@yolk-sdk/agent 0.1.0-canary.119 → 0.1.0-canary.120
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 +4 -1
- package/dist/client/state.d.mts +45 -45
- package/dist/client/state.d.mts.map +1 -1
- package/dist/protocol/index.d.mts +2 -2
- package/dist/protocol/index.d.mts.map +1 -1
- package/dist/protocol/index.mjs +2 -2
- package/dist/protocol/tool-argument-hints.mjs +3 -3
- package/dist/protocol/tool-argument-hints.mjs.map +1 -1
- package/dist/protocol/tool-json-schema-marker.d.mts +20 -0
- package/dist/protocol/tool-json-schema-marker.d.mts.map +1 -0
- package/dist/protocol/tool-json-schema-marker.mjs +57 -0
- package/dist/protocol/tool-json-schema-marker.mjs.map +1 -0
- package/dist/protocol/tool.d.mts +11 -1
- package/dist/protocol/tool.d.mts.map +1 -1
- package/dist/protocol/tool.mjs +11 -1
- package/dist/protocol/tool.mjs.map +1 -1
- package/dist/providers/anthropic-provider-internal.d.mts.map +1 -1
- package/dist/providers/anthropic-provider-internal.mjs +85 -20
- package/dist/providers/anthropic-provider-internal.mjs.map +1 -1
- package/dist/providers/openai/provider.d.mts.map +1 -1
- package/dist/providers/openai/provider.mjs +2 -1
- package/dist/providers/openai/provider.mjs.map +1 -1
- package/dist/providers/openai/realtime/session-config.d.mts +3 -0
- package/dist/providers/openai/realtime/session-config.d.mts.map +1 -1
- package/dist/providers/openai/realtime/session-config.mjs +6 -1
- package/dist/providers/openai/realtime/session-config.mjs.map +1 -1
- package/dist/providers/openai-responses-provider-internal.d.mts.map +1 -1
- package/dist/providers/openai-responses-provider-internal.mjs +2 -1
- package/dist/providers/openai-responses-provider-internal.mjs.map +1 -1
- package/dist/react/chat-items.d.mts +57 -57
- package/dist/react/chat-items.d.mts.map +1 -1
- package/dist/react/chat-messages.d.mts +87 -87
- package/dist/react/chat-messages.d.mts.map +1 -1
- package/dist/skillset/merge.d.mts +1 -1
- package/dist/tools/arguments.mjs +2 -2
- package/dist/tools/arguments.mjs.map +1 -1
- package/dist/tools/input.d.mts.map +1 -1
- package/dist/tools/input.mjs +2 -2
- package/dist/tools/input.mjs.map +1 -1
- package/dist/tools/interaction.d.mts.map +1 -1
- package/dist/tools/interaction.mjs +2 -2
- package/dist/tools/interaction.mjs.map +1 -1
- package/dist/tools/omitted-null.d.mts +16 -0
- package/dist/tools/omitted-null.d.mts.map +1 -0
- package/dist/tools/omitted-null.mjs +105 -0
- package/dist/tools/omitted-null.mjs.map +1 -0
- package/dist/tools/plan-review.d.mts.map +1 -1
- package/dist/tools/plan-review.mjs +2 -2
- package/dist/tools/plan-review.mjs.map +1 -1
- package/dist/tools/registry.d.mts +17 -3
- package/dist/tools/registry.d.mts.map +1 -1
- package/dist/tools/registry.mjs +29 -10
- package/dist/tools/registry.mjs.map +1 -1
- package/package.json +2 -2
- package/src/protocol/index.ts +1 -0
- package/src/protocol/tool-json-schema-marker.ts +99 -0
- package/src/protocol/tool.ts +11 -0
- package/src/providers/anthropic-provider-internal.ts +215 -24
- package/src/providers/openai/provider.ts +2 -1
- package/src/providers/openai/realtime/session-config.ts +8 -1
- package/src/providers/openai-responses-provider-internal.ts +2 -1
- package/src/tools/input.ts +2 -1
- package/src/tools/interaction.ts +2 -1
- package/src/tools/omitted-null.ts +201 -0
- package/src/tools/plan-review.ts +2 -1
- package/src/tools/registry.ts +56 -10
package/README.md
CHANGED
|
@@ -370,7 +370,10 @@ add `u` to keep model-visible `pattern` hints.
|
|
|
370
370
|
|
|
371
371
|
Tool arguments are accepted exactly as advertised: unambiguous `null`s are normalized, and keys
|
|
372
372
|
that would be silently lost are rejected. `ToolDef.parameters` describes the schema's canonical JSON codec, so `Schema.optional(X)` is
|
|
373
|
-
advertised as `X | null
|
|
373
|
+
advertised as `X | null`; that codec-added `null` member carries
|
|
374
|
+
`$comment: toolJsonSchemaOmittedNullComment` (stable value), which Claude compatibility uses to
|
|
375
|
+
advertise such fields as `X` while unmarked (meaningful) nulls stay as they are; other provider
|
|
376
|
+
adapters remove the marker before sending. `makeTool` (validate and execute), `makeInputTool`/`makeInteractionTool`
|
|
374
377
|
call params, and the loop `question` decode model arguments with `Schema.toCodecJson(parameters)`:
|
|
375
378
|
`null` on `Schema.optional(X)` decodes as absent and `withDecodingDefault` still applies,
|
|
376
379
|
`Schema.optional(Schema.NullOr(X))` keeps `null`, and required non-nullable fields still reject it.
|
package/dist/client/state.d.mts
CHANGED
|
@@ -121,20 +121,6 @@ declare const AgentToolRun: {
|
|
|
121
121
|
readonly response: InteractionResponse;
|
|
122
122
|
readonly request?: InteractionRequest;
|
|
123
123
|
}, "_tag">;
|
|
124
|
-
readonly Completed: Data.TaggedEnum.ConstructorFrom<{
|
|
125
|
-
readonly _tag: "Completed";
|
|
126
|
-
readonly call: ToolCall;
|
|
127
|
-
readonly result: ToolResult;
|
|
128
|
-
readonly startedAtMs: number;
|
|
129
|
-
readonly endedAtMs: number;
|
|
130
|
-
}, "_tag">;
|
|
131
|
-
readonly Accepted: Data.TaggedEnum.ConstructorFrom<{
|
|
132
|
-
readonly _tag: "Accepted";
|
|
133
|
-
readonly call: ToolCall;
|
|
134
|
-
readonly result: ToolResult;
|
|
135
|
-
readonly startedAtMs: number;
|
|
136
|
-
readonly endedAtMs: number;
|
|
137
|
-
}, "_tag">;
|
|
138
124
|
readonly InputStreaming: Data.TaggedEnum.ConstructorFrom<{
|
|
139
125
|
readonly _tag: "InputStreaming";
|
|
140
126
|
readonly id: string;
|
|
@@ -151,6 +137,20 @@ declare const AgentToolRun: {
|
|
|
151
137
|
readonly toolCallId: string;
|
|
152
138
|
readonly reason: string;
|
|
153
139
|
}, "_tag">;
|
|
140
|
+
readonly Accepted: Data.TaggedEnum.ConstructorFrom<{
|
|
141
|
+
readonly _tag: "Accepted";
|
|
142
|
+
readonly call: ToolCall;
|
|
143
|
+
readonly result: ToolResult;
|
|
144
|
+
readonly startedAtMs: number;
|
|
145
|
+
readonly endedAtMs: number;
|
|
146
|
+
}, "_tag">;
|
|
147
|
+
readonly Completed: Data.TaggedEnum.ConstructorFrom<{
|
|
148
|
+
readonly _tag: "Completed";
|
|
149
|
+
readonly call: ToolCall;
|
|
150
|
+
readonly result: ToolResult;
|
|
151
|
+
readonly startedAtMs: number;
|
|
152
|
+
readonly endedAtMs: number;
|
|
153
|
+
}, "_tag">;
|
|
154
154
|
readonly Errored: Data.TaggedEnum.ConstructorFrom<{
|
|
155
155
|
readonly _tag: "Errored";
|
|
156
156
|
readonly call: ToolCall;
|
|
@@ -172,7 +172,7 @@ declare const AgentToolRun: {
|
|
|
172
172
|
readonly startedAtMs: number; /** Preserve witnessed interaction acceptance across transport interruptions. */
|
|
173
173
|
readonly interaction?: true;
|
|
174
174
|
}, "_tag">;
|
|
175
|
-
readonly $is: <Tag extends "QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "
|
|
175
|
+
readonly $is: <Tag extends "QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "InputStreaming" | "ApprovalRequested" | "Denied" | "Accepted" | "Completed" | "Errored" | "ProviderCompleted" | "InputReady" | "Executing">(tag: Tag) => (u: unknown) => u is Extract<{
|
|
176
176
|
readonly _tag: "InputStreaming";
|
|
177
177
|
readonly id: string;
|
|
178
178
|
readonly name?: string;
|
|
@@ -328,20 +328,6 @@ declare const AgentToolRun: {
|
|
|
328
328
|
readonly response: InteractionResponse;
|
|
329
329
|
readonly request?: InteractionRequest;
|
|
330
330
|
}) => any;
|
|
331
|
-
readonly Completed: (args: {
|
|
332
|
-
readonly _tag: "Completed";
|
|
333
|
-
readonly call: ToolCall;
|
|
334
|
-
readonly result: ToolResult;
|
|
335
|
-
readonly startedAtMs: number;
|
|
336
|
-
readonly endedAtMs: number;
|
|
337
|
-
}) => any;
|
|
338
|
-
readonly Accepted: (args: {
|
|
339
|
-
readonly _tag: "Accepted";
|
|
340
|
-
readonly call: ToolCall;
|
|
341
|
-
readonly result: ToolResult;
|
|
342
|
-
readonly startedAtMs: number;
|
|
343
|
-
readonly endedAtMs: number;
|
|
344
|
-
}) => any;
|
|
345
331
|
readonly InputStreaming: (args: {
|
|
346
332
|
readonly _tag: "InputStreaming";
|
|
347
333
|
readonly id: string;
|
|
@@ -358,6 +344,20 @@ declare const AgentToolRun: {
|
|
|
358
344
|
readonly toolCallId: string;
|
|
359
345
|
readonly reason: string;
|
|
360
346
|
}) => any;
|
|
347
|
+
readonly Accepted: (args: {
|
|
348
|
+
readonly _tag: "Accepted";
|
|
349
|
+
readonly call: ToolCall;
|
|
350
|
+
readonly result: ToolResult;
|
|
351
|
+
readonly startedAtMs: number;
|
|
352
|
+
readonly endedAtMs: number;
|
|
353
|
+
}) => any;
|
|
354
|
+
readonly Completed: (args: {
|
|
355
|
+
readonly _tag: "Completed";
|
|
356
|
+
readonly call: ToolCall;
|
|
357
|
+
readonly result: ToolResult;
|
|
358
|
+
readonly startedAtMs: number;
|
|
359
|
+
readonly endedAtMs: number;
|
|
360
|
+
}) => any;
|
|
361
361
|
readonly Errored: (args: {
|
|
362
362
|
readonly _tag: "Errored";
|
|
363
363
|
readonly call: ToolCall;
|
|
@@ -379,7 +379,7 @@ declare const AgentToolRun: {
|
|
|
379
379
|
readonly startedAtMs: number; /** Preserve witnessed interaction acceptance across transport interruptions. */
|
|
380
380
|
readonly interaction?: true;
|
|
381
381
|
}) => any;
|
|
382
|
-
}>(cases: Cases): (value: AgentToolRun) => import("effect/Unify").Unify<ReturnType<Cases["QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "
|
|
382
|
+
}>(cases: Cases): (value: AgentToolRun) => import("effect/Unify").Unify<ReturnType<Cases["QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "InputStreaming" | "ApprovalRequested" | "Denied" | "Accepted" | "Completed" | "Errored" | "ProviderCompleted" | "InputReady" | "Executing"]>>;
|
|
383
383
|
<Cases extends {
|
|
384
384
|
readonly QuestionRequested: (args: {
|
|
385
385
|
readonly _tag: "QuestionRequested";
|
|
@@ -423,20 +423,6 @@ declare const AgentToolRun: {
|
|
|
423
423
|
readonly response: InteractionResponse;
|
|
424
424
|
readonly request?: InteractionRequest;
|
|
425
425
|
}) => any;
|
|
426
|
-
readonly Completed: (args: {
|
|
427
|
-
readonly _tag: "Completed";
|
|
428
|
-
readonly call: ToolCall;
|
|
429
|
-
readonly result: ToolResult;
|
|
430
|
-
readonly startedAtMs: number;
|
|
431
|
-
readonly endedAtMs: number;
|
|
432
|
-
}) => any;
|
|
433
|
-
readonly Accepted: (args: {
|
|
434
|
-
readonly _tag: "Accepted";
|
|
435
|
-
readonly call: ToolCall;
|
|
436
|
-
readonly result: ToolResult;
|
|
437
|
-
readonly startedAtMs: number;
|
|
438
|
-
readonly endedAtMs: number;
|
|
439
|
-
}) => any;
|
|
440
426
|
readonly InputStreaming: (args: {
|
|
441
427
|
readonly _tag: "InputStreaming";
|
|
442
428
|
readonly id: string;
|
|
@@ -453,6 +439,20 @@ declare const AgentToolRun: {
|
|
|
453
439
|
readonly toolCallId: string;
|
|
454
440
|
readonly reason: string;
|
|
455
441
|
}) => any;
|
|
442
|
+
readonly Accepted: (args: {
|
|
443
|
+
readonly _tag: "Accepted";
|
|
444
|
+
readonly call: ToolCall;
|
|
445
|
+
readonly result: ToolResult;
|
|
446
|
+
readonly startedAtMs: number;
|
|
447
|
+
readonly endedAtMs: number;
|
|
448
|
+
}) => any;
|
|
449
|
+
readonly Completed: (args: {
|
|
450
|
+
readonly _tag: "Completed";
|
|
451
|
+
readonly call: ToolCall;
|
|
452
|
+
readonly result: ToolResult;
|
|
453
|
+
readonly startedAtMs: number;
|
|
454
|
+
readonly endedAtMs: number;
|
|
455
|
+
}) => any;
|
|
456
456
|
readonly Errored: (args: {
|
|
457
457
|
readonly _tag: "Errored";
|
|
458
458
|
readonly call: ToolCall;
|
|
@@ -474,7 +474,7 @@ declare const AgentToolRun: {
|
|
|
474
474
|
readonly startedAtMs: number; /** Preserve witnessed interaction acceptance across transport interruptions. */
|
|
475
475
|
readonly interaction?: true;
|
|
476
476
|
}) => any;
|
|
477
|
-
}>(value: AgentToolRun, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "
|
|
477
|
+
}>(value: AgentToolRun, cases: Cases): import("effect/Unify").Unify<ReturnType<Cases["QuestionRequested" | "QuestionAnswered" | "QuestionCancelled" | "InputRequested" | "InputSubmitted" | "InputCancelled" | "InteractionRequested" | "InteractionSubmitted" | "InteractionCancelled" | "InputStreaming" | "ApprovalRequested" | "Denied" | "Accepted" | "Completed" | "Errored" | "ProviderCompleted" | "InputReady" | "Executing"]>>;
|
|
478
478
|
};
|
|
479
479
|
};
|
|
480
480
|
type AgentClientState = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.mts","names":[],"sources":["../../src/client/state.ts"],"mappings":";;;;KA0BY,YAAA;EAAA,SAEG,IAAA;EAAA,SACA,EAAA;EAAA,SACA,IAAA;EAAA,SACA,KAAA;AAAA;EAAA,SAEA,IAAA;EAAA,SAA6B,IAAA,EAAM,QAAA;AAAA;EAAA,SAEnC,IAAA;EAAA,SACA,IAAA,EAAM,QAAA;EAAA,SACN,OAAA,GAAU,mBAAA;AAAA;EAAA,SAEV,IAAA;EAAA,SAAyB,UAAA;EAAA,SAA6B,MAAA;AAAA;EAAA,SACtD,IAAA;EAAA,SAAoC,OAAA,EAAS,eAAA;AAAA;EAAA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QAAA;EAAA,mBACI,mBAAA;AAAA;EAAA;oBAGmC,eAAA;AAAA;EAAA;oBAWH,YAAA;AAAA;EAAA;oBAWM,kBAAA;AAAA;EAAA;qBAGtC,mBAAA;EAAA,mBACA,kBAAA;AAAA;EAAA;iBASJ,QAAA;EAAA,8BAb0C;EAAA;;cAgJlD,iBAAA,GAAqB,IAAA,EAAM,aAAA,CAAc,YAAA;EAAA;iBA5HjC,QAAA;EAAA,iBACE,UAAA;EAAA;;;cAwIV,wBAAA,GACX,QAAA,EAAU,aAAA,CAAc,WAAA,MACvB,aAAA,CAAc,YAAA;AAAA,cAwNJ,kBAAA,GACX,QAAA,EAAU,aAAA,CAAc,YAAA,GACxB,OAAA,EAAS,YAAA,KACR,eAAA;AAAA,cAUU,eAAA,GAAmB,KAAA,EAAO,gBAAA,EAAkB,KAAA,EAAO,UAAA,KAAa,gBAAA;AAAA,cAMhE,0BAAA,GACX,KAAA,EAAO,gBAAA,EACP,KAAA,EAAO,UAAA,EACP,OAAA,GAAS,sBAAA,KACR,gBAAA;AAAA,cAmSU,sBAAA,GACX,KAAA,EAAO,gBAAA,EACP,OAAA,EAAS,WAAA,KACR,gBAAA;;cAeU,cAAA,GACX,KAAA,EAAO,gBAAA,EACP,OAAA,WACA,KAAA,GAAQ,UAAA,KACP,gBAAA;;cAUU,gBAAA,GAAoB,KAAA,EAAO,gBAAA,KAAmB,gBAIxD;AAAA,cAEU,iBAAA,GACX,MAAA,EAAQ,aAAA,CAAc,UAAA,GACtB,YAAA,GAAc,gBAAA,EACd,OAAA,GAAS,sBAAA,KAA2B,gBAAA"}
|
|
@@ -4,7 +4,7 @@ import { AttachmentContentPart, AttachmentSource, AttachmentSourceResolver, Audi
|
|
|
4
4
|
import { FileDescriptor, FileId, fileIdPattern, fileLabel, fileNotCapturedLabel, formatFileSize, isFileId, normalizeFileMimeType } from "./file.mjs";
|
|
5
5
|
import { AgentInputUsage, AgentOutputUsage, AgentUsage, addAgentUsage, zeroAgentUsage } from "./usage.mjs";
|
|
6
6
|
import { BoundedNestedToolCallArgs, NestedToolCallAccess, NestedToolCallCounts, NestedToolCallInput, NestedToolCallRecord, NestedToolCallRecorder, NestedToolCallResultFields, NestedToolCallStatus, NestedToolCalls, boundNestedToolCallArgs, emptyNestedToolCallRecorder, makeNestedToolCallRecorder, nestedToolCallMaxArgsBytes, nestedToolCallMaxCalls, nestedToolCallMaxErrorChars, nestedToolCallMaxRecordedCalls, nestedToolCallMaxTotalArgsBytes, nestedToolCallRecordLimit, nestedToolCallResultFields, recordNestedToolCall } from "./nested-tool-calls.mjs";
|
|
7
|
-
import { BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, ErrorToolResultInput, HitlRequest, HitlResponse, HitlResponseSource, InputContentFormatter, InputDescriptor, InputRequest, InputResponse, InputResponseOutcome, InputResponseStructuredContent, InputResponseValidator, InputToolHandler, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCallValidator, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHost, InteractionHostError, InteractionOutcome, InteractionPreflight, InteractionReceipt, InteractionReceiptStatus, InteractionRef, InteractionRequest, InteractionResponse, InteractionResponseOutcome, InteractionResponseStructuredContent, InteractionResponseValidator, InteractionValidationError, PlainHitlResponse, PlainInputResponse, PlainInteractionResponse, PlainQuestionAnswer, PlainQuestionResponse, PlainToolApprovalResponse, QuestionAnswer, QuestionOption, QuestionPrompt, QuestionRequest, QuestionResponse, QuestionResponseOutcome, QuestionResponseStructuredContent, QuestionToolParams, ToolApprovalDecision, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalResponse, ToolCall, ToolCallableBy, ToolDef, ToolDiscovery, ToolExposure, ToolJsonSchema, ToolJsonSchemaObject, ToolLoading, ToolResult, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isCodeModeCallable, isCodeModeFailClosed, isDeferredTool, isProviderToolDef, isToolJsonSchemaObject, isToolStageable, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, providerToolDefs, questionResponseStructuredContent, sameInteractionBinding, sameInteractionCall, toolDiscovery, validInteractionReceipt, validateInteractionSubmission } from "./tool.mjs";
|
|
7
|
+
import { BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, ErrorToolResultInput, HitlRequest, HitlResponse, HitlResponseSource, InputContentFormatter, InputDescriptor, InputRequest, InputResponse, InputResponseOutcome, InputResponseStructuredContent, InputResponseValidator, InputToolHandler, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCallValidator, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHost, InteractionHostError, InteractionOutcome, InteractionPreflight, InteractionReceipt, InteractionReceiptStatus, InteractionRef, InteractionRequest, InteractionResponse, InteractionResponseOutcome, InteractionResponseStructuredContent, InteractionResponseValidator, InteractionValidationError, PlainHitlResponse, PlainInputResponse, PlainInteractionResponse, PlainQuestionAnswer, PlainQuestionResponse, PlainToolApprovalResponse, QuestionAnswer, QuestionOption, QuestionPrompt, QuestionRequest, QuestionResponse, QuestionResponseOutcome, QuestionResponseStructuredContent, QuestionToolParams, ToolApprovalDecision, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalResponse, ToolCall, ToolCallableBy, ToolDef, ToolDiscovery, ToolExposure, ToolJsonSchema, ToolJsonSchemaObject, ToolLoading, ToolResult, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isCodeModeCallable, isCodeModeFailClosed, isDeferredTool, isProviderToolDef, isToolJsonSchemaObject, isToolStageable, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, providerToolDefs, questionResponseStructuredContent, sameInteractionBinding, sameInteractionCall, toolDiscovery, toolJsonSchemaOmittedNullComment, validInteractionReceipt, validateInteractionSubmission } from "./tool.mjs";
|
|
8
8
|
import { ToolApprovalPreviewer, ToolChangeCut, ToolChangeItem, ToolChangePreview, ToolChangePreviewError, ToolChangePreviewErrorCause, ToolChangePreviewFailure, ToolChangeScalar, ToolChangeSetCuts, ToolChangeSideCuts, ToolChangeTarget, ToolFieldChange, ToolListChange, ToolSetChange, ToolStructuredChange, ToolTextChange, ToolValueChange } from "./change-preview.mjs";
|
|
9
9
|
import { AgentMessage, AssistantAgentMessage, AssistantPart, AssistantReasoningPart, AssistantReasoningReplay, AssistantTextPart, DanglingHostToolCall, HostToolCallPart, MessageAnnotations, MessageAuthor, MessageEnvelope, MessageInstruction, ProviderToolCallPart, ProviderToolResultPart, RedactedReasoningReplay, RepairDanglingHostToolCallsOptions, SignedReasoningReplay, ToolResultMessage, TranscriptInvariantValidation, UserMessage, assistantContent, assistantHostToolCalls, assistantReasoningText, danglingHostToolCalls, isInstructionMessage, latestInstructionMessages, latestInstructionState, messageContextText, prependMessageContextToContent, repairDanglingHostToolCalls, resolveMessageAttachmentSources, resolveMessagesAttachmentSources, toolResultMessageFromResult, validateNoDanglingHostToolCalls } from "./message.mjs";
|
|
10
10
|
import { AgentAbortReason, AgentAwaitingInput, AgentEnd, AgentError, AgentErrorCode, AgentEvent, AgentRetry, AgentStart, AssistantMessageEvent, CompactionEnd, CompactionStart, InputCancelled, InputRequested, InputSubmitted, InteractionCancelled, InteractionRequested, InteractionSubmitted, LLMReasoningDelta, LLMReasoningReplay, LLMStreamEnd, LLMStreamStart, LLMTextDelta, ProviderErrorInfo, ProviderFailureKind, ProviderStreamDiagnostics, ProviderStreamProtocol, ProviderStreamResponseFormat, ProviderToolResult, QuestionAnswered, QuestionCancelled, QuestionRequested, SubagentCompleted, SubagentStarted, SubagentStatus, TerminalAgentEvent, ToolApprovalDenied, ToolApprovalGranted, ToolApprovalRequested, ToolExecutionAccepted, ToolExecutionCompleted, ToolExecutionError, ToolExecutionStarted, ToolInputDelta, ToolInputEnd, ToolInputStart, TurnEnd, TurnStart, UsageUpdate, UserMessageEvent, hitlResponseEvent, isSubagentAcceptedToolResult, isSubagentObservationToolResult, isTerminalAgentEvent, makeSubagentRunId } from "./event.mjs";
|
|
@@ -16,5 +16,5 @@ import { ToolSearchActivation, activatedToolNames, declaredToolDefs, toolSearchT
|
|
|
16
16
|
//#region src/protocol/index.d.ts
|
|
17
17
|
type MessageId = string;
|
|
18
18
|
//#endregion
|
|
19
|
-
export { AgentAbortReason, AgentActivity, AgentAwaitingInput, AgentBlocked, AgentBlockedKind, AgentBusy, AgentCompacting, AgentContentCapabilities, AgentDone, AgentEnd, AgentError, AgentErrorCode, AgentEvent, AgentFailed, AgentGenerating, AgentIdle, AgentInputUsage, AgentMessage, AgentModelCapabilities, AgentOutputUsage, AgentReasoningEffort, AgentRetry, AgentRetrying, AgentRunningTools, AgentStart, AgentStatus, AgentStatusTree, AgentToolActivityCall, AgentUsage, AgentWebSocketClientMessage, AgentWebSocketServerMessage, AgentWorking, AssistantAgentMessage, AssistantMessageEvent, AssistantPart, AssistantReasoningPart, AssistantReasoningReplay, AssistantTextPart, type AttachmentContentPart, AttachmentSource, type AttachmentSourceResolver, AudioPart, BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, type BoundedNestedToolCallArgs, CompactionEnd, CompactionStart, Content, ContentPart, type DanglingHostToolCall, DocumentPart, type ErrorToolResultInput, FileDescriptor, FileId, FilePart, HitlRequest, HitlResponse, HitlResponseSource, HostToolCallPart, ImagePart, InlineBase64AttachmentSource, InputCancelled, type InputContentFormatter, InputDescriptor, InputRequest, InputRequested, InputResponse, InputResponseInput, InputResponseOutcome, type InputResponseStructuredContent, type InputResponseValidator, InputSubmitted, type InputToolHandler, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, type InteractionCallValidator, InteractionCancelled, InteractionCandidate, InteractionClaim, InteractionDescriptor, type InteractionHost, InteractionHostError, type InteractionOutcome, type InteractionPreflight, InteractionReceipt, InteractionReceiptStatus, type InteractionRef, InteractionRequest, InteractionRequested, InteractionResponse, InteractionResponseInput, InteractionResponseOutcome, type InteractionResponseStructuredContent, type InteractionResponseValidator, InteractionSubmitted, InteractionValidationError, LLMReasoningDelta, LLMReasoningReplay, LLMStreamEnd, LLMStreamStart, LLMTextDelta, MessageAnnotations, MessageAuthor, type MessageEnvelope, MessageId, MessageInstruction, NestedToolCallAccess, NestedToolCallCounts, type NestedToolCallInput, NestedToolCallRecord, type NestedToolCallRecorder, type NestedToolCallResultFields, NestedToolCallStatus, NestedToolCalls, PlainHitlResponse, type PlainInputResponse, type PlainInteractionResponse, type PlainQuestionAnswer, type PlainQuestionResponse, type PlainToolApprovalResponse, ProviderErrorInfo, ProviderFailureKind, ProviderStreamDiagnostics, ProviderStreamProtocol, ProviderStreamResponseFormat, ProviderToolCallPart, ProviderToolResult, ProviderToolResultPart, QuestionAnswer, QuestionAnswered, QuestionCancelled, QuestionOption, QuestionPrompt, QuestionRequest, QuestionRequested, QuestionResponse, QuestionResponseInput, QuestionResponseOutcome, type QuestionResponseStructuredContent, QuestionToolParams, RedactedReasoningReplay, RefAttachmentSource, type RepairDanglingHostToolCallsOptions, SessionSnapshot, SignedReasoningReplay, SubagentCompleted, SubagentStarted, SubagentStatus, SubagentStatusEntry, type TerminalAgentEvent, TextPart, ToolApprovalDecision, ToolApprovalDenied, ToolApprovalGranted, ToolApprovalMode, ToolApprovalPolicy, type ToolApprovalPreviewer, ToolApprovalRequest, ToolApprovalRequested, ToolApprovalResponse, ToolApprovalResponseInput, ToolCall, ToolCallableBy, ToolChangeCut, ToolChangeItem, ToolChangePreview, ToolChangePreviewError, ToolChangePreviewErrorCause, ToolChangePreviewFailure, ToolChangeScalar, ToolChangeSetCuts, ToolChangeSideCuts, ToolChangeTarget, ToolDef, ToolDiscovery, ToolExecutionAccepted, ToolExecutionCompleted, ToolExecutionError, ToolExecutionStarted, type ToolExposure, ToolFieldChange, ToolInputDelta, ToolInputEnd, ToolInputStart, ToolJsonSchema, ToolJsonSchemaObject, ToolListChange, ToolLoading, ToolResult, ToolResultMessage, ToolSearchActivation, ToolSetChange, ToolStructuredChange, ToolTextChange, ToolValueChange, type TranscriptInvariantValidation, TurnEnd, TurnStart, UrlAttachmentSource, UsageUpdate, UserInput, UserMessage, UserMessageEvent, activatedToolNames, addAgentUsage, agentBlockedKind, agentStatusFromEvents, agentStatusRetry, agentStatusTreeFromEvents, appendTextToContent, assistantContent, assistantHostToolCalls, assistantReasoningText, attachmentSourceBase64, attachmentSourceDataUrl, attachmentSourcePreview, attachmentSourceText, attachmentSourceUrl, base64ToBytes, boundNestedToolCallArgs, bytesToBase64, contentPartPreview, contentPartText, contentParts, contentPreview, contentText, danglingHostToolCalls, declaredToolDefs, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, documentPartFromText, emptyNestedToolCallRecorder, fileIdPattern, fileLabel, fileNotCapturedLabel, filePartFromBytes, filePartText, formatFileSize, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, hitlRequestBlockedKind, hitlResponseEvent, idleAgentStatus, inferTextDocumentMimeType, initialAgentStatusTree, inlineBase64AttachmentSource, inlineBase64Source, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isAgentStatusLive, isCodeModeCallable, isCodeModeFailClosed, isContentEmpty, isDeferredTool, isFileId, isInstructionMessage, isProviderToolDef, isSubagentAcceptedToolResult, isSubagentObservationToolResult, isTerminalAgentEvent, isTextDocumentMimeType, isToolJsonSchemaObject, isToolStageable, latestInstructionMessages, latestInstructionState, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, makeNestedToolCallRecorder, makeSubagentRunId, messageContextText, nestedToolCallMaxArgsBytes, nestedToolCallMaxCalls, nestedToolCallMaxErrorChars, nestedToolCallMaxRecordedCalls, nestedToolCallMaxTotalArgsBytes, nestedToolCallRecordLimit, nestedToolCallResultFields, nextAgentStatus, nextAgentStatusTree, normalizeFileMimeType, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, prependMessageContextToContent, providerToolDefs, questionResponseStructuredContent, reconcileAgentStatus, recordNestedToolCall, refAttachmentSource, repairDanglingHostToolCalls, replaceLoneSurrogates, replaceLoneSurrogatesDeep, resolveContentAttachmentSources, resolveMessageAttachmentSources, resolveMessagesAttachmentSources, sameInteractionBinding, sameInteractionCall, settleAgentStatusTree, startAgentStatusTree, textDocumentMimeTypeFromFilename, textImageDocumentModelCapabilities, textImageModelCapabilities, textOnlyModelCapabilities, textToBase64Utf8, toolDiscovery, toolResultMessageFromResult, toolSearchToolName, truncateCodePoints, urlAttachmentSource, validInteractionReceipt, validateInteractionSubmission, validateNoDanglingHostToolCalls, withSubagentStatus, zeroAgentUsage };
|
|
19
|
+
export { AgentAbortReason, AgentActivity, AgentAwaitingInput, AgentBlocked, AgentBlockedKind, AgentBusy, AgentCompacting, AgentContentCapabilities, AgentDone, AgentEnd, AgentError, AgentErrorCode, AgentEvent, AgentFailed, AgentGenerating, AgentIdle, AgentInputUsage, AgentMessage, AgentModelCapabilities, AgentOutputUsage, AgentReasoningEffort, AgentRetry, AgentRetrying, AgentRunningTools, AgentStart, AgentStatus, AgentStatusTree, AgentToolActivityCall, AgentUsage, AgentWebSocketClientMessage, AgentWebSocketServerMessage, AgentWorking, AssistantAgentMessage, AssistantMessageEvent, AssistantPart, AssistantReasoningPart, AssistantReasoningReplay, AssistantTextPart, type AttachmentContentPart, AttachmentSource, type AttachmentSourceResolver, AudioPart, BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, type BoundedNestedToolCallArgs, CompactionEnd, CompactionStart, Content, ContentPart, type DanglingHostToolCall, DocumentPart, type ErrorToolResultInput, FileDescriptor, FileId, FilePart, HitlRequest, HitlResponse, HitlResponseSource, HostToolCallPart, ImagePart, InlineBase64AttachmentSource, InputCancelled, type InputContentFormatter, InputDescriptor, InputRequest, InputRequested, InputResponse, InputResponseInput, InputResponseOutcome, type InputResponseStructuredContent, type InputResponseValidator, InputSubmitted, type InputToolHandler, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, type InteractionCallValidator, InteractionCancelled, InteractionCandidate, InteractionClaim, InteractionDescriptor, type InteractionHost, InteractionHostError, type InteractionOutcome, type InteractionPreflight, InteractionReceipt, InteractionReceiptStatus, type InteractionRef, InteractionRequest, InteractionRequested, InteractionResponse, InteractionResponseInput, InteractionResponseOutcome, type InteractionResponseStructuredContent, type InteractionResponseValidator, InteractionSubmitted, InteractionValidationError, LLMReasoningDelta, LLMReasoningReplay, LLMStreamEnd, LLMStreamStart, LLMTextDelta, MessageAnnotations, MessageAuthor, type MessageEnvelope, MessageId, MessageInstruction, NestedToolCallAccess, NestedToolCallCounts, type NestedToolCallInput, NestedToolCallRecord, type NestedToolCallRecorder, type NestedToolCallResultFields, NestedToolCallStatus, NestedToolCalls, PlainHitlResponse, type PlainInputResponse, type PlainInteractionResponse, type PlainQuestionAnswer, type PlainQuestionResponse, type PlainToolApprovalResponse, ProviderErrorInfo, ProviderFailureKind, ProviderStreamDiagnostics, ProviderStreamProtocol, ProviderStreamResponseFormat, ProviderToolCallPart, ProviderToolResult, ProviderToolResultPart, QuestionAnswer, QuestionAnswered, QuestionCancelled, QuestionOption, QuestionPrompt, QuestionRequest, QuestionRequested, QuestionResponse, QuestionResponseInput, QuestionResponseOutcome, type QuestionResponseStructuredContent, QuestionToolParams, RedactedReasoningReplay, RefAttachmentSource, type RepairDanglingHostToolCallsOptions, SessionSnapshot, SignedReasoningReplay, SubagentCompleted, SubagentStarted, SubagentStatus, SubagentStatusEntry, type TerminalAgentEvent, TextPart, ToolApprovalDecision, ToolApprovalDenied, ToolApprovalGranted, ToolApprovalMode, ToolApprovalPolicy, type ToolApprovalPreviewer, ToolApprovalRequest, ToolApprovalRequested, ToolApprovalResponse, ToolApprovalResponseInput, ToolCall, ToolCallableBy, ToolChangeCut, ToolChangeItem, ToolChangePreview, ToolChangePreviewError, ToolChangePreviewErrorCause, ToolChangePreviewFailure, ToolChangeScalar, ToolChangeSetCuts, ToolChangeSideCuts, ToolChangeTarget, ToolDef, ToolDiscovery, ToolExecutionAccepted, ToolExecutionCompleted, ToolExecutionError, ToolExecutionStarted, type ToolExposure, ToolFieldChange, ToolInputDelta, ToolInputEnd, ToolInputStart, ToolJsonSchema, ToolJsonSchemaObject, ToolListChange, ToolLoading, ToolResult, ToolResultMessage, ToolSearchActivation, ToolSetChange, ToolStructuredChange, ToolTextChange, ToolValueChange, type TranscriptInvariantValidation, TurnEnd, TurnStart, UrlAttachmentSource, UsageUpdate, UserInput, UserMessage, UserMessageEvent, activatedToolNames, addAgentUsage, agentBlockedKind, agentStatusFromEvents, agentStatusRetry, agentStatusTreeFromEvents, appendTextToContent, assistantContent, assistantHostToolCalls, assistantReasoningText, attachmentSourceBase64, attachmentSourceDataUrl, attachmentSourcePreview, attachmentSourceText, attachmentSourceUrl, base64ToBytes, boundNestedToolCallArgs, bytesToBase64, contentPartPreview, contentPartText, contentParts, contentPreview, contentText, danglingHostToolCalls, declaredToolDefs, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, documentPartFromText, emptyNestedToolCallRecorder, fileIdPattern, fileLabel, fileNotCapturedLabel, filePartFromBytes, filePartText, formatFileSize, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, hitlRequestBlockedKind, hitlResponseEvent, idleAgentStatus, inferTextDocumentMimeType, initialAgentStatusTree, inlineBase64AttachmentSource, inlineBase64Source, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isAgentStatusLive, isCodeModeCallable, isCodeModeFailClosed, isContentEmpty, isDeferredTool, isFileId, isInstructionMessage, isProviderToolDef, isSubagentAcceptedToolResult, isSubagentObservationToolResult, isTerminalAgentEvent, isTextDocumentMimeType, isToolJsonSchemaObject, isToolStageable, latestInstructionMessages, latestInstructionState, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, makeNestedToolCallRecorder, makeSubagentRunId, messageContextText, nestedToolCallMaxArgsBytes, nestedToolCallMaxCalls, nestedToolCallMaxErrorChars, nestedToolCallMaxRecordedCalls, nestedToolCallMaxTotalArgsBytes, nestedToolCallRecordLimit, nestedToolCallResultFields, nextAgentStatus, nextAgentStatusTree, normalizeFileMimeType, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, prependMessageContextToContent, providerToolDefs, questionResponseStructuredContent, reconcileAgentStatus, recordNestedToolCall, refAttachmentSource, repairDanglingHostToolCalls, replaceLoneSurrogates, replaceLoneSurrogatesDeep, resolveContentAttachmentSources, resolveMessageAttachmentSources, resolveMessagesAttachmentSources, sameInteractionBinding, sameInteractionCall, settleAgentStatusTree, startAgentStatusTree, textDocumentMimeTypeFromFilename, textImageDocumentModelCapabilities, textImageModelCapabilities, textOnlyModelCapabilities, textToBase64Utf8, toolDiscovery, toolJsonSchemaOmittedNullComment, toolResultMessageFromResult, toolSearchToolName, truncateCodePoints, urlAttachmentSource, validInteractionReceipt, validateInteractionSubmission, validateNoDanglingHostToolCalls, withSubagentStatus, zeroAgentUsage };
|
|
20
20
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/protocol/index.ts"],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/protocol/index.ts"],"mappings":";;;;;;;;;;;;;;;;KA+WY,SAAA"}
|
package/dist/protocol/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { AttachmentSource, AudioPart, Content, ContentPart, DocumentPart, FilePa
|
|
|
4
4
|
import { truncateCodePoints } from "./bounded-text.mjs";
|
|
5
5
|
import { AgentInputUsage, AgentOutputUsage, AgentUsage, addAgentUsage, zeroAgentUsage } from "./usage.mjs";
|
|
6
6
|
import { NestedToolCallAccess, NestedToolCallCounts, NestedToolCallRecord, NestedToolCallStatus, NestedToolCalls, boundNestedToolCallArgs, emptyNestedToolCallRecorder, makeNestedToolCallRecorder, nestedToolCallMaxArgsBytes, nestedToolCallMaxCalls, nestedToolCallMaxErrorChars, nestedToolCallMaxRecordedCalls, nestedToolCallMaxTotalArgsBytes, nestedToolCallRecordLimit, nestedToolCallResultFields, recordNestedToolCall } from "./nested-tool-calls.mjs";
|
|
7
|
-
import { BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, HitlRequest, HitlResponse, HitlResponseSource, InputDescriptor, InputRequest, InputResponse, InputResponseOutcome, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHostError, InteractionReceipt, InteractionReceiptStatus, InteractionRequest, InteractionResponse, InteractionResponseOutcome, InteractionValidationError, PlainHitlResponse, QuestionAnswer, QuestionOption, QuestionPrompt, QuestionRequest, QuestionResponse, QuestionResponseOutcome, QuestionToolParams, ToolApprovalDecision, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalResponse, ToolCall, ToolCallableBy, ToolDef, ToolDiscovery, ToolJsonSchema, ToolJsonSchemaObject, ToolLoading, ToolResult, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isCodeModeCallable, isCodeModeFailClosed, isDeferredTool, isProviderToolDef, isToolJsonSchemaObject, isToolStageable, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, providerToolDefs, questionResponseStructuredContent, sameInteractionBinding, sameInteractionCall, toolDiscovery, validInteractionReceipt, validateInteractionSubmission } from "./tool.mjs";
|
|
7
|
+
import { BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, HitlRequest, HitlResponse, HitlResponseSource, InputDescriptor, InputRequest, InputResponse, InputResponseOutcome, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHostError, InteractionReceipt, InteractionReceiptStatus, InteractionRequest, InteractionResponse, InteractionResponseOutcome, InteractionValidationError, PlainHitlResponse, QuestionAnswer, QuestionOption, QuestionPrompt, QuestionRequest, QuestionResponse, QuestionResponseOutcome, QuestionToolParams, ToolApprovalDecision, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalResponse, ToolCall, ToolCallableBy, ToolDef, ToolDiscovery, ToolJsonSchema, ToolJsonSchemaObject, ToolLoading, ToolResult, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isCodeModeCallable, isCodeModeFailClosed, isDeferredTool, isProviderToolDef, isToolJsonSchemaObject, isToolStageable, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, providerToolDefs, questionResponseStructuredContent, sameInteractionBinding, sameInteractionCall, toolDiscovery, toolJsonSchemaOmittedNullComment, validInteractionReceipt, validateInteractionSubmission } from "./tool.mjs";
|
|
8
8
|
import { AgentContentCapabilities, AgentModelCapabilities, textImageDocumentModelCapabilities, textImageModelCapabilities, textOnlyModelCapabilities } from "./capability.mjs";
|
|
9
9
|
import { AgentMessage, AssistantAgentMessage, AssistantPart, AssistantReasoningPart, AssistantReasoningReplay, AssistantTextPart, HostToolCallPart, MessageAnnotations, MessageAuthor, MessageInstruction, ProviderToolCallPart, ProviderToolResultPart, RedactedReasoningReplay, SignedReasoningReplay, ToolResultMessage, UserMessage, assistantContent, assistantHostToolCalls, assistantReasoningText, danglingHostToolCalls, isInstructionMessage, latestInstructionMessages, latestInstructionState, messageContextText, prependMessageContextToContent, repairDanglingHostToolCalls, resolveMessageAttachmentSources, resolveMessagesAttachmentSources, toolResultMessageFromResult, validateNoDanglingHostToolCalls } from "./message.mjs";
|
|
10
10
|
import { AgentAbortReason, AgentAwaitingInput, AgentEnd, AgentError, AgentErrorCode, AgentEvent, AgentRetry, AgentStart, AssistantMessageEvent, CompactionEnd, CompactionStart, InputCancelled, InputRequested, InputSubmitted, InteractionCancelled, InteractionRequested, InteractionSubmitted, LLMReasoningDelta, LLMReasoningReplay, LLMStreamEnd, LLMStreamStart, LLMTextDelta, ProviderErrorInfo, ProviderFailureKind, ProviderStreamDiagnostics, ProviderStreamProtocol, ProviderStreamResponseFormat, ProviderToolResult, QuestionAnswered, QuestionCancelled, QuestionRequested, SubagentCompleted, SubagentStarted, SubagentStatus, ToolApprovalDenied, ToolApprovalGranted, ToolApprovalRequested, ToolExecutionAccepted, ToolExecutionCompleted, ToolExecutionError, ToolExecutionStarted, ToolInputDelta, ToolInputEnd, ToolInputStart, TurnEnd, TurnStart, UsageUpdate, UserMessageEvent, hitlResponseEvent, isSubagentAcceptedToolResult, isSubagentObservationToolResult, isTerminalAgentEvent, makeSubagentRunId } from "./event.mjs";
|
|
@@ -12,4 +12,4 @@ import { AgentReasoningEffort } from "./reasoning.mjs";
|
|
|
12
12
|
import { AgentActivity, AgentBlocked, AgentBlockedKind, AgentBusy, AgentCompacting, AgentDone, AgentFailed, AgentGenerating, AgentIdle, AgentRetrying, AgentRunningTools, AgentStatus, AgentStatusTree, AgentToolActivityCall, AgentWorking, SubagentStatusEntry, agentBlockedKind, agentStatusFromEvents, agentStatusRetry, agentStatusTreeFromEvents, hitlRequestBlockedKind, idleAgentStatus, initialAgentStatusTree, isAgentStatusLive, nextAgentStatus, nextAgentStatusTree, reconcileAgentStatus, settleAgentStatusTree, startAgentStatusTree, withSubagentStatus } from "./status.mjs";
|
|
13
13
|
import { AgentWebSocketClientMessage, AgentWebSocketServerMessage, InputResponseInput, InteractionResponseInput, QuestionResponseInput, SessionSnapshot, ToolApprovalResponseInput, UserInput } from "./session.mjs";
|
|
14
14
|
import { ToolSearchActivation, activatedToolNames, declaredToolDefs, toolSearchToolName } from "./tool-search.mjs";
|
|
15
|
-
export { AgentAbortReason, AgentActivity, AgentAwaitingInput, AgentBlocked, AgentBlockedKind, AgentBusy, AgentCompacting, AgentContentCapabilities, AgentDone, AgentEnd, AgentError, AgentErrorCode, AgentEvent, AgentFailed, AgentGenerating, AgentIdle, AgentInputUsage, AgentMessage, AgentModelCapabilities, AgentOutputUsage, AgentReasoningEffort, AgentRetry, AgentRetrying, AgentRunningTools, AgentStart, AgentStatus, AgentStatusTree, AgentToolActivityCall, AgentUsage, AgentWebSocketClientMessage, AgentWebSocketServerMessage, AgentWorking, AssistantAgentMessage, AssistantMessageEvent, AssistantPart, AssistantReasoningPart, AssistantReasoningReplay, AssistantTextPart, AttachmentSource, AudioPart, BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, CompactionEnd, CompactionStart, Content, ContentPart, DocumentPart, FileDescriptor, FileId, FilePart, HitlRequest, HitlResponse, HitlResponseSource, HostToolCallPart, ImagePart, InlineBase64AttachmentSource, InputCancelled, InputDescriptor, InputRequest, InputRequested, InputResponse, InputResponseInput, InputResponseOutcome, InputSubmitted, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCancelled, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHostError, InteractionReceipt, InteractionReceiptStatus, InteractionRequest, InteractionRequested, InteractionResponse, InteractionResponseInput, InteractionResponseOutcome, InteractionSubmitted, InteractionValidationError, LLMReasoningDelta, LLMReasoningReplay, LLMStreamEnd, LLMStreamStart, LLMTextDelta, MessageAnnotations, MessageAuthor, MessageInstruction, NestedToolCallAccess, NestedToolCallCounts, NestedToolCallRecord, NestedToolCallStatus, NestedToolCalls, PlainHitlResponse, ProviderErrorInfo, ProviderFailureKind, ProviderStreamDiagnostics, ProviderStreamProtocol, ProviderStreamResponseFormat, ProviderToolCallPart, ProviderToolResult, ProviderToolResultPart, QuestionAnswer, QuestionAnswered, QuestionCancelled, QuestionOption, QuestionPrompt, QuestionRequest, QuestionRequested, QuestionResponse, QuestionResponseInput, QuestionResponseOutcome, QuestionToolParams, RedactedReasoningReplay, RefAttachmentSource, SessionSnapshot, SignedReasoningReplay, SubagentCompleted, SubagentStarted, SubagentStatus, SubagentStatusEntry, TextPart, ToolApprovalDecision, ToolApprovalDenied, ToolApprovalGranted, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalRequested, ToolApprovalResponse, ToolApprovalResponseInput, ToolCall, ToolCallableBy, ToolChangeCut, ToolChangeItem, ToolChangePreview, ToolChangePreviewError, ToolChangePreviewErrorCause, ToolChangePreviewFailure, ToolChangeScalar, ToolChangeSetCuts, ToolChangeSideCuts, ToolChangeTarget, ToolDef, ToolDiscovery, ToolExecutionAccepted, ToolExecutionCompleted, ToolExecutionError, ToolExecutionStarted, ToolFieldChange, ToolInputDelta, ToolInputEnd, ToolInputStart, ToolJsonSchema, ToolJsonSchemaObject, ToolListChange, ToolLoading, ToolResult, ToolResultMessage, ToolSearchActivation, ToolSetChange, ToolStructuredChange, ToolTextChange, ToolValueChange, TurnEnd, TurnStart, UrlAttachmentSource, UsageUpdate, UserInput, UserMessage, UserMessageEvent, activatedToolNames, addAgentUsage, agentBlockedKind, agentStatusFromEvents, agentStatusRetry, agentStatusTreeFromEvents, appendTextToContent, assistantContent, assistantHostToolCalls, assistantReasoningText, attachmentSourceBase64, attachmentSourceDataUrl, attachmentSourcePreview, attachmentSourceText, attachmentSourceUrl, base64ToBytes, boundNestedToolCallArgs, bytesToBase64, contentPartPreview, contentPartText, contentParts, contentPreview, contentText, danglingHostToolCalls, declaredToolDefs, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, documentPartFromText, emptyNestedToolCallRecorder, fileIdPattern, fileLabel, fileNotCapturedLabel, filePartFromBytes, filePartText, formatFileSize, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, hitlRequestBlockedKind, hitlResponseEvent, idleAgentStatus, inferTextDocumentMimeType, initialAgentStatusTree, inlineBase64AttachmentSource, inlineBase64Source, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isAgentStatusLive, isCodeModeCallable, isCodeModeFailClosed, isContentEmpty, isDeferredTool, isFileId, isInstructionMessage, isProviderToolDef, isSubagentAcceptedToolResult, isSubagentObservationToolResult, isTerminalAgentEvent, isTextDocumentMimeType, isToolJsonSchemaObject, isToolStageable, latestInstructionMessages, latestInstructionState, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, makeNestedToolCallRecorder, makeSubagentRunId, messageContextText, nestedToolCallMaxArgsBytes, nestedToolCallMaxCalls, nestedToolCallMaxErrorChars, nestedToolCallMaxRecordedCalls, nestedToolCallMaxTotalArgsBytes, nestedToolCallRecordLimit, nestedToolCallResultFields, nextAgentStatus, nextAgentStatusTree, normalizeFileMimeType, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, prependMessageContextToContent, providerToolDefs, questionResponseStructuredContent, reconcileAgentStatus, recordNestedToolCall, refAttachmentSource, repairDanglingHostToolCalls, replaceLoneSurrogates, replaceLoneSurrogatesDeep, resolveContentAttachmentSources, resolveMessageAttachmentSources, resolveMessagesAttachmentSources, sameInteractionBinding, sameInteractionCall, settleAgentStatusTree, startAgentStatusTree, textDocumentMimeTypeFromFilename, textImageDocumentModelCapabilities, textImageModelCapabilities, textOnlyModelCapabilities, textToBase64Utf8, toolDiscovery, toolResultMessageFromResult, toolSearchToolName, truncateCodePoints, urlAttachmentSource, validInteractionReceipt, validateInteractionSubmission, validateNoDanglingHostToolCalls, withSubagentStatus, zeroAgentUsage };
|
|
15
|
+
export { AgentAbortReason, AgentActivity, AgentAwaitingInput, AgentBlocked, AgentBlockedKind, AgentBusy, AgentCompacting, AgentContentCapabilities, AgentDone, AgentEnd, AgentError, AgentErrorCode, AgentEvent, AgentFailed, AgentGenerating, AgentIdle, AgentInputUsage, AgentMessage, AgentModelCapabilities, AgentOutputUsage, AgentReasoningEffort, AgentRetry, AgentRetrying, AgentRunningTools, AgentStart, AgentStatus, AgentStatusTree, AgentToolActivityCall, AgentUsage, AgentWebSocketClientMessage, AgentWebSocketServerMessage, AgentWorking, AssistantAgentMessage, AssistantMessageEvent, AssistantPart, AssistantReasoningPart, AssistantReasoningReplay, AssistantTextPart, AttachmentSource, AudioPart, BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, CompactionEnd, CompactionStart, Content, ContentPart, DocumentPart, FileDescriptor, FileId, FilePart, HitlRequest, HitlResponse, HitlResponseSource, HostToolCallPart, ImagePart, InlineBase64AttachmentSource, InputCancelled, InputDescriptor, InputRequest, InputRequested, InputResponse, InputResponseInput, InputResponseOutcome, InputSubmitted, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCancelled, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHostError, InteractionReceipt, InteractionReceiptStatus, InteractionRequest, InteractionRequested, InteractionResponse, InteractionResponseInput, InteractionResponseOutcome, InteractionSubmitted, InteractionValidationError, LLMReasoningDelta, LLMReasoningReplay, LLMStreamEnd, LLMStreamStart, LLMTextDelta, MessageAnnotations, MessageAuthor, MessageInstruction, NestedToolCallAccess, NestedToolCallCounts, NestedToolCallRecord, NestedToolCallStatus, NestedToolCalls, PlainHitlResponse, ProviderErrorInfo, ProviderFailureKind, ProviderStreamDiagnostics, ProviderStreamProtocol, ProviderStreamResponseFormat, ProviderToolCallPart, ProviderToolResult, ProviderToolResultPart, QuestionAnswer, QuestionAnswered, QuestionCancelled, QuestionOption, QuestionPrompt, QuestionRequest, QuestionRequested, QuestionResponse, QuestionResponseInput, QuestionResponseOutcome, QuestionToolParams, RedactedReasoningReplay, RefAttachmentSource, SessionSnapshot, SignedReasoningReplay, SubagentCompleted, SubagentStarted, SubagentStatus, SubagentStatusEntry, TextPart, ToolApprovalDecision, ToolApprovalDenied, ToolApprovalGranted, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalRequested, ToolApprovalResponse, ToolApprovalResponseInput, ToolCall, ToolCallableBy, ToolChangeCut, ToolChangeItem, ToolChangePreview, ToolChangePreviewError, ToolChangePreviewErrorCause, ToolChangePreviewFailure, ToolChangeScalar, ToolChangeSetCuts, ToolChangeSideCuts, ToolChangeTarget, ToolDef, ToolDiscovery, ToolExecutionAccepted, ToolExecutionCompleted, ToolExecutionError, ToolExecutionStarted, ToolFieldChange, ToolInputDelta, ToolInputEnd, ToolInputStart, ToolJsonSchema, ToolJsonSchemaObject, ToolListChange, ToolLoading, ToolResult, ToolResultMessage, ToolSearchActivation, ToolSetChange, ToolStructuredChange, ToolTextChange, ToolValueChange, TurnEnd, TurnStart, UrlAttachmentSource, UsageUpdate, UserInput, UserMessage, UserMessageEvent, activatedToolNames, addAgentUsage, agentBlockedKind, agentStatusFromEvents, agentStatusRetry, agentStatusTreeFromEvents, appendTextToContent, assistantContent, assistantHostToolCalls, assistantReasoningText, attachmentSourceBase64, attachmentSourceDataUrl, attachmentSourcePreview, attachmentSourceText, attachmentSourceUrl, base64ToBytes, boundNestedToolCallArgs, bytesToBase64, contentPartPreview, contentPartText, contentParts, contentPreview, contentText, danglingHostToolCalls, declaredToolDefs, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, documentPartFromText, emptyNestedToolCallRecorder, fileIdPattern, fileLabel, fileNotCapturedLabel, filePartFromBytes, filePartText, formatFileSize, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, hitlRequestBlockedKind, hitlResponseEvent, idleAgentStatus, inferTextDocumentMimeType, initialAgentStatusTree, inlineBase64AttachmentSource, inlineBase64Source, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isAgentStatusLive, isCodeModeCallable, isCodeModeFailClosed, isContentEmpty, isDeferredTool, isFileId, isInstructionMessage, isProviderToolDef, isSubagentAcceptedToolResult, isSubagentObservationToolResult, isTerminalAgentEvent, isTextDocumentMimeType, isToolJsonSchemaObject, isToolStageable, latestInstructionMessages, latestInstructionState, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, makeNestedToolCallRecorder, makeSubagentRunId, messageContextText, nestedToolCallMaxArgsBytes, nestedToolCallMaxCalls, nestedToolCallMaxErrorChars, nestedToolCallMaxRecordedCalls, nestedToolCallMaxTotalArgsBytes, nestedToolCallRecordLimit, nestedToolCallResultFields, nextAgentStatus, nextAgentStatusTree, normalizeFileMimeType, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, prependMessageContextToContent, providerToolDefs, questionResponseStructuredContent, reconcileAgentStatus, recordNestedToolCall, refAttachmentSource, repairDanglingHostToolCalls, replaceLoneSurrogates, replaceLoneSurrogatesDeep, resolveContentAttachmentSources, resolveMessageAttachmentSources, resolveMessagesAttachmentSources, sameInteractionBinding, sameInteractionCall, settleAgentStatusTree, startAgentStatusTree, textDocumentMimeTypeFromFilename, textImageDocumentModelCapabilities, textImageModelCapabilities, textOnlyModelCapabilities, textToBase64Utf8, toolDiscovery, toolJsonSchemaOmittedNullComment, toolResultMessageFromResult, toolSearchToolName, truncateCodePoints, urlAttachmentSource, validInteractionReceipt, validateInteractionSubmission, validateNoDanglingHostToolCalls, withSubagentStatus, zeroAgentUsage };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Match, Predicate } from "effect";
|
|
2
2
|
import * as Schema$1 from "effect/Schema";
|
|
3
|
-
import * as SchemaAST from "effect/SchemaAST";
|
|
3
|
+
import * as SchemaAST$1 from "effect/SchemaAST";
|
|
4
4
|
//#region src/protocol/tool-argument-hints.ts
|
|
5
5
|
const maxAllowedNames = 40;
|
|
6
6
|
const unknownArgumentsIn = (issue, path) => Match.value(issue).pipe(Match.tag("Pointer", (pointer) => unknownArgumentsIn(pointer.issue, [...path, ...pointer.path])), Match.tag("Filter", "Encoding", (wrapper) => unknownArgumentsIn(wrapper.issue, path)), Match.tag("Composite", "AnyOf", (group) => group.issues.flatMap((child) => unknownArgumentsIn(child, path))), Match.tag("UnexpectedKey", (unexpected) => {
|
|
7
7
|
const key = path.at(-1);
|
|
8
|
-
if (key === void 0 || !SchemaAST.isObjects(unexpected.ast)) return [];
|
|
8
|
+
if (key === void 0 || !SchemaAST$1.isObjects(unexpected.ast)) return [];
|
|
9
9
|
const allowed = unexpected.ast.propertySignatures.map((property) => property.name).filter(Predicate.isString);
|
|
10
10
|
return [{
|
|
11
11
|
parent: path.slice(0, -1),
|
|
@@ -14,7 +14,7 @@ const unknownArgumentsIn = (issue, path) => Match.value(issue).pipe(Match.tag("P
|
|
|
14
14
|
}];
|
|
15
15
|
}), Match.tag("InvalidType", (invalid) => {
|
|
16
16
|
const key = path.at(-1);
|
|
17
|
-
return key !== void 0 && SchemaAST.isNever(invalid.ast) ? [{
|
|
17
|
+
return key !== void 0 && SchemaAST$1.isNever(invalid.ast) ? [{
|
|
18
18
|
parent: path.slice(0, -1),
|
|
19
19
|
key,
|
|
20
20
|
allowed: []
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-argument-hints.mjs","names":["Schema"],"sources":["../../src/protocol/tool-argument-hints.ts"],"sourcesContent":["import { Match, Predicate } from 'effect'\nimport * as Schema from 'effect/Schema'\nimport * as SchemaAST from 'effect/SchemaAST'\nimport type * as SchemaIssue from 'effect/SchemaIssue'\n\n// Model-facing hints for invalid tool-call arguments. Tool and interaction argument decoding\n// rejects unknown keys; Effect's issue text names the key but not what the model should send\n// instead. Shared by the tools registry and the loop (which cannot import tools).\n\ntype UnknownArgument = {\n readonly parent: ReadonlyArray<PropertyKey>\n readonly key: PropertyKey\n readonly allowed: ReadonlyArray<string>\n}\n\nconst maxAllowedNames = 40\n\nconst unknownArgumentsIn = (\n issue: SchemaIssue.Issue,\n path: ReadonlyArray<PropertyKey>\n): ReadonlyArray<UnknownArgument> =>\n Match.value(issue).pipe(\n Match.tag('Pointer', pointer => unknownArgumentsIn(pointer.issue, [...path, ...pointer.path])),\n Match.tag('Filter', 'Encoding', wrapper => unknownArgumentsIn(wrapper.issue, path)),\n Match.tag('Composite', 'AnyOf', group =>\n group.issues.flatMap(child => unknownArgumentsIn(child, path))\n ),\n Match.tag('UnexpectedKey', unexpected => {\n const key = path.at(-1)\n\n // Extra tuple elements (Arrays AST) are not argument names; the base message covers them.\n if (key === undefined || !SchemaAST.isObjects(unexpected.ast)) return []\n\n const allowed = unexpected.ast.propertySignatures\n .map(property => property.name)\n .filter(Predicate.isString)\n\n return [{ parent: path.slice(0, -1), key, allowed }]\n }),\n // `Record(String, Never)` (e.g. `EmptyToolParams`) rejects every key's value as `never`.\n Match.tag('InvalidType', invalid => {\n const key = path.at(-1)\n\n return key !== undefined && SchemaAST.isNever(invalid.ast)\n ? [{ parent: path.slice(0, -1), key, allowed: [] }]\n : []\n }),\n Match.orElse(() => [])\n )\n\n// A quoted dotted path when unambiguous (`\"a.b\"`), otherwise an unquoted JSON path array\n// (`[\"a.b\"]`). The two forms never collide: only the array form starts with `[`, and any segment\n// that could look like path syntax or break the line (empty, `.`, `[`, `\"`, newline) forces the\n// array form.\nconst needsArrayForm = (segment: string) => segment === '' || /[.[\"\\n\\r]/.test(segment)\n\nconst formatPath = (path: ReadonlyArray<PropertyKey>) => {\n const segments = path.map(String)\n\n return segments.some(needsArrayForm) ? JSON.stringify(segments) : `\"${segments.join('.')}\"`\n}\n\nconst formatAllowed = (allowed: ReadonlyArray<string>) =>\n allowed.length === 0\n ? 'none'\n : allowed.length > maxAllowedNames\n ? `${allowed.slice(0, maxAllowedNames).join(', ')}, …`\n : allowed.join(', ')\n\ntype UnknownArgumentGroup = {\n readonly parent: ReadonlyArray<PropertyKey>\n readonly keys: Array<string>\n readonly allowed: ReadonlyArray<string>\n}\n\nconst formatGroup = (group: UnknownArgumentGroup) => {\n // JSON-escaped so quotes, commas or newlines in a key cannot look like several keys.\n const keys = group.keys.map(key => JSON.stringify(key)).join(', ')\n const label = group.keys.length === 1 ? 'Unknown argument' : 'Unknown arguments'\n\n return group.parent.length === 0\n ? `${label} ${keys}. Allowed arguments: ${formatAllowed(group.allowed)}.`\n : `${label} ${keys} in ${formatPath(group.parent)}. Allowed there: ${formatAllowed(group.allowed)}.`\n}\n\n/** Actionable hint for unknown-key failures: one line per object (path and allowed-key set; union\n * members at one path can each produce a line), naming its unknown keys and listing the keys that\n * object declares, or `undefined` when there are no unknown keys. */\nexport const toolArgumentsErrorHint = (error: Schema.SchemaError): string | undefined => {\n const groups = new Map<string, UnknownArgumentGroup>()\n\n for (const argument of unknownArgumentsIn(error.issue, [])) {\n // Structural identity: distinct paths or allowed lists never merge.\n const id = JSON.stringify([argument.parent.map(String), argument.allowed])\n const key = String(argument.key)\n const group = groups.get(id)\n\n if (group === undefined) {\n groups.set(id, { parent: argument.parent, keys: [key], allowed: argument.allowed })\n } else if (!group.keys.includes(key)) {\n group.keys.push(key)\n }\n }\n\n return groups.size === 0 ? undefined : Array.from(groups.values(), formatGroup).join('\\n')\n}\n\n/** Appends {@link toolArgumentsErrorHint} to an argument-validation message when available. */\nexport const withToolArgumentsErrorHint = (message: string, error: unknown): string => {\n const hint = error instanceof Schema.SchemaError ? toolArgumentsErrorHint(error) : undefined\n\n return hint === undefined ? message : `${message}\\n${hint}`\n}\n"],"mappings":";;;;AAeA,MAAM,kBAAkB;AAExB,MAAM,sBACJ,OACA,SAEA,MAAM,MAAM,KAAK,EAAE,KACjB,MAAM,IAAI,YAAW,YAAW,mBAAmB,QAAQ,OAAO,CAAC,GAAG,MAAM,GAAG,QAAQ,IAAI,CAAC,CAAC,GAC7F,MAAM,IAAI,UAAU,aAAY,YAAW,mBAAmB,QAAQ,OAAO,IAAI,CAAC,GAClF,MAAM,IAAI,aAAa,UAAS,UAC9B,MAAM,OAAO,SAAQ,UAAS,mBAAmB,OAAO,IAAI,CAAC,CAC/D,GACA,MAAM,IAAI,kBAAiB,eAAc;CACvC,MAAM,MAAM,KAAK,GAAG,EAAE;CAGtB,IAAI,QAAQ,KAAA,KAAa,
|
|
1
|
+
{"version":3,"file":"tool-argument-hints.mjs","names":["SchemaAST","Schema"],"sources":["../../src/protocol/tool-argument-hints.ts"],"sourcesContent":["import { Match, Predicate } from 'effect'\nimport * as Schema from 'effect/Schema'\nimport * as SchemaAST from 'effect/SchemaAST'\nimport type * as SchemaIssue from 'effect/SchemaIssue'\n\n// Model-facing hints for invalid tool-call arguments. Tool and interaction argument decoding\n// rejects unknown keys; Effect's issue text names the key but not what the model should send\n// instead. Shared by the tools registry and the loop (which cannot import tools).\n\ntype UnknownArgument = {\n readonly parent: ReadonlyArray<PropertyKey>\n readonly key: PropertyKey\n readonly allowed: ReadonlyArray<string>\n}\n\nconst maxAllowedNames = 40\n\nconst unknownArgumentsIn = (\n issue: SchemaIssue.Issue,\n path: ReadonlyArray<PropertyKey>\n): ReadonlyArray<UnknownArgument> =>\n Match.value(issue).pipe(\n Match.tag('Pointer', pointer => unknownArgumentsIn(pointer.issue, [...path, ...pointer.path])),\n Match.tag('Filter', 'Encoding', wrapper => unknownArgumentsIn(wrapper.issue, path)),\n Match.tag('Composite', 'AnyOf', group =>\n group.issues.flatMap(child => unknownArgumentsIn(child, path))\n ),\n Match.tag('UnexpectedKey', unexpected => {\n const key = path.at(-1)\n\n // Extra tuple elements (Arrays AST) are not argument names; the base message covers them.\n if (key === undefined || !SchemaAST.isObjects(unexpected.ast)) return []\n\n const allowed = unexpected.ast.propertySignatures\n .map(property => property.name)\n .filter(Predicate.isString)\n\n return [{ parent: path.slice(0, -1), key, allowed }]\n }),\n // `Record(String, Never)` (e.g. `EmptyToolParams`) rejects every key's value as `never`.\n Match.tag('InvalidType', invalid => {\n const key = path.at(-1)\n\n return key !== undefined && SchemaAST.isNever(invalid.ast)\n ? [{ parent: path.slice(0, -1), key, allowed: [] }]\n : []\n }),\n Match.orElse(() => [])\n )\n\n// A quoted dotted path when unambiguous (`\"a.b\"`), otherwise an unquoted JSON path array\n// (`[\"a.b\"]`). The two forms never collide: only the array form starts with `[`, and any segment\n// that could look like path syntax or break the line (empty, `.`, `[`, `\"`, newline) forces the\n// array form.\nconst needsArrayForm = (segment: string) => segment === '' || /[.[\"\\n\\r]/.test(segment)\n\nconst formatPath = (path: ReadonlyArray<PropertyKey>) => {\n const segments = path.map(String)\n\n return segments.some(needsArrayForm) ? JSON.stringify(segments) : `\"${segments.join('.')}\"`\n}\n\nconst formatAllowed = (allowed: ReadonlyArray<string>) =>\n allowed.length === 0\n ? 'none'\n : allowed.length > maxAllowedNames\n ? `${allowed.slice(0, maxAllowedNames).join(', ')}, …`\n : allowed.join(', ')\n\ntype UnknownArgumentGroup = {\n readonly parent: ReadonlyArray<PropertyKey>\n readonly keys: Array<string>\n readonly allowed: ReadonlyArray<string>\n}\n\nconst formatGroup = (group: UnknownArgumentGroup) => {\n // JSON-escaped so quotes, commas or newlines in a key cannot look like several keys.\n const keys = group.keys.map(key => JSON.stringify(key)).join(', ')\n const label = group.keys.length === 1 ? 'Unknown argument' : 'Unknown arguments'\n\n return group.parent.length === 0\n ? `${label} ${keys}. Allowed arguments: ${formatAllowed(group.allowed)}.`\n : `${label} ${keys} in ${formatPath(group.parent)}. Allowed there: ${formatAllowed(group.allowed)}.`\n}\n\n/** Actionable hint for unknown-key failures: one line per object (path and allowed-key set; union\n * members at one path can each produce a line), naming its unknown keys and listing the keys that\n * object declares, or `undefined` when there are no unknown keys. */\nexport const toolArgumentsErrorHint = (error: Schema.SchemaError): string | undefined => {\n const groups = new Map<string, UnknownArgumentGroup>()\n\n for (const argument of unknownArgumentsIn(error.issue, [])) {\n // Structural identity: distinct paths or allowed lists never merge.\n const id = JSON.stringify([argument.parent.map(String), argument.allowed])\n const key = String(argument.key)\n const group = groups.get(id)\n\n if (group === undefined) {\n groups.set(id, { parent: argument.parent, keys: [key], allowed: argument.allowed })\n } else if (!group.keys.includes(key)) {\n group.keys.push(key)\n }\n }\n\n return groups.size === 0 ? undefined : Array.from(groups.values(), formatGroup).join('\\n')\n}\n\n/** Appends {@link toolArgumentsErrorHint} to an argument-validation message when available. */\nexport const withToolArgumentsErrorHint = (message: string, error: unknown): string => {\n const hint = error instanceof Schema.SchemaError ? toolArgumentsErrorHint(error) : undefined\n\n return hint === undefined ? message : `${message}\\n${hint}`\n}\n"],"mappings":";;;;AAeA,MAAM,kBAAkB;AAExB,MAAM,sBACJ,OACA,SAEA,MAAM,MAAM,KAAK,EAAE,KACjB,MAAM,IAAI,YAAW,YAAW,mBAAmB,QAAQ,OAAO,CAAC,GAAG,MAAM,GAAG,QAAQ,IAAI,CAAC,CAAC,GAC7F,MAAM,IAAI,UAAU,aAAY,YAAW,mBAAmB,QAAQ,OAAO,IAAI,CAAC,GAClF,MAAM,IAAI,aAAa,UAAS,UAC9B,MAAM,OAAO,SAAQ,UAAS,mBAAmB,OAAO,IAAI,CAAC,CAC/D,GACA,MAAM,IAAI,kBAAiB,eAAc;CACvC,MAAM,MAAM,KAAK,GAAG,EAAE;CAGtB,IAAI,QAAQ,KAAA,KAAa,CAACA,YAAU,UAAU,WAAW,GAAG,GAAG,OA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,yBAAS,IAAI,IAAkC;CAErD,KAAK,MAAM,YAAY,mBAAmB,MAAM,OAAO,CAAC,CAAC,GAAG;EAE1D,MAAM,KAAK,KAAK,UAAU,CAAC,SAAS,OAAO,IAAI,MAAM,GAAG,SAAS,OAAO,CAAC;EACzE,MAAM,MAAM,OAAO,SAAS,GAAG;EAC/B,MAAM,QAAQ,OAAO,IAAI,EAAE;EAE3B,IAAI,UAAU,KAAA,GACZ,OAAO,IAAI,IAAI;GAAE,QAAQ,SAAS;GAAQ,MAAM,CAAC,GAAG;GAAG,SAAS,SAAS;EAAQ,CAAC;OAC7E,IAAI,CAAC,MAAM,KAAK,SAAS,GAAG,GACjC,MAAM,KAAK,KAAK,GAAG;CAEvB;CAEA,OAAO,OAAO,SAAS,IAAI,KAAA,IAAY,MAAM,KAAK,OAAO,OAAO,GAAG,WAAW,EAAE,KAAK,IAAI;AAC3F;;AAGA,MAAa,8BAA8B,SAAiB,UAA2B;CACrF,MAAM,OAAO,iBAAiBC,SAAO,cAAc,uBAAuB,KAAK,IAAI,KAAA;CAEnF,OAAO,SAAS,KAAA,IAAY,UAAU,GAAG,QAAQ,IAAI;AACvD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
|
|
3
|
+
//#region src/protocol/tool-json-schema-marker.d.ts
|
|
4
|
+
/** Whether a JSON value is a JSON object (not an array or a primitive). */
|
|
5
|
+
declare const isJsonObjectValue: (value: Schema.Json) => value is Schema.JsonObject;
|
|
6
|
+
/** Rebuilds a JSON Schema with `f` applied to every schema object, children first, following
|
|
7
|
+
* schema positions only (literal data under `const`/`default`/`enum`/`examples` is untouched).
|
|
8
|
+
* Unchanged subtrees keep their identity, so a schema without matches is returned as is.
|
|
9
|
+
*/
|
|
10
|
+
declare const mapToolJsonSchemaObjects: (schema: Schema.Json, f: (schema: Schema.JsonObject) => Schema.JsonObject) => Schema.Json;
|
|
11
|
+
/** Whether `schema` is a `{ type: 'null' }` member carrying the omitted-null marker. */
|
|
12
|
+
declare const isToolJsonSchemaOmittedNull: (schema: Schema.JsonObject) => boolean;
|
|
13
|
+
/** The schema as providers that do not use the omitted-null marker must receive it: the exact
|
|
14
|
+
* marker `$comment` is removed from `{ type: 'null' }` members in schema positions, nothing else.
|
|
15
|
+
* Without a marker the same value is returned, so the request body is unchanged.
|
|
16
|
+
*/
|
|
17
|
+
declare const withoutToolJsonSchemaOmittedNullMarker: (schema: Schema.Json) => Schema.Json;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { isJsonObjectValue, isToolJsonSchemaOmittedNull, mapToolJsonSchemaObjects, withoutToolJsonSchemaOmittedNullMarker };
|
|
20
|
+
//# sourceMappingURL=tool-json-schema-marker.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-json-schema-marker.d.mts","names":[],"sources":["../../src/protocol/tool-json-schema-marker.ts"],"mappings":";;;;cAyBa,iBAAA,GAAqB,KAAA,EAAO,MAAA,CAAO,IAAA,KAAO,KAAA,IAAS,MAAA,CAAO,UACZ;AAD3D;;;;AAAA,cAiCa,wBAAA,GACX,MAAA,EAAQ,MAAA,CAAO,IAAA,EACf,CAAA,GAAI,MAAA,EAAQ,MAAA,CAAO,UAAA,KAAe,MAAA,CAAO,UAAA,KACxC,MAAA,CAAO,IAAA;;cAqBG,2BAAA,GAA+B,MAAA,EAAQ,MAAA,CAAO,UAAU;;;;;cAexD,sCAAA,GAA0C,MAAA,EAAQ,MAAA,CAAO,IAAA,KAAO,MAAA,CAAO,IACnC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import "./tool.mjs";
|
|
2
|
+
import { Predicate } from "effect";
|
|
3
|
+
//#region src/protocol/tool-json-schema-marker.ts
|
|
4
|
+
const dataKeywords = new Set([
|
|
5
|
+
"const",
|
|
6
|
+
"default",
|
|
7
|
+
"enum",
|
|
8
|
+
"examples"
|
|
9
|
+
]);
|
|
10
|
+
const schemaMapKeywords = new Set([
|
|
11
|
+
"properties",
|
|
12
|
+
"patternProperties",
|
|
13
|
+
"$defs",
|
|
14
|
+
"definitions",
|
|
15
|
+
"dependentSchemas",
|
|
16
|
+
"dependencies"
|
|
17
|
+
]);
|
|
18
|
+
/** Whether a JSON value is a JSON object (not an array or a primitive). */
|
|
19
|
+
const isJsonObjectValue = (value) => Predicate.isObjectOrArray(value) && !Array.isArray(value);
|
|
20
|
+
const mapEntries = (object, f) => {
|
|
21
|
+
let changed = false;
|
|
22
|
+
const entries = Object.entries(object).map(([key, value]) => {
|
|
23
|
+
const next = f(key, value);
|
|
24
|
+
changed ||= next !== value;
|
|
25
|
+
return [key, next];
|
|
26
|
+
});
|
|
27
|
+
return changed ? Object.fromEntries(entries) : object;
|
|
28
|
+
};
|
|
29
|
+
const mapArray = (items, f) => {
|
|
30
|
+
const next = items.map(f);
|
|
31
|
+
return next.some((item, index) => item !== items[index]) ? next : items;
|
|
32
|
+
};
|
|
33
|
+
/** Rebuilds a JSON Schema with `f` applied to every schema object, children first, following
|
|
34
|
+
* schema positions only (literal data under `const`/`default`/`enum`/`examples` is untouched).
|
|
35
|
+
* Unchanged subtrees keep their identity, so a schema without matches is returned as is.
|
|
36
|
+
*/
|
|
37
|
+
const mapToolJsonSchemaObjects = (schema, f) => {
|
|
38
|
+
if (Array.isArray(schema)) return mapArray(schema, (item) => mapToolJsonSchemaObjects(item, f));
|
|
39
|
+
if (!isJsonObjectValue(schema)) return schema;
|
|
40
|
+
return f(mapEntries(schema, (key, value) => {
|
|
41
|
+
if (dataKeywords.has(key)) return value;
|
|
42
|
+
if (schemaMapKeywords.has(key) && isJsonObjectValue(value)) return mapEntries(value, (_, child) => mapToolJsonSchemaObjects(child, f));
|
|
43
|
+
return mapToolJsonSchemaObjects(value, f);
|
|
44
|
+
}));
|
|
45
|
+
};
|
|
46
|
+
/** Whether `schema` is a `{ type: 'null' }` member carrying the omitted-null marker. */
|
|
47
|
+
const isToolJsonSchemaOmittedNull = (schema) => Object.hasOwn(schema, "type") && schema["type"] === "null" && Object.hasOwn(schema, "$comment") && schema["$comment"] === "yolk:null-means-omitted";
|
|
48
|
+
const withoutMarker = (schema) => isToolJsonSchemaOmittedNull(schema) ? Object.fromEntries(Object.entries(schema).filter(([key]) => key !== "$comment")) : schema;
|
|
49
|
+
/** The schema as providers that do not use the omitted-null marker must receive it: the exact
|
|
50
|
+
* marker `$comment` is removed from `{ type: 'null' }` members in schema positions, nothing else.
|
|
51
|
+
* Without a marker the same value is returned, so the request body is unchanged.
|
|
52
|
+
*/
|
|
53
|
+
const withoutToolJsonSchemaOmittedNullMarker = (schema) => mapToolJsonSchemaObjects(schema, withoutMarker);
|
|
54
|
+
//#endregion
|
|
55
|
+
export { isJsonObjectValue, isToolJsonSchemaOmittedNull, mapToolJsonSchemaObjects, withoutToolJsonSchemaOmittedNullMarker };
|
|
56
|
+
|
|
57
|
+
//# sourceMappingURL=tool-json-schema-marker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-json-schema-marker.mjs","names":[],"sources":["../../src/protocol/tool-json-schema-marker.ts"],"sourcesContent":["import type * as Schema from 'effect/Schema'\nimport { Predicate } from 'effect'\nimport { toolJsonSchemaOmittedNullComment } from './tool.ts'\n\n// Internal helpers for the omitted-null marker (`toolJsonSchemaOmittedNullComment`). Lowering\n// (`tools/omitted-null.ts`) adds it, Claude compatibility consumes it, and every other provider\n// adapter removes it with `withoutToolJsonSchemaOmittedNullMarker` before sending a schema.\n\n// Values under these keywords are literal data, never schemas.\nconst dataKeywords = new Set(['const', 'default', 'enum', 'examples'])\n\n// Values under these keywords are maps from names (or patterns) to schemas. Their entries are\n// named by the schema author, so a name such as `enum` or `default` is never read as a keyword.\n// Legacy `dependencies` entries are schemas or property-name arrays; arrays of strings pass\n// through unchanged.\nconst schemaMapKeywords = new Set([\n 'properties',\n 'patternProperties',\n '$defs',\n 'definitions',\n 'dependentSchemas',\n 'dependencies'\n])\n\n/** Whether a JSON value is a JSON object (not an array or a primitive). */\nexport const isJsonObjectValue = (value: Schema.Json): value is Schema.JsonObject =>\n Predicate.isObjectOrArray(value) && !Array.isArray(value)\n\nconst mapEntries = (\n object: Schema.JsonObject,\n f: (key: string, value: Schema.Json) => Schema.Json\n): Schema.JsonObject => {\n let changed = false\n\n const entries = Object.entries(object).map(([key, value]): [string, Schema.Json] => {\n const next = f(key, value)\n\n changed ||= next !== value\n\n return [key, next]\n })\n\n return changed ? Object.fromEntries(entries) : object\n}\n\nconst mapArray = (\n items: ReadonlyArray<Schema.Json>,\n f: (value: Schema.Json) => Schema.Json\n): ReadonlyArray<Schema.Json> => {\n const next = items.map(f)\n\n return next.some((item, index) => item !== items[index]) ? next : items\n}\n\n/** Rebuilds a JSON Schema with `f` applied to every schema object, children first, following\n * schema positions only (literal data under `const`/`default`/`enum`/`examples` is untouched).\n * Unchanged subtrees keep their identity, so a schema without matches is returned as is.\n */\nexport const mapToolJsonSchemaObjects = (\n schema: Schema.Json,\n f: (schema: Schema.JsonObject) => Schema.JsonObject\n): Schema.Json => {\n if (Array.isArray(schema)) {\n return mapArray(schema, item => mapToolJsonSchemaObjects(item, f))\n }\n\n if (!isJsonObjectValue(schema)) return schema\n\n const children = mapEntries(schema, (key, value) => {\n if (dataKeywords.has(key)) return value\n\n if (schemaMapKeywords.has(key) && isJsonObjectValue(value)) {\n return mapEntries(value, (_, child) => mapToolJsonSchemaObjects(child, f))\n }\n\n return mapToolJsonSchemaObjects(value, f)\n })\n\n return f(children)\n}\n\n/** Whether `schema` is a `{ type: 'null' }` member carrying the omitted-null marker. */\nexport const isToolJsonSchemaOmittedNull = (schema: Schema.JsonObject): boolean =>\n Object.hasOwn(schema, 'type') &&\n schema['type'] === 'null' &&\n Object.hasOwn(schema, '$comment') &&\n schema['$comment'] === toolJsonSchemaOmittedNullComment\n\nconst withoutMarker = (schema: Schema.JsonObject): Schema.JsonObject =>\n isToolJsonSchemaOmittedNull(schema)\n ? Object.fromEntries(Object.entries(schema).filter(([key]) => key !== '$comment'))\n : schema\n\n/** The schema as providers that do not use the omitted-null marker must receive it: the exact\n * marker `$comment` is removed from `{ type: 'null' }` members in schema positions, nothing else.\n * Without a marker the same value is returned, so the request body is unchanged.\n */\nexport const withoutToolJsonSchemaOmittedNullMarker = (schema: Schema.Json): Schema.Json =>\n mapToolJsonSchemaObjects(schema, withoutMarker)\n"],"mappings":";;;AASA,MAAM,eAAe,IAAI,IAAI;CAAC;CAAS;CAAW;CAAQ;AAAU,CAAC;AAMrE,MAAM,oBAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,MAAa,qBAAqB,UAChC,UAAU,gBAAgB,KAAK,KAAK,CAAC,MAAM,QAAQ,KAAK;AAE1D,MAAM,cACJ,QACA,MACsB;CACtB,IAAI,UAAU;CAEd,MAAM,UAAU,OAAO,QAAQ,MAAM,EAAE,KAAK,CAAC,KAAK,WAAkC;EAClF,MAAM,OAAO,EAAE,KAAK,KAAK;EAEzB,YAAY,SAAS;EAErB,OAAO,CAAC,KAAK,IAAI;CACnB,CAAC;CAED,OAAO,UAAU,OAAO,YAAY,OAAO,IAAI;AACjD;AAEA,MAAM,YACJ,OACA,MAC+B;CAC/B,MAAM,OAAO,MAAM,IAAI,CAAC;CAExB,OAAO,KAAK,MAAM,MAAM,UAAU,SAAS,MAAM,MAAM,IAAI,OAAO;AACpE;;;;;AAMA,MAAa,4BACX,QACA,MACgB;CAChB,IAAI,MAAM,QAAQ,MAAM,GACtB,OAAO,SAAS,SAAQ,SAAQ,yBAAyB,MAAM,CAAC,CAAC;CAGnE,IAAI,CAAC,kBAAkB,MAAM,GAAG,OAAO;CAYvC,OAAO,EAVU,WAAW,SAAS,KAAK,UAAU;EAClD,IAAI,aAAa,IAAI,GAAG,GAAG,OAAO;EAElC,IAAI,kBAAkB,IAAI,GAAG,KAAK,kBAAkB,KAAK,GACvD,OAAO,WAAW,QAAQ,GAAG,UAAU,yBAAyB,OAAO,CAAC,CAAC;EAG3E,OAAO,yBAAyB,OAAO,CAAC;CAC1C,CAEgB,CAAC;AACnB;;AAGA,MAAa,+BAA+B,WAC1C,OAAO,OAAO,QAAQ,MAAM,KAC5B,OAAO,YAAY,UACnB,OAAO,OAAO,QAAQ,UAAU,KAChC,OAAO,gBAAA;AAET,MAAM,iBAAiB,WACrB,4BAA4B,MAAM,IAC9B,OAAO,YAAY,OAAO,QAAQ,MAAM,EAAE,QAAQ,CAAC,SAAS,QAAQ,UAAU,CAAC,IAC/E;;;;;AAMN,MAAa,0CAA0C,WACrD,yBAAyB,QAAQ,aAAa"}
|
package/dist/protocol/tool.d.mts
CHANGED
|
@@ -21,6 +21,16 @@ type ToolJsonSchema = typeof ToolJsonSchema.Type;
|
|
|
21
21
|
declare const decodeToolJsonSchema: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Option").Option<boolean | Schema$1.JsonObject>;
|
|
22
22
|
declare const decodeToolJsonSchemaObject: (input: unknown, options?: import("effect/SchemaAST").ParseOptions) => import("effect/Option").Option<Schema$1.JsonObject>;
|
|
23
23
|
declare const isToolJsonSchemaObject: (schema: ToolJsonSchema) => schema is ToolJsonSchemaObject;
|
|
24
|
+
/** `$comment` on the `{ type: 'null' }` member `makeTool`/`toolJsonSchemaFromSchema` advertise for
|
|
25
|
+
* `Schema.optional(X)` (and any other `undefined` the JSON codec encodes as `null`): that `null`
|
|
26
|
+
* decodes as `undefined` ("not sent"). `Schema.NullOr` nulls and third-party raw/MCP schemas do not
|
|
27
|
+
* carry it; tools listed by the `@yolk-sdk/mcp` server do, since they advertise
|
|
28
|
+
* `ToolDef.parameters` and decode through the same codec. A stable wire contract (persisted
|
|
29
|
+
* definitions, MCP listings): the value never changes. `$comment` is a standard annotation keyword
|
|
30
|
+
* that validators ignore. Claude compatibility uses it to show such optional properties as their
|
|
31
|
+
* type; the other provider adapters remove it before sending a schema.
|
|
32
|
+
*/
|
|
33
|
+
declare const toolJsonSchemaOmittedNullComment = "yolk:null-means-omitted";
|
|
24
34
|
declare const HitlResponseSource: Schema$1.Literals<readonly ["user", "policy", "replay"]>;
|
|
25
35
|
type HitlResponseSource = typeof HitlResponseSource.Type;
|
|
26
36
|
declare const ToolApprovalDecision: Schema$1.Literals<readonly ["approved", "denied"]>;
|
|
@@ -1053,5 +1063,5 @@ declare const isDeferredTool: (def: ToolDef) => boolean;
|
|
|
1053
1063
|
/** Effective discovery of a `codemode`-only tool (`listed` by default); undefined otherwise. */
|
|
1054
1064
|
declare const toolDiscovery: (def: ToolDef) => ToolDiscovery | undefined;
|
|
1055
1065
|
//#endregion
|
|
1056
|
-
export { BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, ErrorToolResultInput, HitlRequest, HitlResponse, HitlResponseSource, InputContentFormatter, InputDescriptor, InputRequest, InputResponse, InputResponseOutcome, InputResponseStructuredContent, InputResponseValidator, InputToolHandler, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCallValidator, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHost, InteractionHostError, InteractionOutcome, InteractionPreflight, InteractionReceipt, InteractionReceiptStatus, InteractionRef, InteractionRequest, InteractionResponse, InteractionResponseOutcome, InteractionResponseStructuredContent, InteractionResponseValidator, InteractionValidationError, PlainHitlResponse, PlainInputResponse, PlainInteractionResponse, PlainQuestionAnswer, PlainQuestionResponse, PlainToolApprovalResponse, QuestionAnswer, QuestionOption, QuestionPrompt, QuestionRequest, QuestionResponse, QuestionResponseOutcome, QuestionResponseStructuredContent, QuestionToolParams, ToolApprovalDecision, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalResponse, ToolCall, ToolCallableBy, ToolDef, ToolDiscovery, ToolExposure, ToolJsonSchema, ToolJsonSchemaObject, ToolLoading, ToolResult, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isCodeModeCallable, isCodeModeFailClosed, isDeferredTool, isProviderToolDef, isToolJsonSchemaObject, isToolStageable, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, providerToolDefs, questionResponseStructuredContent, questionToolName, sameInteractionBinding, sameInteractionCall, subagentToolName, toolDiscovery, validInteractionReceipt, validateInteractionSubmission };
|
|
1066
|
+
export { BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, ErrorToolResultInput, HitlRequest, HitlResponse, HitlResponseSource, InputContentFormatter, InputDescriptor, InputRequest, InputResponse, InputResponseOutcome, InputResponseStructuredContent, InputResponseValidator, InputToolHandler, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCallValidator, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHost, InteractionHostError, InteractionOutcome, InteractionPreflight, InteractionReceipt, InteractionReceiptStatus, InteractionRef, InteractionRequest, InteractionResponse, InteractionResponseOutcome, InteractionResponseStructuredContent, InteractionResponseValidator, InteractionValidationError, PlainHitlResponse, PlainInputResponse, PlainInteractionResponse, PlainQuestionAnswer, PlainQuestionResponse, PlainToolApprovalResponse, QuestionAnswer, QuestionOption, QuestionPrompt, QuestionRequest, QuestionResponse, QuestionResponseOutcome, QuestionResponseStructuredContent, QuestionToolParams, ToolApprovalDecision, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalResponse, ToolCall, ToolCallableBy, ToolDef, ToolDiscovery, ToolExposure, ToolJsonSchema, ToolJsonSchemaObject, ToolLoading, ToolResult, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isCodeModeCallable, isCodeModeFailClosed, isDeferredTool, isProviderToolDef, isToolJsonSchemaObject, isToolStageable, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, providerToolDefs, questionResponseStructuredContent, questionToolName, sameInteractionBinding, sameInteractionCall, subagentToolName, toolDiscovery, toolJsonSchemaOmittedNullComment, validInteractionReceipt, validateInteractionSubmission };
|
|
1057
1067
|
//# sourceMappingURL=tool.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool.d.mts","names":[],"sources":["../../src/protocol/tool.ts"],"mappings":";;;;;;;;;;AAoJA;;;cAAa,oBAAA,EAAoB,QAAA,CAAA,kBAAA,CAAA,QAAA,CAAA,UAAA,EAAA,QAAA,CAAA,UAAA,eAAA,QAAA,CAAA,UAAA;AAAA,KAmBrB,oBAAA,UAA8B,oBAAA,CAAqB,IAAI;;;;cAKtD,cAAA,EAAc,QAAA,CAAA,kBAAA,WAAA,QAAA,CAAA,UAAA,YAAA,QAAA,CAAA,UAAA,yBAAA,QAAA,CAAA,UAAA;AAAA,KAaf,cAAA,UAAwB,cAAA,CAAe,IAAI;AAAA,cAE1C,oBAAA,GAAoB,KAAA,WAAA,OAAA,8BAAA,YAAA,6BAAA,MAAA,WAAA,QAAA,CAAA,UAAA;AAAA,cAEpB,0BAAA,GAA0B,KAAA,WAAA,OAAA,8BAAA,YAAA,6BAAA,MAAA,CAAA,QAAA,CAAA,UAAA;AAAA,cAE1B,sBAAA,GAA0B,MAAA,EAAQ,cAAA,KAAiB,MAAA,IAAU,oBAC5C;AAAA,cAEjB,kBAAA,EAAkB,QAAA,CAAA,QAAA;AAAA,KAEnB,kBAAA,UAA4B,kBAAA,CAAmB,IAAI;AAAA,cAElD,oBAAA,EAAoB,QAAA,CAAA,QAAA;AAAA,KAErB,oBAAA,UAA8B,oBAAA,CAAqB,IAAI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AA;AAAA,cAGnE,+BAAA;;;;;;;;cAUA,yBAAA,GAA6B,KAAA;EAAA,SAC/B,UAAA;EAAA,SACA,SAAA;EAAA,SACA,IAAA;EAAA,SACA,YAAA;EAAA,SACA,QAAA;EAAA,SACA,OAAA,EAAS,0BAAA;EAAA,SACT,OAAA,EAAS,OAAA;EAAA,SACT,iBAAA;AAAA,MACP,UAAA;AAAA,cAwDS,gBAAA;AAAA,cAEA,gBAAA;;;;cAKA,oBAAA,GAAwB,GAAY,EAAP,OAAO;;;;cAWpC,kBAAA,GAAsB,GAAY,EAAP,OAAO;;;;;cAOlC,eAAA,GAAmB,GAAY,EAAP,OAAO;;cAY/B,iBAAA,GAAqB,GAAY,EAAP,OAAO;;cAGjC,gBAAA,GAAoB,KAAA,EAAO,aAAA,CAAc,OAAA,MAAW,aAAA,CAAc,OAAA;;cAIlE,cAAA,GAAkB,GAAY,EAAP,OAAO;;cAI9B,aAAA,GAAiB,GAAA,EAAK,OAAA,KAAU,aAAa"}
|
package/dist/protocol/tool.mjs
CHANGED
|
@@ -81,6 +81,16 @@ const ToolJsonSchema = Schema$1.declareConstructor()([], () => (input) => Predic
|
|
|
81
81
|
const decodeToolJsonSchema = Schema$1.decodeUnknownOption(ToolJsonSchema);
|
|
82
82
|
const decodeToolJsonSchemaObject = Schema$1.decodeUnknownOption(ToolJsonSchemaObject);
|
|
83
83
|
const isToolJsonSchemaObject = (schema) => !Predicate.isBoolean(schema);
|
|
84
|
+
/** `$comment` on the `{ type: 'null' }` member `makeTool`/`toolJsonSchemaFromSchema` advertise for
|
|
85
|
+
* `Schema.optional(X)` (and any other `undefined` the JSON codec encodes as `null`): that `null`
|
|
86
|
+
* decodes as `undefined` ("not sent"). `Schema.NullOr` nulls and third-party raw/MCP schemas do not
|
|
87
|
+
* carry it; tools listed by the `@yolk-sdk/mcp` server do, since they advertise
|
|
88
|
+
* `ToolDef.parameters` and decode through the same codec. A stable wire contract (persisted
|
|
89
|
+
* definitions, MCP listings): the value never changes. `$comment` is a standard annotation keyword
|
|
90
|
+
* that validators ignore. Claude compatibility uses it to show such optional properties as their
|
|
91
|
+
* type; the other provider adapters remove it before sending a schema.
|
|
92
|
+
*/
|
|
93
|
+
const toolJsonSchemaOmittedNullComment = "yolk:null-means-omitted";
|
|
84
94
|
const HitlResponseSource = Schema$1.Literals([
|
|
85
95
|
"user",
|
|
86
96
|
"policy",
|
|
@@ -689,6 +699,6 @@ const isDeferredTool = (def) => def.loading === "deferred" && def.callableBy !==
|
|
|
689
699
|
/** Effective discovery of a `codemode`-only tool (`listed` by default); undefined otherwise. */
|
|
690
700
|
const toolDiscovery = (def) => def.callableBy === "codemode" ? def.discovery ?? "listed" : void 0;
|
|
691
701
|
//#endregion
|
|
692
|
-
export { BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, HitlRequest, HitlResponse, HitlResponseSource, InputDescriptor, InputRequest, InputResponse, InputResponseOutcome, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHostError, InteractionReceipt, InteractionReceiptStatus, InteractionRequest, InteractionResponse, InteractionResponseOutcome, InteractionValidationError, PlainHitlResponse, QuestionAnswer, QuestionOption, QuestionPrompt, QuestionRequest, QuestionResponse, QuestionResponseOutcome, QuestionToolParams, ToolApprovalDecision, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalResponse, ToolCall, ToolCallableBy, ToolDef, ToolDiscovery, ToolJsonSchema, ToolJsonSchemaObject, ToolLoading, ToolResult, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isCodeModeCallable, isCodeModeFailClosed, isDeferredTool, isProviderToolDef, isToolJsonSchemaObject, isToolStageable, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, providerToolDefs, questionResponseStructuredContent, questionToolName, sameInteractionBinding, sameInteractionCall, subagentToolName, toolDiscovery, validInteractionReceipt, validateInteractionSubmission };
|
|
702
|
+
export { BackgroundToolAccepted, BackgroundToolExecution, BackgroundToolInput, HitlRequest, HitlResponse, HitlResponseSource, InputDescriptor, InputRequest, InputResponse, InputResponseOutcome, InteractionActionDescriptor, InteractionAdmissionError, InteractionBusinessOutcome, InteractionCandidate, InteractionClaim, InteractionDescriptor, InteractionHostError, InteractionReceipt, InteractionReceiptStatus, InteractionRequest, InteractionResponse, InteractionResponseOutcome, InteractionValidationError, PlainHitlResponse, QuestionAnswer, QuestionOption, QuestionPrompt, QuestionRequest, QuestionResponse, QuestionResponseOutcome, QuestionToolParams, ToolApprovalDecision, ToolApprovalMode, ToolApprovalPolicy, ToolApprovalRequest, ToolApprovalResponse, ToolCall, ToolCallableBy, ToolDef, ToolDiscovery, ToolJsonSchema, ToolJsonSchemaObject, ToolLoading, ToolResult, decodeBackgroundToolInput, decodeToolJsonSchema, decodeToolJsonSchemaObject, formatInputResponseContent, formatInteractionResponseContent, formatQuestionResponseContent, inputRequestId, inputResponseStructuredContent, interactionJsonEquals, interactionRequestId, interactionResponseStructuredContent, interactionUnknownOutcomeNotice, isCodeModeCallable, isCodeModeFailClosed, isDeferredTool, isProviderToolDef, isToolJsonSchemaObject, isToolStageable, makeBackgroundToolAcceptedResult, makeErrorToolResult, makeInteractionToolResult, plainHitlResponse, plainInputResponse, plainInteractionResponse, plainQuestionAnswer, plainQuestionResponse, plainToolApprovalResponse, providerToolDefs, questionResponseStructuredContent, questionToolName, sameInteractionBinding, sameInteractionCall, subagentToolName, toolDiscovery, toolJsonSchemaOmittedNullComment, validInteractionReceipt, validateInteractionSubmission };
|
|
693
703
|
|
|
694
704
|
//# sourceMappingURL=tool.mjs.map
|