@deepseek-ai/dsh-tmux-context 0.2.2-rc.5 → 0.2.3-alpha.2
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/lib/index.js +71 -68
- package/package.json +16 -15
package/lib/index.js
CHANGED
|
@@ -2,15 +2,39 @@ import { createRequire } from "node:module";
|
|
|
2
2
|
import z from "@deepseek-ai/schemastery";
|
|
3
3
|
import { z as z$1 } from "zod";
|
|
4
4
|
import { Context, Service } from "@deepseek-ai/cordis";
|
|
5
|
+
//#region ../../util/error/src/index.ts
|
|
6
|
+
/**
|
|
7
|
+
* Harness error base with a stable machine-routable code and chained cause.
|
|
8
|
+
* Package errors extend it so tool results and replay can retain failure class.
|
|
9
|
+
* @module @deepseek-ai/dsh-error
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Base class for all harness errors. Carries a `code` (stable, programmatic —
|
|
13
|
+
* e.g. `NO_ADAPTER`, `INVALID_ARGS`) distinct from the
|
|
14
|
+
* human-readable `message`, and supports `cause` chaining via the standard
|
|
15
|
+
* `ErrorOptions`. `name` defaults to the subclass constructor name.
|
|
16
|
+
*/
|
|
17
|
+
var HarnessError = class extends Error {
|
|
18
|
+
/** Stable machine-routable failure class (e.g. `RATE_LIMIT`); route on this, never by parsing `message`. */
|
|
19
|
+
code;
|
|
20
|
+
constructor(message, code, options) {
|
|
21
|
+
super(message, options);
|
|
22
|
+
this.code = code;
|
|
23
|
+
this.name = new.target.name;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
5
27
|
//#region ../../typert/protocol/src/remote-error.ts
|
|
28
|
+
/** The one Remote failure class shared by owners, the Gateway, and consumers. */
|
|
6
29
|
/**
|
|
7
|
-
* One Remote call failure: a
|
|
30
|
+
* One Remote call failure: a `HarnessError` carrying its stable code and typed
|
|
8
31
|
* details. Owners throw it at the failure point; the Host Gateway encodes it
|
|
9
32
|
* onto the wire unchanged; the Client face rebuilds an instance for the
|
|
10
33
|
* `RemoteResult` error branch, so `throw result.error` keeps throw semantics.
|
|
11
|
-
*
|
|
34
|
+
* A tool body that throws it records `name: 'RemoteError'` and its Remote code
|
|
35
|
+
* on `tool/result`. Discrimination is always by `code`, never by instanceof.
|
|
12
36
|
*/
|
|
13
|
-
var RemoteError = class extends
|
|
37
|
+
var RemoteError = class extends HarnessError {
|
|
14
38
|
code;
|
|
15
39
|
details;
|
|
16
40
|
/** Structural marker: cross-realm/bundle identification never uses instanceof. */
|
|
@@ -22,7 +46,7 @@ var RemoteError = class extends Error {
|
|
|
22
46
|
* @param options - standard Error options (`cause` survives in-process only).
|
|
23
47
|
*/
|
|
24
48
|
constructor(code, message, details, options) {
|
|
25
|
-
super(message, options);
|
|
49
|
+
super(message, code, options);
|
|
26
50
|
this.code = code;
|
|
27
51
|
this.details = details;
|
|
28
52
|
this.name = "RemoteError";
|
|
@@ -90,8 +114,8 @@ var TypertRemoteService = class extends Service {
|
|
|
90
114
|
* tree registers it on the root, where it outlives any one Service.
|
|
91
115
|
*/
|
|
92
116
|
function provideInvocationAccessor(ctx) {
|
|
93
|
-
if (Object.hasOwn(ctx.root.reflect.props, "invocation")) return;
|
|
94
|
-
ctx.root.accessor("invocation", { get: () => void 0 });
|
|
117
|
+
if (Object.hasOwn(ctx[Context.root].reflect.props, "invocation")) return;
|
|
118
|
+
ctx[Context.root].accessor("invocation", { get: () => void 0 });
|
|
95
119
|
}
|
|
96
120
|
function Remote(methodExportOrOptions, context) {
|
|
97
121
|
if (typeof methodExportOrOptions === "string") {
|
|
@@ -886,65 +910,6 @@ function brandString(value) {
|
|
|
886
910
|
return value;
|
|
887
911
|
}
|
|
888
912
|
//#endregion
|
|
889
|
-
//#region ../../llm/llm/src/message.ts
|
|
890
|
-
/** Message value types, identity, and immutable construction helpers. */
|
|
891
|
-
/**
|
|
892
|
-
* Detach and deep-freeze a message whose identity already exists.
|
|
893
|
-
* @param message - complete message, including its stable identity.
|
|
894
|
-
* @returns an immutable snapshot that preserves the identity.
|
|
895
|
-
*/
|
|
896
|
-
function freezeMessage(message) {
|
|
897
|
-
return deepFreeze(structuredClone(message));
|
|
898
|
-
}
|
|
899
|
-
/**
|
|
900
|
-
* Create one identified message and freeze it before publication.
|
|
901
|
-
* @param input - complete role, content, and source for a new message.
|
|
902
|
-
* @returns an immutable message with a fresh stable identity.
|
|
903
|
-
*/
|
|
904
|
-
function createMessage(input) {
|
|
905
|
-
return deepFreeze(structuredClone({
|
|
906
|
-
...input,
|
|
907
|
-
id: brandString(randomUUID())
|
|
908
|
-
}));
|
|
909
|
-
}
|
|
910
|
-
/**
|
|
911
|
-
* Create one identified user-role message and freeze it before publication.
|
|
912
|
-
* @param input - complete content and source for a new user message.
|
|
913
|
-
* @returns an immutable user message with a fresh stable identity.
|
|
914
|
-
*/
|
|
915
|
-
function createUserMessage(input) {
|
|
916
|
-
return createMessage({
|
|
917
|
-
...input,
|
|
918
|
-
role: "user"
|
|
919
|
-
});
|
|
920
|
-
}
|
|
921
|
-
//#endregion
|
|
922
|
-
//#region ../../util/timeout/src/index.ts
|
|
923
|
-
/** Largest delay Node schedules without clamping it to one millisecond. */
|
|
924
|
-
const MAX_TIMER_DELAY_MS = 2147483647;
|
|
925
|
-
//#endregion
|
|
926
|
-
//#region ../../util/error/src/index.ts
|
|
927
|
-
/**
|
|
928
|
-
* Harness error base with a stable machine-routable code and chained cause.
|
|
929
|
-
* Package errors extend it so tool results and replay can retain failure class.
|
|
930
|
-
* @module @deepseek-ai/dsh-error
|
|
931
|
-
*/
|
|
932
|
-
/**
|
|
933
|
-
* Base class for all harness errors. Carries a `code` (stable, programmatic —
|
|
934
|
-
* e.g. `NO_ADAPTER`, `INVALID_ARGS`) distinct from the
|
|
935
|
-
* human-readable `message`, and supports `cause` chaining via the standard
|
|
936
|
-
* `ErrorOptions`. `name` defaults to the subclass constructor name.
|
|
937
|
-
*/
|
|
938
|
-
var HarnessError = class extends Error {
|
|
939
|
-
/** Stable machine-routable failure class (e.g. `RATE_LIMIT`); route on this, never by parsing `message`. */
|
|
940
|
-
code;
|
|
941
|
-
constructor(message, code, options) {
|
|
942
|
-
super(message, options);
|
|
943
|
-
this.code = code;
|
|
944
|
-
this.name = new.target.name;
|
|
945
|
-
}
|
|
946
|
-
};
|
|
947
|
-
//#endregion
|
|
948
913
|
//#region ../../llm/llm/src/error.ts
|
|
949
914
|
/**
|
|
950
915
|
* LLM failure codes and helpers over the shared Harness error base. The base
|
|
@@ -1028,6 +993,43 @@ new RegExp(String.raw`(?:^|[^a-z0-9])context[\s_-](?:length|window)[\s_-]` + Str
|
|
|
1028
993
|
new RegExp(String.raw`\b(?:request|prompt|input|messages?)\s+(?:is\s+|are\s+)?` + String.raw`too\s+(?:large|long)\s+for\s+(?:(?:this|the)\s+)?` + String.raw`(?:model(?:'s)?\s+)?context(?:\s+window)?\b`, "i");
|
|
1029
994
|
new RegExp(String.raw`\b(?:input|prompt|request|messages?)\b.{0,40}` + String.raw`\b(?:exceed(?:s|ed)?|overflows?|is\s+larger\s+than)\b.{0,40}` + String.raw`\b(?:the\s+)?(?:model(?:'s)?\s+)?context(?:\s+(?:length|window))?\b`, "i");
|
|
1030
995
|
//#endregion
|
|
996
|
+
//#region ../../llm/llm/src/message.ts
|
|
997
|
+
/** Message value types, content text extraction, identity, and immutable construction helpers. */
|
|
998
|
+
/**
|
|
999
|
+
* Detach and deep-freeze a message whose identity already exists.
|
|
1000
|
+
* @param message - complete message, including its stable identity.
|
|
1001
|
+
* @returns an immutable snapshot that preserves the identity.
|
|
1002
|
+
*/
|
|
1003
|
+
function freezeMessage(message) {
|
|
1004
|
+
return deepFreeze(structuredClone(message));
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Create one identified message and freeze it before publication.
|
|
1008
|
+
* @param input - complete role, content, and source for a new message.
|
|
1009
|
+
* @returns an immutable message with a fresh stable identity.
|
|
1010
|
+
*/
|
|
1011
|
+
function createMessage(input) {
|
|
1012
|
+
return deepFreeze(structuredClone({
|
|
1013
|
+
...input,
|
|
1014
|
+
id: brandString(randomUUID())
|
|
1015
|
+
}));
|
|
1016
|
+
}
|
|
1017
|
+
/**
|
|
1018
|
+
* Create one identified user-role message and freeze it before publication.
|
|
1019
|
+
* @param input - complete content and source for a new user message.
|
|
1020
|
+
* @returns an immutable user message with a fresh stable identity.
|
|
1021
|
+
*/
|
|
1022
|
+
function createUserMessage(input) {
|
|
1023
|
+
return createMessage({
|
|
1024
|
+
...input,
|
|
1025
|
+
role: "user"
|
|
1026
|
+
});
|
|
1027
|
+
}
|
|
1028
|
+
//#endregion
|
|
1029
|
+
//#region ../../util/timeout/src/index.ts
|
|
1030
|
+
/** Largest delay Node schedules without clamping it to one millisecond. */
|
|
1031
|
+
const MAX_TIMER_DELAY_MS = 2147483647;
|
|
1032
|
+
//#endregion
|
|
1031
1033
|
//#region ../../llm/llm/src/retry-policy.ts
|
|
1032
1034
|
/**
|
|
1033
1035
|
* Provider-owned request-retry policy configuration and resolution.
|
|
@@ -1227,10 +1229,11 @@ function failureSnapshot(value) {
|
|
|
1227
1229
|
}
|
|
1228
1230
|
/** Read an SDK error message without letting an accessor replace the primary failure. */
|
|
1229
1231
|
function errorMessage(error) {
|
|
1232
|
+
let message;
|
|
1230
1233
|
try {
|
|
1231
|
-
|
|
1232
|
-
if (typeof message === "string" && message.length > 0) return message;
|
|
1234
|
+
message = error.message;
|
|
1233
1235
|
} catch (_sdkMessageGetter) {}
|
|
1236
|
+
if (typeof message === "string" && message.length > 0) return message;
|
|
1234
1237
|
return "LLM adapter failed";
|
|
1235
1238
|
}
|
|
1236
1239
|
/** Trust only Harness-owned codes; third-party SDK codes are not our taxonomy. */
|
|
@@ -1846,7 +1849,7 @@ var LlmError = class LlmError extends HarnessError {
|
|
|
1846
1849
|
* @param provider - registered provider route.
|
|
1847
1850
|
* @param model - exact model id.
|
|
1848
1851
|
* @param image - normalized image reference.
|
|
1849
|
-
* @returns dimensions and byte
|
|
1852
|
+
* @returns maximum dimensions and byte budgets used by the request serializer; readImageRequest returns the actual encoded dimensions.
|
|
1850
1853
|
*/
|
|
1851
1854
|
imageRequestTarget(provider, model, image) {
|
|
1852
1855
|
return this.registration(provider).adapter.imageRequestTarget(provider, model, image);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tmux-context",
|
|
3
3
|
"description": "Opt-in durable per-step context with this agent's tmux pane and window location",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.3-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,24 +32,25 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@deepseek-ai/schemastery": "~3.
|
|
35
|
+
"@deepseek-ai/schemastery": "~3.20.0-alpha.1",
|
|
36
36
|
"zod": "4.6.6"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@deepseek-ai/dsh-agent": "0.2.
|
|
40
|
-
"@deepseek-ai/dsh-shell": "0.2.
|
|
41
|
-
"@deepseek-ai/dsh-session": "0.2.
|
|
42
|
-
"@deepseek-ai/cordis": "~4.
|
|
43
|
-
"@deepseek-ai/dsh-session-projection": "0.2.
|
|
39
|
+
"@deepseek-ai/dsh-agent": "0.2.3-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-shell": "0.2.3-alpha.2",
|
|
41
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.2",
|
|
42
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.1",
|
|
43
|
+
"@deepseek-ai/dsh-session-projection": "0.2.3-alpha.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-agent
|
|
48
|
-
"@deepseek-ai/dsh-
|
|
49
|
-
"@deepseek-ai/dsh-
|
|
50
|
-
"@deepseek-ai/dsh-
|
|
51
|
-
"@deepseek-ai/dsh-
|
|
52
|
-
"@deepseek-ai/
|
|
53
|
-
"@deepseek-ai/
|
|
46
|
+
"@deepseek-ai/dsh-brand": "0.2.3-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-agent": "0.2.3-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.3-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-shell": "0.2.3-alpha.2",
|
|
50
|
+
"@deepseek-ai/dsh-llm": "0.2.3-alpha.2",
|
|
51
|
+
"@deepseek-ai/dsh-session": "0.2.3-alpha.2",
|
|
52
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.3-alpha.2",
|
|
53
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.1",
|
|
54
|
+
"@deepseek-ai/dsh-session-projection": "0.2.3-alpha.2"
|
|
54
55
|
}
|
|
55
56
|
}
|