@sentry/junior 0.88.0 → 0.90.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/README.md +16 -5
- package/dist/{agent-hooks-RIJ5TSWP.js → agent-hooks-MXAF7RQL.js} +10 -10
- package/dist/api/people/list.js +8 -8
- package/dist/api/people/profile.js +8 -8
- package/dist/api-reference.d.ts +1 -1
- package/dist/app.js +716 -732
- package/dist/{catalog-runtime-MW7XERSU.js → catalog-runtime-DXE6NXHT.js} +5 -5
- package/dist/chat/agent/index.d.ts +4 -0
- package/dist/chat/agent/prompt.d.ts +78 -0
- package/dist/chat/{respond.d.ts → agent/request.d.ts} +98 -55
- package/dist/chat/agent/resume.d.ts +65 -0
- package/dist/chat/agent/sandbox.d.ts +15 -0
- package/dist/chat/agent/session.d.ts +20 -0
- package/dist/chat/agent/skills.d.ts +26 -0
- package/dist/chat/agent/tools.d.ts +78 -0
- package/dist/chat/agent-dispatch/runner.d.ts +3 -5
- package/dist/chat/app/production.d.ts +3 -1
- package/dist/chat/app/services.d.ts +1 -4
- package/dist/chat/logging.d.ts +2 -0
- package/dist/chat/mcp/tool-manager.d.ts +1 -6
- package/dist/chat/pi/messages.d.ts +18 -2
- package/dist/chat/pi/transcript.d.ts +31 -0
- package/dist/chat/plugins/agent-hooks.d.ts +2 -2
- package/dist/chat/prompt.d.ts +1 -1
- package/dist/chat/runtime/agent-continue-runner.d.ts +5 -5
- package/dist/chat/runtime/agent-run-outcome.d.ts +21 -0
- package/dist/chat/runtime/agent-runner.d.ts +11 -0
- package/dist/chat/runtime/delivered-turn-state.d.ts +2 -2
- package/dist/chat/runtime/generated-artifacts.d.ts +16 -0
- package/dist/chat/runtime/reply-executor.d.ts +2 -2
- package/dist/chat/runtime/slack-resume.d.ts +21 -12
- package/dist/chat/runtime/turn.d.ts +5 -39
- package/dist/chat/services/reply-delivery-plan.d.ts +0 -8
- package/dist/chat/services/turn-failure-response.d.ts +4 -4
- package/dist/chat/services/turn-result.d.ts +4 -7
- package/dist/chat/slack/channel.d.ts +9 -5
- package/dist/chat/slack/client.d.ts +3 -1
- package/dist/chat/slack/context.d.ts +17 -5
- package/dist/chat/slack/id-param.d.ts +25 -0
- package/dist/chat/slack/ids.d.ts +18 -4
- package/dist/chat/slack/outbound.d.ts +16 -0
- package/dist/chat/slack/output.d.ts +3 -3
- package/dist/chat/slack/reply.d.ts +4 -7
- package/dist/chat/slack/timestamp-param.d.ts +25 -0
- package/dist/chat/slack/tools/canvas/context.d.ts +18 -0
- package/dist/chat/slack/tools/canvas/create.d.ts +4 -0
- package/dist/chat/slack/tools/canvas/edit.d.ts +3 -0
- package/dist/chat/slack/tools/canvas/read.d.ts +6 -0
- package/dist/chat/slack/tools/canvas/write.d.ts +3 -0
- package/dist/chat/{tools/slack → slack/tools}/channel-access.d.ts +4 -3
- package/dist/chat/{tools → slack/tools}/channel-capabilities.d.ts +2 -0
- package/dist/chat/slack/tools/channel-list-messages.d.ts +3 -0
- package/dist/chat/{tools/slack → slack/tools}/context.d.ts +5 -4
- package/dist/chat/slack/tools/list/add-items.d.ts +3 -0
- package/dist/chat/{tools/slack/lists.d.ts → slack/tools/list/api.d.ts} +2 -1
- package/dist/chat/slack/tools/list/create.d.ts +3 -0
- package/dist/chat/slack/tools/list/get-items.d.ts +3 -0
- package/dist/chat/slack/tools/list/update-item.d.ts +3 -0
- package/dist/chat/slack/tools/message-add-reaction.d.ts +4 -0
- package/dist/chat/slack/tools/send-message.d.ts +11 -0
- package/dist/chat/{tools/slack → slack/tools}/slack-message-url.d.ts +5 -5
- package/dist/chat/slack/tools/thread-read.d.ts +6 -0
- package/dist/chat/slack/tools/user-lookup.d.ts +2 -0
- package/dist/chat/slack/users.d.ts +2 -1
- package/dist/chat/{services → slack}/vision-context.d.ts +4 -2
- package/dist/chat/state/session-log.d.ts +1 -1
- package/dist/chat/tool-exposure.d.ts +10 -0
- package/dist/chat/tool-support/catalog-tool-call.d.ts +10 -0
- package/dist/chat/{tools/execution → tool-support}/normalize-result.d.ts +4 -1
- package/dist/chat/{tools/agent-tools.d.ts → tool-support/pi-tool-adapter.d.ts} +3 -9
- package/dist/chat/tool-support/schema-summary.d.ts +2 -0
- package/dist/chat/{tools → tool-support}/skill/mcp-tool-summary.d.ts +0 -6
- package/dist/chat/tool-support/structured-result.d.ts +73 -0
- package/dist/chat/tool-support/text-range-result.d.ts +58 -0
- package/dist/chat/tool-support/tool-execution-report.d.ts +7 -0
- package/dist/chat/tool-support/zod-tool.d.ts +27 -0
- package/dist/chat/tools/advisor/tool.d.ts +9 -18
- package/dist/chat/tools/definition.d.ts +56 -9
- package/dist/chat/tools/execute-tool.d.ts +3 -0
- package/dist/chat/tools/index.d.ts +3 -2
- package/dist/chat/tools/resource-events.d.ts +3 -13
- package/dist/chat/tools/runtime/report-progress.d.ts +1 -3
- package/dist/chat/tools/sandbox/bash.d.ts +1 -4
- package/dist/chat/tools/sandbox/edit-file.d.ts +25 -7
- package/dist/chat/tools/sandbox/file-uploads.d.ts +30 -0
- package/dist/chat/tools/sandbox/file-utils.d.ts +10 -1
- package/dist/chat/tools/sandbox/find-files.d.ts +12 -11
- package/dist/chat/tools/sandbox/grep.d.ts +18 -12
- package/dist/chat/tools/sandbox/list-dir.d.ts +15 -7
- package/dist/chat/tools/sandbox/read-file.d.ts +2 -31
- package/dist/chat/tools/sandbox/write-file.d.ts +1 -4
- package/dist/chat/tools/search-tools.d.ts +4 -0
- package/dist/chat/tools/skill/call-mcp-tool.d.ts +1 -4
- package/dist/chat/tools/skill/load-skill.d.ts +4 -5
- package/dist/chat/tools/skill/search-mcp-tools.d.ts +1 -5
- package/dist/chat/tools/system-time.d.ts +1 -1
- package/dist/chat/tools/types.d.ts +15 -5
- package/dist/chat/tools/web/fetch-content.d.ts +4 -2
- package/dist/chat/tools/web/fetch-tool.d.ts +4 -4
- package/dist/chat/tools/web/image-generate.d.ts +4 -3
- package/dist/chat/tools/web/search.d.ts +1 -4
- package/dist/{chunk-4IXHIV37.js → chunk-2S7M37HY.js} +6 -8
- package/dist/{chunk-L7OHKDOX.js → chunk-3MPOMK3K.js} +58 -7
- package/dist/{chunk-V6XDCS3X.js → chunk-5GBUZI6M.js} +4 -4
- package/dist/{chunk-7ES37H6U.js → chunk-AN2437E3.js} +4 -4
- package/dist/chunk-AOISHLSF.js +747 -0
- package/dist/{chunk-NYJLQI42.js → chunk-BKSZL4QO.js} +11257 -11957
- package/dist/{chunk-XS6NLQPA.js → chunk-DACFZ5CI.js} +474 -33
- package/dist/chunk-GCWD2VHP.js +1216 -0
- package/dist/chunk-GHGPTPBL.js +53 -0
- package/dist/{chunk-S35CPNPT.js → chunk-HXL2ZV74.js} +40 -216
- package/dist/{chunk-PBV4ZIVM.js → chunk-IRRMABQD.js} +1 -1
- package/dist/{chunk-2DPZRS3B.js → chunk-IX76WFJV.js} +8 -8
- package/dist/{chunk-66NX7MNW.js → chunk-KC42JAAQ.js} +1 -1
- package/dist/chunk-LFLTJQVR.js +90 -0
- package/dist/{chunk-IATAYWFU.js → chunk-NW7AXDA5.js} +2 -2
- package/dist/{chunk-F22AM3OW.js → chunk-NYWPISSO.js} +1 -1
- package/dist/chunk-OB42YVAE.js +16 -0
- package/dist/chunk-ONFOWI2D.js +955 -0
- package/dist/chunk-PHZHJTCK.js +1062 -0
- package/dist/{chunk-6UPQ5GTJ.js → chunk-QCKGI74V.js} +7 -7
- package/dist/{chunk-YPAE5RH3.js → chunk-RS6ANWVT.js} +1 -1
- package/dist/{chunk-C5NCV3OB.js → chunk-TYUXD3FN.js} +1 -1
- package/dist/{chunk-KBFQXJL4.js → chunk-XP7F4LYB.js} +5 -7
- package/dist/{chunk-VMBZFPZM.js → chunk-ZUK7BL63.js} +187 -9
- package/dist/cli/chat.js +55 -40
- package/dist/cli/check.js +6 -6
- package/dist/cli/init.js +30 -36
- package/dist/cli/plugins.js +16 -16
- package/dist/cli/snapshot-warmup.js +9 -9
- package/dist/cli/upgrade.js +21 -21
- package/dist/db-CXI7PR5U.js +18 -0
- package/dist/handlers/agent-dispatch.d.ts +3 -3
- package/dist/handlers/mcp-oauth-callback.d.ts +3 -3
- package/dist/handlers/oauth-callback.d.ts +3 -3
- package/dist/instrumentation.js +6 -5
- package/dist/nitro.js +3 -7
- package/dist/reporting.js +23 -25
- package/dist/{runner-BCRF2FCI.js → runner-FKL3RAHA.js} +89 -77
- package/dist/{validation-FMJO3L5P.js → validation-I7GD2YWS.js} +6 -6
- package/package.json +6 -6
- package/dist/chat/respond-helpers.d.ts +0 -82
- package/dist/chat/services/attachment-claims.d.ts +0 -2
- package/dist/chat/services/channel-intent.d.ts +0 -2
- package/dist/chat/tools/sandbox/attach-file.d.ts +0 -7
- package/dist/chat/tools/slack/canvas-tools.d.ts +0 -30
- package/dist/chat/tools/slack/channel-list-messages.d.ts +0 -9
- package/dist/chat/tools/slack/channel-post-message.d.ts +0 -5
- package/dist/chat/tools/slack/list-tools.d.ts +0 -21
- package/dist/chat/tools/slack/message-add-reaction.d.ts +0 -5
- package/dist/chat/tools/slack/thread-read.d.ts +0 -12
- package/dist/chat/tools/slack/user-lookup.d.ts +0 -8
- package/dist/chunk-AHLSXMOU.js +0 -506
- package/dist/chunk-FTMXFBDC.js +0 -49
- package/dist/chunk-KBSLCOGE.js +0 -2226
- package/dist/chunk-KQKIA4CU.js +0 -186
- package/dist/db-37HOGLI7.js +0 -18
- /package/dist/chat/{tools/slack/canvases.d.ts → slack/tools/canvas/api.d.ts} +0 -0
package/dist/cli/upgrade.js
CHANGED
|
@@ -4,53 +4,53 @@ import {
|
|
|
4
4
|
recordConversationActivity,
|
|
5
5
|
recordConversationExecution,
|
|
6
6
|
requestConversationWork
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import {
|
|
9
|
-
JUNIOR_THREAD_STATE_TTL_MS,
|
|
10
|
-
coerceThreadConversationState
|
|
11
|
-
} from "../chunk-66NX7MNW.js";
|
|
7
|
+
} from "../chunk-IX76WFJV.js";
|
|
12
8
|
import {
|
|
13
9
|
defineJuniorPlugins,
|
|
14
10
|
pluginCatalogConfigFromEnv,
|
|
15
11
|
pluginCatalogConfigFromPluginSet,
|
|
16
12
|
pluginRuntimeRegistrationsFromPluginSet
|
|
17
13
|
} from "../chunk-SG5WAA7H.js";
|
|
14
|
+
import {
|
|
15
|
+
JUNIOR_THREAD_STATE_TTL_MS,
|
|
16
|
+
coerceThreadConversationState
|
|
17
|
+
} from "../chunk-KC42JAAQ.js";
|
|
18
|
+
import {
|
|
19
|
+
loadAppPluginSet
|
|
20
|
+
} from "../chunk-Y2CM7HXH.js";
|
|
18
21
|
import {
|
|
19
22
|
createPluginLogger,
|
|
20
23
|
createPluginState
|
|
21
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-NW7AXDA5.js";
|
|
22
25
|
import {
|
|
23
26
|
disconnectStateAdapter,
|
|
24
27
|
getConnectedStateContext
|
|
25
|
-
} from "../chunk-
|
|
28
|
+
} from "../chunk-RS6ANWVT.js";
|
|
26
29
|
import {
|
|
27
30
|
createJuniorSqlExecutor,
|
|
28
31
|
createSqlStore,
|
|
29
32
|
getDb
|
|
30
|
-
} from "../chunk-
|
|
31
|
-
import {
|
|
32
|
-
parseDestination,
|
|
33
|
-
sameDestination
|
|
34
|
-
} from "../chunk-AHLSXMOU.js";
|
|
33
|
+
} from "../chunk-2S7M37HY.js";
|
|
35
34
|
import {
|
|
36
35
|
getChatConfig
|
|
37
|
-
} from "../chunk-
|
|
38
|
-
import "../chunk-
|
|
36
|
+
} from "../chunk-HXL2ZV74.js";
|
|
37
|
+
import "../chunk-3MPOMK3K.js";
|
|
39
38
|
import {
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
parseDestination,
|
|
40
|
+
sameDestination
|
|
41
|
+
} from "../chunk-GHGPTPBL.js";
|
|
42
42
|
import {
|
|
43
43
|
pluginCatalogRuntime
|
|
44
|
-
} from "../chunk-
|
|
45
|
-
import "../chunk-
|
|
46
|
-
import "../chunk-6APU57E6.js";
|
|
47
|
-
import "../chunk-VMBZFPZM.js";
|
|
44
|
+
} from "../chunk-XP7F4LYB.js";
|
|
45
|
+
import "../chunk-ZUK7BL63.js";
|
|
48
46
|
import {
|
|
49
47
|
isRecord,
|
|
50
48
|
toOptionalNumber,
|
|
51
49
|
toOptionalString
|
|
52
|
-
} from "../chunk-
|
|
50
|
+
} from "../chunk-OB42YVAE.js";
|
|
53
51
|
import "../chunk-3DA7X2U3.js";
|
|
52
|
+
import "../chunk-6APU57E6.js";
|
|
53
|
+
import "../chunk-LFLTJQVR.js";
|
|
54
54
|
import "../chunk-MLKGABMK.js";
|
|
55
55
|
|
|
56
56
|
// src/cli/upgrade.ts
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
closeDb,
|
|
3
|
+
getConversationStore,
|
|
4
|
+
getDb
|
|
5
|
+
} from "./chunk-2S7M37HY.js";
|
|
6
|
+
import "./chunk-HXL2ZV74.js";
|
|
7
|
+
import "./chunk-3MPOMK3K.js";
|
|
8
|
+
import "./chunk-GHGPTPBL.js";
|
|
9
|
+
import "./chunk-ZUK7BL63.js";
|
|
10
|
+
import "./chunk-OB42YVAE.js";
|
|
11
|
+
import "./chunk-3DA7X2U3.js";
|
|
12
|
+
import "./chunk-LFLTJQVR.js";
|
|
13
|
+
import "./chunk-MLKGABMK.js";
|
|
14
|
+
export {
|
|
15
|
+
closeDb,
|
|
16
|
+
getConversationStore,
|
|
17
|
+
getDb
|
|
18
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AgentRunner } from "@/chat/runtime/agent-runner";
|
|
2
2
|
import type { WaitUntilFn } from "@/handlers/types";
|
|
3
3
|
interface AgentDispatchHandlerOptions {
|
|
4
|
-
|
|
4
|
+
agentRunner: AgentRunner;
|
|
5
5
|
}
|
|
6
6
|
/** Handle the authenticated internal agent-dispatch callback. */
|
|
7
|
-
export declare function POST(request: Request, waitUntil: WaitUntilFn, options
|
|
7
|
+
export declare function POST(request: Request, waitUntil: WaitUntilFn, options: AgentDispatchHandlerOptions): Promise<Response>;
|
|
8
8
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { AgentRunner } from "@/chat/runtime/agent-runner";
|
|
2
2
|
import type { WaitUntilFn } from "@/handlers/types";
|
|
3
3
|
interface McpOAuthCallbackOptions {
|
|
4
|
-
|
|
4
|
+
agentRunner: AgentRunner;
|
|
5
5
|
}
|
|
6
|
-
export declare function GET(request: Request, provider: string, waitUntil: WaitUntilFn, options
|
|
6
|
+
export declare function GET(request: Request, provider: string, waitUntil: WaitUntilFn, options: McpOAuthCallbackOptions): Promise<Response>;
|
|
7
7
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { WaitUntilFn } from "@/handlers/types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { AgentRunner } from "@/chat/runtime/agent-runner";
|
|
3
3
|
interface OAuthCallbackOptions {
|
|
4
|
-
|
|
4
|
+
agentRunner: AgentRunner;
|
|
5
5
|
}
|
|
6
|
-
export declare function GET(request: Request, provider: string, waitUntil: WaitUntilFn, options
|
|
6
|
+
export declare function GET(request: Request, provider: string, waitUntil: WaitUntilFn, options: OAuthCallbackOptions): Promise<Response>;
|
|
7
7
|
export {};
|
package/dist/instrumentation.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getCurrentConversationPrivacy
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import
|
|
5
|
-
getDeploymentServiceVersion,
|
|
6
|
-
getDeploymentTelemetryAttributes
|
|
7
|
-
} from "./chunk-FTMXFBDC.js";
|
|
3
|
+
} from "./chunk-3MPOMK3K.js";
|
|
4
|
+
import "./chunk-OB42YVAE.js";
|
|
8
5
|
import {
|
|
9
6
|
getClient,
|
|
10
7
|
getGlobalScope,
|
|
@@ -12,6 +9,10 @@ import {
|
|
|
12
9
|
vercelAIIntegration,
|
|
13
10
|
withStreamedSpan
|
|
14
11
|
} from "./chunk-3DA7X2U3.js";
|
|
12
|
+
import {
|
|
13
|
+
getDeploymentServiceVersion,
|
|
14
|
+
getDeploymentTelemetryAttributes
|
|
15
|
+
} from "./chunk-LFLTJQVR.js";
|
|
15
16
|
import "./chunk-MLKGABMK.js";
|
|
16
17
|
|
|
17
18
|
// src/chat/sentry-payload-filter.ts
|
package/dist/nitro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveConversationWorkQueueTopic
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NYWPISSO.js";
|
|
4
4
|
import {
|
|
5
5
|
PLUGIN_TASK_QUEUE_TOPIC
|
|
6
6
|
} from "./chunk-KNFROR7R.js";
|
|
@@ -8,26 +8,22 @@ import {
|
|
|
8
8
|
pluginCatalogConfigFromPluginSet,
|
|
9
9
|
pluginRuntimeRegistrationsFromPluginSet
|
|
10
10
|
} from "./chunk-SG5WAA7H.js";
|
|
11
|
-
import "./chunk-AHLSXMOU.js";
|
|
12
|
-
import "./chunk-S35CPNPT.js";
|
|
13
|
-
import "./chunk-L7OHKDOX.js";
|
|
14
11
|
import {
|
|
15
12
|
loadPluginSetFromModule,
|
|
16
13
|
resolvePluginModule
|
|
17
14
|
} from "./chunk-Y2CM7HXH.js";
|
|
15
|
+
import "./chunk-GHGPTPBL.js";
|
|
18
16
|
import {
|
|
19
17
|
discoverInstalledPluginPackageContent,
|
|
20
18
|
isValidPackageName,
|
|
21
19
|
resolvePackageDir
|
|
22
20
|
} from "./chunk-6APU57E6.js";
|
|
23
|
-
import "./chunk-VMBZFPZM.js";
|
|
24
21
|
import {
|
|
25
22
|
JUNIOR_CONVERSATION_WORK_CALLBACK_ROUTE,
|
|
26
23
|
JUNIOR_HEARTBEAT_CRON_SCHEDULE,
|
|
27
24
|
JUNIOR_HEARTBEAT_ROUTE,
|
|
28
25
|
JUNIOR_PLUGIN_TASK_CALLBACK_ROUTE
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import "./chunk-3DA7X2U3.js";
|
|
26
|
+
} from "./chunk-LFLTJQVR.js";
|
|
31
27
|
import "./chunk-MLKGABMK.js";
|
|
32
28
|
|
|
33
29
|
// src/nitro.ts
|
package/dist/reporting.js
CHANGED
|
@@ -6,50 +6,52 @@ import {
|
|
|
6
6
|
getConversationDetails,
|
|
7
7
|
getConversationDetailsForIds,
|
|
8
8
|
resolveSlackConversationContextFromThreadId
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QCKGI74V.js";
|
|
10
10
|
import {
|
|
11
11
|
buildSystemPrompt,
|
|
12
|
+
unwrapCurrentInstruction
|
|
13
|
+
} from "./chunk-PHZHJTCK.js";
|
|
14
|
+
import {
|
|
12
15
|
getAgentTurnSessionRecord,
|
|
13
16
|
listAgentTurnSessionSummariesForConversation,
|
|
14
|
-
loadActivityEntries
|
|
15
|
-
|
|
17
|
+
loadActivityEntries,
|
|
18
|
+
piContentMessageSchema
|
|
19
|
+
} from "./chunk-GCWD2VHP.js";
|
|
16
20
|
import {
|
|
17
21
|
getPluginOperationalReports
|
|
18
|
-
} from "./chunk-
|
|
19
|
-
import "./chunk-
|
|
22
|
+
} from "./chunk-DACFZ5CI.js";
|
|
23
|
+
import "./chunk-NW7AXDA5.js";
|
|
20
24
|
import "./chunk-G3E7SCME.js";
|
|
21
25
|
import {
|
|
22
26
|
getStateAdapter
|
|
23
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-RS6ANWVT.js";
|
|
24
28
|
import {
|
|
25
29
|
getConversationStore
|
|
26
|
-
} from "./chunk-
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import {
|
|
29
|
-
unwrapCurrentInstruction
|
|
30
|
-
} from "./chunk-S35CPNPT.js";
|
|
30
|
+
} from "./chunk-2S7M37HY.js";
|
|
31
|
+
import "./chunk-HXL2ZV74.js";
|
|
31
32
|
import {
|
|
32
33
|
canExposeConversationPayload,
|
|
33
34
|
parseSlackThreadId,
|
|
34
35
|
resolveConversationPrivacy
|
|
35
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-3MPOMK3K.js";
|
|
37
|
+
import "./chunk-GHGPTPBL.js";
|
|
36
38
|
import {
|
|
37
39
|
discoverSkills
|
|
38
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-AN2437E3.js";
|
|
39
41
|
import {
|
|
40
42
|
pluginCatalogRuntime
|
|
41
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-XP7F4LYB.js";
|
|
42
44
|
import {
|
|
43
45
|
toStoredSlackRequester
|
|
44
|
-
} from "./chunk-
|
|
45
|
-
import {
|
|
46
|
-
homeDir
|
|
47
|
-
} from "./chunk-6APU57E6.js";
|
|
48
|
-
import "./chunk-VMBZFPZM.js";
|
|
46
|
+
} from "./chunk-ZUK7BL63.js";
|
|
49
47
|
import {
|
|
50
48
|
isRecord
|
|
51
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-OB42YVAE.js";
|
|
52
50
|
import "./chunk-3DA7X2U3.js";
|
|
51
|
+
import {
|
|
52
|
+
homeDir
|
|
53
|
+
} from "./chunk-6APU57E6.js";
|
|
54
|
+
import "./chunk-LFLTJQVR.js";
|
|
53
55
|
import "./chunk-MLKGABMK.js";
|
|
54
56
|
|
|
55
57
|
// src/reporting.ts
|
|
@@ -887,10 +889,6 @@ function subagentConversationFields(ref) {
|
|
|
887
889
|
...subagentSentryConversationUrl ? { subagentSentryConversationUrl } : {}
|
|
888
890
|
};
|
|
889
891
|
}
|
|
890
|
-
var piMessageSchema = z.object({
|
|
891
|
-
content: z.array(z.unknown()),
|
|
892
|
-
role: z.string().min(1)
|
|
893
|
-
}).passthrough().transform((value) => value);
|
|
894
892
|
async function readTranscriptRefMessages(ref) {
|
|
895
893
|
if (ref.type !== "advisor_session") {
|
|
896
894
|
return [];
|
|
@@ -898,7 +896,7 @@ async function readTranscriptRefMessages(ref) {
|
|
|
898
896
|
const stateAdapter = getStateAdapter();
|
|
899
897
|
await stateAdapter.connect();
|
|
900
898
|
const value = await stateAdapter.get(ref.key);
|
|
901
|
-
const parsed = z.array(
|
|
899
|
+
const parsed = z.array(piContentMessageSchema).safeParse(value);
|
|
902
900
|
return parsed.success ? parsed.data : [];
|
|
903
901
|
}
|
|
904
902
|
function transcriptSliceBounds(end) {
|
|
@@ -1,51 +1,48 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildConversationContext,
|
|
3
3
|
buildDeliveredTurnStatePatch,
|
|
4
|
-
coerceThreadArtifactsState,
|
|
5
|
-
completeDeliveredTurn,
|
|
6
4
|
finalizeFailedTurnReply,
|
|
7
|
-
generateAssistantReply,
|
|
8
|
-
getPersistedSandboxState,
|
|
9
|
-
getPersistedThreadState,
|
|
10
5
|
markConversationMessage,
|
|
11
|
-
markTurnFailed,
|
|
12
6
|
normalizeConversationText,
|
|
13
|
-
persistThreadStateById,
|
|
14
7
|
processPluginTask,
|
|
15
8
|
scheduleSessionCompletedPluginTasks,
|
|
16
|
-
startActiveTurn,
|
|
17
9
|
updateConversationStats,
|
|
18
10
|
upsertConversationMessage
|
|
19
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-AOISHLSF.js";
|
|
12
|
+
import "./chunk-KNFROR7R.js";
|
|
13
|
+
import {
|
|
14
|
+
coerceThreadArtifactsState,
|
|
15
|
+
completeDeliveredTurn,
|
|
16
|
+
getPersistedSandboxState,
|
|
17
|
+
getPersistedThreadState,
|
|
18
|
+
markTurnFailed,
|
|
19
|
+
persistThreadStateById,
|
|
20
|
+
startActiveTurn
|
|
21
|
+
} from "./chunk-ONFOWI2D.js";
|
|
20
22
|
import {
|
|
21
23
|
coerceThreadConversationState
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import "./chunk-V6XDCS3X.js";
|
|
24
|
-
import "./chunk-KNFROR7R.js";
|
|
24
|
+
} from "./chunk-KC42JAAQ.js";
|
|
25
25
|
import {
|
|
26
26
|
commitMessages,
|
|
27
27
|
loadProjection
|
|
28
|
-
} from "./chunk-
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
28
|
+
} from "./chunk-GCWD2VHP.js";
|
|
29
|
+
import "./chunk-DACFZ5CI.js";
|
|
30
|
+
import "./chunk-NW7AXDA5.js";
|
|
31
31
|
import "./chunk-G3E7SCME.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
34
|
-
import "./chunk-AHLSXMOU.js";
|
|
32
|
+
import "./chunk-RS6ANWVT.js";
|
|
33
|
+
import "./chunk-2S7M37HY.js";
|
|
35
34
|
import {
|
|
36
35
|
stripRuntimeTurnContext,
|
|
37
36
|
trimTrailingAssistantMessages
|
|
38
|
-
} from "./chunk-
|
|
39
|
-
import "./chunk-
|
|
40
|
-
import "./chunk-
|
|
41
|
-
import "./chunk-KBFQXJL4.js";
|
|
42
|
-
import "./chunk-KQKIA4CU.js";
|
|
43
|
-
import "./chunk-6APU57E6.js";
|
|
37
|
+
} from "./chunk-HXL2ZV74.js";
|
|
38
|
+
import "./chunk-3MPOMK3K.js";
|
|
39
|
+
import "./chunk-GHGPTPBL.js";
|
|
44
40
|
import {
|
|
45
41
|
logException
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import "./chunk-
|
|
42
|
+
} from "./chunk-ZUK7BL63.js";
|
|
43
|
+
import "./chunk-OB42YVAE.js";
|
|
48
44
|
import "./chunk-3DA7X2U3.js";
|
|
45
|
+
import "./chunk-LFLTJQVR.js";
|
|
49
46
|
import "./chunk-MLKGABMK.js";
|
|
50
47
|
|
|
51
48
|
// src/chat/local/runner.ts
|
|
@@ -70,7 +67,6 @@ function localTurnId(sequence) {
|
|
|
70
67
|
}
|
|
71
68
|
function localReply(reply) {
|
|
72
69
|
return {
|
|
73
|
-
...reply.files ? { files: reply.files } : {},
|
|
74
70
|
text: reply.text
|
|
75
71
|
};
|
|
76
72
|
}
|
|
@@ -120,7 +116,6 @@ async function runLocalAgentTurn(input, deps) {
|
|
|
120
116
|
}
|
|
121
117
|
const destination = localDestination(input.conversationId);
|
|
122
118
|
const source = createLocalSource(destination.conversationId);
|
|
123
|
-
const generateAssistantReply2 = deps.generateAssistantReply ?? generateAssistantReply;
|
|
124
119
|
const now = deps.now ?? (() => Date.now());
|
|
125
120
|
const persisted = await getPersistedThreadState(input.conversationId);
|
|
126
121
|
const conversation = coerceThreadConversationState(persisted);
|
|
@@ -163,64 +158,81 @@ async function runLocalAgentTurn(input, deps) {
|
|
|
163
158
|
fallback: conversation.piMessages
|
|
164
159
|
});
|
|
165
160
|
piMessagesBeforeRun = piMessages;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
actor: { type: "system", id: "local-cli" }
|
|
174
|
-
},
|
|
175
|
-
destination,
|
|
176
|
-
source,
|
|
177
|
-
requester: {
|
|
178
|
-
fullName: "Local CLI",
|
|
179
|
-
platform: "local",
|
|
180
|
-
userId: "local-cli",
|
|
181
|
-
userName: "local"
|
|
161
|
+
const outcome = await deps.agentRunner.run({
|
|
162
|
+
input: {
|
|
163
|
+
messageText: text,
|
|
164
|
+
conversationContext: buildConversationContext(conversation, {
|
|
165
|
+
excludeMessageId: userMessageId
|
|
166
|
+
}),
|
|
167
|
+
piMessages
|
|
182
168
|
},
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
169
|
+
routing: {
|
|
170
|
+
credentialContext: {
|
|
171
|
+
actor: { type: "system", id: "local-cli" }
|
|
172
|
+
},
|
|
173
|
+
destination,
|
|
174
|
+
source,
|
|
175
|
+
requester: {
|
|
176
|
+
fullName: "Local CLI",
|
|
177
|
+
platform: "local",
|
|
178
|
+
userId: "local-cli",
|
|
179
|
+
userName: "local"
|
|
180
|
+
},
|
|
181
|
+
surface: "internal",
|
|
182
|
+
correlation: {
|
|
183
|
+
conversationId: input.conversationId,
|
|
184
|
+
turnId,
|
|
185
|
+
runId: turnId
|
|
186
|
+
}
|
|
193
187
|
},
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
await persistThreadStateById(input.conversationId, {
|
|
197
|
-
artifacts,
|
|
198
|
-
conversation,
|
|
199
|
-
sandboxId,
|
|
200
|
-
sandboxDependencyProfileHash
|
|
201
|
-
});
|
|
188
|
+
policy: {
|
|
189
|
+
authorizationFlowMode: "disabled"
|
|
202
190
|
},
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
await persistThreadStateById(input.conversationId, {
|
|
207
|
-
artifacts,
|
|
208
|
-
conversation,
|
|
191
|
+
state: {
|
|
192
|
+
artifactState: artifacts,
|
|
193
|
+
sandbox: {
|
|
209
194
|
sandboxId,
|
|
210
195
|
sandboxDependencyProfileHash
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
onStatus: async (status) => {
|
|
214
|
-
await deps.onStatus?.(status.text);
|
|
196
|
+
}
|
|
215
197
|
},
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
198
|
+
observers: {
|
|
199
|
+
onStatus: async (status) => {
|
|
200
|
+
await deps.onStatus?.(status.text);
|
|
201
|
+
},
|
|
202
|
+
onTextDelta: deps.onTextDelta,
|
|
203
|
+
onToolInvocation: async (invocation) => {
|
|
204
|
+
await deps.onToolInvocation?.(invocation);
|
|
205
|
+
},
|
|
206
|
+
onToolResult: async (result) => {
|
|
207
|
+
await deps.onToolResult?.(result);
|
|
208
|
+
}
|
|
219
209
|
},
|
|
220
|
-
|
|
221
|
-
|
|
210
|
+
durability: {
|
|
211
|
+
onArtifactStateUpdated: async (nextArtifacts) => {
|
|
212
|
+
artifacts = nextArtifacts;
|
|
213
|
+
await persistThreadStateById(input.conversationId, {
|
|
214
|
+
artifacts,
|
|
215
|
+
conversation,
|
|
216
|
+
sandboxId,
|
|
217
|
+
sandboxDependencyProfileHash
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
onSandboxAcquired: async (sandbox) => {
|
|
221
|
+
sandboxId = sandbox.sandboxId;
|
|
222
|
+
sandboxDependencyProfileHash = sandbox.sandboxDependencyProfileHash;
|
|
223
|
+
await persistThreadStateById(input.conversationId, {
|
|
224
|
+
artifacts,
|
|
225
|
+
conversation,
|
|
226
|
+
sandboxId,
|
|
227
|
+
sandboxDependencyProfileHash
|
|
228
|
+
});
|
|
229
|
+
}
|
|
222
230
|
}
|
|
223
231
|
});
|
|
232
|
+
if (outcome.status !== "completed") {
|
|
233
|
+
throw new Error(`Local agent run ended with ${outcome.status}`);
|
|
234
|
+
}
|
|
235
|
+
reply = outcome.result;
|
|
224
236
|
reply = finalizeFailedTurnReply({
|
|
225
237
|
reply,
|
|
226
238
|
logException,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
validatePluginEgressCredentialHooks,
|
|
3
3
|
validatePluginRegistrations
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-VMBZFPZM.js";
|
|
9
|
-
import "./chunk-FTMXFBDC.js";
|
|
4
|
+
} from "./chunk-TYUXD3FN.js";
|
|
5
|
+
import "./chunk-XP7F4LYB.js";
|
|
6
|
+
import "./chunk-ZUK7BL63.js";
|
|
7
|
+
import "./chunk-OB42YVAE.js";
|
|
10
8
|
import "./chunk-3DA7X2U3.js";
|
|
9
|
+
import "./chunk-6APU57E6.js";
|
|
10
|
+
import "./chunk-LFLTJQVR.js";
|
|
11
11
|
import "./chunk-MLKGABMK.js";
|
|
12
12
|
export {
|
|
13
13
|
validatePluginEgressCredentialHooks,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/junior",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.90.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"pg": "^8.16.3",
|
|
79
79
|
"yaml": "^2.9.0",
|
|
80
80
|
"zod": "^4.4.3",
|
|
81
|
-
"@sentry/junior-plugin-api": "0.
|
|
81
|
+
"@sentry/junior-plugin-api": "0.90.0"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@emnapi/core": "^1.10.0",
|
|
@@ -94,10 +94,10 @@
|
|
|
94
94
|
"typescript": "^6.0.3",
|
|
95
95
|
"vercel": "^54.4.0",
|
|
96
96
|
"vitest": "^4.1.7",
|
|
97
|
-
"@sentry/junior-
|
|
98
|
-
"@sentry/junior-memory": "0.
|
|
99
|
-
"@sentry/junior-
|
|
100
|
-
"@sentry/junior-
|
|
97
|
+
"@sentry/junior-scheduler": "0.90.0",
|
|
98
|
+
"@sentry/junior-memory": "0.90.0",
|
|
99
|
+
"@sentry/junior-testing": "0.0.0",
|
|
100
|
+
"@sentry/junior-github": "0.90.0"
|
|
101
101
|
},
|
|
102
102
|
"scripts": {
|
|
103
103
|
"build": "tsup && tsc -p tsconfig.build.json --emitDeclarationOnly",
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Pure helper functions used by the agent reply orchestration in respond.ts.
|
|
3
|
-
*
|
|
4
|
-
* These are extracted to reduce the size of the main orchestration module and
|
|
5
|
-
* make individual helpers independently testable.
|
|
6
|
-
*/
|
|
7
|
-
import type { AssistantMessage, ToolResultMessage } from "@earendil-works/pi-ai";
|
|
8
|
-
import type { PiMessage } from "@/chat/pi/messages";
|
|
9
|
-
import type { Skill } from "@/chat/skills";
|
|
10
|
-
/** Extract conversation and session identifiers from correlation context. */
|
|
11
|
-
export declare function getSessionIdentifiers(context: {
|
|
12
|
-
correlation?: {
|
|
13
|
-
conversationId?: string;
|
|
14
|
-
threadId?: string;
|
|
15
|
-
turnId?: string;
|
|
16
|
-
runId?: string;
|
|
17
|
-
};
|
|
18
|
-
}): {
|
|
19
|
-
conversationId?: string;
|
|
20
|
-
sessionId?: string;
|
|
21
|
-
};
|
|
22
|
-
/** Detect polite execution deferral phrases that signal the model is stalling. */
|
|
23
|
-
export declare function isExecutionDeferralResponse(text: string): boolean;
|
|
24
|
-
/** Detect disclaimers about missing tool access. */
|
|
25
|
-
export declare function isToolAccessDisclaimerResponse(text: string): boolean;
|
|
26
|
-
/** True when the model produced an escape response instead of executing. */
|
|
27
|
-
export declare function isExecutionEscapeResponse(text: string): boolean;
|
|
28
|
-
/** Best-effort JSON extraction from text that may contain fenced blocks. */
|
|
29
|
-
export declare function parseJsonCandidate(text: string): unknown;
|
|
30
|
-
/** Check whether a parsed object looks like a raw tool call/result payload. */
|
|
31
|
-
export declare function isToolPayloadShape(payload: unknown): boolean;
|
|
32
|
-
/** Detect responses that are raw tool payloads leaked as text. */
|
|
33
|
-
export declare function isRawToolPayloadResponse(text: string): boolean;
|
|
34
|
-
/** Redact image data from prompt content parts for observability. */
|
|
35
|
-
export declare function toObservablePromptPart(part: {
|
|
36
|
-
type: "text";
|
|
37
|
-
text: string;
|
|
38
|
-
} | {
|
|
39
|
-
type: "image";
|
|
40
|
-
data: string;
|
|
41
|
-
mimeType: string;
|
|
42
|
-
}): Record<string, unknown>;
|
|
43
|
-
/** Truncate message text for log attributes. */
|
|
44
|
-
export declare function summarizeMessageText(text: string): string;
|
|
45
|
-
/**
|
|
46
|
-
* Keep thread text separate from the canonical active task boundary.
|
|
47
|
-
*/
|
|
48
|
-
export declare function buildUserTurnText(userInput: string, conversationContext?: string): string;
|
|
49
|
-
/** Encode a non-image attachment as base64 XML for the prompt. */
|
|
50
|
-
export declare function encodeNonImageAttachmentForPrompt(attachment: {
|
|
51
|
-
data: Buffer;
|
|
52
|
-
mediaType: string;
|
|
53
|
-
filename?: string;
|
|
54
|
-
}): string;
|
|
55
|
-
/** Type guard for Pi SDK tool result messages. */
|
|
56
|
-
export declare function isToolResultMessage(value: unknown): value is ToolResultMessage<any>;
|
|
57
|
-
/** Extract the tool name from a raw tool result message. */
|
|
58
|
-
export declare function normalizeToolNameFromResult(result: unknown): string | undefined;
|
|
59
|
-
/** Check whether a tool result carries an error flag. */
|
|
60
|
-
export declare function isToolResultError(result: unknown): boolean;
|
|
61
|
-
/** Extract tool names that completed successfully from raw Pi messages. */
|
|
62
|
-
export declare function getSuccessfulToolCalls(messages: readonly unknown[]): string[];
|
|
63
|
-
/** Type guard for Pi SDK assistant messages. */
|
|
64
|
-
export declare function isAssistantMessage(value: unknown): value is AssistantMessage;
|
|
65
|
-
/** Extract role string from a raw Pi message. */
|
|
66
|
-
export declare function getPiMessageRole(value: unknown): string | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Add bootstrap context only for stored boundaries captured before prompt().
|
|
69
|
-
*/
|
|
70
|
-
export declare function prependMissingRuntimeTurnContext(messages: PiMessage[], turnContextPrompt: string): PiMessage[];
|
|
71
|
-
/** Return whether Pi history already carries session bootstrap context. */
|
|
72
|
-
export declare function hasRuntimeTurnContext(messages: PiMessage[]): boolean;
|
|
73
|
-
/** Remove volatile runtime context before reusing messages as history. */
|
|
74
|
-
export declare function stripRuntimeTurnContext(messages: PiMessage[]): PiMessage[];
|
|
75
|
-
/** Concatenate text content parts from an assistant message. */
|
|
76
|
-
export declare function extractAssistantText(message: AssistantMessage): string;
|
|
77
|
-
/** Return assistant messages that belong to the terminal post-tool reply phase. */
|
|
78
|
-
export declare function getTerminalAssistantMessages(messages: readonly unknown[]): AssistantMessage[];
|
|
79
|
-
/** Upsert a skill into the active skills list by name. */
|
|
80
|
-
export declare function upsertActiveSkill(activeSkills: Skill[], next: Skill): void;
|
|
81
|
-
/** Remove trailing assistant messages before committing a resumable boundary. */
|
|
82
|
-
export declare function trimTrailingAssistantMessages(messages: PiMessage[]): PiMessage[];
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { SandboxWorkspace } from "@/chat/sandbox/workspace";
|
|
2
|
-
import type { ToolHooks } from "@/chat/tools/types";
|
|
3
|
-
export declare function createAttachFileTool(sandbox: SandboxWorkspace, hooks?: ToolHooks): import("@/chat/tools/definition").ToolDefinition<import("@sinclair/typebox").TObject<{
|
|
4
|
-
path: import("@sinclair/typebox").TString;
|
|
5
|
-
filename: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
6
|
-
mimeType: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
-
}>>;
|