@sentry/junior 0.195.0 → 0.196.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-VIBTIP5F.js → agent-hooks-IQLRR4RC.js} +13 -13
- package/dist/api/schema.js +3 -3
- package/dist/api.js +27 -27
- package/dist/app.d.ts +8 -2
- package/dist/app.js +102 -70
- package/dist/{catalog-runtime-6E6SGRZK.js → catalog-runtime-EM7V2F4I.js} +4 -4
- package/dist/chat/agent/handoff.d.ts +73 -0
- package/dist/chat/config.d.ts +2 -2
- package/dist/chat/model-profile.d.ts +12 -0
- package/dist/chat/no-reply.d.ts +4 -3
- package/dist/chat/services/subscribed-decision.d.ts +8 -0
- package/dist/chat/tools/types.d.ts +6 -2
- package/dist/{chunk-LMYRF6HX.js → chunk-5XSEOJPC.js} +85 -14
- package/dist/{chunk-RZ3PBNDV.js → chunk-6LQNW2CJ.js} +7 -7
- package/dist/{chunk-GFBR4S3Q.js → chunk-7NL7T6VU.js} +1 -1
- package/dist/{chunk-6GGDBXXP.js → chunk-7TUDDW3Y.js} +3 -3
- package/dist/{chunk-R5BGW4WR.js → chunk-B5WJBVHY.js} +2 -2
- package/dist/{chunk-X3PBQ4BK.js → chunk-BXIVMNLR.js} +1 -1
- package/dist/{chunk-JBSCMOLR.js → chunk-CNI74T7U.js} +6 -6
- package/dist/{chunk-HUQOXMDG.js → chunk-CTS72G4B.js} +1 -1
- package/dist/{chunk-VYDIA2UL.js → chunk-DFWJJOW3.js} +2 -6
- package/dist/{chunk-7UED4D5T.js → chunk-EEUFKVCD.js} +22 -22
- package/dist/{chunk-PYTRZZ4V.js → chunk-EFNUCRB5.js} +8 -8
- package/dist/{chunk-7MYXH5LA.js → chunk-EQBHN4JK.js} +1 -1
- package/dist/{chunk-KBPWC7NU.js → chunk-ES7KCEND.js} +1 -1
- package/dist/{chunk-RKA22BQP.js → chunk-G6YRPYDC.js} +1 -1
- package/dist/{chunk-DTYOEHUP.js → chunk-GZ336GZ5.js} +4 -4
- package/dist/{chunk-C4NY6L7S.js → chunk-I7GEGEHZ.js} +1 -1
- package/dist/{chunk-KUQRWV53.js → chunk-J357NJQ5.js} +5 -5
- package/dist/{chunk-CE2P6TOV.js → chunk-KJGH3KWA.js} +3 -3
- package/dist/{chunk-L62JVQPL.js → chunk-KZX7LORG.js} +3 -3
- package/dist/{chunk-QPZL2IYT.js → chunk-LBN67OZR.js} +1 -1
- package/dist/{chunk-HE5PZAPS.js → chunk-LCAM2P7H.js} +4 -4
- package/dist/{chunk-5NR7N567.js → chunk-LGXI6PWX.js} +4 -4
- package/dist/{chunk-RQO67SAO.js → chunk-LSPUMNZK.js} +2 -2
- package/dist/{chunk-OQHO62VA.js → chunk-N2MSPOGG.js} +8 -8
- package/dist/{chunk-PFQRZ4IB.js → chunk-NE2UQMC7.js} +7 -7
- package/dist/{chunk-D4YV5TDV.js → chunk-NHJU2ZAL.js} +11 -0
- package/dist/{chunk-FEZIEEOP.js → chunk-OVWAO5KY.js} +260 -182
- package/dist/{chunk-QHJZSYKY.js → chunk-P3LE2CSJ.js} +2 -2
- package/dist/{chunk-3VWIZVK7.js → chunk-PI6VXVBK.js} +1 -1
- package/dist/{chunk-FPQPYJEG.js → chunk-PIZJBSGZ.js} +1 -1
- package/dist/{chunk-FE3Y4KES.js → chunk-QAINJHI4.js} +5 -5
- package/dist/{chunk-5HNXLP4W.js → chunk-RAWYH7TW.js} +1 -1
- package/dist/{chunk-R5OHONYU.js → chunk-RFNMWONZ.js} +6 -6
- package/dist/{chunk-QKHZF2LH.js → chunk-S74KAE77.js} +4 -4
- package/dist/{chunk-LM7UE523.js → chunk-SR5FS2JP.js} +3 -3
- package/dist/{chunk-N67T4VY3.js → chunk-VKLQ2M7V.js} +9 -9
- package/dist/{chunk-I4RH3KLJ.js → chunk-VRHZXY5X.js} +1 -1
- package/dist/{chunk-7PQMTME5.js → chunk-VSOO3Y6M.js} +1 -1
- package/dist/{chunk-BJZML4RT.js → chunk-VVU7GHIZ.js} +9 -9
- package/dist/{chunk-6TRQLG3D.js → chunk-VXAQTJSR.js} +1 -1
- package/dist/{chunk-KQ3GZGBK.js → chunk-XNXKRWWI.js} +4 -4
- package/dist/cli/chat.js +35 -35
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +14 -14
- package/dist/cli/snapshot-create.js +10 -10
- package/dist/cli/upgrade.js +7 -7
- package/dist/{db-FVCSDROR.js → db-YTM7ZXPK.js} +8 -8
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +7 -7
- package/dist/{oauth-callback-server-Z5PXTDOE.js → oauth-callback-server-OXW4KQLQ.js} +31 -31
- package/dist/{runner-RHYU7OGV.js → runner-RJY5RNJO.js} +23 -23
- package/dist/{skills-QTN73DN5.js → skills-WZV6NLFY.js} +5 -5
- package/dist/spawn-J7SQJLYF.js +42 -0
- package/dist/task-runner-SMUQ5464.js +36 -0
- package/dist/{validation-2ZK7GA6N.js → validation-XS5ZHV3W.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-7IBKSZRU.js → work-LJMSDEY3.js} +23 -23
- package/dist/worker-NMFZ7A2N.js +24 -0
- package/package.json +5 -5
- package/dist/spawn-R56OWLUH.js +0 -42
- package/dist/task-runner-LLJZTLRP.js +0 -36
- package/dist/worker-RNVQVCO7.js +0 -24
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model-profile handoff helpers for one agent run slice.
|
|
3
|
+
*
|
|
4
|
+
* Owns the durable handoff commit, Pi apply shape, tool control, and the few
|
|
5
|
+
* loop checks that only care about handoff tool calls.
|
|
6
|
+
*/
|
|
7
|
+
import { type Agent, type AgentLoopTurnUpdate, type AgentTool } from "@earendil-works/pi-agent-core";
|
|
8
|
+
import type { ResumeState } from "@/chat/agent/resume";
|
|
9
|
+
import { type ModelProfile } from "@/chat/model-profile";
|
|
10
|
+
import { resolveGatewayModel } from "@/chat/pi/client";
|
|
11
|
+
import type { PiMessage } from "@/chat/pi/messages";
|
|
12
|
+
import { type CompactContextArgs } from "@/chat/services/context-compaction";
|
|
13
|
+
import { type TurnRoute } from "@/chat/services/turn-router";
|
|
14
|
+
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
15
|
+
import { type AgentTurnUsage } from "@/chat/usage";
|
|
16
|
+
/** Staged handoff waiting for the next Pi turn boundary. */
|
|
17
|
+
export type PendingHandoff = {
|
|
18
|
+
messages: PiMessage[];
|
|
19
|
+
model: ReturnType<typeof resolveGatewayModel>;
|
|
20
|
+
modelId: string;
|
|
21
|
+
modelProfile: ModelProfile;
|
|
22
|
+
phaseUsage?: AgentTurnUsage;
|
|
23
|
+
thinkingLevel: NonNullable<AgentLoopTurnUpdate["thinkingLevel"]>;
|
|
24
|
+
turnRoute: TurnRoute;
|
|
25
|
+
};
|
|
26
|
+
/** Return the exclusive tool name when one is present among the calls. */
|
|
27
|
+
export declare function exclusiveToolName(toolCalls: ReadonlyArray<{
|
|
28
|
+
name: string;
|
|
29
|
+
}>): string | undefined;
|
|
30
|
+
/** Build the tool control for every configured profile except the active one. */
|
|
31
|
+
export declare function handoffControl(args: {
|
|
32
|
+
activeProfile: ModelProfile;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
execute: NonNullable<ToolRuntimeContext["handoff"]>["execute"];
|
|
35
|
+
}): ToolRuntimeContext["handoff"];
|
|
36
|
+
/**
|
|
37
|
+
* Rebind the handoff tool description and schema for the active profile.
|
|
38
|
+
* Other tools stay as wired.
|
|
39
|
+
*/
|
|
40
|
+
export declare function toolsForHandoffProfile(args: {
|
|
41
|
+
activeProfile: ModelProfile;
|
|
42
|
+
agentTools: AgentTool[];
|
|
43
|
+
enabled: boolean;
|
|
44
|
+
execute: NonNullable<ToolRuntimeContext["handoff"]>["execute"];
|
|
45
|
+
}): AgentTool[];
|
|
46
|
+
/**
|
|
47
|
+
* Commit the durable handoff epoch and return the staged Pi swap.
|
|
48
|
+
* No-op when the requested profile is already active.
|
|
49
|
+
*/
|
|
50
|
+
export declare function commitHandoff(args: {
|
|
51
|
+
activeModelProfile: ModelProfile;
|
|
52
|
+
beforeMessageCount: number;
|
|
53
|
+
conversationContext?: string;
|
|
54
|
+
conversationId: string;
|
|
55
|
+
metadata?: CompactContextArgs["metadata"];
|
|
56
|
+
onStatus?: (status: {
|
|
57
|
+
text: string;
|
|
58
|
+
}) => void | Promise<void>;
|
|
59
|
+
profile: ModelProfile;
|
|
60
|
+
runtimeContextSourceMessages?: PiMessage[];
|
|
61
|
+
signal?: AbortSignal;
|
|
62
|
+
sourceMessages: PiMessage[];
|
|
63
|
+
triggeringToolCallId?: string;
|
|
64
|
+
turnRoute: TurnRoute;
|
|
65
|
+
}): Promise<PendingHandoff | undefined>;
|
|
66
|
+
/** Apply a committed handoff to Pi and reset its durable resume baseline. */
|
|
67
|
+
export declare function applyHandoff(args: {
|
|
68
|
+
agent: Agent;
|
|
69
|
+
baseInstructions: string;
|
|
70
|
+
pending: PendingHandoff;
|
|
71
|
+
resume: ResumeState;
|
|
72
|
+
tools: AgentTool[];
|
|
73
|
+
}): AgentLoopTurnUpdate;
|
package/dist/chat/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TurnReasoningLevel } from "@/chat/reasoning-level";
|
|
2
|
-
import { type ModelProfileConfig, type ModelProfile } from "@/chat/model-profile";
|
|
2
|
+
import { type ModelProfileConfig, type ModelProfile, type ModelProfileInput } from "@/chat/model-profile";
|
|
3
3
|
export declare const DEFAULT_SQL_STATEMENT_TIMEOUT_MS = 30000;
|
|
4
4
|
/**
|
|
5
5
|
* Buffer between the Vercel function timeout and the agent turn timeout so
|
|
@@ -77,7 +77,7 @@ export interface SlackReactionConfig {
|
|
|
77
77
|
processingReactionEmoji: string;
|
|
78
78
|
}
|
|
79
79
|
/** Apply profiles from createApp(). */
|
|
80
|
-
export declare function setProfiles(profiles: Readonly<Record<string,
|
|
80
|
+
export declare function setProfiles(profiles: Readonly<Record<string, ModelProfileInput>> | undefined, defaultProfile: string | undefined): void;
|
|
81
81
|
/** Return the current Slack reaction emoji config. */
|
|
82
82
|
export declare function getSlackReactionConfig(): SlackReactionConfig;
|
|
83
83
|
/** Apply Slack reaction emoji overrides from createApp() options, validating names. */
|
|
@@ -7,9 +7,21 @@ export declare const modelProfileSchema: z.ZodString;
|
|
|
7
7
|
export type ModelProfile = z.output<typeof modelProfileSchema>;
|
|
8
8
|
/** Runtime configuration for one named model profile. */
|
|
9
9
|
export interface ModelProfileConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Tells models which tasks fit this profile.
|
|
12
|
+
* Name concrete tasks. Add use and avoid cases when helpful.
|
|
13
|
+
* Do not use model product names as the selection rule.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
10
16
|
modelId: string;
|
|
11
17
|
reasoningLevel?: TurnReasoningLevel;
|
|
12
18
|
}
|
|
19
|
+
/** App-level profile input: a model id string or a full profile config. */
|
|
20
|
+
export type ModelProfileInput = string | ModelProfileConfig;
|
|
21
|
+
/** Format one profile and its task-fit description. */
|
|
22
|
+
export declare function formatModelProfile(profile: ModelProfile, description?: string): string;
|
|
23
|
+
/** Format configured profiles as one list item per line. */
|
|
24
|
+
export declare function formatModelProfiles(profiles: Readonly<Record<string, ModelProfileConfig>>, profileNames: readonly ModelProfile[]): string;
|
|
13
25
|
/** Identify durable profile bindings that the current host cannot resolve. */
|
|
14
26
|
export declare class ModelProfileNotConfiguredError extends Error {
|
|
15
27
|
constructor(profile: ModelProfile);
|
package/dist/chat/no-reply.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const NO_REPLY_MARKER = "[[NO_REPLY]]";
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* True when one assistant message ends with the silence marker.
|
|
4
|
+
* Mid-sentence mentions do not match. Detection is per message only.
|
|
5
|
+
*/
|
|
3
6
|
export declare function isNoReplyMarker(text: string): boolean;
|
|
4
|
-
/** Detect marker leaks before publication strips or rejects them. */
|
|
5
|
-
export declare function containsNoReplyMarker(text: string): boolean;
|
|
@@ -37,6 +37,14 @@ declare const replyDecisionSchema: z.ZodObject<{
|
|
|
37
37
|
confidence: z.ZodNumber;
|
|
38
38
|
reason: z.ZodString;
|
|
39
39
|
}, z.core.$strict>;
|
|
40
|
+
/**
|
|
41
|
+
* Return a stop decision for one message body.
|
|
42
|
+
* Deferred batches must call this on each body, not on joined text.
|
|
43
|
+
*/
|
|
44
|
+
export declare function getThreadStopDecision(args: {
|
|
45
|
+
rawText: string;
|
|
46
|
+
text: string;
|
|
47
|
+
}): SubscribedDecisionResult | undefined;
|
|
40
48
|
/** Fast heuristic check before the LLM classifier — skips messages directed at another party. */
|
|
41
49
|
export declare function getSubscribedReplyPreflightDecision(args: {
|
|
42
50
|
botUserName: string;
|
|
@@ -13,9 +13,13 @@ import type { SpawnAgent } from "@/chat/agent/types";
|
|
|
13
13
|
import type { AttachmentStorage } from "@/chat/attachments/storage";
|
|
14
14
|
import type { Workspace } from "@/chat/workspaces/types";
|
|
15
15
|
import type { ConversationPrivacy } from "@/chat/conversation-privacy";
|
|
16
|
+
interface HandoffProfile {
|
|
17
|
+
description?: string;
|
|
18
|
+
name: ModelProfile;
|
|
19
|
+
}
|
|
16
20
|
interface HandoffControl {
|
|
17
|
-
/** Non-empty
|
|
18
|
-
profiles: readonly [
|
|
21
|
+
/** Non-empty list of configured profiles. */
|
|
22
|
+
profiles: readonly [HandoffProfile, ...HandoffProfile[]];
|
|
19
23
|
execute: (profile: ModelProfile, options: {
|
|
20
24
|
signal?: AbortSignal;
|
|
21
25
|
toolCallId: string;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
+
TURN_REASONING_LEVELS,
|
|
2
3
|
modelProfileSchema,
|
|
3
4
|
parseTurnReasoningLevel
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-NHJU2ZAL.js";
|
|
5
6
|
import {
|
|
6
7
|
getCurrentConversationPrivacy,
|
|
7
8
|
toCanonicalInputMessage,
|
|
8
9
|
toCanonicalOutputMessage,
|
|
9
10
|
toGenAiMessagesTraceAttributes
|
|
10
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ES7KCEND.js";
|
|
11
12
|
import {
|
|
12
13
|
extractGenAiUsageAttributes,
|
|
13
14
|
logException,
|
|
@@ -15,7 +16,7 @@ import {
|
|
|
15
16
|
normalizeGenAiFinishReason,
|
|
16
17
|
serializeGenAiAttribute,
|
|
17
18
|
withSpan
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-CTS72G4B.js";
|
|
19
20
|
|
|
20
21
|
// src/chat/services/provider-error.ts
|
|
21
22
|
var ProviderError = class extends Error {
|
|
@@ -807,33 +808,103 @@ function validateGatewayModelId(raw) {
|
|
|
807
808
|
function validateEmbeddingModelId(raw) {
|
|
808
809
|
return toOptionalTrimmed(raw);
|
|
809
810
|
}
|
|
811
|
+
var DEFAULT_STANDARD_PROFILE_DESCRIPTION = "Use for default assistant work: lookups, explanations, ordinary tool use, short answers, and light investigation of one source. Avoid for implementation, debugging, multi-file changes, architecture decisions, or research across several systems.";
|
|
812
|
+
var DEFAULT_HANDOFF_PROFILE_DESCRIPTION = "Use for coding and difficult multi-step work: implementation, debugging, root-cause analysis, broad refactors, multi-file changes, architecture decisions, and research across several systems. Avoid for simple lookups, short answers, single-file reads, or ordinary tool use that the default profile can finish.";
|
|
813
|
+
function parseOptionalProfileDescription(rawDescription, configName, profile) {
|
|
814
|
+
if (rawDescription === void 0) {
|
|
815
|
+
return void 0;
|
|
816
|
+
}
|
|
817
|
+
if (typeof rawDescription !== "string") {
|
|
818
|
+
throw new Error(
|
|
819
|
+
`${configName}.${profile}.description must be a string when set`
|
|
820
|
+
);
|
|
821
|
+
}
|
|
822
|
+
const description = toOptionalTrimmed(rawDescription);
|
|
823
|
+
if (!description) {
|
|
824
|
+
throw new Error(
|
|
825
|
+
`${configName}.${profile}.description must not be empty when set`
|
|
826
|
+
);
|
|
827
|
+
}
|
|
828
|
+
return description;
|
|
829
|
+
}
|
|
830
|
+
function parseOptionalProfileReasoningLevel(rawReasoningLevel, configName, profile) {
|
|
831
|
+
if (rawReasoningLevel === void 0) {
|
|
832
|
+
return void 0;
|
|
833
|
+
}
|
|
834
|
+
try {
|
|
835
|
+
return parseTurnReasoningLevel(rawReasoningLevel);
|
|
836
|
+
} catch {
|
|
837
|
+
throw new Error(
|
|
838
|
+
`${configName}.${profile}.reasoningLevel must be one of ${TURN_REASONING_LEVELS.join(", ")}`
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
function parseProfileConfig(rawProfile, configName, profile) {
|
|
843
|
+
if (typeof rawProfile === "string") {
|
|
844
|
+
const modelId2 = validateGatewayModelId(rawProfile);
|
|
845
|
+
if (!modelId2) {
|
|
846
|
+
throw new Error(`${configName}.${profile} must not be empty`);
|
|
847
|
+
}
|
|
848
|
+
return { modelId: modelId2 };
|
|
849
|
+
}
|
|
850
|
+
if (!rawProfile || typeof rawProfile !== "object" || Array.isArray(rawProfile)) {
|
|
851
|
+
throw new Error(
|
|
852
|
+
`${configName}.${profile} must be a model id string or an object with modelId`
|
|
853
|
+
);
|
|
854
|
+
}
|
|
855
|
+
const rawModelId = rawProfile.modelId;
|
|
856
|
+
if (typeof rawModelId !== "string") {
|
|
857
|
+
throw new Error(
|
|
858
|
+
`${configName}.${profile}.modelId must be a model id string`
|
|
859
|
+
);
|
|
860
|
+
}
|
|
861
|
+
const modelId = validateGatewayModelId(rawModelId);
|
|
862
|
+
if (!modelId) {
|
|
863
|
+
throw new Error(`${configName}.${profile}.modelId must not be empty`);
|
|
864
|
+
}
|
|
865
|
+
const description = parseOptionalProfileDescription(
|
|
866
|
+
rawProfile.description,
|
|
867
|
+
configName,
|
|
868
|
+
profile
|
|
869
|
+
);
|
|
870
|
+
const reasoningLevel = parseOptionalProfileReasoningLevel(
|
|
871
|
+
rawProfile.reasoningLevel,
|
|
872
|
+
configName,
|
|
873
|
+
profile
|
|
874
|
+
);
|
|
875
|
+
return {
|
|
876
|
+
modelId,
|
|
877
|
+
...description ? { description } : void 0,
|
|
878
|
+
...reasoningLevel ? { reasoningLevel } : void 0
|
|
879
|
+
};
|
|
880
|
+
}
|
|
810
881
|
function parseProfileMap(rawProfiles, configName) {
|
|
811
882
|
if (!rawProfiles || typeof rawProfiles !== "object" || Array.isArray(rawProfiles)) {
|
|
812
883
|
const objectType = configName === "AI_MODEL_PROFILES" ? "a JSON object" : "an object";
|
|
813
884
|
throw new Error(`${configName} must be ${objectType}`);
|
|
814
885
|
}
|
|
815
886
|
const profiles = {};
|
|
816
|
-
for (const [profile,
|
|
887
|
+
for (const [profile, rawProfile] of Object.entries(rawProfiles)) {
|
|
817
888
|
if (!modelProfileSchema.safeParse(profile).success) {
|
|
818
889
|
throw new Error(
|
|
819
890
|
`${configName} profile "${profile}" must match ^[a-z][a-z0-9_-]*$`
|
|
820
891
|
);
|
|
821
892
|
}
|
|
822
|
-
|
|
823
|
-
throw new Error(`${configName}.${profile} must be a model id string`);
|
|
824
|
-
}
|
|
825
|
-
const modelId = validateGatewayModelId(rawModelId);
|
|
826
|
-
if (!modelId) {
|
|
827
|
-
throw new Error(`${configName}.${profile} must not be empty`);
|
|
828
|
-
}
|
|
829
|
-
profiles[profile] = { modelId };
|
|
893
|
+
profiles[profile] = parseProfileConfig(rawProfile, configName, profile);
|
|
830
894
|
}
|
|
831
895
|
return profiles;
|
|
832
896
|
}
|
|
833
897
|
function parseProfiles(rawValue, standardModelId, handoffModelId) {
|
|
834
898
|
const profiles = {
|
|
835
|
-
standard: {
|
|
836
|
-
|
|
899
|
+
standard: {
|
|
900
|
+
modelId: standardModelId,
|
|
901
|
+
description: DEFAULT_STANDARD_PROFILE_DESCRIPTION
|
|
902
|
+
},
|
|
903
|
+
handoff: {
|
|
904
|
+
modelId: handoffModelId,
|
|
905
|
+
description: DEFAULT_HANDOFF_PROFILE_DESCRIPTION,
|
|
906
|
+
reasoningLevel: "high"
|
|
907
|
+
}
|
|
837
908
|
};
|
|
838
909
|
const trimmed = toOptionalTrimmed(rawValue);
|
|
839
910
|
if (trimmed === void 0) {
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
authenticationUnlinkedEvent,
|
|
8
8
|
fallbackShortTitle,
|
|
9
9
|
generateShortTitle
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-B5WJBVHY.js";
|
|
11
11
|
import {
|
|
12
12
|
bindProviderConversation,
|
|
13
13
|
createSqlConversationEventStore,
|
|
@@ -16,31 +16,31 @@ import {
|
|
|
16
16
|
getSqlExecutor,
|
|
17
17
|
sanitizePostgresJson,
|
|
18
18
|
withConversationEventLock
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-XNXKRWWI.js";
|
|
20
20
|
import {
|
|
21
21
|
SANDBOX_REPOS_ROOT,
|
|
22
22
|
SANDBOX_WORKSPACE_ROOT,
|
|
23
23
|
sleep
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-SR5FS2JP.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-EQBHN4JK.js";
|
|
31
31
|
import {
|
|
32
32
|
agentHistoryItemSchema,
|
|
33
33
|
contextProvenance,
|
|
34
34
|
instructionActors,
|
|
35
35
|
instructionProvenanceFor
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-7NL7T6VU.js";
|
|
37
37
|
import {
|
|
38
38
|
botConfig,
|
|
39
39
|
completeText,
|
|
40
40
|
escapeXml,
|
|
41
41
|
resolveGatewayModel,
|
|
42
42
|
unwrapCurrentInstruction
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-5XSEOJPC.js";
|
|
44
44
|
import {
|
|
45
45
|
parseSlackMessageTs,
|
|
46
46
|
toStoredSlackActor
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
logException,
|
|
52
52
|
logWarn,
|
|
53
53
|
setSpanAttributes
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-CTS72G4B.js";
|
|
55
55
|
|
|
56
56
|
// src/chat/turn-context-tag.ts
|
|
57
57
|
var TURN_CONTEXT_TAG = "runtime-turn-context";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runWithTurnRequestDeadline
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VRHZXY5X.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-CTS72G4B.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-SMUQ5464.js");
|
|
133
133
|
await processPluginTask(message);
|
|
134
134
|
},
|
|
135
135
|
topic: PLUGIN_TASK_QUEUE_TOPIC,
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-PDO5BLNM.js";
|
|
4
4
|
import {
|
|
5
5
|
botConfig
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5XSEOJPC.js";
|
|
7
7
|
import {
|
|
8
8
|
logWarn
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CTS72G4B.js";
|
|
10
10
|
|
|
11
11
|
// src/chat/conversations/structured-events.ts
|
|
12
12
|
import {
|
|
@@ -7,23 +7,23 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
formatProviderLabel,
|
|
9
9
|
startOAuthFlow
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RFNMWONZ.js";
|
|
11
11
|
import {
|
|
12
12
|
abandonReplacedPendingAuth,
|
|
13
13
|
canReusePendingAuthLink
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DFWJJOW3.js";
|
|
15
15
|
import {
|
|
16
16
|
recordAuthorizationRequested
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6LQNW2CJ.js";
|
|
18
18
|
import {
|
|
19
19
|
AGENT_INVOCATION_MAILBOX_STATUSES
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-PIZJBSGZ.js";
|
|
21
21
|
import {
|
|
22
22
|
TURN_REASONING_LEVELS
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-NHJU2ZAL.js";
|
|
24
24
|
import {
|
|
25
25
|
pluginCatalogRuntime
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-G6YRPYDC.js";
|
|
27
27
|
import {
|
|
28
28
|
credentialContextSchema
|
|
29
29
|
} from "./chunk-CEMMLV5L.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
abandonTurnRecord,
|
|
3
3
|
extractAssistantText
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-6LQNW2CJ.js";
|
|
5
5
|
import {
|
|
6
6
|
buildDeterministicTurnId
|
|
7
7
|
} from "./chunk-DA2KGZZI.js";
|
|
@@ -83,10 +83,7 @@ function markTurnFailed(args) {
|
|
|
83
83
|
// src/chat/no-reply.ts
|
|
84
84
|
var NO_REPLY_MARKER = "[[NO_REPLY]]";
|
|
85
85
|
function isNoReplyMarker(text) {
|
|
86
|
-
return text.
|
|
87
|
-
}
|
|
88
|
-
function containsNoReplyMarker(text) {
|
|
89
|
-
return text.includes(NO_REPLY_MARKER);
|
|
86
|
+
return text.trimEnd().endsWith(NO_REPLY_MARKER);
|
|
90
87
|
}
|
|
91
88
|
|
|
92
89
|
// src/chat/services/assistant-reply.ts
|
|
@@ -198,7 +195,6 @@ export {
|
|
|
198
195
|
markTurnFailed,
|
|
199
196
|
NO_REPLY_MARKER,
|
|
200
197
|
isNoReplyMarker,
|
|
201
|
-
containsNoReplyMarker,
|
|
202
198
|
sanitizeAssistantText,
|
|
203
199
|
decideReply,
|
|
204
200
|
getAssistantReplyText,
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
AgentRunError,
|
|
6
6
|
executeTurn
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-KJGH3KWA.js";
|
|
8
8
|
import {
|
|
9
9
|
buildDeliveredTurnStatePatch,
|
|
10
10
|
finalizeFailedTurnReplyWithEvent,
|
|
@@ -15,14 +15,14 @@ import {
|
|
|
15
15
|
getTurnUserSlackMessageTs,
|
|
16
16
|
persistAuthPauseTurnState,
|
|
17
17
|
requireTurnFailureEventId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-J357NJQ5.js";
|
|
19
19
|
import {
|
|
20
20
|
resolveTurnSessionRouting,
|
|
21
21
|
scheduleSessionCompletedPluginTasks
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-VVU7GHIZ.js";
|
|
23
23
|
import {
|
|
24
24
|
getTurnLifecycle
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-VSOO3Y6M.js";
|
|
26
26
|
import {
|
|
27
27
|
coerceThreadConversationState,
|
|
28
28
|
configValueSchema,
|
|
@@ -30,11 +30,11 @@ import {
|
|
|
30
30
|
getPersistedSandboxState,
|
|
31
31
|
getPersistedThreadState,
|
|
32
32
|
persistThreadStateById
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-QAINJHI4.js";
|
|
34
34
|
import {
|
|
35
35
|
buildSentryConversationUrl,
|
|
36
36
|
deleteWebAuthorization
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-RAWYH7TW.js";
|
|
38
38
|
import {
|
|
39
39
|
createUserTokenStore,
|
|
40
40
|
deleteMcpAuthSession,
|
|
@@ -45,7 +45,7 @@ import {
|
|
|
45
45
|
lookupSlackUserProfile,
|
|
46
46
|
putMcpStoredOAuthCredentials,
|
|
47
47
|
resolvePluginOAuthAccount
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-N2MSPOGG.js";
|
|
49
49
|
import {
|
|
50
50
|
RetryableDeliveryError,
|
|
51
51
|
addReactionToMessage,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
removeReactionFromMessage,
|
|
60
60
|
resolveBaseUrl,
|
|
61
61
|
truncateStatusText
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-RFNMWONZ.js";
|
|
63
63
|
import {
|
|
64
64
|
CooperativeTurnYieldError,
|
|
65
65
|
clearPendingAuth,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
isCooperativeTurnYieldError,
|
|
69
69
|
isPendingAuthLatestRequest,
|
|
70
70
|
markTurnFailed
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-DFWJJOW3.js";
|
|
72
72
|
import {
|
|
73
73
|
abandonTurnRecord,
|
|
74
74
|
buildConversationContext,
|
|
@@ -87,20 +87,20 @@ import {
|
|
|
87
87
|
recordTurnSummary,
|
|
88
88
|
saveTurnCheckpoint,
|
|
89
89
|
turnHasReply
|
|
90
|
-
} from "./chunk-
|
|
90
|
+
} from "./chunk-6LQNW2CJ.js";
|
|
91
91
|
import {
|
|
92
92
|
parseSlackThreadId,
|
|
93
93
|
readSlackRawMessageContext,
|
|
94
94
|
resolveSlackChannelIdFromMessage,
|
|
95
95
|
resolveSlackChannelIdFromThreadId
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-VXAQTJSR.js";
|
|
97
97
|
import {
|
|
98
98
|
ensureConversationWake,
|
|
99
99
|
requestConversationWork
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-S74KAE77.js";
|
|
101
101
|
import {
|
|
102
102
|
getTurnRequestDeadline
|
|
103
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-VRHZXY5X.js";
|
|
104
104
|
import {
|
|
105
105
|
getVercelConversationWorkQueue
|
|
106
106
|
} from "./chunk-DKIJ2RP5.js";
|
|
@@ -112,39 +112,39 @@ import {
|
|
|
112
112
|
getSlackClient,
|
|
113
113
|
isDmChannel,
|
|
114
114
|
normalizeSlackConversationId
|
|
115
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-NE2UQMC7.js";
|
|
116
116
|
import {
|
|
117
117
|
getConversationStore,
|
|
118
118
|
getSqlExecutor,
|
|
119
119
|
requireSlackDestination,
|
|
120
120
|
upsertIdentity,
|
|
121
121
|
upsertLinkedIdentity
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-XNXKRWWI.js";
|
|
123
123
|
import {
|
|
124
124
|
acquireActiveLock,
|
|
125
125
|
getStateAdapter
|
|
126
|
-
} from "./chunk-
|
|
126
|
+
} from "./chunk-EQBHN4JK.js";
|
|
127
127
|
import {
|
|
128
128
|
botConfig,
|
|
129
129
|
escapeXml,
|
|
130
130
|
getChatConfig,
|
|
131
131
|
getRuntimeMetadata,
|
|
132
132
|
normalizeSlackEmojiName
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-5XSEOJPC.js";
|
|
134
134
|
import {
|
|
135
135
|
defaultModelId
|
|
136
|
-
} from "./chunk-
|
|
136
|
+
} from "./chunk-NHJU2ZAL.js";
|
|
137
137
|
import {
|
|
138
138
|
discoverSkills
|
|
139
|
-
} from "./chunk-
|
|
139
|
+
} from "./chunk-LSPUMNZK.js";
|
|
140
140
|
import {
|
|
141
141
|
pluginCatalogRuntime
|
|
142
|
-
} from "./chunk-
|
|
142
|
+
} from "./chunk-G6YRPYDC.js";
|
|
143
143
|
import {
|
|
144
144
|
buildOAuthTokenRequest,
|
|
145
145
|
hasRequiredOAuthScope,
|
|
146
146
|
parseOAuthTokenResponse
|
|
147
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-BXIVMNLR.js";
|
|
148
148
|
import {
|
|
149
149
|
createSlackResumeActor,
|
|
150
150
|
isUserActor,
|
|
@@ -162,7 +162,7 @@ import {
|
|
|
162
162
|
setTags,
|
|
163
163
|
toOptionalString,
|
|
164
164
|
withLogContext
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-CTS72G4B.js";
|
|
166
166
|
|
|
167
167
|
// src/chat/slack/assistant-thread/status-render.ts
|
|
168
168
|
var DEFAULT_STATUS_CONTEXTS = {
|
|
@@ -3,39 +3,39 @@ import {
|
|
|
3
3
|
} from "./chunk-RC745GGZ.js";
|
|
4
4
|
import {
|
|
5
5
|
parseSlackThreadId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VXAQTJSR.js";
|
|
7
7
|
import {
|
|
8
8
|
appendAndEnqueueExclusiveInboundMessage,
|
|
9
9
|
appendAndEnqueueInboundMessage
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-S74KAE77.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-NE2UQMC7.js";
|
|
17
17
|
import {
|
|
18
18
|
getConversationStore,
|
|
19
19
|
getDb
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-XNXKRWWI.js";
|
|
21
21
|
import {
|
|
22
22
|
juniorConversationParticipants,
|
|
23
23
|
juniorConversations,
|
|
24
24
|
juniorIdentities,
|
|
25
25
|
juniorUsers
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-PIZJBSGZ.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-5XSEOJPC.js";
|
|
33
33
|
import {
|
|
34
34
|
canExposeConversationPayload
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-ES7KCEND.js";
|
|
36
36
|
import {
|
|
37
37
|
logWarn
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-CTS72G4B.js";
|
|
39
39
|
|
|
40
40
|
// src/handlers/health.ts
|
|
41
41
|
function readHealthReport() {
|