@theokit/sdk 3.2.3 → 3.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.
- package/CHANGELOG.md +6 -0
- package/dist/a2a/index.cjs +7 -1
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +7 -1
- package/dist/a2a/index.js.map +1 -1
- package/dist/{cron-DuhVPer6.d.ts → cron-BxoLC-XX.d.cts} +15 -1
- package/dist/{cron-4u1UdmgC.d.cts → cron-DFta_5kE.d.ts} +15 -1
- package/dist/cron.cjs +7 -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 +7 -1
- package/dist/cron.js.map +1 -1
- package/dist/{errors-_fPS0X80.d.ts → errors-CFEt27lI.d.ts} +1 -1
- package/dist/{errors-jxK4yfp5.d.cts → errors-CIDoPGa7.d.cts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs +7 -1
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +7 -1
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +15 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -93
- package/dist/index.d.ts +7 -93
- package/dist/index.js +15 -5
- package/dist/index.js.map +1 -1
- package/dist/internal/plugins/types.d.cts +7 -0
- package/dist/internal/plugins/types.d.ts +7 -0
- package/dist/permission-engine.d.ts +4 -3
- package/dist/{run-CrHz9BAP.d.cts → run-CL5Rw6a5.d.cts} +98 -1
- package/dist/{run-CrHz9BAP.d.ts → run-CL5Rw6a5.d.ts} +98 -1
- package/dist/types/agent.d.ts +7 -0
- package/dist/types/run.d.ts +10 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { ZodType } from 'zod';
|
|
3
|
-
import { C as CustomTool, M as ModelSelection,
|
|
3
|
+
import { C as CustomTool, c as PermissionMode, M as ModelSelection, ac as SDKUserMessage, ae as SendOptions, b as Run, G as GenerateOptions, m as GenerateRunResult, _ as RunToCompletionOptions, $ as RunToCompletionResult, S as SDKMessage, al as StreamToCompletionResult, a as McpServerConfig, P as Processor, t as MessageOrigin } from './run-CL5Rw6a5.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Fork primitive public type contracts (T1.2, ADRs D110-D114).
|
|
@@ -1100,6 +1100,13 @@ interface PreToolCallContext {
|
|
|
1100
1100
|
args: Record<string, unknown>;
|
|
1101
1101
|
agentId: string;
|
|
1102
1102
|
runId: string;
|
|
1103
|
+
/**
|
|
1104
|
+
* SE1 — the run's resolved `PermissionMode` (from `SendOptions.permissionMode`
|
|
1105
|
+
* ?? `AgentOptions.permissionMode`), threaded so a permission-style plugin can
|
|
1106
|
+
* gate per-run rather than at construction time. Absent ⇒ the plugin's own
|
|
1107
|
+
* default applies. Ignored by non-permission plugins.
|
|
1108
|
+
*/
|
|
1109
|
+
permissionMode?: PermissionMode;
|
|
1103
1110
|
}
|
|
1104
1111
|
interface PreToolCallDecision {
|
|
1105
1112
|
block: true;
|
|
@@ -1563,6 +1570,13 @@ interface AgentOptions {
|
|
|
1563
1570
|
* The two forms are mutually exclusive — pass one or the other.
|
|
1564
1571
|
*/
|
|
1565
1572
|
plugins?: PluginsSettings | readonly Plugin[];
|
|
1573
|
+
/**
|
|
1574
|
+
* SE1 — the default permission mode for this agent's runs, threaded to a
|
|
1575
|
+
* registered `PermissionPlugin`'s pre-tool gate. A per-send
|
|
1576
|
+
* `SendOptions.permissionMode` overrides it. Absent ⇒ the plugin's own
|
|
1577
|
+
* construction-time mode applies. Local runtime.
|
|
1578
|
+
*/
|
|
1579
|
+
permissionMode?: PermissionMode;
|
|
1566
1580
|
/**
|
|
1567
1581
|
* Skills configuration. Either a static {@link SkillsSettings} object or —
|
|
1568
1582
|
* SE22 — a {@link SkillsResolver} evaluated per `send()` to pick skills from
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { ZodType } from 'zod';
|
|
3
|
-
import { C as CustomTool, M as ModelSelection,
|
|
3
|
+
import { C as CustomTool, c as PermissionMode, M as ModelSelection, ac as SDKUserMessage, ae as SendOptions, b as Run, G as GenerateOptions, m as GenerateRunResult, _ as RunToCompletionOptions, $ as RunToCompletionResult, S as SDKMessage, al as StreamToCompletionResult, a as McpServerConfig, P as Processor, t as MessageOrigin } from './run-CL5Rw6a5.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Fork primitive public type contracts (T1.2, ADRs D110-D114).
|
|
@@ -1100,6 +1100,13 @@ interface PreToolCallContext {
|
|
|
1100
1100
|
args: Record<string, unknown>;
|
|
1101
1101
|
agentId: string;
|
|
1102
1102
|
runId: string;
|
|
1103
|
+
/**
|
|
1104
|
+
* SE1 — the run's resolved `PermissionMode` (from `SendOptions.permissionMode`
|
|
1105
|
+
* ?? `AgentOptions.permissionMode`), threaded so a permission-style plugin can
|
|
1106
|
+
* gate per-run rather than at construction time. Absent ⇒ the plugin's own
|
|
1107
|
+
* default applies. Ignored by non-permission plugins.
|
|
1108
|
+
*/
|
|
1109
|
+
permissionMode?: PermissionMode;
|
|
1103
1110
|
}
|
|
1104
1111
|
interface PreToolCallDecision {
|
|
1105
1112
|
block: true;
|
|
@@ -1563,6 +1570,13 @@ interface AgentOptions {
|
|
|
1563
1570
|
* The two forms are mutually exclusive — pass one or the other.
|
|
1564
1571
|
*/
|
|
1565
1572
|
plugins?: PluginsSettings | readonly Plugin[];
|
|
1573
|
+
/**
|
|
1574
|
+
* SE1 — the default permission mode for this agent's runs, threaded to a
|
|
1575
|
+
* registered `PermissionPlugin`'s pre-tool gate. A per-send
|
|
1576
|
+
* `SendOptions.permissionMode` overrides it. Absent ⇒ the plugin's own
|
|
1577
|
+
* construction-time mode applies. Local runtime.
|
|
1578
|
+
*/
|
|
1579
|
+
permissionMode?: PermissionMode;
|
|
1566
1580
|
/**
|
|
1567
1581
|
* Skills configuration. Either a static {@link SkillsSettings} object or —
|
|
1568
1582
|
* SE22 — a {@link SkillsResolver} evaluated per `send()` to pick skills from
|
package/dist/cron.cjs
CHANGED
|
@@ -9006,7 +9006,9 @@ async function vetoFromPluginPreHook(inputs, call, callId, events) {
|
|
|
9006
9006
|
name: call.name,
|
|
9007
9007
|
args: call.input,
|
|
9008
9008
|
agentId: inputs.agentId,
|
|
9009
|
-
runId: inputs.runId
|
|
9009
|
+
runId: inputs.runId,
|
|
9010
|
+
// SE1 — thread the run's permission mode so a PermissionPlugin gates per-run.
|
|
9011
|
+
...inputs.permissionMode !== void 0 ? { permissionMode: inputs.permissionMode } : {}
|
|
9010
9012
|
});
|
|
9011
9013
|
if (pluginVeto === void 0) return void 0;
|
|
9012
9014
|
emitRunEvent(inputs.runEventSink, {
|
|
@@ -13417,6 +13419,10 @@ function buildLoopInputs(options, runId, userText) {
|
|
|
13417
13419
|
...options.onDelta !== void 0 ? { onDelta: options.onDelta } : {},
|
|
13418
13420
|
...options.sendOptions.toolChoice !== void 0 ? { toolChoice: options.sendOptions.toolChoice } : {},
|
|
13419
13421
|
...options.sendOptions.activeTools !== void 0 ? { activeTools: options.sendOptions.activeTools } : {},
|
|
13422
|
+
// SE1 — resolve the run's permission mode: per-send wins over creation-time.
|
|
13423
|
+
...(options.sendOptions.permissionMode ?? options.agentOptions.permissionMode) !== void 0 ? {
|
|
13424
|
+
permissionMode: options.sendOptions.permissionMode ?? options.agentOptions.permissionMode
|
|
13425
|
+
} : {},
|
|
13420
13426
|
...options.priorMessages !== void 0 ? { priorMessages: options.priorMessages } : {},
|
|
13421
13427
|
...options.memoryTools !== void 0 && options.memoryTools.length > 0 ? { memoryTools: options.memoryTools } : {},
|
|
13422
13428
|
...buildCustomToolsInput(
|