@pellux/goodvibes-sdk 0.21.18 → 0.21.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/contracts/generated/runtime-event-domains.d.ts +1 -1
- package/dist/_internal/contracts/generated/runtime-event-domains.d.ts.map +1 -1
- package/dist/_internal/contracts/generated/runtime-event-domains.js +1 -0
- package/dist/_internal/daemon/index.d.ts +1 -1
- package/dist/_internal/daemon/index.d.ts.map +1 -1
- package/dist/_internal/daemon/runtime-session-routes.d.ts +12 -1
- package/dist/_internal/daemon/runtime-session-routes.d.ts.map +1 -1
- package/dist/_internal/daemon/runtime-session-routes.js +23 -5
- package/dist/_internal/daemon/system-route-types.d.ts +19 -0
- package/dist/_internal/daemon/system-route-types.d.ts.map +1 -1
- package/dist/_internal/daemon/system-routes.d.ts.map +1 -1
- package/dist/_internal/daemon/system-routes.js +18 -0
- package/dist/_internal/platform/companion/companion-chat-rate-limiter.d.ts +47 -3
- package/dist/_internal/platform/companion/companion-chat-rate-limiter.d.ts.map +1 -1
- package/dist/_internal/platform/companion/companion-chat-rate-limiter.js +49 -6
- package/dist/_internal/platform/companion/companion-chat-routes.d.ts +13 -0
- package/dist/_internal/platform/companion/companion-chat-routes.d.ts.map +1 -1
- package/dist/_internal/platform/companion/companion-chat-routes.js +38 -2
- package/dist/_internal/platform/config/schema-domain-runtime.d.ts.map +1 -1
- package/dist/_internal/platform/config/schema-domain-runtime.js +8 -0
- package/dist/_internal/platform/config/schema-types.d.ts +2 -2
- package/dist/_internal/platform/config/schema-types.d.ts.map +1 -1
- package/dist/_internal/platform/control-plane/method-catalog-events.d.ts.map +1 -1
- package/dist/_internal/platform/control-plane/method-catalog-events.js +1 -0
- package/dist/_internal/platform/control-plane/session-broker.d.ts +12 -0
- package/dist/_internal/platform/control-plane/session-broker.d.ts.map +1 -1
- package/dist/_internal/platform/control-plane/session-broker.js +22 -0
- package/dist/_internal/platform/daemon/cli.js +51 -4
- package/dist/_internal/platform/daemon/facade-composition.d.ts +5 -0
- package/dist/_internal/platform/daemon/facade-composition.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade-composition.js +1 -0
- package/dist/_internal/platform/daemon/facade.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/facade.js +1 -0
- package/dist/_internal/platform/daemon/http/router-route-contexts.d.ts +1 -0
- package/dist/_internal/platform/daemon/http/router-route-contexts.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/http/router-route-contexts.js +5 -0
- package/dist/_internal/platform/daemon/http/router.d.ts +5 -0
- package/dist/_internal/platform/daemon/http/router.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/http/router.js +1 -0
- package/dist/_internal/platform/daemon/http/system-route-types.d.ts +1 -1
- package/dist/_internal/platform/daemon/http/system-route-types.d.ts.map +1 -1
- package/dist/_internal/platform/daemon/types.d.ts +21 -0
- package/dist/_internal/platform/daemon/types.d.ts.map +1 -1
- package/dist/_internal/platform/pairing/companion-token.d.ts +2 -0
- package/dist/_internal/platform/pairing/companion-token.d.ts.map +1 -1
- package/dist/_internal/platform/pairing/companion-token.js +19 -9
- package/dist/_internal/platform/runtime/events/domain-map.d.ts +4 -2
- package/dist/_internal/platform/runtime/events/domain-map.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/events/domain-map.js +1 -0
- package/dist/_internal/platform/runtime/events/index.d.ts +4 -1
- package/dist/_internal/platform/runtime/events/index.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/events/index.js +0 -15
- package/dist/_internal/platform/runtime/events/workspace.d.ts +56 -0
- package/dist/_internal/platform/runtime/events/workspace.d.ts.map +1 -0
- package/dist/_internal/platform/runtime/events/workspace.js +2 -0
- package/dist/_internal/platform/runtime/health/effect-handlers.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/health/effect-handlers.js +12 -1
- package/dist/_internal/platform/runtime/services.d.ts +19 -0
- package/dist/_internal/platform/runtime/services.d.ts.map +1 -1
- package/dist/_internal/platform/runtime/services.js +31 -0
- package/dist/_internal/platform/state/memory-store.d.ts +11 -0
- package/dist/_internal/platform/state/memory-store.d.ts.map +1 -1
- package/dist/_internal/platform/state/memory-store.js +22 -0
- package/dist/_internal/platform/state/project-index.d.ts +13 -3
- package/dist/_internal/platform/state/project-index.d.ts.map +1 -1
- package/dist/_internal/platform/state/project-index.js +31 -0
- package/dist/_internal/platform/tools/state/index.d.ts +23 -0
- package/dist/_internal/platform/tools/state/index.d.ts.map +1 -1
- package/dist/_internal/platform/tools/state/index.js +49 -5
- package/dist/_internal/platform/version.js +1 -1
- package/dist/_internal/platform/workspace/daemon-home.d.ts +70 -0
- package/dist/_internal/platform/workspace/daemon-home.d.ts.map +1 -0
- package/dist/_internal/platform/workspace/daemon-home.js +221 -0
- package/dist/_internal/platform/workspace/workspace-swap-manager.d.ts +60 -0
- package/dist/_internal/platform/workspace/workspace-swap-manager.d.ts.map +1 -0
- package/dist/_internal/platform/workspace/workspace-swap-manager.js +117 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const RUNTIME_EVENT_DOMAINS: readonly ["session", "turn", "providers", "tools", "tasks", "agents", "workflows", "orchestration", "communication", "planner", "permissions", "plugins", "mcp", "transport", "compaction", "ui", "ops", "forensics", "security", "automation", "routes", "control-plane", "deliveries", "watchers", "surfaces", "knowledge"];
|
|
1
|
+
export declare const RUNTIME_EVENT_DOMAINS: readonly ["session", "turn", "providers", "tools", "tasks", "agents", "workflows", "orchestration", "communication", "planner", "permissions", "plugins", "mcp", "transport", "compaction", "ui", "ops", "forensics", "security", "automation", "routes", "control-plane", "deliveries", "watchers", "surfaces", "knowledge", "workspace"];
|
|
2
2
|
export type RuntimeEventDomain = typeof RUNTIME_EVENT_DOMAINS[number];
|
|
3
3
|
export declare function isRuntimeEventDomain(value: string): value is RuntimeEventDomain;
|
|
4
4
|
//# sourceMappingURL=runtime-event-domains.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-event-domains.d.ts","sourceRoot":"","sources":["../../../../src/_internal/contracts/generated/runtime-event-domains.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB
|
|
1
|
+
{"version":3,"file":"runtime-event-domains.d.ts","sourceRoot":"","sources":["../../../../src/_internal/contracts/generated/runtime-event-domains.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,4UA4BxB,CAAC;AACX,MAAM,MAAM,kBAAkB,GAAG,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAEtE,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,kBAAkB,CAE/E"}
|
|
@@ -12,7 +12,7 @@ export { isJsonRecord, missingScopes, readChannelConversationKind, readChannelLi
|
|
|
12
12
|
export type { ChannelConversationKind, ChannelLifecycleAction, JsonRecord, } from './route-helpers.js';
|
|
13
13
|
export type { ChannelDirectoryQuery, ChannelDirectoryScope, ChannelPluginServiceLike, ChannelPolicyServiceLike, ChannelSurface, DaemonChannelRouteContext, SurfaceRegistryLike, } from './channel-route-types.js';
|
|
14
14
|
export type { ChannelAccountRegistryLike, DaemonIntegrationRouteContext, IntegrationHelperServiceLike, MemoryEmbeddingRegistryLike, MemoryRegistryLike, ProviderRuntimeSnapshotServiceLike, RuntimeEventDomain as DaemonRuntimeEventDomain, UserAuthManagerLike, } from './integration-route-types.js';
|
|
15
|
-
export type { ApprovalBrokerLike, AutomationDeliveryGuarantee, AutomationRouteBindingKind, AutomationSessionPolicy, AutomationSurfaceKind, AutomationThreadPolicy, ConfigManagerLike as DaemonSystemConfigManagerLike, DaemonApiClientKind, DaemonSystemRouteContext, PlatformServiceManagerLike, RouteBindingManagerLike, WatcherKind, WatcherRegistryLike, } from './system-route-types.js';
|
|
15
|
+
export type { ApprovalBrokerLike, AutomationDeliveryGuarantee, AutomationRouteBindingKind, AutomationSessionPolicy, AutomationSurfaceKind, AutomationThreadPolicy, ConfigManagerLike as DaemonSystemConfigManagerLike, DaemonApiClientKind, DaemonSystemRouteContext, PlatformServiceManagerLike, RouteBindingManagerLike, WatcherKind, WatcherRegistryLike, WorkspaceSwapManagerLike, } from './system-route-types.js';
|
|
16
16
|
export type { AuthenticatedPrincipalLike, AutomationScheduleDefinition, DaemonKnowledgeRouteContext, KnowledgeGraphqlAccessLike, KnowledgeGraphqlResultLike, KnowledgeGraphqlServiceLike, KnowledgePacketDetail, KnowledgeProjectionTargetKind, KnowledgeServiceLike, } from './knowledge-route-types.js';
|
|
17
17
|
export type { ArtifactKind, DaemonMediaRouteContext, FetchExtractMode, MediaArtifact, MediaProviderRegistryLike, MultimodalAnalysisResult, MultimodalDetail, MultimodalServiceLike, VoiceAudioArtifact, VoiceServiceLike, WebSearchSafeSearch, WebSearchServiceLike, WebSearchTimeRange, WebSearchVerbosity, } from './media-route-types.js';
|
|
18
18
|
export { createDaemonControlRouteHandlers } from './control-routes.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/_internal/daemon/index.ts"],"names":[],"mappings":"AACA,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC1E,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EACL,qBAAqB,EACrB,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM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mB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,kCAAkC,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,YAAY,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,0CAA0C,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EAAE,uCAAuC,EAAE,MAAM,6BAA6B,CAAC;AACtF,OAAO,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AACvE,OAAO,EACL,+BAA+B,EAC/B,uBAAuB,EACvB,sBAAsB,EACtB,yBAAyB,EACzB,wBAAwB,EACxB,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import type { DaemonApiRouteHandlers } from './context.js';
|
|
2
|
-
import type { DaemonRuntimeRouteContext } from './runtime-route-types.js';
|
|
2
|
+
import type { DaemonRuntimeRouteContext, JsonBody } from './runtime-route-types.js';
|
|
3
3
|
export declare function createDaemonRuntimeSessionRouteHandlers(context: DaemonRuntimeRouteContext): Pick<DaemonApiRouteHandlers, 'createSharedSession' | 'postTask' | 'getSharedSession' | 'closeSharedSession' | 'reopenSharedSession' | 'getSharedSessionMessages' | 'getSharedSessionInputs' | 'postSharedSessionMessage' | 'postSharedSessionSteer' | 'postSharedSessionFollowUp' | 'cancelSharedSessionInput' | 'getRuntimeTask' | 'runtimeTaskAction' | 'getTaskStatus' | 'getSharedSessionEvents'>;
|
|
4
|
+
/**
|
|
5
|
+
* Extract the message body from an incoming POST body.
|
|
6
|
+
*
|
|
7
|
+
* F13 normalization: accepts 'body', 'message', and 'text' field names in
|
|
8
|
+
* priority order (newest to legacy). Returns empty string when none are present.
|
|
9
|
+
* The caller must check for an empty result and return 400.
|
|
10
|
+
*
|
|
11
|
+
* @param body - Parsed JSON body from the request.
|
|
12
|
+
* @returns Trimmed message string, or '' if none of the accepted fields are present.
|
|
13
|
+
*/
|
|
14
|
+
export declare function readSharedSessionMessageBody(body: JsonBody): string;
|
|
4
15
|
//# sourceMappingURL=runtime-session-routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-session-routes.d.ts","sourceRoot":"","sources":["../../../src/_internal/daemon/runtime-session-routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EAEV,yBAAyB,
|
|
1
|
+
{"version":3,"file":"runtime-session-routes.d.ts","sourceRoot":"","sources":["../../../src/_internal/daemon/runtime-session-routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAE3D,OAAO,KAAK,EAEV,yBAAyB,EAEzB,QAAQ,EAET,MAAM,0BAA0B,CAAC;AAOlC,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,yBAAyB,GACjC,IAAI,CACL,sBAAsB,EACpB,qBAAqB,GACrB,UAAU,GACV,kBAAkB,GAClB,oBAAoB,GACpB,qBAAqB,GACrB,0BAA0B,GAC1B,wBAAwB,GACxB,0BAA0B,GAC1B,wBAAwB,GACxB,2BAA2B,GAC3B,0BAA0B,GAC1B,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,wBAAwB,CAC3B,CAkBA;AAwVD;;;;;;;;;GASG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,QAAQ,GAAG,MAAM,CAQnE"}
|
|
@@ -191,6 +191,14 @@ async function handleGetSharedSessionInputs(context, sessionId, url) {
|
|
|
191
191
|
inputs: context.sessionBroker.getInputs(sessionId, limit),
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Handle POST /api/sessions/:sessionId/messages.
|
|
196
|
+
*
|
|
197
|
+
* Accepts either `{body}`, `{message}`, or `{text}` in the request payload (F13 normalization,
|
|
198
|
+
* in priority order). If multiple fields are present, `{body}` takes precedence over
|
|
199
|
+
* `{message}`, which takes precedence over `{text}`.
|
|
200
|
+
* Returns 400 when none of the accepted fields are present or all are empty.
|
|
201
|
+
*/
|
|
194
202
|
async function handlePostSharedSessionMessage(context, sessionId, req) {
|
|
195
203
|
const body = await context.parseJsonBody(req);
|
|
196
204
|
if (body instanceof Response)
|
|
@@ -317,11 +325,21 @@ function handleGetRuntimeTask(context, taskId) {
|
|
|
317
325
|
}
|
|
318
326
|
return Response.json({ task });
|
|
319
327
|
}
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
328
|
+
/**
|
|
329
|
+
* Extract the message body from an incoming POST body.
|
|
330
|
+
*
|
|
331
|
+
* F13 normalization: accepts 'body', 'message', and 'text' field names in
|
|
332
|
+
* priority order (newest to legacy). Returns empty string when none are present.
|
|
333
|
+
* The caller must check for an empty result and return 400.
|
|
334
|
+
*
|
|
335
|
+
* @param body - Parsed JSON body from the request.
|
|
336
|
+
* @returns Trimmed message string, or '' if none of the accepted fields are present.
|
|
337
|
+
*/
|
|
338
|
+
export function readSharedSessionMessageBody(body) {
|
|
339
|
+
return typeof body.body === 'string'
|
|
340
|
+
? body.body.trim()
|
|
341
|
+
: typeof body.message === 'string'
|
|
342
|
+
? body.message.trim()
|
|
325
343
|
: typeof body.text === 'string'
|
|
326
344
|
? body.text.trim()
|
|
327
345
|
: '';
|
|
@@ -102,6 +102,23 @@ export interface ApprovalBrokerLike {
|
|
|
102
102
|
readonly note?: string;
|
|
103
103
|
}): Promise<unknown | null>;
|
|
104
104
|
}
|
|
105
|
+
export interface WorkspaceSwapManagerLike {
|
|
106
|
+
getCurrentWorkingDir(): string;
|
|
107
|
+
requestSwap(newWorkingDir: string): Promise<{
|
|
108
|
+
ok: true;
|
|
109
|
+
previous: string;
|
|
110
|
+
current: string;
|
|
111
|
+
} | {
|
|
112
|
+
ok: false;
|
|
113
|
+
code: 'WORKSPACE_BUSY';
|
|
114
|
+
reason: string;
|
|
115
|
+
retryAfter: number;
|
|
116
|
+
} | {
|
|
117
|
+
ok: false;
|
|
118
|
+
code: 'INVALID_PATH';
|
|
119
|
+
reason: string;
|
|
120
|
+
}>;
|
|
121
|
+
}
|
|
105
122
|
export interface DaemonSystemRouteContext {
|
|
106
123
|
readonly approvalBroker: ApprovalBrokerLike;
|
|
107
124
|
readonly configManager: ConfigManagerLike;
|
|
@@ -119,6 +136,8 @@ export interface DaemonSystemRouteContext {
|
|
|
119
136
|
roles: readonly string[];
|
|
120
137
|
} | null;
|
|
121
138
|
readonly routeBindings: RouteBindingManagerLike;
|
|
139
|
+
/** Manages runtime.workingDir swaps. Null when workspace swapping is not available. */
|
|
140
|
+
readonly swapManager: WorkspaceSwapManagerLike | null;
|
|
122
141
|
readonly watcherRegistry: WatcherRegistryLike;
|
|
123
142
|
}
|
|
124
143
|
//# sourceMappingURL=system-route-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-route-types.d.ts","sourceRoot":"","sources":["../../../src/_internal/daemon/system-route-types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,OAAO,GACP,SAAS,GACT,MAAM,GACN,SAAS,G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gB,GAChB,WAAW,GACX,YAAY,CACf,
|
|
1
|
+
{"version":3,"file":"system-routes.d.ts","sourceRoot":"","sources":["../../../src/_internal/daemon/system-routes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAG3D,OAAO,KAAK,EAMV,wBAAwB,EAEzB,MAAM,yBAAyB,CAAC;AAEjC,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,OAAO,GACf,IAAI,CACL,sBAAsB,EACpB,aAAa,GACb,aAAa,GACb,cAAc,GACd,eAAe,GACf,eAAe,GACf,kBAAkB,GAClB,gBAAgB,GAChB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,mBAAmB,GACnB,oBAAoB,GACpB,cAAc,GACd,gBAAgB,GAChB,WAAW,GACX,YAAY,CACf,CA6KA"}
|
|
@@ -157,6 +157,24 @@ export function createDaemonSystemRouteHandlers(context, request) {
|
|
|
157
157
|
if (!key || typeof key !== 'string') {
|
|
158
158
|
return Response.json({ error: 'Missing or invalid key' }, { status: 400 });
|
|
159
159
|
}
|
|
160
|
+
// Special-case: runtime.workingDir is handled by the workspace swap manager.
|
|
161
|
+
if (key === 'runtime.workingDir') {
|
|
162
|
+
if (!context.swapManager) {
|
|
163
|
+
return Response.json({ error: 'Workspace swapping is not available in this daemon configuration.' }, { status: 400 });
|
|
164
|
+
}
|
|
165
|
+
if (typeof value !== 'string' || !value.trim()) {
|
|
166
|
+
return Response.json({ error: 'runtime.workingDir value must be a non-empty string path.', code: 'INVALID_PATH' }, { status: 400 });
|
|
167
|
+
}
|
|
168
|
+
const result = await context.swapManager.requestSwap(value);
|
|
169
|
+
if (result.ok) {
|
|
170
|
+
return Response.json({ success: true, key, value: result.current, previous: result.previous });
|
|
171
|
+
}
|
|
172
|
+
if (result.code === 'WORKSPACE_BUSY') {
|
|
173
|
+
return Response.json({ error: result.reason, code: 'WORKSPACE_BUSY', retryAfter: result.retryAfter }, { status: 409 });
|
|
174
|
+
}
|
|
175
|
+
// INVALID_PATH
|
|
176
|
+
return Response.json({ error: result.reason, code: 'INVALID_PATH' }, { status: 400 });
|
|
177
|
+
}
|
|
160
178
|
if (!context.isValidConfigKey(key)) {
|
|
161
179
|
return Response.json({ error: 'Invalid config key' }, { status: 400 });
|
|
162
180
|
}
|
|
@@ -11,25 +11,69 @@
|
|
|
11
11
|
* including an actionable message following the Wave 6 three-part standard:
|
|
12
12
|
* [what happened] · [why] · [what to do]
|
|
13
13
|
*/
|
|
14
|
+
import type { ConfigManager } from '../config/manager.js';
|
|
14
15
|
export declare const DEFAULT_MESSAGES_PER_MINUTE_PER_CLIENT = 30;
|
|
15
16
|
export declare const DEFAULT_MESSAGES_PER_MINUTE_PER_SESSION = 10;
|
|
17
|
+
/**
|
|
18
|
+
* Read the per-session threshold override from the environment.
|
|
19
|
+
* GOODVIBES_CHAT_LIMITER_THRESHOLD=<int> overrides the per-session limit.
|
|
20
|
+
* Returns undefined when unset or not a positive integer.
|
|
21
|
+
*/
|
|
22
|
+
export declare function readThresholdFromEnv(env?: NodeJS.ProcessEnv): number | undefined;
|
|
16
23
|
export interface CompanionChatRateLimiterOptions {
|
|
17
24
|
/** Max messages per 60-second window per clientId. Default: 30. */
|
|
18
25
|
readonly perClientLimit?: number;
|
|
19
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* Max messages per 60-second window per sessionId. Default: 10.
|
|
28
|
+
*
|
|
29
|
+
* **Startup-time env var**: `GOODVIBES_CHAT_LIMITER_THRESHOLD` is read **once** at
|
|
30
|
+
* constructor time and used as a fallback when this option is not provided. It
|
|
31
|
+
* cannot be changed at runtime without a daemon restart.
|
|
32
|
+
*
|
|
33
|
+
* **Runtime config key**: `runtime.companionChatLimiter.perSessionLimit` is read
|
|
34
|
+
* on every `check()` call (when a `configManager` is provided) and takes
|
|
35
|
+
* precedence over the env-var-captured fallback.
|
|
36
|
+
*/
|
|
20
37
|
readonly perSessionLimit?: number;
|
|
21
38
|
/** Window size in ms. Default: 60000 (1 minute). */
|
|
22
39
|
readonly windowMs?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Optional ConfigManager for runtime lookup of
|
|
42
|
+
* `runtime.companionChatLimiter.perSessionLimit`.
|
|
43
|
+
* When provided, `check()` reads this key on each call and uses it as the
|
|
44
|
+
* effective per-session limit (falling back to the constructor-time value
|
|
45
|
+
* when the config key is absent or not a positive integer).
|
|
46
|
+
*/
|
|
47
|
+
readonly configManager?: Pick<ConfigManager, 'get'> | null;
|
|
23
48
|
}
|
|
24
49
|
export declare class CompanionChatRateLimiter {
|
|
25
50
|
private readonly perClientLimit;
|
|
26
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Base per-session limit: resolved at constructor time from explicit option >
|
|
53
|
+
* env var > compile-time default. May be overridden per-call by the config
|
|
54
|
+
* manager when `configManager` is provided.
|
|
55
|
+
*
|
|
56
|
+
* **Note**: `GOODVIBES_CHAT_LIMITER_THRESHOLD` is read **once** at constructor
|
|
57
|
+
* time and cached here. Changing the env var after daemon startup has no effect
|
|
58
|
+
* without a daemon restart. Use the `runtime.companionChatLimiter.perSessionLimit`
|
|
59
|
+
* config key for live changes.
|
|
60
|
+
*/
|
|
61
|
+
private readonly perSessionLimitBase;
|
|
27
62
|
private readonly windowMs;
|
|
63
|
+
private readonly configManager;
|
|
28
64
|
/** clientId → bucket */
|
|
29
65
|
private readonly clientBuckets;
|
|
30
66
|
/** sessionId → bucket */
|
|
31
67
|
private readonly sessionBuckets;
|
|
32
|
-
constructor(options?: CompanionChatRateLimiterOptions);
|
|
68
|
+
constructor(options?: CompanionChatRateLimiterOptions, env?: NodeJS.ProcessEnv);
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the effective per-session limit for the current call.
|
|
71
|
+
*
|
|
72
|
+
* Runtime config key `runtime.companionChatLimiter.perSessionLimit` takes
|
|
73
|
+
* precedence over the constructor-time baseline when it resolves to a
|
|
74
|
+
* positive integer.
|
|
75
|
+
*/
|
|
76
|
+
private resolvePerSessionLimit;
|
|
33
77
|
/**
|
|
34
78
|
* Check and record a message attempt.
|
|
35
79
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-chat-rate-limiter.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/companion/companion-chat-rate-limiter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;
|
|
1
|
+
{"version":3,"file":"companion-chat-rate-limiter.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/companion/companion-chat-rate-limiter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAM1D,eAAO,MAAM,sCAAsC,KAAK,CAAC;AACzD,eAAO,MAAM,uCAAuC,KAAK,CAAC;AAE1D;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAK7F;AAeD,MAAM,WAAW,+BAA+B;IAC9C,mEAAmE;IACnE,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,oDAAoD;IACpD,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;CAC5D;AAED,qBAAa,wBAAwB;IACnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC;;;;;;;;;OASG;IACH,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAS;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAoC;IAElE,wBAAwB;IACxB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA6B;IAC3D,yBAAyB;IACzB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAA6B;gBAEhD,OAAO,GAAE,+BAAoC,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB;IAS/F;;;;;;OAMG;IACH,OAAO,CAAC,sBAAsB;IAU9B;;;;;;;;OAQG;IACH,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAkDhD,+DAA+D;IAC/D,OAAO,IAAI,IAAI;IAYf,OAAO,CAAC,WAAW;CAcpB"}
|
|
@@ -17,18 +17,60 @@ import { GoodVibesSdkError } from '../../errors/index.js';
|
|
|
17
17
|
// ---------------------------------------------------------------------------
|
|
18
18
|
export const DEFAULT_MESSAGES_PER_MINUTE_PER_CLIENT = 30;
|
|
19
19
|
export const DEFAULT_MESSAGES_PER_MINUTE_PER_SESSION = 10;
|
|
20
|
+
/**
|
|
21
|
+
* Read the per-session threshold override from the environment.
|
|
22
|
+
* GOODVIBES_CHAT_LIMITER_THRESHOLD=<int> overrides the per-session limit.
|
|
23
|
+
* Returns undefined when unset or not a positive integer.
|
|
24
|
+
*/
|
|
25
|
+
export function readThresholdFromEnv(env = process.env) {
|
|
26
|
+
const raw = env['GOODVIBES_CHAT_LIMITER_THRESHOLD'];
|
|
27
|
+
if (!raw)
|
|
28
|
+
return undefined;
|
|
29
|
+
const parsed = Number.parseInt(raw, 10);
|
|
30
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : undefined;
|
|
31
|
+
}
|
|
20
32
|
export class CompanionChatRateLimiter {
|
|
21
33
|
perClientLimit;
|
|
22
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Base per-session limit: resolved at constructor time from explicit option >
|
|
36
|
+
* env var > compile-time default. May be overridden per-call by the config
|
|
37
|
+
* manager when `configManager` is provided.
|
|
38
|
+
*
|
|
39
|
+
* **Note**: `GOODVIBES_CHAT_LIMITER_THRESHOLD` is read **once** at constructor
|
|
40
|
+
* time and cached here. Changing the env var after daemon startup has no effect
|
|
41
|
+
* without a daemon restart. Use the `runtime.companionChatLimiter.perSessionLimit`
|
|
42
|
+
* config key for live changes.
|
|
43
|
+
*/
|
|
44
|
+
perSessionLimitBase;
|
|
23
45
|
windowMs;
|
|
46
|
+
configManager;
|
|
24
47
|
/** clientId → bucket */
|
|
25
48
|
clientBuckets = new Map();
|
|
26
49
|
/** sessionId → bucket */
|
|
27
50
|
sessionBuckets = new Map();
|
|
28
|
-
constructor(options = {}) {
|
|
51
|
+
constructor(options = {}, env = process.env) {
|
|
52
|
+
// Precedence: explicit config option > env var > compile-time default
|
|
53
|
+
const envThreshold = readThresholdFromEnv(env);
|
|
29
54
|
this.perClientLimit = options.perClientLimit ?? DEFAULT_MESSAGES_PER_MINUTE_PER_CLIENT;
|
|
30
|
-
this.
|
|
55
|
+
this.perSessionLimitBase = options.perSessionLimit ?? envThreshold ?? DEFAULT_MESSAGES_PER_MINUTE_PER_SESSION;
|
|
31
56
|
this.windowMs = options.windowMs ?? 60_000;
|
|
57
|
+
this.configManager = options.configManager ?? null;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Resolve the effective per-session limit for the current call.
|
|
61
|
+
*
|
|
62
|
+
* Runtime config key `runtime.companionChatLimiter.perSessionLimit` takes
|
|
63
|
+
* precedence over the constructor-time baseline when it resolves to a
|
|
64
|
+
* positive integer.
|
|
65
|
+
*/
|
|
66
|
+
resolvePerSessionLimit() {
|
|
67
|
+
if (this.configManager) {
|
|
68
|
+
const raw = this.configManager.get('runtime.companionChatLimiter.perSessionLimit');
|
|
69
|
+
if (typeof raw === 'number' && Number.isInteger(raw) && raw > 0) {
|
|
70
|
+
return raw;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return this.perSessionLimitBase;
|
|
32
74
|
}
|
|
33
75
|
/**
|
|
34
76
|
* Check and record a message attempt.
|
|
@@ -43,12 +85,13 @@ export class CompanionChatRateLimiter {
|
|
|
43
85
|
const now = Date.now();
|
|
44
86
|
const cutoff = now - this.windowMs;
|
|
45
87
|
// --- Per-session check ---
|
|
88
|
+
const perSessionLimit = this.resolvePerSessionLimit();
|
|
46
89
|
const sessionBucket = this.getOrCreate(this.sessionBuckets, sessionId, cutoff);
|
|
47
|
-
if (sessionBucket.timestamps.length >=
|
|
90
|
+
if (sessionBucket.timestamps.length >= perSessionLimit) {
|
|
48
91
|
const oldestTs = sessionBucket.timestamps[0];
|
|
49
92
|
const retryAfterMs = this.windowMs - (now - oldestTs) + 1;
|
|
50
|
-
throw new GoodVibesSdkError(`Companion chat session rate limit exceeded: this session has sent ${
|
|
51
|
-
`Each session is limited to ${
|
|
93
|
+
throw new GoodVibesSdkError(`Companion chat session rate limit exceeded: this session has sent ${perSessionLimit} messages in the last minute. ` +
|
|
94
|
+
`Each session is limited to ${perSessionLimit} messages per minute to prevent runaway conversations. ` +
|
|
52
95
|
`Wait ${Math.ceil(retryAfterMs / 1000)} seconds before sending the next message, or create a new session.`, {
|
|
53
96
|
category: 'rate_limit',
|
|
54
97
|
source: 'runtime',
|
|
@@ -20,4 +20,17 @@ import type { CompanionChatRouteContext } from './companion-chat-route-types.js'
|
|
|
20
20
|
* does not match, so the caller can fall through to other route groups.
|
|
21
21
|
*/
|
|
22
22
|
export declare function dispatchCompanionChatRoutes(req: Request, context: CompanionChatRouteContext): Promise<Response | null>;
|
|
23
|
+
/**
|
|
24
|
+
* Read the message content from an incoming POST body.
|
|
25
|
+
*
|
|
26
|
+
* F13 normalization: accepts both 'body' and 'content' field names;
|
|
27
|
+
* prefers 'body' when both are present (shared-session canonical field);
|
|
28
|
+
* falls back to 'content' for companion-chat clients that send content.
|
|
29
|
+
* Returns empty string when neither field is present — the caller must
|
|
30
|
+
* check for empty and return 400 INVALID_INPUT.
|
|
31
|
+
*
|
|
32
|
+
* @param body - Parsed JSON body from the request.
|
|
33
|
+
* @returns Raw (un-trimmed) string value, or '' if neither field is present.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readCompanionChatMessageBody(body: Record<string, unknown>): string;
|
|
23
36
|
//# sourceMappingURL=companion-chat-routes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"companion-chat-routes.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/companion/companion-chat-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAMjF;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAsC1B"}
|
|
1
|
+
{"version":3,"file":"companion-chat-routes.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/companion/companion-chat-routes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAMH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAMjF;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE,yBAAyB,GACjC,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAsC1B;AA+DD;;;;;;;;;;;GAWG;AACH,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAMlF"}
|
|
@@ -90,21 +90,57 @@ async function handleDeleteSession(sessionId, context) {
|
|
|
90
90
|
return Response.json({ sessionId: session.id, status: session.status });
|
|
91
91
|
}
|
|
92
92
|
// ---------------------------------------------------------------------------
|
|
93
|
+
// F13 field normalization helper
|
|
94
|
+
// ---------------------------------------------------------------------------
|
|
95
|
+
/**
|
|
96
|
+
* Read the message content from an incoming POST body.
|
|
97
|
+
*
|
|
98
|
+
* F13 normalization: accepts both 'body' and 'content' field names;
|
|
99
|
+
* prefers 'body' when both are present (shared-session canonical field);
|
|
100
|
+
* falls back to 'content' for companion-chat clients that send content.
|
|
101
|
+
* Returns empty string when neither field is present — the caller must
|
|
102
|
+
* check for empty and return 400 INVALID_INPUT.
|
|
103
|
+
*
|
|
104
|
+
* @param body - Parsed JSON body from the request.
|
|
105
|
+
* @returns Raw (un-trimmed) string value, or '' if neither field is present.
|
|
106
|
+
*/
|
|
107
|
+
export function readCompanionChatMessageBody(body) {
|
|
108
|
+
return typeof body['body'] === 'string'
|
|
109
|
+
? body['body']
|
|
110
|
+
: typeof body['content'] === 'string'
|
|
111
|
+
? body['content']
|
|
112
|
+
: '';
|
|
113
|
+
}
|
|
114
|
+
// ---------------------------------------------------------------------------
|
|
93
115
|
// POST /api/companion/chat/sessions/:sessionId/messages
|
|
94
116
|
// ---------------------------------------------------------------------------
|
|
117
|
+
/**
|
|
118
|
+
* Handle POST /api/companion/chat/sessions/:sessionId/messages.
|
|
119
|
+
*
|
|
120
|
+
* Accepts either `{body}` or `{content}` in the request payload.
|
|
121
|
+
* If both are present, `{body}` takes precedence (shared-session canonical field).
|
|
122
|
+
* Returns 400 INVALID_INPUT when neither field is present or both are empty.
|
|
123
|
+
*/
|
|
95
124
|
async function handlePostMessage(req, sessionId, context) {
|
|
96
125
|
const bodyOrResponse = await context.parseJsonBody(req);
|
|
97
126
|
if (bodyOrResponse instanceof Response)
|
|
98
127
|
return bodyOrResponse;
|
|
99
128
|
const body = bodyOrResponse;
|
|
129
|
+
// F13: accept both 'body' and 'content' field names; prefer 'body' if both are present
|
|
130
|
+
// (shared-session canonical uses 'body'; companion-chat clients may send 'content').
|
|
131
|
+
const rawContent = typeof body['body'] === 'string'
|
|
132
|
+
? body['body']
|
|
133
|
+
: typeof body['content'] === 'string'
|
|
134
|
+
? body['content']
|
|
135
|
+
: '';
|
|
100
136
|
const input = {
|
|
101
|
-
content:
|
|
137
|
+
content: rawContent,
|
|
102
138
|
metadata: typeof body['metadata'] === 'object' && body['metadata'] !== null
|
|
103
139
|
? body['metadata']
|
|
104
140
|
: undefined,
|
|
105
141
|
};
|
|
106
142
|
if (!input.content.trim()) {
|
|
107
|
-
return Response.json({ error: 'content is required and must be a non-empty string', code: 'INVALID_INPUT' }, { status: 400 });
|
|
143
|
+
return Response.json({ error: 'content or body is required and must be a non-empty string', code: 'INVALID_INPUT' }, { status: 400 });
|
|
108
144
|
}
|
|
109
145
|
try {
|
|
110
146
|
const messageId = await context.chatManager.postMessage(sessionId, input.content);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema-domain-runtime.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/config/schema-domain-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEjC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,uBAAuB,EAyMjE,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"schema-domain-runtime.d.ts","sourceRoot":"","sources":["../../../../src/_internal/platform/config/schema-domain-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqEjC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,uBAAuB,EAyMjE,CAAC;AAEF,eAAO,MAAM,8BAA8B,EAAE,uBAAuB,EAyGnE,CAAC"}
|
|
@@ -366,4 +366,12 @@ export const runtimeSecondaryConfigSettings = [
|
|
|
366
366
|
default: false,
|
|
367
367
|
description: 'Allow explicit admin-approved remote fetches from private, localhost, or metadata hosts for artifacts and ingest flows',
|
|
368
368
|
},
|
|
369
|
+
{
|
|
370
|
+
key: 'runtime.companionChatLimiter.perSessionLimit',
|
|
371
|
+
type: 'number',
|
|
372
|
+
default: 10,
|
|
373
|
+
description: 'Max companion chat messages per 60-second window per session. ' +
|
|
374
|
+
'Overrides the GOODVIBES_CHAT_LIMITER_THRESHOLD env var (env is read once at daemon startup; ' +
|
|
375
|
+
'this config key is read on each check() call and takes precedence when set to a positive integer).',
|
|
376
|
+
},
|
|
369
377
|
];
|
|
@@ -338,7 +338,7 @@ export interface ConfigSetting {
|
|
|
338
338
|
validate?: (value: unknown) => boolean;
|
|
339
339
|
}
|
|
340
340
|
/** Dot-path config keys for all settings. */
|
|
341
|
-
export type ConfigKey = 'display.stream' | 'display.lineNumbers' | 'display.collapseThreshold' | 'display.theme' | 'display.showThinking' | 'display.showReasoningSummary' | 'display.showTokenSpeed' | 'display.showToolPreview' | 'provider.reasoningEffort' | 'provider.model' | 'provider.provider' | 'provider.embeddingProvider' | 'provider.systemPromptFile' | 'behavior.autoApprove' | 'behavior.autoCompactThreshold' | 'behavior.staleContextWarnings' | 'behavior.saveHistory' | 'behavior.notifyOnComplete' | 'behavior.suggestAlternativeOnProviderFail' | 'behavior.hitlMode' | 'behavior.returnContextMode' | 'behavior.guidanceMode' | 'storage.secretPolicy' | 'permissions.mode' | 'permissions.tools.read' | 'permissions.tools.write' | 'permissions.tools.edit' | 'permissions.tools.exec' | 'permissions.tools.find' | 'permissions.tools.fetch' | 'permissions.tools.analyze' | 'permissions.tools.inspect' | 'permissions.tools.agent' | 'permissions.tools.state' | 'permissions.tools.workflow' | 'permissions.tools.registry' | 'permissions.tools.delegate' | 'permissions.tools.mcp' | 'orchestration.recursionEnabled' | 'orchestration.maxActiveAgents' | 'orchestration.maxDepth' | 'sandbox.replIsolation' | 'sandbox.mcpIsolation' | 'sandbox.windowsMode' | 'sandbox.vmBackend' | 'sandbox.qemuBinary' | 'sandbox.qemuImagePath' | 'sandbox.qemuExecWrapper' | 'sandbox.qemuGuestHost' | 'sandbox.qemuGuestPort' | 'sandbox.qemuGuestUser' | 'sandbox.qemuWorkspacePath' | 'sandbox.qemuSessionMode' | 'ui.voiceEnabled' | 'ui.systemMessages' | 'ui.operationalMessages' | 'ui.wrfcMessages' | 'release.channel' | 'danger.daemon' | 'danger.httpListener' | 'tools.llmEnabled' | 'tools.llmProvider' | 'tools.llmModel' | 'tools.autoHeal' | 'tools.defaultTokenBudget' | 'tools.hooksFile' | 'wrfc.scoreThreshold' | 'wrfc.maxFixAttempts' | 'wrfc.autoCommit' | 'cache.enabled' | 'cache.stableTtl' | 'cache.monitorHitRate' | 'cache.hitRateWarningThreshold' | 'helper.enabled' | 'helper.globalProvider' | 'helper.globalModel' | 'automation.enabled' | 'automation.maxConcurrentRuns' | 'automation.runHistoryLimit' | 'automation.defaultTimeoutMs' | 'automation.catchUpWindowMinutes' | 'automation.failureCooldownMs' | 'automation.deleteAfterRun' | 'controlPlane.enabled' | 'controlPlane.hostMode' | 'controlPlane.host' | 'controlPlane.port' | 'controlPlane.baseUrl' | 'controlPlane.streamMode' | 'controlPlane.allowRemote' | 'controlPlane.trustProxy' | 'controlPlane.tls.mode' | 'controlPlane.tls.certFile' | 'controlPlane.tls.keyFile' | 'httpListener.hostMode' | 'httpListener.host' | 'httpListener.port' | 'httpListener.trustProxy' | 'httpListener.tls.mode' | 'httpListener.tls.certFile' | 'httpListener.tls.keyFile' | 'web.enabled' | 'web.hostMode' | 'web.host' | 'web.port' | 'web.publicBaseUrl' | 'web.staticAssetsDir' | 'surfaces.slack.enabled' | 'surfaces.slack.signingSecret' | 'surfaces.slack.botToken' | 'surfaces.slack.appToken' | 'surfaces.slack.defaultChannel' | 'surfaces.slack.workspaceId' | 'surfaces.discord.enabled' | 'surfaces.discord.publicKey' | 'surfaces.discord.botToken' | 'surfaces.discord.applicationId' | 'surfaces.discord.defaultChannelId' | 'surfaces.discord.guildId' | 'surfaces.ntfy.enabled' | 'surfaces.ntfy.baseUrl' | 'surfaces.ntfy.topic' | 'surfaces.ntfy.token' | 'surfaces.ntfy.defaultPriority' | 'surfaces.webhook.enabled' | 'surfaces.webhook.defaultTarget' | 'surfaces.webhook.timeoutMs' | 'surfaces.webhook.secret' | 'surfaces.telegram.enabled' | 'surfaces.telegram.botToken' | 'surfaces.telegram.webhookSecret' | 'surfaces.telegram.defaultChatId' | 'surfaces.telegram.botUsername' | 'surfaces.telegram.mode' | 'surfaces.googleChat.enabled' | 'surfaces.googleChat.webhookUrl' | 'surfaces.googleChat.verificationToken' | 'surfaces.googleChat.appId' | 'surfaces.googleChat.spaceId' | 'surfaces.signal.enabled' | 'surfaces.signal.bridgeUrl' | 'surfaces.signal.account' | 'surfaces.signal.token' | 'surfaces.signal.defaultRecipient' | 'surfaces.whatsapp.enabled' | 'surfaces.whatsapp.provider' | 'surfaces.whatsapp.accessToken' | 'surfaces.whatsapp.verifyToken' | 'surfaces.whatsapp.signingSecret' | 'surfaces.whatsapp.phoneNumberId' | 'surfaces.whatsapp.businessAccountId' | 'surfaces.whatsapp.defaultRecipient' | 'surfaces.imessage.enabled' | 'surfaces.imessage.bridgeUrl' | 'surfaces.imessage.account' | 'surfaces.imessage.token' | 'surfaces.imessage.defaultChatId' | 'surfaces.msteams.enabled' | 'surfaces.msteams.appId' | 'surfaces.msteams.appPassword' | 'surfaces.msteams.tenantId' | 'surfaces.msteams.serviceUrl' | 'surfaces.msteams.botId' | 'surfaces.msteams.defaultConversationId' | 'surfaces.msteams.defaultChannelId' | 'surfaces.bluebubbles.enabled' | 'surfaces.bluebubbles.serverUrl' | 'surfaces.bluebubbles.password' | 'surfaces.bluebubbles.account' | 'surfaces.bluebubbles.defaultChatGuid' | 'surfaces.mattermost.enabled' | 'surfaces.mattermost.baseUrl' | 'surfaces.mattermost.botToken' | 'surfaces.mattermost.teamId' | 'surfaces.mattermost.defaultChannelId' | 'surfaces.matrix.enabled' | 'surfaces.matrix.homeserverUrl' | 'surfaces.matrix.accessToken' | 'surfaces.matrix.userId' | 'surfaces.matrix.defaultRoomId' | 'watchers.enabled' | 'watchers.pollIntervalMs' | 'watchers.heartbeatIntervalMs' | 'watchers.recoveryWindowMinutes' | 'service.enabled' | 'service.autostart' | 'service.restartOnFailure' | 'service.platform' | 'service.serviceName' | 'service.logPath' | 'network.outboundTls.mode' | 'network.outboundTls.customCaFile' | 'network.outboundTls.customCaDir' | 'network.outboundTls.allowInsecureLocalhost' | 'network.remoteFetch.allowPrivateHosts';
|
|
341
|
+
export type ConfigKey = 'display.stream' | 'display.lineNumbers' | 'display.collapseThreshold' | 'display.theme' | 'display.showThinking' | 'display.showReasoningSummary' | 'display.showTokenSpeed' | 'display.showToolPreview' | 'provider.reasoningEffort' | 'provider.model' | 'provider.provider' | 'provider.embeddingProvider' | 'provider.systemPromptFile' | 'behavior.autoApprove' | 'behavior.autoCompactThreshold' | 'behavior.staleContextWarnings' | 'behavior.saveHistory' | 'behavior.notifyOnComplete' | 'behavior.suggestAlternativeOnProviderFail' | 'behavior.hitlMode' | 'behavior.returnContextMode' | 'behavior.guidanceMode' | 'storage.secretPolicy' | 'permissions.mode' | 'permissions.tools.read' | 'permissions.tools.write' | 'permissions.tools.edit' | 'permissions.tools.exec' | 'permissions.tools.find' | 'permissions.tools.fetch' | 'permissions.tools.analyze' | 'permissions.tools.inspect' | 'permissions.tools.agent' | 'permissions.tools.state' | 'permissions.tools.workflow' | 'permissions.tools.registry' | 'permissions.tools.delegate' | 'permissions.tools.mcp' | 'orchestration.recursionEnabled' | 'orchestration.maxActiveAgents' | 'orchestration.maxDepth' | 'sandbox.replIsolation' | 'sandbox.mcpIsolation' | 'sandbox.windowsMode' | 'sandbox.vmBackend' | 'sandbox.qemuBinary' | 'sandbox.qemuImagePath' | 'sandbox.qemuExecWrapper' | 'sandbox.qemuGuestHost' | 'sandbox.qemuGuestPort' | 'sandbox.qemuGuestUser' | 'sandbox.qemuWorkspacePath' | 'sandbox.qemuSessionMode' | 'ui.voiceEnabled' | 'ui.systemMessages' | 'ui.operationalMessages' | 'ui.wrfcMessages' | 'release.channel' | 'danger.daemon' | 'danger.httpListener' | 'tools.llmEnabled' | 'tools.llmProvider' | 'tools.llmModel' | 'tools.autoHeal' | 'tools.defaultTokenBudget' | 'tools.hooksFile' | 'wrfc.scoreThreshold' | 'wrfc.maxFixAttempts' | 'wrfc.autoCommit' | 'cache.enabled' | 'cache.stableTtl' | 'cache.monitorHitRate' | 'cache.hitRateWarningThreshold' | 'helper.enabled' | 'helper.globalProvider' | 'helper.globalModel' | 'automation.enabled' | 'automation.maxConcurrentRuns' | 'automation.runHistoryLimit' | 'automation.defaultTimeoutMs' | 'automation.catchUpWindowMinutes' | 'automation.failureCooldownMs' | 'automation.deleteAfterRun' | 'controlPlane.enabled' | 'controlPlane.hostMode' | 'controlPlane.host' | 'controlPlane.port' | 'controlPlane.baseUrl' | 'controlPlane.streamMode' | 'controlPlane.allowRemote' | 'controlPlane.trustProxy' | 'controlPlane.tls.mode' | 'controlPlane.tls.certFile' | 'controlPlane.tls.keyFile' | 'httpListener.hostMode' | 'httpListener.host' | 'httpListener.port' | 'httpListener.trustProxy' | 'httpListener.tls.mode' | 'httpListener.tls.certFile' | 'httpListener.tls.keyFile' | 'web.enabled' | 'web.hostMode' | 'web.host' | 'web.port' | 'web.publicBaseUrl' | 'web.staticAssetsDir' | 'surfaces.slack.enabled' | 'surfaces.slack.signingSecret' | 'surfaces.slack.botToken' | 'surfaces.slack.appToken' | 'surfaces.slack.defaultChannel' | 'surfaces.slack.workspaceId' | 'surfaces.discord.enabled' | 'surfaces.discord.publicKey' | 'surfaces.discord.botToken' | 'surfaces.discord.applicationId' | 'surfaces.discord.defaultChannelId' | 'surfaces.discord.guildId' | 'surfaces.ntfy.enabled' | 'surfaces.ntfy.baseUrl' | 'surfaces.ntfy.topic' | 'surfaces.ntfy.token' | 'surfaces.ntfy.defaultPriority' | 'surfaces.webhook.enabled' | 'surfaces.webhook.defaultTarget' | 'surfaces.webhook.timeoutMs' | 'surfaces.webhook.secret' | 'surfaces.telegram.enabled' | 'surfaces.telegram.botToken' | 'surfaces.telegram.webhookSecret' | 'surfaces.telegram.defaultChatId' | 'surfaces.telegram.botUsername' | 'surfaces.telegram.mode' | 'surfaces.googleChat.enabled' | 'surfaces.googleChat.webhookUrl' | 'surfaces.googleChat.verificationToken' | 'surfaces.googleChat.appId' | 'surfaces.googleChat.spaceId' | 'surfaces.signal.enabled' | 'surfaces.signal.bridgeUrl' | 'surfaces.signal.account' | 'surfaces.signal.token' | 'surfaces.signal.defaultRecipient' | 'surfaces.whatsapp.enabled' | 'surfaces.whatsapp.provider' | 'surfaces.whatsapp.accessToken' | 'surfaces.whatsapp.verifyToken' | 'surfaces.whatsapp.signingSecret' | 'surfaces.whatsapp.phoneNumberId' | 'surfaces.whatsapp.businessAccountId' | 'surfaces.whatsapp.defaultRecipient' | 'surfaces.imessage.enabled' | 'surfaces.imessage.bridgeUrl' | 'surfaces.imessage.account' | 'surfaces.imessage.token' | 'surfaces.imessage.defaultChatId' | 'surfaces.msteams.enabled' | 'surfaces.msteams.appId' | 'surfaces.msteams.appPassword' | 'surfaces.msteams.tenantId' | 'surfaces.msteams.serviceUrl' | 'surfaces.msteams.botId' | 'surfaces.msteams.defaultConversationId' | 'surfaces.msteams.defaultChannelId' | 'surfaces.bluebubbles.enabled' | 'surfaces.bluebubbles.serverUrl' | 'surfaces.bluebubbles.password' | 'surfaces.bluebubbles.account' | 'surfaces.bluebubbles.defaultChatGuid' | 'surfaces.mattermost.enabled' | 'surfaces.mattermost.baseUrl' | 'surfaces.mattermost.botToken' | 'surfaces.mattermost.teamId' | 'surfaces.mattermost.defaultChannelId' | 'surfaces.matrix.enabled' | 'surfaces.matrix.homeserverUrl' | 'surfaces.matrix.accessToken' | 'surfaces.matrix.userId' | 'surfaces.matrix.defaultRoomId' | 'watchers.enabled' | 'watchers.pollIntervalMs' | 'watchers.heartbeatIntervalMs' | 'watchers.recoveryWindowMinutes' | 'service.enabled' | 'service.autostart' | 'service.restartOnFailure' | 'service.platform' | 'service.serviceName' | 'service.logPath' | 'network.outboundTls.mode' | 'network.outboundTls.customCaFile' | 'network.outboundTls.customCaDir' | 'network.outboundTls.allowInsecureLocalhost' | 'network.remoteFetch.allowPrivateHosts' | 'runtime.companionChatLimiter.perSessionLimit';
|
|
342
342
|
/** Maps a ConfigKey to its value type. */
|
|
343
|
-
export type ConfigValue<K extends ConfigKey> = K extends 'display.stream' ? boolean : K extends 'display.lineNumbers' ? LineNumberMode : K extends 'display.collapseThreshold' ? number : K extends 'display.theme' ? string : K extends 'display.showThinking' ? boolean : K extends 'display.showReasoningSummary' ? boolean : K extends 'display.showTokenSpeed' ? boolean : K extends 'display.showToolPreview' ? boolean : K extends 'provider.reasoningEffort' ? 'instant' | 'low' | 'medium' | 'high' : K extends 'provider.model' ? string : K extends 'provider.provider' ? string : K extends 'provider.embeddingProvider' ? string : K extends 'provider.systemPromptFile' ? string : K extends 'behavior.autoApprove' ? boolean : K extends 'behavior.autoCompactThreshold' ? number : K extends 'behavior.staleContextWarnings' ? boolean : K extends 'behavior.saveHistory' ? boolean : K extends 'behavior.notifyOnComplete' ? boolean : K extends 'behavior.suggestAlternativeOnProviderFail' ? boolean : K extends 'behavior.hitlMode' ? 'quiet' | 'balanced' | 'operator' : K extends 'behavior.returnContextMode' ? 'off' | 'local' | 'assisted' : K extends 'behavior.guidanceMode' ? 'off' | 'minimal' | 'guided' : K extends 'storage.secretPolicy' ? 'plaintext_allowed' | 'preferred_secure' | 'require_secure' : K extends 'permissions.mode' ? PermissionMode : K extends 'permissions.tools.read' ? PermissionAction : K extends 'permissions.tools.write' ? PermissionAction : K extends 'permissions.tools.edit' ? PermissionAction : K extends 'permissions.tools.exec' ? PermissionAction : K extends 'permissions.tools.find' ? PermissionAction : K extends 'permissions.tools.fetch' ? PermissionAction : K extends 'permissions.tools.analyze' ? PermissionAction : K extends 'permissions.tools.inspect' ? PermissionAction : K extends 'permissions.tools.agent' ? PermissionAction : K extends 'permissions.tools.state' ? PermissionAction : K extends 'permissions.tools.workflow' ? PermissionAction : K extends 'permissions.tools.registry' ? PermissionAction : K extends 'permissions.tools.delegate' ? PermissionAction : K extends 'permissions.tools.mcp' ? PermissionAction : K extends 'orchestration.recursionEnabled' ? boolean : K extends 'orchestration.maxActiveAgents' ? number : K extends 'orchestration.maxDepth' ? number : K extends 'sandbox.replIsolation' ? 'shared-vm' | 'per-runtime-vm' : K extends 'sandbox.mcpIsolation' ? 'disabled' | 'shared-vm' | 'hybrid' | 'per-server-vm' : K extends 'sandbox.windowsMode' ? 'native-basic' | 'require-wsl' : K extends 'sandbox.vmBackend' ? 'local' | 'qemu' : K extends 'sandbox.qemuBinary' ? string : K extends 'sandbox.qemuImagePath' ? string : K extends 'sandbox.qemuExecWrapper' ? string : K extends 'sandbox.qemuGuestHost' ? string : K extends 'sandbox.qemuGuestPort' ? number : K extends 'sandbox.qemuGuestUser' ? string : K extends 'sandbox.qemuWorkspacePath' ? string : K extends 'sandbox.qemuSessionMode' ? 'attach' | 'launch-per-command' : K extends 'ui.voiceEnabled' ? boolean : K extends 'ui.systemMessages' ? 'panel' | 'conversation' | 'both' : K extends 'ui.operationalMessages' ? 'panel' | 'conversation' | 'both' : K extends 'ui.wrfcMessages' ? 'panel' | 'conversation' | 'both' : K extends 'release.channel' ? 'stable' | 'preview' : K extends 'danger.daemon' ? boolean : K extends 'danger.httpListener' ? boolean : K extends 'tools.llmEnabled' ? boolean : K extends 'tools.llmProvider' ? string : K extends 'tools.llmModel' ? string : K extends 'tools.autoHeal' ? boolean : K extends 'tools.defaultTokenBudget' ? number : K extends 'tools.hooksFile' ? string : K extends 'wrfc.scoreThreshold' ? number : K extends 'wrfc.maxFixAttempts' ? number : K extends 'wrfc.autoCommit' ? boolean : K extends 'cache.enabled' ? boolean : K extends 'cache.stableTtl' ? '5m' | '1h' : K extends 'cache.monitorHitRate' ? boolean : K extends 'cache.hitRateWarningThreshold' ? number : K extends 'helper.enabled' ? boolean : K extends 'helper.globalProvider' ? string : K extends 'helper.globalModel' ? string : K extends 'automation.enabled' ? boolean : K extends 'automation.maxConcurrentRuns' ? number : K extends 'automation.runHistoryLimit' ? number : K extends 'automation.defaultTimeoutMs' ? number : K extends 'automation.catchUpWindowMinutes' ? number : K extends 'automation.failureCooldownMs' ? number : K extends 'automation.deleteAfterRun' ? boolean : K extends 'controlPlane.enabled' ? boolean : K extends 'controlPlane.hostMode' ? 'local' | 'network' | 'custom' : K extends 'controlPlane.host' ? string : K extends 'controlPlane.port' ? number : K extends 'controlPlane.baseUrl' ? string : K extends 'controlPlane.streamMode' ? 'sse' | 'websocket' | 'both' : K extends 'controlPlane.allowRemote' ? boolean : K extends 'controlPlane.trustProxy' ? boolean : K extends 'controlPlane.tls.mode' ? 'off' | 'proxy' | 'direct' : K extends 'controlPlane.tls.certFile' ? string : K extends 'controlPlane.tls.keyFile' ? string : K extends 'httpListener.hostMode' ? 'local' | 'network' | 'custom' : K extends 'httpListener.host' ? string : K extends 'httpListener.port' ? number : K extends 'httpListener.trustProxy' ? boolean : K extends 'httpListener.tls.mode' ? 'off' | 'proxy' | 'direct' : K extends 'httpListener.tls.certFile' ? string : K extends 'httpListener.tls.keyFile' ? string : K extends 'web.enabled' ? boolean : K extends 'web.hostMode' ? 'local' | 'network' | 'custom' : K extends 'web.host' ? string : K extends 'web.port' ? number : K extends 'web.publicBaseUrl' ? string : K extends 'web.staticAssetsDir' ? string : K extends 'surfaces.slack.enabled' ? boolean : K extends 'surfaces.slack.signingSecret' ? string : K extends 'surfaces.slack.botToken' ? string : K extends 'surfaces.slack.appToken' ? string : K extends 'surfaces.slack.defaultChannel' ? string : K extends 'surfaces.slack.workspaceId' ? string : K extends 'surfaces.discord.enabled' ? boolean : K extends 'surfaces.discord.publicKey' ? string : K extends 'surfaces.discord.botToken' ? string : K extends 'surfaces.discord.applicationId' ? string : K extends 'surfaces.discord.defaultChannelId' ? string : K extends 'surfaces.discord.guildId' ? string : K extends 'surfaces.ntfy.enabled' ? boolean : K extends 'surfaces.ntfy.baseUrl' ? string : K extends 'surfaces.ntfy.topic' ? string : K extends 'surfaces.ntfy.token' ? string : K extends 'surfaces.ntfy.defaultPriority' ? number : K extends 'surfaces.webhook.enabled' ? boolean : K extends 'surfaces.webhook.defaultTarget' ? string : K extends 'surfaces.webhook.timeoutMs' ? number : K extends 'surfaces.webhook.secret' ? string : K extends 'surfaces.telegram.enabled' ? boolean : K extends 'surfaces.telegram.botToken' ? string : K extends 'surfaces.telegram.webhookSecret' ? string : K extends 'surfaces.telegram.defaultChatId' ? string : K extends 'surfaces.telegram.botUsername' ? string : K extends 'surfaces.telegram.mode' ? 'webhook' | 'polling' : K extends 'surfaces.googleChat.enabled' ? boolean : K extends 'surfaces.googleChat.webhookUrl' ? string : K extends 'surfaces.googleChat.verificationToken' ? string : K extends 'surfaces.googleChat.appId' ? string : K extends 'surfaces.googleChat.spaceId' ? string : K extends 'surfaces.signal.enabled' ? boolean : K extends 'surfaces.signal.bridgeUrl' ? string : K extends 'surfaces.signal.account' ? string : K extends 'surfaces.signal.token' ? string : K extends 'surfaces.signal.defaultRecipient' ? string : K extends 'surfaces.whatsapp.enabled' ? boolean : K extends 'surfaces.whatsapp.provider' ? 'meta-cloud' | 'bridge' : K extends 'surfaces.whatsapp.accessToken' ? string : K extends 'surfaces.whatsapp.verifyToken' ? string : K extends 'surfaces.whatsapp.signingSecret' ? string : K extends 'surfaces.whatsapp.phoneNumberId' ? string : K extends 'surfaces.whatsapp.businessAccountId' ? string : K extends 'surfaces.whatsapp.defaultRecipient' ? string : K extends 'surfaces.imessage.enabled' ? boolean : K extends 'surfaces.imessage.bridgeUrl' ? string : K extends 'surfaces.imessage.account' ? string : K extends 'surfaces.imessage.token' ? string : K extends 'surfaces.imessage.defaultChatId' ? string : K extends 'surfaces.msteams.enabled' ? boolean : K extends 'surfaces.msteams.appId' ? string : K extends 'surfaces.msteams.appPassword' ? string : K extends 'surfaces.msteams.tenantId' ? string : K extends 'surfaces.msteams.serviceUrl' ? string : K extends 'surfaces.msteams.botId' ? string : K extends 'surfaces.msteams.defaultConversationId' ? string : K extends 'surfaces.msteams.defaultChannelId' ? string : K extends 'surfaces.bluebubbles.enabled' ? boolean : K extends 'surfaces.bluebubbles.serverUrl' ? string : K extends 'surfaces.bluebubbles.password' ? string : K extends 'surfaces.bluebubbles.account' ? string : K extends 'surfaces.bluebubbles.defaultChatGuid' ? string : K extends 'surfaces.mattermost.enabled' ? boolean : K extends 'surfaces.mattermost.baseUrl' ? string : K extends 'surfaces.mattermost.botToken' ? string : K extends 'surfaces.mattermost.teamId' ? string : K extends 'surfaces.mattermost.defaultChannelId' ? string : K extends 'surfaces.matrix.enabled' ? boolean : K extends 'surfaces.matrix.homeserverUrl' ? string : K extends 'surfaces.matrix.accessToken' ? string : K extends 'surfaces.matrix.userId' ? string : K extends 'surfaces.matrix.defaultRoomId' ? string : K extends 'watchers.enabled' ? boolean : K extends 'watchers.pollIntervalMs' ? number : K extends 'watchers.heartbeatIntervalMs' ? number : K extends 'watchers.recoveryWindowMinutes' ? number : K extends 'service.enabled' ? boolean : K extends 'service.autostart' ? boolean : K extends 'service.restartOnFailure' ? boolean : K extends 'service.platform' ? 'auto' | 'systemd' | 'launchd' | 'windows' | 'manual' : K extends 'service.serviceName' ? string : K extends 'service.logPath' ? string : K extends 'network.outboundTls.mode' ? 'bundled' | 'bundled+custom' | 'custom' : K extends 'network.outboundTls.customCaFile' ? string : K extends 'network.outboundTls.customCaDir' ? string : K extends 'network.outboundTls.allowInsecureLocalhost' ? boolean : K extends 'network.remoteFetch.allowPrivateHosts' ? boolean : never;
|
|
343
|
+
export type ConfigValue<K extends ConfigKey> = K extends 'display.stream' ? boolean : K extends 'display.lineNumbers' ? LineNumberMode : K extends 'display.collapseThreshold' ? number : K extends 'display.theme' ? string : K extends 'display.showThinking' ? boolean : K extends 'display.showReasoningSummary' ? boolean : K extends 'display.showTokenSpeed' ? boolean : K extends 'display.showToolPreview' ? boolean : K extends 'provider.reasoningEffort' ? 'instant' | 'low' | 'medium' | 'high' : K extends 'provider.model' ? string : K extends 'provider.provider' ? string : K extends 'provider.embeddingProvider' ? string : K extends 'provider.systemPromptFile' ? string : K extends 'behavior.autoApprove' ? boolean : K extends 'behavior.autoCompactThreshold' ? number : K extends 'behavior.staleContextWarnings' ? boolean : K extends 'behavior.saveHistory' ? boolean : K extends 'behavior.notifyOnComplete' ? boolean : K extends 'behavior.suggestAlternativeOnProviderFail' ? boolean : K extends 'behavior.hitlMode' ? 'quiet' | 'balanced' | 'operator' : K extends 'behavior.returnContextMode' ? 'off' | 'local' | 'assisted' : K extends 'behavior.guidanceMode' ? 'off' | 'minimal' | 'guided' : K extends 'storage.secretPolicy' ? 'plaintext_allowed' | 'preferred_secure' | 'require_secure' : K extends 'permissions.mode' ? PermissionMode : K extends 'permissions.tools.read' ? PermissionAction : K extends 'permissions.tools.write' ? PermissionAction : K extends 'permissions.tools.edit' ? PermissionAction : K extends 'permissions.tools.exec' ? PermissionAction : K extends 'permissions.tools.find' ? PermissionAction : K extends 'permissions.tools.fetch' ? PermissionAction : K extends 'permissions.tools.analyze' ? PermissionAction : K extends 'permissions.tools.inspect' ? PermissionAction : K extends 'permissions.tools.agent' ? PermissionAction : K extends 'permissions.tools.state' ? PermissionAction : K extends 'permissions.tools.workflow' ? PermissionAction : K extends 'permissions.tools.registry' ? PermissionAction : K extends 'permissions.tools.delegate' ? PermissionAction : K extends 'permissions.tools.mcp' ? PermissionAction : K extends 'orchestration.recursionEnabled' ? boolean : K extends 'orchestration.maxActiveAgents' ? number : K extends 'orchestration.maxDepth' ? number : K extends 'sandbox.replIsolation' ? 'shared-vm' | 'per-runtime-vm' : K extends 'sandbox.mcpIsolation' ? 'disabled' | 'shared-vm' | 'hybrid' | 'per-server-vm' : K extends 'sandbox.windowsMode' ? 'native-basic' | 'require-wsl' : K extends 'sandbox.vmBackend' ? 'local' | 'qemu' : K extends 'sandbox.qemuBinary' ? string : K extends 'sandbox.qemuImagePath' ? string : K extends 'sandbox.qemuExecWrapper' ? string : K extends 'sandbox.qemuGuestHost' ? string : K extends 'sandbox.qemuGuestPort' ? number : K extends 'sandbox.qemuGuestUser' ? string : K extends 'sandbox.qemuWorkspacePath' ? string : K extends 'sandbox.qemuSessionMode' ? 'attach' | 'launch-per-command' : K extends 'ui.voiceEnabled' ? boolean : K extends 'ui.systemMessages' ? 'panel' | 'conversation' | 'both' : K extends 'ui.operationalMessages' ? 'panel' | 'conversation' | 'both' : K extends 'ui.wrfcMessages' ? 'panel' | 'conversation' | 'both' : K extends 'release.channel' ? 'stable' | 'preview' : K extends 'danger.daemon' ? boolean : K extends 'danger.httpListener' ? boolean : K extends 'tools.llmEnabled' ? boolean : K extends 'tools.llmProvider' ? string : K extends 'tools.llmModel' ? string : K extends 'tools.autoHeal' ? boolean : K extends 'tools.defaultTokenBudget' ? number : K extends 'tools.hooksFile' ? string : K extends 'wrfc.scoreThreshold' ? number : K extends 'wrfc.maxFixAttempts' ? number : K extends 'wrfc.autoCommit' ? boolean : K extends 'cache.enabled' ? boolean : K extends 'cache.stableTtl' ? '5m' | '1h' : K extends 'cache.monitorHitRate' ? boolean : K extends 'cache.hitRateWarningThreshold' ? number : K extends 'helper.enabled' ? boolean : K extends 'helper.globalProvider' ? string : K extends 'helper.globalModel' ? string : K extends 'automation.enabled' ? boolean : K extends 'automation.maxConcurrentRuns' ? number : K extends 'automation.runHistoryLimit' ? number : K extends 'automation.defaultTimeoutMs' ? number : K extends 'automation.catchUpWindowMinutes' ? number : K extends 'automation.failureCooldownMs' ? number : K extends 'automation.deleteAfterRun' ? boolean : K extends 'controlPlane.enabled' ? boolean : K extends 'controlPlane.hostMode' ? 'local' | 'network' | 'custom' : K extends 'controlPlane.host' ? string : K extends 'controlPlane.port' ? number : K extends 'controlPlane.baseUrl' ? string : K extends 'controlPlane.streamMode' ? 'sse' | 'websocket' | 'both' : K extends 'controlPlane.allowRemote' ? boolean : K extends 'controlPlane.trustProxy' ? boolean : K extends 'controlPlane.tls.mode' ? 'off' | 'proxy' | 'direct' : K extends 'controlPlane.tls.certFile' ? string : K extends 'controlPlane.tls.keyFile' ? string : K extends 'httpListener.hostMode' ? 'local' | 'network' | 'custom' : K extends 'httpListener.host' ? string : K extends 'httpListener.port' ? number : K extends 'httpListener.trustProxy' ? boolean : K extends 'httpListener.tls.mode' ? 'off' | 'proxy' | 'direct' : K extends 'httpListener.tls.certFile' ? string : K extends 'httpListener.tls.keyFile' ? string : K extends 'web.enabled' ? boolean : K extends 'web.hostMode' ? 'local' | 'network' | 'custom' : K extends 'web.host' ? string : K extends 'web.port' ? number : K extends 'web.publicBaseUrl' ? string : K extends 'web.staticAssetsDir' ? string : K extends 'surfaces.slack.enabled' ? boolean : K extends 'surfaces.slack.signingSecret' ? string : K extends 'surfaces.slack.botToken' ? string : K extends 'surfaces.slack.appToken' ? string : K extends 'surfaces.slack.defaultChannel' ? string : K extends 'surfaces.slack.workspaceId' ? string : K extends 'surfaces.discord.enabled' ? boolean : K extends 'surfaces.discord.publicKey' ? string : K extends 'surfaces.discord.botToken' ? string : K extends 'surfaces.discord.applicationId' ? string : K extends 'surfaces.discord.defaultChannelId' ? string : K extends 'surfaces.discord.guildId' ? string : K extends 'surfaces.ntfy.enabled' ? boolean : K extends 'surfaces.ntfy.baseUrl' ? string : K extends 'surfaces.ntfy.topic' ? string : K extends 'surfaces.ntfy.token' ? string : K extends 'surfaces.ntfy.defaultPriority' ? number : K extends 'surfaces.webhook.enabled' ? boolean : K extends 'surfaces.webhook.defaultTarget' ? string : K extends 'surfaces.webhook.timeoutMs' ? number : K extends 'surfaces.webhook.secret' ? string : K extends 'surfaces.telegram.enabled' ? boolean : K extends 'surfaces.telegram.botToken' ? string : K extends 'surfaces.telegram.webhookSecret' ? string : K extends 'surfaces.telegram.defaultChatId' ? string : K extends 'surfaces.telegram.botUsername' ? string : K extends 'surfaces.telegram.mode' ? 'webhook' | 'polling' : K extends 'surfaces.googleChat.enabled' ? boolean : K extends 'surfaces.googleChat.webhookUrl' ? string : K extends 'surfaces.googleChat.verificationToken' ? string : K extends 'surfaces.googleChat.appId' ? string : K extends 'surfaces.googleChat.spaceId' ? string : K extends 'surfaces.signal.enabled' ? boolean : K extends 'surfaces.signal.bridgeUrl' ? string : K extends 'surfaces.signal.account' ? string : K extends 'surfaces.signal.token' ? string : K extends 'surfaces.signal.defaultRecipient' ? string : K extends 'surfaces.whatsapp.enabled' ? boolean : K extends 'surfaces.whatsapp.provider' ? 'meta-cloud' | 'bridge' : K extends 'surfaces.whatsapp.accessToken' ? string : K extends 'surfaces.whatsapp.verifyToken' ? string : K extends 'surfaces.whatsapp.signingSecret' ? string : K extends 'surfaces.whatsapp.phoneNumberId' ? string : K extends 'surfaces.whatsapp.businessAccountId' ? string : K extends 'surfaces.whatsapp.defaultRecipient' ? string : K extends 'surfaces.imessage.enabled' ? boolean : K extends 'surfaces.imessage.bridgeUrl' ? string : K extends 'surfaces.imessage.account' ? string : K extends 'surfaces.imessage.token' ? string : K extends 'surfaces.imessage.defaultChatId' ? string : K extends 'surfaces.msteams.enabled' ? boolean : K extends 'surfaces.msteams.appId' ? string : K extends 'surfaces.msteams.appPassword' ? string : K extends 'surfaces.msteams.tenantId' ? string : K extends 'surfaces.msteams.serviceUrl' ? string : K extends 'surfaces.msteams.botId' ? string : K extends 'surfaces.msteams.defaultConversationId' ? string : K extends 'surfaces.msteams.defaultChannelId' ? string : K extends 'surfaces.bluebubbles.enabled' ? boolean : K extends 'surfaces.bluebubbles.serverUrl' ? string : K extends 'surfaces.bluebubbles.password' ? string : K extends 'surfaces.bluebubbles.account' ? string : K extends 'surfaces.bluebubbles.defaultChatGuid' ? string : K extends 'surfaces.mattermost.enabled' ? boolean : K extends 'surfaces.mattermost.baseUrl' ? string : K extends 'surfaces.mattermost.botToken' ? string : K extends 'surfaces.mattermost.teamId' ? string : K extends 'surfaces.mattermost.defaultChannelId' ? string : K extends 'surfaces.matrix.enabled' ? boolean : K extends 'surfaces.matrix.homeserverUrl' ? string : K extends 'surfaces.matrix.accessToken' ? string : K extends 'surfaces.matrix.userId' ? string : K extends 'surfaces.matrix.defaultRoomId' ? string : K extends 'watchers.enabled' ? boolean : K extends 'watchers.pollIntervalMs' ? number : K extends 'watchers.heartbeatIntervalMs' ? number : K extends 'watchers.recoveryWindowMinutes' ? number : K extends 'service.enabled' ? boolean : K extends 'service.autostart' ? boolean : K extends 'service.restartOnFailure' ? boolean : K extends 'service.platform' ? 'auto' | 'systemd' | 'launchd' | 'windows' | 'manual' : K extends 'service.serviceName' ? string : K extends 'service.logPath' ? string : K extends 'network.outboundTls.mode' ? 'bundled' | 'bundled+custom' | 'custom' : K extends 'network.outboundTls.customCaFile' ? string : K extends 'network.outboundTls.customCaDir' ? string : K extends 'network.outboundTls.allowInsecureLocalhost' ? boolean : K extends 'network.remoteFetch.allowPrivateHosts' ? boolean : K extends 'runtime.companionChatLimiter.perSessionLimit' ? number : never;
|
|
344
344
|
//# sourceMappingURL=schema-types.d.ts.map
|