stitchkit 0.119.0 → 0.120.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/CHANGELOG.md +26 -0
- package/README.md +10 -7
- package/dist/entrypoints/agent-runtime/coding-tools.js +4 -4
- package/dist/entrypoints/agent-runtime/harness.js +4 -4
- package/dist/entrypoints/agent-runtime/realtime.js +3 -3
- package/dist/entrypoints/agent-runtime/sandbox.js +5 -5
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
- package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
- package/dist/entrypoints/agent-runtime/testing.js +6 -6
- package/dist/entrypoints/agent-runtime.js +13 -11
- package/dist/entrypoints/application/diagnostic-journal.js +2 -2
- package/dist/entrypoints/application/directory-inbox.js +4 -4
- package/dist/entrypoints/application.js +6 -6
- package/dist/entrypoints/cli/publish.js +4 -4
- package/dist/entrypoints/cli.js +7 -7
- package/dist/entrypoints/contract.js +4 -4
- package/dist/entrypoints/files.js +3 -3
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +2 -2
- package/dist/entrypoints/node.js +1 -1
- package/dist/entrypoints/process.js +1 -1
- package/dist/entrypoints/remote.js +1 -1
- package/dist/entrypoints/server.js +11 -11
- package/dist/entrypoints/telegram/screens.js +5 -5
- package/dist/entrypoints/telegram.js +7 -7
- package/dist/entrypoints/testing.js +2 -2
- package/dist/entrypoints/tools/agent.d.ts +9 -0
- package/dist/entrypoints/tools/agent.d.ts.map +1 -0
- package/dist/entrypoints/tools/agent.js +16 -0
- package/dist/entrypoints/tools/connections.js +4 -4
- package/dist/entrypoints/tools/mcp.js +104 -4
- package/dist/entrypoints/tools/toolkit.d.ts +9 -0
- package/dist/entrypoints/tools/toolkit.d.ts.map +1 -0
- package/dist/entrypoints/tools/toolkit.js +40 -0
- package/dist/entrypoints/tools.d.ts +0 -10
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +25 -69
- package/dist/{index-1k18qzqa.js → index-0qyrcjfs.js} +3 -3
- package/dist/index-1psbyyhj.js +21 -0
- package/dist/index-3prvb42w.js +30 -0
- package/dist/{index-ba7are04.js → index-3yb5kft5.js} +1 -1
- package/dist/index-568w258r.js +76 -0
- package/dist/{index-6a69xzrx.js → index-7zwtbak8.js} +5 -46
- package/dist/{index-fcqj44mb.js → index-8ryydawp.js} +4 -4
- package/dist/{index-fqd4yqwd.js → index-8xyf8h2k.js} +1 -1
- package/dist/{index-6f49krb5.js → index-aa50qwv4.js} +1 -1
- package/dist/{index-s20s2mad.js → index-bgcwxhxh.js} +16 -14
- package/dist/index-bph35vpy.js +77 -0
- package/dist/{index-ynrf908v.js → index-bz479f0x.js} +1 -1
- package/dist/{index-q968hy6y.js → index-e452syyh.js} +1 -1
- package/dist/index-h1j71dr1.js +48 -0
- package/dist/{index-mgb7r8b8.js → index-jswst0h3.js} +1 -1
- package/dist/{index-bbvc59gw.js → index-knmnj11j.js} +9 -180
- package/dist/{index-57gqaq8b.js → index-nyyam9ce.js} +1 -1
- package/dist/{index-s0qjs6ee.js → index-pq2m7t46.js} +9 -81
- package/dist/{index-yk4g8805.js → index-pq7rkwkk.js} +1 -30
- package/dist/{index-x8d9fdeg.js → index-qctbzmg9.js} +8 -4
- package/dist/{index-g444vfz2.js → index-r3db01kh.js} +1 -1
- package/dist/index-sb9dr3tq.js +14 -0
- package/dist/{index-rxcgp4b9.js → index-yb9n4pgj.js} +1 -1
- package/dist/{index-tvtacc9a.js → index-zyc64nbh.js} +1 -34
- package/llms/agent-runtime-harness.txt +4 -3
- package/llms/agent-runtime-sandbox.txt +1 -1
- package/llms/agent-runtime.2.txt +3 -2
- package/llms/agent-runtime.3.txt +4 -46
- package/llms/agent-runtime.4.txt +113 -0
- package/llms/agent-runtime.txt +11 -13
- package/llms/cli.txt +1 -1
- package/llms/stitchkit.txt +15 -9
- package/llms/testing.txt +4 -6
- package/llms/tools-agent.txt +24 -0
- package/llms/tools-mcp.txt +71 -6
- package/llms/tools-toolkit.txt +23 -0
- package/llms/tools.2.txt +6 -3
- package/llms/tools.3.txt +8 -77
- package/llms/tools.txt +8 -8
- package/llms/{upgrading-0.106.0-0.119.0.txt → upgrading-0.106.0-0.120.0.txt} +34 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +231 -119
- package/llms.txt +9 -7
- package/package.json +10 -2
- package/dist/{index-arjmb6de.js → index-1jwsfkfz.js} +0 -0
- package/dist/{index-2dfvv1jg.js → index-2fc1k9k2.js} +0 -0
- package/dist/{index-qndsr7f0.js → index-5efrpfmj.js} +3 -3
- /package/dist/{index-cyxp8rbf.js → index-mtwh9hyp.js} +0 -0
- /package/dist/{index-f4njz9j0.js → index-qevqn3d3.js} +0 -0
|
@@ -16,19 +16,19 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
createMutationQueue
|
|
18
18
|
} from "../../index-sykb5ag7.js";
|
|
19
|
+
import {
|
|
20
|
+
argumentsDigest
|
|
21
|
+
} from "../../index-r7a7r7ha.js";
|
|
19
22
|
import {
|
|
20
23
|
bytesToBase64Url,
|
|
21
24
|
base64UrlToBytes
|
|
22
25
|
} from "../../index-dwfv9a85.js";
|
|
23
|
-
import {
|
|
24
|
-
MAX_TIMER_MS
|
|
25
|
-
} from "../../index-eemvahkc.js";
|
|
26
26
|
import {
|
|
27
27
|
isUnsafeKey
|
|
28
28
|
} from "../../index-zsarb5xp.js";
|
|
29
29
|
import {
|
|
30
|
-
|
|
31
|
-
} from "../../index-
|
|
30
|
+
MAX_TIMER_MS
|
|
31
|
+
} from "../../index-eemvahkc.js";
|
|
32
32
|
import {
|
|
33
33
|
compareCodeUnits
|
|
34
34
|
} from "../../index-zsvzhjtk.js";
|
|
@@ -2,10 +2,10 @@ import {
|
|
|
2
2
|
backoffDelay
|
|
3
3
|
} from "../index-g6a3na27.js";
|
|
4
4
|
import"../index-2kbysk9s.js";
|
|
5
|
-
import"../index-
|
|
5
|
+
import"../index-qevqn3d3.js";
|
|
6
6
|
import {
|
|
7
7
|
attemptExclusiveLock
|
|
8
|
-
} from "../index-
|
|
8
|
+
} from "../index-bz479f0x.js";
|
|
9
9
|
import {
|
|
10
10
|
TELEGRAM_SEND_FAILURE_REASONS2,
|
|
11
11
|
classifyTelegramSendFailure2
|
|
@@ -21,6 +21,9 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
BOT_TOKEN_SECRET
|
|
23
23
|
} from "../index-sznqf8fx.js";
|
|
24
|
+
import {
|
|
25
|
+
argumentsDigest
|
|
26
|
+
} from "../index-r7a7r7ha.js";
|
|
24
27
|
import {
|
|
25
28
|
writeFileAtomic2
|
|
26
29
|
} from "../index-ac6vvm30.js";
|
|
@@ -34,15 +37,12 @@ import {
|
|
|
34
37
|
MAX_TIMER_MS,
|
|
35
38
|
sleep
|
|
36
39
|
} from "../index-eemvahkc.js";
|
|
37
|
-
import {
|
|
38
|
-
untilAborted
|
|
39
|
-
} from "../index-a5qr2rj6.js";
|
|
40
40
|
import {
|
|
41
41
|
assertPositiveSafeInteger
|
|
42
42
|
} from "../index-0s4xebbg.js";
|
|
43
43
|
import {
|
|
44
|
-
|
|
45
|
-
} from "../index-
|
|
44
|
+
untilAborted
|
|
45
|
+
} from "../index-a5qr2rj6.js";
|
|
46
46
|
import {
|
|
47
47
|
isRecord,
|
|
48
48
|
transportResult
|
|
@@ -6,7 +6,7 @@ import"../index-9frf01t9.js";
|
|
|
6
6
|
import"../index-9mjrnqxs.js";
|
|
7
7
|
import {
|
|
8
8
|
createApplication2
|
|
9
|
-
} from "../index-
|
|
9
|
+
} from "../index-mtwh9hyp.js";
|
|
10
10
|
import"../index-w5s3xftz.js";
|
|
11
11
|
import {
|
|
12
12
|
RealtimeRequestTimeoutError2,
|
|
@@ -36,7 +36,7 @@ import"../index-k42ckyzx.js";
|
|
|
36
36
|
import {
|
|
37
37
|
createClient2,
|
|
38
38
|
createClients2
|
|
39
|
-
} from "../index-
|
|
39
|
+
} from "../index-2fc1k9k2.js";
|
|
40
40
|
import {
|
|
41
41
|
assertPositiveSafeInteger
|
|
42
42
|
} from "../index-0s4xebbg.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `stitchkit/tools/agent` — mount a contract's operations as AI SDK tools.
|
|
3
|
+
*
|
|
4
|
+
* Its own subpath because the AI SDK (`ai`) is an optional peer: an application
|
|
5
|
+
* that exposes its operations over HTTP and CLI imports `stitchkit/tools` and
|
|
6
|
+
* installs neither the AI SDK nor the MCP server SDK. → ADR 0284.
|
|
7
|
+
*/
|
|
8
|
+
export { type AgentContext, type AgentMountConfig, mountAgent } from '../../tools/agent.js';
|
|
9
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/tools/agent.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import"../../index-k42ckyzx.js";
|
|
2
|
+
import"../../index-dsa676h8.js";
|
|
3
|
+
import"../../index-rbzq0q16.js";
|
|
4
|
+
import"../../index-ct75c3at.js";
|
|
5
|
+
import"../../index-x4p3kw1p.js";
|
|
6
|
+
import"../../index-s3yxw6kt.js";
|
|
7
|
+
import"../../index-69t14s4a.js";
|
|
8
|
+
import"../../index-ycqhyars.js";
|
|
9
|
+
import {
|
|
10
|
+
mountAgent2
|
|
11
|
+
} from "../../index-7zwtbak8.js";
|
|
12
|
+
import"../../index-ff39f9dr.js";
|
|
13
|
+
import"../../index-aqwg2dm5.js";
|
|
14
|
+
export {
|
|
15
|
+
mountAgent2 as mountAgent
|
|
16
|
+
};
|
|
@@ -21,16 +21,16 @@ import {
|
|
|
21
21
|
import {
|
|
22
22
|
raceAbort
|
|
23
23
|
} from "../../index-b0kddvzw.js";
|
|
24
|
+
import {
|
|
25
|
+
safeJsonParse
|
|
26
|
+
} from "../../index-zsarb5xp.js";
|
|
24
27
|
import {
|
|
25
28
|
readBoundedChunks,
|
|
26
29
|
concatChunks
|
|
27
|
-
} from "../../index-
|
|
30
|
+
} from "../../index-5efrpfmj.js";
|
|
28
31
|
import {
|
|
29
32
|
MAX_TIMER_MS
|
|
30
33
|
} from "../../index-eemvahkc.js";
|
|
31
|
-
import {
|
|
32
|
-
safeJsonParse
|
|
33
|
-
} from "../../index-zsarb5xp.js";
|
|
34
34
|
import {
|
|
35
35
|
assertPositiveSafeInteger
|
|
36
36
|
} from "../../index-0s4xebbg.js";
|
|
@@ -19,16 +19,116 @@ import {
|
|
|
19
19
|
mountMcpResource2,
|
|
20
20
|
createMcpHandler2,
|
|
21
21
|
createMcpHttpRoute2,
|
|
22
|
-
createStdioMcpServer2
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
createStdioMcpServer2
|
|
23
|
+
} from "../../index-knmnj11j.js";
|
|
24
|
+
import {
|
|
25
|
+
DEFAULT_PROCESS_SIGNALS,
|
|
26
|
+
defaultSignalSource,
|
|
27
|
+
reportSignalError,
|
|
28
|
+
guardSignalCallback
|
|
29
|
+
} from "../../index-3prvb42w.js";
|
|
25
30
|
import"../../index-ff39f9dr.js";
|
|
26
31
|
import"../../index-aqwg2dm5.js";
|
|
32
|
+
// src/tools/mcp/stdio-signals.ts
|
|
33
|
+
var bound = new WeakSet;
|
|
34
|
+
function bindStdioProcessSignals(handle, options = {}) {
|
|
35
|
+
if (bound.has(handle)) {
|
|
36
|
+
throw new Error("[stitchkit] bindStdioProcessSignals: this stdio handle is already bound; close the first binding before creating another");
|
|
37
|
+
}
|
|
38
|
+
bound.add(handle);
|
|
39
|
+
const signals = [...new Set(options.signals ?? DEFAULT_PROCESS_SIGNALS)];
|
|
40
|
+
const source = options.signalSource ?? defaultSignalSource;
|
|
41
|
+
const handlers = [];
|
|
42
|
+
let started = false;
|
|
43
|
+
let sameTurnAsStart = false;
|
|
44
|
+
let closed = false;
|
|
45
|
+
let resolveChain = () => {
|
|
46
|
+
return;
|
|
47
|
+
};
|
|
48
|
+
let rejectChain = () => {
|
|
49
|
+
return;
|
|
50
|
+
};
|
|
51
|
+
const promise = new Promise((resolve, reject) => {
|
|
52
|
+
resolveChain = resolve;
|
|
53
|
+
rejectChain = reject;
|
|
54
|
+
});
|
|
55
|
+
promise.catch(() => {
|
|
56
|
+
return;
|
|
57
|
+
});
|
|
58
|
+
const removeListeners = () => {
|
|
59
|
+
if (closed)
|
|
60
|
+
return;
|
|
61
|
+
closed = true;
|
|
62
|
+
for (const [signal, handler] of handlers)
|
|
63
|
+
source.off(signal, handler);
|
|
64
|
+
if (!started)
|
|
65
|
+
bound.delete(handle);
|
|
66
|
+
};
|
|
67
|
+
const close = () => {
|
|
68
|
+
const hadStarted = started;
|
|
69
|
+
removeListeners();
|
|
70
|
+
if (!hadStarted)
|
|
71
|
+
resolveChain();
|
|
72
|
+
};
|
|
73
|
+
const run = async (signal) => {
|
|
74
|
+
try {
|
|
75
|
+
await options.onClose?.(signal);
|
|
76
|
+
} catch (error) {
|
|
77
|
+
reportSignalError("prepare", error, options.onError);
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
await handle.close();
|
|
81
|
+
} catch (error) {
|
|
82
|
+
rejectChain(error);
|
|
83
|
+
reportSignalError("close", error, options.onError);
|
|
84
|
+
removeListeners();
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
resolveChain();
|
|
88
|
+
try {
|
|
89
|
+
await options.onComplete?.();
|
|
90
|
+
} catch (error) {
|
|
91
|
+
reportSignalError("complete", error, options.onError);
|
|
92
|
+
} finally {
|
|
93
|
+
removeListeners();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
const onSignal = (signal) => {
|
|
97
|
+
if (!started) {
|
|
98
|
+
started = true;
|
|
99
|
+
sameTurnAsStart = true;
|
|
100
|
+
queueMicrotask(() => {
|
|
101
|
+
sameTurnAsStart = false;
|
|
102
|
+
});
|
|
103
|
+
run(signal).catch((error) => reportSignalError("close", error, options.onError));
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (sameTurnAsStart)
|
|
107
|
+
return;
|
|
108
|
+
removeListeners();
|
|
109
|
+
guardSignalCallback(() => options.onRepeatedSignal?.(signal), "close", options.onError);
|
|
110
|
+
let restored = false;
|
|
111
|
+
try {
|
|
112
|
+
restored = source.raiseDefault(signal);
|
|
113
|
+
} catch (error) {
|
|
114
|
+
reportSignalError("close", error, options.onError);
|
|
115
|
+
}
|
|
116
|
+
if (!restored) {
|
|
117
|
+
guardSignalCallback(() => options.onEscalationBlocked?.(signal), "close", options.onError);
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
for (const signal of signals) {
|
|
121
|
+
const handler = () => onSignal(signal);
|
|
122
|
+
handlers.push([signal, handler]);
|
|
123
|
+
source.on(signal, handler);
|
|
124
|
+
}
|
|
125
|
+
return { promise, close };
|
|
126
|
+
}
|
|
27
127
|
export {
|
|
28
128
|
EXT_APPS_BUNDLE_PLACEHOLDER2 as EXT_APPS_BUNDLE_PLACEHOLDER,
|
|
29
129
|
MCP_CATALOG_META_KEY2 as MCP_CATALOG_META_KEY,
|
|
30
130
|
RESOURCE_MIME_TYPE2 as RESOURCE_MIME_TYPE,
|
|
31
|
-
|
|
131
|
+
bindStdioProcessSignals,
|
|
32
132
|
buildMcpServer2 as buildMcpServer,
|
|
33
133
|
createMcpHandler2 as createMcpHandler,
|
|
34
134
|
createMcpHttpRoute2 as createMcpHttpRoute,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `stitchkit/tools/toolkit` — one tool set served over MCP and to an AI SDK agent.
|
|
3
|
+
*
|
|
4
|
+
* The toolkit composes both adapters, so this subpath needs both optional peers,
|
|
5
|
+
* `@modelcontextprotocol/server` and `ai`. A server that needs only one of them
|
|
6
|
+
* imports `stitchkit/tools/mcp` or `stitchkit/tools/agent`. → ADR 0284.
|
|
7
|
+
*/
|
|
8
|
+
export { createToolkit, type Toolkit } from '../../tools/toolkit.js';
|
|
9
|
+
//# sourceMappingURL=toolkit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolkit.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/tools/toolkit.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,aAAa,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import"../../index-k42ckyzx.js";
|
|
2
|
+
import"../../index-dsa676h8.js";
|
|
3
|
+
import"../../index-rbzq0q16.js";
|
|
4
|
+
import"../../index-ct75c3at.js";
|
|
5
|
+
import"../../index-x4p3kw1p.js";
|
|
6
|
+
import"../../index-s3yxw6kt.js";
|
|
7
|
+
import"../../index-69t14s4a.js";
|
|
8
|
+
import"../../index-ycqhyars.js";
|
|
9
|
+
import {
|
|
10
|
+
mountAgent2
|
|
11
|
+
} from "../../index-7zwtbak8.js";
|
|
12
|
+
import {
|
|
13
|
+
createCli2
|
|
14
|
+
} from "../../index-pq2m7t46.js";
|
|
15
|
+
import"../../index-2kbysk9s.js";
|
|
16
|
+
import {
|
|
17
|
+
mountMcp2,
|
|
18
|
+
buildMcpServer2,
|
|
19
|
+
createMcpHandler2,
|
|
20
|
+
createStdioMcpServer2
|
|
21
|
+
} from "../../index-knmnj11j.js";
|
|
22
|
+
import"../../index-e452syyh.js";
|
|
23
|
+
import"../../index-1jwsfkfz.js";
|
|
24
|
+
import"../../index-ff39f9dr.js";
|
|
25
|
+
import"../../index-aqwg2dm5.js";
|
|
26
|
+
|
|
27
|
+
// src/tools/toolkit.ts
|
|
28
|
+
function createToolkit() {
|
|
29
|
+
return {
|
|
30
|
+
mountMcp: (server, services, config) => mountMcp2(server, services, config),
|
|
31
|
+
mountAgent: (services, config) => mountAgent2(services, config),
|
|
32
|
+
buildMcpServer: (config, auth) => buildMcpServer2(config, auth),
|
|
33
|
+
createMcpHandler: (config) => createMcpHandler2(config),
|
|
34
|
+
createStdioMcpServer: (config) => createStdioMcpServer2(config),
|
|
35
|
+
createCli: (config) => createCli2(config)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
createToolkit
|
|
40
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export type { McpServer } from '@modelcontextprotocol/server';
|
|
2
1
|
export { createLocalStepDurability, type EffectHandlers, type EffectOutcome, type EffectRunOptions, EffectUnresolvedError, type LocalStepDurability, type LocalStepDurabilityOptions, type StepDurabilityLedger, } from '../durability/engine.js';
|
|
3
2
|
export type { AgentStoreEventEnvelope, AgentStoreEventPage, AppendAgentStoreEvent, ReadAgentStoreEvents, } from '../durability/events.js';
|
|
4
3
|
export type { ManagedFileBoundary, ManagedFileReadOptions, ManagedFileSource, ManagedFileWriteOptions, } from '../files/boundary.js';
|
|
@@ -6,7 +5,6 @@ export { type CimdCacheEvent, type CimdCachePolicy, type CimdClientMetadata, typ
|
|
|
6
5
|
export { oauthProtectedResourceRoute, PROTECTED_RESOURCE_PATH, type ProtectedResourceConfig, protectedResourceMetadataUrl, wwwAuthenticateHeader, } from '../server/oauth/metadata.js';
|
|
7
6
|
export { type ApplicationType, type AuthCodeData, type AuthRequest, type ClientMetadata, mountOAuthProvider, type OAuthClientRegistrationConfig, type OAuthProviderConfig, type RefreshData, type RegisteredClient, } from '../server/oauth/provider.js';
|
|
8
7
|
export type { OperationIdentity } from '../server/types.js';
|
|
9
|
-
export { type AgentContext, type AgentMountConfig, mountAgent } from '../tools/agent.js';
|
|
10
8
|
export { AgentToolError, isAgentToolError } from '../tools/agent-tool-error.js';
|
|
11
9
|
export type { DurableJsonValue, ToolDurability, ToolDurabilityFactory, } from '../tools/durability-port.js';
|
|
12
10
|
export type { ToolExecutionControlReason, ToolOperation } from '../tools/execute.js';
|
|
@@ -18,13 +16,6 @@ export { createToolInvoker, type ToolInvocationOptions, type ToolInvoker, type T
|
|
|
18
16
|
export { composeToolLifecycle } from '../tools/lifecycle.js';
|
|
19
17
|
export { listContractToolNames, listToolNames, type ToolNameEntry, } from '../tools/list-names.js';
|
|
20
18
|
export { buildToolManifest, describeToolCatalog, type ToolCatalogConfig, type ToolCatalogEntry, type ToolManifestConfig, type ToolManifestEntry, } from '../tools/manifest.js';
|
|
21
|
-
export { EXT_APPS_BUNDLE_PLACEHOLDER, inlineMcpAppBundle, type McpAppCsp, type McpAppResourceMeta, type McpResourceDef, RESOURCE_MIME_TYPE, } from '../tools/mcp/app.js';
|
|
22
|
-
export { MCP_CATALOG_META_KEY, type McpCatalogStamp, mcpCatalogMeta, readMcpCatalogStamp, } from '../tools/mcp/catalog.js';
|
|
23
|
-
export { createMcpHandler, createMcpHttpRoute, type McpHandlerConfig, type McpHttpConfig, type McpHttpHandler, type McpHttpSecurityConfig, type McpLegacyPolicy, } from '../tools/mcp/handler.js';
|
|
24
|
-
export { buildMcpServer, type DirectMcpSurfaceConfig, type FiniteMcpSurfaceConfig, type McpMountConfig, type McpServerBuildConfig, type McpServerSharedConfig, mountMcp, mountMcpResource, validateMcpSchemas, } from '../tools/mcp/mount.js';
|
|
25
|
-
export type { IncompatibleSchemaPolicy, McpSchemaValidationConfig, McpSurfaceDefinition, McpSurfaceRegistry, ValidateMcpSchemasConfig, } from '../tools/mcp/prepare.js';
|
|
26
|
-
export { createStdioMcpServer, type McpStdioHandle, type StdioAuthConfig, type StdioMcpServerConfig, } from '../tools/mcp/stdio.js';
|
|
27
|
-
export { bindStdioProcessSignals, type StdioCloseTarget, type StdioProcessSignalsBinding, type StdioProcessSignalsErrorPhase, type StdioProcessSignalsOptions, } from '../tools/mcp/stdio-signals.js';
|
|
28
19
|
export { type CollectToolsConfig, collectTools, type MountableTool, type ToolExtend, } from '../tools/mount.js';
|
|
29
20
|
export type { ManagedNativeToolConfig, NativeToolIdentity, } from '../tools/native-definition.js';
|
|
30
21
|
export { bindContractAsyncOperation } from '../tools/operations/async-operation-binding.js';
|
|
@@ -42,7 +33,6 @@ export { flattenToolJsonSchema, type ToolPresentationSchema, } from '../tools/sc
|
|
|
42
33
|
export { findNonPortableFormats, type NonPortableFormat, PORTABLE_JSON_SCHEMA_FORMATS, } from '../tools/schema/portable-formats.js';
|
|
43
34
|
export { findUntypedProperties, type UntypedProperty, } from '../tools/schema/untyped-properties.js';
|
|
44
35
|
export { createToolLogger, type ToolCallRecord, type ToolLoggerConfig, } from '../tools/tool-logger.js';
|
|
45
|
-
export { createToolkit, type Toolkit } from '../tools/toolkit.js';
|
|
46
36
|
export { type DefineDownloadToolConfig, defineDownloadTool, } from '../tools/transfer/define-download-tool.js';
|
|
47
37
|
export { type DefineUploadToolConfig, defineUploadTool, UploadToolInputSchema, } from '../tools/transfer/define-upload-tool.js';
|
|
48
38
|
export { type DefineViewFileToolConfig, defineViewFileTool, } from '../tools/transfer/define-view-file-tool.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/entrypoints/tools.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/entrypoints/tools.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,yBAAyB,EACzB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,qBAAqB,EACrB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,K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mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
|
|
@@ -2,10 +2,8 @@ import {
|
|
|
2
2
|
EffectUnresolvedError2
|
|
3
3
|
} from "../index-snef22zr.js";
|
|
4
4
|
import {
|
|
5
|
-
createLocalStepDurability2
|
|
6
|
-
|
|
7
|
-
isAgentToolError2
|
|
8
|
-
} from "../index-tvtacc9a.js";
|
|
5
|
+
createLocalStepDurability2
|
|
6
|
+
} from "../index-zyc64nbh.js";
|
|
9
7
|
import {
|
|
10
8
|
normalizeError2
|
|
11
9
|
} from "../index-k42ckyzx.js";
|
|
@@ -33,36 +31,10 @@ import {
|
|
|
33
31
|
import {
|
|
34
32
|
collectTools2
|
|
35
33
|
} from "../index-ycqhyars.js";
|
|
36
|
-
import {
|
|
37
|
-
mountAgent2,
|
|
38
|
-
describeToolCatalog2,
|
|
39
|
-
buildToolManifest2
|
|
40
|
-
} from "../index-6a69xzrx.js";
|
|
41
34
|
import"../index-m38ej7e5.js";
|
|
42
35
|
import {
|
|
43
36
|
defineContract2
|
|
44
37
|
} from "../index-4jpykzvw.js";
|
|
45
|
-
import {
|
|
46
|
-
PROTECTED_RESOURCE_PATH2,
|
|
47
|
-
protectedResourceMetadataUrl2,
|
|
48
|
-
wwwAuthenticateHeader2,
|
|
49
|
-
oauthProtectedResourceRoute2,
|
|
50
|
-
RESOURCE_MIME_TYPE2,
|
|
51
|
-
EXT_APPS_BUNDLE_PLACEHOLDER2,
|
|
52
|
-
inlineMcpAppBundle2,
|
|
53
|
-
MCP_CATALOG_META_KEY2,
|
|
54
|
-
mcpCatalogMeta2,
|
|
55
|
-
readMcpCatalogStamp2,
|
|
56
|
-
createMcpProgressReporter,
|
|
57
|
-
validateMcpSchemas2,
|
|
58
|
-
mountMcp2,
|
|
59
|
-
buildMcpServer2,
|
|
60
|
-
mountMcpResource2,
|
|
61
|
-
createMcpHandler2,
|
|
62
|
-
createMcpHttpRoute2,
|
|
63
|
-
createStdioMcpServer2,
|
|
64
|
-
bindStdioProcessSignals2
|
|
65
|
-
} from "../index-bbvc59gw.js";
|
|
66
38
|
import {
|
|
67
39
|
AsyncOperationCancelResultSchema2,
|
|
68
40
|
createAsyncOperationSnapshotSchema2,
|
|
@@ -72,12 +44,6 @@ import {
|
|
|
72
44
|
ViewFileOutputSchema2,
|
|
73
45
|
ViewFileInputSchema2
|
|
74
46
|
} from "../index-sba3e6m4.js";
|
|
75
|
-
import {
|
|
76
|
-
WaitTimeoutError,
|
|
77
|
-
runWaitOperation,
|
|
78
|
-
createCli2
|
|
79
|
-
} from "../index-s0qjs6ee.js";
|
|
80
|
-
import"../index-2kbysk9s.js";
|
|
81
47
|
import {
|
|
82
48
|
ManagedFilePathSchema2,
|
|
83
49
|
ManagedFileRefSchema2
|
|
@@ -90,14 +56,32 @@ import {
|
|
|
90
56
|
contractOnlyService,
|
|
91
57
|
mediaTypeEssence
|
|
92
58
|
} from "../index-sa99p98w.js";
|
|
59
|
+
import"../index-pfvde2fz.js";
|
|
60
|
+
import {
|
|
61
|
+
describeToolCatalog2,
|
|
62
|
+
buildToolManifest2
|
|
63
|
+
} from "../index-h1j71dr1.js";
|
|
64
|
+
import {
|
|
65
|
+
PROTECTED_RESOURCE_PATH2,
|
|
66
|
+
protectedResourceMetadataUrl2,
|
|
67
|
+
wwwAuthenticateHeader2,
|
|
68
|
+
oauthProtectedResourceRoute2,
|
|
69
|
+
createMcpProgressReporter
|
|
70
|
+
} from "../index-568w258r.js";
|
|
93
71
|
import {
|
|
94
72
|
DEFAULT_CORS_ALLOW_HEADERS2
|
|
95
|
-
} from "../index-
|
|
73
|
+
} from "../index-pq7rkwkk.js";
|
|
74
|
+
import {
|
|
75
|
+
AgentToolError2,
|
|
76
|
+
isAgentToolError2
|
|
77
|
+
} from "../index-1psbyyhj.js";
|
|
96
78
|
import {
|
|
97
79
|
createToolInvoker2
|
|
98
80
|
} from "../index-kz9734jc.js";
|
|
99
|
-
import
|
|
100
|
-
|
|
81
|
+
import {
|
|
82
|
+
WaitTimeoutError,
|
|
83
|
+
runWaitOperation
|
|
84
|
+
} from "../index-bph35vpy.js";
|
|
101
85
|
import {
|
|
102
86
|
collectToolSurface
|
|
103
87
|
} from "../index-ff39f9dr.js";
|
|
@@ -115,12 +99,11 @@ import {
|
|
|
115
99
|
fetchGuarded,
|
|
116
100
|
fetchPinnedDocument,
|
|
117
101
|
readCapped
|
|
118
|
-
} from "../index-
|
|
119
|
-
import"../index-pfvde2fz.js";
|
|
102
|
+
} from "../index-jswst0h3.js";
|
|
120
103
|
import {
|
|
121
104
|
readBoundedChunks,
|
|
122
105
|
concatChunks
|
|
123
|
-
} from "../index-
|
|
106
|
+
} from "../index-5efrpfmj.js";
|
|
124
107
|
import {
|
|
125
108
|
assertPositiveSafeInteger
|
|
126
109
|
} from "../index-0s4xebbg.js";
|
|
@@ -1424,17 +1407,6 @@ function createToolLogger(config = {}) {
|
|
|
1424
1407
|
}
|
|
1425
1408
|
};
|
|
1426
1409
|
}
|
|
1427
|
-
// src/tools/toolkit.ts
|
|
1428
|
-
function createToolkit() {
|
|
1429
|
-
return {
|
|
1430
|
-
mountMcp: (server, services, config) => mountMcp2(server, services, config),
|
|
1431
|
-
mountAgent: (services, config) => mountAgent2(services, config),
|
|
1432
|
-
buildMcpServer: (config, auth) => buildMcpServer2(config, auth),
|
|
1433
|
-
createMcpHandler: (config) => createMcpHandler2(config),
|
|
1434
|
-
createStdioMcpServer: (config) => createStdioMcpServer2(config),
|
|
1435
|
-
createCli: (config) => createCli2(config)
|
|
1436
|
-
};
|
|
1437
|
-
}
|
|
1438
1410
|
// src/tools/transfer/download-core.ts
|
|
1439
1411
|
import { basename, extname } from "node:path";
|
|
1440
1412
|
var DEFAULT_MAX_BYTES = 100 * 1024 * 1024;
|
|
@@ -1971,36 +1943,27 @@ function summarizeTransports(surface) {
|
|
|
1971
1943
|
export {
|
|
1972
1944
|
AgentToolError2 as AgentToolError,
|
|
1973
1945
|
AsyncOperationCancelResultSchema2 as AsyncOperationCancelResultSchema,
|
|
1974
|
-
EXT_APPS_BUNDLE_PLACEHOLDER2 as EXT_APPS_BUNDLE_PLACEHOLDER,
|
|
1975
1946
|
EffectUnresolvedError2 as EffectUnresolvedError,
|
|
1976
|
-
MCP_CATALOG_META_KEY2 as MCP_CATALOG_META_KEY,
|
|
1977
1947
|
McpAnnotationsSchema2 as McpAnnotationsSchema,
|
|
1978
1948
|
McpMediaContentSchema2 as McpMediaContentSchema,
|
|
1979
1949
|
PORTABLE_JSON_SCHEMA_FORMATS2 as PORTABLE_JSON_SCHEMA_FORMATS,
|
|
1980
1950
|
PROTECTED_RESOURCE_PATH2 as PROTECTED_RESOURCE_PATH,
|
|
1981
|
-
RESOURCE_MIME_TYPE2 as RESOURCE_MIME_TYPE,
|
|
1982
1951
|
ToolExecutionControlError2 as ToolExecutionControlError,
|
|
1983
1952
|
UploadToolInputSchema,
|
|
1984
1953
|
ViewFileErrorSchema2 as ViewFileErrorSchema,
|
|
1985
1954
|
ViewFileInputSchema2 as ViewFileInputSchema,
|
|
1986
1955
|
ViewFileOutputSchema2 as ViewFileOutputSchema,
|
|
1987
1956
|
bindContractAsyncOperation,
|
|
1988
|
-
bindStdioProcessSignals2 as bindStdioProcessSignals,
|
|
1989
|
-
buildMcpServer2 as buildMcpServer,
|
|
1990
1957
|
buildToolManifest2 as buildToolManifest,
|
|
1991
1958
|
coerceJsonArgs2 as coerceJsonArgs,
|
|
1992
1959
|
collectTools2 as collectTools,
|
|
1993
1960
|
composeToolLifecycle,
|
|
1994
1961
|
createAsyncOperationSnapshotSchema2 as createAsyncOperationSnapshotSchema,
|
|
1995
1962
|
createLocalStepDurability2 as createLocalStepDurability,
|
|
1996
|
-
createMcpHandler2 as createMcpHandler,
|
|
1997
|
-
createMcpHttpRoute2 as createMcpHttpRoute,
|
|
1998
1963
|
createRuntimeToolFactory2 as createRuntimeToolFactory,
|
|
1999
1964
|
createSecureClientMetadataFetcher,
|
|
2000
|
-
createStdioMcpServer2 as createStdioMcpServer,
|
|
2001
1965
|
createToolInvoker2 as createToolInvoker,
|
|
2002
1966
|
createToolLogger,
|
|
2003
|
-
createToolkit,
|
|
2004
1967
|
defineAsyncOperation,
|
|
2005
1968
|
defineAsyncOperationContract,
|
|
2006
1969
|
defineDownloadTool,
|
|
@@ -2013,25 +1976,18 @@ export {
|
|
|
2013
1976
|
findNonPortableFormats2 as findNonPortableFormats,
|
|
2014
1977
|
findUntypedProperties2 as findUntypedProperties,
|
|
2015
1978
|
flattenToolJsonSchema2 as flattenToolJsonSchema,
|
|
2016
|
-
inlineMcpAppBundle2 as inlineMcpAppBundle,
|
|
2017
1979
|
isAgentToolError2 as isAgentToolError,
|
|
2018
1980
|
isToolExecutionControlError2 as isToolExecutionControlError,
|
|
2019
1981
|
listContractToolNames,
|
|
2020
1982
|
listToolNames,
|
|
2021
|
-
mcpCatalogMeta2 as mcpCatalogMeta,
|
|
2022
|
-
mountAgent2 as mountAgent,
|
|
2023
1983
|
mountDownload,
|
|
2024
|
-
mountMcp2 as mountMcp,
|
|
2025
|
-
mountMcpResource2 as mountMcpResource,
|
|
2026
1984
|
mountOAuthProvider,
|
|
2027
1985
|
mountUpload,
|
|
2028
1986
|
mountViewFile,
|
|
2029
1987
|
mountWait,
|
|
2030
1988
|
oauthProtectedResourceRoute2 as oauthProtectedResourceRoute,
|
|
2031
1989
|
protectedResourceMetadataUrl2 as protectedResourceMetadataUrl,
|
|
2032
|
-
readMcpCatalogStamp2 as readMcpCatalogStamp,
|
|
2033
1990
|
resolveMedia,
|
|
2034
1991
|
summarizeTransports,
|
|
2035
|
-
validateMcpSchemas2 as validateMcpSchemas,
|
|
2036
1992
|
wwwAuthenticateHeader2 as wwwAuthenticateHeader
|
|
2037
1993
|
};
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
} from "./index-nn9qvkww.js";
|
|
8
8
|
import {
|
|
9
9
|
scanContainedFiles
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-aa50qwv4.js";
|
|
11
11
|
import {
|
|
12
12
|
writeContainedFile
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-e452syyh.js";
|
|
14
14
|
import {
|
|
15
15
|
listContainedDirectory,
|
|
16
16
|
missingContainedDirectories,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
containedEntryMetadata,
|
|
25
25
|
openContainedParentFile,
|
|
26
26
|
readContainedUtf8Handle
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-1jwsfkfz.js";
|
|
28
28
|
import {
|
|
29
29
|
defineRuntimeTool2
|
|
30
30
|
} from "./index-aqwg2dm5.js";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// src/tools/agent-tool-error.ts
|
|
2
|
+
var AGENT_TOOL_ERROR_BRAND = Symbol.for("stitchkit.AgentToolError");
|
|
3
|
+
|
|
4
|
+
class AgentToolError2 extends Error {
|
|
5
|
+
output;
|
|
6
|
+
constructor(output, cause) {
|
|
7
|
+
let message = "Tool execution failed";
|
|
8
|
+
try {
|
|
9
|
+
message = JSON.stringify(output);
|
|
10
|
+
} catch {}
|
|
11
|
+
super(message, cause === undefined ? undefined : { cause });
|
|
12
|
+
this.name = "AgentToolError";
|
|
13
|
+
this.output = output;
|
|
14
|
+
Object.defineProperty(this, AGENT_TOOL_ERROR_BRAND, { value: true });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function isAgentToolError2(value) {
|
|
18
|
+
return typeof value === "object" && value !== null && AGENT_TOOL_ERROR_BRAND in value;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { AgentToolError2, isAgentToolError2 };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/server/process-signal-common.ts
|
|
2
|
+
var DEFAULT_PROCESS_SIGNALS = ["SIGINT", "SIGTERM"];
|
|
3
|
+
var defaultSignalSource = {
|
|
4
|
+
on: (signal, handler) => {
|
|
5
|
+
process.on(signal, handler);
|
|
6
|
+
},
|
|
7
|
+
off: (signal, handler) => {
|
|
8
|
+
process.off(signal, handler);
|
|
9
|
+
},
|
|
10
|
+
raiseDefault: (signal) => {
|
|
11
|
+
if (process.listenerCount(signal) > 0)
|
|
12
|
+
return false;
|
|
13
|
+
process.kill(process.pid, signal);
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
function reportSignalError(phase, error, onError) {
|
|
18
|
+
try {
|
|
19
|
+
onError?.(phase, error);
|
|
20
|
+
} catch {}
|
|
21
|
+
}
|
|
22
|
+
function guardSignalCallback(run, phase, onError) {
|
|
23
|
+
try {
|
|
24
|
+
run();
|
|
25
|
+
} catch (error) {
|
|
26
|
+
reportSignalError(phase, error, onError);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export { DEFAULT_PROCESS_SIGNALS, defaultSignalSource, reportSignalError, guardSignalCallback };
|