@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
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* push/types.ts
|
|
3
|
+
*
|
|
4
|
+
* Shared shapes for the browser-push subscription lifecycle and delivery path.
|
|
5
|
+
*
|
|
6
|
+
* Custody note: a stored subscription's `endpoint` is a capability URL (anyone
|
|
7
|
+
* holding it can push to that device) and its `keys` are the receiver's
|
|
8
|
+
* encryption material. Neither is ever returned over the wire — read verbs
|
|
9
|
+
* hand back the redacted `PublicPushSubscription` view instead. The VAPID
|
|
10
|
+
* private key never appears in any shape here at all; it lives only inside the
|
|
11
|
+
* secrets store (see push/vapid.ts).
|
|
12
|
+
*/
|
|
13
|
+
import type { SubscriptionKeyMaterial } from './encryption.js';
|
|
14
|
+
export type { SubscriptionKeyMaterial } from './encryption.js';
|
|
15
|
+
/** A subscription as stored on disk (contains capability URL + key material). */
|
|
16
|
+
export interface StoredPushSubscription {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
/** The principal (operator identity) that registered this device. */
|
|
19
|
+
readonly principalId: string;
|
|
20
|
+
/** The browser Push endpoint — a capability URL, kept off the wire. */
|
|
21
|
+
readonly endpoint: string;
|
|
22
|
+
readonly keys: SubscriptionKeyMaterial;
|
|
23
|
+
readonly createdAt: number;
|
|
24
|
+
/** Timestamp of the last delivery attempt, if any. */
|
|
25
|
+
readonly lastDeliveryAt?: number | undefined;
|
|
26
|
+
/** Outcome of the last delivery attempt, if any. */
|
|
27
|
+
readonly lastOutcome?: PushDeliveryOutcome | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The redacted, wire-safe view of a subscription. The capability URL and key
|
|
31
|
+
* material are deliberately absent; the origin + short hash are enough to
|
|
32
|
+
* identify a device in a management UI without handing the capability back out.
|
|
33
|
+
*/
|
|
34
|
+
export interface PublicPushSubscription {
|
|
35
|
+
readonly id: string;
|
|
36
|
+
readonly principalId: string;
|
|
37
|
+
/** The endpoint's origin only (e.g. `https://push.example`), never the full path. */
|
|
38
|
+
readonly endpointOrigin: string;
|
|
39
|
+
/** A short, stable hash of the full endpoint, for de-duplication in a UI. */
|
|
40
|
+
readonly endpointHash: string;
|
|
41
|
+
readonly createdAt: number;
|
|
42
|
+
readonly lastDeliveryAt?: number | undefined;
|
|
43
|
+
readonly lastOutcome?: PushDeliveryOutcome | undefined;
|
|
44
|
+
}
|
|
45
|
+
export type PushDeliveryOutcome = 'delivered' | 'pruned' | 'failed' | 'skipped';
|
|
46
|
+
/** Per-subscription result of a delivery fan-out, honest about what happened. */
|
|
47
|
+
export interface PushDeliveryReceipt {
|
|
48
|
+
readonly subscriptionId: string;
|
|
49
|
+
readonly endpointOrigin: string;
|
|
50
|
+
readonly outcome: PushDeliveryOutcome;
|
|
51
|
+
/** The push service's HTTP status, when a request was actually made. */
|
|
52
|
+
readonly httpStatus?: number | undefined;
|
|
53
|
+
/** Plain-language reason, especially for `pruned`/`failed`/`skipped`. */
|
|
54
|
+
readonly detail?: string | undefined;
|
|
55
|
+
}
|
|
56
|
+
/** Message urgency, mapped straight onto the push `Urgency` header. */
|
|
57
|
+
export type PushUrgency = 'very-low' | 'low' | 'normal' | 'high';
|
|
58
|
+
/** The notification a caller wants delivered to the operator's devices. */
|
|
59
|
+
export interface PushMessage {
|
|
60
|
+
readonly title: string;
|
|
61
|
+
readonly body: string;
|
|
62
|
+
/** Optional structured data the service worker can act on (e.g. a deep link). */
|
|
63
|
+
readonly data?: Record<string, unknown> | undefined;
|
|
64
|
+
readonly urgency?: PushUrgency | undefined;
|
|
65
|
+
/** How long (seconds) the push service should retain the message if offline. */
|
|
66
|
+
readonly ttlSeconds?: number | undefined;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/platform/push/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D,YAAY,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE/D,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AAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,uEAAuE;AACvE,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjE,2EAA2E;AAC3E,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,iFAAiF;IACjF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACpD,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;IAC3C,gFAAgF;IAChF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* push/types.ts
|
|
3
|
+
*
|
|
4
|
+
* Shared shapes for the browser-push subscription lifecycle and delivery path.
|
|
5
|
+
*
|
|
6
|
+
* Custody note: a stored subscription's `endpoint` is a capability URL (anyone
|
|
7
|
+
* holding it can push to that device) and its `keys` are the receiver's
|
|
8
|
+
* encryption material. Neither is ever returned over the wire — read verbs
|
|
9
|
+
* hand back the redacted `PublicPushSubscription` view instead. The VAPID
|
|
10
|
+
* private key never appears in any shape here at all; it lives only inside the
|
|
11
|
+
* secrets store (see push/vapid.ts).
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* push/vapid.ts
|
|
3
|
+
*
|
|
4
|
+
* VAPID (RFC 8292) key custody and request signing for browser push.
|
|
5
|
+
*
|
|
6
|
+
* KEY CUSTODY — the load-bearing rule of this file:
|
|
7
|
+
* - The daemon generates one P-256 keypair on first need.
|
|
8
|
+
* - The WHOLE keypair (including the private component) is persisted only
|
|
9
|
+
* through the SecretsManager, exactly like any other credential — into the
|
|
10
|
+
* secure store, or the plaintext secrets file, per the active secret policy.
|
|
11
|
+
* It is NEVER written into the config, so it can never ride out in the
|
|
12
|
+
* secret-free config snapshot.
|
|
13
|
+
* - The private key is used only here, to sign the short-lived VAPID JWT that
|
|
14
|
+
* authorizes one delivery. It is never logged and never returned by any read
|
|
15
|
+
* verb.
|
|
16
|
+
* - Only the PUBLIC key leaves the daemon: `getPublicKey()` feeds the
|
|
17
|
+
* `push.vapid.get` verb and the `k=` parameter of the Authorization header.
|
|
18
|
+
*/
|
|
19
|
+
/** The narrow slice of SecretsManager this module needs — get/set one secret. */
|
|
20
|
+
export interface VapidSecretStore {
|
|
21
|
+
get(key: string): Promise<string | null>;
|
|
22
|
+
set(key: string, value: string): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
export interface VapidManagerOptions {
|
|
25
|
+
/**
|
|
26
|
+
* The `sub` claim of the VAPID JWT — a `mailto:` or `https:` contact the push
|
|
27
|
+
* service can reach. Defaults to a local mailto when unset.
|
|
28
|
+
*/
|
|
29
|
+
readonly subject?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
/** The secret key under which the keypair is stored (a secrets-store key, not a config key). */
|
|
32
|
+
export declare const VAPID_SECRET_KEY = "push.vapid.keypair";
|
|
33
|
+
export declare class VapidManager {
|
|
34
|
+
private readonly store;
|
|
35
|
+
private readonly subject;
|
|
36
|
+
private inflight;
|
|
37
|
+
constructor(store: VapidSecretStore, options?: VapidManagerOptions);
|
|
38
|
+
/** The public application-server key clients subscribe with. Generates on first call. */
|
|
39
|
+
getPublicKey(): Promise<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Build the `Authorization: vapid ...` header value for one delivery to
|
|
42
|
+
* `endpoint`. The JWT's audience is the endpoint's origin (RFC 8292).
|
|
43
|
+
*/
|
|
44
|
+
buildAuthorizationHeader(endpoint: string): Promise<string>;
|
|
45
|
+
private signJwt;
|
|
46
|
+
/**
|
|
47
|
+
* Load the keypair from the secrets store, or generate and persist one on
|
|
48
|
+
* first use. Concurrent callers share a single in-flight generation so two
|
|
49
|
+
* simultaneous first-time deliveries cannot mint two keypairs.
|
|
50
|
+
*/
|
|
51
|
+
private ensureKeypair;
|
|
52
|
+
private loadOrGenerate;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=vapid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vapid.d.ts","sourceRoot":"","sources":["../../../src/platform/push/vapid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,iFAAiF;AACjF,MAAM,WAAW,gBAAgB;IAC/B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACzC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAChD;AASD,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC;AAED,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,uBAAuB,CAAC;AAyBrD,qBAAa,YAAY;IAIX,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHlC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAA4C;gBAE/B,KAAK,EAAE,gBAAgB,EAAE,OAAO,GAAE,mBAAwB;IAIvF,yFAAyF;IACnF,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IAKrC;;;OAGG;IACG,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAOjE,OAAO,CAAC,OAAO;IAkBf;;;;OAIG;IACH,OAAO,CAAC,aAAa;YAUP,cAAc;CAe7B"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* push/vapid.ts
|
|
3
|
+
*
|
|
4
|
+
* VAPID (RFC 8292) key custody and request signing for browser push.
|
|
5
|
+
*
|
|
6
|
+
* KEY CUSTODY — the load-bearing rule of this file:
|
|
7
|
+
* - The daemon generates one P-256 keypair on first need.
|
|
8
|
+
* - The WHOLE keypair (including the private component) is persisted only
|
|
9
|
+
* through the SecretsManager, exactly like any other credential — into the
|
|
10
|
+
* secure store, or the plaintext secrets file, per the active secret policy.
|
|
11
|
+
* It is NEVER written into the config, so it can never ride out in the
|
|
12
|
+
* secret-free config snapshot.
|
|
13
|
+
* - The private key is used only here, to sign the short-lived VAPID JWT that
|
|
14
|
+
* authorizes one delivery. It is never logged and never returned by any read
|
|
15
|
+
* verb.
|
|
16
|
+
* - Only the PUBLIC key leaves the daemon: `getPublicKey()` feeds the
|
|
17
|
+
* `push.vapid.get` verb and the `k=` parameter of the Authorization header.
|
|
18
|
+
*/
|
|
19
|
+
import { createPrivateKey, generateKeyPairSync, sign as cryptoSign } from 'node:crypto';
|
|
20
|
+
/** The secret key under which the keypair is stored (a secrets-store key, not a config key). */
|
|
21
|
+
export const VAPID_SECRET_KEY = 'push.vapid.keypair';
|
|
22
|
+
const DEFAULT_SUBJECT = 'mailto:goodvibes-push@localhost';
|
|
23
|
+
/** VAPID JWTs are short-lived; RFC 8292 caps `exp` at 24h. Use 12h. */
|
|
24
|
+
const JWT_LIFETIME_SECONDS = 12 * 60 * 60;
|
|
25
|
+
function base64UrlFromBuffer(buffer) {
|
|
26
|
+
return buffer.toString('base64url');
|
|
27
|
+
}
|
|
28
|
+
function base64UrlJson(value) {
|
|
29
|
+
return Buffer.from(JSON.stringify(value), 'utf8').toString('base64url');
|
|
30
|
+
}
|
|
31
|
+
/** Derive the 65-byte uncompressed public point (base64url) from a P-256 JWK. */
|
|
32
|
+
function publicKeyFromJwk(jwk) {
|
|
33
|
+
if (!jwk.x || !jwk.y)
|
|
34
|
+
throw new Error('VAPID JWK is missing its public coordinates');
|
|
35
|
+
const point = Buffer.concat([
|
|
36
|
+
Buffer.from([0x04]),
|
|
37
|
+
Buffer.from(jwk.x, 'base64url'),
|
|
38
|
+
Buffer.from(jwk.y, 'base64url'),
|
|
39
|
+
]);
|
|
40
|
+
return base64UrlFromBuffer(point);
|
|
41
|
+
}
|
|
42
|
+
export class VapidManager {
|
|
43
|
+
store;
|
|
44
|
+
subject;
|
|
45
|
+
inflight = null;
|
|
46
|
+
constructor(store, options = {}) {
|
|
47
|
+
this.store = store;
|
|
48
|
+
this.subject = options.subject && options.subject.length > 0 ? options.subject : DEFAULT_SUBJECT;
|
|
49
|
+
}
|
|
50
|
+
/** The public application-server key clients subscribe with. Generates on first call. */
|
|
51
|
+
async getPublicKey() {
|
|
52
|
+
const keypair = await this.ensureKeypair();
|
|
53
|
+
return keypair.publicKey;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Build the `Authorization: vapid ...` header value for one delivery to
|
|
57
|
+
* `endpoint`. The JWT's audience is the endpoint's origin (RFC 8292).
|
|
58
|
+
*/
|
|
59
|
+
async buildAuthorizationHeader(endpoint) {
|
|
60
|
+
const keypair = await this.ensureKeypair();
|
|
61
|
+
const audience = new URL(endpoint).origin;
|
|
62
|
+
const jwt = this.signJwt(audience, keypair.privateJwk);
|
|
63
|
+
return `vapid t=${jwt}, k=${keypair.publicKey}`;
|
|
64
|
+
}
|
|
65
|
+
signJwt(audience, privateJwk) {
|
|
66
|
+
const header = base64UrlJson({ typ: 'JWT', alg: 'ES256' });
|
|
67
|
+
const payload = base64UrlJson({
|
|
68
|
+
aud: audience,
|
|
69
|
+
exp: Math.floor(Date.now() / 1000) + JWT_LIFETIME_SECONDS,
|
|
70
|
+
sub: this.subject,
|
|
71
|
+
});
|
|
72
|
+
const signingInput = `${header}.${payload}`;
|
|
73
|
+
const key = createPrivateKey({ key: privateJwk, format: 'jwk' });
|
|
74
|
+
// ieee-p1363 gives the raw r||s (64-byte) JOSE signature ES256 requires,
|
|
75
|
+
// not Node's default DER encoding.
|
|
76
|
+
const signature = cryptoSign('sha256', Buffer.from(signingInput, 'utf8'), {
|
|
77
|
+
key,
|
|
78
|
+
dsaEncoding: 'ieee-p1363',
|
|
79
|
+
});
|
|
80
|
+
return `${signingInput}.${base64UrlFromBuffer(signature)}`;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Load the keypair from the secrets store, or generate and persist one on
|
|
84
|
+
* first use. Concurrent callers share a single in-flight generation so two
|
|
85
|
+
* simultaneous first-time deliveries cannot mint two keypairs.
|
|
86
|
+
*/
|
|
87
|
+
ensureKeypair() {
|
|
88
|
+
if (this.inflight)
|
|
89
|
+
return this.inflight;
|
|
90
|
+
this.inflight = this.loadOrGenerate().catch((error) => {
|
|
91
|
+
// A failed attempt must not poison every later call.
|
|
92
|
+
this.inflight = null;
|
|
93
|
+
throw error;
|
|
94
|
+
});
|
|
95
|
+
return this.inflight;
|
|
96
|
+
}
|
|
97
|
+
async loadOrGenerate() {
|
|
98
|
+
const existing = await this.store.get(VAPID_SECRET_KEY);
|
|
99
|
+
if (existing) {
|
|
100
|
+
const parsed = JSON.parse(existing);
|
|
101
|
+
if (parsed.publicKey && parsed.privateJwk)
|
|
102
|
+
return parsed;
|
|
103
|
+
}
|
|
104
|
+
const { publicKey, privateKey } = generateKeyPairSync('ec', { namedCurve: 'prime256v1' });
|
|
105
|
+
const privateJwk = privateKey.export({ format: 'jwk' });
|
|
106
|
+
const keypair = {
|
|
107
|
+
publicKey: publicKeyFromJwk(publicKey.export({ format: 'jwk' })),
|
|
108
|
+
privateJwk,
|
|
109
|
+
};
|
|
110
|
+
await this.store.set(VAPID_SECRET_KEY, JSON.stringify(keypair));
|
|
111
|
+
return keypair;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -343,9 +343,9 @@ export const FEATURE_FLAGS = [
|
|
|
343
343
|
runtimeToggleable: true,
|
|
344
344
|
},
|
|
345
345
|
{
|
|
346
|
-
// NOTE: control-plane-gateway is the ONE tier-10 flag that defaults ON (One-Platform
|
|
347
|
-
//
|
|
348
|
-
// leaving this OFF made a fresh daemon return 503 on the live-stream path (the
|
|
346
|
+
// NOTE: control-plane-gateway is the ONE tier-10 flag that defaults ON (One-Platform).
|
|
347
|
+
// A stock daemon (no config) must be able to stream companion chat over SSE;
|
|
348
|
+
// leaving this OFF made a fresh daemon return 503 on the live-stream path (the
|
|
349
349
|
// "stock daemon is dead" bug).
|
|
350
350
|
//
|
|
351
351
|
// HONEST SURFACE STATEMENT: flipping this default ON DOES expose surface — just not
|
|
@@ -5,7 +5,7 @@ import type { ProcessActivity, ProcessNode, ProcessState, ProcessUsage } from '.
|
|
|
5
5
|
export declare function chainNodeId(chainId: string): string;
|
|
6
6
|
/** Subtask node ids are namespaced to avoid colliding with agent/process ids. */
|
|
7
7
|
export declare function subtaskNodeId(subtaskId: string): string;
|
|
8
|
-
/** Work-item node ids are namespaced to avoid colliding with agent/process ids
|
|
8
|
+
/** Work-item node ids are namespaced to avoid colliding with agent/process ids. */
|
|
9
9
|
export declare function workItemNodeId(workItemId: string): string;
|
|
10
10
|
/**
|
|
11
11
|
* One activity side-table entry. Registry-owned; populated from the EXISTING
|
|
@@ -35,7 +35,7 @@ export interface AgentAdapterContext {
|
|
|
35
35
|
readonly chainIds: ReadonlySet<string>;
|
|
36
36
|
/** Raw WrfcSubtask ids present in this snapshot. */
|
|
37
37
|
readonly subtaskIds: ReadonlySet<string>;
|
|
38
|
-
/** Raw orchestration-engine WorkItem ids present in this snapshot
|
|
38
|
+
/** Raw orchestration-engine WorkItem ids present in this snapshot. */
|
|
39
39
|
readonly workItemIds: ReadonlySet<string>;
|
|
40
40
|
/** orchestrationNodeId → owning agentId, for parentNodeId edge resolution. */
|
|
41
41
|
readonly agentIdByOrchestrationNodeId: ReadonlyMap<string, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../../../src/platform/runtime/fleet/adapters/agent.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK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@ export function chainNodeId(chainId) {
|
|
|
7
7
|
export function subtaskNodeId(subtaskId) {
|
|
8
8
|
return `subtask:${subtaskId}`;
|
|
9
9
|
}
|
|
10
|
-
/** Work-item node ids are namespaced to avoid colliding with agent/process ids
|
|
10
|
+
/** Work-item node ids are namespaced to avoid colliding with agent/process ids. */
|
|
11
11
|
export function workItemNodeId(workItemId) {
|
|
12
12
|
return `work-item:${workItemId}`;
|
|
13
13
|
}
|
|
@@ -27,9 +27,9 @@ export function usageFromAgentRecord(record) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* parentId precedence (brief-mandated,
|
|
30
|
+
* parentId precedence (brief-mandated, stable):
|
|
31
31
|
* wrfcSubtaskId → `subtask:<id>` else wrfcId → `chain:<id>` else
|
|
32
|
-
* workItemId → `work-item:<id>` (
|
|
32
|
+
* workItemId → `work-item:<id>` (orchestration-engine phase
|
|
33
33
|
* agents, a separate track from WRFC so the two systems' agents are never
|
|
34
34
|
* conflated) else orchestrationNodeId/parentNodeId (resolved to the owning
|
|
35
35
|
* agent) else parentAgentId. Every step falls through when the referenced
|
|
@@ -64,7 +64,7 @@ function deriveAgentState(record, entry, sessionId, ctx) {
|
|
|
64
64
|
return 'failed';
|
|
65
65
|
case 'cancelled':
|
|
66
66
|
// terminationKind distinguishes a graceful interrupt request from a hard
|
|
67
|
-
// kill for display purposes
|
|
67
|
+
// kill for display purposes. Records
|
|
68
68
|
// persisted before this field existed have no terminationKind and
|
|
69
69
|
// default to 'killed' — the historical behavior.
|
|
70
70
|
return record.terminationKind === 'interrupt' ? 'interrupted' : 'killed';
|
|
@@ -17,7 +17,7 @@ export interface AutomationJobRaw {
|
|
|
17
17
|
/** Type guard for AutomationJobRaw, used by registry.ts to distinguish an automation-job 'schedule' node's `raw` from a workflow-tool ScheduleEntry's `raw` — both share the 'schedule' kind. */
|
|
18
18
|
export declare function isAutomationJobRaw(raw: unknown): raw is AutomationJobRaw;
|
|
19
19
|
/**
|
|
20
|
-
* AutomationJob → ProcessNode
|
|
20
|
+
* AutomationJob → ProcessNode. Reuses the 'schedule'
|
|
21
21
|
* kind rather than inventing a new one — a job created via `/schedule` IS a
|
|
22
22
|
* schedule from the user's viewpoint, even though it lives in a completely
|
|
23
23
|
* separate subsystem (platform/automation) from the workflow-tool's
|
|
@@ -14,7 +14,7 @@ export function isAutomationJobRaw(raw) {
|
|
|
14
14
|
return raw !== null && typeof raw === 'object' && raw.source === 'automation-manager';
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* AutomationJob → ProcessNode
|
|
17
|
+
* AutomationJob → ProcessNode. Reuses the 'schedule'
|
|
18
18
|
* kind rather than inventing a new one — a job created via `/schedule` IS a
|
|
19
19
|
* schedule from the user's viewpoint, even though it lives in a completely
|
|
20
20
|
* separate subsystem (platform/automation) from the workflow-tool's
|
|
@@ -15,7 +15,7 @@ export declare function codeIndexNodeId(): string;
|
|
|
15
15
|
* background-process): liveness rides the registry tick. An index build has
|
|
16
16
|
* no pid, so it is NOT a 'background-process' node (ProcessManager is
|
|
17
17
|
* shell/OS-process-only) — it gets its own ProcessKind, mirroring the
|
|
18
|
-
*
|
|
18
|
+
* orchestrationEngine-dep precedent.
|
|
19
19
|
*/
|
|
20
20
|
export declare function adaptCodeIndex(service: CodeIndexProcessSource, now: number): ProcessNode;
|
|
21
21
|
//# sourceMappingURL=code-index.d.ts.map
|
|
@@ -8,7 +8,7 @@ export function codeIndexNodeId() {
|
|
|
8
8
|
* background-process): liveness rides the registry tick. An index build has
|
|
9
9
|
* no pid, so it is NOT a 'background-process' node (ProcessManager is
|
|
10
10
|
* shell/OS-process-only) — it gets its own ProcessKind, mirroring the
|
|
11
|
-
*
|
|
11
|
+
* orchestrationEngine-dep precedent.
|
|
12
12
|
*/
|
|
13
13
|
export function adaptCodeIndex(service, now) {
|
|
14
14
|
const building = service.isBuilding();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
2
|
/**
|
|
3
|
-
* Orchestration-engine fleet adapters
|
|
3
|
+
* Orchestration-engine fleet adapters — Workstream/Phase/
|
|
4
4
|
* WorkItem -> ProcessNode, mirroring adapters/wrfc.ts's chain/subtask
|
|
5
5
|
* pattern: a workstream is a root node (no native cancel of its own, so kill
|
|
6
6
|
* is DERIVED — cascades AgentManager.cancel over every agent any item ever
|
|
@@ -5,10 +5,10 @@ import type { ProcessNode } from '../types.js';
|
|
|
5
5
|
export declare function scheduleNodeId(name: string): string;
|
|
6
6
|
/**
|
|
7
7
|
* ScheduleEntry → ProcessNode. A schedule between runs is honestly 'idle'
|
|
8
|
-
* (not force-fit into an active state); disabled maps to 'paused' (
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* (not force-fit into an active state); disabled maps to 'paused' (NOT
|
|
9
|
+
* 'killed': the entry still exists and ScheduleManager.enable() can re-arm
|
|
10
|
+
* it, so collapsing it into a terminal state was dishonest). resumable
|
|
11
|
+
* mirrors the inverse of pausable.
|
|
12
12
|
*/
|
|
13
13
|
export declare function adaptSchedule(entry: ScheduleEntry): ProcessNode;
|
|
14
14
|
//# sourceMappingURL=schedule.d.ts.map
|
|
@@ -5,10 +5,10 @@ export function scheduleNodeId(name) {
|
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
7
7
|
* ScheduleEntry → ProcessNode. A schedule between runs is honestly 'idle'
|
|
8
|
-
* (not force-fit into an active state); disabled maps to 'paused' (
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* (not force-fit into an active state); disabled maps to 'paused' (NOT
|
|
9
|
+
* 'killed': the entry still exists and ScheduleManager.enable() can re-arm
|
|
10
|
+
* it, so collapsing it into a terminal state was dishonest). resumable
|
|
11
|
+
* mirrors the inverse of pausable.
|
|
12
12
|
*/
|
|
13
13
|
export function adaptSchedule(entry) {
|
|
14
14
|
return {
|
|
@@ -3,10 +3,9 @@ import type { TriggerDefinition } from '../../../tools/workflow/index.js';
|
|
|
3
3
|
import type { ProcessNode } from '../types.js';
|
|
4
4
|
/**
|
|
5
5
|
* TriggerDefinition → ProcessNode. Triggers have no timestamps and no run
|
|
6
|
-
* state — enabled means armed ('idle'), disabled maps to 'paused' (
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* pausable.
|
|
6
|
+
* state — enabled means armed ('idle'), disabled maps to 'paused' (NOT
|
|
7
|
+
* 'killed': the definition still exists and TriggerManager.enable() can
|
|
8
|
+
* re-arm it). resumable mirrors the inverse of pausable.
|
|
10
9
|
*/
|
|
11
10
|
export declare function adaptTrigger(def: TriggerDefinition): ProcessNode;
|
|
12
11
|
//# sourceMappingURL=trigger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../../src/platform/runtime/fleet/adapters/trigger.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"trigger.d.ts","sourceRoot":"","sources":["../../../../../src/platform/runtime/fleet/adapters/trigger.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,iBAAiB,GAAG,WAAW,CAahE"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
2
|
/**
|
|
3
3
|
* TriggerDefinition → ProcessNode. Triggers have no timestamps and no run
|
|
4
|
-
* state — enabled means armed ('idle'), disabled maps to 'paused' (
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* pausable.
|
|
4
|
+
* state — enabled means armed ('idle'), disabled maps to 'paused' (NOT
|
|
5
|
+
* 'killed': the definition still exists and TriggerManager.enable() can
|
|
6
|
+
* re-arm it). resumable mirrors the inverse of pausable.
|
|
8
7
|
*/
|
|
9
8
|
export function adaptTrigger(def) {
|
|
10
9
|
return {
|
|
@@ -135,7 +135,7 @@ function sumUsage(nodes) {
|
|
|
135
135
|
*
|
|
136
136
|
* The owner agent is EXCLUDED from aggregation: it runs no LLM turns itself —
|
|
137
137
|
* its AgentRecord.usage is populated FROM the phase children at completion
|
|
138
|
-
* time
|
|
138
|
+
* time, so including it would double-count.
|
|
139
139
|
*/
|
|
140
140
|
function aggregateCost(members) {
|
|
141
141
|
const withUsage = members.filter((node) => node.usage !== undefined);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
2
|
/**
|
|
3
|
-
* Live process registry
|
|
3
|
+
* Live process registry — one queryable + subscribable aggregation
|
|
4
4
|
* surface over the already-composed runtime managers. ZERO new store state:
|
|
5
5
|
* every query is an aggregate-on-read over the managers' in-memory maps, and
|
|
6
6
|
* the only registry-owned mutable state is the agent activity side-table fed
|
|
@@ -49,7 +49,7 @@ export interface ProcessRegistryDeps {
|
|
|
49
49
|
readonly agentManager: Pick<AgentManager, 'list' | 'cancel'>;
|
|
50
50
|
readonly wrfcController: Pick<WrfcController, 'listChains'>;
|
|
51
51
|
/**
|
|
52
|
-
* Optional
|
|
52
|
+
* Optional: folds workstream/phase/work-item nodes into
|
|
53
53
|
* the fleet, nested workstream -> phase -> work-item, mirroring the
|
|
54
54
|
* wrfc-chain/subtask nesting. Without this dep the registry degrades to
|
|
55
55
|
* exactly today's behavior — no orchestration nodes, no new capability.
|
|
@@ -67,23 +67,23 @@ export interface ProcessRegistryDeps {
|
|
|
67
67
|
readonly watcherRegistry: Pick<WatcherRegistry, 'list' | 'stopWatcher'>;
|
|
68
68
|
readonly workflow: {
|
|
69
69
|
readonly workflowManager: Pick<WorkflowManager, 'list' | 'cancel'>;
|
|
70
|
-
/** `enable`
|
|
70
|
+
/** `enable` backs ProcessRegistry.resume() — the inverse of `disable`'s interrupt/pause. */
|
|
71
71
|
readonly triggerManager: Pick<TriggerManager, 'list' | 'remove' | 'disable' | 'enable'>;
|
|
72
72
|
readonly scheduleManager: Pick<ScheduleManager, 'list' | 'remove' | 'disable' | 'enable'>;
|
|
73
73
|
};
|
|
74
74
|
/** Optional: awaiting-approval derivation. Non-control-plane runtimes still build a fleet. */
|
|
75
75
|
readonly approvalBroker?: Pick<ApprovalBroker, 'listApprovals'> | undefined;
|
|
76
|
-
/** Optional: populates ProcessNode.sessionRef.sessionId (
|
|
76
|
+
/** Optional: populates ProcessNode.sessionRef.sessionId (tab attach point). */
|
|
77
77
|
readonly sessionBroker?: Pick<SharedSessionBroker, 'listSessions'> | undefined;
|
|
78
78
|
/**
|
|
79
|
-
* Optional: the repo source-tree code index (
|
|
79
|
+
* Optional: the repo source-tree code index (Stage A).
|
|
80
80
|
* When present, its build/idle state surfaces as a single 'code-index'
|
|
81
81
|
* ProcessNode. Without this dep the fleet degrades to exactly today's
|
|
82
82
|
* behavior — zero code-index nodes, no new capability.
|
|
83
83
|
*/
|
|
84
84
|
readonly codeIndexService?: CodeIndexProcessSource | undefined;
|
|
85
85
|
/**
|
|
86
|
-
* Optional
|
|
86
|
+
* Optional: folds `/schedule` automation jobs
|
|
87
87
|
* (platform/automation, a SEPARATE subsystem from the workflow-tool's
|
|
88
88
|
* ScheduleManager above) into the fleet as 'schedule'-kind nodes — see
|
|
89
89
|
* adapters/automation.ts. Without this dep the fleet degrades to exactly
|
|
@@ -91,7 +91,7 @@ export interface ProcessRegistryDeps {
|
|
|
91
91
|
*/
|
|
92
92
|
readonly automationManager?: Pick<AutomationManager, 'listJobs' | 'setEnabled' | 'removeJob'> | undefined;
|
|
93
93
|
/**
|
|
94
|
-
* Optional: backs `steer()` and the `steerable` capability
|
|
94
|
+
* Optional: backs `steer()` and the `steerable` capability. The
|
|
95
95
|
* bus already exists in the composed runtime and already feeds every
|
|
96
96
|
* in-process agent's per-turn inbox drain (orchestrator-runner.ts) — this
|
|
97
97
|
* just hands the registry a narrow `send`-only pick of it. Without this
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/platform/runtime/fleet/registry.ts"],"names":[],"mappings":"AAAA,qFAAqF;AAErF;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,8BAA8B,CAAC;AAC9E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAEV,eAAe,EACf,cAAc,EACd,eAAe,EAChB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAwB,MAAM,oBAAoB,CAAC;AAEhF,OAAO,KAAK,EAKV,eAAe,EACf,YAAY,EAEb,MAAM,YAAY,CAAC;AAoBpB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIzE,+FAA+F;AAC/F,eAAO,MAAM,4BAA4B,QAAS,CAAC;AACnD,mEAAmE;AACnE,eAAO,MAAM,wBAAwB,MAAM,CA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IAC9F,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,YAAY,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,SAAS,CAAC;IACtG,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,MAAM,CAAC,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjD,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7C,QAAQ,CAAC,MAAM,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;CAC9C;AAkDD,2EAA2E;AAC3E,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,eAAe,CA0lBhF"}
|
|
@@ -387,8 +387,8 @@ export function createProcessRegistry(deps) {
|
|
|
387
387
|
return affected;
|
|
388
388
|
}
|
|
389
389
|
/**
|
|
390
|
-
* Fire-and-forget an AutomationManager async control call
|
|
391
|
-
*
|
|
390
|
+
* Fire-and-forget an AutomationManager async control call: the
|
|
391
|
+
* registry's own kill/interrupt/resume verbs are
|
|
392
392
|
* synchronous, but AutomationManager.removeJob/setEnabled are Promises —
|
|
393
393
|
* dispatch without awaiting rather than making every registry verb async,
|
|
394
394
|
* but never let a rejection vanish silently. The next tick's assemble()
|
|
@@ -545,7 +545,7 @@ export function createProcessRegistry(deps) {
|
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
/**
|
|
548
|
-
*
|
|
548
|
+
* Re-arm a `paused` trigger/schedule via the owning
|
|
549
549
|
* manager's `enable()` — the inverse of interrupt()'s disable. Re-assemble
|
|
550
550
|
* + dispatch-by-kind mirrors interrupt()/kill()'s own shape exactly (same
|
|
551
551
|
* synchronous, no-owned-state pattern as every other control verb here).
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/** SDK-owned platform module. This implementation is maintained in goodvibes-sdk. */
|
|
2
2
|
/**
|
|
3
3
|
* Fleet types — the normalized process-tree contract for the live process
|
|
4
|
-
* registry
|
|
4
|
+
* registry. One queryable + subscribable aggregation surface that
|
|
5
5
|
* enumerates every live/completed runtime process (agents incl. WRFC roles,
|
|
6
6
|
* WRFC chains + subtasks, workflow-tool FSMs/triggers/schedules, watchers,
|
|
7
7
|
* background processes) as flat `ProcessNode` records with parentId edges.
|
|
8
8
|
*
|
|
9
|
-
* Consumers (the TUI fleet tree,
|
|
9
|
+
* Consumers (the TUI fleet tree, session tabs, orchestration
|
|
10
10
|
* nesting) build the tree from the flat list — this keeps the registry cheap
|
|
11
11
|
* and lets each surface reorder/filter independently.
|
|
12
12
|
*/
|
|
@@ -19,17 +19,17 @@ export type ProcessKind = 'agent' | 'wrfc-chain' | 'wrfc-subtask' | 'workflow' |
|
|
|
19
19
|
* ScheduleEntry-between-runs and pending agents need honest states rather
|
|
20
20
|
* than being force-fit into an active state.
|
|
21
21
|
*
|
|
22
|
-
* `interrupted`
|
|
22
|
+
* `interrupted` is a distinct TERMINAL outcome
|
|
23
23
|
* from `killed`: both come from AgentManager.cancel(), but a graceful
|
|
24
24
|
* interrupt request and a hard kill are display-distinguishable via
|
|
25
25
|
* AgentRecord.terminationKind. There is no resume path — `cancel()` is
|
|
26
26
|
* terminal in the current SDK, so 'interrupted' does NOT mean "process still
|
|
27
27
|
* alive"; it means "the operator asked nicely" vs. "the operator killed it".
|
|
28
28
|
*
|
|
29
|
-
* `paused`
|
|
29
|
+
* `paused` is NOT terminal and NOT the same as
|
|
30
30
|
* `killed`: a disabled trigger/schedule/automation-job still exists and can
|
|
31
31
|
* be re-armed via `ProcessRegistry.resume()` — collapsing it into `killed`
|
|
32
|
-
* (the
|
|
32
|
+
* (the previous behavior) was dishonest, since `killed` implies the
|
|
33
33
|
* process is gone for good. See ProcessCapabilities.resumable.
|
|
34
34
|
*/
|
|
35
35
|
export type ProcessState = 'thinking' | 'executing-tool' | 'awaiting-approval' | 'streaming' | 'stalled' | 'retrying' | 'done' | 'failed' | 'killed' | 'interrupted' | 'idle' | 'queued' | 'paused';
|
|
@@ -58,7 +58,7 @@ export interface ProcessCapabilities {
|
|
|
58
58
|
readonly killable: boolean;
|
|
59
59
|
readonly pausable: boolean;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Whether `ProcessRegistry.resume()` can re-arm
|
|
62
62
|
* this node. True only for a node currently in the `paused` state whose
|
|
63
63
|
* source manager exposes an `enable` control (trigger, schedule,
|
|
64
64
|
* automation job) — false for every other kind/state, including a
|
|
@@ -66,7 +66,7 @@ export interface ProcessCapabilities {
|
|
|
66
66
|
*/
|
|
67
67
|
readonly resumable: boolean;
|
|
68
68
|
/**
|
|
69
|
-
*
|
|
69
|
+
* Whether `ProcessRegistry.steer()` can queue a message for this
|
|
70
70
|
* node. True only for a live in-process agent (or a wrfc-subtask with a
|
|
71
71
|
* live member agent) AND only when the registry was constructed with a
|
|
72
72
|
* `messageBus` dep — false everywhere when that dep is absent (graceful
|
|
@@ -76,7 +76,7 @@ export interface ProcessCapabilities {
|
|
|
76
76
|
*/
|
|
77
77
|
readonly steerable: boolean;
|
|
78
78
|
}
|
|
79
|
-
/**
|
|
79
|
+
/** Tab attach point: session/agent identity for transcript drill-downs. */
|
|
80
80
|
export interface ProcessSessionRef {
|
|
81
81
|
readonly sessionId?: string | undefined;
|
|
82
82
|
readonly agentId?: string | undefined;
|
|
@@ -167,7 +167,7 @@ export interface ProcessRegistry {
|
|
|
167
167
|
*/
|
|
168
168
|
interrupt(id: string): boolean;
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
170
|
+
* Re-arm a `paused` node — triggers/schedules via
|
|
171
171
|
* their manager's `enable()`, the inverse of `interrupt()`'s disable.
|
|
172
172
|
* Honest refusal (returns false, no throw) for a node that is not
|
|
173
173
|
* resumable: not found, not currently `paused`, or a kind whose source
|