@sentry/junior 0.179.0 → 0.180.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/dist/{agent-hooks-32IDCLMW.js → agent-hooks-DKDDRKZA.js} +16 -18
- package/dist/api/schema.js +0 -1
- package/dist/api.js +199 -197
- package/dist/app.d.ts +4 -0
- package/dist/app.js +300 -1259
- package/dist/catalog-runtime-WXKGUF3W.js +14 -0
- package/dist/chat/agent/sandbox.d.ts +0 -2
- package/dist/chat/api-turns/routing.d.ts +4 -0
- package/dist/chat/api-turns/work.d.ts +5 -0
- package/dist/chat/config.d.ts +5 -2
- package/dist/chat/configuration/defaults.d.ts +1 -1
- package/dist/chat/conversations/projection.d.ts +6 -4
- package/dist/chat/ingress/message-router.d.ts +3 -0
- package/dist/chat/model-profile.d.ts +8 -10
- package/dist/chat/pi/conversation-events.d.ts +3 -2
- package/dist/chat/plugins/task-queue.d.ts +40 -3
- package/dist/chat/plugins/task-runner.d.ts +1 -1
- package/dist/chat/queue/callback.d.ts +26 -0
- package/dist/chat/queue/sign.d.ts +30 -0
- package/dist/chat/sandbox/sandbox.d.ts +0 -2
- package/dist/chat/sandbox/session.d.ts +0 -2
- package/dist/chat/sandbox/skill-sync.d.ts +1 -1
- package/dist/chat/sandbox/snapshot/events.d.ts +23 -0
- package/dist/chat/sandbox/snapshot/job-callback.d.ts +5 -0
- package/dist/chat/sandbox/snapshot/job-queue.d.ts +26 -0
- package/dist/chat/sandbox/snapshot/job-runner.d.ts +11 -0
- package/dist/chat/sandbox/snapshot/not-ready-error.d.ts +6 -0
- package/dist/chat/sandbox/snapshot/workspace.d.ts +9 -3
- package/dist/chat/services/turn-router.d.ts +4 -3
- package/dist/chat/task-execution/queue-signing.d.ts +10 -21
- package/dist/chat/task-execution/state.d.ts +48 -0
- package/dist/chat/task-execution/store.d.ts +28 -2
- package/dist/chat/task-execution/worker.d.ts +4 -1
- package/dist/chat/tools/handoff/tool.d.ts +1 -1
- package/dist/{chunk-B6ECUSVX.js → chunk-2AYEVN7K.js} +8 -8
- package/dist/{chunk-SLGGOASN.js → chunk-2YIRH4E3.js} +46 -46
- package/dist/{chunk-KJLHIHFF.js → chunk-3ILJBWP7.js} +35 -227
- package/dist/{chunk-RZRYOLCE.js → chunk-5PUMIMNQ.js} +2292 -1147
- package/dist/{chunk-CJLBLELR.js → chunk-5TUR4M3M.js} +8 -61
- package/dist/{chunk-6ZWRNC4D.js → chunk-6Y5B5PEX.js} +1 -1
- package/dist/{chunk-XSPSCWLH.js → chunk-6YCEWOLO.js} +4 -4
- package/dist/chunk-7H2VZTWN.js +103 -0
- package/dist/{chunk-FAS6AIMF.js → chunk-CCDXTDSY.js} +8 -8
- package/dist/{chunk-CGA4ERJ5.js → chunk-CEMMLV5L.js} +1 -1
- package/dist/{chunk-XZY6G5YZ.js → chunk-CK6EINVZ.js} +180 -87
- package/dist/{chunk-FIANEE7Z.js → chunk-CM5HNV2W.js} +6 -6
- package/dist/{chunk-JT4WMD3C.js → chunk-CP73FKME.js} +144 -218
- package/dist/{chunk-3I7XE3PA.js → chunk-DHLOGWYH.js} +36 -36
- package/dist/chunk-DKIJ2RP5.js +68 -0
- package/dist/{chunk-YFNAMRGE.js → chunk-DRHEGXTZ.js} +1 -1
- package/dist/{chunk-OOUNJNMR.js → chunk-DWPN6SCH.js} +1 -1
- package/dist/chunk-EWHP2IRG.js +209 -0
- package/dist/{chunk-R6U7N4FS.js → chunk-FGC3PHNH.js} +3 -3
- package/dist/{chunk-3TM3FYLQ.js → chunk-GA5NS74S.js} +1 -1
- package/dist/{chunk-FIDMHAO6.js → chunk-GPXAHUQH.js} +84 -274
- package/dist/chunk-GUKXEPMX.js +218 -0
- package/dist/{chunk-GENV6KF2.js → chunk-I6IFTAPF.js} +108 -76
- package/dist/{chunk-R5NWWYIS.js → chunk-IANUX7HX.js} +5 -5
- package/dist/{chunk-G2CAC4CV.js → chunk-KCL6AWYW.js} +74 -68
- package/dist/{chunk-5IRROPA5.js → chunk-L7LTGN4Z.js} +129 -31
- package/dist/{chunk-Q5B3WTGG.js → chunk-LGVQLNLS.js} +42 -41
- package/dist/chunk-M3QYTBQ6.js +55 -0
- package/dist/{chunk-FTGD2FBP.js → chunk-MXEUIGHO.js} +2 -2
- package/dist/{chunk-M63DETLL.js → chunk-N7TMSOZH.js} +6 -6
- package/dist/{chunk-2HIPYNQI.js → chunk-O4QYZTDK.js} +33 -32
- package/dist/chunk-PEQXYSSE.js +45 -0
- package/dist/{chunk-RTRBYSF3.js → chunk-QSO7B5JO.js} +1 -1
- package/dist/{chunk-HQNE5APD.js → chunk-RAZG3YHC.js} +100 -79
- package/dist/{chunk-VP4OVRDD.js → chunk-S7YRTOSQ.js} +69 -73
- package/dist/{chunk-U4TKB6F6.js → chunk-SDBKZ5LV.js} +108 -5
- package/dist/{chunk-GPLAT6H7.js → chunk-TC5DE5KJ.js} +22 -18
- package/dist/{chunk-H4HBKISO.js → chunk-TXKUKMVO.js} +1 -1
- package/dist/chunk-U5EUCUBH.js +164 -0
- package/dist/{chunk-3AFVR5UC.js → chunk-VG722ONZ.js} +18 -16
- package/dist/{chunk-ZQMG3CL5.js → chunk-VGPPWWHF.js} +16 -16
- package/dist/{chunk-JMJNFEDC.js → chunk-WVAMRKYG.js} +9 -54
- package/dist/chunk-X6GDDWQH.js +60 -0
- package/dist/{chunk-4GWXAILB.js → chunk-ZE2KOV3G.js} +1 -1
- package/dist/{chunk-TIEKUH4Q.js → chunk-ZM7ZURJS.js} +4 -3
- package/dist/cli/chat.js +47 -43
- package/dist/cli/check.js +13 -15
- package/dist/cli/env.js +0 -1
- package/dist/cli/init.js +0 -1
- package/dist/cli/main.js +2 -3
- package/dist/cli/plugins.js +18 -20
- package/dist/cli/run.js +0 -1
- package/dist/cli/snapshot-create.js +14 -16
- package/dist/cli/upgrade.js +16 -18
- package/dist/{conversation-work-KATFHLG3.js → conversation-work-VIOQ5ZF3.js} +0 -2
- package/dist/{db-EJAV7JL6.js → db-6SBHIAJK.js} +8 -10
- package/dist/deployment.d.ts +1 -0
- package/dist/{discovery-GUFTFBTL.js → discovery-DWVDM7UK.js} +1 -2
- package/dist/{experimental-XVDOSRBS.js → experimental-SIJSRDJD.js} +0 -1
- package/dist/instrumentation.js +7 -9
- package/dist/nitro.js +39 -13
- package/dist/{oauth-callback-server-GAVSUBTQ.js → oauth-callback-server-WSDQPZZS.js} +34 -32
- package/dist/{oauth-relay-3ZU72UGL.js → oauth-relay-5XPVRPYB.js} +0 -1
- package/dist/{plugins-HW4VWW6G.js → plugins-YTYJMMJF.js} +1 -2
- package/dist/{runner-34JL64JF.js → runner-GWTSWESR.js} +39 -33
- package/dist/{sandbox-egress-signals-DXOOBSBI.js → sandbox-egress-signals-FIL7EGPR.js} +5 -6
- package/dist/{sentry-JMWTS32N.js → sentry-MB3NL3IR.js} +1 -2
- package/dist/skills-F32BPFYW.js +27 -0
- package/dist/spawn-X5BPP5OE.js +37 -0
- package/dist/task-runner-2FPBV5PP.js +32 -0
- package/dist/validation-62WO524A.js +17 -0
- package/dist/vercel.js +0 -1
- package/dist/version.js +1 -2
- package/dist/work-3C3CMZ24.js +45 -0
- package/dist/worker-MFAI6ZEK.js +22 -0
- package/package.json +8 -7
- package/dist/catalog-runtime-FBVA6WAQ.js +0 -16
- package/dist/chat/plugins/task-callback.d.ts +0 -5
- package/dist/chat/plugins/task-message.d.ts +0 -23
- package/dist/chat/plugins/task-signing.d.ts +0 -31
- package/dist/chat/sandbox/snapshot/waiting-error.d.ts +0 -15
- package/dist/chat/services/workspace-snapshot-wait.d.ts +0 -27
- package/dist/chunk-5I6ORJUY.js +0 -127
- package/dist/chunk-6GWA276C.js +0 -72
- package/dist/chunk-MLKGABMK.js +0 -9
- package/dist/chunk-UT6X7XN7.js +0 -51
- package/dist/chunk-WR76IVA5.js +0 -130
- package/dist/skills-U545HALM.js +0 -29
- package/dist/spawn-I2S4IDUQ.js +0 -37
- package/dist/validation-EVXVGA44.js +0 -19
- package/dist/work-QOAUPDBU.js +0 -45
- package/dist/worker-5GX2IKLZ.js +0 -24
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import {
|
|
2
|
+
QUEUE_SIGNATURE_MAX_AGE_MS,
|
|
3
|
+
createVercelQueueClient,
|
|
4
|
+
signQueueMessage,
|
|
5
|
+
verifyQueueMessage
|
|
6
|
+
} from "./chunk-7H2VZTWN.js";
|
|
7
|
+
import {
|
|
8
|
+
runWithTurnRequestDeadline
|
|
9
|
+
} from "./chunk-ZE2KOV3G.js";
|
|
10
|
+
import {
|
|
11
|
+
logWarn
|
|
12
|
+
} from "./chunk-RAZG3YHC.js";
|
|
13
|
+
|
|
14
|
+
// src/chat/plugins/task-queue.ts
|
|
15
|
+
import { createHash } from "crypto";
|
|
16
|
+
import { z } from "zod";
|
|
17
|
+
|
|
18
|
+
// src/chat/queue/callback.ts
|
|
19
|
+
import {
|
|
20
|
+
handleCallback,
|
|
21
|
+
registerDevConsumer
|
|
22
|
+
} from "@vercel/queue";
|
|
23
|
+
function queueCallback(options) {
|
|
24
|
+
const handler = async (value, metadata) => {
|
|
25
|
+
if (options.skip?.(metadata)) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const checked = options.verify(value);
|
|
29
|
+
if (checked.status === "rejected") {
|
|
30
|
+
options.onRejected(checked.reason, metadata);
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (checked.status === "unavailable") {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`Queue message verification unavailable: ${checked.reason}`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
try {
|
|
39
|
+
await runWithTurnRequestDeadline(
|
|
40
|
+
() => options.run(checked.message, metadata)
|
|
41
|
+
);
|
|
42
|
+
} catch (error) {
|
|
43
|
+
const reason = options.permanentError?.(error);
|
|
44
|
+
if (!reason) {
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
options.onRejected(reason, metadata, error);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
const retry = (error, metadata) => {
|
|
51
|
+
const reason = options.permanentError?.(error);
|
|
52
|
+
if (reason) {
|
|
53
|
+
options.onRejected(reason, metadata, error);
|
|
54
|
+
return { acknowledge: true };
|
|
55
|
+
}
|
|
56
|
+
if (options.maxDeliveries !== null && metadata.deliveryCount >= options.maxDeliveries) {
|
|
57
|
+
return { acknowledge: true };
|
|
58
|
+
}
|
|
59
|
+
return void 0;
|
|
60
|
+
};
|
|
61
|
+
const visibility = options.visibilityTimeoutSeconds === void 0 ? {} : { visibilityTimeoutSeconds: options.visibilityTimeoutSeconds };
|
|
62
|
+
return {
|
|
63
|
+
create: () => handleCallback(handler, { retry, ...visibility }),
|
|
64
|
+
registerDev: () => {
|
|
65
|
+
if (process.env.NODE_ENV !== "development") {
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
return registerDevConsumer({
|
|
69
|
+
client: createVercelQueueClient(),
|
|
70
|
+
consumerGroup: options.consumerGroup,
|
|
71
|
+
handler,
|
|
72
|
+
retry,
|
|
73
|
+
topic: options.topic,
|
|
74
|
+
...visibility
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/chat/plugins/task-queue.ts
|
|
81
|
+
var PLUGIN_TASK_QUEUE_TOPIC = "junior_plugin_tasks";
|
|
82
|
+
var PLUGIN_TASK_DEV_CONSUMER_GROUP = "junior_plugin_tasks_dev";
|
|
83
|
+
var PLUGIN_TASK_MAX_DELIVERIES = 5;
|
|
84
|
+
var PLUGIN_TASK_SIGN_CONTEXT = "junior.plugin_task_queue.v1";
|
|
85
|
+
var PLUGIN_TASK_SIGN_VERSION = "v1";
|
|
86
|
+
var pluginTaskParamsSchema = z.object({
|
|
87
|
+
conversationId: z.string().min(1),
|
|
88
|
+
sessionId: z.string().min(1)
|
|
89
|
+
}).strict();
|
|
90
|
+
var pluginTaskQueueMessageSchema = z.object({
|
|
91
|
+
name: z.string().min(1),
|
|
92
|
+
params: pluginTaskParamsSchema,
|
|
93
|
+
plugin: z.string().min(1)
|
|
94
|
+
}).strict();
|
|
95
|
+
var pluginTaskSign = {
|
|
96
|
+
context: PLUGIN_TASK_SIGN_CONTEXT,
|
|
97
|
+
schema: pluginTaskQueueMessageSchema,
|
|
98
|
+
signatureVersion: PLUGIN_TASK_SIGN_VERSION,
|
|
99
|
+
parts: (message) => [
|
|
100
|
+
message.plugin,
|
|
101
|
+
message.name,
|
|
102
|
+
message.params.conversationId,
|
|
103
|
+
message.params.sessionId
|
|
104
|
+
]
|
|
105
|
+
};
|
|
106
|
+
function pluginTaskId(args) {
|
|
107
|
+
const digest = createHash("sha256").update(args.plugin).update("\0").update(args.name).update("\0").update(args.params.conversationId).update("\0").update(args.params.sessionId).digest("hex").slice(0, 32);
|
|
108
|
+
return `plugin-task_${digest}`;
|
|
109
|
+
}
|
|
110
|
+
function signPluginTaskQueueMessage(message, nowMs = Date.now()) {
|
|
111
|
+
return signQueueMessage(pluginTaskSign, message, nowMs);
|
|
112
|
+
}
|
|
113
|
+
function verifyPluginTaskQueueMessage(value, nowMs = Date.now()) {
|
|
114
|
+
return verifyQueueMessage(pluginTaskSign, value, nowMs);
|
|
115
|
+
}
|
|
116
|
+
function logPluginTaskQueueMessageRejected(reason, metadata) {
|
|
117
|
+
logWarn("plugin.task.queue_message.rejected", {
|
|
118
|
+
"app.queue.consumer_group": metadata.consumerGroup,
|
|
119
|
+
"app.queue.delivery_count": metadata.deliveryCount,
|
|
120
|
+
"app.queue.message_id": metadata.messageId,
|
|
121
|
+
"app.queue.reject_reason": reason,
|
|
122
|
+
"app.queue.topic_name": metadata.topicName
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function pluginTaskCallback() {
|
|
126
|
+
return queueCallback({
|
|
127
|
+
consumerGroup: PLUGIN_TASK_DEV_CONSUMER_GROUP,
|
|
128
|
+
maxDeliveries: PLUGIN_TASK_MAX_DELIVERIES,
|
|
129
|
+
onRejected: logPluginTaskQueueMessageRejected,
|
|
130
|
+
// Load the runner on first use so this module can send without a cycle.
|
|
131
|
+
run: async (message) => {
|
|
132
|
+
const { processPluginTask } = await import("./task-runner-2FPBV5PP.js");
|
|
133
|
+
await processPluginTask(message);
|
|
134
|
+
},
|
|
135
|
+
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
136
|
+
verify: verifyPluginTaskQueueMessage
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
async function sendVercelPluginTask(message) {
|
|
140
|
+
await createVercelQueueClient().send(
|
|
141
|
+
PLUGIN_TASK_QUEUE_TOPIC,
|
|
142
|
+
signPluginTaskQueueMessage(message),
|
|
143
|
+
{
|
|
144
|
+
idempotencyKey: pluginTaskId(message),
|
|
145
|
+
retentionSeconds: QUEUE_SIGNATURE_MAX_AGE_MS / 1e3
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function createVercelPluginTaskCallback() {
|
|
150
|
+
return pluginTaskCallback().create();
|
|
151
|
+
}
|
|
152
|
+
function registerVercelPluginTaskDevConsumer() {
|
|
153
|
+
return pluginTaskCallback().registerDev();
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export {
|
|
157
|
+
queueCallback,
|
|
158
|
+
PLUGIN_TASK_QUEUE_TOPIC,
|
|
159
|
+
pluginTaskParamsSchema,
|
|
160
|
+
pluginTaskId,
|
|
161
|
+
sendVercelPluginTask,
|
|
162
|
+
createVercelPluginTaskCallback,
|
|
163
|
+
registerVercelPluginTaskDevConsumer
|
|
164
|
+
};
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
parseSandboxEgressAuthRequiredSignal
|
|
3
|
+
} from "./chunk-6Y5B5PEX.js";
|
|
1
4
|
import {
|
|
2
5
|
authorizationId
|
|
3
6
|
} from "./chunk-DIB4GX3G.js";
|
|
4
7
|
import {
|
|
5
8
|
formatProviderLabel,
|
|
6
9
|
startOAuthFlow
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
parseSandboxEgressAuthRequiredSignal
|
|
10
|
-
} from "./chunk-6ZWRNC4D.js";
|
|
10
|
+
} from "./chunk-O4QYZTDK.js";
|
|
11
11
|
import {
|
|
12
12
|
abandonReplacedPendingAuth,
|
|
13
|
-
canReusePendingAuthLink
|
|
13
|
+
canReusePendingAuthLink
|
|
14
|
+
} from "./chunk-GUKXEPMX.js";
|
|
15
|
+
import {
|
|
14
16
|
recordAuthorizationRequested
|
|
15
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GPXAHUQH.js";
|
|
16
18
|
import {
|
|
17
19
|
AGENT_INVOCATION_MAILBOX_STATUSES
|
|
18
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FGC3PHNH.js";
|
|
19
21
|
import {
|
|
20
22
|
TURN_REASONING_LEVELS
|
|
21
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-I6IFTAPF.js";
|
|
22
24
|
import {
|
|
23
25
|
pluginCatalogRuntime
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DRHEGXTZ.js";
|
|
25
27
|
import {
|
|
26
28
|
credentialContextSchema
|
|
27
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-CEMMLV5L.js";
|
|
28
30
|
|
|
29
31
|
// src/chat/services/auth-pause.ts
|
|
30
32
|
var AuthorizationPauseError = class extends Error {
|
|
@@ -94,8 +96,8 @@ function pluginAuthRequiredSignal(details) {
|
|
|
94
96
|
provider: parsedSignal.provider,
|
|
95
97
|
grant: parsedSignal.grant,
|
|
96
98
|
kind: parsedSignal.kind,
|
|
97
|
-
...parsedSignal.message ? { message: parsedSignal.message } :
|
|
98
|
-
...parsedSignal.authorization ? { authorization: parsedSignal.authorization } :
|
|
99
|
+
...parsedSignal.message ? { message: parsedSignal.message } : void 0,
|
|
100
|
+
...parsedSignal.authorization ? { authorization: parsedSignal.authorization } : void 0
|
|
99
101
|
};
|
|
100
102
|
}
|
|
101
103
|
function createPluginAuthOrchestration(input) {
|
|
@@ -123,17 +125,17 @@ function createPluginAuthOrchestration(input) {
|
|
|
123
125
|
provider,
|
|
124
126
|
actorId: input.actorId,
|
|
125
127
|
sessionId: input.sessionId,
|
|
126
|
-
...options?.scope ? { scope: options.scope } :
|
|
128
|
+
...options?.scope ? { scope: options.scope } : void 0
|
|
127
129
|
}) : false;
|
|
128
130
|
if (!reusingPendingLink) {
|
|
129
131
|
const oauthResult = await startOAuthFlow(provider, {
|
|
130
132
|
actorId: input.actorId,
|
|
131
|
-
...input.actor ? { actor: input.actor } :
|
|
133
|
+
...input.actor ? { actor: input.actor } : void 0,
|
|
132
134
|
channelId: input.channelId,
|
|
133
135
|
destination: input.destination,
|
|
134
136
|
source: input.source,
|
|
135
137
|
threadTs: input.threadTs,
|
|
136
|
-
...options?.scope ? { scope: options.scope } :
|
|
138
|
+
...options?.scope ? { scope: options.scope } : void 0,
|
|
137
139
|
resumeConversationId: input.conversationId,
|
|
138
140
|
resumeSessionId: input.sessionId,
|
|
139
141
|
authorization: input.authorization
|
|
@@ -152,7 +154,7 @@ function createPluginAuthOrchestration(input) {
|
|
|
152
154
|
kind: "plugin",
|
|
153
155
|
provider,
|
|
154
156
|
actorId: input.actorId,
|
|
155
|
-
...options?.scope ? { scope: options.scope } :
|
|
157
|
+
...options?.scope ? { scope: options.scope } : void 0,
|
|
156
158
|
sessionId: input.sessionId,
|
|
157
159
|
linkSentAtMs: reusingPendingLink ? input.pendingAuth.linkSentAtMs : Date.now()
|
|
158
160
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pluginCatalogRuntime
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
logWarn
|
|
6
|
-
} from "./chunk-HQNE5APD.js";
|
|
3
|
+
} from "./chunk-DRHEGXTZ.js";
|
|
7
4
|
import {
|
|
8
5
|
skillRoots
|
|
9
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TXKUKMVO.js";
|
|
7
|
+
import {
|
|
8
|
+
logWarn
|
|
9
|
+
} from "./chunk-RAZG3YHC.js";
|
|
10
10
|
|
|
11
11
|
// src/chat/skills.ts
|
|
12
12
|
import fs from "fs/promises";
|
|
@@ -147,11 +147,11 @@ function parseSkillFile(raw, expectedName) {
|
|
|
147
147
|
name: result.data.name,
|
|
148
148
|
description: result.data.description,
|
|
149
149
|
body: stripFrontmatter(raw),
|
|
150
|
-
...result.data.metadata ? { metadata: result.data.metadata } :
|
|
151
|
-
...result.data.compatibility !== void 0 ? { compatibility: result.data.compatibility } :
|
|
152
|
-
...result.data.license !== void 0 ? { license: result.data.license } :
|
|
153
|
-
...allowedTools ? { allowedTools } :
|
|
154
|
-
...disableModelInvocation ? { disableModelInvocation } :
|
|
150
|
+
...result.data.metadata ? { metadata: result.data.metadata } : void 0,
|
|
151
|
+
...result.data.compatibility !== void 0 ? { compatibility: result.data.compatibility } : void 0,
|
|
152
|
+
...result.data.license !== void 0 ? { license: result.data.license } : void 0,
|
|
153
|
+
...allowedTools ? { allowedTools } : void 0,
|
|
154
|
+
...disableModelInvocation ? { disableModelInvocation } : void 0
|
|
155
155
|
}
|
|
156
156
|
};
|
|
157
157
|
}
|
|
@@ -235,9 +235,9 @@ async function readSkillDirectory(skillDir) {
|
|
|
235
235
|
name,
|
|
236
236
|
description,
|
|
237
237
|
skillPath: skillDir,
|
|
238
|
-
...plugin ? { pluginProvider: plugin.manifest.name } :
|
|
239
|
-
...allowedTools ? { allowedTools } :
|
|
240
|
-
...disableModelInvocation ? { disableModelInvocation } :
|
|
238
|
+
...plugin ? { pluginProvider: plugin.manifest.name } : void 0,
|
|
239
|
+
...allowedTools ? { allowedTools } : void 0,
|
|
240
|
+
...disableModelInvocation ? { disableModelInvocation } : void 0
|
|
241
241
|
};
|
|
242
242
|
} catch (error) {
|
|
243
243
|
logWarn("skill.directory.read.failed", {
|
|
@@ -364,9 +364,9 @@ async function loadSkillsByName(skillNames, available) {
|
|
|
364
364
|
name: parsed.skill.name,
|
|
365
365
|
description: parsed.skill.description,
|
|
366
366
|
skillPath: meta.skillPath,
|
|
367
|
-
...plugin ? { pluginProvider: plugin.manifest.name } :
|
|
368
|
-
...parsed.skill.allowedTools ? { allowedTools: parsed.skill.allowedTools } :
|
|
369
|
-
...parsed.skill.disableModelInvocation ? { disableModelInvocation: parsed.skill.disableModelInvocation } :
|
|
367
|
+
...plugin ? { pluginProvider: plugin.manifest.name } : void 0,
|
|
368
|
+
...parsed.skill.allowedTools ? { allowedTools: parsed.skill.allowedTools } : void 0,
|
|
369
|
+
...parsed.skill.disableModelInvocation ? { disableModelInvocation: parsed.skill.disableModelInvocation } : void 0
|
|
370
370
|
};
|
|
371
371
|
skills.push({
|
|
372
372
|
...loadedMeta,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toOptionalTrimmed
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-I6IFTAPF.js";
|
|
4
4
|
import {
|
|
5
5
|
pluginCatalogRuntime
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DRHEGXTZ.js";
|
|
7
7
|
import {
|
|
8
8
|
setSpanAttributes,
|
|
9
9
|
setSpanStatus
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RAZG3YHC.js";
|
|
11
11
|
|
|
12
12
|
// src/chat/sandbox/paths.ts
|
|
13
13
|
function normalizeWorkspaceRoot(input) {
|
|
@@ -98,10 +98,10 @@ function buildNonInteractiveCommand(input) {
|
|
|
98
98
|
async function runNonInteractiveCommand(sandbox, input) {
|
|
99
99
|
const command = {
|
|
100
100
|
...buildNonInteractiveCommand(input),
|
|
101
|
-
...input.cwd ? { cwd: input.cwd } :
|
|
102
|
-
...input.signal ? { signal: input.signal } :
|
|
103
|
-
...input.sudo !== void 0 ? { sudo: input.sudo } :
|
|
104
|
-
...input.timeoutMs !== void 0 ? { timeoutMs: input.timeoutMs } :
|
|
101
|
+
...input.cwd ? { cwd: input.cwd } : void 0,
|
|
102
|
+
...input.signal ? { signal: input.signal } : void 0,
|
|
103
|
+
...input.sudo !== void 0 ? { sudo: input.sudo } : void 0,
|
|
104
|
+
...input.timeoutMs !== void 0 ? { timeoutMs: input.timeoutMs } : void 0
|
|
105
105
|
};
|
|
106
106
|
return await sandbox.runCommand(command);
|
|
107
107
|
}
|
|
@@ -344,7 +344,7 @@ function create(runtime, workspace) {
|
|
|
344
344
|
rebuildEpoch,
|
|
345
345
|
dependencies,
|
|
346
346
|
postinstall,
|
|
347
|
-
...workspace ? { workspace: workspaceRecipe(workspace) } :
|
|
347
|
+
...workspace ? { workspace: workspaceRecipe(workspace) } : void 0
|
|
348
348
|
})
|
|
349
349
|
).digest("hex");
|
|
350
350
|
return {
|
|
@@ -399,44 +399,6 @@ function getVercelSandboxCredentials() {
|
|
|
399
399
|
return void 0;
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
// src/chat/sandbox/snapshot/waiting-error.ts
|
|
403
|
-
var WorkspaceSnapshotWaitingError = class extends Error {
|
|
404
|
-
code = "workspace_snapshot_waiting";
|
|
405
|
-
workspaceName;
|
|
406
|
-
constructor(workspaceName) {
|
|
407
|
-
super(
|
|
408
|
-
`Workspace ${workspaceName} snapshot is still building; yielded for requeue`
|
|
409
|
-
);
|
|
410
|
-
this.name = "WorkspaceSnapshotWaitingError";
|
|
411
|
-
this.workspaceName = workspaceName;
|
|
412
|
-
}
|
|
413
|
-
};
|
|
414
|
-
function isWorkspaceSnapshotWaitingResult(details) {
|
|
415
|
-
if (!details || typeof details !== "object" || Array.isArray(details)) {
|
|
416
|
-
return false;
|
|
417
|
-
}
|
|
418
|
-
const record = details;
|
|
419
|
-
return record.timed_out === true && record.waiting === "workspace_snapshot" && typeof record.workspace?.name === "string" && record.workspace.name.length > 0;
|
|
420
|
-
}
|
|
421
|
-
function workspaceNameFromWaitingResult(details) {
|
|
422
|
-
if (!isWorkspaceSnapshotWaitingResult(details)) return void 0;
|
|
423
|
-
const name = details.workspace?.name;
|
|
424
|
-
return typeof name === "string" ? name : void 0;
|
|
425
|
-
}
|
|
426
|
-
function isWorkspaceSnapshotWaitingError(error) {
|
|
427
|
-
const seen = /* @__PURE__ */ new Set();
|
|
428
|
-
let current = error;
|
|
429
|
-
while (current && !seen.has(current)) {
|
|
430
|
-
if (current instanceof WorkspaceSnapshotWaitingError) return true;
|
|
431
|
-
if (current instanceof Error && (current.name === "WorkspaceSnapshotWaitingError" || current.code === "workspace_snapshot_waiting")) {
|
|
432
|
-
return true;
|
|
433
|
-
}
|
|
434
|
-
seen.add(current);
|
|
435
|
-
current = typeof current === "object" ? current.cause : void 0;
|
|
436
|
-
}
|
|
437
|
-
return false;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
402
|
// src/chat/sandbox/http-error-details.ts
|
|
441
403
|
var DEFAULT_PREVIEW_LIMIT = 512;
|
|
442
404
|
function toTrimmedString(value, maxChars) {
|
|
@@ -653,9 +615,6 @@ function isSandboxCommandStreamInterruptedError(error) {
|
|
|
653
615
|
});
|
|
654
616
|
}
|
|
655
617
|
function wrapSandboxSetupError(error) {
|
|
656
|
-
if (isWorkspaceSnapshotWaitingError(error)) {
|
|
657
|
-
return error instanceof Error ? error : new Error(String(error));
|
|
658
|
-
}
|
|
659
618
|
try {
|
|
660
619
|
const details = getSandboxErrorDetails(error);
|
|
661
620
|
if (details.summary) {
|
|
@@ -683,7 +642,7 @@ function throwSandboxOperationError(action, error, includeMissingPath = false) {
|
|
|
683
642
|
...details.attributes,
|
|
684
643
|
...includeMissingPath ? {
|
|
685
644
|
"app.sandbox.api_error.missing_path": details.searchableText.includes("no such file") || details.searchableText.includes("enoent")
|
|
686
|
-
} :
|
|
645
|
+
} : void 0,
|
|
687
646
|
"app.sandbox.success": false
|
|
688
647
|
});
|
|
689
648
|
setSpanStatus("error");
|
|
@@ -703,10 +662,6 @@ export {
|
|
|
703
662
|
sandboxSkillDir,
|
|
704
663
|
sandboxSkillFile,
|
|
705
664
|
sandboxSkillPathResolution,
|
|
706
|
-
WorkspaceSnapshotWaitingError,
|
|
707
|
-
isWorkspaceSnapshotWaitingResult,
|
|
708
|
-
workspaceNameFromWaitingResult,
|
|
709
|
-
isWorkspaceSnapshotWaitingError,
|
|
710
665
|
sleep,
|
|
711
666
|
buildCommandScript,
|
|
712
667
|
buildNonInteractiveShellScript,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import {
|
|
2
|
+
QUEUE_SIGNATURE_MAX_AGE_MS,
|
|
3
|
+
createVercelQueueClient,
|
|
4
|
+
signQueueMessage,
|
|
5
|
+
verifyQueueMessage
|
|
6
|
+
} from "./chunk-7H2VZTWN.js";
|
|
7
|
+
|
|
8
|
+
// src/chat/sandbox/snapshot/job-queue.ts
|
|
9
|
+
import { createHash } from "crypto";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
var SIGNATURE_CONTEXT = "junior.workspace_snapshot_queue.v1";
|
|
12
|
+
var SIGNATURE_VERSION = "v1";
|
|
13
|
+
var WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC = "junior_workspace_snapshots";
|
|
14
|
+
var workspaceSnapshotJobMessageSchema = z.object({
|
|
15
|
+
workspaceId: z.string().uuid(),
|
|
16
|
+
profileHash: z.string().min(1)
|
|
17
|
+
}).strict();
|
|
18
|
+
var workspaceSnapshotJobSign = {
|
|
19
|
+
context: SIGNATURE_CONTEXT,
|
|
20
|
+
schema: workspaceSnapshotJobMessageSchema,
|
|
21
|
+
signatureVersion: SIGNATURE_VERSION,
|
|
22
|
+
parts: (message) => [
|
|
23
|
+
message.workspaceId,
|
|
24
|
+
message.profileHash
|
|
25
|
+
]
|
|
26
|
+
};
|
|
27
|
+
function jobId(message) {
|
|
28
|
+
const digest = createHash("sha256").update(message.workspaceId).update("\0").update(message.profileHash).digest("hex").slice(0, 32);
|
|
29
|
+
return `workspace-snapshot_${digest}`;
|
|
30
|
+
}
|
|
31
|
+
function signWorkspaceSnapshotJobMessage(message, nowMs = Date.now()) {
|
|
32
|
+
return signQueueMessage(workspaceSnapshotJobSign, message, nowMs);
|
|
33
|
+
}
|
|
34
|
+
function verifyWorkspaceSnapshotJobMessage(value, nowMs = Date.now()) {
|
|
35
|
+
return verifyQueueMessage(workspaceSnapshotJobSign, value, nowMs);
|
|
36
|
+
}
|
|
37
|
+
async function send(message, idempotencyKey) {
|
|
38
|
+
const options = {
|
|
39
|
+
retentionSeconds: QUEUE_SIGNATURE_MAX_AGE_MS / 1e3
|
|
40
|
+
};
|
|
41
|
+
if (idempotencyKey) options.idempotencyKey = idempotencyKey;
|
|
42
|
+
await createVercelQueueClient().send(
|
|
43
|
+
WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC,
|
|
44
|
+
signWorkspaceSnapshotJobMessage(message),
|
|
45
|
+
options
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
async function sendWorkspaceSnapshotJob(message) {
|
|
49
|
+
await send(message, jobId(message));
|
|
50
|
+
}
|
|
51
|
+
async function sendNextWorkspaceSnapshotJob(message) {
|
|
52
|
+
await send(message);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export {
|
|
56
|
+
WORKSPACE_SNAPSHOT_JOB_QUEUE_TOPIC,
|
|
57
|
+
verifyWorkspaceSnapshotJobMessage,
|
|
58
|
+
sendWorkspaceSnapshotJob,
|
|
59
|
+
sendNextWorkspaceSnapshotJob
|
|
60
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// package.json
|
|
2
2
|
var package_default = {
|
|
3
3
|
name: "@sentry/junior",
|
|
4
|
-
version: "0.
|
|
4
|
+
version: "0.180.0",
|
|
5
5
|
private: false,
|
|
6
6
|
publishConfig: {
|
|
7
7
|
access: "public"
|
|
@@ -105,9 +105,10 @@ var package_default = {
|
|
|
105
105
|
zod: "catalog:"
|
|
106
106
|
},
|
|
107
107
|
devDependencies: {
|
|
108
|
-
"@hono/node-server": "1.19.14",
|
|
109
108
|
"@emnapi/core": "^1.10.0",
|
|
110
109
|
"@emnapi/runtime": "^1.10.0",
|
|
110
|
+
"@hono/node-server": "1.19.14",
|
|
111
|
+
"@oxlint/plugins": "1.79.0",
|
|
111
112
|
"@sentry/junior-github": "workspace:*",
|
|
112
113
|
"@sentry/junior-memory": "workspace:*",
|
|
113
114
|
"@sentry/junior-testing": "workspace:*",
|
|
@@ -118,7 +119,7 @@ var package_default = {
|
|
|
118
119
|
"drizzle-kit": "catalog:",
|
|
119
120
|
msw: "^2.14.6",
|
|
120
121
|
nitro: "3.0.260522-beta",
|
|
121
|
-
oxlint: "^1.
|
|
122
|
+
oxlint: "^1.79.0",
|
|
122
123
|
tsup: "^8.5.1",
|
|
123
124
|
typescript: "^6.0.3",
|
|
124
125
|
vercel: "^54.4.0",
|
package/dist/cli/chat.js
CHANGED
|
@@ -1,46 +1,50 @@
|
|
|
1
1
|
import {
|
|
2
2
|
executeAgentRun
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-5PUMIMNQ.js";
|
|
4
|
+
import "../chunk-VG722ONZ.js";
|
|
5
|
+
import "../chunk-6Y5B5PEX.js";
|
|
5
6
|
import "../chunk-DIB4GX3G.js";
|
|
6
7
|
import {
|
|
7
8
|
createAgentRunner
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-4GWXAILB.js";
|
|
9
|
+
} from "../chunk-LGVQLNLS.js";
|
|
10
10
|
import "../chunk-RF6J3DIO.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-6ZWRNC4D.js";
|
|
11
|
+
import "../chunk-O4QYZTDK.js";
|
|
13
12
|
import "../chunk-VRS6WDK5.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-CK6EINVZ.js";
|
|
14
|
+
import "../chunk-CCDXTDSY.js";
|
|
15
|
+
import "../chunk-L7LTGN4Z.js";
|
|
16
|
+
import "../chunk-GUKXEPMX.js";
|
|
17
|
+
import "../chunk-GPXAHUQH.js";
|
|
18
|
+
import "../chunk-2AYEVN7K.js";
|
|
18
19
|
import "../chunk-PDO5BLNM.js";
|
|
19
20
|
import "../chunk-UIE3R5XU.js";
|
|
21
|
+
import "../chunk-X6GDDWQH.js";
|
|
22
|
+
import "../chunk-DKIJ2RP5.js";
|
|
23
|
+
import "../chunk-JAL3CH4G.js";
|
|
24
|
+
import "../chunk-7H2VZTWN.js";
|
|
25
|
+
import "../chunk-ZE2KOV3G.js";
|
|
20
26
|
import {
|
|
21
27
|
loadAppPluginSet
|
|
22
28
|
} from "../chunk-Y2CM7HXH.js";
|
|
23
|
-
import "../chunk-
|
|
29
|
+
import "../chunk-DHLOGWYH.js";
|
|
24
30
|
import "../chunk-3Y47VMHV.js";
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-GENV6KF2.js";
|
|
31
|
+
import "../chunk-S7YRTOSQ.js";
|
|
32
|
+
import "../chunk-FGC3PHNH.js";
|
|
33
|
+
import "../chunk-WVAMRKYG.js";
|
|
34
|
+
import "../chunk-GA5NS74S.js";
|
|
30
35
|
import "../chunk-VFUK3X5B.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
36
|
-
import "../chunk-
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
42
|
-
import "../chunk-
|
|
43
|
-
import "../chunk-MLKGABMK.js";
|
|
36
|
+
import "../chunk-I6IFTAPF.js";
|
|
37
|
+
import "../chunk-6YCEWOLO.js";
|
|
38
|
+
import "../chunk-VGPPWWHF.js";
|
|
39
|
+
import "../chunk-DRHEGXTZ.js";
|
|
40
|
+
import "../chunk-2YIRH4E3.js";
|
|
41
|
+
import "../chunk-CEMMLV5L.js";
|
|
42
|
+
import "../chunk-N7TMSOZH.js";
|
|
43
|
+
import "../chunk-DWPN6SCH.js";
|
|
44
|
+
import "../chunk-TXKUKMVO.js";
|
|
45
|
+
import "../chunk-RAZG3YHC.js";
|
|
46
|
+
import "../chunk-PEQXYSSE.js";
|
|
47
|
+
import "../chunk-ZM7ZURJS.js";
|
|
44
48
|
|
|
45
49
|
// src/cli/chat.ts
|
|
46
50
|
import {
|
|
@@ -161,11 +165,11 @@ async function configureLocalChatPlugins(pluginSet) {
|
|
|
161
165
|
validationModule,
|
|
162
166
|
databaseModule
|
|
163
167
|
] = await Promise.all([
|
|
164
|
-
import("../plugins-
|
|
165
|
-
import("../agent-hooks-
|
|
166
|
-
import("../catalog-runtime-
|
|
167
|
-
import("../validation-
|
|
168
|
-
import("../db-
|
|
168
|
+
import("../plugins-YTYJMMJF.js"),
|
|
169
|
+
import("../agent-hooks-DKDDRKZA.js"),
|
|
170
|
+
import("../catalog-runtime-WXKGUF3W.js"),
|
|
171
|
+
import("../validation-62WO524A.js"),
|
|
172
|
+
import("../db-6SBHIAJK.js")
|
|
169
173
|
]);
|
|
170
174
|
const resolvedPluginSet = pluginSet === void 0 ? await loadLocalPluginSet() : pluginSet ?? void 0;
|
|
171
175
|
const plugins = pluginsModule.pluginRuntimeRegistrationsFromPluginSet(resolvedPluginSet);
|
|
@@ -229,16 +233,16 @@ function localDevServerUrl() {
|
|
|
229
233
|
async function prepareLocalChatRun(io, pluginSet) {
|
|
230
234
|
defaultStateAdapterForLocalChat();
|
|
231
235
|
await configureLocalChatPlugins(pluginSet);
|
|
232
|
-
const { setExperimentalFeatures } = await import("../experimental-
|
|
236
|
+
const { setExperimentalFeatures } = await import("../experimental-SIJSRDJD.js");
|
|
233
237
|
setExperimentalFeatures({ subagents: true });
|
|
234
|
-
const { runLocalAgentTurn } = await import("../runner-
|
|
235
|
-
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-
|
|
236
|
-
const { createLocalOAuthState } = await import("../oauth-relay-
|
|
237
|
-
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-
|
|
238
|
-
const { bindSpawnAgent } = await import("../spawn-
|
|
239
|
-
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-
|
|
240
|
-
const { createLocalConversationWork } = await import("../conversation-work-
|
|
241
|
-
const { processConversationWork } = await import("../worker-
|
|
238
|
+
const { runLocalAgentTurn } = await import("../runner-GWTSWESR.js");
|
|
239
|
+
const { startLocalOAuthCallbackServer } = await import("../oauth-callback-server-WSDQPZZS.js");
|
|
240
|
+
const { createLocalOAuthState } = await import("../oauth-relay-5XPVRPYB.js");
|
|
241
|
+
const { createLocalSandboxEgressSignalTransport } = await import("../sandbox-egress-signals-FIL7EGPR.js");
|
|
242
|
+
const { bindSpawnAgent } = await import("../spawn-X5BPP5OE.js");
|
|
243
|
+
const { createAgentInvocationWorker, routeAgentInvocationWork } = await import("../work-3C3CMZ24.js");
|
|
244
|
+
const { createLocalConversationWork } = await import("../conversation-work-VIOQ5ZF3.js");
|
|
245
|
+
const { processConversationWork } = await import("../worker-MFAI6ZEK.js");
|
|
242
246
|
let agentRunner;
|
|
243
247
|
const localConversationWork = createLocalConversationWork(async (message) => {
|
|
244
248
|
if (!agentRunner) {
|