@fabric-harness/sdk 6.2.0 → 6.3.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.
Files changed (134) hide show
  1. package/NOTICE +1 -1
  2. package/README.md +9 -9
  3. package/connector-spec/channel.md +2 -2
  4. package/connector-spec/sandbox.md +1 -1
  5. package/connector-spec/tooling.md +1 -1
  6. package/connector-spec/voice-telephony.md +1 -1
  7. package/dist/action.d.ts +2 -2
  8. package/dist/action.js +1 -1
  9. package/dist/ai-gateway.d.ts +1 -1
  10. package/dist/ai-gateway.js +1 -1
  11. package/dist/attachment-store.d.ts +3 -3
  12. package/dist/attachment-store.js +2 -2
  13. package/dist/channel.d.ts +3 -3
  14. package/dist/channel.js +2 -2
  15. package/dist/conversation-projection.d.ts +2 -2
  16. package/dist/conversation-projection.js +2 -2
  17. package/dist/conversation-stream.d.ts +5 -5
  18. package/dist/conversation-stream.js +1 -1
  19. package/dist/cost-budget.d.ts +3 -3
  20. package/dist/cost-budget.js +1 -1
  21. package/dist/delivered-message.d.ts +3 -3
  22. package/dist/error.js +2 -2
  23. package/dist/error.js.map +1 -1
  24. package/dist/events.d.ts +1 -1
  25. package/dist/events.js +1 -1
  26. package/dist/filesystem-source.d.ts +3 -3
  27. package/dist/filesystem-source.js +1 -1
  28. package/dist/governed-voice.d.ts +55 -0
  29. package/dist/governed-voice.d.ts.map +1 -0
  30. package/dist/governed-voice.js +357 -0
  31. package/dist/governed-voice.js.map +1 -0
  32. package/dist/history.d.ts +3 -3
  33. package/dist/history.js +3 -3
  34. package/dist/index.d.ts +3 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +2 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/langfuse.d.ts +2 -2
  39. package/dist/mcp.d.ts +1 -0
  40. package/dist/mcp.d.ts.map +1 -1
  41. package/dist/mcp.js +2 -0
  42. package/dist/mcp.js.map +1 -1
  43. package/dist/model-pricing.d.ts +7 -4
  44. package/dist/model-pricing.d.ts.map +1 -1
  45. package/dist/model-pricing.js +8 -7
  46. package/dist/model-pricing.js.map +1 -1
  47. package/dist/model.d.ts +3 -1
  48. package/dist/model.d.ts.map +1 -1
  49. package/dist/model.js +3 -1
  50. package/dist/model.js.map +1 -1
  51. package/dist/persistent-agent.d.ts +1 -1
  52. package/dist/policy.d.ts +1 -1
  53. package/dist/rate-limiter.d.ts +2 -2
  54. package/dist/rate-limiter.js +2 -2
  55. package/dist/retrieval.d.ts +1 -1
  56. package/dist/sandbox-ref.d.ts +2 -2
  57. package/dist/sandbox.js +1 -1
  58. package/dist/sandbox.js.map +1 -1
  59. package/dist/session-memory.d.ts +4 -3
  60. package/dist/session-memory.d.ts.map +1 -1
  61. package/dist/session-memory.js +4 -3
  62. package/dist/session-memory.js.map +1 -1
  63. package/dist/session.d.ts +3 -0
  64. package/dist/session.d.ts.map +1 -1
  65. package/dist/session.js +36 -5
  66. package/dist/session.js.map +1 -1
  67. package/dist/skill-definition.d.ts +1 -1
  68. package/dist/skill-definition.js +1 -1
  69. package/dist/store.d.ts +1 -1
  70. package/dist/store.js +1 -1
  71. package/dist/strict.d.ts +3 -0
  72. package/dist/strict.d.ts.map +1 -1
  73. package/dist/strict.js +2 -0
  74. package/dist/strict.js.map +1 -1
  75. package/dist/submission-runner.d.ts +1 -1
  76. package/dist/submission-runner.d.ts.map +1 -1
  77. package/dist/submission-runner.js +15 -1
  78. package/dist/submission-runner.js.map +1 -1
  79. package/dist/submission-state.d.ts +3 -3
  80. package/dist/submission-state.js +3 -3
  81. package/dist/submission-store.d.ts +4 -4
  82. package/dist/submission-store.js +2 -2
  83. package/dist/tool-execution.d.ts +11 -0
  84. package/dist/tool-execution.d.ts.map +1 -0
  85. package/dist/tool-execution.js +36 -0
  86. package/dist/tool-execution.js.map +1 -0
  87. package/dist/tools.d.ts +6 -0
  88. package/dist/tools.d.ts.map +1 -1
  89. package/dist/tools.js +5 -0
  90. package/dist/tools.js.map +1 -1
  91. package/dist/types.d.ts +3 -3
  92. package/dist/vercel-ai-gateway.d.ts +4 -4
  93. package/dist/vercel-ai-gateway.js +4 -4
  94. package/dist/voice-openai-realtime.d.ts +2 -2
  95. package/dist/voice-openai-realtime.d.ts.map +1 -1
  96. package/dist/voice-openai-realtime.js +48 -41
  97. package/dist/voice-openai-realtime.js.map +1 -1
  98. package/dist/voice-pipeline.d.ts +3 -0
  99. package/dist/voice-pipeline.d.ts.map +1 -1
  100. package/dist/voice-pipeline.js +71 -23
  101. package/dist/voice-pipeline.js.map +1 -1
  102. package/dist/voice-stt-cartesia.d.ts +1 -0
  103. package/dist/voice-stt-cartesia.d.ts.map +1 -1
  104. package/dist/voice-stt-cartesia.js +8 -1
  105. package/dist/voice-stt-cartesia.js.map +1 -1
  106. package/dist/voice-stt-deepgram.d.ts +1 -0
  107. package/dist/voice-stt-deepgram.d.ts.map +1 -1
  108. package/dist/voice-stt-deepgram.js +8 -1
  109. package/dist/voice-stt-deepgram.js.map +1 -1
  110. package/dist/voice-stt.d.ts +2 -0
  111. package/dist/voice-stt.d.ts.map +1 -1
  112. package/dist/voice-tts-cartesia.d.ts +1 -0
  113. package/dist/voice-tts-cartesia.d.ts.map +1 -1
  114. package/dist/voice-tts-cartesia.js +2 -1
  115. package/dist/voice-tts-cartesia.js.map +1 -1
  116. package/dist/voice-tts-elevenlabs.d.ts +1 -0
  117. package/dist/voice-tts-elevenlabs.d.ts.map +1 -1
  118. package/dist/voice-tts-elevenlabs.js +4 -1
  119. package/dist/voice-tts-elevenlabs.js.map +1 -1
  120. package/dist/voice-tts.d.ts +2 -0
  121. package/dist/voice-tts.d.ts.map +1 -1
  122. package/dist/voice-ws-client.d.ts +6 -4
  123. package/dist/voice-ws-client.d.ts.map +1 -1
  124. package/dist/voice-ws-client.js +11 -6
  125. package/dist/voice-ws-client.js.map +1 -1
  126. package/dist/voice-ws-shared.d.ts +10 -3
  127. package/dist/voice-ws-shared.d.ts.map +1 -1
  128. package/dist/voice-ws-shared.js +45 -9
  129. package/dist/voice-ws-shared.js.map +1 -1
  130. package/dist/voice.d.ts +6 -7
  131. package/dist/voice.d.ts.map +1 -1
  132. package/dist/webhook-subscription.d.ts +1 -1
  133. package/dist/ws-client.d.ts +1 -1
  134. package/package.json +16 -10
package/NOTICE CHANGED
@@ -1,4 +1,4 @@
1
- Fabric Harness
1
+ TechFabric Harness
2
2
  Copyright 2026 Fabric
3
3
 
4
4
  This product is licensed under the Apache License, Version 2.0.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @fabric-harness/sdk
2
2
 
3
- > Core SDK for [Fabric Harness](https://github.com/Fabric-Pro/fabric-harness) — a headless TypeScript framework for building durable, deployable autonomous agents.
3
+ > Core SDK for [TechFabric Harness](https://github.com/Fabric-Pro/fabric-harness) — a headless TypeScript framework for building durable, deployable autonomous agents.
4
4
 
5
5
  ## Install
6
6
 
@@ -102,15 +102,15 @@ use direct provider endpoints and never silently fall back to a gateway or mock
102
102
 
103
103
  ## Documentation
104
104
 
105
- - [Headless agents with the minimal entrypoint](https://harness.fabric.pro/docs/getting-started/headless-mode)
106
- - [SDK entrypoints, runtimes, and targets](https://harness.fabric.pro/docs/reference/sdk-entrypoints-runtimes-targets)
107
- - [Runtime modes](https://harness.fabric.pro/docs/reference/runtime-modes) — including the direct `temporalSessionRuntime` API.
108
- - [Dynamic agents and hooks](https://harness.fabric.pro/docs/building/dynamic-agents)
109
- - [Filesystem sources](https://harness.fabric.pro/docs/reference/filesystem-sources) — `session.mount()` and source connectors.
110
- - [Policies and approvals](https://harness.fabric.pro/docs/reference/policies-approvals) — capability policy, network policy, mount permissions, custom approvals.
111
- - [Telemetry](https://harness.fabric.pro/docs/reference/telemetry) — events, transports, metrics.
105
+ - [Headless agents with the minimal entrypoint](https://harness.techfabric.com/docs/getting-started/headless-mode)
106
+ - [SDK entrypoints, runtimes, and targets](https://harness.techfabric.com/docs/reference/sdk-entrypoints-runtimes-targets)
107
+ - [Runtime modes](https://harness.techfabric.com/docs/reference/runtime-modes) — including the direct `temporalSessionRuntime` API.
108
+ - [Dynamic agents and hooks](https://harness.techfabric.com/docs/building/dynamic-agents)
109
+ - [Filesystem sources](https://harness.techfabric.com/docs/reference/filesystem-sources) — `session.mount()` and source connectors.
110
+ - [Policies and approvals](https://harness.techfabric.com/docs/reference/policies-approvals) — capability policy, network policy, mount permissions, custom approvals.
111
+ - [Telemetry](https://harness.techfabric.com/docs/reference/telemetry) — events, transports, metrics.
112
112
  - [Roadmap](https://github.com/Fabric-Pro/fabric-harness/blob/main/docs/ROADMAP.md)
113
- - [Full reference](https://harness.fabric.pro/docs)
113
+ - [Full reference](https://harness.techfabric.com/docs)
114
114
 
115
115
  ## License
116
116
 
@@ -1,6 +1,6 @@
1
- <!-- Canonical Fabric Harness channel connector contract. Shipped with @fabric-harness/sdk. -->
1
+ <!-- Canonical TechFabric Harness channel connector contract. Shipped with @fabric-harness/sdk. -->
2
2
 
3
- # Fabric Harness Channel Connector Spec
3
+ # TechFabric Harness Channel Connector Spec
4
4
 
5
5
  A channel turns an authenticated provider event into a durable dispatch to a persistent agent. Produce a TypeScript module under `.fabricharness/channels/<provider>.ts` that exports a `Channel` created with `defineChannel()`.
6
6
 
@@ -3,7 +3,7 @@
3
3
  Shipped with @fabric-harness/sdk so it's available offline.
4
4
 
5
5
  Mirrored at the docs site:
6
- https://harness.fabric.pro/docs/building/sandbox-connectors
6
+ https://harness.techfabric.com/docs/building/sandbox-connectors
7
7
 
8
8
  Raw GitHub URL (must remain valid):
9
9
  https://raw.githubusercontent.com/Fabric-Pro/fabric-harness/main/packages/sdk/connector-spec/sandbox.md
@@ -1,4 +1,4 @@
1
- # Fabric Harness Tooling Connector Spec
1
+ # TechFabric Harness Tooling Connector Spec
2
2
 
3
3
  A tooling connector observes Fabric events, traces, metrics, or eval results without changing agent behavior. Produce a project-local module that uses public Fabric event, telemetry, or eval APIs.
4
4
 
@@ -124,7 +124,7 @@ The OpenAI Realtime server-side VAD detects when the caller starts speaking and
124
124
 
125
125
  ## Cost
126
126
 
127
- Realtime audio is billed per audio token. Fabric Harness records `audioInputTokens` /
127
+ Realtime audio is billed per audio token. TechFabric Harness records `audioInputTokens` /
128
128
  `audioOutputTokens` on `usage` and rolls them into `costUsd`. Use `gpt-realtime` as the stable
129
129
  general-purpose model or `gpt-realtime-mini` when cost and latency matter more than maximum quality.
130
130
 
package/dist/action.d.ts CHANGED
@@ -5,7 +5,7 @@ declare const actionSymbol: unique symbol;
5
5
  /**
6
6
  * What an action runs against: the harness entry point (`init` can prompt
7
7
  * models, spawn sessions, and call tools) plus the platform environment.
8
- * Jobs, agents, and servers all satisfy this — it is the harness slice of
8
+ * Jobs, agents, and servers all satisfy this. It is the harness slice of
9
9
  * `FabricContext`.
10
10
  */
11
11
  export interface ActionHost {
@@ -45,7 +45,7 @@ export declare class ActionError extends Error {
45
45
  constructor(code: ActionError['code'], action: string, message: string, issues?: SchemaIssue[]);
46
46
  }
47
47
  /**
48
- * Define an action — the harness-context counterpart to `defineTool`.
48
+ * Define an action, the harness-context counterpart to `defineTool`.
49
49
  * A tool is a leaf capability the model calls; an action holds the harness
50
50
  * (`context.init`) and can prompt, spawn sessions, and compose other work.
51
51
  * Input/output use the harness `schema` builders and are validated on every
package/dist/action.js CHANGED
@@ -13,7 +13,7 @@ export class ActionError extends Error {
13
13
  }
14
14
  }
15
15
  /**
16
- * Define an action — the harness-context counterpart to `defineTool`.
16
+ * Define an action, the harness-context counterpart to `defineTool`.
17
17
  * A tool is a leaf capability the model calls; an action holds the harness
18
18
  * (`context.init`) and can prompt, spawn sessions, and compose other work.
19
19
  * Input/output use the harness `schema` builders and are validated on every
@@ -41,7 +41,7 @@ export interface AIGatewayOptions {
41
41
  * });
42
42
  * ```
43
43
  *
44
- * For Vercel AI Gateway, prefer the {@link vercelAIGateway} preset — same
44
+ * For Vercel AI Gateway, prefer the {@link vercelAIGateway} preset: same
45
45
  * factory under the hood with the gateway URL pre-baked.
46
46
  */
47
47
  export declare function aiGateway(options: AIGatewayOptions): OpenAICompatibleModelProvider;
@@ -29,7 +29,7 @@ import { OpenAICompatibleModelProvider } from './model.js';
29
29
  * });
30
30
  * ```
31
31
  *
32
- * For Vercel AI Gateway, prefer the {@link vercelAIGateway} preset — same
32
+ * For Vercel AI Gateway, prefer the {@link vercelAIGateway} preset: same
33
33
  * factory under the hood with the gateway URL pre-baked.
34
34
  */
35
35
  export function aiGateway(options) {
@@ -60,7 +60,7 @@ export interface StoredAttachment {
60
60
  /**
61
61
  * Durable content-addressed attachment storage.
62
62
  *
63
- * - `put` is idempotent by `(scope, digest)` — re-putting the same content
63
+ * - `put` is idempotent by `(scope, digest)`. Re-putting the same content
64
64
  * succeeds without duplicating storage (the first stored ref metadata is
65
65
  * retained). It MUST verify the digest against the bytes and reject a
66
66
  * mismatch with `AttachmentStoreError('DIGEST_MISMATCH')` before writing.
@@ -99,8 +99,8 @@ export declare function messageHasDataAttachments(message: DeliveredMessage): bo
99
99
  * base64 data, store the bytes under `scope`, and return a NEW message whose
100
100
  * attachments carry `{ type, mimeType, filename?, ref }` and no `data`.
101
101
  *
102
- * Deterministic by construction — attachment ids are `${idPrefix}_${index}`
103
- * and digests derive from content — so an exact redelivery of the same
102
+ * Deterministic by construction (attachment ids are `${idPrefix}_${index}`
103
+ * and digests derive from content) so an exact redelivery of the same
104
104
  * message produces an identical materialized payload (admission idempotency).
105
105
  * Messages without inline attachments are returned unchanged (same
106
106
  * reference).
@@ -128,8 +128,8 @@ export function messageHasDataAttachments(message) {
128
128
  * base64 data, store the bytes under `scope`, and return a NEW message whose
129
129
  * attachments carry `{ type, mimeType, filename?, ref }` and no `data`.
130
130
  *
131
- * Deterministic by construction — attachment ids are `${idPrefix}_${index}`
132
- * and digests derive from content — so an exact redelivery of the same
131
+ * Deterministic by construction (attachment ids are `${idPrefix}_${index}`
132
+ * and digests derive from content) so an exact redelivery of the same
133
133
  * message produces an identical materialized payload (admission idempotency).
134
134
  * Messages without inline attachments are returned unchanged (same
135
135
  * reference).
package/dist/channel.d.ts CHANGED
@@ -4,7 +4,7 @@ import type { FabricActor } from './types.js';
4
4
  /**
5
5
  * Channels turn platform webhooks (Slack, GitHub, …) into agent dispatches. Handlers are written
6
6
  * against the Web `Request`/`Response` API and `crypto.subtle`, so the same channel runs on Node and
7
- * Cloudflare. A channel is a stateless route container plus a conversation-id (de)serializer —
7
+ * Cloudflare. A channel is a stateless route container plus a conversation-id (de)serializer;
8
8
  * session continuity falls out of the key (same thread → same key → same session).
9
9
  */
10
10
  export interface ChannelRoute {
@@ -63,7 +63,7 @@ export declare function parseConversationKey(key: string): ParsedConversationKey
63
63
  * Reads the full request body as bytes, or returns undefined if it exceeds `limitBytes`.
64
64
  *
65
65
  * NOTE: this consumes the request stream (single read). Signature-verifying channels need the *exact*
66
- * bytes for HMAC and the parsed JSON afterward — don't call `request.json()` as well. Use
66
+ * bytes for HMAC and the parsed JSON afterward. Don't call `request.json()` as well. Use
67
67
  * {@link readJsonBody} to get both from one read.
68
68
  */
69
69
  export declare function readRequestBody(request: Request, limitBytes?: number): Promise<Uint8Array | undefined>;
@@ -76,7 +76,7 @@ export interface RequestBody {
76
76
  json: unknown;
77
77
  }
78
78
  /**
79
- * Reads the body once and returns the raw bytes, the decoded text, and the parsed JSON together — so a
79
+ * Reads the body once and returns the raw bytes, the decoded text, and the parsed JSON together, so a
80
80
  * channel can HMAC-verify the exact bytes and use the JSON without re-reading the (already consumed)
81
81
  * stream. Returns undefined only when the body exceeds `limitBytes`.
82
82
  */
package/dist/channel.js CHANGED
@@ -81,7 +81,7 @@ const DEFAULT_BODY_LIMIT = 1_000_000;
81
81
  * Reads the full request body as bytes, or returns undefined if it exceeds `limitBytes`.
82
82
  *
83
83
  * NOTE: this consumes the request stream (single read). Signature-verifying channels need the *exact*
84
- * bytes for HMAC and the parsed JSON afterward — don't call `request.json()` as well. Use
84
+ * bytes for HMAC and the parsed JSON afterward. Don't call `request.json()` as well. Use
85
85
  * {@link readJsonBody} to get both from one read.
86
86
  */
87
87
  export async function readRequestBody(request, limitBytes = DEFAULT_BODY_LIMIT) {
@@ -94,7 +94,7 @@ export async function readRequestBody(request, limitBytes = DEFAULT_BODY_LIMIT)
94
94
  return buffer;
95
95
  }
96
96
  /**
97
- * Reads the body once and returns the raw bytes, the decoded text, and the parsed JSON together — so a
97
+ * Reads the body once and returns the raw bytes, the decoded text, and the parsed JSON together, so a
98
98
  * channel can HMAC-verify the exact bytes and use the JSON without re-reading the (already consumed)
99
99
  * stream. Returns undefined only when the body exceeds `limitBytes`.
100
100
  */
@@ -7,10 +7,10 @@ import type { SessionData, SessionEntry, SessionStore } from "./types.js";
7
7
  * The SessionEntry DAG stays the single source of truth; the stream gives
8
8
  * clients offset-based catch-up + live tail. Two rules keep them coherent:
9
9
  *
10
- * 1. **Idempotent by entryId** — a crash between the DAG write and the
10
+ * 1. **Idempotent by entryId**. A crash between the DAG write and the
11
11
  * stream write is repaired on the next append: the projector diffs the
12
12
  * stream tail against the active path and re-emits anything missing.
13
- * 2. **Truncation is explicit** — the DAG can branch (fork/replay/
13
+ * 2. **Truncation is explicit**. The DAG can branch (fork/replay/
14
14
  * checkpoint-restore rewrite `leafId`); the stream cannot. When `save()`
15
15
  * rewinds the active path, the projector appends a `truncated` record
16
16
  * and re-acquires the producer (epoch bump), so tailing clients see the
@@ -6,10 +6,10 @@ import { ConversationStreamStoreError, conversationStreamPath } from "./conversa
6
6
  * The SessionEntry DAG stays the single source of truth; the stream gives
7
7
  * clients offset-based catch-up + live tail. Two rules keep them coherent:
8
8
  *
9
- * 1. **Idempotent by entryId** — a crash between the DAG write and the
9
+ * 1. **Idempotent by entryId**. A crash between the DAG write and the
10
10
  * stream write is repaired on the next append: the projector diffs the
11
11
  * stream tail against the active path and re-emits anything missing.
12
- * 2. **Truncation is explicit** — the DAG can branch (fork/replay/
12
+ * 2. **Truncation is explicit**. The DAG can branch (fork/replay/
13
13
  * checkpoint-restore rewrite `leafId`); the stream cannot. When `save()`
14
14
  * rewinds the active path, the projector appends a `truncated` record
15
15
  * and re-acquires the producer (epoch bump), so tailing clients see the
@@ -1,13 +1,13 @@
1
1
  import type { SessionEntry } from './types.js';
2
2
  /**
3
- * Append-only conversation stream — the durable, offset-addressable
3
+ * Append-only conversation stream, the durable, offset-addressable
4
4
  * projection of a session's active path (v2 migration, phase A4).
5
5
  *
6
6
  * The SessionEntry DAG remains the single source of truth for model context;
7
7
  * this stream exists so clients can read a conversation with offsets
8
8
  * (catch-up + live tail), across processes, without count-based replay. The
9
- * projection appends one record per active-path entry, and — because the DAG
10
- * can branch (fork/replay/checkpoint-restore) while a stream cannot — an
9
+ * projection appends one record per active-path entry, and (because the DAG
10
+ * can branch (fork/replay/checkpoint-restore) while a stream cannot) an
11
11
  * explicit `truncated` record whenever the active path rewinds, paired with
12
12
  * a producer-epoch bump so stale writers are fenced out.
13
13
  */
@@ -92,7 +92,7 @@ export interface ConversationStreamAppendInput {
92
92
  *
93
93
  * **Producer fencing**: `acquireProducer` bumps the producer epoch; appends
94
94
  * carrying a stale epoch are rejected. The (path, producerId, epoch,
95
- * sequence) uniqueness makes redelivered appends idempotent — a retried
95
+ * sequence) uniqueness makes redelivered appends idempotent; a retried
96
96
  * append with the same coordinates returns the already-committed offset.
97
97
  */
98
98
  export interface ConversationStreamStore {
@@ -139,7 +139,7 @@ export declare function readConversationFromFold(store: ConversationStreamStore,
139
139
  /** Stream path for a session's conversation projection. */
140
140
  export declare function conversationStreamPath(storeSessionId: string): string;
141
141
  /**
142
- * Process-local listener registry shared by store implementations —
142
+ * Process-local listener registry shared by store implementations:
143
143
  * registration, unsubscribe-and-prune, and error-swallowing notify.
144
144
  */
145
145
  export declare class StreamListenerRegistry {
@@ -78,7 +78,7 @@ export function conversationStreamPath(storeSessionId) {
78
78
  return `conversations/${storeSessionId}`;
79
79
  }
80
80
  /**
81
- * Process-local listener registry shared by store implementations —
81
+ * Process-local listener registry shared by store implementations:
82
82
  * registration, unsubscribe-and-prune, and error-swallowing notify.
83
83
  */
84
84
  export class StreamListenerRegistry {
@@ -18,11 +18,11 @@ import { FabricError } from './error.js';
18
18
  */
19
19
  /**
20
20
  * Async store for cross-process spend aggregation. Pair with `CostLimit.scopeKey`
21
- * + `CostLimit.perScope` to enforce a budget that survives process restarts —
21
+ * + `CostLimit.perScope` to enforce a budget that survives process restarts:
22
22
  * "tenant:acme spends ≤ $50 today" or "company-wide ≤ $100 this hour".
23
23
  *
24
24
  * Built-in implementations:
25
- * - `inMemoryCostBudgetStore()` — process-local; default.
25
+ * - `inMemoryCostBudgetStore()`, process-local; default.
26
26
  * - `@fabric-harness/node` exposes `postgresCostBudgetStore({ pool })`.
27
27
  */
28
28
  export interface CostBudgetStore {
@@ -46,7 +46,7 @@ export interface CostBudgetStore {
46
46
  *
47
47
  * Scope key convention: `tenant:<id>:<period>` where `<period>` is
48
48
  * `day:YYYY-MM-DD`, `hour:YYYY-MM-DDTHH:00Z`, or `month:YYYY-MM`. Reset
49
- * semantics (rollover) are the host's job — call `store.reset(scopeKey)`
49
+ * semantics (rollover) are the host's job. Call `store.reset(scopeKey)`
50
50
  * from a scheduled task to clear the period total.
51
51
  *
52
52
  * ```ts
@@ -7,7 +7,7 @@ import { FabricError } from './error.js';
7
7
  *
8
8
  * Scope key convention: `tenant:<id>:<period>` where `<period>` is
9
9
  * `day:YYYY-MM-DD`, `hour:YYYY-MM-DDTHH:00Z`, or `month:YYYY-MM`. Reset
10
- * semantics (rollover) are the host's job — call `store.reset(scopeKey)`
10
+ * semantics (rollover) are the host's job. Call `store.reset(scopeKey)`
11
11
  * from a scheduled task to clear the period total.
12
12
  *
13
13
  * ```ts
@@ -1,13 +1,13 @@
1
1
  import type { SignalEntryData } from './types.js';
2
2
  /**
3
- * DeliveredMessage — the single unified input shape for everything that
3
+ * DeliveredMessage, the single unified input shape for everything that
4
4
  * enters a persistent agent's session: direct HTTP prompts, dispatch,
5
5
  * channels/webhooks, Databricks events, SDK clients, and tests.
6
6
  *
7
7
  * `kind: 'user'` is a direct user talking to the assistant (1:1 chat
8
8
  * surface), optionally carrying attachments.
9
9
  *
10
- * `kind: 'signal'` models everything beyond that direct exchange — a Slack
10
+ * `kind: 'signal'` models everything beyond that direct exchange. A Slack
11
11
  * thread or a Lakeflow job event is activity the agent observes, not the
12
12
  * assistant's own user speaking. Sender identity and structured metadata go
13
13
  * in `attributes`; the message itself in `body`. Signals render into model
@@ -32,7 +32,7 @@ export type DeliveredMessage = {
32
32
  * One attachment on a `kind: 'user'` message. Today the only supported
33
33
  * attachment is an image, carried either inline (`data`, base64) or as a
34
34
  * durable content-addressed reference (`ref`) once an attachment store is
35
- * configured — admission materializes inline bytes into refs. An attachment
35
+ * configured; admission materializes inline bytes into refs. An attachment
36
36
  * must carry `data` or `ref` (or both, transiently during materialization).
37
37
  */
38
38
  export interface DeliveredAttachment {
package/dist/error.js CHANGED
@@ -57,7 +57,7 @@ export class FabricError extends Error {
57
57
  }
58
58
  function safePublicMessage(code, message) {
59
59
  if (code === 'UNKNOWN')
60
- return 'An unexpected Fabric Harness error occurred.';
60
+ return 'An unexpected TechFabric Harness error occurred.';
61
61
  return sanitizePublicText(message);
62
62
  }
63
63
  /** Remove credentials and host filesystem locations from caller-visible text. */
@@ -91,7 +91,7 @@ export function toFabricError(error, fallback) {
91
91
  /** Convert any thrown value into the stable public/developer transport shape. */
92
92
  export function serializeFabricError(error, audience = 'public', fallback = {
93
93
  code: 'UNKNOWN',
94
- message: 'An unexpected Fabric Harness error occurred.',
94
+ message: 'An unexpected TechFabric Harness error occurred.',
95
95
  }) {
96
96
  return toFabricError(error, fallback).toJSON(audience);
97
97
  }
package/dist/error.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../src/error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AA6D5C,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAE5D,gFAAgF;AAChF,MAAM,UAAU,oBAAoB,CAAC,GAAG,GAAG,IAAI,CA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,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7F,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IACF,OAAO,KAAK,CAAC,QAAQ,CAAM,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc;IAC1C,OAAO,KAAK,YAAY,WAAW,CAAC;AACtC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAc,EAAE,QAA2C;IACvF,IAAI,aAAa,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACvC,OAAO,IAAI,WAAW,CAAC,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AACxD,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,oBAAoB,CAClC,KAAc,EACd,WAAmC,QAAQ,EAC3C,WAA8C;IAC5C,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,kDAAkD;CAC5D;IAED,OAAO,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;AACzD,CAAC"}
package/dist/events.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Typed event payloads for `init({ onEvent })` and `session.stream()`.
3
3
  *
4
- * Fabric Harness already emits a structured event stream via the
4
+ * TechFabric Harness already emits a structured event stream via the
5
5
  * untyped `FabricEvent` interface (see `types.ts`). This module layers
6
6
  * a discriminated union on top so consumers can write `if (event.type
7
7
  * === 'tool_start')` and have TypeScript narrow `event.data` for them.
package/dist/events.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Typed event payloads for `init({ onEvent })` and `session.stream()`.
3
3
  *
4
- * Fabric Harness already emits a structured event stream via the
4
+ * TechFabric Harness already emits a structured event stream via the
5
5
  * untyped `FabricEvent` interface (see `types.ts`). This module layers
6
6
  * a discriminated union on top so consumers can write `if (event.type
7
7
  * === 'tool_start')` and have TypeScript narrow `event.data` for them.
@@ -3,12 +3,12 @@ import type { SandboxBackend } from './types.js';
3
3
  /**
4
4
  * A read-only content source that can be mounted into a sandbox at
5
5
  * sandbox-creation time. The agent then has built-in `read`, `glob`,
6
- * and `grep` tools available over the mounted content — no retrieval
6
+ * and `grep` tools available over the mounted content, no retrieval
7
7
  * pipeline, no embeddings, no vector store required.
8
8
  *
9
9
  * Sources are intentionally minimal: they yield (path, content) pairs.
10
10
  * Implementations decide how to enumerate (eager vs lazy is up to the
11
- * source author) — the mount step pulls the full set into the sandbox.
11
+ * source author). The mount step pulls the full set into the sandbox.
12
12
  */
13
13
  export interface FilesystemSource {
14
14
  /** Stable name for telemetry / logs. */
@@ -73,7 +73,7 @@ export declare function inMemorySource(files: Record<string, string | Uint8Array
73
73
  * withFilesystemSources('virtual', [{ mountAt, source }])
74
74
  * ```
75
75
  *
76
- * Used for support agents, runbook lookup, FAQ assistants — anywhere a
76
+ * Use it for support agents, runbook lookup, and FAQ assistants: anywhere a
77
77
  * small Markdown corpus needs to be searchable via the agent's built-in
78
78
  * `grep`/`glob`/`read` tools.
79
79
  *
@@ -84,7 +84,7 @@ export function inMemorySource(files, options = {}) {
84
84
  * withFilesystemSources('virtual', [{ mountAt, source }])
85
85
  * ```
86
86
  *
87
- * Used for support agents, runbook lookup, FAQ assistants — anywhere a
87
+ * Use it for support agents, runbook lookup, and FAQ assistants: anywhere a
88
88
  * small Markdown corpus needs to be searchable via the agent's built-in
89
89
  * `grep`/`glob`/`read` tools.
90
90
  *
@@ -0,0 +1,55 @@
1
+ import type { CostLimit } from './cost-budget.js';
2
+ import type { ToolCall, ToolCallResult, ToolDef } from './tools.js';
3
+ import type { JsonObject, SessionStore } from './types.js';
4
+ import type { VoiceConnectOptions, VoiceProvider, VoiceSession } from './voice.js';
5
+ export interface GovernedVoiceOptions {
6
+ provider: VoiceProvider;
7
+ /** Trusted application binding, resolved from authenticated server state. */
8
+ callId: string;
9
+ resourceId: string;
10
+ instructions: string;
11
+ tools: ToolDef[];
12
+ voice?: string;
13
+ audioFormat?: VoiceConnectOptions['audioFormat'];
14
+ sampleRate?: number;
15
+ signal?: AbortSignal;
16
+ limits: {
17
+ durationMs: number;
18
+ maxTurns: number;
19
+ maxToolCalls: number;
20
+ maxAudioFrameBytes?: number;
21
+ };
22
+ /** Estimated spend, checked after each response. One in-flight response can overshoot. */
23
+ costLimit: Pick<CostLimit, 'perCall' | 'perScope' | 'scopeKey'> & {
24
+ perSession: number;
25
+ };
26
+ /** Checked on admission and immediately before every tool execution/replay. */
27
+ authorize: (operation: {
28
+ kind: 'connect' | 'input' | 'tool';
29
+ tool?: string;
30
+ }) => boolean | Promise<boolean>;
31
+ /** Validate and remove sensitive values before policy/history/model exposure. Throw to reject. */
32
+ prepareToolInput: (name: string, input: unknown) => unknown | Promise<unknown>;
33
+ /** Trusted logical action identity, stable across provider reconnects. Never use a provider call ID. */
34
+ toolOperationKey: (name: string, preparedInput: unknown) => string | Promise<string>;
35
+ /** Return only model-safe output; the safe value is also what the journal retains. */
36
+ prepareToolOutput: (name: string, output: unknown) => unknown | Promise<unknown>;
37
+ /** Redact before transcript/text is exposed. Raw audio is never persisted by Harness. */
38
+ redactTranscript: (text: string) => string | Promise<string>;
39
+ /** Awaited audit delivery; failures stop the session. Contains metadata, never audio/text/arguments. */
40
+ onAudit?: (event: JsonObject) => void | Promise<void>;
41
+ }
42
+ /** Only sessions opened through session.voice() carry this server-route marker. */
43
+ export interface GovernedVoiceSession extends VoiceSession {
44
+ readonly governed: true;
45
+ }
46
+ export interface GovernedVoiceRuntime {
47
+ sessionId: string;
48
+ tenantId: string;
49
+ actorId: string;
50
+ store: SessionStore;
51
+ execute: (call: ToolCall, tools: ToolDef[], signal: AbortSignal) => Promise<ToolCallResult>;
52
+ }
53
+ /** Internal session adapter. Public callers use session.voice(). */
54
+ export declare function openGovernedVoice(options: GovernedVoiceOptions, runtime: GovernedVoiceRuntime): Promise<GovernedVoiceSession>;
55
+ //# sourceMappingURL=governed-voice.d.ts.map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