@dsh-cc/tools 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.i18n.yaml +6 -0
- package/README.md +209 -0
- package/README.zh.md +200 -0
- package/lib/abort-utils.d.ts +80 -0
- package/lib/abort-utils.d.ts.map +1 -0
- package/lib/abort-utils.js +186 -0
- package/lib/abort-utils.js.map +1 -0
- package/lib/cc-names.d.ts +100 -0
- package/lib/cc-names.d.ts.map +1 -0
- package/lib/cc-names.js +197 -0
- package/lib/cc-names.js.map +1 -0
- package/lib/code-mode.d.ts +46 -0
- package/lib/code-mode.d.ts.map +1 -0
- package/lib/code-mode.js +380 -0
- package/lib/code-mode.js.map +1 -0
- package/lib/define-tool.d.ts +103 -0
- package/lib/define-tool.d.ts.map +1 -0
- package/lib/define-tool.js +354 -0
- package/lib/define-tool.js.map +1 -0
- package/lib/index.d.ts +348 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +289 -0
- package/lib/index.js.map +1 -0
- package/lib/invariant.d.ts +13 -0
- package/lib/invariant.d.ts.map +1 -0
- package/lib/invariant.js +123 -0
- package/lib/invariant.js.map +1 -0
- package/lib/json-render.d.ts +18 -0
- package/lib/json-render.d.ts.map +1 -0
- package/lib/json-render.js +111 -0
- package/lib/json-render.js.map +1 -0
- package/lib/json-schema-value.d.ts +18 -0
- package/lib/json-schema-value.d.ts.map +1 -0
- package/lib/json-schema-value.js +238 -0
- package/lib/json-schema-value.js.map +1 -0
- package/lib/json-schema.d.ts +101 -0
- package/lib/json-schema.d.ts.map +1 -0
- package/lib/json-schema.js +351 -0
- package/lib/json-schema.js.map +1 -0
- package/lib/presentation.d.ts +367 -0
- package/lib/presentation.d.ts.map +1 -0
- package/lib/presentation.js +8 -0
- package/lib/presentation.js.map +1 -0
- package/lib/py-names.d.ts +163 -0
- package/lib/py-names.d.ts.map +1 -0
- package/lib/py-names.js +236 -0
- package/lib/py-names.js.map +1 -0
- package/lib/py-render.d.ts +23 -0
- package/lib/py-render.d.ts.map +1 -0
- package/lib/py-render.js +434 -0
- package/lib/py-render.js.map +1 -0
- package/lib/py-sdk-doc.d.ts +29 -0
- package/lib/py-sdk-doc.d.ts.map +1 -0
- package/lib/py-sdk-doc.js +114 -0
- package/lib/py-sdk-doc.js.map +1 -0
- package/lib/py-types.d.ts +34 -0
- package/lib/py-types.d.ts.map +1 -0
- package/lib/py-types.js +40 -0
- package/lib/py-types.js.map +1 -0
- package/lib/run-code-defs.d.ts +77 -0
- package/lib/run-code-defs.d.ts.map +1 -0
- package/lib/run-code-defs.js +98 -0
- package/lib/run-code-defs.js.map +1 -0
- package/lib/runtime-code.d.ts +65 -0
- package/lib/runtime-code.d.ts.map +1 -0
- package/lib/runtime-code.js +129 -0
- package/lib/runtime-code.js.map +1 -0
- package/lib/runtime-core.d.ts +130 -0
- package/lib/runtime-core.d.ts.map +1 -0
- package/lib/runtime-core.js +33 -0
- package/lib/runtime-core.js.map +1 -0
- package/lib/runtime-execute.d.ts +82 -0
- package/lib/runtime-execute.d.ts.map +1 -0
- package/lib/runtime-execute.js +333 -0
- package/lib/runtime-execute.js.map +1 -0
- package/lib/runtime-registry.d.ts +131 -0
- package/lib/runtime-registry.d.ts.map +1 -0
- package/lib/runtime-registry.js +269 -0
- package/lib/runtime-registry.js.map +1 -0
- package/lib/runtime-results.d.ts +32 -0
- package/lib/runtime-results.d.ts.map +1 -0
- package/lib/runtime-results.js +163 -0
- package/lib/runtime-results.js.map +1 -0
- package/lib/runtime-schemas.d.ts +112 -0
- package/lib/runtime-schemas.d.ts.map +1 -0
- package/lib/runtime-schemas.js +222 -0
- package/lib/runtime-schemas.js.map +1 -0
- package/lib/scheduler.d.ts +22 -0
- package/lib/scheduler.d.ts.map +1 -0
- package/lib/scheduler.js +21 -0
- package/lib/scheduler.js.map +1 -0
- package/lib/schema-spec.d.ts +154 -0
- package/lib/schema-spec.d.ts.map +1 -0
- package/lib/schema-spec.js +9 -0
- package/lib/schema-spec.js.map +1 -0
- package/lib/schema.d.ts +5 -0
- package/lib/schema.d.ts.map +1 -0
- package/lib/schema.js +3 -0
- package/lib/schema.js.map +1 -0
- package/lib/testing.d.ts +25 -0
- package/lib/testing.d.ts.map +1 -0
- package/lib/testing.js +25 -0
- package/lib/testing.js.map +1 -0
- package/lib/tool-layer.d.ts +49 -0
- package/lib/tool-layer.d.ts.map +1 -0
- package/lib/tool-layer.js +57 -0
- package/lib/tool-layer.js.map +1 -0
- package/lib/tool-types.d.ts +385 -0
- package/lib/tool-types.d.ts.map +1 -0
- package/lib/tool-types.js +11 -0
- package/lib/tool-types.js.map +1 -0
- package/lib/ts-types.d.ts +37 -0
- package/lib/ts-types.d.ts.map +1 -0
- package/lib/ts-types.js +265 -0
- package/lib/ts-types.js.map +1 -0
- package/lib/types.d.ts +55 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +7 -0
- package/lib/types.js.map +1 -0
- package/package.json +65 -0
package/lib/ts-types.js
ADDED
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code Mode codegen: the pure projection from registered tool schemas to the TypeScript SDK
|
|
3
|
+
* text the model programs against (the `tools:sdk` prompt section). Sibling of
|
|
4
|
+
* `json-schema.ts` — `schemas()` (native function calling) and this module (the generated
|
|
5
|
+
* `declare const tools` API) are two projections of the same store.
|
|
6
|
+
* @module @dsh-cc/tools/src/ts-types
|
|
7
|
+
*/
|
|
8
|
+
import { assertSupportedJsonSchema } from "./json-schema.js";
|
|
9
|
+
/** Property names that are valid bare TS identifiers; anything else is quoted. */
|
|
10
|
+
const IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
11
|
+
/** Render an object key: bare when it is a valid identifier, quoted otherwise (every name stays reachable, no aliasing). */
|
|
12
|
+
function renderKey(name) {
|
|
13
|
+
return IDENTIFIER.test(name) ? name : JSON.stringify(name);
|
|
14
|
+
}
|
|
15
|
+
/** One `indent`-deep line prefix (two spaces per level). */
|
|
16
|
+
function pad(indent) {
|
|
17
|
+
return ' '.repeat(indent);
|
|
18
|
+
}
|
|
19
|
+
/** A one-line JSDoc block for a schema `description`, or no lines when there is none. */
|
|
20
|
+
function docLines(description, indent) {
|
|
21
|
+
if (typeof description !== 'string' || description.length === 0)
|
|
22
|
+
return [];
|
|
23
|
+
// Collapse prose to stable one-line docs and escape comment closers so a
|
|
24
|
+
// schema description cannot terminate generated JSDoc.
|
|
25
|
+
const collapsed = description.replace(/\s+/g, ' ').trim();
|
|
26
|
+
return [`${pad(indent)}/** ${collapsed.replaceAll('*/', String.raw `*\/`)} */`];
|
|
27
|
+
}
|
|
28
|
+
/** Render one scalar already validated by the unified schema boundary. */
|
|
29
|
+
function renderScalar(value) {
|
|
30
|
+
return JSON.stringify(value);
|
|
31
|
+
}
|
|
32
|
+
/** Render a validated scalar `const`/`enum`, falling back to the broad type. */
|
|
33
|
+
function renderConstrainedScalar(node, type) {
|
|
34
|
+
const broad = type === 'integer' ? 'number' : type;
|
|
35
|
+
if (Object.hasOwn(node, 'const'))
|
|
36
|
+
return renderScalar(node.const);
|
|
37
|
+
if (Object.hasOwn(node, 'enum')) {
|
|
38
|
+
return node.enum.map(renderScalar).join(' | ');
|
|
39
|
+
}
|
|
40
|
+
return broad;
|
|
41
|
+
}
|
|
42
|
+
/** Build one document from captured parts while retaining the legacy array-parenthesization test. */
|
|
43
|
+
function typeDocumentFrom(parts) {
|
|
44
|
+
return {
|
|
45
|
+
parts,
|
|
46
|
+
containsUnionOrIntersection: parts.some(part => typeof part === 'string'
|
|
47
|
+
? part.includes('|') || part.includes('&')
|
|
48
|
+
: part.containsUnionOrIntersection),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/** Build a small document without an intermediate array at each call site. */
|
|
52
|
+
function typeDocument(...parts) {
|
|
53
|
+
return typeDocumentFrom(parts);
|
|
54
|
+
}
|
|
55
|
+
/** Flatten a nested document with an explicit work stack. */
|
|
56
|
+
function flattenTypeDocument(document) {
|
|
57
|
+
const chunks = [];
|
|
58
|
+
const tasks = [document];
|
|
59
|
+
for (let task = tasks.pop(); task !== undefined; task = tasks.pop()) {
|
|
60
|
+
if (typeof task === 'string') {
|
|
61
|
+
chunks.push(task);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
for (let index = task.parts.length - 1; index >= 0; index--) {
|
|
65
|
+
const part = task.parts[index];
|
|
66
|
+
/* v8 ignore next -- the loop is bounded by the captured part count. */
|
|
67
|
+
if (part !== undefined)
|
|
68
|
+
tasks.push(part);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return chunks.join('');
|
|
72
|
+
}
|
|
73
|
+
/** Initialize one schema-render frame with empty aggregation state. */
|
|
74
|
+
function schemaRenderFrame(node, indent) {
|
|
75
|
+
return { node, indent, phase: 'start', children: [], childIndex: 0, childDocuments: [], entries: [] };
|
|
76
|
+
}
|
|
77
|
+
/** Render an already asserted schema to a composable document. */
|
|
78
|
+
function renderSupportedSchema(schema, indent) {
|
|
79
|
+
const frames = [schemaRenderFrame(schema, indent)];
|
|
80
|
+
let rootDocument;
|
|
81
|
+
const finish = (document) => {
|
|
82
|
+
frames.pop();
|
|
83
|
+
const parent = frames.at(-1);
|
|
84
|
+
if (parent === undefined)
|
|
85
|
+
rootDocument = document;
|
|
86
|
+
else
|
|
87
|
+
parent.childDocuments.push(document);
|
|
88
|
+
};
|
|
89
|
+
while (frames.length > 0) {
|
|
90
|
+
const frame = frames.at(-1);
|
|
91
|
+
/* v8 ignore next -- the loop condition guarantees a current frame. */
|
|
92
|
+
if (frame === undefined)
|
|
93
|
+
break;
|
|
94
|
+
if (frame.phase === 'children') {
|
|
95
|
+
if (frame.childIndex < frame.children.length) {
|
|
96
|
+
const child = frame.children[frame.childIndex];
|
|
97
|
+
/* v8 ignore next -- childIndex is bounded by children.length. */
|
|
98
|
+
if (child === undefined)
|
|
99
|
+
throw new Error('missing schema render child');
|
|
100
|
+
frame.childIndex++;
|
|
101
|
+
frames.push(schemaRenderFrame(child.node, child.indent));
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (frame.kind === 'oneOf') {
|
|
105
|
+
const parts = [];
|
|
106
|
+
for (let index = 0; index < frame.childDocuments.length; index++) {
|
|
107
|
+
if (index > 0)
|
|
108
|
+
parts.push(' | ');
|
|
109
|
+
const child = frame.childDocuments[index];
|
|
110
|
+
/* v8 ignore next -- child documents correspond one-to-one with children. */
|
|
111
|
+
if (child !== undefined)
|
|
112
|
+
parts.push(child);
|
|
113
|
+
}
|
|
114
|
+
finish(typeDocumentFrom(parts));
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
if (frame.kind === 'array') {
|
|
118
|
+
const child = frame.childDocuments[0];
|
|
119
|
+
/* v8 ignore next -- array frames always schedule exactly one child. */
|
|
120
|
+
if (child === undefined)
|
|
121
|
+
throw new Error('missing array item type');
|
|
122
|
+
finish(child.containsUnionOrIntersection
|
|
123
|
+
? typeDocument('(', child, ')[]')
|
|
124
|
+
: typeDocument(child, '[]'));
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const required = new Set(frame.node.required);
|
|
128
|
+
const parts = ['{'];
|
|
129
|
+
for (let index = 0; index < frame.entries.length; index++) {
|
|
130
|
+
const entry = frame.entries[index];
|
|
131
|
+
const child = frame.childDocuments[index];
|
|
132
|
+
/* v8 ignore next -- object entries and child documents have the same length. */
|
|
133
|
+
if (entry === undefined || child === undefined)
|
|
134
|
+
throw new Error('missing object property type');
|
|
135
|
+
const [name, prop] = entry;
|
|
136
|
+
for (const line of docLines(prop.description, frame.indent + 1))
|
|
137
|
+
parts.push('\n', line);
|
|
138
|
+
parts.push('\n', `${pad(frame.indent + 1)}${renderKey(name)}${required.has(name) ? '' : '?'}: `, child, ';');
|
|
139
|
+
}
|
|
140
|
+
parts.push('\n', `${pad(frame.indent)}}`);
|
|
141
|
+
const declared = typeDocumentFrom(parts);
|
|
142
|
+
finish(frame.node.additionalProperties === false
|
|
143
|
+
? declared
|
|
144
|
+
: typeDocument(declared, ' & Record<string, JsonValue>'));
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
const node = frame.node;
|
|
148
|
+
if (node.oneOf !== undefined) {
|
|
149
|
+
frame.kind = 'oneOf';
|
|
150
|
+
frame.children = Array.from(node.oneOf, child => ({ node: child, indent: frame.indent }));
|
|
151
|
+
frame.childIndex = 0;
|
|
152
|
+
frame.childDocuments = [];
|
|
153
|
+
frame.phase = 'children';
|
|
154
|
+
continue;
|
|
155
|
+
}
|
|
156
|
+
if (node.type === undefined) {
|
|
157
|
+
finish(typeDocument('JsonValue'));
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
switch (node.type) {
|
|
161
|
+
case 'string':
|
|
162
|
+
case 'number':
|
|
163
|
+
case 'integer':
|
|
164
|
+
case 'boolean':
|
|
165
|
+
case 'null':
|
|
166
|
+
finish(typeDocument(renderConstrainedScalar(node, node.type)));
|
|
167
|
+
break;
|
|
168
|
+
case 'array':
|
|
169
|
+
if (node.items === undefined) {
|
|
170
|
+
finish(typeDocument('JsonValue[]'));
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
frame.kind = 'array';
|
|
174
|
+
frame.children = [{ node: node.items, indent: frame.indent }];
|
|
175
|
+
frame.childIndex = 0;
|
|
176
|
+
frame.childDocuments = [];
|
|
177
|
+
frame.phase = 'children';
|
|
178
|
+
}
|
|
179
|
+
break;
|
|
180
|
+
case 'object': {
|
|
181
|
+
const open = node.additionalProperties !== false;
|
|
182
|
+
const entries = Object.entries(node.properties ?? {});
|
|
183
|
+
if (entries.length === 0) {
|
|
184
|
+
finish(typeDocument(open ? 'Record<string, JsonValue>' : 'Record<string, never>'));
|
|
185
|
+
}
|
|
186
|
+
else {
|
|
187
|
+
frame.kind = 'object';
|
|
188
|
+
frame.entries = entries;
|
|
189
|
+
frame.children = entries.map(([, child]) => ({ node: child, indent: frame.indent + 1 }));
|
|
190
|
+
frame.childIndex = 0;
|
|
191
|
+
frame.childDocuments = [];
|
|
192
|
+
frame.phase = 'children';
|
|
193
|
+
}
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
/* v8 ignore next -- assertSupportedJsonSchema narrowed this closed type union. */
|
|
197
|
+
default:
|
|
198
|
+
finish(typeDocument('unknown'));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
/* v8 ignore next -- every root frame produces one document. */
|
|
202
|
+
return rootDocument ?? typeDocument('unknown');
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Map one enforced JSON-Schema node to a TypeScript type literal. Supports
|
|
206
|
+
* every unified schema construct and returns `unknown` for malformed or
|
|
207
|
+
* unsupported inputs without throwing.
|
|
208
|
+
* @param schema - the JSON-Schema node (any shape; hostile inputs degrade).
|
|
209
|
+
* @param indent - the indentation level for nested object members.
|
|
210
|
+
* @returns the TS type text (multi-line for objects with properties).
|
|
211
|
+
*/
|
|
212
|
+
export function jsonSchemaToTs(schema, indent = 0) {
|
|
213
|
+
try {
|
|
214
|
+
assertSupportedJsonSchema(schema);
|
|
215
|
+
return flattenTypeDocument(renderSupportedSchema(schema, indent));
|
|
216
|
+
}
|
|
217
|
+
catch {
|
|
218
|
+
return 'unknown';
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/** The fixed model-facing usage contract rendered above the declarations (see the Code Mode Agent Note's "What the model sees"). */
|
|
222
|
+
const SDK_INSTRUCTIONS = `## Writing code for run_code
|
|
223
|
+
|
|
224
|
+
\`run_code\` takes two required arguments: \`code\` — the body of an async TypeScript function (erasable syntax only — no \`enum\` or namespaces; type annotations are advisory, the code runs type-stripped) — and \`description\`, a short summary of what the program does. Inside the program:
|
|
225
|
+
|
|
226
|
+
- Call tools as \`await tools.name(args)\` — quoted access for exotic names: \`tools["my-tool"](args)\`. Every call resolves to the tool's typed canonical JSON value. Tool arguments must be lossless JSON.
|
|
227
|
+
- A FAILED tool call rejects with \`ToolCallError\`, whose \`toolName\` identifies the failed tool and whose \`message\` is human-readable — \`try/catch\` it to handle and continue.
|
|
228
|
+
- Independent read-only calls MAY overlap under \`Promise.all\` (safe calls run concurrently; mutating calls run alone, in submission order). Sequence dependent work with \`await\`.
|
|
229
|
+
- Emit results with \`return\` and/or \`console.log(...)\`. ONLY what you print or return comes back to you — intermediate tool results never enter the conversation, so extract just what you need.
|
|
230
|
+
|
|
231
|
+
The available tools:`;
|
|
232
|
+
/**
|
|
233
|
+
* Render the full `tools:sdk` prompt section: the fixed usage instructions
|
|
234
|
+
* plus one `declare const tools` interface covering every given tool.
|
|
235
|
+
* Deterministic — tools are emitted in lexicographic name order, so an
|
|
236
|
+
* unchanged tool set produces byte-identical text across assemblies. The sort
|
|
237
|
+
* is not a total order on byte-equal names, so two schemas sharing a name
|
|
238
|
+
* would render in argument order; the caller's visible-capability map is keyed
|
|
239
|
+
* by name, so the input never carries a duplicate.
|
|
240
|
+
* @param schemas - the tool schemas to declare (the caller excludes
|
|
241
|
+
* `run_code` itself).
|
|
242
|
+
* @returns the complete section text.
|
|
243
|
+
*/
|
|
244
|
+
export function renderToolsSdk(schemas) {
|
|
245
|
+
const sorted = [...schemas].sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
|
|
246
|
+
const argsMembers = [];
|
|
247
|
+
const outputMembers = [];
|
|
248
|
+
for (const schema of sorted) {
|
|
249
|
+
argsMembers.push(...docLines(schema.description, 1));
|
|
250
|
+
argsMembers.push(`${pad(1)}${renderKey(schema.name)}: ${jsonSchemaToTs(schema.parameters, 1)};`);
|
|
251
|
+
outputMembers.push(`${pad(1)}${renderKey(schema.name)}: ${jsonSchemaToTs(schema.output, 1)};`);
|
|
252
|
+
}
|
|
253
|
+
const argsMap = `interface ToolArgsMap {${argsMembers.length > 0 ? `\n${argsMembers.join('\n')}\n` : ''}}`;
|
|
254
|
+
const outputMap = `interface ToolOutputMap {${outputMembers.length > 0 ? `\n${outputMembers.join('\n')}\n` : ''}}`;
|
|
255
|
+
const declaration = [
|
|
256
|
+
argsMap,
|
|
257
|
+
outputMap,
|
|
258
|
+
'type ToolName = keyof ToolOutputMap',
|
|
259
|
+
['declare class ToolCallError extends Error {', ' readonly name: "ToolCallError";', ' readonly toolName: ToolName;', '}'].join('\n'),
|
|
260
|
+
['declare const tools: {', ' [K in ToolName]: (args: ToolArgsMap[K]) => Promise<ToolOutputMap[K]>;', '}'].join('\n'),
|
|
261
|
+
].join('\n\n');
|
|
262
|
+
const jsonValue = 'type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue }';
|
|
263
|
+
return `${SDK_INSTRUCTIONS}\n\n\`\`\`ts\n${jsonValue}\n\n${declaration}\n\`\`\``;
|
|
264
|
+
}
|
|
265
|
+
//# sourceMappingURL=ts-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ts-types.js","sourceRoot":"","sources":["../src/ts-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAA;AAQ5D,kFAAkF;AAClF,MAAM,UAAU,GAAG,4BAA4B,CAAA;AAE/C,4HAA4H;AAC5H,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AAC5D,CAAC;AAED,4DAA4D;AAC5D,SAAS,GAAG,CAAC,MAAc;IACzB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAC5B,CAAC;AAED,yFAAyF;AACzF,SAAS,QAAQ,CAAC,WAAoB,EAAE,MAAc;IACpD,IAAI,OAAO,WAAW,KAAK,QAAQ,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAC1E,yEAAyE;IACzE,uDAAuD;IACvD,MAAM,SAAS,GAAG,WAA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AAE,gCAAgC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;QACtI,CAAC,wBAAwB,EAAE,yEAAyE,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;KACtH,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IACd,MAAM,SAAS,GAAG,gGAAgG,CAAA;IAClH,OAAO,GAAG,gBAAgB,iBAAiB,SAAS,OAAO,WAAW,UAAU,CAAA;AAClF,CAAC"}
|
package/lib/types.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable Tool event vocabulary shared with type-only consumers.
|
|
3
|
+
*
|
|
4
|
+
* @module @dsh-cc/tools/types
|
|
5
|
+
*/
|
|
6
|
+
import type { CallId } from '@deepseek-ai/dsh-llm/brand';
|
|
7
|
+
import type { ContentBlock } from '@deepseek-ai/dsh-llm/types';
|
|
8
|
+
/** Payload recorded when one nested Code Mode Tool dispatch starts. */
|
|
9
|
+
export interface CodeDispatchStartEventData {
|
|
10
|
+
rootCallId: CallId;
|
|
11
|
+
parentCallId: CallId;
|
|
12
|
+
subCallId: CallId;
|
|
13
|
+
name: string;
|
|
14
|
+
arguments: unknown;
|
|
15
|
+
}
|
|
16
|
+
/** Payload recorded when one nested Code Mode Tool dispatch settles. */
|
|
17
|
+
export interface CodeDispatchEventData extends CodeDispatchStartEventData {
|
|
18
|
+
isError: boolean;
|
|
19
|
+
content: ContentBlock[];
|
|
20
|
+
}
|
|
21
|
+
declare module '@deepseek-ai/dsh-session/types' {
|
|
22
|
+
interface SessionEventMap {
|
|
23
|
+
/**
|
|
24
|
+
* One sub-dispatch STARTING inside a `run_code` program: the parent
|
|
25
|
+
* `run_code` call id, the deterministic sub-call id (`<parent>:code:<n>`,
|
|
26
|
+
* numbered in submission order), and the tool `name` with its
|
|
27
|
+
* JSON-normalized `arguments` — the exact value dispatched, normalized
|
|
28
|
+
* BEFORE dispatch, so this append can never fail on payload shape.
|
|
29
|
+
* Appended when the scheduler actually starts the call (not at
|
|
30
|
+
* submission), so a start means the tool body pipeline was entered; a
|
|
31
|
+
* call abandoned in the queue logs nothing. Log-only: `deriveMessages()`
|
|
32
|
+
* ignores it; UIs use it for live per-sub-call running state and pair it
|
|
33
|
+
* with `tool/code-dispatch` by `subCallId` (timing = the two events'
|
|
34
|
+
* `time` fields).
|
|
35
|
+
*/
|
|
36
|
+
'tool/code-dispatch-start': CodeDispatchStartEventData;
|
|
37
|
+
/**
|
|
38
|
+
* One bridged sub-dispatch SETTLING: the pairing ids (matching the
|
|
39
|
+
* `tool/code-dispatch-start` with the same `subCallId`), the tool `name`
|
|
40
|
+
* with the same JSON-normalized `arguments`, and the sub-call's complete
|
|
41
|
+
* model-facing outcome in `tool/result`'s own vocabulary
|
|
42
|
+
* (`content` + `isError`), so UIs render a sub-call through the exact
|
|
43
|
+
* code path that renders a native call. Every started sub-call settles
|
|
44
|
+
* with exactly one of these (abort included: the aborted pipeline result
|
|
45
|
+
* is an `isError` outcome).
|
|
46
|
+
* Log-only: `deriveMessages()` ignores it, so sub-calls never re-enter
|
|
47
|
+
* model context; persistence and UIs get every call. Appended inside the
|
|
48
|
+
* parent `run_code`'s execution (the bridge drains in-flight dispatches
|
|
49
|
+
* before returning), so its execution-enclosure relation holds by
|
|
50
|
+
* construction.
|
|
51
|
+
*/
|
|
52
|
+
'tool/code-dispatch': CodeDispatchEventData;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAE9D,uEAAuE;AACvE,MAAM,WAAW,0BAA0B;IACzC,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,OAAO,CAAA;CACnB;AAED,wEAAwE;AACxE,MAAM,WAAW,qBAAsB,SAAQ,0BAA0B;IACvE,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,YAAY,EAAE,CAAA;CACxB;AAED,OAAO,QAAQ,gCAAgC,CAAC;IAC9C,UAAU,eAAe;QACvB;;;;;;;;;;;;WAYG;QACH,0BAA0B,EAAE,0BAA0B,CAAA;QACtD;;;;;;;;;;;;;;WAcG;QACH,oBAAoB,EAAE,qBAAqB,CAAA;KAC5C;CACF"}
|
package/lib/types.js
ADDED
package/lib/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dsh-cc/tools",
|
|
3
|
+
"description": "Tool registry and execution pipeline for the DeepSeek Harness",
|
|
4
|
+
"version": "0.5.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/dsh-cc/dsh-cc.git",
|
|
8
|
+
"directory": "packages/core/tools"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/index.d.ts",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./invariant": {
|
|
17
|
+
"types": "./lib/invariant.d.ts",
|
|
18
|
+
"default": "./lib/invariant.js"
|
|
19
|
+
},
|
|
20
|
+
"./types": {
|
|
21
|
+
"types": "./lib/types.d.ts",
|
|
22
|
+
"default": "./lib/types.js"
|
|
23
|
+
},
|
|
24
|
+
"./presentation": {
|
|
25
|
+
"types": "./lib/presentation.d.ts",
|
|
26
|
+
"default": "./lib/presentation.js"
|
|
27
|
+
},
|
|
28
|
+
"./src/*": "./src/*",
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"lib"
|
|
33
|
+
],
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@deepseek-ai/dsh-agent": ">=0.1.1-rc.2",
|
|
37
|
+
"@deepseek-ai/dsh-code-runtime": ">=0.1.1-rc.2",
|
|
38
|
+
"@deepseek-ai/dsh-invariants": ">=0.1.1-rc.2",
|
|
39
|
+
"@deepseek-ai/dsh-llm": ">=0.1.1-rc.2",
|
|
40
|
+
"@deepseek-ai/dsh-scope": ">=0.1.1-rc.2",
|
|
41
|
+
"@deepseek-ai/dsh-session": ">=0.1.1-rc.2",
|
|
42
|
+
"@deepseek-ai/dsh-system-prompt": ">=0.1.1-rc.2",
|
|
43
|
+
"@deepseek-ai/dsh-tools": ">=0.1.1-rc.2",
|
|
44
|
+
"@deepseek-ai/dsh-user-approval": ">=0.1.1-rc.2",
|
|
45
|
+
"@deepseek-ai/cordis": ">=0.1.1-rc.2",
|
|
46
|
+
"@deepseek-ai/schemastery": "^3.18.1"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@deepseek-ai/dsh-agent": "link:../../../../deepseek-harness/packages/core/agent",
|
|
50
|
+
"@deepseek-ai/dsh-code-runtime": "link:../../../../deepseek-harness/packages/code-runtime/code-runtime",
|
|
51
|
+
"@deepseek-ai/dsh-invariants": "link:../../../../deepseek-harness/packages/runtime-diagnostics/invariants",
|
|
52
|
+
"@deepseek-ai/dsh-llm": "link:../../../../deepseek-harness/packages/llm/llm",
|
|
53
|
+
"@deepseek-ai/dsh-scope": "link:../../../../deepseek-harness/packages/core/scope",
|
|
54
|
+
"@deepseek-ai/dsh-session": "link:../../../../deepseek-harness/packages/core/session",
|
|
55
|
+
"@deepseek-ai/dsh-system-prompt": "link:../../../../deepseek-harness/packages/core/system-prompt",
|
|
56
|
+
"@deepseek-ai/dsh-tools": "link:../../../../deepseek-harness/packages/core/tools",
|
|
57
|
+
"@deepseek-ai/dsh-user-approval": "link:../../../../deepseek-harness/packages/interaction/user-approval",
|
|
58
|
+
"@deepseek-ai/cordis": "link:../../../../deepseek-harness/vendor/cordis",
|
|
59
|
+
"@deepseek-ai/schemastery": "link:../../../../deepseek-harness/vendor/schemastery",
|
|
60
|
+
"fast-check": "4.8.0"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
}
|
|
65
|
+
}
|