@yaklabs-ai/plugin-sdk 0.14.1 → 0.15.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/README.md +2 -2
- package/THIRD-PARTY-INVENTORY.json +1 -1
- package/dist/disclosure.d.ts +99 -8
- package/dist/disclosure.js +17 -15
- package/dist/kay-agent-testing.d.ts +99 -8
- package/dist/kay-agent-testing.js +17 -15
- package/dist/kay-agent.d.ts +139 -11
- package/dist/kay-app.d.ts +150 -27
- package/dist/kay-app.js +4 -0
- package/dist/system-one.d.ts +10 -4
- package/dist/system-one.js +17 -15
- package/dist/transcript.d.ts +32 -0
- package/dist/transcript.js +41 -0
- package/dist/vendored-mcp.d.ts +2 -2
- package/package.json +1 -1
- package/skills/directory-plugin-authoring/SKILL.md +4 -4
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ it under the name your plugin code actually imports:
|
|
|
13
13
|
```json
|
|
14
14
|
{
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.
|
|
16
|
+
"@bonsai/plugin-sdk": "npm:@yaklabs-ai/plugin-sdk@^0.15.0"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
```
|
|
@@ -62,7 +62,7 @@ Every tool the entrypoint registers is declared in the manifest too:
|
|
|
62
62
|
"description": "Greets people by name.",
|
|
63
63
|
"version": "0.1.0",
|
|
64
64
|
"namespace": "widgets",
|
|
65
|
-
"compatibility": { "sdk": "^0.
|
|
65
|
+
"compatibility": { "sdk": "^0.15.0" },
|
|
66
66
|
"targets": {
|
|
67
67
|
"kay": {
|
|
68
68
|
"agent": {
|
package/dist/disclosure.d.ts
CHANGED
|
@@ -86,6 +86,8 @@ declare interface AgentToolResult<T = JsonValue_3 | undefined> {
|
|
|
86
86
|
* error, but `details` and `structuredContent` are kept for the UI and programmatic callers.
|
|
87
87
|
*/
|
|
88
88
|
isError?: boolean;
|
|
89
|
+
/** Classification for an `isError` result; the host validates it and stamps identity and attribution. */
|
|
90
|
+
failure?: ToolCallFailure;
|
|
89
91
|
/**
|
|
90
92
|
* Hint that the agent should stop after the current tool batch.
|
|
91
93
|
* Early termination only happens when every finalized tool result in the batch sets this to true.
|
|
@@ -261,6 +263,12 @@ declare interface BackgroundTaskAdoptOptions {
|
|
|
261
263
|
readonly ownerId?: string;
|
|
262
264
|
readonly inspect?: BackgroundTaskInspector;
|
|
263
265
|
readonly meta?: Readonly<Record<string, unknown>>;
|
|
266
|
+
/**
|
|
267
|
+
* The task's owner waits for its result: the work was meant to finish and report back (a build,
|
|
268
|
+
* a test run). Absent or false: nothing waits on it (a dev server, a watcher). The kernel only
|
|
269
|
+
* carries this fact on the task's snapshot; what waiting means is the host's to decide.
|
|
270
|
+
*/
|
|
271
|
+
readonly awaitsResult?: boolean;
|
|
264
272
|
/** Scoped settlement hook for the task created by this adoption only. */
|
|
265
273
|
readonly onSettled?: (completion: BackgroundTaskCompletion) => void;
|
|
266
274
|
}
|
|
@@ -310,6 +318,8 @@ declare interface BackgroundTaskSnapshot {
|
|
|
310
318
|
readonly startedAtMs: number;
|
|
311
319
|
readonly updatedAtMs: number;
|
|
312
320
|
readonly meta?: Readonly<Record<string, unknown>>;
|
|
321
|
+
/** The owner waits for this task's result; see `BackgroundTaskAdoptOptions.awaitsResult`. */
|
|
322
|
+
readonly awaitsResult?: boolean;
|
|
313
323
|
}
|
|
314
324
|
|
|
315
325
|
declare type BackgroundTaskStatus = "queued" | "running" | "completed" | "failed" | "cancelled";
|
|
@@ -635,7 +645,7 @@ declare interface DecideChoiceQuestion<L extends string = string> {
|
|
|
635
645
|
/** What a question asks: text, or a JSON object the client sends as its JSON text. */
|
|
636
646
|
declare type DecideInstructions = string | object;
|
|
637
647
|
|
|
638
|
-
declare type DecideModelId = "jev" | "clef" | "clef-flash";
|
|
648
|
+
declare type DecideModelId = "jev" | "clef" | "clef-flash" | "gpt-6-luna";
|
|
639
649
|
|
|
640
650
|
declare type DecideQuestion = DecideBoolQuestion | DecideChoiceQuestion | DecideScoreQuestion;
|
|
641
651
|
|
|
@@ -643,10 +653,10 @@ declare type DecideQuestion = DecideBoolQuestion | DecideChoiceQuestion | Decide
|
|
|
643
653
|
declare type DecideQuestions = Readonly<Record<string, DecideQuestion>>;
|
|
644
654
|
|
|
645
655
|
declare interface DecideRequest<Q extends DecideQuestions = DecideQuestions> {
|
|
646
|
-
|
|
647
|
-
readonly model?: DecideModelId;
|
|
656
|
+
readonly model: DecideModelId;
|
|
648
657
|
readonly state: DecideState;
|
|
649
658
|
readonly questions: Q;
|
|
659
|
+
readonly image?: SystemOneImage;
|
|
650
660
|
}
|
|
651
661
|
|
|
652
662
|
declare interface DecideScoreAnswer {
|
|
@@ -1003,7 +1013,10 @@ declare interface ExtensionAuthContext {
|
|
|
1003
1013
|
|
|
1004
1014
|
/** Optional extension-facing APIs for background task orchestration. */
|
|
1005
1015
|
declare interface ExtensionBackgroundTasksApi {
|
|
1006
|
-
adopt(taskKind: BackgroundTaskKind, label: string, run: BackgroundTaskRun, options?: BackgroundTaskAdoptOptions
|
|
1016
|
+
adopt(taskKind: BackgroundTaskKind, label: string, run: BackgroundTaskRun, options?: BackgroundTaskAdoptOptions & {
|
|
1017
|
+
readonly awaitsResult?: false;
|
|
1018
|
+
}): string;
|
|
1019
|
+
adopt(taskKind: BackgroundTaskKind, label: string, run: BackgroundTaskRun, options: BackgroundTaskAdoptOptions): string | Promise<string>;
|
|
1007
1020
|
list(): readonly BackgroundTaskSnapshot[];
|
|
1008
1021
|
get(taskId: string): BackgroundTaskSnapshot | undefined;
|
|
1009
1022
|
}
|
|
@@ -1716,8 +1729,8 @@ declare type KayAgentActivate = (api: KayAgentPluginApi) => void;
|
|
|
1716
1729
|
*/
|
|
1717
1730
|
declare interface KayAgentEvents {
|
|
1718
1731
|
/**
|
|
1719
|
-
* Publish one event the plugin declares in its `kay.app` `eventDefinitions`, with
|
|
1720
|
-
*
|
|
1732
|
+
* Publish one event the plugin declares in its `kay.app` `eventDefinitions`, with its resource URI and optional
|
|
1733
|
+
* payload matching that definition's `payloadSchema` when declared.
|
|
1721
1734
|
*
|
|
1722
1735
|
* The host stamps the publisher (this plugin) and the session this activation belongs to; the
|
|
1723
1736
|
* plugin names neither. Fire-and-forget: it returns nothing and never throws. A publish the host
|
|
@@ -1725,7 +1738,7 @@ declare interface KayAgentEvents {
|
|
|
1725
1738
|
* is reported to the host's diagnostics and dropped, so the work that raised the event never
|
|
1726
1739
|
* fails because the event did not go out.
|
|
1727
1740
|
*/
|
|
1728
|
-
publish(localId: string,
|
|
1741
|
+
publish(localId: string, input: PluginEventPublishInput): void;
|
|
1729
1742
|
}
|
|
1730
1743
|
|
|
1731
1744
|
/** This plugin's folder in the session family's shared Whiteboard. */
|
|
@@ -3353,6 +3366,20 @@ declare interface PluginDelegatedServiceEntry {
|
|
|
3353
3366
|
/** One rule id from {@link PLUGIN_DISCLOSURE_RULES}. */
|
|
3354
3367
|
export declare type PluginDisclosureRule = (typeof PLUGIN_DISCLOSURE_RULES)[number];
|
|
3355
3368
|
|
|
3369
|
+
declare const PluginEventPublishInput: z.ZodObject<{
|
|
3370
|
+
uri: z.ZodString;
|
|
3371
|
+
related: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
3372
|
+
key: z.ZodOptional<z.ZodString>;
|
|
3373
|
+
occurredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
3374
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
3375
|
+
poller: z.ZodOptional<z.ZodString>;
|
|
3376
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
3377
|
+
}, z.core.$strict>>;
|
|
3378
|
+
payload: z.ZodOptional<z.ZodType<JsonValue_2, unknown, z.core.$ZodTypeInternals<JsonValue_2, unknown>>>;
|
|
3379
|
+
}, z.core.$strict>;
|
|
3380
|
+
|
|
3381
|
+
declare type PluginEventPublishInput = z.infer<typeof PluginEventPublishInput>;
|
|
3382
|
+
|
|
3356
3383
|
/**
|
|
3357
3384
|
* An external-CLI readiness scheme the plugin declares: a non-injectable marker for a
|
|
3358
3385
|
* host-probed local binary (e.g. `osascript`, `gh`). Connecting runs `binary probeArgs`
|
|
@@ -4485,7 +4512,7 @@ declare interface SystemOneClient {
|
|
|
4485
4512
|
decide<const Q extends DecideQuestions>(request: DecideRequest<Q>, options?: SystemOneCallOptions): Promise<Decision<Q>>;
|
|
4486
4513
|
extract<const F extends ExtractFields>(request: ExtractRequest<F>, options?: SystemOneCallOptions): Promise<Extraction<F>>;
|
|
4487
4514
|
/** Whether some provider in the current order can serve `(kind, model)`. Never rejects. */
|
|
4488
|
-
availability(kind: SystemOneKind, model
|
|
4515
|
+
availability(kind: SystemOneKind, model: SystemOneModelId): Promise<Availability>;
|
|
4489
4516
|
}
|
|
4490
4517
|
|
|
4491
4518
|
/**
|
|
@@ -4520,6 +4547,12 @@ declare type SystemOneFailureCause = {
|
|
|
4520
4547
|
readonly kind: "invalid-answer";
|
|
4521
4548
|
};
|
|
4522
4549
|
|
|
4550
|
+
/** One PNG attachment. `data` is padded base64, without a data-URL prefix. */
|
|
4551
|
+
declare interface SystemOneImage {
|
|
4552
|
+
readonly mimeType: "image/png";
|
|
4553
|
+
readonly data: string;
|
|
4554
|
+
}
|
|
4555
|
+
|
|
4523
4556
|
/**
|
|
4524
4557
|
* ---
|
|
4525
4558
|
* responsibility: The data shapes of the System One surface: models, the decide and extract
|
|
@@ -6683,6 +6716,14 @@ declare type TOmitDeferred<Type extends TSchema, Indexer extends TSchema> = (TDe
|
|
|
6683
6716
|
|
|
6684
6717
|
declare type TOmitInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>, InstantiatedIndexer extends TSchema = TInstantiateType<Context, State, Indexer>> = TOmitAction<InstantiatedType, InstantiatedIndexer>;
|
|
6685
6718
|
|
|
6719
|
+
/**
|
|
6720
|
+
* The closed vocabulary of tool call failure codes. The engine and the tools
|
|
6721
|
+
* mint only these; a returned failure with a code outside it is not a
|
|
6722
|
+
* classification (the engine records the rejection on an unexplained failure),
|
|
6723
|
+
* and a stored record with one reads as none.
|
|
6724
|
+
*/
|
|
6725
|
+
declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change"];
|
|
6726
|
+
|
|
6686
6727
|
/**
|
|
6687
6728
|
* ---
|
|
6688
6729
|
* responsibility: The declarative permission classification a tool carries on its definition
|
|
@@ -6712,6 +6753,56 @@ declare interface ToolAvailability {
|
|
|
6712
6753
|
description: string;
|
|
6713
6754
|
}
|
|
6714
6755
|
|
|
6756
|
+
/**
|
|
6757
|
+
* The lane's classification of why one tool invocation failed: a searchable
|
|
6758
|
+
* machine code and the cause the tool or engine classified at execution.
|
|
6759
|
+
*/
|
|
6760
|
+
declare interface ToolCallFailure extends ToolCallFailureCause {
|
|
6761
|
+
readonly code: ToolCallFailureCode;
|
|
6762
|
+
}
|
|
6763
|
+
|
|
6764
|
+
declare type ToolCallFailureCause = z.infer<typeof toolCallFailureCauseSchema>;
|
|
6765
|
+
|
|
6766
|
+
declare const toolCallFailureCauseSchema: z.ZodObject<{
|
|
6767
|
+
category: z.ZodEnum<{
|
|
6768
|
+
cancelled: "cancelled";
|
|
6769
|
+
timeout: "timeout";
|
|
6770
|
+
unknown: "unknown";
|
|
6771
|
+
provider: "provider";
|
|
6772
|
+
"invalid-input": "invalid-input";
|
|
6773
|
+
"not-connected": "not-connected";
|
|
6774
|
+
"unsupported-operation": "unsupported-operation";
|
|
6775
|
+
"not-found": "not-found";
|
|
6776
|
+
permission: "permission";
|
|
6777
|
+
unavailable: "unavailable";
|
|
6778
|
+
}>;
|
|
6779
|
+
retryable: z.ZodBoolean;
|
|
6780
|
+
action: z.ZodEnum<{
|
|
6781
|
+
unknown: "unknown";
|
|
6782
|
+
none: "none";
|
|
6783
|
+
retry: "retry";
|
|
6784
|
+
"correct-input": "correct-input";
|
|
6785
|
+
connect: "connect";
|
|
6786
|
+
}>;
|
|
6787
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
6788
|
+
moduleId: z.ZodOptional<z.ZodString>;
|
|
6789
|
+
toolOwnerId: z.ZodOptional<z.ZodString>;
|
|
6790
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
6791
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
6792
|
+
path: z.ZodOptional<z.ZodString>;
|
|
6793
|
+
validationField: z.ZodOptional<z.ZodString>;
|
|
6794
|
+
errorName: z.ZodOptional<z.ZodString>;
|
|
6795
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
6796
|
+
providerCode: z.ZodOptional<z.ZodString>;
|
|
6797
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
6798
|
+
editIndex: z.ZodOptional<z.ZodNumber>;
|
|
6799
|
+
occurrences: z.ZodOptional<z.ZodNumber>;
|
|
6800
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
6801
|
+
}, z.core.$strict>>;
|
|
6802
|
+
}, z.core.$strict>;
|
|
6803
|
+
|
|
6804
|
+
declare type ToolCallFailureCode = (typeof TOOL_CALL_FAILURE_CODES)[number];
|
|
6805
|
+
|
|
6715
6806
|
/**
|
|
6716
6807
|
* The neutral around-execution hook: return `next()`'s result (possibly transformed) to run the
|
|
6717
6808
|
* real tool, or return a result without calling `next()` to substitute one — the tool then never
|
package/dist/disclosure.js
CHANGED
|
@@ -763,20 +763,6 @@ function describe(init) {
|
|
|
763
763
|
return `System One ${init.kind} on ${init.model}${where} failed: ${init.cause.kind}${detail}.`;
|
|
764
764
|
}
|
|
765
765
|
|
|
766
|
-
// packages/system-one/dist/models.js
|
|
767
|
-
var DEFAULT_DECIDE_MODEL = "jev";
|
|
768
|
-
var SYSTEM_ONE_LIMITS = {
|
|
769
|
-
/** The serialized request body, in bytes. */
|
|
770
|
-
maxBodyBytes: 64 * 1024,
|
|
771
|
-
maxQuestions: 64,
|
|
772
|
-
maxFields: 32,
|
|
773
|
-
minChoiceOptions: 2,
|
|
774
|
-
maxChoiceOptions: 255,
|
|
775
|
-
minScoreLevels: 2,
|
|
776
|
-
maxScoreLevels: 10,
|
|
777
|
-
maxForecastHorizon: 64
|
|
778
|
-
};
|
|
779
|
-
|
|
780
766
|
// packages/system-one/dist/unavailable.js
|
|
781
767
|
var NOT_SERVED = {
|
|
782
768
|
available: false,
|
|
@@ -788,7 +774,7 @@ function createUnavailableSystemOneClient() {
|
|
|
788
774
|
decide(request) {
|
|
789
775
|
return Promise.reject(new SystemOneError({
|
|
790
776
|
kind: "decide",
|
|
791
|
-
model: request.model
|
|
777
|
+
model: request.model,
|
|
792
778
|
cause: { kind: "not-served" }
|
|
793
779
|
}));
|
|
794
780
|
},
|
|
@@ -803,6 +789,22 @@ function createUnavailableSystemOneClient() {
|
|
|
803
789
|
};
|
|
804
790
|
}
|
|
805
791
|
|
|
792
|
+
// packages/system-one/dist/models.js
|
|
793
|
+
var SYSTEM_ONE_LIMITS = {
|
|
794
|
+
/** The serialized state and questions, in bytes; images have a separate budget. */
|
|
795
|
+
maxBodyBytes: 64 * 1024,
|
|
796
|
+
maxImageBytes: 4 * 1024 * 1024,
|
|
797
|
+
maxImagePixels: 16e6,
|
|
798
|
+
maxImageBodyBytes: 6 * 1024 * 1024,
|
|
799
|
+
maxQuestions: 64,
|
|
800
|
+
maxFields: 32,
|
|
801
|
+
minChoiceOptions: 2,
|
|
802
|
+
maxChoiceOptions: 255,
|
|
803
|
+
minScoreLevels: 2,
|
|
804
|
+
maxScoreLevels: 10,
|
|
805
|
+
maxForecastHorizon: 64
|
|
806
|
+
};
|
|
807
|
+
|
|
806
808
|
// packages/plugin-sdk/dist/disclosure/probe-kay-agent-capabilities.js
|
|
807
809
|
var inertResult = () => new Promise(() => {
|
|
808
810
|
});
|
|
@@ -86,6 +86,8 @@ declare interface AgentToolResult<T = JsonValue_3 | undefined> {
|
|
|
86
86
|
* error, but `details` and `structuredContent` are kept for the UI and programmatic callers.
|
|
87
87
|
*/
|
|
88
88
|
isError?: boolean;
|
|
89
|
+
/** Classification for an `isError` result; the host validates it and stamps identity and attribution. */
|
|
90
|
+
failure?: ToolCallFailure;
|
|
89
91
|
/**
|
|
90
92
|
* Hint that the agent should stop after the current tool batch.
|
|
91
93
|
* Early termination only happens when every finalized tool result in the batch sets this to true.
|
|
@@ -215,6 +217,12 @@ declare interface BackgroundTaskAdoptOptions {
|
|
|
215
217
|
readonly ownerId?: string;
|
|
216
218
|
readonly inspect?: BackgroundTaskInspector;
|
|
217
219
|
readonly meta?: Readonly<Record<string, unknown>>;
|
|
220
|
+
/**
|
|
221
|
+
* The task's owner waits for its result: the work was meant to finish and report back (a build,
|
|
222
|
+
* a test run). Absent or false: nothing waits on it (a dev server, a watcher). The kernel only
|
|
223
|
+
* carries this fact on the task's snapshot; what waiting means is the host's to decide.
|
|
224
|
+
*/
|
|
225
|
+
readonly awaitsResult?: boolean;
|
|
218
226
|
/** Scoped settlement hook for the task created by this adoption only. */
|
|
219
227
|
readonly onSettled?: (completion: BackgroundTaskCompletion) => void;
|
|
220
228
|
}
|
|
@@ -264,6 +272,8 @@ declare interface BackgroundTaskSnapshot {
|
|
|
264
272
|
readonly startedAtMs: number;
|
|
265
273
|
readonly updatedAtMs: number;
|
|
266
274
|
readonly meta?: Readonly<Record<string, unknown>>;
|
|
275
|
+
/** The owner waits for this task's result; see `BackgroundTaskAdoptOptions.awaitsResult`. */
|
|
276
|
+
readonly awaitsResult?: boolean;
|
|
267
277
|
}
|
|
268
278
|
|
|
269
279
|
declare type BackgroundTaskStatus = "queued" | "running" | "completed" | "failed" | "cancelled";
|
|
@@ -546,7 +556,7 @@ declare interface DecideChoiceQuestion<L extends string = string> {
|
|
|
546
556
|
/** What a question asks: text, or a JSON object the client sends as its JSON text. */
|
|
547
557
|
declare type DecideInstructions = string | object;
|
|
548
558
|
|
|
549
|
-
declare type DecideModelId = "jev" | "clef" | "clef-flash";
|
|
559
|
+
declare type DecideModelId = "jev" | "clef" | "clef-flash" | "gpt-6-luna";
|
|
550
560
|
|
|
551
561
|
declare type DecideQuestion = DecideBoolQuestion | DecideChoiceQuestion | DecideScoreQuestion;
|
|
552
562
|
|
|
@@ -554,10 +564,10 @@ declare type DecideQuestion = DecideBoolQuestion | DecideChoiceQuestion | Decide
|
|
|
554
564
|
declare type DecideQuestions = Readonly<Record<string, DecideQuestion>>;
|
|
555
565
|
|
|
556
566
|
declare interface DecideRequest<Q extends DecideQuestions = DecideQuestions> {
|
|
557
|
-
|
|
558
|
-
readonly model?: DecideModelId;
|
|
567
|
+
readonly model: DecideModelId;
|
|
559
568
|
readonly state: DecideState;
|
|
560
569
|
readonly questions: Q;
|
|
570
|
+
readonly image?: SystemOneImage;
|
|
561
571
|
}
|
|
562
572
|
|
|
563
573
|
declare interface DecideScoreAnswer {
|
|
@@ -886,7 +896,10 @@ declare interface ExtensionAuthContext {
|
|
|
886
896
|
|
|
887
897
|
/** Optional extension-facing APIs for background task orchestration. */
|
|
888
898
|
declare interface ExtensionBackgroundTasksApi {
|
|
889
|
-
adopt(taskKind: BackgroundTaskKind, label: string, run: BackgroundTaskRun, options?: BackgroundTaskAdoptOptions
|
|
899
|
+
adopt(taskKind: BackgroundTaskKind, label: string, run: BackgroundTaskRun, options?: BackgroundTaskAdoptOptions & {
|
|
900
|
+
readonly awaitsResult?: false;
|
|
901
|
+
}): string;
|
|
902
|
+
adopt(taskKind: BackgroundTaskKind, label: string, run: BackgroundTaskRun, options: BackgroundTaskAdoptOptions): string | Promise<string>;
|
|
890
903
|
list(): readonly BackgroundTaskSnapshot[];
|
|
891
904
|
get(taskId: string): BackgroundTaskSnapshot | undefined;
|
|
892
905
|
}
|
|
@@ -1630,8 +1643,8 @@ declare type JsonValue_3 = null | boolean | number | string | JsonValue_3[] | {
|
|
|
1630
1643
|
*/
|
|
1631
1644
|
declare interface KayAgentEvents {
|
|
1632
1645
|
/**
|
|
1633
|
-
* Publish one event the plugin declares in its `kay.app` `eventDefinitions`, with
|
|
1634
|
-
*
|
|
1646
|
+
* Publish one event the plugin declares in its `kay.app` `eventDefinitions`, with its resource URI and optional
|
|
1647
|
+
* payload matching that definition's `payloadSchema` when declared.
|
|
1635
1648
|
*
|
|
1636
1649
|
* The host stamps the publisher (this plugin) and the session this activation belongs to; the
|
|
1637
1650
|
* plugin names neither. Fire-and-forget: it returns nothing and never throws. A publish the host
|
|
@@ -1639,7 +1652,7 @@ declare interface KayAgentEvents {
|
|
|
1639
1652
|
* is reported to the host's diagnostics and dropped, so the work that raised the event never
|
|
1640
1653
|
* fails because the event did not go out.
|
|
1641
1654
|
*/
|
|
1642
|
-
publish(localId: string,
|
|
1655
|
+
publish(localId: string, input: PluginEventPublishInput): void;
|
|
1643
1656
|
}
|
|
1644
1657
|
|
|
1645
1658
|
/** This plugin's folder in the session family's shared Whiteboard. */
|
|
@@ -3231,6 +3244,20 @@ declare interface PluginDelegatedServiceEntry {
|
|
|
3231
3244
|
readonly scheme: PluginDelegatedScheme;
|
|
3232
3245
|
}
|
|
3233
3246
|
|
|
3247
|
+
declare const PluginEventPublishInput: z.ZodObject<{
|
|
3248
|
+
uri: z.ZodString;
|
|
3249
|
+
related: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
|
|
3250
|
+
key: z.ZodOptional<z.ZodString>;
|
|
3251
|
+
occurredAt: z.ZodOptional<z.ZodISODateTime>;
|
|
3252
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
3253
|
+
poller: z.ZodOptional<z.ZodString>;
|
|
3254
|
+
runId: z.ZodOptional<z.ZodString>;
|
|
3255
|
+
}, z.core.$strict>>;
|
|
3256
|
+
payload: z.ZodOptional<z.ZodType<JsonValue_2, unknown, z.core.$ZodTypeInternals<JsonValue_2, unknown>>>;
|
|
3257
|
+
}, z.core.$strict>;
|
|
3258
|
+
|
|
3259
|
+
declare type PluginEventPublishInput = z.infer<typeof PluginEventPublishInput>;
|
|
3260
|
+
|
|
3234
3261
|
/**
|
|
3235
3262
|
* An external-CLI readiness scheme the plugin declares: a non-injectable marker for a
|
|
3236
3263
|
* host-probed local binary (e.g. `osascript`, `gh`). Connecting runs `binary probeArgs`
|
|
@@ -4396,7 +4423,7 @@ declare interface SystemOneClient {
|
|
|
4396
4423
|
decide<const Q extends DecideQuestions>(request: DecideRequest<Q>, options?: SystemOneCallOptions): Promise<Decision<Q>>;
|
|
4397
4424
|
extract<const F extends ExtractFields>(request: ExtractRequest<F>, options?: SystemOneCallOptions): Promise<Extraction<F>>;
|
|
4398
4425
|
/** Whether some provider in the current order can serve `(kind, model)`. Never rejects. */
|
|
4399
|
-
availability(kind: SystemOneKind, model
|
|
4426
|
+
availability(kind: SystemOneKind, model: SystemOneModelId): Promise<Availability>;
|
|
4400
4427
|
}
|
|
4401
4428
|
|
|
4402
4429
|
/**
|
|
@@ -4431,6 +4458,12 @@ declare type SystemOneFailureCause = {
|
|
|
4431
4458
|
readonly kind: "invalid-answer";
|
|
4432
4459
|
};
|
|
4433
4460
|
|
|
4461
|
+
/** One PNG attachment. `data` is padded base64, without a data-URL prefix. */
|
|
4462
|
+
declare interface SystemOneImage {
|
|
4463
|
+
readonly mimeType: "image/png";
|
|
4464
|
+
readonly data: string;
|
|
4465
|
+
}
|
|
4466
|
+
|
|
4434
4467
|
/**
|
|
4435
4468
|
* ---
|
|
4436
4469
|
* responsibility: The data shapes of the System One surface: models, the decide and extract
|
|
@@ -6606,6 +6639,14 @@ declare type TOmitDeferred<Type extends TSchema, Indexer extends TSchema> = (TDe
|
|
|
6606
6639
|
|
|
6607
6640
|
declare type TOmitInstantiate<Context extends TProperties, State extends TState, Type extends TSchema, Indexer extends TSchema, InstantiatedType extends TSchema = TInstantiateType<Context, State, Type>, InstantiatedIndexer extends TSchema = TInstantiateType<Context, State, Indexer>> = TOmitAction<InstantiatedType, InstantiatedIndexer>;
|
|
6608
6641
|
|
|
6642
|
+
/**
|
|
6643
|
+
* The closed vocabulary of tool call failure codes. The engine and the tools
|
|
6644
|
+
* mint only these; a returned failure with a code outside it is not a
|
|
6645
|
+
* classification (the engine records the rejection on an unexplained failure),
|
|
6646
|
+
* and a stored record with one reads as none.
|
|
6647
|
+
*/
|
|
6648
|
+
declare const TOOL_CALL_FAILURE_CODES: readonly ["tool.invalid_input", "tool.blocked", "tool.cancelled", "tool.timeout", "tool.not_found", "tool.unavailable", "tool.execution_failed", "provider.http", "provider.api", "provider.transport", "uri.not_found", "uri.unsupported_operation", "uri.not_connected", "uri.auth_unavailable", "permission.denied", "edit.empty_edits", "edit.text_not_found", "edit.text_not_unique", "edit.empty_old_text", "edit.overlapping_edits", "edit.no_change"];
|
|
6649
|
+
|
|
6609
6650
|
/**
|
|
6610
6651
|
* ---
|
|
6611
6652
|
* responsibility: The declarative permission classification a tool carries on its definition
|
|
@@ -6635,6 +6676,56 @@ declare interface ToolAvailability {
|
|
|
6635
6676
|
description: string;
|
|
6636
6677
|
}
|
|
6637
6678
|
|
|
6679
|
+
/**
|
|
6680
|
+
* The lane's classification of why one tool invocation failed: a searchable
|
|
6681
|
+
* machine code and the cause the tool or engine classified at execution.
|
|
6682
|
+
*/
|
|
6683
|
+
declare interface ToolCallFailure extends ToolCallFailureCause {
|
|
6684
|
+
readonly code: ToolCallFailureCode;
|
|
6685
|
+
}
|
|
6686
|
+
|
|
6687
|
+
declare type ToolCallFailureCause = z.infer<typeof toolCallFailureCauseSchema>;
|
|
6688
|
+
|
|
6689
|
+
declare const toolCallFailureCauseSchema: z.ZodObject<{
|
|
6690
|
+
category: z.ZodEnum<{
|
|
6691
|
+
cancelled: "cancelled";
|
|
6692
|
+
timeout: "timeout";
|
|
6693
|
+
unknown: "unknown";
|
|
6694
|
+
provider: "provider";
|
|
6695
|
+
"invalid-input": "invalid-input";
|
|
6696
|
+
"not-connected": "not-connected";
|
|
6697
|
+
"unsupported-operation": "unsupported-operation";
|
|
6698
|
+
"not-found": "not-found";
|
|
6699
|
+
permission: "permission";
|
|
6700
|
+
unavailable: "unavailable";
|
|
6701
|
+
}>;
|
|
6702
|
+
retryable: z.ZodBoolean;
|
|
6703
|
+
action: z.ZodEnum<{
|
|
6704
|
+
unknown: "unknown";
|
|
6705
|
+
none: "none";
|
|
6706
|
+
retry: "retry";
|
|
6707
|
+
"correct-input": "correct-input";
|
|
6708
|
+
connect: "connect";
|
|
6709
|
+
}>;
|
|
6710
|
+
details: z.ZodOptional<z.ZodObject<{
|
|
6711
|
+
moduleId: z.ZodOptional<z.ZodString>;
|
|
6712
|
+
toolOwnerId: z.ZodOptional<z.ZodString>;
|
|
6713
|
+
operation: z.ZodOptional<z.ZodString>;
|
|
6714
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
6715
|
+
path: z.ZodOptional<z.ZodString>;
|
|
6716
|
+
validationField: z.ZodOptional<z.ZodString>;
|
|
6717
|
+
errorName: z.ZodOptional<z.ZodString>;
|
|
6718
|
+
errorCode: z.ZodOptional<z.ZodString>;
|
|
6719
|
+
providerCode: z.ZodOptional<z.ZodString>;
|
|
6720
|
+
status: z.ZodOptional<z.ZodNumber>;
|
|
6721
|
+
editIndex: z.ZodOptional<z.ZodNumber>;
|
|
6722
|
+
occurrences: z.ZodOptional<z.ZodNumber>;
|
|
6723
|
+
retryAfterMs: z.ZodOptional<z.ZodNumber>;
|
|
6724
|
+
}, z.core.$strict>>;
|
|
6725
|
+
}, z.core.$strict>;
|
|
6726
|
+
|
|
6727
|
+
declare type ToolCallFailureCode = (typeof TOOL_CALL_FAILURE_CODES)[number];
|
|
6728
|
+
|
|
6638
6729
|
/**
|
|
6639
6730
|
* The neutral around-execution hook: return `next()`'s result (possibly transformed) to run the
|
|
6640
6731
|
* real tool, or return a result without calling `next()` to substitute one — the tool then never
|
|
@@ -56,20 +56,6 @@ function describe(init) {
|
|
|
56
56
|
return `System One ${init.kind} on ${init.model}${where} failed: ${init.cause.kind}${detail}.`;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
// packages/system-one/dist/models.js
|
|
60
|
-
var DEFAULT_DECIDE_MODEL = "jev";
|
|
61
|
-
var SYSTEM_ONE_LIMITS = {
|
|
62
|
-
/** The serialized request body, in bytes. */
|
|
63
|
-
maxBodyBytes: 64 * 1024,
|
|
64
|
-
maxQuestions: 64,
|
|
65
|
-
maxFields: 32,
|
|
66
|
-
minChoiceOptions: 2,
|
|
67
|
-
maxChoiceOptions: 255,
|
|
68
|
-
minScoreLevels: 2,
|
|
69
|
-
maxScoreLevels: 10,
|
|
70
|
-
maxForecastHorizon: 64
|
|
71
|
-
};
|
|
72
|
-
|
|
73
59
|
// packages/system-one/dist/unavailable.js
|
|
74
60
|
var NOT_SERVED = {
|
|
75
61
|
available: false,
|
|
@@ -81,7 +67,7 @@ function createUnavailableSystemOneClient() {
|
|
|
81
67
|
decide(request) {
|
|
82
68
|
return Promise.reject(new SystemOneError({
|
|
83
69
|
kind: "decide",
|
|
84
|
-
model: request.model
|
|
70
|
+
model: request.model,
|
|
85
71
|
cause: { kind: "not-served" }
|
|
86
72
|
}));
|
|
87
73
|
},
|
|
@@ -96,6 +82,22 @@ function createUnavailableSystemOneClient() {
|
|
|
96
82
|
};
|
|
97
83
|
}
|
|
98
84
|
|
|
85
|
+
// packages/system-one/dist/models.js
|
|
86
|
+
var SYSTEM_ONE_LIMITS = {
|
|
87
|
+
/** The serialized state and questions, in bytes; images have a separate budget. */
|
|
88
|
+
maxBodyBytes: 64 * 1024,
|
|
89
|
+
maxImageBytes: 4 * 1024 * 1024,
|
|
90
|
+
maxImagePixels: 16e6,
|
|
91
|
+
maxImageBodyBytes: 6 * 1024 * 1024,
|
|
92
|
+
maxQuestions: 64,
|
|
93
|
+
maxFields: 32,
|
|
94
|
+
minChoiceOptions: 2,
|
|
95
|
+
maxChoiceOptions: 255,
|
|
96
|
+
minScoreLevels: 2,
|
|
97
|
+
maxScoreLevels: 10,
|
|
98
|
+
maxForecastHorizon: 64
|
|
99
|
+
};
|
|
100
|
+
|
|
99
101
|
// packages/plugin-primitives/dist/is-object.js
|
|
100
102
|
function isObject(value) {
|
|
101
103
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|