@pellux/goodvibes-sdk 1.0.0 → 1.2.0
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/contracts/artifacts/operator-contract.json +2878 -264
- package/dist/events/communication.d.ts +1 -1
- package/dist/platform/agents/orchestrator-runner.d.ts +5 -5
- package/dist/platform/agents/orchestrator-runner.js +6 -6
- package/dist/platform/agents/orchestrator.d.ts +4 -4
- package/dist/platform/agents/orchestrator.js +2 -2
- package/dist/platform/agents/wrfc-controller.d.ts +1 -1
- package/dist/platform/agents/wrfc-controller.js +3 -3
- package/dist/platform/calendar/index.d.ts +2 -2
- package/dist/platform/calendar/index.js +3 -3
- package/dist/platform/calendar/oauth-providers.d.ts +1 -1
- package/dist/platform/calendar/oauth-providers.js +1 -1
- package/dist/platform/calendar/oauth-types.d.ts +1 -1
- package/dist/platform/calendar/oauth-types.js +1 -1
- package/dist/platform/companion/companion-chat-branching.d.ts +66 -0
- package/dist/platform/companion/companion-chat-branching.d.ts.map +1 -0
- package/dist/platform/companion/companion-chat-branching.js +142 -0
- package/dist/platform/companion/companion-chat-broker-bridge.d.ts +1 -1
- package/dist/platform/companion/companion-chat-broker-bridge.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-broker-sync.d.ts +2 -2
- package/dist/platform/companion/companion-chat-broker-sync.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-broker-sync.js +1 -1
- package/dist/platform/companion/companion-chat-manager.d.ts +26 -5
- package/dist/platform/companion/companion-chat-manager.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-manager.js +67 -81
- package/dist/platform/companion/companion-chat-routes.d.ts.map +1 -1
- package/dist/platform/companion/companion-chat-routes.js +77 -1
- package/dist/platform/companion/companion-chat-turn-execution.d.ts +61 -0
- package/dist/platform/companion/companion-chat-turn-execution.d.ts.map +1 -0
- package/dist/platform/companion/companion-chat-turn-execution.js +107 -0
- package/dist/platform/companion/companion-chat-types.d.ts +67 -0
- package/dist/platform/companion/companion-chat-types.d.ts.map +1 -1
- package/dist/platform/config/credential-status.d.ts +1 -1
- package/dist/platform/config/credential-status.js +1 -1
- package/dist/platform/config/index.d.ts +1 -1
- package/dist/platform/config/index.js +1 -1
- package/dist/platform/config/manager.d.ts +1 -1
- package/dist/platform/config/manager.js +1 -1
- package/dist/platform/config/migrations.d.ts +2 -2
- package/dist/platform/config/migrations.js +2 -2
- package/dist/platform/config/schema-domain-runtime.d.ts +8 -0
- package/dist/platform/config/schema-domain-runtime.d.ts.map +1 -1
- package/dist/platform/config/schema-domain-runtime.js +32 -0
- package/dist/platform/config/schema-types.d.ts +10 -2
- package/dist/platform/config/schema-types.d.ts.map +1 -1
- package/dist/platform/control-plane/gateway-scope-enforcement.js +2 -2
- package/dist/platform/control-plane/index.d.ts +2 -0
- package/dist/platform/control-plane/index.d.ts.map +1 -1
- package/dist/platform/control-plane/index.js +5 -1
- package/dist/platform/control-plane/invoke-input-validation.d.ts +1 -1
- package/dist/platform/control-plane/invoke-input-validation.js +1 -1
- package/dist/platform/control-plane/method-catalog-calendar.d.ts +2 -2
- package/dist/platform/control-plane/method-catalog-calendar.js +2 -2
- package/dist/platform/control-plane/method-catalog-channels.js +3 -3
- package/dist/platform/control-plane/method-catalog-control-automation.js +4 -4
- package/dist/platform/control-plane/method-catalog-control-companion.d.ts +1 -1
- package/dist/platform/control-plane/method-catalog-control-companion.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-control-companion.js +43 -0
- package/dist/platform/control-plane/method-catalog-control-core.js +3 -3
- package/dist/platform/control-plane/method-catalog-email.d.ts +1 -1
- package/dist/platform/control-plane/method-catalog-email.js +1 -1
- package/dist/platform/control-plane/method-catalog-fleet.d.ts +1 -1
- package/dist/platform/control-plane/method-catalog-push.d.ts +30 -0
- package/dist/platform/control-plane/method-catalog-push.d.ts.map +1 -0
- package/dist/platform/control-plane/method-catalog-push.js +80 -0
- package/dist/platform/control-plane/method-catalog-route-reconcile.d.ts +1 -1
- package/dist/platform/control-plane/method-catalog-runtime.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog-runtime.js +177 -1
- package/dist/platform/control-plane/method-catalog.d.ts.map +1 -1
- package/dist/platform/control-plane/method-catalog.js +2 -0
- package/dist/platform/control-plane/operator-contract-schemas-fleet.js +1 -1
- package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts +15 -0
- package/dist/platform/control-plane/operator-contract-schemas-runtime.d.ts.map +1 -1
- package/dist/platform/control-plane/operator-contract-schemas-runtime.js +81 -0
- package/dist/platform/control-plane/routes/checkpoints.d.ts +1 -1
- package/dist/platform/control-plane/routes/fleet.d.ts +2 -2
- package/dist/platform/control-plane/routes/fleet.js +1 -1
- package/dist/platform/control-plane/routes/gateway-verb-error.d.ts +1 -1
- package/dist/platform/control-plane/routes/gateway-verb-error.js +1 -1
- package/dist/platform/control-plane/routes/index.js +1 -1
- package/dist/platform/control-plane/routes/invocation-params.d.ts +1 -1
- package/dist/platform/control-plane/routes/push.d.ts +26 -0
- package/dist/platform/control-plane/routes/push.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/push.js +104 -0
- package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts +31 -0
- package/dist/platform/control-plane/routes/register-gateway-verb-groups.d.ts.map +1 -0
- package/dist/platform/control-plane/routes/register-gateway-verb-groups.js +16 -0
- package/dist/platform/control-plane/routes/register-w3-s2.d.ts +2 -2
- package/dist/platform/control-plane/routes/session-search.d.ts +4 -4
- package/dist/platform/control-plane/session-broker.d.ts +1 -1
- package/dist/platform/control-plane/session-broker.js +1 -1
- package/dist/platform/control-plane/session-store-importer.d.ts +1 -1
- package/dist/platform/control-plane/session-store-importer.js +1 -1
- package/dist/platform/control-plane/session-types.d.ts +1 -1
- package/dist/platform/core/orchestrator-runtime.d.ts +4 -4
- package/dist/platform/core/orchestrator-tool-runtime.d.ts +1 -1
- package/dist/platform/core/orchestrator-turn-loop.d.ts +6 -6
- package/dist/platform/core/orchestrator-turn-loop.d.ts.map +1 -1
- package/dist/platform/core/orchestrator-turn-loop.js +23 -22
- package/dist/platform/core/orchestrator.d.ts +10 -10
- package/dist/platform/core/orchestrator.d.ts.map +1 -1
- package/dist/platform/core/orchestrator.js +8 -8
- package/dist/platform/daemon/boot.d.ts +6 -0
- package/dist/platform/daemon/boot.d.ts.map +1 -1
- package/dist/platform/daemon/boot.js +1 -0
- package/dist/platform/daemon/control-plane.js +2 -2
- package/dist/platform/daemon/facade.d.ts +4 -7
- package/dist/platform/daemon/facade.d.ts.map +1 -1
- package/dist/platform/daemon/facade.js +5 -7
- package/dist/platform/daemon/http/router-session-broker-adapter.d.ts +1 -1
- package/dist/platform/daemon/http/router.d.ts +1 -0
- package/dist/platform/daemon/http/router.d.ts.map +1 -1
- package/dist/platform/daemon/http/router.js +36 -19
- package/dist/platform/daemon/http/runtime-route-types.d.ts +1 -1
- package/dist/platform/daemon/http/runtime-route-types.d.ts.map +1 -1
- package/dist/platform/daemon/http/webui-serving.d.ts +68 -0
- package/dist/platform/daemon/http/webui-serving.d.ts.map +1 -0
- package/dist/platform/daemon/http/webui-serving.js +230 -0
- package/dist/platform/knowledge/knowledge-api.d.ts +1 -1
- package/dist/platform/orchestration/budget.d.ts +2 -2
- package/dist/platform/orchestration/cancellation.d.ts +2 -2
- package/dist/platform/orchestration/controller-compat.d.ts +2 -3
- package/dist/platform/orchestration/controller-compat.d.ts.map +1 -1
- package/dist/platform/orchestration/dirty-guard.js +1 -1
- package/dist/platform/orchestration/engine.d.ts.map +1 -1
- package/dist/platform/orchestration/engine.js +3 -4
- package/dist/platform/orchestration/persistence.js +2 -2
- package/dist/platform/orchestration/phase-runner.d.ts +4 -4
- package/dist/platform/orchestration/scheduler.d.ts +1 -1
- package/dist/platform/orchestration/types.d.ts +3 -3
- package/dist/platform/presentation/glyphs.d.ts +1 -1
- package/dist/platform/presentation/glyphs.js +1 -1
- package/dist/platform/presentation/index.d.ts +3 -3
- package/dist/platform/presentation/index.js +3 -3
- package/dist/platform/presentation/thinking-phrases.d.ts +1 -1
- package/dist/platform/presentation/thinking-phrases.js +1 -1
- package/dist/platform/presentation/waiting-wording.d.ts +1 -1
- package/dist/platform/presentation/waiting-wording.js +1 -1
- package/dist/platform/push/delivery.d.ts +48 -0
- package/dist/platform/push/delivery.d.ts.map +1 -0
- package/dist/platform/push/delivery.js +117 -0
- package/dist/platform/push/encryption.d.ts +41 -0
- package/dist/platform/push/encryption.d.ts.map +1 -0
- package/dist/platform/push/encryption.js +82 -0
- package/dist/platform/push/index.d.ts +17 -0
- package/dist/platform/push/index.d.ts.map +1 -0
- package/dist/platform/push/index.js +10 -0
- package/dist/platform/push/service.d.ts +75 -0
- package/dist/platform/push/service.d.ts.map +1 -0
- package/dist/platform/push/service.js +95 -0
- package/dist/platform/push/subscription-store.d.ts +50 -0
- package/dist/platform/push/subscription-store.d.ts.map +1 -0
- package/dist/platform/push/subscription-store.js +123 -0
- package/dist/platform/push/types.d.ts +68 -0
- package/dist/platform/push/types.d.ts.map +1 -0
- package/dist/platform/push/types.js +13 -0
- package/dist/platform/push/vapid.d.ts +54 -0
- package/dist/platform/push/vapid.d.ts.map +1 -0
- package/dist/platform/push/vapid.js +113 -0
- package/dist/platform/runtime/feature-flags/flags.js +3 -3
- package/dist/platform/runtime/fleet/adapters/agent.d.ts +2 -2
- package/dist/platform/runtime/fleet/adapters/agent.d.ts.map +1 -1
- package/dist/platform/runtime/fleet/adapters/agent.js +4 -4
- package/dist/platform/runtime/fleet/adapters/automation.d.ts +1 -1
- package/dist/platform/runtime/fleet/adapters/automation.js +1 -1
- package/dist/platform/runtime/fleet/adapters/code-index.d.ts +1 -1
- package/dist/platform/runtime/fleet/adapters/code-index.js +1 -1
- package/dist/platform/runtime/fleet/adapters/orchestration.js +1 -1
- package/dist/platform/runtime/fleet/adapters/schedule.d.ts +4 -4
- package/dist/platform/runtime/fleet/adapters/schedule.js +4 -4
- package/dist/platform/runtime/fleet/adapters/trigger.d.ts +3 -4
- package/dist/platform/runtime/fleet/adapters/trigger.d.ts.map +1 -1
- package/dist/platform/runtime/fleet/adapters/trigger.js +3 -4
- package/dist/platform/runtime/fleet/adapters/wrfc.js +1 -1
- package/dist/platform/runtime/fleet/registry.d.ts +7 -7
- package/dist/platform/runtime/fleet/registry.d.ts.map +1 -1
- package/dist/platform/runtime/fleet/registry.js +3 -3
- package/dist/platform/runtime/fleet/types.d.ts +9 -9
- package/dist/platform/runtime/fleet/types.d.ts.map +1 -1
- package/dist/platform/runtime/memory-spine/client.d.ts +240 -0
- package/dist/platform/runtime/memory-spine/client.d.ts.map +1 -0
- package/dist/platform/runtime/memory-spine/client.js +221 -0
- package/dist/platform/runtime/memory-spine/index.d.ts +17 -0
- package/dist/platform/runtime/memory-spine/index.d.ts.map +1 -0
- package/dist/platform/runtime/memory-spine/index.js +16 -0
- package/dist/platform/runtime/memory-spine/recall-snapshot.d.ts +74 -0
- package/dist/platform/runtime/memory-spine/recall-snapshot.d.ts.map +1 -0
- package/dist/platform/runtime/memory-spine/recall-snapshot.js +74 -0
- package/dist/platform/runtime/operator-client.d.ts +1 -1
- package/dist/platform/runtime/services.d.ts +6 -6
- package/dist/platform/runtime/services.d.ts.map +1 -1
- package/dist/platform/runtime/services.js +9 -9
- package/dist/platform/runtime/session-spine/union-cache.d.ts +1 -1
- package/dist/platform/runtime/session-spine/union-cache.js +1 -1
- package/dist/platform/state/canonical-memory.d.ts +7 -7
- package/dist/platform/state/canonical-memory.js +8 -8
- package/dist/platform/state/code-index-chunking.js +1 -1
- package/dist/platform/state/code-index-db.d.ts +1 -1
- package/dist/platform/state/code-index-store.js +1 -1
- package/dist/platform/state/index.d.ts +2 -2
- package/dist/platform/state/index.d.ts.map +1 -1
- package/dist/platform/state/index.js +1 -1
- package/dist/platform/state/memory-recall-contract.d.ts +59 -4
- package/dist/platform/state/memory-recall-contract.d.ts.map +1 -1
- package/dist/platform/state/memory-recall-contract.js +79 -3
- package/dist/platform/state/memory-registry.d.ts +8 -0
- package/dist/platform/state/memory-registry.d.ts.map +1 -1
- package/dist/platform/state/memory-registry.js +10 -0
- package/dist/platform/state/memory-vector-store.js +1 -1
- package/dist/platform/state/sqlite-vec-loader.d.ts +1 -1
- package/dist/platform/state/sqlite-vec-loader.js +1 -1
- package/dist/platform/state/vibe-projection.d.ts +3 -3
- package/dist/platform/state/vibe-projection.js +3 -3
- package/dist/platform/tools/agent/manager.d.ts +10 -10
- package/dist/platform/tools/agent/manager.js +7 -7
- package/dist/platform/tools/exec/runtime.js +5 -5
- package/dist/platform/tools/exec/schema.d.ts +1 -1
- package/dist/platform/tools/exec/schema.d.ts.map +1 -1
- package/dist/platform/tools/fetch/runtime.d.ts +1 -1
- package/dist/platform/tools/registry.d.ts +1 -1
- package/dist/platform/tools/registry.js +1 -1
- package/dist/platform/types/tools.d.ts +1 -1
- package/dist/platform/utils/request-body.d.ts.map +1 -1
- package/dist/platform/utils/request-body.js +50 -5
- package/dist/platform/version.js +1 -1
- package/dist/platform/voice/index.d.ts +2 -0
- package/dist/platform/voice/index.d.ts.map +1 -1
- package/dist/platform/voice/index.js +3 -0
- package/dist/platform/voice/spoken-turn/audio-sink.d.ts +111 -0
- package/dist/platform/voice/spoken-turn/audio-sink.d.ts.map +1 -0
- package/dist/platform/voice/spoken-turn/audio-sink.js +1 -0
- package/dist/platform/voice/spoken-turn/controller.d.ts +117 -0
- package/dist/platform/voice/spoken-turn/controller.d.ts.map +1 -0
- package/dist/platform/voice/spoken-turn/controller.js +448 -0
- package/dist/platform/voice/spoken-turn/index.d.ts +16 -0
- package/dist/platform/voice/spoken-turn/index.d.ts.map +1 -0
- package/dist/platform/voice/spoken-turn/index.js +12 -0
- package/dist/platform/voice/spoken-turn/text-chunker.d.ts +33 -0
- package/dist/platform/voice/spoken-turn/text-chunker.d.ts.map +1 -0
- package/dist/platform/voice/spoken-turn/text-chunker.js +97 -0
- package/package.json +13 -9
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MemoryAddOptions, MemoryBundle, MemoryDoctorReport, MemoryLink, MemoryRecord, MemoryReviewPatch, MemoryScope, MemorySearchFilter, MemorySemanticSearchResult, MemoryStore } from './memory-store.js';
|
|
2
2
|
import type { MemoryVectorStats } from './memory-vector-store.js';
|
|
3
3
|
import type { MemoryImportResult } from './memory-store.js';
|
|
4
|
+
import { type HonestMemorySearchOptions, type HonestMemorySearchResult } from './memory-recall-contract.js';
|
|
4
5
|
/**
|
|
5
6
|
* MemoryRegistry — thin observable wrapper around the MemoryStore.
|
|
6
7
|
* Panels subscribe via listeners; commands push/retrieve through this.
|
|
@@ -15,6 +16,13 @@ export declare class MemoryRegistry {
|
|
|
15
16
|
add(opts: MemoryAddOptions): Promise<MemoryRecord>;
|
|
16
17
|
search(filter?: MemorySearchFilter): MemoryRecord[];
|
|
17
18
|
searchSemantic(filter?: MemorySearchFilter): MemorySemanticSearchResult[];
|
|
19
|
+
/**
|
|
20
|
+
* Search honoring the recall-honesty contract: semantic-or-literal with a stated
|
|
21
|
+
* fallback reason when the index is unavailable, and (with `options.recall`) the
|
|
22
|
+
* flagged/confidence-floor exclusion. This is the method a wire client and an
|
|
23
|
+
* offline surface both route through, so the honesty is identical either way.
|
|
24
|
+
*/
|
|
25
|
+
honestSearch(filter?: MemorySearchFilter, options?: HonestMemorySearchOptions): HonestMemorySearchResult;
|
|
18
26
|
rebuildVectors(): MemoryVectorStats;
|
|
19
27
|
rebuildVectorsAsync(): Promise<MemoryVectorStats>;
|
|
20
28
|
vectorStats(): MemoryVectorStats;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory-registry.d.ts","sourceRoot":"","sources":["../../../src/platform/state/memory-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,kBAAkB,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACnN,OAAO,KAAK,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AC;IAI3C,WAAW,CAAC,KAAK,SAAK,EAAE,KAAK,CAAC,EAAE,WAAW,GAAG,YAAY,EAAE;IAI5D,YAAY,CAAC,MAAM,GAAE,kBAAuB,GAAG,YAAY;IAIrD,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAMrE,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAI9B,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAMtF,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,EAAE;IAIlC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,KAAK,CAAC,EAAE,WAAW,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,YAAY,GAAG,IAAI;IAM3H,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,YAAY,GAAG,IAAI;IAMjE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO;IAM3B,MAAM,IAAI,YAAY,EAAE;CAGzB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { runHonestMemorySearch } from './memory-recall-contract.js';
|
|
1
2
|
/**
|
|
2
3
|
* MemoryRegistry — thin observable wrapper around the MemoryStore.
|
|
3
4
|
* Panels subscribe via listeners; commands push/retrieve through this.
|
|
@@ -32,6 +33,15 @@ export class MemoryRegistry {
|
|
|
32
33
|
searchSemantic(filter = {}) {
|
|
33
34
|
return this.store.searchSemantic(filter);
|
|
34
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Search honoring the recall-honesty contract: semantic-or-literal with a stated
|
|
38
|
+
* fallback reason when the index is unavailable, and (with `options.recall`) the
|
|
39
|
+
* flagged/confidence-floor exclusion. This is the method a wire client and an
|
|
40
|
+
* offline surface both route through, so the honesty is identical either way.
|
|
41
|
+
*/
|
|
42
|
+
honestSearch(filter = {}, options = {}) {
|
|
43
|
+
return runHonestMemorySearch(this.store, filter, options);
|
|
44
|
+
}
|
|
35
45
|
rebuildVectors() {
|
|
36
46
|
return this.store.rebuildVectorIndex();
|
|
37
47
|
}
|
|
@@ -6,7 +6,7 @@ import { MemoryEmbeddingProviderRegistry, embedMemoryText, normalizeMemoryEmbedd
|
|
|
6
6
|
import { loadSqliteVecExtension } from './sqlite-vec-loader.js';
|
|
7
7
|
import { logger } from '../utils/logger.js';
|
|
8
8
|
import { summarizeError } from '../utils/error-display.js';
|
|
9
|
-
// Lifted to sqlite-vec-loader.ts (
|
|
9
|
+
// Lifted to sqlite-vec-loader.ts (see CHANGELOG 0.38.0) so code-index-store.ts can load
|
|
10
10
|
// the exact same native extension the exact same way. Re-exported here so
|
|
11
11
|
// existing callers that import resolveSqliteVecPath from this module keep working.
|
|
12
12
|
export { resolveSqliteVecPath } from './sqlite-vec-loader.js';
|
|
@@ -13,7 +13,7 @@ import type { Database } from 'bun:sqlite';
|
|
|
13
13
|
* via the re-exported `load()` function.
|
|
14
14
|
*
|
|
15
15
|
* Shared by memory-vector-store.ts (MemoryStore's vector index) and
|
|
16
|
-
* code-index-store.ts (the repo source-tree code index
|
|
16
|
+
* code-index-store.ts (the repo source-tree code index; see CHANGELOG 0.38.0) so both
|
|
17
17
|
* indexes load the exact same native extension the exact same way.
|
|
18
18
|
*/
|
|
19
19
|
export declare function resolveSqliteVecPath(): string;
|
|
@@ -14,7 +14,7 @@ import { load as loadSqliteVec } from 'sqlite-vec';
|
|
|
14
14
|
* via the re-exported `load()` function.
|
|
15
15
|
*
|
|
16
16
|
* Shared by memory-vector-store.ts (MemoryStore's vector index) and
|
|
17
|
-
* code-index-store.ts (the repo source-tree code index
|
|
17
|
+
* code-index-store.ts (the repo source-tree code index; see CHANGELOG 0.38.0) so both
|
|
18
18
|
* indexes load the exact same native extension the exact same way.
|
|
19
19
|
*/
|
|
20
20
|
export function resolveSqliteVecPath() {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vibe-projection.ts — VIBE.md as a PROJECTION of memory records (
|
|
2
|
+
* vibe-projection.ts — VIBE.md as a PROJECTION of memory records (see CHANGELOG 1.0.0).
|
|
3
3
|
*
|
|
4
|
-
* BEFORE
|
|
5
|
-
* — a projection of ITSELF, a source of truth disjoint from the memory store.
|
|
4
|
+
* BEFORE memory unification, VIBE.md was a persona file read off disk and injected into the prompt
|
|
5
|
+
* — a projection of ITSELF, a source of truth disjoint from the memory store. Memory unification
|
|
6
6
|
* demotes the file to an import/export FORMAT and makes the prompt block a
|
|
7
7
|
* projection of first-class memory records:
|
|
8
8
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vibe-projection.ts — VIBE.md as a PROJECTION of memory records (
|
|
2
|
+
* vibe-projection.ts — VIBE.md as a PROJECTION of memory records (see CHANGELOG 1.0.0).
|
|
3
3
|
*
|
|
4
|
-
* BEFORE
|
|
5
|
-
* — a projection of ITSELF, a source of truth disjoint from the memory store.
|
|
4
|
+
* BEFORE memory unification, VIBE.md was a persona file read off disk and injected into the prompt
|
|
5
|
+
* — a projection of ITSELF, a source of truth disjoint from the memory store. Memory unification
|
|
6
6
|
* demotes the file to an import/export FORMAT and makes the prompt block a
|
|
7
7
|
* projection of first-class memory records:
|
|
8
8
|
*
|
|
@@ -25,7 +25,7 @@ export interface AgentManagerDependencies {
|
|
|
25
25
|
readonly conversationSnapshotRetention?: number | undefined;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
28
|
-
*
|
|
28
|
+
* Conversation-snapshot tab attach point (Part C6): default bound on how many recently
|
|
29
29
|
* finished agents' final conversation snapshot AgentManager keeps around
|
|
30
30
|
* after their live source is released. Without a bound, a long-lived process
|
|
31
31
|
* that spawns many short-lived agents would retain every finished agent's
|
|
@@ -56,7 +56,7 @@ export interface AgentRecord {
|
|
|
56
56
|
/**
|
|
57
57
|
* Set by cancel(id, kind) when status transitions to 'cancelled'. Distinguishes
|
|
58
58
|
* a graceful interrupt request from a hard kill for display purposes
|
|
59
|
-
* (
|
|
59
|
+
* (verb formalization) without overloading `status`, which is
|
|
60
60
|
* consumed widely (ledger parse, orchestrator finalize, exportState/
|
|
61
61
|
* importState). Absent on records cancelled before this field existed, and
|
|
62
62
|
* on any record cancelled via the single-arg cancel(id) call — both default
|
|
@@ -90,7 +90,7 @@ export interface AgentRecord {
|
|
|
90
90
|
fanoutCollapse?: AgentInput['fanoutCollapse'] | undefined;
|
|
91
91
|
dangerously_disable_wrfc?: boolean | undefined;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* Orchestration engine tag: set by phase-runner.ts when it
|
|
94
94
|
* spawns an agent to run one WorkItem through one Phase. Mirrors
|
|
95
95
|
* wrfcId/wrfcSubtaskId — the fleet's agent adapter uses it to parent this
|
|
96
96
|
* agent node under its work-item ProcessNode (adapters/agent.ts
|
|
@@ -132,7 +132,7 @@ export interface AgentRecord {
|
|
|
132
132
|
reviewState: 'fresh' | 'reviewed' | 'stale' | 'contradicted';
|
|
133
133
|
}>;
|
|
134
134
|
/**
|
|
135
|
-
*
|
|
135
|
+
* Bounded ring of per-turn passive-injection honesty
|
|
136
136
|
* records — one entry per turn that actually ran retrieval (turns that
|
|
137
137
|
* reused the prior turn's cached block, or that ran with the feature
|
|
138
138
|
* flag/budget off, append nothing). See turn-knowledge-injection.ts for
|
|
@@ -153,14 +153,14 @@ export declare class AgentManager {
|
|
|
153
153
|
private executor;
|
|
154
154
|
private readonly configManager;
|
|
155
155
|
/**
|
|
156
|
-
* Live snapshot accessors for RUNNING agents (
|
|
156
|
+
* Live snapshot accessors for RUNNING agents (conversation-snapshot bridge, Part C6).
|
|
157
157
|
* Registered by the executor (orchestrator-runner.ts) right after it
|
|
158
158
|
* creates the agent's ConversationManager; the manager never stores
|
|
159
159
|
* messages itself while an agent is running — it just holds a callback.
|
|
160
160
|
*/
|
|
161
161
|
private readonly conversationSources;
|
|
162
162
|
/**
|
|
163
|
-
*
|
|
163
|
+
* Cooperative cancellation bridge: per-agent AbortSignal
|
|
164
164
|
* registered by an orchestration-engine work item for the duration of one
|
|
165
165
|
* phase run. AgentOrchestrator reads this via
|
|
166
166
|
* setCancellationSource/getCancellationSignal and threads it into
|
|
@@ -187,14 +187,14 @@ export declare class AgentManager {
|
|
|
187
187
|
cancel(id: string, kind?: 'interrupt' | 'kill'): boolean;
|
|
188
188
|
/**
|
|
189
189
|
* Register the live conversation-snapshot source for a running agent
|
|
190
|
-
* (
|
|
190
|
+
* (conversation-snapshot bridge, Part C6). Called by the executor (orchestrator-runner.ts)
|
|
191
191
|
* once its ConversationManager exists — `source` is invoked on demand by
|
|
192
192
|
* getConversationSnapshot(); the manager never copies or stores the
|
|
193
193
|
* messages itself while the agent is running.
|
|
194
194
|
*/
|
|
195
195
|
registerConversationSource(agentId: string, source: () => ConversationMessageSnapshot[]): void;
|
|
196
196
|
/**
|
|
197
|
-
*
|
|
197
|
+
* Cooperative cancellation bridge: register the AbortSignal
|
|
198
198
|
* an orchestration engine's cancellation registry created for a work
|
|
199
199
|
* item's current agent. Called by the engine right after
|
|
200
200
|
* AgentManager.spawn() so the signal is in place before the agent's first
|
|
@@ -212,7 +212,7 @@ export declare class AgentManager {
|
|
|
212
212
|
* open at the moment of completion keeps showing content instead of going
|
|
213
213
|
* blank. Once evicted (oldest-first, beyond the retention bound),
|
|
214
214
|
* getConversationSnapshot falls back to an empty array — callers past that
|
|
215
|
-
* point are expected to degrade to the on-disk event ledger (
|
|
215
|
+
* point are expected to degrade to the on-disk event ledger (TUI
|
|
216
216
|
* Part C6's documented fallback for completed/detached agents).
|
|
217
217
|
*
|
|
218
218
|
* Safe to call even when no source was ever registered for this agentId
|
|
@@ -220,7 +220,7 @@ export declare class AgentManager {
|
|
|
220
220
|
*/
|
|
221
221
|
releaseConversationSource(agentId: string): void;
|
|
222
222
|
/**
|
|
223
|
-
* The
|
|
223
|
+
* The conversation-snapshot tab attach point: a full-fidelity conversation history for a
|
|
224
224
|
* fleet agent (ConversationMessageSnapshot[] — the same shape the main
|
|
225
225
|
* session surface renders via MessageLineCache/conversation.ts).
|
|
226
226
|
*
|
|
@@ -9,7 +9,7 @@ import { summarizeError } from '../../utils/error-display.js';
|
|
|
9
9
|
import { splitModelRegistryKey } from '../../providers/registry-helpers.js';
|
|
10
10
|
import { isRootReviewRoleTask, resolveAuthoritativeWrfcScope, resolveImplementationToolContract, resolveNarrowedRootSpawnScope, } from './wrfc-batch-policy.js';
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Conversation-snapshot tab attach point (Part C6): default bound on how many recently
|
|
13
13
|
* finished agents' final conversation snapshot AgentManager keeps around
|
|
14
14
|
* after their live source is released. Without a bound, a long-lived process
|
|
15
15
|
* that spawns many short-lived agents would retain every finished agent's
|
|
@@ -82,14 +82,14 @@ export class AgentManager {
|
|
|
82
82
|
executor;
|
|
83
83
|
configManager;
|
|
84
84
|
/**
|
|
85
|
-
* Live snapshot accessors for RUNNING agents (
|
|
85
|
+
* Live snapshot accessors for RUNNING agents (conversation-snapshot bridge, Part C6).
|
|
86
86
|
* Registered by the executor (orchestrator-runner.ts) right after it
|
|
87
87
|
* creates the agent's ConversationManager; the manager never stores
|
|
88
88
|
* messages itself while an agent is running — it just holds a callback.
|
|
89
89
|
*/
|
|
90
90
|
conversationSources = new Map();
|
|
91
91
|
/**
|
|
92
|
-
*
|
|
92
|
+
* Cooperative cancellation bridge: per-agent AbortSignal
|
|
93
93
|
* registered by an orchestration-engine work item for the duration of one
|
|
94
94
|
* phase run. AgentOrchestrator reads this via
|
|
95
95
|
* setCancellationSource/getCancellationSignal and threads it into
|
|
@@ -529,7 +529,7 @@ export class AgentManager {
|
|
|
529
529
|
}
|
|
530
530
|
/**
|
|
531
531
|
* Register the live conversation-snapshot source for a running agent
|
|
532
|
-
* (
|
|
532
|
+
* (conversation-snapshot bridge, Part C6). Called by the executor (orchestrator-runner.ts)
|
|
533
533
|
* once its ConversationManager exists — `source` is invoked on demand by
|
|
534
534
|
* getConversationSnapshot(); the manager never copies or stores the
|
|
535
535
|
* messages itself while the agent is running.
|
|
@@ -538,7 +538,7 @@ export class AgentManager {
|
|
|
538
538
|
this.conversationSources.set(agentId, source);
|
|
539
539
|
}
|
|
540
540
|
/**
|
|
541
|
-
*
|
|
541
|
+
* Cooperative cancellation bridge: register the AbortSignal
|
|
542
542
|
* an orchestration engine's cancellation registry created for a work
|
|
543
543
|
* item's current agent. Called by the engine right after
|
|
544
544
|
* AgentManager.spawn() so the signal is in place before the agent's first
|
|
@@ -562,7 +562,7 @@ export class AgentManager {
|
|
|
562
562
|
* open at the moment of completion keeps showing content instead of going
|
|
563
563
|
* blank. Once evicted (oldest-first, beyond the retention bound),
|
|
564
564
|
* getConversationSnapshot falls back to an empty array — callers past that
|
|
565
|
-
* point are expected to degrade to the on-disk event ledger (
|
|
565
|
+
* point are expected to degrade to the on-disk event ledger (TUI
|
|
566
566
|
* Part C6's documented fallback for completed/detached agents).
|
|
567
567
|
*
|
|
568
568
|
* Safe to call even when no source was ever registered for this agentId
|
|
@@ -593,7 +593,7 @@ export class AgentManager {
|
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
595
|
/**
|
|
596
|
-
* The
|
|
596
|
+
* The conversation-snapshot tab attach point: a full-fidelity conversation history for a
|
|
597
597
|
* fleet agent (ConversationMessageSnapshot[] — the same shape the main
|
|
598
598
|
* session surface renders via MessageLineCache/conversation.ts).
|
|
599
599
|
*
|
|
@@ -124,7 +124,7 @@ function applyExpectations(result, expect, exitCode) {
|
|
|
124
124
|
function buildTimedOutResult(cmdStr, cwd, durationMs, progressFile) {
|
|
125
125
|
return { cmd: cmdStr, exit_code: null, stdout: '', stderr: '', success: false, timed_out: true, duration_ms: durationMs, cwd, ...(progressFile ? { progress_file: progressFile } : {}) };
|
|
126
126
|
}
|
|
127
|
-
/**
|
|
127
|
+
/** Cooperative cancellation: mirrors buildTimedOutResult's shape for the AbortSignal path. */
|
|
128
128
|
function buildCancelledResult(cmdStr, cwd, durationMs) {
|
|
129
129
|
return { cmd: cmdStr, exit_code: null, stdout: '', stderr: '', success: false, cancelled: true, duration_ms: durationMs, cwd };
|
|
130
130
|
}
|
|
@@ -136,7 +136,7 @@ function buildCancelledResult(cmdStr, cwd, durationMs) {
|
|
|
136
136
|
*/
|
|
137
137
|
const POST_STOP_DRAIN_GRACE_MS = 500;
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* Cooperative cancellation: after a timeout/abort kill the
|
|
140
140
|
* child has already been SIGKILL'd, but a grandchild that inherited the
|
|
141
141
|
* stdout/stderr pipe can hold it open, so reading those streams to EOF may
|
|
142
142
|
* never settle. Awaiting the full IO promise unbounded here could therefore
|
|
@@ -214,11 +214,11 @@ async function runCommand(processManager, overflowHandler, featureFlags, cmdStr,
|
|
|
214
214
|
const timeoutMs = cmdInput.timeout_ms ?? globalTimeout;
|
|
215
215
|
const mergedEnv = { ...buildCleanEnv(), ...cmdInput.env };
|
|
216
216
|
const startTime = Date.now();
|
|
217
|
-
//
|
|
217
|
+
// Cooperative cancellation is wired for the foreground and
|
|
218
218
|
// progress-streamed paths (the common cases — progress auto-engages once
|
|
219
219
|
// timeout_ms exceeds PROGRESS_AUTO_THRESHOLD_MS, which the 120s default
|
|
220
220
|
// timeout always does). `until`-pattern commands are explicitly deferred
|
|
221
|
-
//
|
|
221
|
+
// — the timeout kill-timer they already have still
|
|
222
222
|
// applies, just not an external AbortSignal.
|
|
223
223
|
if (cmdInput.until) {
|
|
224
224
|
return runUntil(processManager, overflowHandler, cmdStr, cmdInput, cwd, mergedEnv, timeoutMs, startTime);
|
|
@@ -543,7 +543,7 @@ export function isRetryableExecResult(result, allowed) {
|
|
|
543
543
|
// Timed-out commands are never auto-retried — callers must decide
|
|
544
544
|
if (result.timed_out)
|
|
545
545
|
return false;
|
|
546
|
-
// Cancelled commands
|
|
546
|
+
// Cancelled commands must never be retried — retrying
|
|
547
547
|
// after an operator/engine kill would defeat the cancellation entirely.
|
|
548
548
|
if (result.cancelled)
|
|
549
549
|
return false;
|
|
@@ -269,7 +269,7 @@ export interface ExecCommandResult {
|
|
|
269
269
|
expectation_error?: string | undefined;
|
|
270
270
|
/** Set when command exceeded timeout. */
|
|
271
271
|
timed_out?: boolean | undefined;
|
|
272
|
-
/** Set when an external AbortSignal cancelled the command (
|
|
272
|
+
/** Set when an external AbortSignal cancelled the command (orchestration engine cancellation). Never combined with timed_out. */
|
|
273
273
|
cancelled?: boolean | undefined;
|
|
274
274
|
/** Set when command ran in background. */
|
|
275
275
|
process_id?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/platform/tools/exec/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoNnB,CAAC;AAIX,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAE9E,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,WAAW,SAAS;IACxB,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS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AM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,0CAA0C;IAC1C,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,yCAAyC;IACzC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,iIAAiI;IACjI,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,0CAA0C;IAC1C,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,kCAAkC;IAClC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACzC,uBAAuB;IACvB,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,6EAA6E;IAC7E,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,4EAA4E;IAC5E,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;CACjC;AAGD,YAAY,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -7,7 +7,7 @@ export interface FetchRuntimeDeps {
|
|
|
7
7
|
readonly serviceRegistry?: Pick<ServiceRegistry, 'resolveAuth'> | null | undefined;
|
|
8
8
|
readonly featureFlags?: Pick<FeatureFlagManager, 'isEnabled'> | null | undefined;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Cooperative cancellation: an externally-supplied signal,
|
|
11
11
|
* combined with each request's own per-URL timeout signal via
|
|
12
12
|
* `AbortSignal.any`. Optional and additive — omitted, behavior is
|
|
13
13
|
* unchanged from before this field existed.
|
|
@@ -44,7 +44,7 @@ export declare class ToolRegistry {
|
|
|
44
44
|
/**
|
|
45
45
|
* Execute a named tool with the given arguments. Wraps errors in ToolResult.
|
|
46
46
|
*
|
|
47
|
-
* `opts.signal`
|
|
47
|
+
* `opts.signal` is an additive pass-through to
|
|
48
48
|
* `tool.execute` — only tools that opt in (exec, fetch) read it. Callers
|
|
49
49
|
* that don't have a cancellation signal (the common case) omit `opts`.
|
|
50
50
|
*/
|
|
@@ -73,7 +73,7 @@ export class ToolRegistry {
|
|
|
73
73
|
/**
|
|
74
74
|
* Execute a named tool with the given arguments. Wraps errors in ToolResult.
|
|
75
75
|
*
|
|
76
|
-
* `opts.signal`
|
|
76
|
+
* `opts.signal` is an additive pass-through to
|
|
77
77
|
* `tool.execute` — only tools that opt in (exec, fetch) read it. Callers
|
|
78
78
|
* that don't have a cancellation signal (the common case) omit `opts`.
|
|
79
79
|
*/
|
|
@@ -33,7 +33,7 @@ export interface ToolResult {
|
|
|
33
33
|
/**
|
|
34
34
|
* Optional per-call execution options.
|
|
35
35
|
*
|
|
36
|
-
* `signal`
|
|
36
|
+
* `signal` is ADDITIVE: it was not present before, and every
|
|
37
37
|
* existing tool implementation that declares `execute(args)` with a single
|
|
38
38
|
* parameter remains a valid implementation of this interface (structural
|
|
39
39
|
* typing — an unused trailing optional parameter is simply never read). Only
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-body.d.ts","sourceRoot":"","sources":["../../../src/platform/utils/request-body.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,UAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"request-body.d.ts","sourceRoot":"","sources":["../../../src/platform/utils/request-body.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,UAAY,CAAC;AA8CxD,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,OAAO,EACZ,QAAQ,SAAiC,GACxC,OAAO,CAAC,MAAM,GAAG,QAAQ,CAAC,CA+B5B;AAED,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,OAAO,EACZ,QAAQ,SAAiC,GACxC,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAC,CAQ7B"}
|
|
@@ -1,11 +1,54 @@
|
|
|
1
1
|
export const DEFAULT_MAX_REQUEST_BODY_BYTES = 1_000_000;
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Reads and discards the remainder of a request body reader.
|
|
4
|
+
*
|
|
5
|
+
* Bun (and Node) keep-alive connection reuse depends on the previous
|
|
6
|
+
* request's body having been fully read off the wire — `stream.cancel()`
|
|
7
|
+
* signals "stop delivering chunks to me" but does not, in practice, drain the
|
|
8
|
+
* underlying connection buffer, which leaves the NEXT request on a reused
|
|
9
|
+
* connection stalled for several seconds waiting for the runtime to notice
|
|
10
|
+
* the connection is actually free (observed directly against a bare
|
|
11
|
+
* `Bun.serve()` with no SDK code involved). Actively reading-and-discarding
|
|
12
|
+
* the rest of the body is the correct fix: it costs a little time
|
|
13
|
+
* proportional to the bytes the caller already sent, but leaves the
|
|
14
|
+
* connection immediately reusable. Best-effort — a drain failure must not
|
|
15
|
+
* mask the caller's own response/error.
|
|
16
|
+
*/
|
|
17
|
+
async function drainReader(reader) {
|
|
18
|
+
try {
|
|
19
|
+
for (;;) {
|
|
20
|
+
const { done } = await reader.read();
|
|
21
|
+
if (done)
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
// Best-effort.
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
async function drainBody(body) {
|
|
30
|
+
if (!body)
|
|
31
|
+
return;
|
|
32
|
+
const reader = body.getReader();
|
|
33
|
+
try {
|
|
34
|
+
await drainReader(reader);
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
reader.releaseLock();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function payloadTooLargeResponse(maxBytes) {
|
|
41
|
+
// Honest refusal: state the actual limit rather than a bare "too large" —
|
|
42
|
+
// a caller (browser composer, webhook sender, etc.) needs the number to
|
|
43
|
+
// decide whether to retry with a different transport (e.g. the artifact
|
|
44
|
+
// multipart/raw-body upload path) or shrink the payload.
|
|
45
|
+
return Response.json({ error: `Payload exceeds the ${maxBytes}-byte limit.` }, { status: 413 });
|
|
4
46
|
}
|
|
5
47
|
export async function readTextBodyWithinLimit(req, maxBytes = DEFAULT_MAX_REQUEST_BODY_BYTES) {
|
|
6
48
|
const contentLength = Number.parseInt(req.headers.get('content-length') ?? '0', 10);
|
|
7
49
|
if (Number.isFinite(contentLength) && contentLength > maxBytes) {
|
|
8
|
-
|
|
50
|
+
await drainBody(req.body);
|
|
51
|
+
return payloadTooLargeResponse(maxBytes);
|
|
9
52
|
}
|
|
10
53
|
if (!req.body)
|
|
11
54
|
return '';
|
|
@@ -20,8 +63,10 @@ export async function readTextBodyWithinLimit(req, maxBytes = DEFAULT_MAX_REQUES
|
|
|
20
63
|
break;
|
|
21
64
|
total += value.byteLength;
|
|
22
65
|
if (total > maxBytes) {
|
|
23
|
-
|
|
24
|
-
|
|
66
|
+
// Keep reading (and discarding) the rest of this oversized body
|
|
67
|
+
// rather than cancelling — see drainReader's doc comment.
|
|
68
|
+
await drainReader(reader);
|
|
69
|
+
return payloadTooLargeResponse(maxBytes);
|
|
25
70
|
}
|
|
26
71
|
body += decoder.decode(value, { stream: true });
|
|
27
72
|
}
|
package/dist/platform/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
let version = '1.
|
|
3
|
+
let version = '1.2.0';
|
|
4
4
|
try {
|
|
5
5
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
|
|
6
6
|
version = pkg.version ?? version;
|
|
@@ -4,4 +4,6 @@ export type { VoiceProviderDescriptor } from './provider-registry.js';
|
|
|
4
4
|
export { VoiceService } from './service.js';
|
|
5
5
|
export type { VoiceServiceStatus } from './service.js';
|
|
6
6
|
export { ensureBuiltinVoiceProviders } from './builtin-providers.js';
|
|
7
|
+
export { SpokenTurnController, TtsTextChunker, normalizeSpeechText } from './spoken-turn/index.js';
|
|
8
|
+
export type { SpokenTurnControllerOptions, TtsTextChunkerOptions, AudioSink, AudioSinkPlaybackOptions, } from './spoken-turn/index.js';
|
|
7
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/voice/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/platform/voice/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,2BAA2B,EAC3B,qBAAqB,EACrB,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,YAAY,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAIrE,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACnG,YAAY,EACV,2BAA2B,EAC3B,qBAAqB,EACrB,SAAS,EACT,wBAAwB,GACzB,MAAM,wBAAwB,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { VoiceProviderRegistry } from './provider-registry.js';
|
|
2
2
|
export { VoiceService } from './service.js';
|
|
3
3
|
export { ensureBuiltinVoiceProviders } from './builtin-providers.js';
|
|
4
|
+
// Spoken-turn (live TTS) policy engine — shared behavioral contract; consumers
|
|
5
|
+
// inject an AudioSink for I/O. See ./spoken-turn.
|
|
6
|
+
export { SpokenTurnController, TtsTextChunker, normalizeSpeechText } from './spoken-turn/index.js';
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { VoiceAudioChunk } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* AudioSink — the injectable I/O boundary the spoken-turn policy engine plays
|
|
4
|
+
* through. The SDK owns POLICY (chunking, the bounded synthesis window, merge
|
|
5
|
+
* coalescing, retry/backoff, the turn state machine); a sink owns I/O (turning
|
|
6
|
+
* an ordered stream of audio bytes into sound and reporting when it has stopped
|
|
7
|
+
* making sound). The controller never spawns a process, opens a device, or
|
|
8
|
+
* touches Web Audio — it only talks to this interface, so the same policy runs
|
|
9
|
+
* unchanged behind a terminal subprocess player, a browser Web Audio sink, or a
|
|
10
|
+
* test fake.
|
|
11
|
+
*
|
|
12
|
+
* ## Behavioral contract
|
|
13
|
+
*
|
|
14
|
+
* The controller depends on these guarantees, not on any implementation detail:
|
|
15
|
+
*
|
|
16
|
+
* 1. **Readiness / head survival.** `play()` must not drop the leading bytes of
|
|
17
|
+
* the stream while the underlying output is still coming up. A subprocess
|
|
18
|
+
* sink holds the first byte until the player has actually exec'd (its spawn
|
|
19
|
+
* event); a browser sink holds until the MediaSource `sourceopen` /
|
|
20
|
+
* SourceBuffer is ready. The controller writes the whole stream and trusts
|
|
21
|
+
* the sink to have played the head — it does not re-send or pre-buffer.
|
|
22
|
+
* `available` is the coarse, synchronous readiness signal (is any output
|
|
23
|
+
* device usable at all); per-call readiness is internal to `play()`.
|
|
24
|
+
*
|
|
25
|
+
* 2. **Natural drain plays everything.** When the input stream ends without an
|
|
26
|
+
* abort, `play()` resolves only after the last buffered sample has been
|
|
27
|
+
* heard — never at end-of-input. Truncating the tail of a response is the
|
|
28
|
+
* bug this contract exists to prevent.
|
|
29
|
+
*
|
|
30
|
+
* 3. **Abort cuts immediately.** When `options.signal` aborts (a deliberate
|
|
31
|
+
* interrupt — new turn, Ctrl+C, /tts stop, turn cancel), `play()` stops
|
|
32
|
+
* emitting sound and resolves promptly; it must NOT wait on a graceful
|
|
33
|
+
* drain. `stop()` is the same instant cut driven imperatively rather than by
|
|
34
|
+
* a signal.
|
|
35
|
+
*
|
|
36
|
+
* 4. **Bounded exit drain.** `waitForDrain(timeoutMs)` resolves when the sound
|
|
37
|
+
* currently playing finishes naturally OR after `timeoutMs`, whichever comes
|
|
38
|
+
* first, and resolves immediately when nothing is playing. The exit path
|
|
39
|
+
* uses this to let the final audio of a finished response play out inside a
|
|
40
|
+
* short window instead of being cut mid-word.
|
|
41
|
+
*
|
|
42
|
+
* ## Web Audio / browser sink mapping (proof the interface fits a browser)
|
|
43
|
+
*
|
|
44
|
+
* A browser sink for the webui voice build implements this same interface over
|
|
45
|
+
* streaming MP3 into MediaSource; no interface change is required:
|
|
46
|
+
*
|
|
47
|
+
* - `available` -> `('MediaSource' in window) && MediaSource.isTypeSupported('audio/mpeg')`
|
|
48
|
+
* (fall back to Web Audio `decodeAudioData` where MSE is absent).
|
|
49
|
+
* - `play(chunks, { format, signal })` ->
|
|
50
|
+
* - create a `MediaSource`, attach it to an `HTMLAudioElement` via
|
|
51
|
+
* `URL.createObjectURL`, and `await` its `sourceopen` event — this is the
|
|
52
|
+
* readiness gate (contract 1);
|
|
53
|
+
* - `addSourceBuffer(mimeFor(format))` where `mimeFor('mp3') === 'audio/mpeg'`
|
|
54
|
+
* (the same `format` string the controller forwards from the synthesis
|
|
55
|
+
* result), then `await audioEl.play()`;
|
|
56
|
+
* - `for await (const chunk of chunks)` -> `sourceBuffer.appendBuffer(chunk.data)`,
|
|
57
|
+
* awaiting each `updateend`, honoring `signal.aborted` between chunks;
|
|
58
|
+
* - on input end without abort: `mediaSource.endOfStream()` and resolve on
|
|
59
|
+
* the audio element's `ended` event -> natural drain (contract 2);
|
|
60
|
+
* - on `signal` abort: `audioEl.pause()`, `sourceBuffer.abort()`,
|
|
61
|
+
* `mediaSource.endOfStream()`, revoke the object URL, resolve now
|
|
62
|
+
* (contract 3).
|
|
63
|
+
* - `stop()` -> the same teardown as the abort branch, driven imperatively.
|
|
64
|
+
* - `waitForDrain(timeoutMs)` -> resolve on the audio element's `ended` event or
|
|
65
|
+
* a `setTimeout(timeoutMs)`, whichever fires first (contract 4).
|
|
66
|
+
*
|
|
67
|
+
* `VoiceAudioChunk.data` is a `Uint8Array`, which `appendBuffer` accepts
|
|
68
|
+
* directly, and the `format` string maps 1:1 to a MediaSource MIME type, so the
|
|
69
|
+
* byte-and-format shape the controller emits is exactly what a browser sink
|
|
70
|
+
* consumes. (The subprocess sink — mpv/ffplay over stdin — stays consumer-side
|
|
71
|
+
* and is not part of the SDK.)
|
|
72
|
+
*/
|
|
73
|
+
export interface AudioSink {
|
|
74
|
+
/** Human-readable sink name for status lines (e.g. 'mpv', 'web-audio'). */
|
|
75
|
+
readonly label: string;
|
|
76
|
+
/**
|
|
77
|
+
* Coarse, synchronous readiness: is any output device usable at all. When
|
|
78
|
+
* false the controller arms nothing and reports the graceful-degradation
|
|
79
|
+
* notice instead of attempting playback.
|
|
80
|
+
*/
|
|
81
|
+
readonly available: boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Play an ordered stream of audio chunks to completion. Resolves after the
|
|
84
|
+
* final sample is heard on a natural end, or promptly on abort. See the
|
|
85
|
+
* interface contract above for readiness, drain, and abort obligations.
|
|
86
|
+
*/
|
|
87
|
+
play(chunks: AsyncIterable<VoiceAudioChunk>, options: AudioSinkPlaybackOptions): Promise<void>;
|
|
88
|
+
/** Instant cut: stop emitting sound now and release the output. Idempotent; a no-op when idle. */
|
|
89
|
+
stop(): void;
|
|
90
|
+
/**
|
|
91
|
+
* Resolves once the currently playing sound has finished naturally or after
|
|
92
|
+
* `timeoutMs`, whichever comes first; resolves immediately when nothing is
|
|
93
|
+
* playing. The bounded exit drain — see contract 4.
|
|
94
|
+
*/
|
|
95
|
+
waitForDrain(timeoutMs: number): Promise<void>;
|
|
96
|
+
}
|
|
97
|
+
export interface AudioSinkPlaybackOptions {
|
|
98
|
+
/**
|
|
99
|
+
* Container/codec hint for the byte stream (e.g. 'mp3'), forwarded verbatim
|
|
100
|
+
* from the synthesis result's `format`. A subprocess sink maps it to a
|
|
101
|
+
* demuxer flag; a browser sink maps it to a MediaSource MIME type. Omitted or
|
|
102
|
+
* a value containing '/' (already a MIME type) leaves the sink on its default.
|
|
103
|
+
*/
|
|
104
|
+
readonly format?: string | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Deliberate-interrupt signal. When it aborts, playback cuts immediately (no
|
|
107
|
+
* graceful drain) and `play()` resolves. Absence means "play to natural end".
|
|
108
|
+
*/
|
|
109
|
+
readonly signal?: AbortSignal | undefined;
|
|
110
|
+
}
|
|
111
|
+
//# sourceMappingURL=audio-sink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio-sink.d.ts","sourceRoot":"","sources":["../../../../src/platform/voice/spoken-turn/audio-sink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,MAAM,WAAW,SAAS;IACxB,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,kGAAkG;IAClG,IAAI,IAAI,IAAI,CAAC;IACb;;;;OAIG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,wBAAwB;IACvC;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|