@theokit/sdk 2.30.0 → 3.0.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 +10 -0
- package/dist/a2a/index.cjs +8 -1
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.d.cts +1 -1
- package/dist/a2a/index.d.ts +1 -1
- package/dist/a2a/index.js +8 -1
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/subagent.d.cts +5 -1
- package/dist/a2a/subagent.d.ts +5 -1
- package/dist/agent-factory.d.ts +5 -20
- package/dist/concurrency.cjs +10 -1
- package/dist/concurrency.cjs.map +1 -1
- package/dist/concurrency.d.cts +7 -1
- package/dist/concurrency.d.ts +7 -1
- package/dist/concurrency.js +10 -1
- package/dist/concurrency.js.map +1 -1
- package/dist/create-skill.d.ts +7 -7
- package/dist/{cron-BNHJywtl.d.ts → cron-BLRe166v.d.ts} +19 -15
- package/dist/{cron-t4oKI2Is.d.cts → cron-C2jWAvlQ.d.cts} +19 -15
- package/dist/cron.d.cts +1 -1
- package/dist/cron.d.ts +1 -1
- package/dist/define-tool.d.ts +12 -1
- package/dist/index.cjs +90 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -114
- package/dist/index.d.ts +60 -114
- package/dist/index.js +79 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/plugins/index.d.cts +1 -1
- package/dist/internal/plugins/index.d.ts +1 -1
- package/dist/internal/plugins/types.d.cts +4 -0
- package/dist/internal/plugins/types.d.ts +4 -0
- package/dist/retry.cjs +10 -1
- package/dist/retry.cjs.map +1 -1
- package/dist/retry.d.cts +12 -1
- package/dist/retry.d.ts +12 -1
- package/dist/retry.js +10 -1
- package/dist/retry.js.map +1 -1
- package/dist/server/auth/index.cjs +8 -1
- package/dist/server/auth/index.cjs.map +1 -1
- package/dist/server/auth/index.d.cts +1 -1
- package/dist/server/auth/index.d.ts +1 -1
- package/dist/server/auth/index.js +8 -1
- package/dist/server/auth/index.js.map +1 -1
- package/dist/server/auth/orchestrator.d.cts +5 -1
- package/dist/server/auth/orchestrator.d.ts +5 -1
- package/dist/subscription/define-subscription.d.cts +5 -0
- package/dist/subscription/define-subscription.d.ts +5 -0
- package/dist/subscription/index.cjs +8 -1
- package/dist/subscription/index.cjs.map +1 -1
- package/dist/subscription/index.d.cts +1 -1
- package/dist/subscription/index.d.ts +1 -1
- package/dist/subscription/index.js +8 -1
- package/dist/subscription/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cron.d.ts
CHANGED
package/dist/define-tool.d.ts
CHANGED
|
@@ -60,5 +60,16 @@ export interface DefineToolSpec<T extends ZodType, O extends ZodType = never> {
|
|
|
60
60
|
*/
|
|
61
61
|
sanitize?: boolean | SanitizeOptions;
|
|
62
62
|
}
|
|
63
|
-
|
|
63
|
+
/**
|
|
64
|
+
* SE36 — the uniform `X.create()` namespace API. `Tool.create(spec)` is the sole public
|
|
65
|
+
* constructor for a {@link CustomTool}; it wraps the internal builder so behavior is identical
|
|
66
|
+
* (ADR 0015). A `private constructor` makes `Tool` a namespace, not an instantiable value —
|
|
67
|
+
* `new Tool()` is a compile error. Mirrors `Agent.create` / `Cron.create`.
|
|
68
|
+
*
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export declare class Tool {
|
|
72
|
+
private constructor();
|
|
73
|
+
static create<T extends ZodType, O extends ZodType = never>(spec: DefineToolSpec<T, O>): CustomTool;
|
|
74
|
+
}
|
|
64
75
|
export {};
|
package/dist/index.cjs
CHANGED
|
@@ -19436,6 +19436,13 @@ function deepMergeCloud(base, top) {
|
|
|
19436
19436
|
if (base === void 0 && top === void 0) return void 0;
|
|
19437
19437
|
return { ...base ?? {}, ...top ?? {} };
|
|
19438
19438
|
}
|
|
19439
|
+
var AgentFactory = class {
|
|
19440
|
+
constructor() {
|
|
19441
|
+
}
|
|
19442
|
+
static create(common) {
|
|
19443
|
+
return createAgentFactory(common);
|
|
19444
|
+
}
|
|
19445
|
+
};
|
|
19439
19446
|
|
|
19440
19447
|
// src/internal/budget/enforcement.ts
|
|
19441
19448
|
init_errors();
|
|
@@ -19873,6 +19880,20 @@ function createTokenLimiter(opts) {
|
|
|
19873
19880
|
processOutput: (ctx) => cap2(ctx.text, ctx)
|
|
19874
19881
|
};
|
|
19875
19882
|
}
|
|
19883
|
+
var TokenLimiter = class {
|
|
19884
|
+
constructor() {
|
|
19885
|
+
}
|
|
19886
|
+
static create(opts) {
|
|
19887
|
+
return createTokenLimiter(opts);
|
|
19888
|
+
}
|
|
19889
|
+
};
|
|
19890
|
+
var UnicodeNormalizer = class {
|
|
19891
|
+
constructor() {
|
|
19892
|
+
}
|
|
19893
|
+
static create(opts = {}) {
|
|
19894
|
+
return createUnicodeNormalizer(opts);
|
|
19895
|
+
}
|
|
19896
|
+
};
|
|
19876
19897
|
|
|
19877
19898
|
// src/create-skill.ts
|
|
19878
19899
|
function createSkill(spec) {
|
|
@@ -19888,6 +19909,13 @@ function createSkill(spec) {
|
|
|
19888
19909
|
...spec.references !== void 0 ? { references: spec.references } : {}
|
|
19889
19910
|
};
|
|
19890
19911
|
}
|
|
19912
|
+
var Skill = class {
|
|
19913
|
+
constructor() {
|
|
19914
|
+
}
|
|
19915
|
+
static create(spec) {
|
|
19916
|
+
return createSkill(spec);
|
|
19917
|
+
}
|
|
19918
|
+
};
|
|
19891
19919
|
|
|
19892
19920
|
// src/cron.ts
|
|
19893
19921
|
init_errors();
|
|
@@ -20356,6 +20384,13 @@ function defineProvider(profile, opts) {
|
|
|
20356
20384
|
profile
|
|
20357
20385
|
};
|
|
20358
20386
|
}
|
|
20387
|
+
var Provider = class {
|
|
20388
|
+
constructor() {
|
|
20389
|
+
}
|
|
20390
|
+
static create(profile, opts) {
|
|
20391
|
+
return defineProvider(profile, opts);
|
|
20392
|
+
}
|
|
20393
|
+
};
|
|
20359
20394
|
|
|
20360
20395
|
// src/define-skill-read-tool.ts
|
|
20361
20396
|
init_to_json_schema();
|
|
@@ -20396,6 +20431,13 @@ function defineSkillReadTool(skills) {
|
|
|
20396
20431
|
}
|
|
20397
20432
|
};
|
|
20398
20433
|
}
|
|
20434
|
+
var SkillReadTool = class {
|
|
20435
|
+
constructor() {
|
|
20436
|
+
}
|
|
20437
|
+
static create(skills) {
|
|
20438
|
+
return defineSkillReadTool(skills);
|
|
20439
|
+
}
|
|
20440
|
+
};
|
|
20399
20441
|
|
|
20400
20442
|
// src/define-tool.ts
|
|
20401
20443
|
init_to_json_schema();
|
|
@@ -20404,6 +20446,13 @@ function shapeToolResult(spec, out) {
|
|
|
20404
20446
|
if (spec.toModelOutput !== void 0) return spec.toModelOutput(validated);
|
|
20405
20447
|
return typeof validated === "string" ? validated : JSON.stringify(validated);
|
|
20406
20448
|
}
|
|
20449
|
+
var Tool = class {
|
|
20450
|
+
constructor() {
|
|
20451
|
+
}
|
|
20452
|
+
static create(spec) {
|
|
20453
|
+
return defineTool(spec);
|
|
20454
|
+
}
|
|
20455
|
+
};
|
|
20407
20456
|
function defineTool(spec) {
|
|
20408
20457
|
const inputSchema = toJsonSchema(spec.inputSchema, {
|
|
20409
20458
|
unrepresentable: "any"
|
|
@@ -20587,6 +20636,7 @@ init_cwd_mutex();
|
|
|
20587
20636
|
function definePlugin(p) {
|
|
20588
20637
|
return p;
|
|
20589
20638
|
}
|
|
20639
|
+
var Plugin = { create: definePlugin };
|
|
20590
20640
|
|
|
20591
20641
|
// src/internal/runtime/budget/budget-tracker-counter.ts
|
|
20592
20642
|
function createCounterBudgetTracker(options = {}) {
|
|
@@ -20745,6 +20795,13 @@ function createNoopMemoryProvider() {
|
|
|
20745
20795
|
}
|
|
20746
20796
|
};
|
|
20747
20797
|
}
|
|
20798
|
+
var NoopMemoryProvider = class {
|
|
20799
|
+
constructor() {
|
|
20800
|
+
}
|
|
20801
|
+
static create() {
|
|
20802
|
+
return createNoopMemoryProvider();
|
|
20803
|
+
}
|
|
20804
|
+
};
|
|
20748
20805
|
var JobQueue = class {
|
|
20749
20806
|
jobs = /* @__PURE__ */ new Map();
|
|
20750
20807
|
controllers = /* @__PURE__ */ new Map();
|
|
@@ -21401,6 +21458,13 @@ function createPermissionPlugin(engine, opts = {}) {
|
|
|
21401
21458
|
}
|
|
21402
21459
|
});
|
|
21403
21460
|
}
|
|
21461
|
+
var PermissionPlugin = class {
|
|
21462
|
+
constructor() {
|
|
21463
|
+
}
|
|
21464
|
+
static create(engine, opts = {}) {
|
|
21465
|
+
return createPermissionPlugin(engine, opts);
|
|
21466
|
+
}
|
|
21467
|
+
};
|
|
21404
21468
|
|
|
21405
21469
|
// src/schema-normalizer.ts
|
|
21406
21470
|
init_to_json_schema();
|
|
@@ -21590,6 +21654,13 @@ function previewOf(text) {
|
|
|
21590
21654
|
if (oneLine.length === 0) return void 0;
|
|
21591
21655
|
return oneLine.length > SUMMARY_PREVIEW_MAX ? `${oneLine.slice(0, SUMMARY_PREVIEW_MAX - 1)}\u2026` : oneLine;
|
|
21592
21656
|
}
|
|
21657
|
+
var Session = class {
|
|
21658
|
+
constructor() {
|
|
21659
|
+
}
|
|
21660
|
+
static create(storage2) {
|
|
21661
|
+
return createSessionManager(storage2);
|
|
21662
|
+
}
|
|
21663
|
+
};
|
|
21593
21664
|
|
|
21594
21665
|
// src/session-scope.ts
|
|
21595
21666
|
function scopedConversationId(scope, id) {
|
|
@@ -21947,6 +22018,13 @@ function createSquad(options) {
|
|
|
21947
22018
|
}
|
|
21948
22019
|
};
|
|
21949
22020
|
}
|
|
22021
|
+
var Squad = class {
|
|
22022
|
+
constructor() {
|
|
22023
|
+
}
|
|
22024
|
+
static create(options) {
|
|
22025
|
+
return createSquad(options);
|
|
22026
|
+
}
|
|
22027
|
+
};
|
|
21950
22028
|
|
|
21951
22029
|
// src/index.ts
|
|
21952
22030
|
init_stream_object();
|
|
@@ -22396,35 +22474,35 @@ function safeStringify2(v) {
|
|
|
22396
22474
|
|
|
22397
22475
|
exports.Agent = Agent;
|
|
22398
22476
|
exports.AgentBuilder = AgentBuilder;
|
|
22477
|
+
exports.AgentFactory = AgentFactory;
|
|
22399
22478
|
exports.Budget = Budget;
|
|
22400
22479
|
exports.Cron = Cron;
|
|
22401
22480
|
exports.EventBus = EventBus;
|
|
22402
22481
|
exports.InMemoryConversationStorage = InMemoryConversationStorage;
|
|
22403
22482
|
exports.JobQueue = JobQueue;
|
|
22404
22483
|
exports.Memory = Memory;
|
|
22484
|
+
exports.NoopMemoryProvider = NoopMemoryProvider;
|
|
22405
22485
|
exports.PermissionEngine = PermissionEngine;
|
|
22486
|
+
exports.PermissionPlugin = PermissionPlugin;
|
|
22487
|
+
exports.Plugin = Plugin;
|
|
22488
|
+
exports.Provider = Provider;
|
|
22406
22489
|
exports.Security = Security;
|
|
22490
|
+
exports.Session = Session;
|
|
22491
|
+
exports.Skill = Skill;
|
|
22492
|
+
exports.SkillReadTool = SkillReadTool;
|
|
22493
|
+
exports.Squad = Squad;
|
|
22407
22494
|
exports.Task = Task;
|
|
22408
22495
|
exports.Theokit = Theokit;
|
|
22496
|
+
exports.TokenLimiter = TokenLimiter;
|
|
22497
|
+
exports.Tool = Tool;
|
|
22409
22498
|
exports.ToolError = ToolError;
|
|
22499
|
+
exports.UnicodeNormalizer = UnicodeNormalizer;
|
|
22410
22500
|
exports.UsageAccumulator = UsageAccumulator;
|
|
22411
22501
|
exports.applyMode = applyMode;
|
|
22412
22502
|
exports.buildReplayHistory = buildReplayHistory;
|
|
22413
22503
|
exports.chargeAndCheckThresholds = chargeAndCheckThresholds;
|
|
22414
22504
|
exports.computeCost = computeCost;
|
|
22415
|
-
exports.createAgentFactory = createAgentFactory;
|
|
22416
22505
|
exports.createCounterBudgetTracker = createCounterBudgetTracker;
|
|
22417
|
-
exports.createNoopMemoryProvider = createNoopMemoryProvider;
|
|
22418
|
-
exports.createPermissionPlugin = createPermissionPlugin;
|
|
22419
|
-
exports.createSessionManager = createSessionManager;
|
|
22420
|
-
exports.createSkill = createSkill;
|
|
22421
|
-
exports.createSquad = createSquad;
|
|
22422
|
-
exports.createTokenLimiter = createTokenLimiter;
|
|
22423
|
-
exports.createUnicodeNormalizer = createUnicodeNormalizer;
|
|
22424
|
-
exports.definePlugin = definePlugin;
|
|
22425
|
-
exports.defineProvider = defineProvider;
|
|
22426
|
-
exports.defineSkillReadTool = defineSkillReadTool;
|
|
22427
|
-
exports.defineTool = defineTool;
|
|
22428
22506
|
exports.emitRunEvent = emitRunEvent;
|
|
22429
22507
|
exports.estimateTokens = estimateTokens;
|
|
22430
22508
|
exports.extractRawId = extractRawId;
|