@pellux/goodvibes-sdk 1.0.0 → 1.1.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 +1320 -10
- 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 +83 -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 +8 -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 +43 -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 +127 -0
- package/dist/platform/runtime/memory-spine/client.d.ts.map +1 -0
- package/dist/platform/runtime/memory-spine/client.js +113 -0
- package/dist/platform/runtime/memory-spine/index.d.ts +11 -0
- package/dist/platform/runtime/memory-spine/index.d.ts.map +1 -0
- package/dist/platform/runtime/memory-spine/index.js +10 -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/package.json +13 -9
|
@@ -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,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,8DAA8D;IAC9D,YAAY,CA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AO,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.1.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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pellux/goodvibes-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "TypeScript SDK for building GoodVibes operator, peer, web, mobile, and daemon-connected apps with typed contracts, auth, realtime events, and transport layers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goodvibes",
|
|
@@ -348,6 +348,10 @@
|
|
|
348
348
|
"types": "./dist/platform/runtime/sandbox.d.ts",
|
|
349
349
|
"import": "./dist/platform/runtime/sandbox.js"
|
|
350
350
|
},
|
|
351
|
+
"./platform/runtime/memory-spine": {
|
|
352
|
+
"types": "./dist/platform/runtime/memory-spine/index.d.ts",
|
|
353
|
+
"import": "./dist/platform/runtime/memory-spine/index.js"
|
|
354
|
+
},
|
|
351
355
|
"./platform/runtime/session-spine": {
|
|
352
356
|
"types": "./dist/platform/runtime/session-spine/index.d.ts",
|
|
353
357
|
"import": "./dist/platform/runtime/session-spine/index.js"
|
|
@@ -473,14 +477,14 @@
|
|
|
473
477
|
"sideEffects": false,
|
|
474
478
|
"type": "module",
|
|
475
479
|
"dependencies": {
|
|
476
|
-
"@pellux/goodvibes-contracts": "1.
|
|
477
|
-
"@pellux/goodvibes-daemon-sdk": "1.
|
|
478
|
-
"@pellux/goodvibes-errors": "1.
|
|
479
|
-
"@pellux/goodvibes-operator-sdk": "1.
|
|
480
|
-
"@pellux/goodvibes-peer-sdk": "1.
|
|
481
|
-
"@pellux/goodvibes-transport-core": "1.
|
|
482
|
-
"@pellux/goodvibes-transport-http": "1.
|
|
483
|
-
"@pellux/goodvibes-transport-realtime": "1.
|
|
480
|
+
"@pellux/goodvibes-contracts": "1.1.0",
|
|
481
|
+
"@pellux/goodvibes-daemon-sdk": "1.1.0",
|
|
482
|
+
"@pellux/goodvibes-errors": "1.1.0",
|
|
483
|
+
"@pellux/goodvibes-operator-sdk": "1.1.0",
|
|
484
|
+
"@pellux/goodvibes-peer-sdk": "1.1.0",
|
|
485
|
+
"@pellux/goodvibes-transport-core": "1.1.0",
|
|
486
|
+
"@pellux/goodvibes-transport-http": "1.1.0",
|
|
487
|
+
"@pellux/goodvibes-transport-realtime": "1.1.0"
|
|
484
488
|
},
|
|
485
489
|
"optionalDependencies": {
|
|
486
490
|
"@agentclientprotocol/sdk": "^0.21.0",
|