@theokit/sdk 2.19.0 → 2.21.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 +123 -0
- package/dist/a2a/index.cjs +611 -274
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +612 -275
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/types.d.cts +7 -0
- package/dist/a2a/types.d.ts +7 -0
- package/dist/agent-builder.d.ts +2 -1
- package/dist/agent-generate.d.ts +12 -0
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +5 -0
- package/dist/client/index.d.ts +5 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/theokit-client.d.cts +6 -0
- package/dist/client/theokit-client.d.ts +6 -0
- package/dist/client/types.d.cts +2 -0
- package/dist/client/types.d.ts +2 -0
- package/dist/create-skill.d.ts +29 -0
- package/dist/{cron-D_wK1S-0.d.cts → cron-YrmsszEN.d.cts} +110 -3
- package/dist/{cron-Cep07kTz.d.ts → cron-dpvtRoro.d.ts} +110 -3
- package/dist/cron.cjs +660 -370
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +3 -2
- package/dist/cron.d.ts +3 -2
- package/dist/cron.js +661 -371
- package/dist/cron.js.map +1 -1
- package/dist/{errors-5lj1EWgs.d.ts → errors-C4vZPqXf.d.ts} +2 -2
- package/dist/{errors-CE-lMBi2.d.cts → errors-DrcpYVfZ.d.cts} +2 -2
- package/dist/errors.d.cts +3 -2
- package/dist/eval.cjs +660 -370
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +660 -370
- package/dist/eval.js.map +1 -1
- package/dist/generate-object.d.ts +19 -4
- package/dist/index.cjs +867 -371
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +274 -16
- package/dist/index.d.ts +274 -16
- package/dist/index.js +863 -373
- package/dist/index.js.map +1 -1
- package/dist/internal/agent-loop/loop-types.d.ts +2 -0
- package/dist/internal/agent-loop/tool-result-guard.d.ts +1 -0
- package/dist/internal/llm/tool-result-content.d.ts +40 -0
- package/dist/internal/llm/types.d.ts +6 -1
- package/dist/internal/persistence/conversation-storage-fs.d.cts +3 -1
- package/dist/internal/persistence/conversation-storage-fs.d.ts +3 -1
- package/dist/internal/persistence/conversation-storage-memory.d.cts +3 -1
- package/dist/internal/persistence/conversation-storage-memory.d.ts +3 -1
- package/dist/internal/persistence/session-meta.d.cts +13 -0
- package/dist/internal/persistence/session-meta.d.ts +13 -0
- package/dist/internal/runtime/model-selection.d.ts +14 -0
- package/dist/internal/structured-output-helpers.d.ts +1 -1
- package/dist/permission-engine.d.ts +32 -1
- package/dist/{run-BgfBWX-z.d.cts → run-BMo8yRwK.d.cts} +262 -19
- package/dist/{run-BgfBWX-z.d.ts → run-BMo8yRwK.d.ts} +262 -19
- package/dist/stream-object.d.ts +2 -1
- package/dist/tool-error.d.ts +30 -0
- package/dist/types/agent-prims.d.ts +10 -8
- package/dist/types/agent.d.ts +22 -1
- package/dist/types/content-blocks.d.ts +47 -0
- package/dist/types/conversation-storage.d.ts +38 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/messages.d.ts +2 -9
- package/dist/types/run-events.d.ts +84 -0
- package/dist/types/run.d.ts +115 -1
- package/dist/types/session.d.ts +99 -0
- package/dist/types/workflow.d.ts +7 -0
- package/dist/workflow.cjs +7 -2
- package/dist/workflow.cjs.map +1 -1
- package/dist/workflow.d.cts +2 -0
- package/dist/workflow.d.ts +2 -0
- package/dist/workflow.js +7 -2
- package/dist/workflow.js.map +1 -1
- package/package.json +3 -23
- package/dist/internal/observability/context.d.cts +0 -23
- package/dist/internal/observability/context.d.ts +0 -23
- package/dist/internal/observability/index.cjs +0 -38
- package/dist/internal/observability/index.cjs.map +0 -1
- package/dist/internal/observability/index.d.cts +0 -8
- package/dist/internal/observability/index.d.ts +0 -8
- package/dist/internal/observability/index.js +0 -33
- package/dist/internal/observability/index.js.map +0 -1
- package/dist/internal/plugins/index.cjs +0 -363
- package/dist/internal/plugins/index.cjs.map +0 -1
- package/dist/internal/plugins/index.js +0 -357
- package/dist/internal/plugins/index.js.map +0 -1
- package/dist/internal/workflow/index.d.ts +0 -12
- package/dist/server/adapter/index.d.cts +0 -8
- package/dist/server/adapter/index.d.ts +0 -8
package/dist/workflow.d.cts
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import type { ZodType } from "zod";
|
|
26
26
|
import type { SDKAgent } from "./types/agent.js";
|
|
27
|
+
import type { MessageOrigin } from "./types/run.js";
|
|
27
28
|
import type { AgentStep, BranchStep, DowhileStep, FnStep, RetryPolicy, Step, StepContext, WorkflowOptions, WorkflowResumeOptions, WorkflowRun, WorkflowRunOptions } from "./types/workflow.js";
|
|
28
29
|
export declare class WorkflowBuilder<TInput = unknown, TOutput = unknown> {
|
|
29
30
|
private readonly options;
|
|
@@ -91,6 +92,7 @@ export declare function fn<I = unknown, O = unknown>(id: string, step: (input: I
|
|
|
91
92
|
*/
|
|
92
93
|
export declare function agentStep(id: string, agent: SDKAgent, promptTemplate: string | ((input: unknown) => string), opts?: {
|
|
93
94
|
retry?: RetryPolicy;
|
|
95
|
+
origin?: MessageOrigin;
|
|
94
96
|
}): AgentStep;
|
|
95
97
|
export { __resetSnapshotStoresForTests } from "./internal/workflow/snapshot-store.js";
|
|
96
98
|
export type * from "./types/workflow.js";
|
package/dist/workflow.d.ts
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import type { ZodType } from "zod";
|
|
26
26
|
import type { SDKAgent } from "./types/agent.js";
|
|
27
|
+
import type { MessageOrigin } from "./types/run.js";
|
|
27
28
|
import type { AgentStep, BranchStep, DowhileStep, FnStep, RetryPolicy, Step, StepContext, WorkflowOptions, WorkflowResumeOptions, WorkflowRun, WorkflowRunOptions } from "./types/workflow.js";
|
|
28
29
|
export declare class WorkflowBuilder<TInput = unknown, TOutput = unknown> {
|
|
29
30
|
private readonly options;
|
|
@@ -91,6 +92,7 @@ export declare function fn<I = unknown, O = unknown>(id: string, step: (input: I
|
|
|
91
92
|
*/
|
|
92
93
|
export declare function agentStep(id: string, agent: SDKAgent, promptTemplate: string | ((input: unknown) => string), opts?: {
|
|
93
94
|
retry?: RetryPolicy;
|
|
95
|
+
origin?: MessageOrigin;
|
|
94
96
|
}): AgentStep;
|
|
95
97
|
export { __resetSnapshotStoresForTests } from "./internal/workflow/snapshot-store.js";
|
|
96
98
|
export type * from "./types/workflow.js";
|
package/dist/workflow.js
CHANGED
|
@@ -678,7 +678,10 @@ async function runAgentStep(step, input, ctx) {
|
|
|
678
678
|
};
|
|
679
679
|
}
|
|
680
680
|
const exec = async () => {
|
|
681
|
-
const run = await step.agent.send(
|
|
681
|
+
const run = await step.agent.send(
|
|
682
|
+
prompt,
|
|
683
|
+
step.origin !== void 0 ? { origin: step.origin } : void 0
|
|
684
|
+
);
|
|
682
685
|
const result = await run.wait();
|
|
683
686
|
if (result.status === "finished") {
|
|
684
687
|
return result.result ?? "";
|
|
@@ -2459,7 +2462,9 @@ function agentStep(id, agent, promptTemplate, opts) {
|
|
|
2459
2462
|
id,
|
|
2460
2463
|
agent,
|
|
2461
2464
|
promptTemplate,
|
|
2462
|
-
...opts?.retry !== void 0 ? { retry: opts.retry } : {}
|
|
2465
|
+
...opts?.retry !== void 0 ? { retry: opts.retry } : {},
|
|
2466
|
+
// SE3 — carry the turn's provenance down to `agent.send()` (metadata-only).
|
|
2467
|
+
...opts?.origin !== void 0 ? { origin: opts.origin } : {}
|
|
2463
2468
|
};
|
|
2464
2469
|
}
|
|
2465
2470
|
function validateStepId(id) {
|