@sentry/junior 0.189.0 → 0.190.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-6QRYH6PX.js → agent-hooks-3IG2FQW2.js} +11 -11
- package/dist/api.js +27 -27
- package/dist/app.js +86 -67
- package/dist/{catalog-runtime-IETJLJFG.js → catalog-runtime-2OT7S3ZC.js} +4 -4
- package/dist/chat/actor.d.ts +7 -2
- package/dist/chat/agent-invocations/types.d.ts +44 -308
- package/dist/chat/event-tasks/tool-support.d.ts +1 -1
- package/dist/chat/resource-events/actor.d.ts +2 -2
- package/dist/chat/source.d.ts +3 -3
- package/dist/chat/task-execution/mailbox-turn.d.ts +16 -6
- package/dist/chat/task-execution/state.d.ts +2 -2
- package/dist/chat/task-execution/store.d.ts +1 -1
- package/dist/chat/task-execution/turn-cursor.d.ts +10 -1
- package/dist/chat/tools/types.d.ts +9 -2
- package/dist/{chunk-6AUR6PWR.js → chunk-2MKHYSYL.js} +3 -3
- package/dist/{chunk-MI6ZBDTS.js → chunk-2MRF22J4.js} +25 -10
- package/dist/{chunk-OEIITG5F.js → chunk-3J3BCB4J.js} +1 -1
- package/dist/{chunk-SR6OMO5C.js → chunk-4BLFIYVK.js} +8 -8
- package/dist/{chunk-E3PDZPGV.js → chunk-4PKEJK5B.js} +1 -1
- package/dist/{chunk-CMWIMFM6.js → chunk-62DRKZQU.js} +5 -5
- package/dist/{chunk-ZV6PFUA4.js → chunk-663DQH5W.js} +1 -1
- package/dist/{chunk-GP32KD2J.js → chunk-67MMSYSE.js} +1 -1
- package/dist/{chunk-5CXCGDIL.js → chunk-6BXUSF7J.js} +1 -1
- package/dist/{chunk-WWYUYKKV.js → chunk-6H7YU6XH.js} +1 -1
- package/dist/{chunk-S3SGZUOI.js → chunk-7UJ6IJCK.js} +1 -1
- package/dist/{chunk-7R5JRPCY.js → chunk-7Y7XMI6P.js} +5 -5
- package/dist/{chunk-MFSET7Q7.js → chunk-BGOLRC36.js} +24 -8
- package/dist/{chunk-MVPLEPSI.js → chunk-BUJU6C2J.js} +1 -1
- package/dist/{chunk-KN32OWL2.js → chunk-CZXZKTAI.js} +3 -3
- package/dist/{chunk-QNIOBNOY.js → chunk-DJZGQ7OL.js} +52 -39
- package/dist/{chunk-DYXVAO2E.js → chunk-DVX6U6GI.js} +1 -1
- package/dist/{chunk-4RHJ3CXR.js → chunk-ECOR3OXY.js} +13 -12
- package/dist/{chunk-WMUAKAIF.js → chunk-F3K2267N.js} +29 -27
- package/dist/{chunk-YYZNESC3.js → chunk-FVFJ57RK.js} +8 -8
- package/dist/{chunk-PCPSX4ES.js → chunk-GWCFXTB6.js} +14 -12
- package/dist/{chunk-WDHPN2GH.js → chunk-HI5KXE3C.js} +3 -3
- package/dist/{chunk-WYDF6PGK.js → chunk-IRQ3RSX3.js} +3 -3
- package/dist/{chunk-NY2F7BZA.js → chunk-JV7U4665.js} +1 -1
- package/dist/{chunk-LHKZKAZ4.js → chunk-MNHJ4WLE.js} +3 -3
- package/dist/{chunk-YNZPOFF3.js → chunk-OJFX2FP7.js} +9 -9
- package/dist/{chunk-CUYFCI4G.js → chunk-OKAHLUSU.js} +16 -13
- package/dist/{chunk-VKQWU4PO.js → chunk-OON4IQHH.js} +1 -1
- package/dist/{chunk-AC7MDOJW.js → chunk-OYCOLHCR.js} +5 -5
- package/dist/{chunk-YYSEH2WC.js → chunk-REVH4BZU.js} +2 -2
- package/dist/{chunk-UCWO5MKP.js → chunk-RLYJYEIY.js} +4 -4
- package/dist/{chunk-ZUPDSJUE.js → chunk-T66GV7A3.js} +2 -2
- package/dist/{chunk-BYBSI5TI.js → chunk-VWNIDTFR.js} +2 -2
- package/dist/{chunk-MRXMFB4L.js → chunk-W2C4TPLB.js} +5 -5
- package/dist/{chunk-PY3EIEAF.js → chunk-Y4WL4OYD.js} +1 -1
- package/dist/{chunk-WN6VLHOU.js → chunk-YFU4DGZY.js} +4 -4
- package/dist/{chunk-O35GZCKL.js → chunk-YKIAUKYH.js} +2 -2
- package/dist/{chunk-5VWAY27R.js → chunk-ZFCO2TMB.js} +1 -1
- package/dist/cli/chat.js +33 -33
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +6 -6
- package/dist/db/schema/agent-invocations.d.ts +18 -6
- package/dist/db/schema.d.ts +18 -6
- package/dist/{db-LPJKR2EO.js → db-2IFDMDDY.js} +6 -6
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-DMXF4TTQ.js → oauth-callback-server-SZSS2KH6.js} +29 -29
- package/dist/{runner-L5DPVYCN.js → runner-2N4QU77X.js} +21 -21
- package/dist/{skills-NXG3LBCK.js → skills-VU2LZAKX.js} +5 -5
- package/dist/spawn-3K7RV4T5.js +42 -0
- package/dist/task-runner-52DYFHW3.js +36 -0
- package/dist/{validation-CH36LTOS.js → validation-IJGHK7NI.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-HBC5Y5VZ.js → work-DI45MLRL.js} +21 -21
- package/dist/{worker-5RDZHLXH.js → worker-FY7KWG2M.js} +10 -10
- package/package.json +5 -5
- package/dist/spawn-VRUIGKWW.js +0 -42
- package/dist/task-runner-7YTBSPXW.js +0 -36
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
getConversationEventStore,
|
|
6
6
|
getDb,
|
|
7
7
|
getSqlExecutor
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-OKAHLUSU.js";
|
|
9
9
|
import {
|
|
10
10
|
juniorCodeChanges,
|
|
11
11
|
juniorCodeRepositories,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
juniorUsers,
|
|
17
17
|
juniorWorkspaceRepos,
|
|
18
18
|
juniorWorkspaces
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ZFCO2TMB.js";
|
|
20
20
|
import {
|
|
21
21
|
SANDBOX_WORKSPACE_ROOT,
|
|
22
22
|
getVercelSandboxCredentials,
|
|
@@ -24,16 +24,16 @@ import {
|
|
|
24
24
|
isSandboxMissingError,
|
|
25
25
|
runNonInteractiveCommand,
|
|
26
26
|
sleep
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-HI5KXE3C.js";
|
|
28
28
|
import {
|
|
29
29
|
getStateAdapter
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-6BXUSF7J.js";
|
|
31
31
|
import {
|
|
32
32
|
botConfig,
|
|
33
33
|
completeObject,
|
|
34
34
|
embedTexts,
|
|
35
35
|
getSlackBotToken
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-VWNIDTFR.js";
|
|
37
37
|
import {
|
|
38
38
|
defaultModelId
|
|
39
39
|
} from "./chunk-D4YV5TDV.js";
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
setSpanAttributes,
|
|
53
53
|
setSpanStatus,
|
|
54
54
|
withSpan
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-Y4WL4OYD.js";
|
|
56
56
|
|
|
57
57
|
// src/chat/plugins/agent-hooks.ts
|
|
58
58
|
import {
|
|
@@ -898,7 +898,7 @@ var RESOURCE_WATCH_TOOL_SOURCE = {
|
|
|
898
898
|
|
|
899
899
|
// src/chat/slack/tool-support/context.ts
|
|
900
900
|
function getSlackToolContext(context) {
|
|
901
|
-
if (context.source.
|
|
901
|
+
if (context.source.kind !== "slack") {
|
|
902
902
|
return void 0;
|
|
903
903
|
}
|
|
904
904
|
if (context.destination.platform !== "slack") {
|
|
@@ -2304,7 +2304,7 @@ function pluginInvocationContext(context) {
|
|
|
2304
2304
|
conversationId: context.conversationId,
|
|
2305
2305
|
locationId: context.locationId
|
|
2306
2306
|
};
|
|
2307
|
-
switch (context.source.
|
|
2307
|
+
switch (context.source.kind) {
|
|
2308
2308
|
case "slack": {
|
|
2309
2309
|
if (context.destination.platform !== "slack") {
|
|
2310
2310
|
throw new TypeError("Slack plugin context requires Slack destination");
|
|
@@ -2334,6 +2334,13 @@ function pluginInvocationContext(context) {
|
|
|
2334
2334
|
destination: context.destination,
|
|
2335
2335
|
source: context.source
|
|
2336
2336
|
};
|
|
2337
|
+
case "resource_event":
|
|
2338
|
+
return {
|
|
2339
|
+
...common,
|
|
2340
|
+
actor: context.actor?.platform === "system" ? context.actor : void 0,
|
|
2341
|
+
destination: context.destination,
|
|
2342
|
+
source: context.source
|
|
2343
|
+
};
|
|
2337
2344
|
}
|
|
2338
2345
|
}
|
|
2339
2346
|
function invocationPluginContext(plugin, context, turnId) {
|
|
@@ -2529,7 +2536,7 @@ async function getPluginSystemPromptContributions(source) {
|
|
|
2529
2536
|
const pluginContributions = await hook({
|
|
2530
2537
|
...systemPromptPluginContext(plugin),
|
|
2531
2538
|
// Plugin system prompts only distinguish Slack vs non-Slack surfaces.
|
|
2532
|
-
platform: source.
|
|
2539
|
+
platform: source.kind === "slack" ? "slack" : "local"
|
|
2533
2540
|
});
|
|
2534
2541
|
const result = systemPromptMessageArraySchema.safeParse(pluginContributions);
|
|
2535
2542
|
if (!result.success) {
|
|
@@ -2725,7 +2732,7 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
|
|
|
2725
2732
|
}
|
|
2726
2733
|
};
|
|
2727
2734
|
let pluginContext;
|
|
2728
|
-
switch (context.source.
|
|
2735
|
+
switch (context.source.kind) {
|
|
2729
2736
|
case "slack":
|
|
2730
2737
|
if (context.destination.platform !== "slack") {
|
|
2731
2738
|
throw new TypeError(
|
|
@@ -2761,6 +2768,14 @@ function getPluginTools(context, sandbox = createSandboxCapability(context.works
|
|
|
2761
2768
|
source: context.source
|
|
2762
2769
|
};
|
|
2763
2770
|
break;
|
|
2771
|
+
case "resource_event":
|
|
2772
|
+
pluginContext = {
|
|
2773
|
+
...common,
|
|
2774
|
+
actor: context.actor?.platform === "system" ? context.actor : void 0,
|
|
2775
|
+
destination: context.destination,
|
|
2776
|
+
source: context.source
|
|
2777
|
+
};
|
|
2778
|
+
break;
|
|
2764
2779
|
}
|
|
2765
2780
|
const pluginTools = hook(pluginContext);
|
|
2766
2781
|
const namespace = pluginToolNamespace(pluginName);
|
|
@@ -3,39 +3,39 @@ import {
|
|
|
3
3
|
} from "./chunk-UTL3MHPC.js";
|
|
4
4
|
import {
|
|
5
5
|
parseSlackThreadId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BUJU6C2J.js";
|
|
7
7
|
import {
|
|
8
8
|
appendAndEnqueueExclusiveInboundMessage,
|
|
9
9
|
appendAndEnqueueInboundMessage
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YFU4DGZY.js";
|
|
11
11
|
import {
|
|
12
12
|
buildDeterministicTurnId
|
|
13
13
|
} from "./chunk-DA2KGZZI.js";
|
|
14
14
|
import {
|
|
15
15
|
normalizeSlackConversationId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-2MRF22J4.js";
|
|
17
17
|
import {
|
|
18
18
|
getConversationStore,
|
|
19
19
|
getDb
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-OKAHLUSU.js";
|
|
21
21
|
import {
|
|
22
22
|
juniorConversationParticipants,
|
|
23
23
|
juniorConversations,
|
|
24
24
|
juniorIdentities,
|
|
25
25
|
juniorUsers
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ZFCO2TMB.js";
|
|
27
27
|
import {
|
|
28
28
|
juniorDestinations
|
|
29
29
|
} from "./chunk-VFUK3X5B.js";
|
|
30
30
|
import {
|
|
31
31
|
getSlackBotToken
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-VWNIDTFR.js";
|
|
33
33
|
import {
|
|
34
34
|
canExposeConversationPayload
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-DVX6U6GI.js";
|
|
36
36
|
import {
|
|
37
37
|
logWarn
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-Y4WL4OYD.js";
|
|
39
39
|
|
|
40
40
|
// src/handlers/health.ts
|
|
41
41
|
function readHealthReport() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ToolInputError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YKIAUKYH.js";
|
|
4
4
|
import {
|
|
5
5
|
getPlugins
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2MRF22J4.js";
|
|
7
7
|
import {
|
|
8
8
|
getDb
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-OKAHLUSU.js";
|
|
10
10
|
import {
|
|
11
11
|
juniorAttachments,
|
|
12
12
|
juniorConversations,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
juniorSchedulerRuns,
|
|
15
15
|
juniorSchedulerTasks,
|
|
16
16
|
juniorStats
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZFCO2TMB.js";
|
|
18
18
|
import {
|
|
19
19
|
juniorDestinations
|
|
20
20
|
} from "./chunk-VFUK3X5B.js";
|
|
@@ -542,7 +542,7 @@ function requireSupportedEventTaskTrigger(catalog, trigger) {
|
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
544
|
function requireEventTaskSlackContext(context) {
|
|
545
|
-
if (context.source.
|
|
545
|
+
if (context.source.kind !== "slack" || context.destination.platform !== "slack" || context.actor?.platform !== "slack" || context.actor.teamId !== context.source.teamId) {
|
|
546
546
|
throw new ToolInputError(
|
|
547
547
|
"Event tasks require an active Slack channel or DM and actor."
|
|
548
548
|
);
|
|
@@ -2,16 +2,16 @@ import {
|
|
|
2
2
|
coerceThreadConversationState,
|
|
3
3
|
getPersistedThreadState,
|
|
4
4
|
persistThreadStateById
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-W2C4TPLB.js";
|
|
6
6
|
import {
|
|
7
7
|
clearPendingAuth,
|
|
8
8
|
markTurnClosed,
|
|
9
9
|
markTurnCompleted
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-67MMSYSE.js";
|
|
11
11
|
import {
|
|
12
12
|
hydrateConversationMessages,
|
|
13
13
|
markConversationMessage
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-BGOLRC36.js";
|
|
15
15
|
import {
|
|
16
16
|
buildDeterministicTurnId
|
|
17
17
|
} from "./chunk-DA2KGZZI.js";
|
|
@@ -20,13 +20,13 @@ import {
|
|
|
20
20
|
findProviderError,
|
|
21
21
|
getProviderErrorAttributes,
|
|
22
22
|
getProviderErrorUserMessage
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-VWNIDTFR.js";
|
|
24
24
|
import {
|
|
25
25
|
parseSlackMessageTs
|
|
26
26
|
} from "./chunk-N7TMSOZH.js";
|
|
27
27
|
import {
|
|
28
28
|
buildTurnFailureResponse
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-Y4WL4OYD.js";
|
|
30
30
|
|
|
31
31
|
// src/chat/runtime/delivered-turn-state.ts
|
|
32
32
|
function buildDeliveredTurnStatePatch(args) {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
authenticationUnlinkedEvent,
|
|
8
8
|
fallbackShortTitle,
|
|
9
9
|
generateShortTitle
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YKIAUKYH.js";
|
|
11
11
|
import {
|
|
12
12
|
bindProviderConversation,
|
|
13
13
|
createSqlConversationEventStore,
|
|
@@ -16,18 +16,18 @@ import {
|
|
|
16
16
|
getSqlExecutor,
|
|
17
17
|
sanitizePostgresJson,
|
|
18
18
|
withConversationEventLock
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OKAHLUSU.js";
|
|
20
20
|
import {
|
|
21
21
|
SANDBOX_REPOS_ROOT,
|
|
22
22
|
SANDBOX_WORKSPACE_ROOT,
|
|
23
23
|
sleep
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-HI5KXE3C.js";
|
|
25
25
|
import {
|
|
26
26
|
MUTATION_LOCK_TTL_MS,
|
|
27
27
|
fenceLock,
|
|
28
28
|
getStateAdapter,
|
|
29
29
|
withLock
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-6BXUSF7J.js";
|
|
31
31
|
import {
|
|
32
32
|
agentHistoryItemSchema,
|
|
33
33
|
contextProvenance,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
escapeXml,
|
|
41
41
|
resolveGatewayModel,
|
|
42
42
|
unwrapCurrentInstruction
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-VWNIDTFR.js";
|
|
44
44
|
import {
|
|
45
45
|
parseSlackMessageTs,
|
|
46
46
|
toStoredSlackActor
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
logException,
|
|
51
51
|
logWarn,
|
|
52
52
|
setSpanAttributes
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-Y4WL4OYD.js";
|
|
54
54
|
|
|
55
55
|
// src/chat/turn-context-tag.ts
|
|
56
56
|
var TURN_CONTEXT_TAG = "runtime-turn-context";
|
|
@@ -1556,6 +1556,10 @@ async function persistWithRetry(persist) {
|
|
|
1556
1556
|
}
|
|
1557
1557
|
|
|
1558
1558
|
// src/chat/task-execution/turn-cursor.ts
|
|
1559
|
+
import {
|
|
1560
|
+
actorSchema,
|
|
1561
|
+
sourceSchema
|
|
1562
|
+
} from "@sentry/junior-plugin-api";
|
|
1559
1563
|
import { z as z2 } from "zod";
|
|
1560
1564
|
|
|
1561
1565
|
// src/chat/repository-instructions.ts
|
|
@@ -2047,6 +2051,8 @@ var storedTurnSummarySchema = z2.object({
|
|
|
2047
2051
|
updatedAtMs: nonNegativeNumberSchema
|
|
2048
2052
|
}).strip();
|
|
2049
2053
|
var storedTurnRecordSchema = z2.object({
|
|
2054
|
+
// TODO(dcramer): Require Actor after no deployed Turn cursor can omit it.
|
|
2055
|
+
actor: actorSchema.optional(),
|
|
2050
2056
|
schemaVersion: z2.literal(TURN_CURSOR_SCHEMA_VERSION),
|
|
2051
2057
|
version: z2.number().int().nonnegative(),
|
|
2052
2058
|
conversationId: z2.string().min(1),
|
|
@@ -2056,6 +2062,7 @@ var storedTurnRecordSchema = z2.object({
|
|
|
2056
2062
|
lastProgressAtMs: nonNegativeNumberSchema,
|
|
2057
2063
|
resumeReason: turnPauseReasonSchema.optional(),
|
|
2058
2064
|
publishExternally: z2.boolean().optional(),
|
|
2065
|
+
source: sourceSchema.optional(),
|
|
2059
2066
|
resumedFromSliceId: z2.number().int().nonnegative().optional(),
|
|
2060
2067
|
turnId: z2.string().min(1),
|
|
2061
2068
|
sliceId: z2.number().int().nonnegative(),
|
|
@@ -2120,7 +2127,7 @@ async function recordConversationActivityMetadata(args) {
|
|
|
2120
2127
|
if (!hasParent && !destination && !conversation) {
|
|
2121
2128
|
return;
|
|
2122
2129
|
}
|
|
2123
|
-
const activitySource = hasParent ? "internal" : args.source?.
|
|
2130
|
+
const activitySource = hasParent ? "internal" : args.source?.kind === "web" ? "web" : destination?.platform === "local" ? "local" : destination ? args.summary.surface : void 0;
|
|
2124
2131
|
await conversationStore.recordActivity({
|
|
2125
2132
|
activityAtMs: args.summary.updatedAtMs,
|
|
2126
2133
|
channelName: args.summary.channelName,
|
|
@@ -2152,6 +2159,7 @@ async function recordConversationActivityMetadata(args) {
|
|
|
2152
2159
|
function materializeTurnRecord(stored, piProjection, turnStartMessageIndex, restoreVolatileContext = true, runtimeMetrics) {
|
|
2153
2160
|
const restoredProjection = restoreVolatileContext && (stored.state === "running" || stored.state === "paused") ? restoreRuntimeContext(piProjection, stored.runtimeContext) : piProjection;
|
|
2154
2161
|
return {
|
|
2162
|
+
...definedProps({ actor: stored.actor }),
|
|
2155
2163
|
schemaVersion: stored.schemaVersion,
|
|
2156
2164
|
version: stored.version,
|
|
2157
2165
|
conversationId: stored.conversationId,
|
|
@@ -2173,6 +2181,7 @@ function materializeTurnRecord(stored, piProjection, turnStartMessageIndex, rest
|
|
|
2173
2181
|
errorMessage: stored.errorMessage,
|
|
2174
2182
|
resumeReason: stored.resumeReason,
|
|
2175
2183
|
publishExternally: stored.publishExternally,
|
|
2184
|
+
source: stored.source,
|
|
2176
2185
|
resultMessageId: stored.resultMessageId,
|
|
2177
2186
|
resumedFromSliceId: stored.resumedFromSliceId,
|
|
2178
2187
|
surface: stored.surface,
|
|
@@ -2279,12 +2288,14 @@ function buildStoredRecord(args) {
|
|
|
2279
2288
|
updatedAtMs: nowMs,
|
|
2280
2289
|
committedSeq: args.committedSeq,
|
|
2281
2290
|
...definedProps({
|
|
2291
|
+
actor: args.actor,
|
|
2282
2292
|
dispatchId: args.dispatchId,
|
|
2283
2293
|
dispatchOutcome: args.dispatchOutcome,
|
|
2284
2294
|
errorMessage: args.errorMessage,
|
|
2285
2295
|
historyVersion: args.historyVersion,
|
|
2286
2296
|
resumeReason: args.resumeReason,
|
|
2287
2297
|
publishExternally: args.publishExternally,
|
|
2298
|
+
source: args.source,
|
|
2288
2299
|
resultMessageId: args.resultMessageId,
|
|
2289
2300
|
resumedFromSliceId: args.resumedFromSliceId,
|
|
2290
2301
|
runtimeContext: args.runtimeContext && args.runtimeContext.length > 0 ? args.runtimeContext : void 0,
|
|
@@ -2343,6 +2354,7 @@ async function updateTurnState(args) {
|
|
|
2343
2354
|
return void 0;
|
|
2344
2355
|
}
|
|
2345
2356
|
return await setStoredRecord({
|
|
2357
|
+
actor: args.existing.actor,
|
|
2346
2358
|
fence: args.fence,
|
|
2347
2359
|
piMessages: args.existing.piMessages,
|
|
2348
2360
|
piMessageProvenance: args.existing.piMessageProvenance,
|
|
@@ -2358,6 +2370,7 @@ async function updateTurnState(args) {
|
|
|
2358
2370
|
turnStartMessageIndex: args.existing.turnStartMessageIndex
|
|
2359
2371
|
}),
|
|
2360
2372
|
record: buildStoredRecord({
|
|
2373
|
+
actor: args.existing.actor,
|
|
2361
2374
|
conversationId: args.existing.conversationId,
|
|
2362
2375
|
turnId: args.existing.turnId,
|
|
2363
2376
|
sliceId: args.existing.sliceId,
|
|
@@ -2373,6 +2386,7 @@ async function updateTurnState(args) {
|
|
|
2373
2386
|
historyVersion: parsed.historyVersion,
|
|
2374
2387
|
resumeReason: args.existing.resumeReason,
|
|
2375
2388
|
publishExternally: args.existing.publishExternally,
|
|
2389
|
+
source: args.existing.source,
|
|
2376
2390
|
resultMessageId: args.resultMessageId ?? args.existing.resultMessageId,
|
|
2377
2391
|
resumedFromSliceId: args.existing.resumedFromSliceId,
|
|
2378
2392
|
surface: args.existing.surface,
|
|
@@ -2426,7 +2440,7 @@ async function upsertTurnRecordLocked(args, fence) {
|
|
|
2426
2440
|
const turnStartSeq = durableTurnStartMessageIndex === void 0 ? existingRecord?.turnStartSeq : durableTurnStartMessageIndex <= 0 ? -1 : commit.messageSeqs[durableTurnStartMessageIndex - 1] ?? commit.committedSeq;
|
|
2427
2441
|
const turnStartMessageIndex = durableTurnStartMessageIndex ?? (turnStartSeq === void 0 ? void 0 : commit.messageSeqs.filter((seq) => seq <= turnStartSeq).length);
|
|
2428
2442
|
return await setStoredRecord({
|
|
2429
|
-
actor: args.actor,
|
|
2443
|
+
actor: existingRecord?.actor ?? args.actor,
|
|
2430
2444
|
fence,
|
|
2431
2445
|
conversationStore: args.conversationStore,
|
|
2432
2446
|
destination: args.destination,
|
|
@@ -2447,6 +2461,7 @@ async function upsertTurnRecordLocked(args, fence) {
|
|
|
2447
2461
|
...definedProps({ indexTtlMs: args.ttlMs }),
|
|
2448
2462
|
turnStartMessageIndex,
|
|
2449
2463
|
record: buildStoredRecord({
|
|
2464
|
+
actor: existingRecord?.actor ?? args.actor,
|
|
2450
2465
|
conversationId: args.conversationId,
|
|
2451
2466
|
turnId: args.turnId,
|
|
2452
2467
|
sliceId: args.sliceId,
|
|
@@ -2461,6 +2476,7 @@ async function upsertTurnRecordLocked(args, fence) {
|
|
|
2461
2476
|
lastProgressAtMs: args.lastProgressAtMs,
|
|
2462
2477
|
resumeReason: args.resumeReason,
|
|
2463
2478
|
publishExternally: args.publishExternally ?? existingRecord?.publishExternally,
|
|
2479
|
+
source: args.source ?? existingRecord?.source,
|
|
2464
2480
|
resultMessageId: args.resultMessageId ?? existingRecord?.resultMessageId,
|
|
2465
2481
|
resumedFromSliceId: args.resumedFromSliceId,
|
|
2466
2482
|
runtimeContext: args.state === "running" || args.state === "paused" ? retainedRuntimeContext : void 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runWithTurnRequestDeadline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7UJ6IJCK.js";
|
|
4
4
|
import {
|
|
5
5
|
QUEUE_SIGNATURE_MAX_AGE_MS,
|
|
6
6
|
createVercelQueueClient,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-7H2VZTWN.js";
|
|
10
10
|
import {
|
|
11
11
|
logWarn
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Y4WL4OYD.js";
|
|
13
13
|
|
|
14
14
|
// src/chat/plugins/task-queue.ts
|
|
15
15
|
import { createHash } from "crypto";
|
|
@@ -129,7 +129,7 @@ function pluginTaskCallback() {
|
|
|
129
129
|
onRejected: logPluginTaskQueueMessageRejected,
|
|
130
130
|
// Load the runner on first use so this module can send without a cycle.
|
|
131
131
|
run: async (message) => {
|
|
132
|
-
const { processPluginTask } = await import("./task-runner-
|
|
132
|
+
const { processPluginTask } = await import("./task-runner-52DYFHW3.js");
|
|
133
133
|
await processPluginTask(message);
|
|
134
134
|
},
|
|
135
135
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|