stitchkit 0.100.2 → 0.101.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 +153 -0
- package/README.md +2 -1
- package/dist/entrypoints/agent-runtime/browser.js +119 -119
- package/dist/entrypoints/agent-runtime/coding-tools.js +15 -20
- package/dist/entrypoints/agent-runtime/harness.js +55 -63
- package/dist/entrypoints/agent-runtime/openrouter.js +6 -6
- package/dist/entrypoints/agent-runtime/sandbox.js +20 -25
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +11 -13
- package/dist/entrypoints/agent-runtime/sqlite/node.js +11 -13
- package/dist/entrypoints/agent-runtime/testing.js +32 -34
- package/dist/entrypoints/agent-runtime.js +395 -402
- package/dist/entrypoints/application/diagnostic-journal.js +26 -27
- package/dist/entrypoints/application/directory-inbox.js +16 -17
- package/dist/entrypoints/application/grammy.js +13 -13
- package/dist/entrypoints/application/opentelemetry.js +13 -13
- package/dist/entrypoints/application/schemas.js +24 -24
- package/dist/entrypoints/application.js +209 -210
- package/dist/entrypoints/bin/upgrade-cli.js +2 -2
- package/dist/entrypoints/cli.js +81 -84
- package/dist/entrypoints/contract.js +54 -57
- package/dist/entrypoints/declaration.js +22 -22
- package/dist/entrypoints/files.js +18 -21
- package/dist/entrypoints/geo.js +7 -8
- package/dist/entrypoints/google.js +2 -2
- package/dist/entrypoints/index.js +150 -154
- package/dist/entrypoints/live.js +45 -47
- package/dist/entrypoints/node.js +68 -74
- package/dist/entrypoints/oauth.js +6 -6
- package/dist/entrypoints/observability.d.ts +1 -0
- package/dist/entrypoints/observability.d.ts.map +1 -1
- package/dist/entrypoints/observability.js +116 -87
- package/dist/entrypoints/primitives.js +35 -35
- package/dist/entrypoints/react/keyboard.d.ts +4 -0
- package/dist/entrypoints/react/keyboard.d.ts.map +1 -0
- package/dist/entrypoints/react/keyboard.js +397 -0
- package/dist/entrypoints/react.js +10 -10
- package/dist/entrypoints/release.js +7 -7
- package/dist/entrypoints/remote.js +15 -17
- package/dist/entrypoints/server.js +198 -200
- package/dist/entrypoints/telegram/html.d.ts +5 -0
- package/dist/entrypoints/telegram/html.d.ts.map +1 -0
- package/dist/entrypoints/telegram/html.js +26 -0
- package/dist/entrypoints/telegram/screens.d.ts +14 -0
- package/dist/entrypoints/telegram/screens.d.ts.map +1 -0
- package/dist/entrypoints/telegram/screens.js +2028 -0
- package/dist/entrypoints/telegram.d.ts +11 -3
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +779 -159
- package/dist/entrypoints/testing.js +75 -79
- package/dist/entrypoints/tools/connections.js +30 -32
- package/dist/entrypoints/tools/contract.js +18 -20
- package/dist/entrypoints/tools/invoker.js +12 -17
- package/dist/entrypoints/tools.js +224 -229
- package/dist/entrypoints/tracking/server.js +6 -6
- package/dist/entrypoints/tracking.js +40 -42
- package/dist/entrypoints/voice.js +3 -3
- package/dist/{index-eaysmdtq.js → index-0ndk4555.js} +56 -56
- package/dist/{index-2bxbyab0.js → index-1bx1xv1k.js} +1 -1
- package/dist/{index-p5r7qpdd.js → index-1eeqpadm.js} +4 -4
- package/dist/{index-hadmp193.js → index-3ct7hhq6.js} +210 -210
- package/dist/{index-e01r054k.js → index-45tdvqa3.js} +26 -26
- package/dist/{index-dce5wxcq.js → index-4s0fep5q.js} +8 -8
- package/dist/index-50ejfz75.js +9 -0
- package/dist/{index-m9zn6cpq.js → index-5107q189.js} +12 -12
- package/dist/{index-sbdmyz75.js → index-5cc6r990.js} +3 -3
- package/dist/{index-c6bxbsnc.js → index-7kxw1awn.js} +2 -2
- package/dist/{index-0r0fbk7z.js → index-7z9ym7t8.js} +28 -28
- package/dist/{index-p7hgdyhb.js → index-814xpr6d.js} +2 -2
- package/dist/{index-gtj3zc53.js → index-8kzct1d6.js} +99 -99
- package/dist/{index-1zbbzgfh.js → index-9pw0a51a.js} +4 -4
- package/dist/{index-79z7m7dt.js → index-a9pd417t.js} +35 -35
- package/dist/{index-ham5sz8m.js → index-aaj97r4y.js} +45 -45
- package/dist/{index-s812ycat.js → index-aan6hqb9.js} +3 -3
- package/dist/{index-10x2hbx0.js → index-adhgd4pe.js} +44 -44
- package/dist/{index-2gxzjvyr.js → index-afjvjyck.js} +23 -23
- package/dist/{index-qmy6zq75.js → index-ahvsksw5.js} +16 -16
- package/dist/{index-hr4tzbwq.js → index-ap3gqe56.js} +3 -3
- package/dist/{index-znfs20ss.js → index-b2bz0kdm.js} +16 -16
- package/dist/{index-r066jx76.js → index-c6aagrbd.js} +148 -120
- package/dist/{index-k30h66yd.js → index-ck71tbcf.js} +9 -9
- package/dist/{index-eqqvgdb3.js → index-ct75c3at.js} +2 -2
- package/dist/{index-gw8bmyaj.js → index-djjhhgjk.js} +41 -41
- package/dist/{index-8qt2m66q.js → index-dvwj1f43.js} +43 -43
- package/dist/index-e05cjgtf.js +144 -0
- package/dist/{index-yw4fzmdz.js → index-e6c2spsd.js} +79 -30
- package/dist/{index-fhwqwxe0.js → index-ej331hah.js} +1 -1
- package/dist/{index-9t3dffv2.js → index-ewbaywk5.js} +5 -5
- package/dist/{index-7p1f0vp2.js → index-fyphpknh.js} +25 -25
- package/dist/{index-83bdg97s.js → index-g149e9pk.js} +1 -1
- package/dist/{index-ngfhvfpd.js → index-g6a3na27.js} +4 -4
- package/dist/{index-qwhynv6x.js → index-h124epcf.js} +20 -20
- package/dist/{index-h6eeys1v.js → index-h97tqqp1.js} +9 -9
- package/dist/{index-zcgf3gqf.js → index-hby4qhax.js} +10 -10
- package/dist/{index-5jrd0yng.js → index-j8aw2c0e.js} +4 -4
- package/dist/{index-d8m8zpd8.js → index-jzczzcsb.js} +14 -14
- package/dist/index-kqnd6a85.js +26 -0
- package/dist/{index-35mh5bhj.js → index-kw1ws0cs.js} +12 -12
- package/dist/{index-4gcnakhx.js → index-m38ej7e5.js} +2 -2
- package/dist/{index-ndddxtyx.js → index-m79yr938.js} +19 -19
- package/dist/{index-5p2m7we1.js → index-m9fndta6.js} +11 -11
- package/dist/index-mnkk1ffz.js +150 -0
- package/dist/index-n15jny5b.js +4 -0
- package/dist/{index-2vtcmrj9.js → index-n53mswt3.js} +20 -20
- package/dist/{index-bt14acb5.js → index-n5yqxd3d.js} +21 -21
- package/dist/{index-bm5rx7n6.js → index-n9tyz8z3.js} +12 -12
- package/dist/index-nmaqxdx7.js +463 -0
- package/dist/{index-mqv3b5rh.js → index-nx6eazt0.js} +30 -30
- package/dist/{index-3z73fh2c.js → index-q0th8q0z.js} +9 -9
- package/dist/{index-v260df89.js → index-qjeggp8w.js} +20 -20
- package/dist/{index-zfrhfn82.js → index-r1z0rd9c.js} +20 -20
- package/dist/{index-wqgjfstn.js → index-r5c4fedv.js} +3 -3
- package/dist/{index-cyktc4bp.js → index-r5hsgkz5.js} +118 -118
- package/dist/{index-0b1ess5e.js → index-r7a7r7ha.js} +1 -1
- package/dist/{index-1j8pm5t0.js → index-rfkh44ss.js} +15 -15
- package/dist/index-rz3z13e9.js +47 -0
- package/dist/{index-k6gpggb9.js → index-s80awwsw.js} +35 -35
- package/dist/{index-vqr7f7v8.js → index-ssmd41kh.js} +124 -124
- package/dist/index-sznqf8fx.js +20 -0
- package/dist/{index-ensd0r74.js → index-v14qqmys.js} +41 -41
- package/dist/{index-paz6sgdp.js → index-v4a2fjtk.js} +36 -36
- package/dist/{index-d9pk3td4.js → index-w0eqdhyd.js} +14 -14
- package/dist/{index-5qn1kx34.js → index-w575evhq.js} +29 -29
- package/dist/{index-3gye9wzb.js → index-w5s3xftz.js} +26 -26
- package/dist/{index-tm88avnj.js → index-wykebpn9.js} +3 -3
- package/dist/{index-sh3s86na.js → index-xkhk5d6g.js} +17 -17
- package/dist/{index-6k1937bx.js → index-xqhede6x.js} +4 -4
- package/dist/{index-f4fx2tza.js → index-zs4ms3th.js} +181 -181
- package/dist/{index-k5hsfc3j.js → index-zsvzhjtk.js} +1 -1
- package/dist/internal/secret-shapes.d.ts +21 -0
- package/dist/internal/secret-shapes.d.ts.map +1 -0
- package/dist/observability/bounded-logger.d.ts +2 -0
- package/dist/observability/bounded-logger.d.ts.map +1 -1
- package/dist/observability/sanitize.d.ts +6 -0
- package/dist/observability/sanitize.d.ts.map +1 -1
- package/dist/observability/secret-values.d.ts +25 -0
- package/dist/observability/secret-values.d.ts.map +1 -0
- package/dist/react/keyboard/hooks.d.ts +71 -0
- package/dist/react/keyboard/hooks.d.ts.map +1 -0
- package/dist/react/keyboard/layers.d.ts +98 -0
- package/dist/react/keyboard/layers.d.ts.map +1 -0
- package/dist/react/keyboard/zone.d.ts +139 -0
- package/dist/react/keyboard/zone.d.ts.map +1 -0
- package/dist/telegram/bot-api.d.ts +7 -4
- package/dist/telegram/bot-api.d.ts.map +1 -1
- package/dist/telegram/crypto.d.ts +16 -0
- package/dist/telegram/crypto.d.ts.map +1 -0
- package/dist/telegram/html/check.d.ts +26 -0
- package/dist/telegram/html/check.d.ts.map +1 -0
- package/dist/telegram/html/nodes.d.ts +70 -0
- package/dist/telegram/html/nodes.d.ts.map +1 -0
- package/dist/telegram/html/parse.d.ts +35 -0
- package/dist/telegram/html/parse.d.ts.map +1 -0
- package/dist/telegram/html/render.d.ts +39 -0
- package/dist/telegram/html/render.d.ts.map +1 -0
- package/dist/telegram/init-data.d.ts +3 -44
- package/dist/telegram/init-data.d.ts.map +1 -1
- package/dist/telegram/operator-channel.d.ts +19 -3
- package/dist/telegram/operator-channel.d.ts.map +1 -1
- package/dist/telegram/operator-dedupe.d.ts +44 -0
- package/dist/telegram/operator-dedupe.d.ts.map +1 -0
- package/dist/telegram/screens/callback-codec.d.ts +34 -0
- package/dist/telegram/screens/callback-codec.d.ts.map +1 -0
- package/dist/telegram/screens/dispatch.d.ts +22 -0
- package/dist/telegram/screens/dispatch.d.ts.map +1 -0
- package/dist/telegram/screens/display.d.ts +70 -0
- package/dist/telegram/screens/display.d.ts.map +1 -0
- package/dist/telegram/screens/execute.d.ts +57 -0
- package/dist/telegram/screens/execute.d.ts.map +1 -0
- package/dist/telegram/screens/html.d.ts +36 -0
- package/dist/telegram/screens/html.d.ts.map +1 -0
- package/dist/telegram/screens/outcome.d.ts +74 -0
- package/dist/telegram/screens/outcome.d.ts.map +1 -0
- package/dist/telegram/screens/path.d.ts +29 -0
- package/dist/telegram/screens/path.d.ts.map +1 -0
- package/dist/telegram/screens/reconcile.d.ts +67 -0
- package/dist/telegram/screens/reconcile.d.ts.map +1 -0
- package/dist/telegram/screens/registry.d.ts +23 -0
- package/dist/telegram/screens/registry.d.ts.map +1 -0
- package/dist/telegram/screens/render.d.ts +70 -0
- package/dist/telegram/screens/render.d.ts.map +1 -0
- package/dist/telegram/screens/runtime.d.ts +133 -0
- package/dist/telegram/screens/runtime.d.ts.map +1 -0
- package/dist/telegram/screens/screen-types.d.ts +130 -0
- package/dist/telegram/screens/screen-types.d.ts.map +1 -0
- package/dist/telegram/screens/screen.d.ts +138 -0
- package/dist/telegram/screens/screen.d.ts.map +1 -0
- package/dist/telegram/screens/state.d.ts +115 -0
- package/dist/telegram/screens/state.d.ts.map +1 -0
- package/dist/telegram/screens/telegram-screens.d.ts +18 -0
- package/dist/telegram/screens/telegram-screens.d.ts.map +1 -0
- package/dist/telegram/screens/test-chat-telegram.d.ts +47 -0
- package/dist/telegram/screens/test-chat-telegram.d.ts.map +1 -0
- package/dist/telegram/screens/test-chat.d.ts +66 -0
- package/dist/telegram/screens/test-chat.d.ts.map +1 -0
- package/dist/telegram/screens/view.d.ts +89 -0
- package/dist/telegram/screens/view.d.ts.map +1 -0
- package/dist/telegram/send-failure.d.ts +25 -0
- package/dist/telegram/send-failure.d.ts.map +1 -1
- package/dist/telegram/update-intake.d.ts +82 -0
- package/dist/telegram/update-intake.d.ts.map +1 -0
- package/dist/telegram/update-store-check.d.ts +22 -0
- package/dist/telegram/update-store-check.d.ts.map +1 -0
- package/dist/telegram/update-store-postgres.d.ts +33 -0
- package/dist/telegram/update-store-postgres.d.ts.map +1 -0
- package/dist/telegram/update-store-sqlite.d.ts +26 -0
- package/dist/telegram/update-store-sqlite.d.ts.map +1 -0
- package/dist/telegram/update-store.d.ts +67 -0
- package/dist/telegram/update-store.d.ts.map +1 -0
- package/dist/telegram/user.d.ts +51 -0
- package/dist/telegram/user.d.ts.map +1 -0
- package/dist/telegram/webhook.d.ts +105 -0
- package/dist/telegram/webhook.d.ts.map +1 -0
- package/dist/tools/cli/args-fields.d.ts +8 -0
- package/dist/tools/cli/args-fields.d.ts.map +1 -1
- package/dist/tools/cli/args-route.d.ts.map +1 -1
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/help.d.ts.map +1 -1
- package/llms/cli.txt +8 -2
- package/llms/observability.txt +15 -2
- package/llms/react-keyboard.txt +193 -0
- package/llms/server.4.txt +16 -0
- package/llms/stitchkit.txt +10 -4
- package/llms/telegram-html.txt +35 -0
- package/llms/telegram-screens.txt +365 -0
- package/llms/telegram.txt +245 -11
- package/llms/{upgrading-0.74.0-0.100.0.txt → upgrading-0.74.0-0.101.0.txt} +39 -3
- package/llms/upgrading.txt +1 -1
- package/llms-full.txt +889 -19
- package/llms.txt +12 -7
- package/package.json +17 -2
- package/dist/index-2k4yrqkc.js +0 -9
- package/dist/index-crykmqkr.js +0 -26
- package/dist/index-y64k3s0h.js +0 -150
- package/dist/index-y91ry9h2.js +0 -4
- /package/dist/{index-hffjpmq9.js → index-9jfdm5tg.js} +0 -0
- /package/dist/{index-zjjyynm3.js → index-d4pa2bgs.js} +0 -0
- /package/dist/{index-rxfy4cq7.js → index-dwfv9a85.js} +0 -0
- /package/dist/{index-5jm36zv1.js → index-gfk7nrht.js} +0 -0
- /package/dist/{index-b9aefrqd.js → index-n1dqr7gf.js} +0 -0
- /package/dist/{index-q3pyb9n0.js → index-sykb5ag7.js} +0 -0
- /package/dist/{index-48ffdxgk.js → index-xhzq2qvj.js} +0 -0
- /package/dist/{index-kzfs85xp.js → index-zsarb5xp.js} +0 -0
|
@@ -1,54 +1,50 @@
|
|
|
1
|
+
import"../index-hby4qhax.js";
|
|
2
|
+
import"../index-qjeggp8w.js";
|
|
1
3
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../index-
|
|
4
|
-
import"../index-
|
|
5
|
-
import"../index-2k4yrqkc.js";
|
|
6
|
-
import"../index-3z73fh2c.js";
|
|
7
|
-
import {
|
|
8
|
-
RealtimeRejectDirectionSchema,
|
|
9
|
-
RealtimeRejectFaultSchema,
|
|
10
|
-
RealtimeRejectPhaseSchema,
|
|
11
|
-
RealtimeRejectReasonSchema
|
|
12
|
-
} from "../index-p7hgdyhb.js";
|
|
4
|
+
joinRoutePath
|
|
5
|
+
} from "../index-m38ej7e5.js";
|
|
6
|
+
import"../index-r5c4fedv.js";
|
|
13
7
|
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
} from "../index-
|
|
8
|
+
createClient2,
|
|
9
|
+
createClients2
|
|
10
|
+
} from "../index-aaj97r4y.js";
|
|
11
|
+
import"../index-n53mswt3.js";
|
|
12
|
+
import"../index-q0th8q0z.js";
|
|
17
13
|
import {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} from "../index-dce5wxcq.js";
|
|
22
|
-
import"../index-48ffdxgk.js";
|
|
23
|
-
import"../index-wqgjfstn.js";
|
|
24
|
-
import"../index-v260df89.js";
|
|
14
|
+
createApplication2
|
|
15
|
+
} from "../index-w575evhq.js";
|
|
16
|
+
import"../index-w5s3xftz.js";
|
|
25
17
|
import {
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
RealtimeRequestTimeoutError2,
|
|
19
|
+
RealtimeRequestDisconnectedError2,
|
|
20
|
+
RealtimeRequestInvalidAcknowledgementError2
|
|
21
|
+
} from "../index-4s0fep5q.js";
|
|
28
22
|
import {
|
|
29
|
-
|
|
30
|
-
} from "../index-
|
|
31
|
-
import"../index-zcgf3gqf.js";
|
|
23
|
+
TOOL_TRANSPORTS2
|
|
24
|
+
} from "../index-ck71tbcf.js";
|
|
32
25
|
import {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} from "../index-
|
|
26
|
+
RealtimeRejectDirectionSchema,
|
|
27
|
+
RealtimeRejectPhaseSchema,
|
|
28
|
+
RealtimeRejectReasonSchema,
|
|
29
|
+
RealtimeRejectFaultSchema
|
|
30
|
+
} from "../index-814xpr6d.js";
|
|
38
31
|
import {
|
|
39
32
|
toJsonSchema
|
|
40
|
-
} from "../index-
|
|
41
|
-
import
|
|
42
|
-
|
|
43
|
-
|
|
33
|
+
} from "../index-ct75c3at.js";
|
|
34
|
+
import {
|
|
35
|
+
staticInputRounds,
|
|
36
|
+
projectToolSurface,
|
|
37
|
+
mcpProjectionCandidate,
|
|
38
|
+
prepareProjectedMcpTools
|
|
39
|
+
} from "../index-7z9ym7t8.js";
|
|
40
|
+
import"../index-b2bz0kdm.js";
|
|
44
41
|
import {
|
|
45
42
|
compareCodeUnits,
|
|
46
43
|
serializeCanonicalJson
|
|
47
|
-
} from "../index-
|
|
48
|
-
import"../index-kzfs85xp.js";
|
|
44
|
+
} from "../index-zsvzhjtk.js";
|
|
49
45
|
import {
|
|
50
46
|
isRecord
|
|
51
|
-
} from "../index-
|
|
47
|
+
} from "../index-9jfdm5tg.js";
|
|
52
48
|
|
|
53
49
|
// src/testing/handler-clients.ts
|
|
54
50
|
function resolveTestBaseUrl(origin, pathPrefix) {
|
|
@@ -70,10 +66,10 @@ function createTestClientConfig(config) {
|
|
|
70
66
|
};
|
|
71
67
|
}
|
|
72
68
|
function createHandlerTestClient(config) {
|
|
73
|
-
return
|
|
69
|
+
return createClient2(config.contract, createTestClientConfig(config), config.contractConfig);
|
|
74
70
|
}
|
|
75
71
|
function createHandlerTestClients(config) {
|
|
76
|
-
return
|
|
72
|
+
return createClients2(config.contracts, createTestClientConfig(config), config.contractConfig);
|
|
77
73
|
}
|
|
78
74
|
// src/testing/managed-resource-conformance-contract.ts
|
|
79
75
|
import { z } from "zod";
|
|
@@ -462,7 +458,7 @@ async function completionBeforeReady(runtime) {
|
|
|
462
458
|
async function lateCompletion(runtime) {
|
|
463
459
|
await startSuccessfully(runtime);
|
|
464
460
|
const expectedHealth = runtime.scenario.required ? "unhealthy" : "degraded";
|
|
465
|
-
const changed = waitForSnapshot(runtime.application, (
|
|
461
|
+
const changed = waitForSnapshot(runtime.application, (snapshot) => snapshot.health === expectedHealth);
|
|
466
462
|
runtime.gates.reject("completion", new Error("controlled late completion rejection"));
|
|
467
463
|
const snapshot = await changed;
|
|
468
464
|
requireCondition(snapshot.lifecycle === "ready", "late completion changed lifecycle ownership");
|
|
@@ -521,7 +517,7 @@ function expectedManagedResourceConformanceTrace(scenarioId) {
|
|
|
521
517
|
return EXPECTED_TRACE[scenarioId];
|
|
522
518
|
}
|
|
523
519
|
async function executeManagedResourceConformanceScenario(scenario, resource, gates, trace) {
|
|
524
|
-
const application =
|
|
520
|
+
const application = createApplication2({
|
|
525
521
|
id: `conformance-${scenario.id}`,
|
|
526
522
|
resources: [observeManagedResource(resource, scenario.required, trace)]
|
|
527
523
|
});
|
|
@@ -790,7 +786,7 @@ function runtimeOperationSource(source) {
|
|
|
790
786
|
// src/testing/surface-manifest.ts
|
|
791
787
|
var SURFACE_MANIFEST_VERSION = 3;
|
|
792
788
|
var HttpMethodSchema = z2.enum(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"]);
|
|
793
|
-
var ToolTransportSchema = z2.enum(
|
|
789
|
+
var ToolTransportSchema = z2.enum(TOOL_TRANSPORTS2);
|
|
794
790
|
var SurfaceTransportSchema = z2.enum(["HTTP", "MCP", "AGENT", "CLI", "REALTIME"]);
|
|
795
791
|
var SurfaceSchemaDigestsSchema = z2.object({
|
|
796
792
|
params: z2.string().nullable(),
|
|
@@ -1081,7 +1077,7 @@ function assertSurfaceDiscovery(manifest, observed) {
|
|
|
1081
1077
|
if (observed.openApi) {
|
|
1082
1078
|
assertSameSet("HTTP/OpenAPI", manifest.operations.flatMap((operation) => operation.http.map((entry) => `${entry.method}:${entry.path.replace(/:([^/]+)/g, "{$1}")}`)), openApiOperations(observed.openApi));
|
|
1083
1079
|
}
|
|
1084
|
-
for (const transport of
|
|
1080
|
+
for (const transport of TOOL_TRANSPORTS2) {
|
|
1085
1081
|
const names = observed[transport];
|
|
1086
1082
|
if (names) {
|
|
1087
1083
|
assertSameSet(`${transport} discovery`, expectedToolNames(manifest, transport, null), names);
|
|
@@ -1291,11 +1287,11 @@ function createRealtimeProbeDriver({
|
|
|
1291
1287
|
if (observedRejection) {
|
|
1292
1288
|
return withCalls({
|
|
1293
1289
|
outcome: "realtime_rejected",
|
|
1294
|
-
code: error instanceof
|
|
1290
|
+
code: error instanceof RealtimeRequestInvalidAcknowledgementError2 ? error.code : observedRejection.error.code,
|
|
1295
1291
|
rejection: rejectionObservation(observedRejection)
|
|
1296
1292
|
});
|
|
1297
1293
|
}
|
|
1298
|
-
if (error instanceof
|
|
1294
|
+
if (error instanceof RealtimeRequestInvalidAcknowledgementError2) {
|
|
1299
1295
|
return withCalls({
|
|
1300
1296
|
outcome: "realtime_rejected",
|
|
1301
1297
|
code: error.code,
|
|
@@ -1307,7 +1303,7 @@ function createRealtimeProbeDriver({
|
|
|
1307
1303
|
}
|
|
1308
1304
|
});
|
|
1309
1305
|
}
|
|
1310
|
-
if (error instanceof
|
|
1306
|
+
if (error instanceof RealtimeRequestDisconnectedError2) {
|
|
1311
1307
|
return withCalls({
|
|
1312
1308
|
outcome: "disconnected",
|
|
1313
1309
|
code: error.code,
|
|
@@ -1316,7 +1312,7 @@ function createRealtimeProbeDriver({
|
|
|
1316
1312
|
}
|
|
1317
1313
|
});
|
|
1318
1314
|
}
|
|
1319
|
-
if (error instanceof
|
|
1315
|
+
if (error instanceof RealtimeRequestTimeoutError2) {
|
|
1320
1316
|
return withCalls({ outcome: "timeout", code: error.code });
|
|
1321
1317
|
}
|
|
1322
1318
|
if (signal.aborted && error === signal.reason) {
|
|
@@ -1324,10 +1320,10 @@ function createRealtimeProbeDriver({
|
|
|
1324
1320
|
}
|
|
1325
1321
|
const parsedRejection = RealtimeRejectionObservationSchema.safeParse(typeof error === "object" && error !== null && "details" in error ? error.details : undefined);
|
|
1326
1322
|
if (parsedRejection.success) {
|
|
1327
|
-
const
|
|
1323
|
+
const code = typeof error === "object" && error !== null && "code" in error ? String(error.code) : "REALTIME_CONTRACT_VIOLATION";
|
|
1328
1324
|
return withCalls({
|
|
1329
1325
|
outcome: "realtime_rejected",
|
|
1330
|
-
code
|
|
1326
|
+
code,
|
|
1331
1327
|
rejection: parsedRejection.data
|
|
1332
1328
|
});
|
|
1333
1329
|
}
|
|
@@ -1344,34 +1340,34 @@ function createRealtimeProbeDriver({
|
|
|
1344
1340
|
};
|
|
1345
1341
|
}
|
|
1346
1342
|
export {
|
|
1347
|
-
|
|
1348
|
-
runSurfaceProbes,
|
|
1349
|
-
runManagedResourceConformance,
|
|
1350
|
-
defineRealtimeProbe,
|
|
1351
|
-
createRealtimeProbeDriver,
|
|
1352
|
-
createHandlerTestClients,
|
|
1353
|
-
createHandlerTestClient,
|
|
1354
|
-
buildSurfaceManifest,
|
|
1355
|
-
assertSurfaceManifestSnapshot,
|
|
1356
|
-
assertSurfaceDiscovery,
|
|
1357
|
-
TransportObservationSchema,
|
|
1358
|
-
SurfaceSchemaDigestsSchema,
|
|
1359
|
-
SurfaceRealtimeSchemaPairSchema,
|
|
1360
|
-
SurfaceManifestToolSurfaceSchema,
|
|
1361
|
-
SurfaceManifestToolSchema,
|
|
1362
|
-
SurfaceManifestSchema,
|
|
1363
|
-
SurfaceManifestRealtimeEventSchema,
|
|
1364
|
-
SurfaceManifestOperationToolViewSchema,
|
|
1365
|
-
SurfaceManifestOperationSchema,
|
|
1366
|
-
SurfaceManifestOperationMcpSchema,
|
|
1367
|
-
SurfaceManifestExtensionSchema,
|
|
1368
|
-
SURFACE_MANIFEST_VERSION,
|
|
1369
|
-
RealtimeRejectionObservationSchema,
|
|
1370
|
-
RealtimeDisconnectObservationSchema,
|
|
1371
|
-
ManagedResourceConformanceTraceOutcomeSchema,
|
|
1372
|
-
ManagedResourceConformanceTraceEntrySchema,
|
|
1373
|
-
ManagedResourceConformanceScenarioSchema,
|
|
1374
|
-
ManagedResourceConformanceScenarioIdSchema,
|
|
1343
|
+
ManagedResourceConformanceError,
|
|
1375
1344
|
ManagedResourceConformancePhaseSchema,
|
|
1376
|
-
|
|
1345
|
+
ManagedResourceConformanceScenarioIdSchema,
|
|
1346
|
+
ManagedResourceConformanceScenarioSchema,
|
|
1347
|
+
ManagedResourceConformanceTraceEntrySchema,
|
|
1348
|
+
ManagedResourceConformanceTraceOutcomeSchema,
|
|
1349
|
+
RealtimeDisconnectObservationSchema,
|
|
1350
|
+
RealtimeRejectionObservationSchema,
|
|
1351
|
+
SURFACE_MANIFEST_VERSION,
|
|
1352
|
+
SurfaceManifestExtensionSchema,
|
|
1353
|
+
SurfaceManifestOperationMcpSchema,
|
|
1354
|
+
SurfaceManifestOperationSchema,
|
|
1355
|
+
SurfaceManifestOperationToolViewSchema,
|
|
1356
|
+
SurfaceManifestRealtimeEventSchema,
|
|
1357
|
+
SurfaceManifestSchema,
|
|
1358
|
+
SurfaceManifestToolSchema,
|
|
1359
|
+
SurfaceManifestToolSurfaceSchema,
|
|
1360
|
+
SurfaceRealtimeSchemaPairSchema,
|
|
1361
|
+
SurfaceSchemaDigestsSchema,
|
|
1362
|
+
TransportObservationSchema,
|
|
1363
|
+
assertSurfaceDiscovery,
|
|
1364
|
+
assertSurfaceManifestSnapshot,
|
|
1365
|
+
buildSurfaceManifest,
|
|
1366
|
+
createHandlerTestClient,
|
|
1367
|
+
createHandlerTestClients,
|
|
1368
|
+
createRealtimeProbeDriver,
|
|
1369
|
+
defineRealtimeProbe,
|
|
1370
|
+
runManagedResourceConformance,
|
|
1371
|
+
runSurfaceProbes,
|
|
1372
|
+
serializeSurfaceValue
|
|
1377
1373
|
};
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
defineRuntimeTool
|
|
3
|
-
} from "../../index-d8m8zpd8.js";
|
|
1
|
+
import"../../index-ct75c3at.js";
|
|
4
2
|
import {
|
|
5
3
|
declaresDraft07,
|
|
6
4
|
withDefsDialect
|
|
7
|
-
} from "../../index-
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
5
|
+
} from "../../index-7z9ym7t8.js";
|
|
6
|
+
import {
|
|
7
|
+
AppError2
|
|
8
|
+
} from "../../index-n53mswt3.js";
|
|
9
|
+
import"../../index-b2bz0kdm.js";
|
|
11
10
|
import {
|
|
12
|
-
|
|
13
|
-
} from "../../index-
|
|
14
|
-
import"../../index-k5hsfc3j.js";
|
|
11
|
+
defineRuntimeTool2
|
|
12
|
+
} from "../../index-jzczzcsb.js";
|
|
15
13
|
import {
|
|
16
14
|
safeJsonParse
|
|
17
|
-
} from "../../index-
|
|
15
|
+
} from "../../index-zsarb5xp.js";
|
|
18
16
|
import {
|
|
19
17
|
isRecord
|
|
20
|
-
} from "../../index-
|
|
18
|
+
} from "../../index-9jfdm5tg.js";
|
|
21
19
|
|
|
22
20
|
// src/tools/connections/errors.ts
|
|
23
21
|
class ConnectionAuthorizationRequiredError extends Error {
|
|
@@ -465,9 +463,9 @@ class McpHttpClient {
|
|
|
465
463
|
for await (const frame of readSseFrames(response, this.options.maxResponseBytes, this.connectionName, true)) {
|
|
466
464
|
if (!frame.data)
|
|
467
465
|
continue;
|
|
468
|
-
const
|
|
469
|
-
if (isRecord(
|
|
470
|
-
return unwrap(
|
|
466
|
+
const payload = JSON.parse(frame.data);
|
|
467
|
+
if (isRecord(payload) && payload.id === message.id)
|
|
468
|
+
return unwrap(payload, message.id, this.connectionName);
|
|
471
469
|
}
|
|
472
470
|
throw new Error("MCP stream ended without a response");
|
|
473
471
|
}
|
|
@@ -546,9 +544,9 @@ function mcpToolFailure(toolName, result) {
|
|
|
546
544
|
if (isRecord(payload) && typeof payload.error === "string") {
|
|
547
545
|
const details = isRecord(payload.details) ? payload.details : undefined;
|
|
548
546
|
const message = typeof details?.message === "string" ? details.message : payload.error;
|
|
549
|
-
return new
|
|
547
|
+
return new AppError2(payload.error, message, 502, details, typeof payload._hint === "string" ? payload._hint : undefined, undefined, typeof payload.retryable === "boolean" ? payload.retryable : undefined);
|
|
550
548
|
}
|
|
551
|
-
return new
|
|
549
|
+
return new AppError2(UPSTREAM_TOOL_ERROR, `External MCP tool "${toolName}" returned an error`, 502, payload === undefined ? undefined : { upstream: payload });
|
|
552
550
|
}
|
|
553
551
|
|
|
554
552
|
// src/tools/connections/runtime.ts
|
|
@@ -633,7 +631,7 @@ async function mountMcpConnection(connection, instanceId, onSkipped) {
|
|
|
633
631
|
const name = tool.name;
|
|
634
632
|
const description = tool.description ?? `External MCP tool "${name}"`;
|
|
635
633
|
const input = zodObjectFromJsonSchema(tool.inputSchema);
|
|
636
|
-
const definition =
|
|
634
|
+
const definition = defineRuntimeTool2({
|
|
637
635
|
name,
|
|
638
636
|
description,
|
|
639
637
|
identity: { serviceName: connection.name, action: name, method: "POST" },
|
|
@@ -697,7 +695,7 @@ function resolveOpenApiDocument(document) {
|
|
|
697
695
|
if (refs.includes(ref))
|
|
698
696
|
throw new TypeError("OpenAPI recursive references are unsupported");
|
|
699
697
|
let target = document;
|
|
700
|
-
for (const part of ref.slice(2).split("/").map((
|
|
698
|
+
for (const part of ref.slice(2).split("/").map((part) => part.replace(/~1/g, "/").replace(/~0/g, "~"))) {
|
|
701
699
|
if (!isRecord(target) || !Object.hasOwn(target, part))
|
|
702
700
|
throw new TypeError("OpenAPI reference does not resolve");
|
|
703
701
|
target = target[part];
|
|
@@ -764,7 +762,7 @@ async function mountOpenApiConnection(connection, instanceId, onSkipped) {
|
|
|
764
762
|
const schema = operationInputSchema(document, entry);
|
|
765
763
|
const input = zodObjectFromJsonSchema(schema);
|
|
766
764
|
const auth = resolveAuth(document, entry.operation);
|
|
767
|
-
const definition =
|
|
765
|
+
const definition = defineRuntimeTool2({
|
|
768
766
|
name,
|
|
769
767
|
description,
|
|
770
768
|
identity: {
|
|
@@ -826,10 +824,10 @@ async function loadOpenApiDocument(connection, timeoutMs, maxResponseBytes) {
|
|
|
826
824
|
}
|
|
827
825
|
const text = connection.spec.trim();
|
|
828
826
|
if (text.startsWith("{")) {
|
|
829
|
-
const
|
|
830
|
-
if (!isRecord(
|
|
827
|
+
const parsed = JSON.parse(text);
|
|
828
|
+
if (!isRecord(parsed))
|
|
831
829
|
throw new Error(`OpenAPI spec of "${connection.name}" is not an object`);
|
|
832
|
-
return { document:
|
|
830
|
+
return { document: parsed };
|
|
833
831
|
}
|
|
834
832
|
const url = assertConnectionUrl(text, connection.name);
|
|
835
833
|
const parsed = await withConnectionDeadline(connection.name, timeoutMs, undefined, async (signal) => {
|
|
@@ -1079,9 +1077,9 @@ async function mountConnections(connections, options = {}) {
|
|
|
1079
1077
|
}
|
|
1080
1078
|
const schemaLimit = options.budget?.maxSchemaBytes;
|
|
1081
1079
|
if (schemaLimit !== undefined) {
|
|
1082
|
-
const
|
|
1083
|
-
if (
|
|
1084
|
-
throw new ConnectionBudgetExceededError(schemaLimit,
|
|
1080
|
+
const schemaBytes = tools.reduce((total, tool) => total + foreignSchemaBytes(tool), 0);
|
|
1081
|
+
if (schemaBytes > schemaLimit) {
|
|
1082
|
+
throw new ConnectionBudgetExceededError(schemaLimit, schemaBytes, "schema bytes");
|
|
1085
1083
|
}
|
|
1086
1084
|
}
|
|
1087
1085
|
return tools;
|
|
@@ -1100,11 +1098,11 @@ function instanceIdOf(connection) {
|
|
|
1100
1098
|
return connectionInstanceId(connection.name, url, connection.instanceKey);
|
|
1101
1099
|
}
|
|
1102
1100
|
export {
|
|
1103
|
-
|
|
1104
|
-
defineOpenApiConnection,
|
|
1105
|
-
defineMcpClientConnection,
|
|
1106
|
-
ConnectionUrlError,
|
|
1107
|
-
ConnectionRequestError,
|
|
1101
|
+
ConnectionAuthorizationRequiredError,
|
|
1108
1102
|
ConnectionBudgetExceededError,
|
|
1109
|
-
|
|
1103
|
+
ConnectionRequestError,
|
|
1104
|
+
ConnectionUrlError,
|
|
1105
|
+
defineMcpClientConnection,
|
|
1106
|
+
defineOpenApiConnection,
|
|
1107
|
+
mountConnections
|
|
1110
1108
|
};
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "../../index-
|
|
2
|
+
AsyncOperationCancelResultSchema2,
|
|
3
|
+
createAsyncOperationSnapshotSchema2,
|
|
4
|
+
McpAnnotationsSchema2,
|
|
5
|
+
McpMediaContentSchema2,
|
|
6
|
+
ViewFileErrorSchema2,
|
|
7
|
+
ViewFileOutputSchema2,
|
|
8
|
+
ViewFileInputSchema2
|
|
9
|
+
} from "../../index-5107q189.js";
|
|
10
10
|
import {
|
|
11
|
-
|
|
12
|
-
} from "../../index-
|
|
13
|
-
import"../../index-kzfs85xp.js";
|
|
14
|
-
import"../../index-hffjpmq9.js";
|
|
11
|
+
coerceJsonArgs2
|
|
12
|
+
} from "../../index-9pw0a51a.js";
|
|
15
13
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
AsyncOperationCancelResultSchema2 as AsyncOperationCancelResultSchema,
|
|
15
|
+
McpAnnotationsSchema2 as McpAnnotationsSchema,
|
|
16
|
+
McpMediaContentSchema2 as McpMediaContentSchema,
|
|
17
|
+
ViewFileErrorSchema2 as ViewFileErrorSchema,
|
|
18
|
+
ViewFileInputSchema2 as ViewFileInputSchema,
|
|
19
|
+
ViewFileOutputSchema2 as ViewFileOutputSchema,
|
|
20
|
+
coerceJsonArgs2 as coerceJsonArgs,
|
|
21
|
+
createAsyncOperationSnapshotSchema2 as createAsyncOperationSnapshotSchema
|
|
24
22
|
};
|
|
@@ -1,20 +1,15 @@
|
|
|
1
|
+
import"../../index-n53mswt3.js";
|
|
2
|
+
import"../../index-b2bz0kdm.js";
|
|
3
|
+
import"../../index-dvwj1f43.js";
|
|
4
|
+
import"../../index-hby4qhax.js";
|
|
5
|
+
import"../../index-9pw0a51a.js";
|
|
6
|
+
import"../../index-ct75c3at.js";
|
|
7
|
+
import"../../index-7z9ym7t8.js";
|
|
8
|
+
import"../../index-n9tyz8z3.js";
|
|
1
9
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../index-
|
|
4
|
-
import"../../index-
|
|
5
|
-
import"../../index-8qt2m66q.js";
|
|
6
|
-
import"../../index-zfrhfn82.js";
|
|
7
|
-
import"../../index-35mh5bhj.js";
|
|
8
|
-
import"../../index-zcgf3gqf.js";
|
|
9
|
-
import"../../index-1zbbzgfh.js";
|
|
10
|
-
import"../../index-0r0fbk7z.js";
|
|
11
|
-
import"../../index-eqqvgdb3.js";
|
|
12
|
-
import"../../index-znfs20ss.js";
|
|
13
|
-
import"../../index-p5r7qpdd.js";
|
|
14
|
-
import"../../index-2vtcmrj9.js";
|
|
15
|
-
import"../../index-k5hsfc3j.js";
|
|
16
|
-
import"../../index-kzfs85xp.js";
|
|
17
|
-
import"../../index-hffjpmq9.js";
|
|
10
|
+
createToolInvoker2
|
|
11
|
+
} from "../../index-m9fndta6.js";
|
|
12
|
+
import"../../index-r1z0rd9c.js";
|
|
18
13
|
export {
|
|
19
|
-
createToolInvoker
|
|
14
|
+
createToolInvoker2 as createToolInvoker
|
|
20
15
|
};
|