@theokit/sdk 4.2.2 → 4.2.3
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/CHANGELOG.md +6 -0
- package/README.md +5 -5
- package/dist/compaction.cjs.map +1 -1
- package/dist/compaction.d.cts +1 -1
- package/dist/compaction.d.ts +1 -1
- package/dist/compaction.js.map +1 -1
- package/dist/{cron-afuxJHol.d.cts → cron-CWQPZTwX.d.cts} +1 -1
- package/dist/{cron-DxBlp3i4.d.ts → cron-DVM9f1I_.d.ts} +1 -1
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js.map +1 -1
- package/dist/{errors-DzCWdfkp.d.ts → errors-CG2RpeW-.d.ts} +1 -1
- package/dist/{errors-VY7_0ki7.d.cts → errors-gE8612p9.d.cts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js.map +1 -1
- package/dist/internal/llm/vertex-gemini.d.ts +1 -1
- package/dist/internal/runtime/lifecycle/stream-to-completion.d.ts +1 -1
- package/dist/messages.cjs.map +1 -1
- package/dist/messages.d.cts +1 -1
- package/dist/messages.d.ts +1 -1
- package/dist/messages.js.map +1 -1
- package/dist/path-safety.d.cts +1 -2
- package/dist/path-safety.d.ts +1 -2
- package/dist/{run-CsIsK9Gx.d.cts → run-DFM1H2jW.d.cts} +1 -1
- package/dist/{run-CsIsK9Gx.d.ts → run-DFM1H2jW.d.ts} +1 -1
- package/dist/types/mcp.d.ts +1 -1
- package/package.json +2 -3
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Wraps `OpenAIClient` with the Vertex baseUrl + lazy OAuth token from
|
|
8
8
|
* `google-auth-library` (D288). Limitation: Vertex silently drops
|
|
9
|
-
* unsupported OpenAI params (D264-style trade-off
|
|
9
|
+
* unsupported OpenAI params (D264-style trade-off).
|
|
10
10
|
*
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* The `StreamToCompletionResult` is the generator's RETURN value, read via a
|
|
15
15
|
* manual `gen.next()` loop (`while (!res.done) res = await gen.next()` → `res.value`).
|
|
16
16
|
* A plain `for await...of` consumes the yielded messages but discards the return
|
|
17
|
-
* value (EC-1)
|
|
17
|
+
* value (EC-1).
|
|
18
18
|
*
|
|
19
19
|
* @internal
|
|
20
20
|
*/
|
package/dist/messages.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/messages.ts"],"names":[],"mappings":";;;AAmBO,SAAS,cAAc,GAAA,EAAyB;AACrD,EAAA,IAAI,GAAA,CAAI,SAAS,WAAA,EAAa;AAC5B,IAAA,OAAO,EAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAI,OAAA,CAAQ,OAAA,CAChB,MAAA,CAAO,CAAC,UAA4D,KAAA,CAAM,IAAA,KAAS,MAAM,CAAA,CACzF,IAAI,CAAC,KAAA,KAAU,MAAM,IAAI,CAAA,CACzB,KAAK,EAAE,CAAA;AACZ;AASO,SAAS,gBAAgB,GAAA,EAAiC;AAC/D,EAAA,IAAI,GAAA,CAAI,SAAS,WAAA,EAAa;AAC5B,IAAA,OAAO,EAAC;AAAA,EACV;AACA,EAAA,OAAO,GAAA,CAAI,QAAQ,OAAA,CAAQ,MAAA,CAAO,CAAC,KAAA,KAAiC,KAAA,CAAM,SAAS,UAAU,CAAA;AAC/F;AAQO,SAAS,cAAc,IAAA,EAAqD;AACjF,EAAA,OAAO,IAAA,EAAM,SAAA;AACf","file":"messages.cjs","sourcesContent":["/**\n * Pure readers over the `SDKMessage` stream (M1-5).\n *\n * Promotes the proven first-party hand-roll (`../theocode/server/lib/sdk-mappers.ts`)\n * onto the SDK's own types so consumers stop re-implementing a wire-event mapper.\n * Every reader is pure: no I/O, no mutation of its input, deterministic.\n *\n * Public from the `@theokit/sdk/messages` sub-path
|
|
1
|
+
{"version":3,"sources":["../src/messages.ts"],"names":[],"mappings":";;;AAmBO,SAAS,cAAc,GAAA,EAAyB;AACrD,EAAA,IAAI,GAAA,CAAI,SAAS,WAAA,EAAa;AAC5B,IAAA,OAAO,EAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAI,OAAA,CAAQ,OAAA,CAChB,MAAA,CAAO,CAAC,UAA4D,KAAA,CAAM,IAAA,KAAS,MAAM,CAAA,CACzF,IAAI,CAAC,KAAA,KAAU,MAAM,IAAI,CAAA,CACzB,KAAK,EAAE,CAAA;AACZ;AASO,SAAS,gBAAgB,GAAA,EAAiC;AAC/D,EAAA,IAAI,GAAA,CAAI,SAAS,WAAA,EAAa;AAC5B,IAAA,OAAO,EAAC;AAAA,EACV;AACA,EAAA,OAAO,GAAA,CAAI,QAAQ,OAAA,CAAQ,MAAA,CAAO,CAAC,KAAA,KAAiC,KAAA,CAAM,SAAS,UAAU,CAAA;AAC/F;AAQO,SAAS,cAAc,IAAA,EAAqD;AACjF,EAAA,OAAO,IAAA,EAAM,SAAA;AACf","file":"messages.cjs","sourcesContent":["/**\n * Pure readers over the `SDKMessage` stream (M1-5).\n *\n * Promotes the proven first-party hand-roll (`../theocode/server/lib/sdk-mappers.ts`)\n * onto the SDK's own types so consumers stop re-implementing a wire-event mapper.\n * Every reader is pure: no I/O, no mutation of its input, deterministic.\n *\n * Public from the `@theokit/sdk/messages` sub-path.\n */\n\nimport type { SDKMessage, ToolUseBlock } from \"./types/messages.js\";\nimport type { CostBreakdown } from \"./types/usage.js\";\n\n/**\n * Concatenate the text of an assistant message's `TextBlock`s.\n *\n * Returns `\"\"` for any non-assistant message (or an assistant with no text\n * blocks). `tool_use` blocks are ignored — only `text` blocks contribute.\n */\nexport function assistantText(msg: SDKMessage): string {\n if (msg.type !== \"assistant\") {\n return \"\";\n }\n return msg.message.content\n .filter((block): block is Extract<typeof block, { type: \"text\" }> => block.type === \"text\")\n .map((block) => block.text)\n .join(\"\");\n}\n\n/**\n * Extract the `ToolUseBlock`s from an assistant message's content.\n *\n * Returns `[]` for any non-assistant message. This reads the assistant\n * message's content blocks — NOT the separate `SDKToolUseMessage`\n * (`type:\"tool_call\"`) lifecycle event, which is a different stream (ADR D2).\n */\nexport function extractToolUses(msg: SDKMessage): ToolUseBlock[] {\n if (msg.type !== \"assistant\") {\n return [];\n }\n return msg.message.content.filter((block): block is ToolUseBlock => block.type === \"tool_use\");\n}\n\n/**\n * Read the cost amount from a `CostBreakdown`, preserving the honesty contract\n * (repo ADR `D377-cost-status-closed-enum.md`): `amountUsd` is `number | undefined`\n * where `undefined` means \"cost unknown\" — distinct from a real `$0` (e.g. a\n * subscription-included route). NEVER coerced to 0.\n */\nexport function costAmountUsd(cost: CostBreakdown | undefined): number | undefined {\n return cost?.amountUsd;\n}\n"]}
|
package/dist/messages.d.cts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* onto the SDK's own types so consumers stop re-implementing a wire-event mapper.
|
|
6
6
|
* Every reader is pure: no I/O, no mutation of its input, deterministic.
|
|
7
7
|
*
|
|
8
|
-
* Public from the `@theokit/sdk/messages` sub-path.
|
|
8
|
+
* Public from the `@theokit/sdk/messages` sub-path.
|
|
9
9
|
*/
|
|
10
10
|
import type { SDKMessage, ToolUseBlock } from "./types/messages.js";
|
|
11
11
|
import type { CostBreakdown } from "./types/usage.js";
|
package/dist/messages.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* onto the SDK's own types so consumers stop re-implementing a wire-event mapper.
|
|
6
6
|
* Every reader is pure: no I/O, no mutation of its input, deterministic.
|
|
7
7
|
*
|
|
8
|
-
* Public from the `@theokit/sdk/messages` sub-path.
|
|
8
|
+
* Public from the `@theokit/sdk/messages` sub-path.
|
|
9
9
|
*/
|
|
10
10
|
import type { SDKMessage, ToolUseBlock } from "./types/messages.js";
|
|
11
11
|
import type { CostBreakdown } from "./types/usage.js";
|
package/dist/messages.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/messages.ts"],"names":[],"mappings":";AAmBO,SAAS,cAAc,GAAA,EAAyB;AACrD,EAAA,IAAI,GAAA,CAAI,SAAS,WAAA,EAAa;AAC5B,IAAA,OAAO,EAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAI,OAAA,CAAQ,OAAA,CAChB,MAAA,CAAO,CAAC,UAA4D,KAAA,CAAM,IAAA,KAAS,MAAM,CAAA,CACzF,IAAI,CAAC,KAAA,KAAU,MAAM,IAAI,CAAA,CACzB,KAAK,EAAE,CAAA;AACZ;AASO,SAAS,gBAAgB,GAAA,EAAiC;AAC/D,EAAA,IAAI,GAAA,CAAI,SAAS,WAAA,EAAa;AAC5B,IAAA,OAAO,EAAC;AAAA,EACV;AACA,EAAA,OAAO,GAAA,CAAI,QAAQ,OAAA,CAAQ,MAAA,CAAO,CAAC,KAAA,KAAiC,KAAA,CAAM,SAAS,UAAU,CAAA;AAC/F;AAQO,SAAS,cAAc,IAAA,EAAqD;AACjF,EAAA,OAAO,IAAA,EAAM,SAAA;AACf","file":"messages.js","sourcesContent":["/**\n * Pure readers over the `SDKMessage` stream (M1-5).\n *\n * Promotes the proven first-party hand-roll (`../theocode/server/lib/sdk-mappers.ts`)\n * onto the SDK's own types so consumers stop re-implementing a wire-event mapper.\n * Every reader is pure: no I/O, no mutation of its input, deterministic.\n *\n * Public from the `@theokit/sdk/messages` sub-path
|
|
1
|
+
{"version":3,"sources":["../src/messages.ts"],"names":[],"mappings":";AAmBO,SAAS,cAAc,GAAA,EAAyB;AACrD,EAAA,IAAI,GAAA,CAAI,SAAS,WAAA,EAAa;AAC5B,IAAA,OAAO,EAAA;AAAA,EACT;AACA,EAAA,OAAO,IAAI,OAAA,CAAQ,OAAA,CAChB,MAAA,CAAO,CAAC,UAA4D,KAAA,CAAM,IAAA,KAAS,MAAM,CAAA,CACzF,IAAI,CAAC,KAAA,KAAU,MAAM,IAAI,CAAA,CACzB,KAAK,EAAE,CAAA;AACZ;AASO,SAAS,gBAAgB,GAAA,EAAiC;AAC/D,EAAA,IAAI,GAAA,CAAI,SAAS,WAAA,EAAa;AAC5B,IAAA,OAAO,EAAC;AAAA,EACV;AACA,EAAA,OAAO,GAAA,CAAI,QAAQ,OAAA,CAAQ,MAAA,CAAO,CAAC,KAAA,KAAiC,KAAA,CAAM,SAAS,UAAU,CAAA;AAC/F;AAQO,SAAS,cAAc,IAAA,EAAqD;AACjF,EAAA,OAAO,IAAA,EAAM,SAAA;AACf","file":"messages.js","sourcesContent":["/**\n * Pure readers over the `SDKMessage` stream (M1-5).\n *\n * Promotes the proven first-party hand-roll (`../theocode/server/lib/sdk-mappers.ts`)\n * onto the SDK's own types so consumers stop re-implementing a wire-event mapper.\n * Every reader is pure: no I/O, no mutation of its input, deterministic.\n *\n * Public from the `@theokit/sdk/messages` sub-path.\n */\n\nimport type { SDKMessage, ToolUseBlock } from \"./types/messages.js\";\nimport type { CostBreakdown } from \"./types/usage.js\";\n\n/**\n * Concatenate the text of an assistant message's `TextBlock`s.\n *\n * Returns `\"\"` for any non-assistant message (or an assistant with no text\n * blocks). `tool_use` blocks are ignored — only `text` blocks contribute.\n */\nexport function assistantText(msg: SDKMessage): string {\n if (msg.type !== \"assistant\") {\n return \"\";\n }\n return msg.message.content\n .filter((block): block is Extract<typeof block, { type: \"text\" }> => block.type === \"text\")\n .map((block) => block.text)\n .join(\"\");\n}\n\n/**\n * Extract the `ToolUseBlock`s from an assistant message's content.\n *\n * Returns `[]` for any non-assistant message. This reads the assistant\n * message's content blocks — NOT the separate `SDKToolUseMessage`\n * (`type:\"tool_call\"`) lifecycle event, which is a different stream (ADR D2).\n */\nexport function extractToolUses(msg: SDKMessage): ToolUseBlock[] {\n if (msg.type !== \"assistant\") {\n return [];\n }\n return msg.message.content.filter((block): block is ToolUseBlock => block.type === \"tool_use\");\n}\n\n/**\n * Read the cost amount from a `CostBreakdown`, preserving the honesty contract\n * (repo ADR `D377-cost-status-closed-enum.md`): `amountUsd` is `number | undefined`\n * where `undefined` means \"cost unknown\" — distinct from a real `$0` (e.g. a\n * subscription-included route). NEVER coerced to 0.\n */\nexport function costAmountUsd(cost: CostBreakdown | undefined): number | undefined {\n return cost?.amountUsd;\n}\n"]}
|
package/dist/path-safety.d.cts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* surface a known-spurious "ForkOptions not exported" error from
|
|
10
10
|
* `types/agent.ts` (dynamic-import-type quirk in rollup-plugin-dts).
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* primitive reference. Public from v1.x.
|
|
12
|
+
* Path-traversal + TOCTOU-safe primitives. Public from v1.x.
|
|
14
13
|
*/
|
|
15
14
|
export { assertNoSymlinkEscape, ForbiddenPathError, isForbiddenPath, PathTraversalError, safeFilenameForId, safePathJoin, sanitizeIdentifier, } from "./internal/security/path-guard.js";
|
package/dist/path-safety.d.ts
CHANGED
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* surface a known-spurious "ForkOptions not exported" error from
|
|
10
10
|
* `types/agent.ts` (dynamic-import-type quirk in rollup-plugin-dts).
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* primitive reference. Public from v1.x.
|
|
12
|
+
* Path-traversal + TOCTOU-safe primitives. Public from v1.x.
|
|
14
13
|
*/
|
|
15
14
|
export { assertNoSymlinkEscape, ForbiddenPathError, isForbiddenPath, PathTraversalError, safeFilenameForId, safePathJoin, sanitizeIdentifier, } from "./internal/security/path-guard.js";
|
package/dist/types/mcp.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theokit/sdk",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.3",
|
|
4
4
|
"description": "TypeScript SDK for the Theo agent harness — same surface, local or cloud.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/usetheo/theokit-sdk#readme",
|
|
@@ -373,7 +373,6 @@
|
|
|
373
373
|
"test:contract": "vitest run --no-file-parallelism tests/theokit-consumer-contract.test.ts",
|
|
374
374
|
"typecheck": "tsc --noEmit",
|
|
375
375
|
"clean": "rm -rf dist",
|
|
376
|
-
"docs:json": "typedoc --options typedoc.json"
|
|
377
|
-
"docs:drift": "tsx scripts/check-docs-drift.ts"
|
|
376
|
+
"docs:json": "typedoc --options typedoc.json"
|
|
378
377
|
}
|
|
379
378
|
}
|