@sentry/junior 0.203.0 → 0.204.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-CMyTD4DD.js +17509 -0
- package/dist/agent-hooks-Bbcp9e33.js +4040 -0
- package/dist/agent-runner-DNb1A49M.js +678 -0
- package/dist/api/schema.d.ts +2728 -2639
- package/dist/api/schema.js +4 -169
- package/dist/api.d.ts +23 -17
- package/dist/api.js +3881 -5326
- package/dist/app-B1TOqBI8.d.ts +246 -0
- package/dist/app.d.ts +4 -520
- package/dist/app.js +9522 -11875
- package/dist/auth-pause-state-DosEalIG.js +168 -0
- package/dist/catalog-runtime-BReos-D4.js +7 -0
- package/dist/checkpoint-CNrPyRJN.js +2450 -0
- package/dist/cli/chat.d.ts +20 -0
- package/dist/cli/chat.js +229 -336
- package/dist/cli/check.d.ts +8 -0
- package/dist/cli/check.js +513 -806
- package/dist/cli/env.d.ts +13 -0
- package/dist/cli/env.js +63 -12
- package/dist/cli/init.d.ts +3 -0
- package/dist/cli/init.js +90 -159
- package/dist/cli/main.d.ts +6 -0
- package/dist/cli/main.js +43 -64
- package/dist/cli/plugins.d.ts +13 -0
- package/dist/cli/plugins.js +148 -227
- package/dist/cli/run.d.ts +16 -0
- package/dist/cli/run.js +52 -8
- package/dist/cli/snapshot-create.d.ts +4 -0
- package/dist/cli/snapshot-create.js +71 -125
- package/dist/cli/upgrade.d.ts +15 -0
- package/dist/cli/upgrade.js +232 -335
- package/dist/config-nGCW1OTG.js +941 -0
- package/dist/context-B45_WqVX.js +298 -0
- package/dist/conversation-privacy-B4voFRSm.js +182 -0
- package/dist/conversation-work-C6y3T5Hx.js +51 -0
- package/dist/credential-sync-kXr1hvO1.js +2660 -0
- package/dist/db-BeyXKJOI.d.ts +5 -0
- package/dist/destinations-BeBiJeEM.js +29 -0
- package/dist/execution-stats-DWfSihcH.js +373 -0
- package/dist/executor-DcMSlI5c.js +721 -0
- package/dist/experimental-CIXf7Uye.js +46 -0
- package/dist/history-ClE4toxe.d.ts +32 -0
- package/dist/history-CqTuSAdI.js +441 -0
- package/dist/instrumentation.d.ts +3 -3
- package/dist/instrumentation.js +130 -176
- package/dist/job-queue-Drn_LXlM.js +63 -0
- package/dist/logging-BzAk1S_s.js +1210 -0
- package/dist/model-profile-CZmVoGdX.js +49 -0
- package/dist/nitro.d.ts +31 -36
- package/dist/nitro.js +275 -456
- package/dist/oauth-callback-server-JiftokvA.js +130 -0
- package/dist/oauth-relay-CdCnu80W.js +62 -0
- package/dist/package-discovery-7a9YqLhE.js +455 -0
- package/dist/pending-auth-CWmSdZVg.js +185 -0
- package/dist/plugin-module-BKGOXca2.js +81 -0
- package/dist/plugins-BI9A1vKA.d.ts +95 -0
- package/dist/plugins-egKWjgue.js +99 -0
- package/dist/private-trace-result-BLvBjy_e.js +16 -0
- package/dist/profile-CrT5nXbw.js +861 -0
- package/dist/registry-DH1xUo2N.js +1419 -0
- package/dist/reporting-schema-DosTN__Q.js +105 -0
- package/dist/resolve-CZHnfxaS.js +546 -0
- package/dist/rolldown-runtime-B4FMCO8f.js +28 -0
- package/dist/runner-CZV2sC46.js +392 -0
- package/dist/sandbox-egress-signals-bHZfmhbd.js +46 -0
- package/dist/schema-Rn8-XEaN.js +1140 -0
- package/dist/sentry-CD3SdJl-.js +26 -0
- package/dist/skills-CIcDQSgM.js +316 -0
- package/dist/spawn-DdkUFRmq.js +29 -0
- package/dist/stats-DTUbAb88.js +2634 -0
- package/dist/store-C5qxF2ac.d.ts +208 -0
- package/dist/task-queue-CJIR4RF7.js +136 -0
- package/dist/task-runner-D-O3A-Cp.js +639 -0
- package/dist/thread-state-CRc9jTJS.js +431 -0
- package/dist/turn-execution-BkinIdJF.js +47 -0
- package/dist/turn-lifecycle-DQV19VTW.js +54 -0
- package/dist/usage-D3EbSO7w.js +296 -0
- package/dist/usage-schema-CKaDkH_j.js +20 -0
- package/dist/validation-C2CR-OX3.js +40 -0
- package/dist/vercel-queue-DIkVcfK4.js +167 -0
- package/dist/vercel.d.ts +6 -6
- package/dist/vercel.js +14 -6
- package/dist/version-CnXZ614E.d.ts +5 -0
- package/dist/version-DxcWdoKa.js +8 -0
- package/dist/version.d.ts +2 -4
- package/dist/version.js +2 -6
- package/dist/web-authorization-RMBxAR_t.js +76 -0
- package/dist/web-input-3EPfpf55.js +494 -0
- package/dist/work-fGofI7Op.js +509 -0
- package/dist/worker-CsOLq-mR.js +625 -0
- package/package.json +8 -8
- package/dist/agent-hooks-GB2VPTNA.js +0 -51
- package/dist/catalog-runtime-UBLIWD3O.js +0 -14
- package/dist/chunk-2LYHWMR4.js +0 -46
- package/dist/chunk-352OWAZH.js +0 -320
- package/dist/chunk-3Y47VMHV.js +0 -6
- package/dist/chunk-3YJSKOWF.js +0 -164
- package/dist/chunk-4KSSKTQ5.js +0 -229
- package/dist/chunk-4UO6FK4G.js +0 -64
- package/dist/chunk-5AHX53NQ.js +0 -717
- package/dist/chunk-5J3E5FWA.js +0 -700
- package/dist/chunk-5PDAG6O3.js +0 -206
- package/dist/chunk-6Y5B5PEX.js +0 -80
- package/dist/chunk-7GWQ5S5R.js +0 -2086
- package/dist/chunk-7H2VZTWN.js +0 -103
- package/dist/chunk-7NL7T6VU.js +0 -406
- package/dist/chunk-A5L27LE4.js +0 -387
- package/dist/chunk-ADIAWL34.js +0 -81
- package/dist/chunk-ASTEMBKJ.js +0 -519
- package/dist/chunk-CEMMLV5L.js +0 -98
- package/dist/chunk-CM5HNV2W.js +0 -131
- package/dist/chunk-CRTRBBRI.js +0 -105
- package/dist/chunk-DA2KGZZI.js +0 -13
- package/dist/chunk-DIB4GX3G.js +0 -8
- package/dist/chunk-DKIJ2RP5.js +0 -68
- package/dist/chunk-DWPN6SCH.js +0 -172
- package/dist/chunk-EDKUFGPL.js +0 -64
- package/dist/chunk-ENY6SKIU.js +0 -1228
- package/dist/chunk-F4MGCZOX.js +0 -2943
- package/dist/chunk-FA6POGLH.js +0 -70
- package/dist/chunk-FSUR7GTG.js +0 -20475
- package/dist/chunk-GKEOHJL5.js +0 -1856
- package/dist/chunk-GMCB6W5Y.js +0 -333
- package/dist/chunk-IE2VPG7O.js +0 -1135
- package/dist/chunk-IZ5B5IHQ.js +0 -3656
- package/dist/chunk-JAL3CH4G.js +0 -27
- package/dist/chunk-KIIEUXD3.js +0 -1764
- package/dist/chunk-KXU4NIL7.js +0 -692
- package/dist/chunk-MTM5IFCY.js +0 -1190
- package/dist/chunk-N7TMSOZH.js +0 -235
- package/dist/chunk-NCEBK6PH.js +0 -36
- package/dist/chunk-NHJU2ZAL.js +0 -56
- package/dist/chunk-P6KTRNVC.js +0 -321
- package/dist/chunk-PDO5BLNM.js +0 -22
- package/dist/chunk-PDRNLLFT.js +0 -3295
- package/dist/chunk-PEQXYSSE.js +0 -45
- package/dist/chunk-PKEX2AQX.js +0 -198
- package/dist/chunk-PSJCGIGO.js +0 -1163
- package/dist/chunk-PZUSUL55.js +0 -506
- package/dist/chunk-R45M4TUS.js +0 -37
- package/dist/chunk-RC745GGZ.js +0 -122
- package/dist/chunk-SP3QKZXJ.js +0 -820
- package/dist/chunk-TXKUKMVO.js +0 -417
- package/dist/chunk-UE4GPWSD.js +0 -931
- package/dist/chunk-UIE3R5XU.js +0 -17
- package/dist/chunk-UXPG6ZIN.js +0 -84
- package/dist/chunk-VFUK3X5B.js +0 -50
- package/dist/chunk-VNMJWREK.js +0 -787
- package/dist/chunk-VZ7CSOX2.js +0 -706
- package/dist/chunk-WCNQJKFT.js +0 -10
- package/dist/chunk-WDZR3QQM.js +0 -135
- package/dist/chunk-WLYVJCHV.js +0 -1433
- package/dist/chunk-WS7NAFTM.js +0 -1520
- package/dist/chunk-X6GDDWQH.js +0 -60
- package/dist/chunk-XPDEYNQI.js +0 -102
- package/dist/chunk-XRW44VGM.js +0 -58
- package/dist/chunk-Y2CM7HXH.js +0 -111
- package/dist/chunk-Y7X25LFY.js +0 -15
- package/dist/conversation-work-VIOQ5ZF3.js +0 -54
- package/dist/db-NGDJV7YH.js +0 -26
- package/dist/discovery-DWVDM7UK.js +0 -44
- package/dist/experimental-P5FZM4CU.js +0 -12
- package/dist/oauth-callback-server-YFY7YEGK.js +0 -243
- package/dist/oauth-relay-5XPVRPYB.js +0 -8
- package/dist/plugins-YTYJMMJF.js +0 -14
- package/dist/runner-ORTNSB2Q.js +0 -522
- package/dist/sandbox-egress-signals-FIL7EGPR.js +0 -73
- package/dist/sentry-MB3NL3IR.js +0 -42
- package/dist/skills-H376WQOH.js +0 -27
- package/dist/spawn-T43WHLOS.js +0 -42
- package/dist/task-runner-LBZWF32V.js +0 -36
- package/dist/validation-REJLRKI6.js +0 -17
- package/dist/work-3KJ3RE76.js +0 -51
- package/dist/worker-QFEBU72E.js +0 -24
package/dist/chunk-X6GDDWQH.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
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
|
-
};
|
package/dist/chunk-XPDEYNQI.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
parseSlackChannelId,
|
|
3
|
-
parseSlackMessageTs,
|
|
4
|
-
parseSlackTeamId
|
|
5
|
-
} from "./chunk-N7TMSOZH.js";
|
|
6
|
-
import {
|
|
7
|
-
toOptionalString
|
|
8
|
-
} from "./chunk-WS7NAFTM.js";
|
|
9
|
-
|
|
10
|
-
// src/chat/slack/context.ts
|
|
11
|
-
import { z } from "zod";
|
|
12
|
-
function toTrimmedSlackString(value) {
|
|
13
|
-
const normalized = toOptionalString(value);
|
|
14
|
-
return normalized?.trim() || void 0;
|
|
15
|
-
}
|
|
16
|
-
var slackMessageEnvelopeSchema = z.object({
|
|
17
|
-
raw: z.unknown().optional()
|
|
18
|
-
});
|
|
19
|
-
var rawSlackMessageSchema = z.object({
|
|
20
|
-
channel: z.unknown().optional(),
|
|
21
|
-
message: z.unknown().optional(),
|
|
22
|
-
team: z.unknown().optional(),
|
|
23
|
-
team_id: z.unknown().optional(),
|
|
24
|
-
thread_ts: z.unknown().optional(),
|
|
25
|
-
ts: z.unknown().optional(),
|
|
26
|
-
user_team: z.unknown().optional()
|
|
27
|
-
});
|
|
28
|
-
var nestedRawSlackMessageSchema = z.object({
|
|
29
|
-
ts: z.unknown().optional()
|
|
30
|
-
});
|
|
31
|
-
function readSlackRawMessageContext(message) {
|
|
32
|
-
const envelope = slackMessageEnvelopeSchema.safeParse(message);
|
|
33
|
-
if (!envelope.success) {
|
|
34
|
-
return void 0;
|
|
35
|
-
}
|
|
36
|
-
const raw = rawSlackMessageSchema.safeParse(envelope.data.raw);
|
|
37
|
-
if (!raw.success) {
|
|
38
|
-
return void 0;
|
|
39
|
-
}
|
|
40
|
-
const nestedMessage = nestedRawSlackMessageSchema.safeParse(raw.data.message);
|
|
41
|
-
const channelId = parseSlackChannelId(raw.data.channel);
|
|
42
|
-
const threadTs = parseSlackMessageTs(raw.data.thread_ts);
|
|
43
|
-
const messageTs = parseSlackMessageTs(raw.data.ts);
|
|
44
|
-
const nestedMessageTs = nestedMessage.success && parseSlackMessageTs(nestedMessage.data.ts);
|
|
45
|
-
const teamId = parseSlackTeamId(raw.data.team_id) ?? parseSlackTeamId(raw.data.team);
|
|
46
|
-
const authorTeamId = parseSlackTeamId(raw.data.user_team);
|
|
47
|
-
return {
|
|
48
|
-
...channelId ? { channelId } : void 0,
|
|
49
|
-
...threadTs ? { threadTs } : void 0,
|
|
50
|
-
...messageTs ? { messageTs } : void 0,
|
|
51
|
-
...nestedMessageTs ? { nestedMessageTs } : void 0,
|
|
52
|
-
...teamId ? { teamId } : void 0,
|
|
53
|
-
...authorTeamId ? { authorTeamId } : void 0
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
function parseSlackThreadId(threadId) {
|
|
57
|
-
const normalizedThreadId = toTrimmedSlackString(threadId);
|
|
58
|
-
if (!normalizedThreadId) {
|
|
59
|
-
return void 0;
|
|
60
|
-
}
|
|
61
|
-
const parts = normalizedThreadId.split(":");
|
|
62
|
-
if (parts.length !== 3 || parts[0] !== "slack") {
|
|
63
|
-
return void 0;
|
|
64
|
-
}
|
|
65
|
-
const channelId = parseSlackChannelId(parts[1]);
|
|
66
|
-
const threadTs = parseSlackMessageTs(parts[2]);
|
|
67
|
-
if (!channelId || !threadTs) {
|
|
68
|
-
return void 0;
|
|
69
|
-
}
|
|
70
|
-
return { channelId, threadTs };
|
|
71
|
-
}
|
|
72
|
-
function resolveSlackChannelIdFromThreadId(threadId) {
|
|
73
|
-
return parseSlackThreadId(threadId)?.channelId;
|
|
74
|
-
}
|
|
75
|
-
function resolveSlackChannelIdFromMessage(message) {
|
|
76
|
-
const messageChannelId = parseSlackChannelId(
|
|
77
|
-
message.channelId
|
|
78
|
-
);
|
|
79
|
-
if (messageChannelId) {
|
|
80
|
-
return messageChannelId;
|
|
81
|
-
}
|
|
82
|
-
const raw = message.raw;
|
|
83
|
-
if (raw && typeof raw === "object") {
|
|
84
|
-
const rawChannel = parseSlackChannelId(
|
|
85
|
-
raw.channel
|
|
86
|
-
);
|
|
87
|
-
if (rawChannel) {
|
|
88
|
-
return rawChannel;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
const threadId = toTrimmedSlackString(
|
|
92
|
-
message.threadId
|
|
93
|
-
);
|
|
94
|
-
return resolveSlackChannelIdFromThreadId(threadId);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export {
|
|
98
|
-
readSlackRawMessageContext,
|
|
99
|
-
parseSlackThreadId,
|
|
100
|
-
resolveSlackChannelIdFromThreadId,
|
|
101
|
-
resolveSlackChannelIdFromMessage
|
|
102
|
-
};
|
package/dist/chunk-XRW44VGM.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConversationTurnLifecycleService
|
|
3
|
-
} from "./chunk-EDKUFGPL.js";
|
|
4
|
-
import {
|
|
5
|
-
runAgentWithTimeout
|
|
6
|
-
} from "./chunk-UE4GPWSD.js";
|
|
7
|
-
import {
|
|
8
|
-
getConversationEventStore
|
|
9
|
-
} from "./chunk-GKEOHJL5.js";
|
|
10
|
-
|
|
11
|
-
// src/chat/runtime/turn-execution.ts
|
|
12
|
-
var AgentRunError = class extends Error {
|
|
13
|
-
constructor(cause) {
|
|
14
|
-
super(cause instanceof Error ? cause.message : "Agent Run failed", {
|
|
15
|
-
cause
|
|
16
|
-
});
|
|
17
|
-
this.name = "AgentRunError";
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
async function executeTurn(agentRunner, run, saveResult, timeoutMs) {
|
|
21
|
-
let outcome;
|
|
22
|
-
try {
|
|
23
|
-
outcome = await runAgentWithTimeout(agentRunner, run, timeoutMs);
|
|
24
|
-
} catch (error) {
|
|
25
|
-
throw new AgentRunError(error);
|
|
26
|
-
}
|
|
27
|
-
if (outcome.status !== "completed") {
|
|
28
|
-
return outcome;
|
|
29
|
-
}
|
|
30
|
-
const saved = await saveResult(outcome.result);
|
|
31
|
-
const lifecycle = new ConversationTurnLifecycleService(
|
|
32
|
-
getConversationEventStore()
|
|
33
|
-
);
|
|
34
|
-
const common = {
|
|
35
|
-
conversationId: run.conversationId,
|
|
36
|
-
createdAtMs: saved.finishedAtMs ?? Date.now(),
|
|
37
|
-
turnId: run.turnId
|
|
38
|
-
};
|
|
39
|
-
if (saved.outcome === "failed") {
|
|
40
|
-
await lifecycle.fail({
|
|
41
|
-
...common,
|
|
42
|
-
...saved.eventId ? { eventId: saved.eventId } : void 0,
|
|
43
|
-
failureCode: saved.failureCode,
|
|
44
|
-
...saved.failureReason ? { failureReason: saved.failureReason } : void 0
|
|
45
|
-
});
|
|
46
|
-
} else {
|
|
47
|
-
await lifecycle.complete({
|
|
48
|
-
...common,
|
|
49
|
-
outcome: saved.outcome
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
return { status: "completed" };
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export {
|
|
56
|
-
AgentRunError,
|
|
57
|
-
executeTurn
|
|
58
|
-
};
|
package/dist/chunk-Y2CM7HXH.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
// src/plugin-module.ts
|
|
2
|
-
import { statSync } from "fs";
|
|
3
|
-
import { createRequire } from "module";
|
|
4
|
-
import path from "path";
|
|
5
|
-
import { pathToFileURL } from "url";
|
|
6
|
-
var PLUGIN_MODULE_EXTENSIONS = [
|
|
7
|
-
"",
|
|
8
|
-
".ts",
|
|
9
|
-
".tsx",
|
|
10
|
-
".mts",
|
|
11
|
-
".mjs",
|
|
12
|
-
".js",
|
|
13
|
-
".cjs"
|
|
14
|
-
];
|
|
15
|
-
function resolveRelativePluginModule(cwd, specifier) {
|
|
16
|
-
const basePath = path.resolve(cwd, specifier);
|
|
17
|
-
for (const extension of PLUGIN_MODULE_EXTENSIONS) {
|
|
18
|
-
const candidate = `${basePath}${extension}`;
|
|
19
|
-
try {
|
|
20
|
-
if (statSync(candidate).isFile()) {
|
|
21
|
-
return candidate;
|
|
22
|
-
}
|
|
23
|
-
} catch {
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
for (const extension of PLUGIN_MODULE_EXTENSIONS) {
|
|
27
|
-
const candidate = path.join(basePath, `index${extension}`);
|
|
28
|
-
try {
|
|
29
|
-
if (statSync(candidate).isFile()) {
|
|
30
|
-
return candidate;
|
|
31
|
-
}
|
|
32
|
-
} catch {
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
throw new Error(`Plugin module "${specifier}" could not be resolved`);
|
|
36
|
-
}
|
|
37
|
-
function resolvePluginModule(cwd, input) {
|
|
38
|
-
const moduleSpecifier = typeof input === "string" ? input : input.module;
|
|
39
|
-
const exportName = typeof input === "string" ? "plugins" : input.exportName ?? "plugins";
|
|
40
|
-
if (!moduleSpecifier.trim()) {
|
|
41
|
-
throw new Error("Plugin module specifier must not be empty");
|
|
42
|
-
}
|
|
43
|
-
if (moduleSpecifier.startsWith(".") || path.isAbsolute(moduleSpecifier)) {
|
|
44
|
-
const resolvedPath2 = resolveRelativePluginModule(cwd, moduleSpecifier);
|
|
45
|
-
return {
|
|
46
|
-
exportName,
|
|
47
|
-
importPath: resolvedPath2,
|
|
48
|
-
importUrl: pathToFileURL(resolvedPath2).href,
|
|
49
|
-
kind: "file",
|
|
50
|
-
sourceSpecifier: moduleSpecifier
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const requireFromApp = createRequire(path.join(cwd, "package.json"));
|
|
54
|
-
const resolvedPath = requireFromApp.resolve(moduleSpecifier);
|
|
55
|
-
return {
|
|
56
|
-
exportName,
|
|
57
|
-
importPath: resolvedPath,
|
|
58
|
-
importUrl: pathToFileURL(resolvedPath).href,
|
|
59
|
-
kind: "package",
|
|
60
|
-
sourceSpecifier: moduleSpecifier
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
function assertPluginSet(value, source) {
|
|
64
|
-
if (!value || typeof value !== "object" || !Array.isArray(value.packageNames) || !Array.isArray(value.registrations)) {
|
|
65
|
-
throw new Error(
|
|
66
|
-
`Plugin module ${source} must export a defineJuniorPlugins(...) set`
|
|
67
|
-
);
|
|
68
|
-
}
|
|
69
|
-
const pluginSet = value;
|
|
70
|
-
const invalidPackageName = pluginSet.packageNames?.find(
|
|
71
|
-
(packageName) => typeof packageName !== "string"
|
|
72
|
-
);
|
|
73
|
-
if (invalidPackageName !== void 0) {
|
|
74
|
-
throw new Error(`Plugin module ${source} must export string package names`);
|
|
75
|
-
}
|
|
76
|
-
const invalidRegistration = pluginSet.registrations?.find(
|
|
77
|
-
(registration) => !registration || typeof registration !== "object" || !("manifest" in registration) || !registration.manifest || typeof registration.manifest !== "object" || !("name" in registration.manifest) || typeof registration.manifest.name !== "string"
|
|
78
|
-
);
|
|
79
|
-
if (invalidRegistration) {
|
|
80
|
-
throw new Error(
|
|
81
|
-
`Plugin module ${source} must export plugin registrations with manifest names`
|
|
82
|
-
);
|
|
83
|
-
}
|
|
84
|
-
return value;
|
|
85
|
-
}
|
|
86
|
-
async function loadPluginSetFromModule(moduleRef, importModule = async (ref) => await import(ref.importUrl)) {
|
|
87
|
-
const mod = await importModule(moduleRef);
|
|
88
|
-
const value = moduleRef.exportName === "default" ? mod.default : mod[moduleRef.exportName];
|
|
89
|
-
return assertPluginSet(
|
|
90
|
-
value,
|
|
91
|
-
`${moduleRef.importUrl}#${moduleRef.exportName}`
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
async function loadAppPluginSet(cwd, importModule) {
|
|
95
|
-
let pluginModule;
|
|
96
|
-
try {
|
|
97
|
-
pluginModule = resolvePluginModule(cwd, "./plugins");
|
|
98
|
-
} catch (error) {
|
|
99
|
-
if (error instanceof Error && error.message === 'Plugin module "./plugins" could not be resolved') {
|
|
100
|
-
return void 0;
|
|
101
|
-
}
|
|
102
|
-
throw error;
|
|
103
|
-
}
|
|
104
|
-
return await loadPluginSetFromModule(pluginModule, importModule);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
resolvePluginModule,
|
|
109
|
-
loadPluginSetFromModule,
|
|
110
|
-
loadAppPluginSet
|
|
111
|
-
};
|
package/dist/chunk-Y7X25LFY.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// src/vercel.ts
|
|
2
|
-
function juniorVercelConfig(options = {}) {
|
|
3
|
-
const buildCommand = options.buildCommand === void 0 ? "pnpm exec junior upgrade && pnpm build" : options.buildCommand;
|
|
4
|
-
const config = {
|
|
5
|
-
framework: "nitro"
|
|
6
|
-
};
|
|
7
|
-
if (buildCommand !== null) {
|
|
8
|
-
config.buildCommand = buildCommand;
|
|
9
|
-
}
|
|
10
|
-
return config;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
juniorVercelConfig
|
|
15
|
-
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
// src/chat/local/conversation-work.ts
|
|
2
|
-
function createLocalConversationWork(processMessage) {
|
|
3
|
-
const acceptedWakeIds = /* @__PURE__ */ new Map();
|
|
4
|
-
const pending = /* @__PURE__ */ new Set();
|
|
5
|
-
let firstError;
|
|
6
|
-
let nextWakeId = 1;
|
|
7
|
-
function schedule(message, options) {
|
|
8
|
-
const delayMs = Math.max(0, options?.delayMs ?? 0);
|
|
9
|
-
let work;
|
|
10
|
-
work = (async () => {
|
|
11
|
-
await new Promise((resolve) => {
|
|
12
|
-
setTimeout(resolve, delayMs);
|
|
13
|
-
});
|
|
14
|
-
await processMessage(message);
|
|
15
|
-
})().catch((error) => {
|
|
16
|
-
firstError ??= error;
|
|
17
|
-
}).finally(() => {
|
|
18
|
-
pending.delete(work);
|
|
19
|
-
});
|
|
20
|
-
pending.add(work);
|
|
21
|
-
}
|
|
22
|
-
const queue = {
|
|
23
|
-
async send(message, options) {
|
|
24
|
-
const idempotencyKey = options?.idempotencyKey;
|
|
25
|
-
const acceptedWakeId = idempotencyKey ? acceptedWakeIds.get(idempotencyKey) : void 0;
|
|
26
|
-
if (acceptedWakeId) {
|
|
27
|
-
return { messageId: acceptedWakeId };
|
|
28
|
-
}
|
|
29
|
-
const messageId = `local-conversation-work:${nextWakeId}`;
|
|
30
|
-
nextWakeId += 1;
|
|
31
|
-
if (idempotencyKey) {
|
|
32
|
-
acceptedWakeIds.set(idempotencyKey, messageId);
|
|
33
|
-
}
|
|
34
|
-
schedule(message, options);
|
|
35
|
-
return { messageId };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
return {
|
|
39
|
-
queue,
|
|
40
|
-
async drain() {
|
|
41
|
-
while (pending.size > 0) {
|
|
42
|
-
await Promise.all(pending);
|
|
43
|
-
}
|
|
44
|
-
if (firstError !== void 0) {
|
|
45
|
-
const error = firstError;
|
|
46
|
-
firstError = void 0;
|
|
47
|
-
throw error;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export {
|
|
53
|
-
createLocalConversationWork
|
|
54
|
-
};
|
package/dist/db-NGDJV7YH.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
closeDb,
|
|
3
|
-
getConversationEventStore,
|
|
4
|
-
getConversationMessageSearchStore,
|
|
5
|
-
getConversationStore,
|
|
6
|
-
getDb,
|
|
7
|
-
getSqlExecutor
|
|
8
|
-
} from "./chunk-GKEOHJL5.js";
|
|
9
|
-
import "./chunk-IE2VPG7O.js";
|
|
10
|
-
import "./chunk-7NL7T6VU.js";
|
|
11
|
-
import "./chunk-VFUK3X5B.js";
|
|
12
|
-
import "./chunk-ENY6SKIU.js";
|
|
13
|
-
import "./chunk-NHJU2ZAL.js";
|
|
14
|
-
import "./chunk-PKEX2AQX.js";
|
|
15
|
-
import "./chunk-N7TMSOZH.js";
|
|
16
|
-
import "./chunk-WS7NAFTM.js";
|
|
17
|
-
import "./chunk-PEQXYSSE.js";
|
|
18
|
-
import "./chunk-WDZR3QQM.js";
|
|
19
|
-
export {
|
|
20
|
-
closeDb,
|
|
21
|
-
getConversationEventStore,
|
|
22
|
-
getConversationMessageSearchStore,
|
|
23
|
-
getConversationStore,
|
|
24
|
-
getDb,
|
|
25
|
-
getSqlExecutor
|
|
26
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
builtInSkillsDir,
|
|
3
|
-
dataDir,
|
|
4
|
-
dataRoots,
|
|
5
|
-
descriptionPath,
|
|
6
|
-
descriptionPathCandidates,
|
|
7
|
-
discoverNodeModulesDirs,
|
|
8
|
-
discoverProjectRoots,
|
|
9
|
-
homeDir,
|
|
10
|
-
isDirectory,
|
|
11
|
-
isFile,
|
|
12
|
-
listReferenceFiles,
|
|
13
|
-
pluginRoots,
|
|
14
|
-
pluginsDir,
|
|
15
|
-
resolveHomeDir,
|
|
16
|
-
skillRoots,
|
|
17
|
-
skillsDir,
|
|
18
|
-
soulPath,
|
|
19
|
-
soulPathCandidates,
|
|
20
|
-
worldPath,
|
|
21
|
-
worldPathCandidates
|
|
22
|
-
} from "./chunk-TXKUKMVO.js";
|
|
23
|
-
export {
|
|
24
|
-
builtInSkillsDir,
|
|
25
|
-
dataDir,
|
|
26
|
-
dataRoots,
|
|
27
|
-
descriptionPath,
|
|
28
|
-
descriptionPathCandidates,
|
|
29
|
-
discoverNodeModulesDirs,
|
|
30
|
-
discoverProjectRoots,
|
|
31
|
-
homeDir,
|
|
32
|
-
isDirectory,
|
|
33
|
-
isFile,
|
|
34
|
-
listReferenceFiles,
|
|
35
|
-
pluginRoots,
|
|
36
|
-
pluginsDir,
|
|
37
|
-
resolveHomeDir,
|
|
38
|
-
skillRoots,
|
|
39
|
-
skillsDir,
|
|
40
|
-
soulPath,
|
|
41
|
-
soulPathCandidates,
|
|
42
|
-
worldPath,
|
|
43
|
-
worldPathCandidates
|
|
44
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
EXPERIMENTAL_FEATURES,
|
|
3
|
-
getExperimentalFeatures,
|
|
4
|
-
isExperimentalFeatureEnabled,
|
|
5
|
-
setExperimentalFeatures
|
|
6
|
-
} from "./chunk-2LYHWMR4.js";
|
|
7
|
-
export {
|
|
8
|
-
EXPERIMENTAL_FEATURES,
|
|
9
|
-
getExperimentalFeatures,
|
|
10
|
-
isExperimentalFeatureEnabled,
|
|
11
|
-
setExperimentalFeatures
|
|
12
|
-
};
|