@theokit/sdk 2.15.1 → 2.18.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/CHANGELOG.md +71 -0
- package/dist/a2a/index.cjs +981 -208
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +982 -209
- package/dist/a2a/index.js.map +1 -1
- package/dist/{cron-BxLSz1UH.d.cts → cron-Bbg0mBOv.d.ts} +33 -3
- package/dist/{cron-DcaoP7aW.d.ts → cron-ZLSKbDbB.d.cts} +33 -3
- package/dist/cron.cjs +945 -196
- 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 +945 -196
- package/dist/cron.js.map +1 -1
- package/dist/define-tool.d.ts +9 -2
- package/dist/{errors-Bart0ptP.d.cts → errors-1tVcX3Fq.d.cts} +1 -1
- package/dist/{errors-DJuuubJK.d.ts → errors-qyVYfk9H.d.ts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs +951 -198
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +951 -198
- package/dist/eval.js.map +1 -1
- package/dist/event-bus.d.ts +3 -0
- package/dist/index.cjs +1082 -224
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +122 -27
- package/dist/index.d.ts +122 -27
- package/dist/index.js +1082 -226
- package/dist/index.js.map +1 -1
- package/dist/internal/agent-loop/tool-dispatch.d.ts +3 -1
- package/dist/internal/agent-loop/tool-result-guard.d.ts +24 -0
- package/dist/internal/agent-loop/tool-timeout.d.ts +23 -0
- package/dist/internal/llm/openai.d.ts +13 -0
- package/dist/internal/llm/sse.d.ts +13 -1
- package/dist/internal/mcp/client.d.ts +1 -1
- package/dist/internal/memory/active-memory.d.ts +1 -1
- package/dist/internal/persistence/conversation-storage-fs.d.cts +7 -1
- package/dist/internal/persistence/conversation-storage-fs.d.ts +7 -1
- package/dist/internal/persistence/conversation-storage-memory.d.cts +7 -1
- package/dist/internal/persistence/conversation-storage-memory.d.ts +7 -1
- package/dist/internal/persistence/pagination.d.cts +8 -0
- package/dist/internal/persistence/pagination.d.ts +8 -0
- package/dist/internal/plugins/index.cjs +135 -0
- package/dist/internal/plugins/index.cjs.map +1 -1
- package/dist/internal/plugins/index.js +135 -0
- package/dist/internal/plugins/index.js.map +1 -1
- package/dist/internal/plugins/manager.d.cts +21 -1
- package/dist/internal/plugins/manager.d.ts +21 -1
- package/dist/internal/plugins/types.d.cts +40 -0
- package/dist/internal/plugins/types.d.ts +40 -0
- package/dist/internal/{memory → resilience}/circuit-breaker.d.ts +5 -1
- package/dist/internal/runtime/hooks/hooks-frontmatter.d.ts +1 -1
- package/dist/internal/runtime/lifecycle/env-policy.d.ts +30 -0
- package/dist/internal/runtime/session/agent-session-store.d.ts +1 -0
- package/dist/internal/telemetry/span-names.d.ts +7 -1
- package/dist/job-queue.d.ts +29 -7
- package/dist/permission-engine.d.ts +32 -7
- package/dist/{run-DXy_MVwz.d.cts → run-pE-34AAo.d.cts} +64 -3
- package/dist/{run-DXy_MVwz.d.ts → run-pE-34AAo.d.ts} +64 -3
- package/dist/sandbox/index.cjs +53 -2
- package/dist/sandbox/index.cjs.map +1 -1
- package/dist/sandbox/index.js +53 -2
- package/dist/sandbox/index.js.map +1 -1
- package/dist/sandbox/local-sandbox.d.cts +11 -3
- package/dist/sandbox/local-sandbox.d.ts +11 -3
- package/dist/sandbox/types.d.cts +7 -0
- package/dist/sandbox/types.d.ts +7 -0
- package/dist/types/agent-prims.d.ts +6 -2
- package/dist/types/conversation-storage.d.ts +32 -2
- package/dist/types/mcp.d.ts +20 -0
- package/dist/types/run.d.ts +17 -0
- package/dist/workflow.cjs +6 -3
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.js +6 -3
- package/dist/workflow.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomTool, M as ModelSelection, G as SDKUserMessage, J as SendOptions, b as Run, r as RunToCompletionOptions, s as RunToCompletionResult, S as SDKMessage, U as StreamToCompletionResult, a as McpServerConfig } from './run-
|
|
1
|
+
import { C as CustomTool, M as ModelSelection, G as SDKUserMessage, J as SendOptions, b as Run, r as RunToCompletionOptions, s as RunToCompletionResult, S as SDKMessage, U as StreamToCompletionResult, a as McpServerConfig } from './run-pE-34AAo.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Fork primitive public type contracts (T1.2, ADRs D110-D114).
|
|
@@ -616,20 +616,50 @@ interface StoredMessage {
|
|
|
616
616
|
*/
|
|
617
617
|
interface ConversationStorageAdapter {
|
|
618
618
|
/**
|
|
619
|
-
* Return the
|
|
619
|
+
* Return the message history for a conversation, in insertion order.
|
|
620
620
|
* MUST return `[]` (not throw) when the conversation does not exist.
|
|
621
|
+
*
|
|
622
|
+
* M2 #63 — an optional `{ offset, limit }` window paginates the result so a
|
|
623
|
+
* caller hydrating a long history is not forced to materialize the whole log.
|
|
624
|
+
* Omitting `opts` returns the full history (backward-compatible). `offset`
|
|
625
|
+
* counts from the oldest message; `limit` bounds the returned count.
|
|
621
626
|
*/
|
|
622
|
-
getMessages(conversationId: string
|
|
627
|
+
getMessages(conversationId: string, opts?: {
|
|
628
|
+
offset?: number;
|
|
629
|
+
limit?: number;
|
|
630
|
+
}): Promise<readonly StoredMessage[]>;
|
|
623
631
|
/**
|
|
624
632
|
* Append a single message to the conversation.
|
|
625
633
|
* MUST be atomic — concurrent appends MUST NOT corrupt the log.
|
|
626
634
|
* MUST create the conversation lazily if it does not exist.
|
|
627
635
|
*/
|
|
628
636
|
appendMessage(conversationId: string, message: StoredMessage): Promise<void>;
|
|
637
|
+
/**
|
|
638
|
+
* M2 #63 — optional batch append: write a whole conversation turn
|
|
639
|
+
* (user + assistant + N tool results) in ONE atomic operation. The default FS
|
|
640
|
+
* adapter uses a single locked `appendFile` (one open per turn instead of N).
|
|
641
|
+
* Adapters that do not implement it fall back to looping `appendMessage`.
|
|
642
|
+
* MUST be atomic as a unit — a partial batch MUST NOT be observable.
|
|
643
|
+
*/
|
|
644
|
+
appendMessages?(conversationId: string, messages: readonly StoredMessage[]): Promise<void>;
|
|
645
|
+
/**
|
|
646
|
+
* M3 #67 — revert a conversation back to its first `keepCount` messages
|
|
647
|
+
* ("undo the last turn(s)"). Atomic rewrite; `keepCount <= 0` empties it,
|
|
648
|
+
* `keepCount >= length` is a no-op. Returns the number of messages kept.
|
|
649
|
+
* Transcript-only; adapters that cannot truncate MAY omit it.
|
|
650
|
+
*/
|
|
651
|
+
truncateConversation?(conversationId: string, keepCount: number): Promise<number>;
|
|
629
652
|
/**
|
|
630
653
|
* Delete the entire conversation. MUST be idempotent (delete-of-missing = ok).
|
|
631
654
|
*/
|
|
632
655
|
deleteConversation(conversationId: string): Promise<void>;
|
|
656
|
+
/**
|
|
657
|
+
* M3 #62 — delete every conversation whose id starts with `prefix`
|
|
658
|
+
* (e.g. `"temp__"` from {@link sessionScopePrefix}) so a whole session scope
|
|
659
|
+
* can be pruned in one call. Returns the number deleted. Optional — adapters
|
|
660
|
+
* that cannot enumerate MAY omit it.
|
|
661
|
+
*/
|
|
662
|
+
deleteScope?(prefix: string): Promise<number>;
|
|
633
663
|
/**
|
|
634
664
|
* Optional: list conversation ids. Used by housekeeping flows.
|
|
635
665
|
* Implementations that cannot enumerate (e.g., wildcards too expensive on
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomTool, M as ModelSelection, G as SDKUserMessage, J as SendOptions, b as Run, r as RunToCompletionOptions, s as RunToCompletionResult, S as SDKMessage, U as StreamToCompletionResult, a as McpServerConfig } from './run-
|
|
1
|
+
import { C as CustomTool, M as ModelSelection, G as SDKUserMessage, J as SendOptions, b as Run, r as RunToCompletionOptions, s as RunToCompletionResult, S as SDKMessage, U as StreamToCompletionResult, a as McpServerConfig } from './run-pE-34AAo.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Fork primitive public type contracts (T1.2, ADRs D110-D114).
|
|
@@ -616,20 +616,50 @@ interface StoredMessage {
|
|
|
616
616
|
*/
|
|
617
617
|
interface ConversationStorageAdapter {
|
|
618
618
|
/**
|
|
619
|
-
* Return the
|
|
619
|
+
* Return the message history for a conversation, in insertion order.
|
|
620
620
|
* MUST return `[]` (not throw) when the conversation does not exist.
|
|
621
|
+
*
|
|
622
|
+
* M2 #63 — an optional `{ offset, limit }` window paginates the result so a
|
|
623
|
+
* caller hydrating a long history is not forced to materialize the whole log.
|
|
624
|
+
* Omitting `opts` returns the full history (backward-compatible). `offset`
|
|
625
|
+
* counts from the oldest message; `limit` bounds the returned count.
|
|
621
626
|
*/
|
|
622
|
-
getMessages(conversationId: string
|
|
627
|
+
getMessages(conversationId: string, opts?: {
|
|
628
|
+
offset?: number;
|
|
629
|
+
limit?: number;
|
|
630
|
+
}): Promise<readonly StoredMessage[]>;
|
|
623
631
|
/**
|
|
624
632
|
* Append a single message to the conversation.
|
|
625
633
|
* MUST be atomic — concurrent appends MUST NOT corrupt the log.
|
|
626
634
|
* MUST create the conversation lazily if it does not exist.
|
|
627
635
|
*/
|
|
628
636
|
appendMessage(conversationId: string, message: StoredMessage): Promise<void>;
|
|
637
|
+
/**
|
|
638
|
+
* M2 #63 — optional batch append: write a whole conversation turn
|
|
639
|
+
* (user + assistant + N tool results) in ONE atomic operation. The default FS
|
|
640
|
+
* adapter uses a single locked `appendFile` (one open per turn instead of N).
|
|
641
|
+
* Adapters that do not implement it fall back to looping `appendMessage`.
|
|
642
|
+
* MUST be atomic as a unit — a partial batch MUST NOT be observable.
|
|
643
|
+
*/
|
|
644
|
+
appendMessages?(conversationId: string, messages: readonly StoredMessage[]): Promise<void>;
|
|
645
|
+
/**
|
|
646
|
+
* M3 #67 — revert a conversation back to its first `keepCount` messages
|
|
647
|
+
* ("undo the last turn(s)"). Atomic rewrite; `keepCount <= 0` empties it,
|
|
648
|
+
* `keepCount >= length` is a no-op. Returns the number of messages kept.
|
|
649
|
+
* Transcript-only; adapters that cannot truncate MAY omit it.
|
|
650
|
+
*/
|
|
651
|
+
truncateConversation?(conversationId: string, keepCount: number): Promise<number>;
|
|
629
652
|
/**
|
|
630
653
|
* Delete the entire conversation. MUST be idempotent (delete-of-missing = ok).
|
|
631
654
|
*/
|
|
632
655
|
deleteConversation(conversationId: string): Promise<void>;
|
|
656
|
+
/**
|
|
657
|
+
* M3 #62 — delete every conversation whose id starts with `prefix`
|
|
658
|
+
* (e.g. `"temp__"` from {@link sessionScopePrefix}) so a whole session scope
|
|
659
|
+
* can be pruned in one call. Returns the number deleted. Optional — adapters
|
|
660
|
+
* that cannot enumerate MAY omit it.
|
|
661
|
+
*/
|
|
662
|
+
deleteScope?(prefix: string): Promise<number>;
|
|
633
663
|
/**
|
|
634
664
|
* Optional: list conversation ids. Used by housekeeping flows.
|
|
635
665
|
* Implementations that cannot enumerate (e.g., wildcards too expensive on
|