@sourcegraph/amp 0.0.1749571294-gef5aa3 → 0.0.1749600114-g5c00b8
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/dist/amp.js +3 -3
- package/dist/architectureDiagram-RWNHDUBN-1v8WgxdD.js +4635 -0
- package/dist/blockDiagram-XZSR5OGQ-XFBYN-jB.js +2243 -0
- package/dist/c4Diagram-6R2MQUNL-B0L0pltn.js +1587 -0
- package/dist/chunk-COUQ6RZ3-qd4eG6tc.js +17852 -0
- package/dist/chunk-CRQPXCKQ-yjI467Bq.js +65 -0
- package/dist/chunk-EFPBJHX4-DdHmqd0M.js +1378 -0
- package/dist/chunk-EOAU2GW5-CpRNAcjo.js +253 -0
- package/dist/chunk-IHYUGLNO-DJcRQIf7.js +1365 -0
- package/dist/chunk-K2ZEYYM2-CbqHhUqy.js +9 -0
- package/dist/chunk-Q7VUVKE6-gBSSbdjU.js +24 -0
- package/dist/chunk-T2M37SMK-Br8mK30k.js +1411 -0
- package/dist/chunk-TGZYFRKZ-BYBLXoJz.js +1331 -0
- package/dist/chunk-YJGJQOYZ-BGiSkWF0.js +19 -0
- package/dist/classDiagram-LB37KKQG-DhFsEyDS.js +17 -0
- package/dist/classDiagram-v2-KFQJBC22-DhFsEyDS.js +17 -0
- package/dist/{client-C1WG2nEf.js → client-D-YAg8x6.js} +6 -6
- package/dist/{console-DK0gDzNQ.js → console-CoE5Qzyz.js} +41106 -22971
- package/dist/create_file.node-Co0Uh1F3.js +21 -0
- package/dist/dagre-CMTPJJKG-UDPzd9Iy.js +446 -0
- package/dist/diagram-BIPOGRU5-B7TV59-n.js +128 -0
- package/dist/diagram-YF4VECWA-LsAZsciQ.js +219 -0
- package/dist/{edit_file.node-BH524GkF.js → edit_file.node-CmTZeBc2.js} +11 -11
- package/dist/erDiagram-AK44R45H-BWpeEu7D.js +843 -0
- package/dist/{executable-5cBRGrsC.js → executable-BE7tfoX5.js} +1 -1
- package/dist/{files-CybxYgbE.js → files-DqpRf5q4.js} +10 -10
- package/dist/flowDiagram-XARHJDSH-DzpV02UB.js +1618 -0
- package/dist/ganttDiagram-H5QQZTZ5-C0BhJTzn.js +1605 -0
- package/dist/gitGraphDiagram-XHLTLO3W-0EiOmv44.js +701 -0
- package/dist/{glob.node-C6HbLuPt.js → glob.node-DNei8bFS.js} +11 -11
- package/dist/{index-C2wo7rRZ.js → index-BcjxaWOc.js} +31 -31
- package/dist/infoDiagram-TP2HPDHO-CQX5a0Fc.js +24 -0
- package/dist/journeyDiagram-VHRN44N3-C82dEe4G.js +809 -0
- package/dist/kanban-definition-K5J3OUUV-xilJcrom.js +718 -0
- package/dist/katex-5N2NCDMP-CAsrnb6_.js +11703 -0
- package/dist/{list_directory.node-ZQscizpi.js → list_directory.node-CMiNNbXP.js} +1 -1
- package/dist/{load-profile-BbmyxO_7.js → load-profile-Cg8XaTx6.js} +1 -1
- package/dist/{main-BVP_XL7v.js → main-Dy2VZM_S.js} +15 -15
- package/dist/mindmap-definition-TI5ONXTW-BNaRba4R.js +3221 -0
- package/dist/{node-DvmQAW7h.js → node-BtG1o_DD.js} +2 -2
- package/dist/{node-syWQvN9a.js → node-BulbxvrV.js} +58 -58
- package/dist/{node-Cpbjmhrj.js → node-Cp3D7_hw.js} +71 -71
- package/dist/{node-Cye82yIV.js → node-CtoBdTQT.js} +3 -3
- package/dist/{node-CiFAW-F3.js → node-Ctw1i0nl.js} +12 -12
- package/dist/{node-CgVq0JJ9.js → node-D1zxOCuN.js} +1 -1
- package/dist/pieDiagram-FPR3CNQC-_30_tQz0.js +120 -0
- package/dist/quadrantDiagram-RLP5YTJ2-CTD43GTk.js +1028 -0
- package/dist/radar-MK3ICKWK-55CS4JTO-afihMdR4.js +14398 -0
- package/dist/{read_file.node-CIdAFiJ6.js → read_file.node-QZ0VCmB2.js} +1 -1
- package/dist/requirementDiagram-P5NVWGNK-Sd2_6g8e.js +853 -0
- package/dist/sankeyDiagram-C6NZRJHT-D1EcCYaw.js +864 -0
- package/dist/sequenceDiagram-6SLVIXKN-CghQTpGf.js +2283 -0
- package/dist/stateDiagram-WI5ZVJ5I-Bv21MlSK.js +272 -0
- package/dist/stateDiagram-v2-KVDSFUFK-BgP0D8xL.js +17 -0
- package/dist/{stdio-DNCc59wT.js → stdio-CCCGI3C7.js} +8 -8
- package/dist/storybook.js +7 -7
- package/dist/timeline-definition-65575674-BUqRZdJ-.js +800 -0
- package/dist/{undo_edit.node-VYuTxRwd.js → undo_edit.node-BkletvTZ.js} +5 -5
- package/dist/xychartDiagram-674MFTBU-DjBabATx.js +1291 -0
- package/package.json +1 -1
- package/dist/create_file.node-DtVTaHj5.js +0 -21
@@ -1,6 +1,6 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import { i as a, F as c, f as i } from "./client-
|
3
|
-
import {
|
2
|
+
import { i as a, F as c, f as i } from "./client-D-YAg8x6.js";
|
3
|
+
import { b as m, H as l } from "./console-CoE5Qzyz.js";
|
4
4
|
const h = ({ args: e }, { threadID: o }) => m(async (s) => {
|
5
5
|
try {
|
6
6
|
const r = await a.webSearch(
|
@@ -1,47 +1,47 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
import {
|
3
|
-
import { r as se } from "./main-
|
4
|
-
const
|
2
|
+
import { c9 as x, ca as A, cb as g, cc as B, cd as Y, ce as h, cf as $, cg as J, ch as V, ci as k, cj as z, ck as W, cl as q, cm as L, cn as C, co as D, cp as M, cq as _, c4 as Z, cr as G, cs as H, ct as F, cu as K, O as Q, cv as N, cw as X, n as ee, t as te } from "./console-CoE5Qzyz.js";
|
3
|
+
import { r as se } from "./main-Dy2VZM_S.js";
|
4
|
+
const v = A({
|
5
5
|
context: V(["continue", "none"]).optional().default("continue"),
|
6
6
|
tools: J([h("all"), x(g())]).optional(),
|
7
7
|
prompt: g(),
|
8
|
-
verify:
|
9
|
-
}), oe =
|
8
|
+
verify: $(k()).optional()
|
9
|
+
}), oe = v.extend({
|
10
10
|
type: h("agent"),
|
11
11
|
model: g().optional(),
|
12
12
|
// Default could be set in implementation
|
13
|
-
interactive_confirmation:
|
14
|
-
}), re =
|
13
|
+
interactive_confirmation: Y().optional()
|
14
|
+
}), re = v.extend({
|
15
15
|
type: h("llm"),
|
16
16
|
model: g().optional()
|
17
|
-
}), ne =
|
17
|
+
}), ne = v.extend({
|
18
18
|
type: h("loop_agent"),
|
19
19
|
model: g().optional(),
|
20
20
|
input_file: g()
|
21
|
-
}), ae =
|
21
|
+
}), ae = v.extend({
|
22
22
|
type: h("loop_llm"),
|
23
23
|
model: g().optional(),
|
24
24
|
input_file: g()
|
25
25
|
}), ie = A({
|
26
26
|
type: h("tool_call"),
|
27
27
|
tool: g(),
|
28
|
-
parameters:
|
28
|
+
parameters: $(k()).optional()
|
29
29
|
}), le = A({
|
30
30
|
type: h("bash"),
|
31
31
|
command: g()
|
32
|
-
}),
|
32
|
+
}), ce = B("type", [
|
33
33
|
oe,
|
34
34
|
re,
|
35
35
|
ne,
|
36
36
|
ae,
|
37
37
|
ie,
|
38
38
|
le
|
39
|
-
]),
|
39
|
+
]), pe = A({
|
40
40
|
id: g(),
|
41
|
-
steps: x(
|
42
|
-
}), P = x(
|
41
|
+
steps: x(ce)
|
42
|
+
}), P = x(pe);
|
43
43
|
x(P);
|
44
|
-
function
|
44
|
+
function ue(r) {
|
45
45
|
try {
|
46
46
|
const e = z(r);
|
47
47
|
return P.parse(e);
|
@@ -90,29 +90,29 @@ function de(r, e, t, s, o, a = new AbortController().signal) {
|
|
90
90
|
async function ge(r, e, t, s, o, a) {
|
91
91
|
const l = _();
|
92
92
|
await se(l);
|
93
|
-
const
|
93
|
+
const u = O(r.prompt, o);
|
94
94
|
let i = e;
|
95
|
-
const m = (
|
96
|
-
i = F(i,
|
95
|
+
const m = (c) => {
|
96
|
+
i = F(i, c);
|
97
97
|
};
|
98
98
|
m({
|
99
99
|
type: "user:message",
|
100
100
|
message: {
|
101
|
-
content: [{ type: "text", text:
|
101
|
+
content: [{ type: "text", text: u }],
|
102
102
|
meta: {
|
103
103
|
sentAt: Date.now()
|
104
104
|
}
|
105
105
|
}
|
106
106
|
}), s.update({
|
107
107
|
status: "in-progress",
|
108
|
-
progress: { type: "message", speaker: "user", message:
|
108
|
+
progress: { type: "message", speaker: "user", message: u }
|
109
109
|
});
|
110
|
-
const
|
110
|
+
const p = (await Z(l.tools, a)).map((c) => c.spec), T = C;
|
111
111
|
let f = 0;
|
112
112
|
const d = 100;
|
113
113
|
for (; f < d; ) {
|
114
114
|
a.throwIfAborted(), f++;
|
115
|
-
const
|
115
|
+
const c = new H(), w = await G(c, {
|
116
116
|
enabledTodos: !1,
|
117
117
|
threadEnv: t.threadEnvironment
|
118
118
|
});
|
@@ -120,15 +120,15 @@ async function ge(r, e, t, s, o, a) {
|
|
120
120
|
type: "text",
|
121
121
|
text: "You are a helpful AI assistant running as a subagent within a larger system. Your task is to handle this specific step in a routine. You can use tools to complete your task. When you are completely done, do not ask to use more tools."
|
122
122
|
});
|
123
|
-
const
|
123
|
+
const U = w;
|
124
124
|
a.throwIfAborted();
|
125
125
|
let b;
|
126
126
|
try {
|
127
|
-
const n =
|
127
|
+
const n = L.fromNativeThread(i);
|
128
128
|
b = await D(
|
129
129
|
n,
|
130
|
-
|
131
|
-
|
130
|
+
p,
|
131
|
+
U,
|
132
132
|
T,
|
133
133
|
a
|
134
134
|
);
|
@@ -139,19 +139,19 @@ async function ge(r, e, t, s, o, a) {
|
|
139
139
|
throw new Error("Unexpected response format from Anthropic");
|
140
140
|
if (b.message.content.length === 0)
|
141
141
|
break;
|
142
|
-
const
|
143
|
-
m(
|
142
|
+
const S = M(b.message);
|
143
|
+
m(S);
|
144
144
|
const E = b.message.content.filter((n) => n.type === "text").map((n) => "text" in n ? n.text : "").join(" ").trim();
|
145
145
|
if (E && s.update({
|
146
146
|
status: "in-progress",
|
147
147
|
progress: { type: "message", speaker: "assistant", message: E }
|
148
|
-
}),
|
148
|
+
}), S.type !== "assistant:message")
|
149
149
|
break;
|
150
|
-
const
|
150
|
+
const j = ye(
|
151
151
|
i,
|
152
|
-
|
152
|
+
S.message
|
153
153
|
);
|
154
|
-
for (const n of
|
154
|
+
for (const n of j) {
|
155
155
|
s.update({
|
156
156
|
status: "in-progress",
|
157
157
|
progress: {
|
@@ -171,13 +171,13 @@ async function ge(r, e, t, s, o, a) {
|
|
171
171
|
a
|
172
172
|
), a.throwIfAborted(), y.status !== "done")
|
173
173
|
throw new Error(JSON.stringify(y));
|
174
|
-
} catch (
|
174
|
+
} catch (I) {
|
175
175
|
m({
|
176
176
|
type: "tool:data",
|
177
177
|
toolUse: n.id,
|
178
178
|
data: {
|
179
179
|
status: "error",
|
180
|
-
error: { message: `Tool call error: ${
|
180
|
+
error: { message: `Tool call error: ${I}` }
|
181
181
|
}
|
182
182
|
}), s.update({
|
183
183
|
status: "in-progress",
|
@@ -185,7 +185,7 @@ async function ge(r, e, t, s, o, a) {
|
|
185
185
|
id: n.id,
|
186
186
|
type: "toolResult",
|
187
187
|
toolName: n.name,
|
188
|
-
result: `Tool call error: ${
|
188
|
+
result: `Tool call error: ${I}`
|
189
189
|
}
|
190
190
|
});
|
191
191
|
continue;
|
@@ -210,10 +210,10 @@ async function ge(r, e, t, s, o, a) {
|
|
210
210
|
async function fe(r, e, t, s, o) {
|
211
211
|
const a = O(r.prompt, s);
|
212
212
|
let l = e;
|
213
|
-
const
|
213
|
+
const u = (d) => {
|
214
214
|
l = F(l, d);
|
215
215
|
};
|
216
|
-
|
216
|
+
u({
|
217
217
|
type: "user:message",
|
218
218
|
message: {
|
219
219
|
content: [{ type: "text", text: a }],
|
@@ -225,7 +225,7 @@ async function fe(r, e, t, s, o) {
|
|
225
225
|
status: "in-progress",
|
226
226
|
progress: { type: "message", speaker: "user", message: a }
|
227
227
|
});
|
228
|
-
const i =
|
228
|
+
const i = L.fromNativeThread(l), m = r.model || C, p = await D(
|
229
229
|
i,
|
230
230
|
[],
|
231
231
|
// No tools for LLM-only step
|
@@ -234,11 +234,11 @@ async function fe(r, e, t, s, o) {
|
|
234
234
|
m,
|
235
235
|
o
|
236
236
|
);
|
237
|
-
if (!
|
237
|
+
if (!p.message)
|
238
238
|
throw new Error("Failed to get response from Anthropic");
|
239
|
-
const T = M(
|
240
|
-
|
241
|
-
const f =
|
239
|
+
const T = M(p.message);
|
240
|
+
u(T);
|
241
|
+
const f = p.message.content.filter((d) => d.type === "text").map((d) => d.type === "text" ? d.text : "").join(" ").trim();
|
242
242
|
return t.update({
|
243
243
|
status: "in-progress",
|
244
244
|
progress: { type: "message", speaker: "assistant", message: f }
|
@@ -254,20 +254,20 @@ function ye(r, e) {
|
|
254
254
|
);
|
255
255
|
}
|
256
256
|
async function R(r, e, t, s, o = new AbortController().signal, a) {
|
257
|
-
return new Promise((l,
|
257
|
+
return new Promise((l, u) => {
|
258
258
|
let i = !1;
|
259
259
|
const m = r.invokeTool(e, { args: t, userInput: a }, s).subscribe({
|
260
|
-
next: (
|
261
|
-
q(
|
260
|
+
next: (p) => {
|
261
|
+
q(p) && (m.unsubscribe(), i || (i = !0, l(p)));
|
262
262
|
},
|
263
|
-
error: (
|
264
|
-
i || (i = !0,
|
263
|
+
error: (p) => {
|
264
|
+
i || (i = !0, u(p));
|
265
265
|
},
|
266
266
|
complete: () => {
|
267
267
|
}
|
268
268
|
});
|
269
269
|
o.addEventListener("abort", () => {
|
270
|
-
m.unsubscribe(), i || (i = !0,
|
270
|
+
m.unsubscribe(), i || (i = !0, u(new Error("Tool execution was aborted")));
|
271
271
|
});
|
272
272
|
});
|
273
273
|
}
|
@@ -289,10 +289,10 @@ async function he(r, e, t, s) {
|
|
289
289
|
status: "in-progress",
|
290
290
|
progress: { type: "meta", message: `Loading routine: ${o} from ${l}` }
|
291
291
|
});
|
292
|
-
const
|
293
|
-
|
292
|
+
const u = _();
|
293
|
+
u.registerTool(X);
|
294
294
|
const i = await R(
|
295
|
-
|
295
|
+
u,
|
296
296
|
"read_file",
|
297
297
|
{ path: l },
|
298
298
|
e,
|
@@ -300,13 +300,13 @@ async function he(r, e, t, s) {
|
|
300
300
|
);
|
301
301
|
if (i.status !== "done")
|
302
302
|
throw new Error(`Failed to read routine file: ${l}`);
|
303
|
-
const m = typeof i.result == "string" ? i.result : i.result.content,
|
304
|
-
`).map((
|
303
|
+
const m = typeof i.result == "string" ? i.result : i.result.content, p = String(m).split(`
|
304
|
+
`).map((c) => c.replace(/^\d+:\s/, "")).join(`
|
305
305
|
`);
|
306
306
|
s.throwIfAborted();
|
307
|
-
const T =
|
307
|
+
const T = ue(p);
|
308
308
|
s.throwIfAborted();
|
309
|
-
const f = T.find((
|
309
|
+
const f = T.find((c) => c.id === o);
|
310
310
|
if (!f)
|
311
311
|
throw new Error(`Routine with id "${o}" not found in ${l}`);
|
312
312
|
let d = {
|
@@ -324,14 +324,14 @@ async function he(r, e, t, s) {
|
|
324
324
|
}
|
325
325
|
]
|
326
326
|
});
|
327
|
-
for (let
|
328
|
-
const w = f.steps[
|
327
|
+
for (let c = 0; c < f.steps.length; c++) {
|
328
|
+
const w = f.steps[c];
|
329
329
|
w && (t.update({
|
330
330
|
status: "in-progress",
|
331
331
|
progress: [
|
332
332
|
{
|
333
333
|
type: "meta",
|
334
|
-
message: `Executing step ${
|
334
|
+
message: `Executing step ${c + 1}/${f.steps.length}: ${w.type}`,
|
335
335
|
variant: "header"
|
336
336
|
}
|
337
337
|
]
|