@yanlinglabs/winter-agent-sdk 0.0.43 → 0.0.44
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/dist/index.d.ts +1 -1
- package/dist/index.js +6 -1
- package/dist/protocol/frames.d.ts +23 -1
- package/dist/query.d.ts +18 -0
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export { SDK_VERSION } from "./version.js";
|
|
|
30
30
|
export { MESSAGING_CONTROL_SUBTYPES, MESSAGING_CONTROL_SUBTYPE_LIST, MESSAGING_HOST_REQUEST_SUBTYPES, MESSAGING_RUNTIME_REQUEST_SUBTYPES, resolveFacetTarget } from "./protocol/messaging.js";
|
|
31
31
|
export { isRuntimeAddress, isGlobalAgentMessage, isDeliveryOutcome, isListedRuntimeObjectArray, isPermissionClassLabel, isMessagingDeliverRequest, isMessagingChildRequest, isMessagingSubscribeIdleRequest, isMessagingReadNotificationsRequest, isMessagingNotificationsPage, isMessagingIdleNoticePayload, isNotificationRecord, } from "./protocol/messaging.js";
|
|
32
32
|
export type { MessagingControlSubtype, MessagingDeliverRequest, MessagingChildRequest, MessagingSubscribeIdleRequest, MessagingSenderClassResponse, MessagingReadNotificationsRequest, MessagingNotificationsPage, MessagingIdleNoticePayload, } from "./protocol/messaging.js";
|
|
33
|
-
export type { ProtocolVersion, WinterFrame, SdkMessage as ProtocolSdkMessage, InitFrame, UserFrame, DataFrame, ControlRequestFrame, ControlResponseFrame, ControlCancelRequestFrame, WireResultUsage, UnknownFrame, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKPermissionDeniedMessage, SDKPermissionDenial, SDKTaskStartedMessage, SDKTaskNotificationMessage, SDKTaskUpdatedMessage, SDKTaskProgressMessage, SDKBackgroundTasksChangedMessage, SDKLocalCommandOutputMessage, BackgroundTaskMessage, SDKCompactBoundaryMessage, SDKSessionStateChangedMessage, SDKInformationalMessage, WireContentBlock, WireStreamEvent, WireStreamEventDelta, SDKPartialAssistantMessage, SDKAssistantMessageError, SDKAPIRetryMessage, SDKRateLimitEvent, SDKRateLimitInfo, SDKAuthStatusMessage, SDKThinkingTokensMessage, SDKModelRefusalFallbackMessage, SDKModelRefusalNoFallbackMessage, SDKReasoningSummaryMessage, SDKModelSwitchMessage, SDKContinuityWarningMessage, } from "./protocol/frames.js";
|
|
33
|
+
export type { ProtocolVersion, WinterFrame, SdkMessage as ProtocolSdkMessage, InitFrame, UserFrame, DataFrame, ControlRequestFrame, ControlResponseFrame, ControlCancelRequestFrame, WireResultUsage, UnknownFrame, SDKHookStartedMessage, SDKHookProgressMessage, SDKHookResponseMessage, SDKPermissionDeniedMessage, SDKPermissionDenial, SDKTaskStartedMessage, SDKTaskNotificationMessage, SDKTaskUpdatedMessage, SDKTaskProgressMessage, SDKBackgroundTasksChangedMessage, SDKLocalCommandOutputMessage, BackgroundTaskMessage, SDKCompactBoundaryMessage, SDKSessionStateChangedMessage, SDKInformationalMessage, SDKHostInputFoldedMessage, WireContentBlock, WireStreamEvent, WireStreamEventDelta, SDKPartialAssistantMessage, SDKAssistantMessageError, SDKAPIRetryMessage, SDKRateLimitEvent, SDKRateLimitInfo, SDKAuthStatusMessage, SDKThinkingTokensMessage, SDKModelRefusalFallbackMessage, SDKModelRefusalNoFallbackMessage, SDKReasoningSummaryMessage, SDKModelSwitchMessage, SDKContinuityWarningMessage, } from "./protocol/frames.js";
|
|
34
34
|
export { resolveWinterHome, resolveKeychainServiceForProfile, isUnset } from "./paths/home.js";
|
|
35
35
|
export { transcriptProjectKey, TRANSCRIPT_PROJECT_KEY_MAX_LENGTH, isVendorCompliantProjectKey } from "./paths/project-key.js";
|
|
36
36
|
export { compatibilityKeys } from "./paths/keys.js";
|
package/dist/index.js
CHANGED
|
@@ -1146,6 +1146,11 @@ function query(args) {
|
|
|
1146
1146
|
gen.reconnectMcpServer = async (serverName) => {
|
|
1147
1147
|
await sendControlRequest("mcp_reconnect", { serverName });
|
|
1148
1148
|
};
|
|
1149
|
+
gen.clearQueuedInput = async () => {
|
|
1150
|
+
const payload = await sendControlRequest("clear_queued_input", undefined);
|
|
1151
|
+
const cleared = typeof payload === "object" && payload !== null ? payload.cleared : undefined;
|
|
1152
|
+
return { cleared: typeof cleared === "number" ? cleared : 0 };
|
|
1153
|
+
};
|
|
1149
1154
|
gen.supportedModels = async () => {
|
|
1150
1155
|
const payload = await sendControlRequest("list_models", undefined);
|
|
1151
1156
|
return Array.isArray(payload) ? payload : [];
|
|
@@ -1271,7 +1276,7 @@ function withTestKeychainRedirect(env) {
|
|
|
1271
1276
|
return { ...env, [TEST_KEYCHAIN_ENV]: redirect };
|
|
1272
1277
|
}
|
|
1273
1278
|
// src/version.ts
|
|
1274
|
-
var SDK_VERSION = "0.0.
|
|
1279
|
+
var SDK_VERSION = "0.0.44";
|
|
1275
1280
|
// src/paths/project-key.ts
|
|
1276
1281
|
var TRANSCRIPT_PROJECT_KEY_MAX_LENGTH = 64;
|
|
1277
1282
|
var VENDOR_PROJECT_KEY_PATTERN = /^[A-Za-z0-9_-]{1,64}$/;
|
|
@@ -637,6 +637,28 @@ export interface SDKSessionStateChangedMessage {
|
|
|
637
637
|
session_id: string;
|
|
638
638
|
[k: string]: unknown;
|
|
639
639
|
}
|
|
640
|
+
/**
|
|
641
|
+
* WINTER-ONLY: host input was FOLDED into the running turn.
|
|
642
|
+
*
|
|
643
|
+
* A `user` input the host sends while a turn is running waits; once a tool round has ended, just
|
|
644
|
+
* before the next request, the runtime hands it to the model inside that same turn (after the round's
|
|
645
|
+
* tool results), as claude does with a message typed while it works. This frame goes out once the
|
|
646
|
+
* folded inputs are persisted, before the next request's frames. An interrupt (or another stop) that
|
|
647
|
+
* lands before the fold leaves the inputs pending; they then run as their own turns.
|
|
648
|
+
*
|
|
649
|
+
* THE CONTRACT: `count` of the host's EARLIEST sent inputs that had not yet started a turn were absorbed
|
|
650
|
+
* into the running turn, and none of them will ever produce a `result` of its own -- the running turn's
|
|
651
|
+
* one `result` covers them. An input still waiting when a turn ends is not folded: it starts its own
|
|
652
|
+
* turn, with its own `result`, in the order sent. Only the top-level session folds; a subagent never
|
|
653
|
+
* does. `Query.clearQueuedInput()` drops the inputs still waiting.
|
|
654
|
+
*/
|
|
655
|
+
export interface SDKHostInputFoldedMessage {
|
|
656
|
+
type: "system";
|
|
657
|
+
subtype: "host_input_folded";
|
|
658
|
+
count: number;
|
|
659
|
+
uuid: string;
|
|
660
|
+
session_id: string;
|
|
661
|
+
}
|
|
640
662
|
/**
|
|
641
663
|
* WS-23: claude 2.1.282's `SDKInformationalMessage` -- "generic text banner emitted by the loop --
|
|
642
664
|
* non-error status lines, hook feedback (e.g. a UserPromptSubmit hook's block reason)". Winter had no
|
|
@@ -678,7 +700,7 @@ export type SdkMessage = {
|
|
|
678
700
|
*/
|
|
679
701
|
agents?: string[];
|
|
680
702
|
[k: string]: unknown;
|
|
681
|
-
} | SDKHookStartedMessage | SDKHookProgressMessage | SDKHookResponseMessage | SDKPermissionDeniedMessage | SDKStatusMessage | SDKCompactBoundaryMessage | SDKSessionStateChangedMessage | SDKInformationalMessage | BackgroundTaskMessage | SDKPartialAssistantMessage | SDKAPIRetryMessage | SDKRateLimitEvent | SDKAuthStatusMessage | SDKThinkingTokensMessage | SDKModelRefusalFallbackMessage | SDKModelRefusalNoFallbackMessage | SDKReasoningSummaryMessage | SDKModelSwitchMessage | SDKContinuityWarningMessage | {
|
|
703
|
+
} | SDKHookStartedMessage | SDKHookProgressMessage | SDKHookResponseMessage | SDKPermissionDeniedMessage | SDKStatusMessage | SDKCompactBoundaryMessage | SDKSessionStateChangedMessage | SDKInformationalMessage | SDKHostInputFoldedMessage | BackgroundTaskMessage | SDKPartialAssistantMessage | SDKAPIRetryMessage | SDKRateLimitEvent | SDKAuthStatusMessage | SDKThinkingTokensMessage | SDKModelRefusalFallbackMessage | SDKModelRefusalNoFallbackMessage | SDKReasoningSummaryMessage | SDKModelSwitchMessage | SDKContinuityWarningMessage | {
|
|
682
704
|
type: "assistant";
|
|
683
705
|
message: {
|
|
684
706
|
content: Array<{
|
package/dist/query.d.ts
CHANGED
|
@@ -159,6 +159,24 @@ export interface Query extends AsyncGenerator<SdkMessage> {
|
|
|
159
159
|
* type-checking); every `Query` this package returns has it.
|
|
160
160
|
*/
|
|
161
161
|
reconnectMcpServer?(serverName: string): Promise<void>;
|
|
162
|
+
/**
|
|
163
|
+
* WINTER-ONLY, additive: drop every input this query sent that is still WAITING -- it has neither
|
|
164
|
+
* started a turn nor been folded into the running one (`system/host_input_folded`) -- and resolve with
|
|
165
|
+
* how many were dropped. A dropped input never runs and never gets a `result`. Nothing else changes:
|
|
166
|
+
* the running turn keeps running, and queued task notifications stay queued. An item the prompt
|
|
167
|
+
* iterable has not yielded yet has not been sent, so it is not touched.
|
|
168
|
+
*
|
|
169
|
+
* Rides Winter's own `clear_queued_input` control subtype. claude can cancel one queued input by id;
|
|
170
|
+
* this clears them all. A runtime older than this control answers `unknown_subtype`, and the promise
|
|
171
|
+
* REJECTS with a `WinterRpcError` carrying that code -- a host that may drive an older runtime must
|
|
172
|
+
* catch it (nothing was cleared).
|
|
173
|
+
*
|
|
174
|
+
* OPTIONAL on the interface for the same reason as `compact` (a host's structural `Query` doubles keep
|
|
175
|
+
* type-checking); every `Query` this package returns has it.
|
|
176
|
+
*/
|
|
177
|
+
clearQueuedInput?(): Promise<{
|
|
178
|
+
cleared: number;
|
|
179
|
+
}>;
|
|
162
180
|
/**
|
|
163
181
|
* Phase 6 Task 10 (derived-shapes-p6 item (d), `sdk.d.ts:2566`): the models this session may select.
|
|
164
182
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yanlinglabs/winter-agent-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@yanlinglabs/winter-provider-catalog": "0.0.
|
|
48
|
+
"@yanlinglabs/winter-provider-catalog": "0.0.44"
|
|
49
49
|
},
|
|
50
50
|
"optionalDependencies": {
|
|
51
|
-
"@yanlinglabs/winter-agent-sdk-darwin-arm64": "0.0.
|
|
51
|
+
"@yanlinglabs/winter-agent-sdk-darwin-arm64": "0.0.44"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/node": "^26.4.0",
|
|
55
|
-
"@yanlinglabs/winter-agent-runtime": "0.0.
|
|
56
|
-
"@yanlinglabs/winter-conformance": "0.0.
|
|
55
|
+
"@yanlinglabs/winter-agent-runtime": "0.0.44",
|
|
56
|
+
"@yanlinglabs/winter-conformance": "0.0.44"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {}
|
|
59
59
|
}
|