@runlith/tagma 0.0.0-stage → 0.1.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/adapter/claudeHooks.d.ts +10 -0
- package/adapter/claudeHooks.js +4 -0
- package/adapter/declaration.d.ts +14 -0
- package/adapter/declaration.js +2 -0
- package/adapter/harness.d.ts +454 -0
- package/adapter/harness.js +2 -0
- package/adapter/hook.d.ts +43 -0
- package/adapter/hook.js +2 -0
- package/adapter/hostModules.d.ts +19 -0
- package/adapter/hostModules.js +2 -0
- package/adapter/loader.d.ts +10 -0
- package/adapter/loader.js +2 -0
- package/adapter/metadata.d.ts +179 -0
- package/adapter/metadata.js +4 -0
- package/adapter/payload.d.ts +19 -0
- package/adapter/payload.js +3 -0
- package/adapter/provider.d.ts +209 -0
- package/adapter/provider.js +2 -0
- package/adapter/settings.d.ts +182 -0
- package/adapter/settings.js +2 -0
- package/adapter/speech.d.ts +4 -0
- package/adapter/speech.js +2 -0
- package/host.d.ts +61223 -0
- package/package.json +129 -3
- package/plugin/Held-6krt6ncs.js +6 -0
- package/plugin/accountKey-tdjj67f5.js +2 -0
- package/plugin/adapter-qdnpxs6n.js +1 -0
- package/plugin/anthropic-a4pdzrv2.js +2 -0
- package/plugin/anthropic-messages-7gtja121.js +2 -0
- package/plugin/anthropic-z9xqmm3q.js +2 -0
- package/plugin/auth-0w6kk39v.js +2 -0
- package/plugin/authStatus-a1g3eb9p.js +2 -0
- package/plugin/bundling.d.ts +30 -0
- package/plugin/bundling.js +2 -0
- package/plugin/cacheLifetime-c5mpw676.js +2 -0
- package/plugin/callback-server-0wrzmjfx.js +16 -0
- package/plugin/capabilities-n3vfpy41.js +2 -0
- package/plugin/claudeHooks-edpg1e46.js +3 -0
- package/plugin/cli.js +21 -0
- package/plugin/cliStore-9rhjxtht.js +2 -0
- package/plugin/clientSession-tmmxm39z.js +2 -0
- package/plugin/codec-aa8mxqyr.js +1 -0
- package/plugin/connect-vrdsw05j.js +2 -0
- package/plugin/contract-qn0z7r9c.js +1 -0
- package/plugin/credential-5sgapkh0.js +2 -0
- package/plugin/deepseek-fvdrmjr9.js +2 -0
- package/plugin/deepseek-v388d1wv.js +2 -0
- package/plugin/definition-s3xx207f.js +2 -0
- package/plugin/description-8xhxryaq.js +2 -0
- package/plugin/deviceGrant-vgbscpr4.js +2 -0
- package/plugin/devin-hy98d305.js +2 -0
- package/plugin/duplex-kpmftvf7.js +2 -0
- package/plugin/endpoint-kvf97tz7.js +2 -0
- package/plugin/errors-5t42p4q1.js +2 -0
- package/plugin/events-e8vv9hda.js +2 -0
- package/plugin/events-s95ybm4g.js +2 -0
- package/plugin/executor-q8kp5q8h.js +2 -0
- package/plugin/failure-vr32debc.js +2 -0
- package/plugin/framing-nktw5sts.js +2 -0
- package/plugin/grant-67b10nhx.js +2 -0
- package/plugin/harness-nrh78w4d.js +2 -0
- package/plugin/headers-ss3dzznj.js +2 -0
- package/plugin/hook-hjrk83m8.js +2 -0
- package/plugin/icon-044pa3y8.js +6 -0
- package/plugin/icon-j22svmgp.js +4 -0
- package/plugin/icon-ny6qbjvc.js +4 -0
- package/plugin/icon-pz54e8n3.js +4 -0
- package/plugin/icon-qy92jx2b.js +4 -0
- package/plugin/ids-n269hc5k.js +2 -0
- package/plugin/images-q80x3bt1.js +2 -0
- package/plugin/index-cyd7v366.js +2 -0
- package/plugin/index-jpmjpmkn.js +2 -0
- package/plugin/lifecycle-qf4fh5m8.js +2 -0
- package/plugin/manual-2mdscj84.js +2 -0
- package/plugin/messages-1szh3p3k.js +2 -0
- package/plugin/metadata-zm1v3ptf.js +4 -0
- package/plugin/muse-r16jp51z.js +2 -0
- package/plugin/muse-tfe6sph7.js +2 -0
- package/plugin/museToolSchema-tbe0f3wa.js +2 -0
- package/plugin/notes-6amdhm6h.js +2 -0
- package/plugin/object-9pjtdam7.js +2 -0
- package/plugin/open-browser-vqb7ckt1.js +2 -0
- package/plugin/openai-0z6fy497.js +2 -0
- package/plugin/openai-37dne8v0.js +2 -0
- package/plugin/openai-compatible-chat-tq9w69h4.js +2 -0
- package/plugin/openai-images-x1sj79qh.js +2 -0
- package/plugin/openai-responses-dka6k753.js +2 -0
- package/plugin/opencodeGo-173fz5c5.js +3 -0
- package/plugin/opencodeGo-qgw3pfg6.js +2 -0
- package/plugin/options-pxwjpfdk.js +2 -0
- package/plugin/payload-2gr4q9g8.js +2 -0
- package/plugin/pkce-nrpept7w.js +2 -0
- package/plugin/plugin-1n46me5n.js +6 -0
- package/plugin/plugin-1vpp5mqk.js +4 -0
- package/plugin/plugin-1x94cj6e.js +3 -0
- package/plugin/plugin-1xze8f5y.js +3 -0
- package/plugin/plugin-285exjxd.js +3 -0
- package/plugin/plugin-3b8x73y6.js +3 -0
- package/plugin/plugin-3pfrkxg1.js +3 -0
- package/plugin/plugin-3whwpedj.js +3 -0
- package/plugin/plugin-521srf94.js +3 -0
- package/plugin/plugin-55fbx586.js +3 -0
- package/plugin/plugin-5zq084fb.js +3 -0
- package/plugin/plugin-60bdzk1r.js +4 -0
- package/plugin/plugin-6a56xsx3.js +3 -0
- package/plugin/plugin-6xpcmvm3.js +36 -0
- package/plugin/plugin-72xxqm1t.js +3 -0
- package/plugin/plugin-7y7ndrk9.js +3 -0
- package/plugin/plugin-80gqwmjy.js +3 -0
- package/plugin/plugin-8230g28p.js +3 -0
- package/plugin/plugin-8jf7f360.js +3 -0
- package/plugin/plugin-92redty0.js +3 -0
- package/plugin/plugin-9gha9fx3.js +3 -0
- package/plugin/plugin-a4ng6krf.js +3 -0
- package/plugin/plugin-ak62rhwz.js +3 -0
- package/plugin/plugin-ay29ch70.js +3 -0
- package/plugin/plugin-ba1sv0th.js +3 -0
- package/plugin/plugin-ca4vf4j5.js +3 -0
- package/plugin/plugin-cydz2zhy.js +3 -0
- package/plugin/plugin-d6hbav22.js +3 -0
- package/plugin/plugin-e2y95zm5.js +3 -0
- package/plugin/plugin-ff38dxy1.js +3 -0
- package/plugin/plugin-ff9hx5a4.js +3 -0
- package/plugin/plugin-fhc5q7r3.js +3 -0
- package/plugin/plugin-frrvs5yc.js +3 -0
- package/plugin/plugin-g65b14k1.js +3 -0
- package/plugin/plugin-gh857xdd.js +3 -0
- package/plugin/plugin-gkgs7vfv.js +3 -0
- package/plugin/plugin-h66k1zhn.js +14 -0
- package/plugin/plugin-je5cfnqn.js +3 -0
- package/plugin/plugin-jjm52353.js +3 -0
- package/plugin/plugin-jxvmq18y.js +3 -0
- package/plugin/plugin-kc4z9msd.js +3 -0
- package/plugin/plugin-kjtzm2q6.js +3 -0
- package/plugin/plugin-krbbb4ts.js +3 -0
- package/plugin/plugin-me00x60n.js +3 -0
- package/plugin/plugin-mqr325kz.js +3 -0
- package/plugin/plugin-njh1f7b2.js +5 -0
- package/plugin/plugin-nkb5bb2q.js +3 -0
- package/plugin/plugin-nqmb78ez.js +4 -0
- package/plugin/plugin-nzacjxf9.js +3 -0
- package/plugin/plugin-p59gy5xd.js +3 -0
- package/plugin/plugin-pfj9nc2e.js +3 -0
- package/plugin/plugin-pkxw1pfs.js +3 -0
- package/plugin/plugin-q1n5kwx0.js +3 -0
- package/plugin/plugin-q1sqj2tc.js +3 -0
- package/plugin/plugin-q7rk75bs.js +3 -0
- package/plugin/plugin-qpda63gv.js +3 -0
- package/plugin/plugin-rrgyjesv.js +3 -0
- package/plugin/plugin-sfdxgkds.js +3 -0
- package/plugin/plugin-v7k9fx92.js +3 -0
- package/plugin/plugin-vfjhxng8.js +3 -0
- package/plugin/plugin-vv72e4ah.js +3 -0
- package/plugin/plugin-w8f977my.js +3 -0
- package/plugin/plugin-xbnw80pk.js +3 -0
- package/plugin/plugin-yxgg03s0.js +5 -0
- package/plugin/plugin-z6hkd9rw.js +3 -0
- package/plugin/plugin-zew2m18x.js +3 -0
- package/plugin/plugin-zphe2a5v.js +9 -0
- package/plugin/plugin-zvyk8bnr.js +3 -0
- package/plugin/plugin-zw3ywa4b.js +3 -0
- package/plugin/plugin-zxe49p72.js +3 -0
- package/plugin/plugin-zz7yc97m.js +3 -0
- package/plugin/plugin.d.ts +175 -0
- package/plugin/plugin.js +2 -0
- package/plugin/points.generated.d.ts +341 -0
- package/plugin/points.generated.js +2 -0
- package/plugin/process.d.ts +4 -0
- package/plugin/process.js +85 -0
- package/plugin/protocol-hwnfh4h1.js +2 -0
- package/plugin/protocol.d.ts +115 -0
- package/plugin/protocol.js +2 -0
- package/plugin/provider-0b7xxyhn.js +2 -0
- package/plugin/quota-vrrmfag6.js +2 -0
- package/plugin/quotaRead-vj6e90xc.js +2 -0
- package/plugin/reasoning-5nanktp2.js +2 -0
- package/plugin/record-1m3vvy60.js +2 -0
- package/plugin/requests-2zyr1g8e.js +1 -0
- package/plugin/responseFold-w4526gvb.js +2 -0
- package/plugin/settings-vdypzert.js +2 -0
- package/plugin/shared-a2yyy8ry.js +2 -0
- package/plugin/speech-067caz1a.js +2 -0
- package/plugin/stepfun-3en5g41d.js +2 -0
- package/plugin/stepfun-bwsz4nrd.js +2 -0
- package/plugin/stream-bt8etfpc.js +2 -0
- package/plugin/svelteProgram-73v9yajk.js +2 -0
- package/plugin/synthesisDuplex-m2j6pmyv.js +2 -0
- package/plugin/template.d.ts +14 -0
- package/plugin/template.js +2 -0
- package/plugin/testing.d.ts +85 -0
- package/plugin/testing.js +4 -0
- package/plugin/tool-content-b9jtprr7.js +2 -0
- package/plugin/tool-stream-gdajdxn0.js +2 -0
- package/plugin/transport-7hfp9sn4.js +2 -0
- package/plugin/ui.generated.d.ts +1044 -0
- package/plugin/value.d.ts +8 -0
- package/plugin/value.js +2 -0
- package/plugin/vendor-pn6b5a8f.js +2 -0
- package/plugin/vendorCall-6n5chrn0.js +2 -0
- package/plugin/vendorCall-hv01nwsp.js +2 -0
- package/plugin/vendorPayload-awxqr7t8.js +2 -0
- package/plugin/vendorWeb-vnf344r1.js +2 -0
- package/plugin/verbatim-mqt9x4aa.js +2 -0
- package/plugin/xai-e8sbtk6a.js +2 -0
- package/plugin/xai-z1ysta23.js +2 -0
- package/rules/effect.d.ts +55 -0
- package/rules/effect.js +11 -0
- package/rules/rules.d.ts +342 -0
- package/rules/rules.js +50 -0
- package/types/node/assert/strict.d.ts +12 -0
- package/types/node/assert.d.ts +76 -0
- package/types/node/async_hooks.d.ts +113 -0
- package/types/node/buffer.buffer.d.ts +29 -0
- package/types/node/buffer.d.ts +162 -0
- package/types/node/child_process.d.ts +337 -0
- package/types/node/cluster.d.ts +118 -0
- package/types/node/compatibility/iterators.d.ts +11 -0
- package/types/node/console.d.ts +48 -0
- package/types/node/constants.d.ts +8 -0
- package/types/node/crypto.d.ts +847 -0
- package/types/node/dgram.d.ts +88 -0
- package/types/node/diagnostics_channel.d.ts +61 -0
- package/types/node/dns/promises.d.ts +94 -0
- package/types/node/dns.d.ts +276 -0
- package/types/node/domain.d.ts +17 -0
- package/types/node/events.d.ts +138 -0
- package/types/node/fs/promises.d.ts +253 -0
- package/types/node/fs.d.ts +1038 -0
- package/types/node/globals.d.ts +73 -0
- package/types/node/globals.typedarray.d.ts +22 -0
- package/types/node/http.d.ts +530 -0
- package/types/node/http2.d.ts +794 -0
- package/types/node/https.d.ts +66 -0
- package/types/node/index.d.ts +84 -0
- package/types/node/inspector/promises.d.ts +13 -0
- package/types/node/inspector.d.ts +61 -0
- package/types/node/inspector.generated.d.ts +1624 -0
- package/types/node/module.d.ts +187 -0
- package/types/node/net.d.ts +266 -0
- package/types/node/os.d.ts +236 -0
- package/types/node/path/posix.d.ts +8 -0
- package/types/node/path/win32.d.ts +8 -0
- package/types/node/path.d.ts +40 -0
- package/types/node/perf_hooks.d.ts +236 -0
- package/types/node/process.d.ts +436 -0
- package/types/node/punycode.d.ts +15 -0
- package/types/node/querystring.d.ts +22 -0
- package/types/node/quic.d.ts +203 -0
- package/types/node/readline/promises.d.ts +28 -0
- package/types/node/readline.d.ts +94 -0
- package/types/node/repl.d.ts +104 -0
- package/types/node/sea.d.ts +11 -0
- package/types/node/sqlite.d.ts +183 -0
- package/types/node/stream/consumers.d.ts +13 -0
- package/types/node/stream/iter.d.ts +240 -0
- package/types/node/stream/promises.d.ts +37 -0
- package/types/node/stream/web.d.ts +297 -0
- package/types/node/stream.d.ts +378 -0
- package/types/node/string_decoder.d.ts +10 -0
- package/types/node/test/reporters.d.ts +66 -0
- package/types/node/test.d.ts +462 -0
- package/types/node/timers/promises.d.ts +16 -0
- package/types/node/timers.d.ts +43 -0
- package/types/node/tls.d.ts +279 -0
- package/types/node/trace_events.d.ts +16 -0
- package/types/node/ts5.6/buffer.buffer.d.ts +26 -0
- package/types/node/ts5.6/compatibility/float16array.d.ts +43 -0
- package/types/node/ts5.6/globals.typedarray.d.ts +22 -0
- package/types/node/ts5.6/index.d.ts +84 -0
- package/types/node/ts5.7/compatibility/float16array.d.ts +50 -0
- package/types/node/ts5.7/index.d.ts +84 -0
- package/types/node/tty.d.ts +61 -0
- package/types/node/url.d.ts +165 -0
- package/types/node/util/types.d.ts +49 -0
- package/types/node/util.d.ts +320 -0
- package/types/node/v8.d.ts +178 -0
- package/types/node/vm.d.ts +130 -0
- package/types/node/wasi.d.ts +26 -0
- package/types/node/web-globals/abortcontroller.d.ts +47 -0
- package/types/node/web-globals/blob.d.ts +34 -0
- package/types/node/web-globals/console.d.ts +7 -0
- package/types/node/web-globals/crypto.d.ts +46 -0
- package/types/node/web-globals/domexception.d.ts +74 -0
- package/types/node/web-globals/encoding.d.ts +16 -0
- package/types/node/web-globals/events.d.ts +111 -0
- package/types/node/web-globals/fetch.d.ts +121 -0
- package/types/node/web-globals/importmeta.d.ts +11 -0
- package/types/node/web-globals/messaging.d.ts +32 -0
- package/types/node/web-globals/navigator.d.ts +28 -0
- package/types/node/web-globals/performance.d.ts +71 -0
- package/types/node/web-globals/storage.d.ts +26 -0
- package/types/node/web-globals/streams.d.ts +162 -0
- package/types/node/web-globals/timers.d.ts +22 -0
- package/types/node/web-globals/url.d.ts +27 -0
- package/types/node/worker_threads.d.ts +199 -0
- package/types/node/zlib/iter.d.ts +49 -0
- package/types/node/zlib.d.ts +360 -0
- package/types/undici/agent.d.ts +24 -0
- package/types/undici/api.d.ts +19 -0
- package/types/undici/balanced-pool.d.ts +16 -0
- package/types/undici/cache-interceptor.d.ts +98 -0
- package/types/undici/cache.d.ts +30 -0
- package/types/undici/client-stats.d.ts +9 -0
- package/types/undici/client.d.ts +61 -0
- package/types/undici/connector.d.ts +37 -0
- package/types/undici/content-type.d.ts +9 -0
- package/types/undici/cookies.d.ts +22 -0
- package/types/undici/diagnostics-channel.d.ts +72 -0
- package/types/undici/dispatcher.d.ts +207 -0
- package/types/undici/env-http-proxy-agent.d.ts +15 -0
- package/types/undici/errors.d.ts +117 -0
- package/types/undici/eventsource.d.ts +39 -0
- package/types/undici/fetch.d.ts +122 -0
- package/types/undici/formdata.d.ts +24 -0
- package/types/undici/global-dispatcher.d.ts +4 -0
- package/types/undici/global-origin.d.ts +3 -0
- package/types/undici/h2c-client.d.ts +35 -0
- package/types/undici/handlers.d.ts +7 -0
- package/types/undici/header.d.ts +10 -0
- package/types/undici/index.d.ts +85 -0
- package/types/undici/interceptors.d.ts +70 -0
- package/types/undici/mock-agent.d.ts +43 -0
- package/types/undici/mock-call-history.d.ts +57 -0
- package/types/undici/mock-client.d.ts +17 -0
- package/types/undici/mock-errors.d.ts +9 -0
- package/types/undici/mock-interceptor.d.ts +60 -0
- package/types/undici/mock-pool.d.ts +17 -0
- package/types/undici/patch.d.ts +21 -0
- package/types/undici/pool-stats.d.ts +11 -0
- package/types/undici/pool.d.ts +25 -0
- package/types/undici/proxy-agent.d.ts +22 -0
- package/types/undici/readable.d.ts +24 -0
- package/types/undici/retry-agent.d.ts +6 -0
- package/types/undici/retry-handler.d.ts +41 -0
- package/types/undici/round-robin-pool.d.ts +25 -0
- package/types/undici/snapshot-agent.d.ts +98 -0
- package/types/undici/socks5-proxy-agent.d.ts +17 -0
- package/types/undici/util.d.ts +4 -0
- package/types/undici/utility.d.ts +2 -0
- package/types/undici/webidl.d.ts +121 -0
- package/types/undici/websocket.d.ts +130 -0
- package/README.md +0 -3
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/// <reference path="../types/node/index.d.ts" />
|
|
2
|
+
/// <reference path="../host.d.ts" />
|
|
3
|
+
export type TickInput = {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly scheduledAt: number;
|
|
6
|
+
readonly startedAt: number;
|
|
7
|
+
readonly skipped: number;
|
|
8
|
+
};
|
|
9
|
+
export type EndingInput = {
|
|
10
|
+
readonly threadId: string;
|
|
11
|
+
readonly runId: string;
|
|
12
|
+
readonly status: string;
|
|
13
|
+
readonly failureReason: string | null;
|
|
14
|
+
};
|
|
15
|
+
export type AskedPrompt = {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly prompt: string;
|
|
18
|
+
readonly header?: string;
|
|
19
|
+
readonly options: readonly {
|
|
20
|
+
readonly value: string;
|
|
21
|
+
readonly label: string;
|
|
22
|
+
readonly description?: string;
|
|
23
|
+
}[];
|
|
24
|
+
readonly freeform: boolean;
|
|
25
|
+
readonly multiple: boolean;
|
|
26
|
+
};
|
|
27
|
+
export type AskedInput = {
|
|
28
|
+
readonly threadId: string;
|
|
29
|
+
readonly questionId: string;
|
|
30
|
+
readonly summary: string;
|
|
31
|
+
readonly prompts: readonly AskedPrompt[] | null;
|
|
32
|
+
readonly deadlineAt: string | null;
|
|
33
|
+
};
|
|
34
|
+
export declare const ASKED_LEFT: {
|
|
35
|
+
readonly question: "left";
|
|
36
|
+
};
|
|
37
|
+
export type AskedLeft = typeof ASKED_LEFT;
|
|
38
|
+
export type NotificationInput = {
|
|
39
|
+
readonly id: string;
|
|
40
|
+
readonly title: string;
|
|
41
|
+
readonly kind: 'answered' | 'dismissed';
|
|
42
|
+
readonly answer: string | null;
|
|
43
|
+
readonly at: number;
|
|
44
|
+
};
|
|
45
|
+
export type BuildStepInput = {
|
|
46
|
+
readonly offer: 'head' | 'tree';
|
|
47
|
+
readonly checkout: string;
|
|
48
|
+
};
|
|
49
|
+
export type ActionInput = {
|
|
50
|
+
readonly args: string;
|
|
51
|
+
};
|
|
52
|
+
export declare const HOOK_POINTS: readonly [
|
|
53
|
+
"beforeTool",
|
|
54
|
+
"afterTool",
|
|
55
|
+
"beforeStep",
|
|
56
|
+
"beforeClose",
|
|
57
|
+
"threadStarted",
|
|
58
|
+
"threadEnded"
|
|
59
|
+
];
|
|
60
|
+
export type HookPoint = (typeof HOOK_POINTS)[number];
|
|
61
|
+
export type HookCall = {
|
|
62
|
+
readonly at: 'beforeTool';
|
|
63
|
+
readonly tool: string;
|
|
64
|
+
readonly input: unknown;
|
|
65
|
+
readonly callId: string;
|
|
66
|
+
} | {
|
|
67
|
+
readonly at: 'afterTool';
|
|
68
|
+
readonly tool: string;
|
|
69
|
+
readonly input: unknown;
|
|
70
|
+
readonly output: unknown;
|
|
71
|
+
readonly callId: string;
|
|
72
|
+
} | {
|
|
73
|
+
readonly at: 'beforeStep';
|
|
74
|
+
readonly text: string;
|
|
75
|
+
} | {
|
|
76
|
+
readonly at: 'beforeClose';
|
|
77
|
+
readonly answer: string | null;
|
|
78
|
+
readonly continued: boolean;
|
|
79
|
+
} | {
|
|
80
|
+
readonly at: 'threadStarted';
|
|
81
|
+
readonly resumed: boolean;
|
|
82
|
+
} | {
|
|
83
|
+
readonly at: 'threadEnded';
|
|
84
|
+
readonly reason: 'archive' | 'delete';
|
|
85
|
+
};
|
|
86
|
+
export type HookSession = {
|
|
87
|
+
readonly threadId: string;
|
|
88
|
+
readonly cwd: string;
|
|
89
|
+
};
|
|
90
|
+
export type HookInput = HookCall & HookSession;
|
|
91
|
+
export declare const TAGMA_REASONS: {
|
|
92
|
+
readonly schedule: "schedule";
|
|
93
|
+
readonly build: "build";
|
|
94
|
+
readonly ended: "ended";
|
|
95
|
+
readonly asked: "asked";
|
|
96
|
+
readonly notification: "notification";
|
|
97
|
+
readonly hook: "hook";
|
|
98
|
+
};
|
|
99
|
+
export declare const PLUGIN_ENVIRONMENT: {
|
|
100
|
+
readonly server: "TAGMA_SERVER_URL";
|
|
101
|
+
readonly caller: "TAGMA_CALLER";
|
|
102
|
+
readonly data: "TAGMA_PLUGIN_DATA";
|
|
103
|
+
readonly revision: "TAGMA_PLUGIN_REVISION";
|
|
104
|
+
};
|
|
105
|
+
export declare const PROJECTS_META_KEY = "runlith/projects";
|
|
106
|
+
export declare const RESERVED_PREFIX = "__";
|
|
107
|
+
export declare const handlerTools: {
|
|
108
|
+
readonly schedule: (name: string) => string;
|
|
109
|
+
readonly build: (name: string) => string;
|
|
110
|
+
readonly action: (name: string) => string;
|
|
111
|
+
readonly hook: (name: string) => string;
|
|
112
|
+
readonly ended: "__ended";
|
|
113
|
+
readonly asked: "__asked";
|
|
114
|
+
readonly notification: "__notification";
|
|
115
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{qk,pc,Bk,Ps,Nm,Ul,Lm,Dm,Tf,ls,Wk,ji,NT}from"./plugin-zw3ywa4b.js";import"./plugin-h66k1zhn.js";export{NT as QuotaFailure,ls as QuotaInvalidResponse,Lm as QuotaMissingScope,Ps as QuotaObservation,Bk as QuotaObservationSource,Nm as QuotaRateLimited,Dm as QuotaServerFailure,Ul as QuotaStaleToken,Tf as QuotaTransportFailure,Wk as QuotaUnavailable,ji as QuotaUnsupported,pc as QuotaWindow,qk as QuotaWindowKind};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{FE,Is,Jw,Kw,Al,W_}from"./plugin-d6hbav22.js";import"./plugin-zw3ywa4b.js";import"./plugin-3pfrkxg1.js";import"./plugin-3whwpedj.js";import"./plugin-pfj9nc2e.js";import"./plugin-1n46me5n.js";import"./plugin-ay29ch70.js";import"./plugin-7y7ndrk9.js";import"./plugin-e2y95zm5.js";import"./plugin-je5cfnqn.js";import"./plugin-nqmb78ez.js";import"./plugin-zz7yc97m.js";import"./plugin-krbbb4ts.js";import"./plugin-72xxqm1t.js";import"./plugin-me00x60n.js";import"./plugin-frrvs5yc.js";import"./plugin-h66k1zhn.js";export{Jw as QuotaDoor,FE as quotaFailure,Al as quotaGet,W_ as quotaPost,Is as unsupportedQuota,Kw as withQuotaWire};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// @bun
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Em,vm,wm,sT,iT}from"./plugin-521srf94.js";import"./plugin-a4ng6krf.js";import"./plugin-gkgs7vfv.js";import"./plugin-nkb5bb2q.js";import"./plugin-zw3ywa4b.js";import"./plugin-zz7yc97m.js";import"./plugin-me00x60n.js";import"./plugin-frrvs5yc.js";import"./plugin-h66k1zhn.js";export{sT as answer,wm as complete,Em as empty,iT as fromEvents,vm as reduce};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{ql,Zk,xr,Dr,jn,Ie,ds,Ta,Hm,Su,sy,Et,iy,Ls,DT,mi,Gk,jm,Ds,ay,Fs,Jk,Kk,cy,wv,qm,fs,Ra,uy,ps,Bl,xt,Us,Xr,lr,Wl,Ia}from"./plugin-1n46me5n.js";import"./plugin-7y7ndrk9.js";import"./plugin-je5cfnqn.js";import"./plugin-nqmb78ez.js";import"./plugin-zz7yc97m.js";import"./plugin-72xxqm1t.js";import"./plugin-me00x60n.js";import"./plugin-frrvs5yc.js";import"./plugin-h66k1zhn.js";export{Kk as AUDIO_MIMES,Fs as IMAGE_MIMES,ql as Json,Dr as JsonObject,qm as MAX_MEDIA_DECODED_BYTES,wv as MAX_MEDIA_ENCODED_BYTES,cy as MEDIA_MIMES,Jk as VIDEO_MIMES,Su as causeChain,sy as causeCode,Zk as decodeJson,xr as encodeJson,Et as failureOf,xt as invalidRequest,mi as joinText,Ia as jsonPost,Us as matchToolChoice,jn as optionalArray,Ie as optionalNull,DT as parseJson,Ls as providerStreamFailure,Ta as subtractTokens,Hm as sumTokens,Xr as supportsContent,jm as systemUpdateText,Bl as toolId,ay as toolInput,ps as toolResultText,ds as totalTokens,uy as trimBaseUrl,lr as unsupportedContent,fs as validateMedia,Ra as validateToolFile,Wl as validateWith,iy as withAttempt,Gk as wrapSystemUpdate,Ds as wrappedSystemUpdate};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./plugin-h66k1zhn.js";import"./plugin-3whwpedj.js";import"./plugin-nqmb78ez.js";import"./plugin-72xxqm1t.js";import"./plugin-frrvs5yc.js";import"./plugin-7y7ndrk9.js";import"./plugin-me00x60n.js";import"./plugin-zz7yc97m.js";import"./plugin-je5cfnqn.js";import"./plugin-1n46me5n.js";import"./plugin-nkb5bb2q.js";import"./plugin-gkgs7vfv.js";import{ji}from"./plugin-zw3ywa4b.js";import"./plugin-a4ng6krf.js";import"./plugin-ay29ch70.js";import"./plugin-q1n5kwx0.js";import"./plugin-pfj9nc2e.js";import"./plugin-e2y95zm5.js";import"./plugin-krbbb4ts.js";import"./plugin-3pfrkxg1.js";import"./plugin-60bdzk1r.js";import"./plugin-1x94cj6e.js";import"./plugin-ba1sv0th.js";import"./plugin-1xze8f5y.js";import"./plugin-fhc5q7r3.js";import"./plugin-pkxw1pfs.js";import{Ea,va}from"./plugin-yxgg03s0.js";import{sm,im}from"./plugin-55fbx586.js";import{Hn}from"./plugin-zvyk8bnr.js";import{Yn}from"./plugin-jjm52353.js";import"./plugin-kc4z9msd.js";import{r,c}from"./plugin-6xpcmvm3.js";var i="https://api.stepfun.ai/step_plan/v1",t=32000,e={fromHeaders:()=>null,read:()=>c(new ji)};function n(o){return Ea({reasoningEffort:Yn(o.rung),parallelToolCalls:o.parallelToolCalls})}var p={output:{budget:t,sent:!0},model:(o)=>r(va.with({provider:sm,quota:e.fromHeaders,endpoint:{baseURL:i},limits:{output:t},auth:Hn(o.credentials,o.ownerId,sm,o.account).bearer()}).model({id:o.model})),options:n},s={...im,profile:p,quota:e},R=()=>[s];export{i as STEPFUN_BASE_URL,t as STEPFUN_OUTPUT_RESERVATION,e as stepfunQuota,s as stepfunRegistration,R as stepfunRegistrations};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{PE,Pw,$E}from"./plugin-njh1f7b2.js";import"./plugin-1xze8f5y.js";import"./plugin-pkxw1pfs.js";import"./plugin-ba1sv0th.js";import"./plugin-kc4z9msd.js";import"./plugin-1x94cj6e.js";import"./plugin-60bdzk1r.js";import"./plugin-a4ng6krf.js";import"./plugin-gkgs7vfv.js";import"./plugin-nkb5bb2q.js";import"./plugin-q1n5kwx0.js";import"./plugin-zw3ywa4b.js";import"./plugin-3pfrkxg1.js";import"./plugin-3whwpedj.js";import"./plugin-pfj9nc2e.js";import"./plugin-1n46me5n.js";import"./plugin-ay29ch70.js";import"./plugin-7y7ndrk9.js";import"./plugin-e2y95zm5.js";import"./plugin-je5cfnqn.js";import"./plugin-nqmb78ez.js";import"./plugin-zz7yc97m.js";import"./plugin-krbbb4ts.js";import"./plugin-72xxqm1t.js";import"./plugin-me00x60n.js";import"./plugin-frrvs5yc.js";import"./plugin-h66k1zhn.js";export{$E as initialState,Pw as initialStateFor,PE as step};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{fileURLToPath as x}from"url";import f from"svelte/package.json"with{type:"json"};import{svelte2tsx as h}from"svelte2tsx";import o from"typescript";var S=["svelte2tsx/svelte-shims-v4.d.ts","svelte2tsx/svelte-jsx-v4.d.ts"],C=({options:a,rootNames:d,resolve:c,adapt:g,refuse:l})=>{let t=o.createCompilerHost(a);g?.(t);let p=new Map,v=t.getSourceFile.bind(t);t.getSourceFile=(e,n,m,i)=>{if(!e.endsWith(".svelte"))return v(e,n,m,i);let s=o.sys.readFile(e);if(s===void 0)return;try{let{code:r,map:y}=h(s,{filename:e,isTsFile:/<script[^>]*\blang\s*=\s*["']ts["']/u.test(s),mode:"ts",version:f.version,emitOnTemplateError:!1});return p.set(e,y.mappings),o.createSourceFile(e,r,n,!0,o.ScriptKind.TSX)}catch(r){if(l===void 0)throw r;return l(e,r)}},t.resolveModuleNameLiterals=(e,n,m,i)=>e.map((s)=>{let r=c(s.text,n,i,t);return typeof r==="string"?{resolvedModule:{resolvedFileName:r,extension:o.Extension.Tsx,isExternalLibraryImport:!1}}:r});let u=S.map((e)=>x(import.meta.resolve(e)));return{program:o.createProgram({rootNames:[...d,...u],options:a,host:t}),mappings:p}};export{C as svelteProgram};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./plugin-h66k1zhn.js";import{ur}from"./plugin-v7k9fx92.js";import{rm,om}from"./plugin-kjtzm2q6.js";import"./plugin-92redty0.js";import{b,T,En,v}from"./plugin-6xpcmvm3.js";var f=(t,a,d)=>{let s=new Uint8Array(t.byteLength+a.byteLength);s.set(t,0),s.set(a,t.byteLength);let n=s.byteLength-s.byteLength%d,i=new DataView(s.buffer,s.byteOffset,n),y=new Int16Array(n/2);for(let e=0;e<y.length;e++)y[e]=i.getInt16(e*2,!0);return{pcm:y,carry:s.slice(n)}},g=v(function*(t){let a=yield*om,d=2*t.format.channels,s=new Uint8Array(0),n=(e)=>{let r=[];for(let p of e.audio){let o=f(s,p,d);if(s=o.carry,o.pcm.length>0)r.push({_tag:"Audio",pcm:o.pcm})}if(e.marks.length>0)r.push({_tag:"Marks",marks:e.marks});if(e.done&&s.byteLength>0)return T(ur.provider("the synthesis ended inside a frame",!1));return b({state:e.state,send:e.send,out:r,done:e.done})},i=yield*rm({request:t.request,init:t.init,initial:t.initial,decode:t.decode,step:(e,r)=>En(t.step(e,r),n),ready:t.ready,keepalive:t.keepalive,readyMs:a.readyMs,bytesPerWeight:1,ended:ur.invalidRequest("the synthesis has ended")});return{format:t.format,say:(e)=>i.act((r)=>n(t.say(r,e))),end:i.act((e)=>n(t.end(e)),!0),audio:i.out}});export{g as synthesisDuplex};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference path="../types/node/index.d.ts" />
|
|
2
|
+
/// <reference path="../host.d.ts" />
|
|
3
|
+
export declare const SDK_RELEASE_DEFINE = "BUILT_SDK";
|
|
4
|
+
export declare const SDK_VERSION: string;
|
|
5
|
+
export declare const SDK_DEPENDENCY: string;
|
|
6
|
+
export type PluginTemplateInput = {
|
|
7
|
+
readonly id: string;
|
|
8
|
+
readonly title: string;
|
|
9
|
+
};
|
|
10
|
+
export type PluginTemplateFile = {
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly text: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const pluginTemplate: ({ id, title }: PluginTemplateInput) => readonly PluginTemplateFile[];
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/// <reference path="../types/node/index.d.ts" />
|
|
2
|
+
/// <reference path="../host.d.ts" />
|
|
3
|
+
import { Effect } from "effect";
|
|
4
|
+
import { type HttpClientRequest } from "effect/http";
|
|
5
|
+
import { LLMError } from "@runlith/llm/schema/errors";
|
|
6
|
+
import type { GeneratedImage } from "@runlith/llm/profiles/images";
|
|
7
|
+
import { type McpCaller } from "@runlith/tagma/internal/packages/mcp/src/mcpCallerMeta";
|
|
8
|
+
import { type ScriptedLink } from "@runlith/tagma/internal/packages/speech/src/testing/ScriptedTransport";
|
|
9
|
+
import type { FileEvent } from "@runlith/speech/wire/events";
|
|
10
|
+
import type { AdapterHost } from "@runlith/tagma/adapter/provider";
|
|
11
|
+
import { manifestOf } from "@runlith/tagma/internal/packages/tagma/src/plugin/describe";
|
|
12
|
+
import type { OperationId, PluginDefinition } from "@runlith/tagma/plugin";
|
|
13
|
+
import { type BuildStepInput, type EndingInput, type HookInput, type NotificationInput, type TickInput } from "@runlith/tagma/plugin/protocol";
|
|
14
|
+
export type TestedAnswer = {
|
|
15
|
+
readonly text: string;
|
|
16
|
+
readonly isError: boolean;
|
|
17
|
+
readonly structured?: Readonly<Record<string, unknown>>;
|
|
18
|
+
};
|
|
19
|
+
export type TagmaDouble = (operation: OperationId, input: unknown, project: number | null) => Promise<unknown>;
|
|
20
|
+
export type TestPluginOptions = {
|
|
21
|
+
readonly options?: Readonly<Record<string, string>>;
|
|
22
|
+
readonly data?: string;
|
|
23
|
+
readonly projects?: readonly number[];
|
|
24
|
+
readonly tagma?: TagmaDouble;
|
|
25
|
+
};
|
|
26
|
+
export type TestedPlugin = {
|
|
27
|
+
readonly manifest: ReturnType<typeof manifestOf>;
|
|
28
|
+
readonly call: (tool: string, input?: Readonly<Record<string, unknown>>, caller?: McpCaller) => Promise<TestedAnswer>;
|
|
29
|
+
readonly tick: (schedule: string, tick?: Partial<Omit<TickInput, 'name'>>) => Promise<TestedAnswer>;
|
|
30
|
+
readonly end: (ending: EndingInput, project?: number | null) => Promise<TestedAnswer>;
|
|
31
|
+
readonly notify: (answer: NotificationInput) => Promise<TestedAnswer>;
|
|
32
|
+
readonly build: (step: string, input: BuildStepInput, project?: number | null) => Promise<TestedAnswer>;
|
|
33
|
+
readonly act: (action: string, project?: number | null, from?: {
|
|
34
|
+
readonly threadId?: string;
|
|
35
|
+
readonly args?: string;
|
|
36
|
+
}) => Promise<TestedAnswer>;
|
|
37
|
+
readonly check: (hook: string, event: HookInput, project?: number | null) => Promise<TestedAnswer>;
|
|
38
|
+
readonly read: (uri: string, caller?: McpCaller) => Promise<TestedAnswer>;
|
|
39
|
+
readonly changed: readonly string[];
|
|
40
|
+
};
|
|
41
|
+
export declare const testPlugin: (definition: PluginDefinition, given?: TestPluginOptions) => TestedPlugin;
|
|
42
|
+
export type SignInFixture = {
|
|
43
|
+
readonly kind: 'loopback' | 'paste' | 'key' | 'device';
|
|
44
|
+
readonly input: string;
|
|
45
|
+
readonly openBrowser?: (authorizeUrl: string) => void;
|
|
46
|
+
};
|
|
47
|
+
export type ModelsPhase = 'sign-in' | 'model' | 'failure' | 'image';
|
|
48
|
+
export type ModelsFixture = {
|
|
49
|
+
readonly host: AdapterHost;
|
|
50
|
+
readonly provider: string;
|
|
51
|
+
readonly model?: string;
|
|
52
|
+
readonly signIn?: SignInFixture;
|
|
53
|
+
readonly key?: string;
|
|
54
|
+
readonly expectedText: string;
|
|
55
|
+
readonly respond: (request: HttpClientRequest.HttpClientRequest, phase: ModelsPhase) => Response;
|
|
56
|
+
};
|
|
57
|
+
export type SpeechFixture = {
|
|
58
|
+
readonly provider: string;
|
|
59
|
+
readonly model?: string;
|
|
60
|
+
readonly credential?: unknown;
|
|
61
|
+
readonly respond?: (request: HttpClientRequest.HttpClientRequest) => Response;
|
|
62
|
+
readonly serve?: (link: ScriptedLink) => Effect.Effect<void>;
|
|
63
|
+
};
|
|
64
|
+
export type ConformanceFixture = {
|
|
65
|
+
readonly models?: ModelsFixture;
|
|
66
|
+
readonly speech?: SpeechFixture;
|
|
67
|
+
};
|
|
68
|
+
export type ModelsResult = {
|
|
69
|
+
readonly provider: string;
|
|
70
|
+
readonly model: string;
|
|
71
|
+
readonly text: string;
|
|
72
|
+
readonly failure: LLMError;
|
|
73
|
+
readonly image: GeneratedImage | null;
|
|
74
|
+
};
|
|
75
|
+
export type SpeechResult = {
|
|
76
|
+
readonly provider: string;
|
|
77
|
+
readonly model: string;
|
|
78
|
+
readonly heard: readonly FileEvent[];
|
|
79
|
+
readonly spokenSamples: number;
|
|
80
|
+
};
|
|
81
|
+
export type ConformanceResult = {
|
|
82
|
+
readonly models?: ModelsResult;
|
|
83
|
+
readonly speech?: SpeechResult;
|
|
84
|
+
};
|
|
85
|
+
export declare const runConformance: (directory: string, fixture: ConformanceFixture) => Promise<ConformanceResult>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./plugin-h66k1zhn.js";import{Tu,Hs,Ru}from"./plugin-nqmb78ez.js";import{$s}from"./plugin-3whwpedj.js";import"./plugin-me00x60n.js";import"./plugin-frrvs5yc.js";import{Yl,Xl,Ur,ed,Ut,gs}from"./plugin-zz7yc97m.js";import"./plugin-nkb5bb2q.js";import{dn,pi,us}from"./plugin-gkgs7vfv.js";import"./plugin-72xxqm1t.js";import{rn,kr,de}from"./plugin-7y7ndrk9.js";import"./plugin-je5cfnqn.js";import{Et,Wl}from"./plugin-1n46me5n.js";import"./plugin-zw3ywa4b.js";import{Am}from"./plugin-a4ng6krf.js";import"./plugin-e2y95zm5.js";import{Hl,jl}from"./plugin-pfj9nc2e.js";import"./plugin-krbbb4ts.js";import{Io,xu,Fm,Um,zm}from"./plugin-3pfrkxg1.js";import"./plugin-ay29ch70.js";import"./plugin-q1n5kwx0.js";import"./plugin-60bdzk1r.js";import"./plugin-1x94cj6e.js";import{xf}from"./plugin-sfdxgkds.js";import{Em,vm,wm}from"./plugin-521srf94.js";import"./plugin-zew2m18x.js";import"./plugin-qpda63gv.js";import{km,_m}from"./plugin-vv72e4ah.js";import"./plugin-z6hkd9rw.js";import{Sf,bf,Ef,vf}from"./plugin-g65b14k1.js";import{gu}from"./plugin-92redty0.js";import"./plugin-8230g28p.js";import"./plugin-ca4vf4j5.js";import"./plugin-6a56xsx3.js";import{Tl,Yd,Ft}from"./plugin-cydz2zhy.js";import{jf}from"./plugin-rrgyjesv.js";import"./plugin-3b8x73y6.js";import"./plugin-w8f977my.js";import{Fv,Hf}from"./plugin-nzacjxf9.js";import{Kt,oe,C,Ct,me,We,N0,or,D0,ne,Mt,bt,dp,mn,ze,r,h,d,y,f,c,Ve,s,Te,tt,ol,i,kn,es,Va,Th,Dt,co,dt,zo,ir,mr,v,ee,pt,hl,is,ga,gr,ig,nc,wo,xn,cw,Qn,Ts,Fi,Ot,un,Ui,oc,ya,sc,fg,lw,Jd,Sg}from"./plugin-6xpcmvm3.js";import{strict as E}from"assert";import{mkdtempSync as he}from"fs";import{tmpdir as Me}from"os";import{join as Le}from"path";var B={tools:!0,system:!0,messages:"latest-message"},W={};var G=(e)=>{if(e===void 0||e==="auto")return B;if(e==="none")return W;return e},V=(e)=>e!==void 0?new gs({type:"ephemeral",ttlSeconds:e}):new gs({type:"ephemeral"}),J=(e,t)=>{if(e.length===0)return e;let o=e.length-1;if(e[o].cache)return e;return e.map((n,a)=>a===o?new pi({...n,cache:t}):n)},K=(e,t)=>{if(e.length===0)return e;let o=e.length-1;if(e[o].cache)return e;return e.map((n,a)=>a===o?{...n,cache:t}:n)},Q=(e,t)=>e.findLastIndex((o)=>o.role===t),A=(e)=>e.content.findLastIndex((t)=>t.type!=="reasoning"),x=(e,t,o)=>{if(t<0||t>=e.length)return e;let n=e[t],a=A(n);if(a<0)return e;let l=n.content[a];if("cache"in l&&l.cache)return e;let m=n.content.map((g,u)=>u===a?{...g,cache:o}:g),L=new dn({...n,content:m}),M=e.slice();return M[t]=L,M},X=(e,t)=>{for(let o=e.length-1;o>=0;o--)if(A(e[o])>=0)return x(e,o,t);return e},Y=(e,t,o)=>{if(e.length===0)return e;if(t==="latest-message")return X(e,o);if(t==="latest-assistant")return x(e,Q(e,"assistant"),o);let n=Math.max(0,e.length-t.tail),a=e;for(let l=n;l<e.length;l++)a=x(a,l,o);return a},I=(e)=>{if(!e.model.route.inlineCacheHints)return e;let t=G(e.cache);if(!t.tools&&!t.system&&!t.messages)return e;let o=V(t.ttlSeconds),n=t.tools?J(e.tools,o):e.tools,a=t.system?K(e.system,o):e.system,l=t.messages?Y(e.messages,t.messages,o):e.messages;if(n===e.tools&&a===e.system&&l===e.messages)return e;return us.update(e,{tools:n,system:a,messages:l})};var O=(e)=>{let t=Ut.of(e.model),o=Z(e.messages,t);if(e.messages.every((m)=>o.some((L)=>Ut.same(m.origin,L))))return e;let n=[],a=new Set,l=[];for(let m of e.messages){let L=n.length;for(let{message:M,historical:g}of te(m,o)){if(g&&a.size>0){l.push(M);continue}let u=n.at(-1);if(n.length>L&&u?.role==="assistant"&&M.role==="assistant")n[n.length-1]=new dn({...u,content:[...u.content,...M.content]});else n.push(M);for(let p of M.content){if(M.role==="assistant"&&p.type==="tool-call"&&p.providerExecuted!==!0)a.add(p.id);if(M.role==="tool"&&p.type==="tool-result")a.delete(p.id)}if(a.size===0)n.push(...l.splice(0))}}return n.push(...l),us.update(e,{messages:n})},Z=(e,t)=>{let o=[t];for(let n=e.length-1;n>=0;n--)for(let a of e[n]?.content??[]){if(a.type!=="model-fallback")continue;if(o.some((l)=>Ut.same(a.to,l))&&!o.some((l)=>Ut.same(a.from,l)))o.push(a.from)}return o},te=(e,t)=>{if(t.some((p)=>Ut.same(e.origin,p)))return[{message:e,historical:!1}];let{native:o,id:n,requestId:a,...l}=e,m=[],L=e.role,M=!1,g=[],u=()=>{if(g.length===0)return;m.push({message:new dn({...l,id:m.length===0?n:void 0,requestId:m.length===0?a:void 0,role:L,content:g}),historical:M}),g=[]};for(let p of e.content){if(p.type==="reasoning"||p.type==="model-fallback")continue;let R=(p.type==="tool-call"||p.type==="tool-result")&&p.providerExecuted===!0,S=R&&p.type==="tool-result",k=S?"user":e.role;if(k!==L||S!==M)u(),L=k,M=S;if(R&&p.type==="tool-call")g.push(dn.text(`Recorded provider tool request: ${JSON.stringify({id:p.id,name:p.name,input:p.input})}`));else if(R&&p.type==="tool-result")if(g.push(dn.text(`Recorded provider tool result: ${JSON.stringify({id:p.id,name:p.name,type:p.result.type})}`)),p.result.type==="content")g.push(...p.result.value.map((b)=>b.type==="text"?dn.text(b.text):{type:"media",mediaType:b.mime,data:b.uri,filename:b.name}));else g.push(dn.text(typeof p.result.value==="string"?p.result.value:JSON.stringify(p.result.value)??"null"));else g.push(re(p))}return u(),m},re=(e)=>{if(e.type==="text"&&e.providerMetadata!==void 0){let{providerMetadata:t,...o}=e;return o}if(e.type==="tool-call"&&e.providerMetadata!==void 0){let{providerMetadata:t,...o}=e;return o}if(e.type==="tool-result"&&e.providerMetadata!==void 0){let{providerMetadata:t,...o}=e;return o}return e};var H=(e,t)=>{let o=e?.open?.()??t,n=!1,a=0;return{decide:(l,m)=>h(()=>{let L={...m,attempt:m.attempt-a};if(l.status===401){if(n)return r({again:!1,stop:"not-retryable",of:1,failure:new de({module:"Auth",method:"recover",reason:new kr({message:"The renewed sign-in was rejected; reconnect this account.",kind:"expired",http:"http"in l.reason?l.reason.http:void 0})})});let M=m.recover??e?.recover;if(M===void 0)return r({again:!1,stop:"not-retryable",of:1});return n=!0,i(o.decide(l,L),(g)=>{if(g.again)return{...g,prepare:g.prepare===void 0?M:Te(M,g.prepare)};return a=1,{again:!0,after:Ct,of:1,attempt:1,prepare:M}})}return o.decide(l,L)})}};class P extends oe()("@runlith/llm/LlmClient"){}var ae=(e)=>{let t=e.model.route.defaults,o=e.model.defaults,n=ed(t.generation,o?.generation,e.generation);return us.update(e,{generation:n??new Ur({}),cache:e.cache??t.cache,providerOptions:Yl(t.providerOptions,o?.providerOptions,e.providerOptions),http:Xl(t.http,o?.http,e.http)})},j=ee("LLM.compile")(function*(e,t={}){let o=e.model.compatibility?.toolChoice,n=e.toolChoice?.type??"auto";if(o!==void 0&&!o.includes(n))return yield*c(new de({module:"LLM",method:"compile",reason:new rn({parameter:"toolChoice",message:`Model ${e.model.provider}/${e.model.id} does not support tool choice "${n}"; allowed modes: ${o.join(", ")}.`})}));let a=ae(e),l=a.model.route.presentation,m=l?.resolve===void 0?void 0:yield*l.resolve(a),L=I(O(m?.request??a)),M=m?.present??l?.present,g=M===void 0?{request:L,receive:r}:yield*M(L,t),u=g.request,p=u.model.route,R=yield*p.body.from(u),S=yield*Wl(pt(p.body.schema))(R),k=g.body===void 0?S:g.body(S),b=yield*p.prepareTransport(k,u,g.encode);return{request:u,route:p,body:k,prepared:b,receive:g.receive,failed:g.failed}}),le=ee("LLMClient.prepare")(function*(e){let t=yield*j(e);return new Am({id:t.request.id??"request",route:t.route.id,protocol:t.route.protocol,model:t.request.model,body:t.body,metadata:{transport:t.route.transport.id}})}),ce=(e)=>(t,o)=>Ot(f(function*(){let n=yield*j(t,{executor:e.http}),a=!1,l=n.route.streamPrepared(n.prepared,n.request,e,o).pipe(un((L)=>L.type==="step-start"?{...L,origin:Ut.of(n.request.model)}:L),Ui(n.receive),ya((L)=>Ts(Array.isArray(L)?L:[L])),oc((L)=>d(()=>{if(L.type==="finish")a=!0})),sc(Ot(d(()=>a?xn:Qn(Et(void 0,{route:`${n.request.model.provider}/${n.route.id}`,family:"clean-eof-no-finish",message:"The stream ended without its terminal finish event"}))))),fg((L)=>n.failed?.(L)??y)),m=pe(n.route,n.body);return m===void 0?l:lw(l,Hl,m)}));function pe(e,t){let o=e.body.cachePrefix;if(o===void 0)return;let n=JSON.stringify(o(t))??"",a=2166136261;for(let l=0;l<n.length;l++)a^=n.charCodeAt(l),a=Math.imul(a,16777619);return(a>>>0).toString(36)}var ue=ee("LLM.fold")(function*(e,t,o){let n=yield*D0(),a=yield*ze,l={events:0,lastEventType:void 0},L=yield*oc(e(n),(u)=>d(()=>{l.events+=1,l.lastEventType=u.type,o?.(u)})).pipe(Sg(()=>Em(Ut.of(t.model)),vm),zo(ne(n,We))),M=wm(L);if(M)return M;let g=yield*ze;return yield*Et(void 0,{route:`${t.model.provider}/${t.model.route.id}`,message:"The stream ended without a terminal finish event",family:"clean-eof-no-finish",elapsedMs:g-a,lastEvent:{type:l.lastEventType,count:l.events}})}),fe=(e)=>e.reason._tag!=="Transport"&&!(("http"in e.reason)&&e.reason.http!==void 0),F=(e,t,o,n=0,a=[],l=H(t.model.route.retry,{decide:(m,L)=>Um(m.family,{attempt:L.attempt-1,remaining:xu-(L.attempt-1),retryAfterMs:m.retryAfterMs}).pipe(i((M)=>M.retry?{again:!0,after:M.after,of:xu}:{again:!1,stop:"not-retryable",of:xu}))}))=>es(Dt(ue(e,t,o),jl,n),"LLM.Error",(m)=>{if(t.model.route.retry?.open===void 0&&m.status!==401&&!fe(m))return c(m);let M=[...a,m];return l.decide(m,{attempt:n+1,failures:M,outputStarted:!1}).pipe(s((u)=>{if(!u.again)return c("failure"in u&&u.failure!==void 0?u.failure:m);return $s({type:"retry-scheduled",transportAttempt:n,delayMs:me(u.after)}).pipe(s(()=>Fm(u.after)),s(()=>u.prepare??y),s(()=>F(e,t,o,n+1,M,l)))}))}),ye=(e)=>(t)=>F((o)=>e(t,o),t);var U=bt(P,f(function*(){let e=ce({http:yield*Io,webSocket:Kt(yield*Th(xf))});return P.of({prepare:le,stream:e,generate:ye(e)})}));var ge=v(function*(e){let t=yield*ga(),o=[],n=0,a=!1,l,m={send:(g)=>h(()=>{if(l!==void 0)return c(l);if(!a)o.push(g);return y}),buffered:d(()=>n),messages:Fi(t),close:d(()=>{a=!0})},L={request:e,sent:o,receive:(g)=>kn(gr(t,g)),hangUp:kn(nc(t)),drop:(g)=>kn(ig(t,g)),setBuffered:(g)=>{n=g},breakSends:(g)=>{l=g},isClosed:()=>a},M=Te(d(()=>{a=!0}),nc(t));return{duplex:m,scripted:L,shut:M}}),z=f(function*(){let e=yield*ga(),t,o=0,n=v(function*(a){if(t!==void 0)yield*or(t);let l=yield*dt(tt(ge(a),()=>d(()=>{o+=1})),(m)=>Te(m.shut,d(()=>{o-=1})));return yield*gr(e,l.scripted),l.duplex});return{layer:Mt(gu,{open:n}),next:wo(e),hold:f(function*(){let a=yield*N0();return t=a,a}),live:()=>o}});var w={kind:"agent",projectId:1,agentId:"tester",ownerId:"tester",thread:null},ve=(e)=>Promise.reject(Error(`${e}: this test gave testPlugin no tagma double`)),Re=(e)=>e.structuredContent===void 0?{text:e.text,isError:e.isError===!0}:{text:e.text,isError:e.isError===!0,structured:e.structuredContent},Xt=(e,t={})=>{let o=t.tagma??ve,n=(u)=>({op:(p,R)=>o(p,R,u),in:(p)=>n(p)}),a=[],l=t.data,m=Hf(e,{get data(){return l??=he(Le(Me(),`${e.id}-data-`)),l},options:Object.fromEntries((e.options??[]).map((u)=>[u.key,t.options?.[u.key]??u.default])),client:n,log:(u)=>process.stderr.write(`${u}
|
|
3
|
+
`),changed:(u)=>a.push(u)}),L=(u)=>({...Fv(u),[Yd]:t.projects??[]}),M=async(u,p,R)=>Re(await m.call(u,p,L(R),new AbortController().signal)),g=(u,p)=>({kind:"tagma",projectId:u,reason:p});return{manifest:jf(m.description),call:(u,p={},R=w)=>M(u,p,R),tick:(u,p={})=>{let R=Date.now();return M(Ft.schedule(u),{name:u,scheduledAt:p.scheduledAt??R,startedAt:p.startedAt??R,skipped:p.skipped??0},g(null,Tl.schedule))},end:(u,p=w.projectId)=>M(Ft.ended,u,g(p,Tl.ended)),notify:(u)=>M(Ft.notification,u,g(null,Tl.notification)),build:(u,p,R=w.projectId)=>M(Ft.build(u),p,g(R,Tl.build)),act:(u,p=w.projectId,{threadId:R,args:S=""}={})=>M(Ft.action(u),{args:S},{kind:"operator",projectId:p,view:`action:${u}`,...R===void 0?{}:{threadId:R}}),check:(u,p,R=w.projectId)=>M(Ft.hook(u),p,g(R,Tl.hook)),read:async(u,p=w)=>{let R=await m.read(u,L(p),new AbortController().signal);return"refused"in R?{text:R.refused,isError:!0}:{text:R.text,isError:!1}},changed:a}},Ee=ee("conformance.signIn")(function*(e,t){let o=e.accounts;E(o!==void 0,`Provider ${e.id} declares no subscription accounts`);let n=o.signIns.find((m)=>m.kind===t.kind);E(n!==void 0,`Provider ${e.id} declares no ${t.kind} sign-in`);let a=t.openBrowser??(()=>{throw Error("Supply openBrowser to complete the local sign-in")}),l=n.kind==="loopback"?yield*n.run(a):n.kind==="paste"?yield*f(function*(){let m=yield*n.begin();return a(m.authorizeUrl),yield*m.complete(t.input)}):n.kind==="key"?yield*n.store(t.input):yield*f(function*(){let m=yield*km(n.vendor);return a(m.verificationUriComplete??m.verificationUri),yield*n.store(yield*_m(n.vendor,m))});return yield*pt(o.credential)(l)}),be=async(e,t,o,n)=>{let[a,l]=Object.entries(e.imageModels??{})[0]??[];if(a===void 0||l===void 0)return null;E(e.images!==void 0,`Provider ${e.id} declares image models without an image profile`);let m=e.images,L=(R)=>m.generate({ownerId:"contract",model:a,credentials:t},{model:a,prompt:"contract",images:[],transparent:!1,...R}).pipe(Va(zm(o))),g=(await mr(L({}))).images[0];E(g!==void 0&&g.bytes.byteLength>0,"The stub image response did not reach the consumer"),E(g.mediaType.startsWith("image/"),`The image answer names ${g.mediaType}, not a picture type`);let u=n(),p=await mr(ol(L({images:Array.from({length:l.inputs+1},()=>g)})));return E(C(p)&&p.failure instanceof de,`${a} accepted more input images than it declares`),E.equal(n(),u,`${a} sent a request beyond what it declares instead of refusing it first`),g},Se=async(e,t)=>{let n=bf(e,t.host).providers.find((b)=>b.id===t.provider);E(n?.kind==="wire",`The kit needs a declared wire provider: ${t.provider}`);let a=t.model??n.defaultTextModel;E(n.models[a]!==void 0,`Provider ${n.id} declares no model ${a}`);let l="sign-in",m=0,L=Ru((b)=>d(()=>(m+=1,Tu(b,t.respond(b,l))))),M=t.signIn===void 0?void 0:await mr(Ee(n,t.signIn).pipe(Dt(Hs,L)));if(n.auth==="oauth")E(M!==void 0,"Exercise a declared sign-in for a subscription provider");if(n.auth==="api-key")E(t.key!==void 0,"Supply a local API key fixture");let g={apiKey:async()=>t.key??t.signIn?.input??"",accessToken:async()=>(E(M!==void 0),M.accessToken),credential:async()=>M},u=f(function*(){let b=yield*n.profile.model({ownerId:"contract",model:a,credentials:g}),N=new us({model:b,system:[],messages:[dn.user("contract")],tools:[],providerOptions:n.profile.options({model:a,rung:n.models[a].defaultReasoning,adaptive:!1,reasoningOutput:!1,outputTokens:32,switches:{}})});return yield*P.use((_)=>_.generate(N))}),p=U.pipe(mn(zm(L)));l="model";let R=await mr(u.pipe(Va(p)));E.equal(R.text,t.expectedText,"The stub model response did not reach the consumer"),l="failure";let S=await mr(ol(u).pipe(Va(p)));E(C(S),"The failing stub model call answered success"),E(S.failure instanceof de,"The adapter failure is not the host LLMError class"),l="image";let k=await be(n,g,L,()=>m);return{provider:n.id,model:a,text:R.text,failure:S.failure,image:k}},ke=16000,we=v(function*(e,t,o){let n=e.recognizer,a=t.recognition,l={turns:a.kind==="stream"?a.turns[0]:a.kind==="batch"?"client":"none",rate:a.kind==="file"?ke:a.rates[0],languages:[],detect:!1,speakers:!1,terms:[],tuning:{}},m={rate:l.rate,channels:1},L=new Int16Array(l.rate/10);if(a.kind==="batch")return yield*Jd(n.batch(t,{format:m,pcm:L},l,o));if(a.kind==="file"){let u=new Uint8Array(64),p={mime:a.containers[0],bytes:cw(u),size:u.byteLength,format:m,durationMs:100,reference:"conformance"};return yield*Jd(n.file(t,p,l,o))}let M=yield*n.stream(t,l,o),g=yield*ir(Jd(M.events));return yield*M.send(L),yield*M.finish,yield*is(g)}),Ce=v(function*(e,t,o){let n=t.synthesis,a={voice:n.voices[0].id,rate:n.rates[0],language:n.needsLanguage?n.languages[0]:void 0,timestamps:!1},l=yield*e.synthesizer.open(t,a,o),m=yield*ir(Jd(l.audio));return yield*l.say("contract"),yield*l.end,(yield*is(m)).reduce((L,M)=>L+(M._tag==="Audio"?M.pcm.length:0),0)}),Pe=async(e,t,o)=>{let{faults:n}=Sf([{owner:e,providers:t}]);E.equal(n.length,0,n.map((p)=>`${p.provider??e}: ${p.reason}`).join(`
|
|
4
|
+
`));let a=t.find((p)=>p.id===o.provider);E(a!==void 0,`The folder declares no speech provider ${o.provider}`);let l=[...a.recognizer?.models??[],...a.synthesizer?.models??[]].find((p)=>o.model===void 0||p.id===o.model);E(l!==void 0,`Provider ${a.id} declares no model ${o.model??""}`);let m=a.credential,L=m._tag==="none"?m.value:hl(m.schema)(o.credential),M=Ru((p)=>o.respond===void 0?Ve(Error(`The speech stub gave no respond for ${p.url}`)):d(()=>Tu(p,o.respond(p)))),g=f(function*(){let p=yield*z;if(o.serve!==void 0)yield*ir(s(p.next,o.serve));let R=dp(p.layer,Mt(Hs,M));return yield*("recognition"in l?i(we(a,l,L),(k)=>({heard:k,spokenSamples:0})):i(Ce(a,l,L),(k)=>({heard:[],spokenSamples:k}))).pipe(Va(R))}),u=await mr(co(g));if("recognition"in l)E(u.heard.length>0,`Provider ${a.id} heard nothing from the stub`);else E(u.spokenSamples>0,`Provider ${a.id} spoke nothing from the stub`);return{provider:a.id,model:l.id,...u}},Yt=async(e,t)=>{let o=await Ef(e,await vf(),["--no-install"]);return E(o.models===void 0||t.models!==void 0,"The folder declares models: give the fixture a models stub"),E(o.speech===void 0||t.speech!==void 0,"The folder declares speech: give the fixture a speech stub"),{...o.models===void 0||t.models===void 0?{}:{models:await Se(o.models,t.models)},...o.speech===void 0||t.speech===void 0?{}:{speech:await Pe(o.id,o.speech,t.speech)}}};export{Yt as runConformance,Xt as testPlugin};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{Hi,wa,hu,Bg,$l,Nl,Wg,Ll}from"./plugin-pkxw1pfs.js";import"./plugin-a4ng6krf.js";import"./plugin-gkgs7vfv.js";import"./plugin-nkb5bb2q.js";import"./plugin-zw3ywa4b.js";import"./plugin-1n46me5n.js";import"./plugin-7y7ndrk9.js";import"./plugin-je5cfnqn.js";import"./plugin-nqmb78ez.js";import"./plugin-zz7yc97m.js";import"./plugin-72xxqm1t.js";import"./plugin-me00x60n.js";import"./plugin-frrvs5yc.js";import"./plugin-h66k1zhn.js";export{$l as appendExisting,Bg as appendOrStart,Hi as empty,Nl as finish,Ll as finishAll,Wg as finishWithInput,wa as isError,hu as start};
|