|
1 | | -// Source-of-truth mirror of factory-mono-alpha protocol constants. |
2 | | -// Faithful copy of: |
3 | | -// packages/common/src/droid/schemas/constants.ts |
4 | | -// packages/common/src/droid/constants.ts (LOOP_INTERVAL_POLICY) |
5 | | -// Keep shapes/values identical to the private monorepo to avoid protocol drift. |
| 1 | +import { DroidWorkingState } from './enums.js'; |
| 2 | + |
| 3 | +export const FACTORY_CLIENT_HEADER = 'X-Factory-Client'; |
| 4 | +export const FACTORY_CLIENT_VERSION = 'X-Client-Version'; |
| 5 | +export const ACTIVE_ORGANIZATION_HEADER = 'X-Factory-Org-Id'; |
6 | 6 |
|
7 | 7 | /** |
8 | 8 | * Legacy envelope field for old JSON-RPC peers - `factoryApiVersion` must be set to this value. |
|
11 | 11 | */ |
12 | 12 | export const LEGACY_FACTORY_API_VERSION = '1.0.0' as const; |
13 | 13 |
|
14 | | -export const FACTORY_PROTOCOL_VERSION = '1.62.0' as const; |
| 14 | +export const FACTORY_PROTOCOL_VERSION = '1.66.0' as const; |
15 | 15 |
|
16 | 16 | export const JSONRPC_VERSION = '2.0' as const; |
17 | 17 |
|
18 | 18 | /** |
19 | | - * Sentinel ModelID value for the Factory routing model. Faithful copy of |
20 | | - * packages/common/src/llm/constants.ts. |
| 19 | + * Sentinel ModelID value for the Factory routing model. |
21 | 20 | */ |
22 | 21 | export const FACTORY_ROUTER_MODEL_ID = 'factory-router' as const; |
23 | 22 |
|
24 | 23 | /** |
25 | 24 | * Sentinel value used by CompactionModelSchema to mean "use the session's |
26 | | - * current model for compaction". Faithful copy of |
27 | | - * packages/common/src/settings/constants.ts. |
| 25 | + * current model for compaction". |
28 | 26 | */ |
29 | 27 | export const CURRENT_COMPACTION_MODEL = 'current-model'; |
30 | 28 |
|
31 | | -// Faithful copy of packages/common/src/settings/constants.ts router-rule |
32 | | -// guardrails. Used by ManagedSettingsBaseSchema and FactoryRouterRuleSchema. |
33 | | - |
34 | 29 | /** Sized comparably to a trimmed user message in the classifier context budget. */ |
35 | 30 | export const FACTORY_ROUTER_GUIDANCE_MAX_LENGTH = 2000; |
36 | 31 | export const FACTORY_ROUTER_RULES_MAX_COUNT = 20; |
37 | 32 | export const FACTORY_ROUTER_RULE_WHEN_MAX_LENGTH = 300; |
38 | 33 | export const FACTORY_ROUTER_RULE_GUIDANCE_MAX_LENGTH = 600; |
39 | 34 |
|
| 35 | +/** |
| 36 | + * System reminder tag constants used for marking content as hidden from users. |
| 37 | + */ |
| 38 | +export const SYSTEM_REMINDER_START = '<system-reminder>'; |
| 39 | +export const SYSTEM_REMINDER_END = '</system-reminder>'; |
| 40 | + |
| 41 | +/** |
| 42 | + * System notification tag constants used for marking notifications as hidden from users. |
| 43 | + */ |
| 44 | +export const SYSTEM_NOTIFICATION_START = '<system-notification>'; |
| 45 | +export const SYSTEM_NOTIFICATION_END = '</system-notification>'; |
| 46 | + |
| 47 | +export const EXIT_SPEC_MODE_REJECTED_MESSAGE = |
| 48 | + 'Plan not approved - remaining in Spec Mode. Provide feedback to refine the spec.'; |
| 49 | + |
40 | 50 | const seconds = (value: number) => value * 1_000; |
41 | 51 | const minutes = (value: number) => seconds(value * 60); |
42 | 52 | const hours = (value: number) => minutes(value * 60); |
43 | 53 |
|
44 | 54 | export const LOOP_INTERVAL_POLICY = { |
45 | | - minMs: seconds(5), |
| 55 | + minMs: minutes(1), |
46 | 56 | maxMs: hours(24), |
47 | | - displayRange: '5s–24h', |
48 | | - examples: '5s, 5m, 30m, 2h', |
| 57 | + displayRange: '1m–24h', |
| 58 | + examples: '5m, 30m, 2h', |
49 | 59 | } as const; |
| 60 | + |
| 61 | +const DROID_RUNNING_STATES = [ |
| 62 | + DroidWorkingState.Thinking, |
| 63 | + DroidWorkingState.StreamingAssistantMessage, |
| 64 | + DroidWorkingState.ExecutingTool, |
| 65 | + DroidWorkingState.CompactingConversation, |
| 66 | +]; |
| 67 | +export const DROID_IN_PROGRESS_STATES = [ |
| 68 | + ...DROID_RUNNING_STATES, |
| 69 | + DroidWorkingState.WaitingForToolConfirmation, |
| 70 | +]; |
0 commit comments