@sentry/junior 0.114.0 → 0.116.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-WNBUY4OB.js → agent-hooks-67NFITDH.js} +13 -12
- package/dist/api/conversations/detail.d.ts +20 -0
- package/dist/api/conversations/event-list.d.ts +2 -0
- package/dist/api/conversations/event-page.d.ts +1 -1
- package/dist/api/conversations/events.d.ts +1 -1
- package/dist/api/health.d.ts +7 -0
- package/dist/api/people/profile.d.ts +2 -2
- package/dist/api/people/shared.d.ts +1 -1
- package/dist/api/personal-tokens/create.d.ts +11 -0
- package/dist/api/personal-tokens/list.d.ts +12 -0
- package/dist/api/personal-tokens/revoke.d.ts +5 -0
- package/dist/api/personal-tokens/routes.d.ts +4 -0
- package/dist/api/plugin-reports.d.ts +62 -0
- package/dist/api/plugins.d.ts +8 -0
- package/dist/api/route.d.ts +1 -1
- package/dist/api/runtime.d.ts +24 -0
- package/dist/api/schema/conversation.d.ts +26 -0
- package/dist/api/schema/person.d.ts +3 -3
- package/dist/api/schema/personal-token.d.ts +38 -0
- package/dist/api/schema.d.ts +4 -2
- package/dist/api/schema.js +19 -7
- package/dist/api/skills.d.ts +6 -0
- package/dist/api.d.ts +1 -0
- package/dist/api.js +285 -121
- package/dist/app.js +1957 -5677
- package/dist/catalog-runtime-CWZY6GTH.js +18 -0
- package/dist/chat/agent/request.d.ts +7 -0
- package/dist/chat/agent/resume.d.ts +1 -0
- package/dist/chat/agent/sandbox.d.ts +3 -0
- package/dist/chat/agent/tools.d.ts +3 -0
- package/dist/chat/agent-dispatch/context.d.ts +2 -0
- package/dist/chat/agent-dispatch/heartbeat.d.ts +11 -5
- package/dist/chat/agent-dispatch/signing.d.ts +14 -5
- package/dist/chat/agent-dispatch/store.d.ts +36 -15
- package/dist/chat/agent-dispatch/types.d.ts +23 -10
- package/dist/chat/agent-dispatch/work.d.ts +58 -0
- package/dist/chat/app/factory.d.ts +12 -3
- package/dist/chat/config.d.ts +2 -0
- package/dist/chat/conversations/history.d.ts +291 -290
- package/dist/chat/conversations/projection.d.ts +2 -2
- package/dist/chat/local/credential-sync.d.ts +5 -0
- package/dist/chat/local/oauth-relay.d.ts +4 -0
- package/dist/chat/mcp/oauth.d.ts +1 -0
- package/dist/chat/mcp/tool-manager.d.ts +2 -1
- package/dist/chat/oauth-authorization.d.ts +17 -0
- package/dist/chat/oauth-flow.d.ts +9 -0
- package/dist/chat/pi/conversation-events.d.ts +6 -2
- package/dist/chat/plugins/annotations.d.ts +8 -0
- package/dist/chat/plugins/registry.d.ts +0 -3
- package/dist/chat/plugins/types.d.ts +0 -2
- package/dist/chat/runtime/agent-continue-runner.d.ts +4 -0
- package/dist/chat/runtime/reply-executor.d.ts +6 -1
- package/dist/chat/runtime/slack-resume.d.ts +5 -1
- package/dist/chat/runtime/turn-input.d.ts +3 -0
- package/dist/chat/sandbox/egress/schemas.d.ts +46 -0
- package/dist/chat/sandbox/egress/signals.d.ts +9 -0
- package/dist/chat/sandbox/sandbox.d.ts +4 -1
- package/dist/chat/sandbox/session.d.ts +2 -11
- package/dist/chat/sandbox/workspace.d.ts +10 -2
- package/dist/chat/sentry-payload-filter.d.ts +4 -4
- package/dist/chat/services/mcp-auth-orchestration.d.ts +5 -3
- package/dist/chat/services/plugin-auth-orchestration.d.ts +2 -0
- package/dist/chat/services/turn-session-record.d.ts +14 -1
- package/dist/chat/slack/dispatch-turn.d.ts +25 -0
- package/dist/chat/slack/message-control.d.ts +2 -0
- package/dist/chat/slack/oauth-authorization-message.d.ts +3 -0
- package/dist/chat/state/turn-session.d.ts +11 -0
- package/dist/chat/task-execution/slack-work.d.ts +2 -0
- package/dist/chat/tool-support/text-range-result.d.ts +3 -0
- package/dist/chat/tool-support/zod-tool.d.ts +2 -1
- package/dist/chat/tools/definition.d.ts +3 -5
- package/dist/chat/tools/query-conversation-events.d.ts +68 -0
- package/dist/chat/tools/sandbox/file-utils.d.ts +8 -1
- package/dist/chat/tools/sandbox/find-files.d.ts +2 -1
- package/dist/chat/tools/sandbox/grep.d.ts +2 -1
- package/dist/{chunk-OSKEC4XU.js → chunk-25GU5B5E.js} +1 -1
- package/dist/{chunk-XLFBQJUO.js → chunk-3H45VOBZ.js} +32 -7
- package/dist/{chunk-4FUEG3QY.js → chunk-3JOGUT46.js} +4 -16
- package/dist/chunk-4CODA7P5.js +43 -0
- package/dist/{chunk-O4GT7LYB.js → chunk-4DD6AOCG.js} +3 -43
- package/dist/{chunk-YU6PO42Q.js → chunk-53ZKTQO6.js} +1 -1
- package/dist/{chunk-WV4UJBAS.js → chunk-5UNB623T.js} +1282 -2536
- package/dist/{chunk-TLGM5X2M.js → chunk-6RQ5GCWH.js} +2 -2
- package/dist/{chunk-MIAKQNYX.js → chunk-6ZK6FZIV.js} +1 -1
- package/dist/{chunk-W6RDUAO3.js → chunk-BXLS3I4W.js} +1 -1
- package/dist/{chunk-RD7EJI7H.js → chunk-CI3VK7X5.js} +69 -3
- package/dist/chunk-DIB4GX3G.js +8 -0
- package/dist/{chunk-42WRQLJ6.js → chunk-F3B2YJ76.js} +0 -14
- package/dist/chunk-FA6POGLH.js +70 -0
- package/dist/{chunk-6Y5L4BOM.js → chunk-FXOYURO4.js} +5 -3
- package/dist/chunk-HDSDCEPK.js +80 -0
- package/dist/{chunk-C4MZ3GP5.js → chunk-HZF5P5UN.js} +1 -1
- package/dist/{chunk-K2W4CK7K.js → chunk-JZPQ5K4V.js} +10 -129
- package/dist/{chunk-FIGAF6KL.js → chunk-KBNDFU6J.js} +108 -38
- package/dist/{chunk-PM3PX42K.js → chunk-MGH5ADQS.js} +1 -2
- package/dist/{chunk-5CZ7RETL.js → chunk-N7TMYLF2.js} +1 -1
- package/dist/chunk-OB42YVAE.js +16 -0
- package/dist/{chunk-6QWPVTMO.js → chunk-OF5FODBL.js} +125 -23
- package/dist/{chunk-2ZTTXTSZ.js → chunk-PE44LDDQ.js} +9 -4
- package/dist/chunk-PGKWXHYJ.js +1870 -0
- package/dist/{chunk-ZGXH3REA.js → chunk-PZGPCOSD.js} +12 -2
- package/dist/{chunk-JQFJO5WH.js → chunk-RXRQJF7Y.js} +74 -17
- package/dist/{chunk-S4QDH23A.js → chunk-TC4ZEM2D.js} +113 -79
- package/dist/{chunk-ABPSDO6M.js → chunk-UEVLIYK5.js} +234 -165
- package/dist/chunk-VKZ6WVAY.js +4318 -0
- package/dist/{chunk-VNNBSKCO.js → chunk-VZCSLYCE.js} +22 -7
- package/dist/chunk-W3U3YQYI.js +71 -0
- package/dist/{chunk-SG5WAA7H.js → chunk-WKU7TY22.js} +0 -3
- package/dist/cli/chat.js +74 -42
- package/dist/cli/check.js +10 -8
- package/dist/cli/init.js +1 -0
- package/dist/cli/plugins.js +18 -16
- package/dist/cli/snapshot-warmup.js +13 -11
- package/dist/cli/upgrade.js +12 -10
- package/dist/db/schema/api-tokens.d.ts +160 -0
- package/dist/db/schema/conversation-annotations.d.ts +142 -0
- package/dist/db/schema.d.ts +305 -1
- package/dist/{db-4VLP7KBF.js → db-57FHVGGQ.js} +9 -8
- package/dist/handlers/agent-dispatch.d.ts +7 -3
- package/dist/handlers/sandbox-egress-signals.d.ts +4 -0
- package/dist/instrumentation.js +72 -4
- package/dist/nitro.js +5 -5
- package/dist/oauth-callback-server-PAQRPXZX.js +231 -0
- package/dist/oauth-relay-3ZU72UGL.js +9 -0
- package/dist/personal-tokens/store.d.ts +27 -0
- package/dist/{plugins-PZMDS7AT.js → plugins-IUJA4VBU.js} +1 -1
- package/dist/reporting-schema.d.ts +10 -4
- package/dist/reporting.d.ts +5 -5
- package/dist/{runner-IPXLWQOF.js → runner-4ISZYJEX.js} +141 -74
- package/dist/sandbox-egress-signals-CDFAP67O.js +75 -0
- package/dist/{skills-QCNZISNF.js → skills-UE2KXQMB.js} +10 -8
- package/dist/validation-PO5LHTJT.js +21 -0
- package/dist/version.js +1 -1
- package/migrations/0008_sticky_rage.sql +14 -0
- package/migrations/0009_slippery_harrier.sql +12 -0
- package/migrations/0010_native_conversation_history.sql +142 -0
- package/migrations/meta/0008_snapshot.json +1076 -0
- package/migrations/meta/0009_snapshot.json +1146 -0
- package/migrations/meta/0010_snapshot.json +1190 -0
- package/migrations/meta/_journal.json +22 -1
- package/package.json +6 -7
- package/dist/catalog-runtime-6O4M6JGA.js +0 -16
- package/dist/chat/agent-dispatch/runner.d.ts +0 -13
- package/dist/chat/capabilities/catalog.d.ts +0 -16
- package/dist/chat/oauth-authorization-message.d.ts +0 -6
- package/dist/validation-I2BW3UHD.js +0 -19
- package/dist/{chunk-KNFROR7R.js → chunk-5I6ORJUY.js} +1 -1
|
@@ -2,7 +2,8 @@ import { z, type ZodType, type ZodTypeAny } from "zod";
|
|
|
2
2
|
import { type JuniorToolResult } from "@/chat/tool-support/structured-result";
|
|
3
3
|
import type { ImageContent, TextContent } from "@earendil-works/pi-ai";
|
|
4
4
|
import type { AnyToolDefinition, JsonSchemaObject, ToolExecuteOptions } from "@/chat/tools/definition";
|
|
5
|
-
type ZodToolDefinitionBase<TInputSchema extends ZodTypeAny> = Pick<AnyToolDefinition, "identity" | "source" | "description" | "exposure" | "annotations" | "promptSnippet" | "promptGuidelines" | "executionMode"> & {
|
|
5
|
+
type ZodToolDefinitionBase<TInputSchema extends ZodTypeAny> = Pick<AnyToolDefinition, "approvalMode" | "identity" | "source" | "description" | "exposure" | "annotations" | "promptSnippet" | "promptGuidelines" | "executionMode"> & {
|
|
6
|
+
describeProposal?(input: z.output<TInputSchema>): string;
|
|
6
7
|
inputSchema: TInputSchema;
|
|
7
8
|
prepareArguments?: (args: unknown) => z.input<TInputSchema>;
|
|
8
9
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ToolAnnotations } from "@modelcontextprotocol/sdk/types.js";
|
|
2
1
|
import { type Static, type TSchema } from "@sinclair/typebox";
|
|
3
2
|
import type { ToolExecutionMode } from "@earendil-works/pi-agent-core";
|
|
3
|
+
import type { ToolApprovalMetadata } from "@sentry/junior-plugin-api";
|
|
4
4
|
import type { ConversationPrivacy } from "@/chat/conversation-privacy";
|
|
5
5
|
/**
|
|
6
6
|
* Tool definition boundary for Pi-facing agent tools.
|
|
@@ -16,7 +16,7 @@ export interface ToolExecuteOptions {
|
|
|
16
16
|
conversationPrivacy?: ConversationPrivacy;
|
|
17
17
|
toolCallId?: string;
|
|
18
18
|
}
|
|
19
|
-
interface BaseToolDefinition<TInput, TInputSchema extends ToolInputSchema> {
|
|
19
|
+
interface BaseToolDefinition<TInput, TInputSchema extends ToolInputSchema> extends ToolApprovalMetadata<TInput> {
|
|
20
20
|
/** Stable internal owner-qualified identity for plugin-contributed tools. */
|
|
21
21
|
identity?: {
|
|
22
22
|
id: string;
|
|
@@ -33,7 +33,6 @@ interface BaseToolDefinition<TInput, TInputSchema extends ToolInputSchema> {
|
|
|
33
33
|
inputSchema: TInputSchema;
|
|
34
34
|
outputSchema?: ToolInputSchema;
|
|
35
35
|
privateTraceResult?(result: unknown): unknown;
|
|
36
|
-
annotations?: ToolAnnotations;
|
|
37
36
|
/**
|
|
38
37
|
* @deprecated Put tool-selection and usage guidance directly in `description`
|
|
39
38
|
* and parameter descriptions. Retained for plugin compatibility; may be
|
|
@@ -55,7 +54,7 @@ export interface ToolDefinition<TInputSchema extends TSchema = TSchema> extends
|
|
|
55
54
|
/**
|
|
56
55
|
* Schema-erased view for heterogeneous registries after Pi validates tool input.
|
|
57
56
|
*/
|
|
58
|
-
export interface AnyToolDefinition {
|
|
57
|
+
export interface AnyToolDefinition extends ToolApprovalMetadata {
|
|
59
58
|
/** Stable internal owner-qualified identity for plugin-contributed tools. */
|
|
60
59
|
identity?: {
|
|
61
60
|
id: string;
|
|
@@ -72,7 +71,6 @@ export interface AnyToolDefinition {
|
|
|
72
71
|
inputSchema: ToolInputSchema;
|
|
73
72
|
outputSchema?: ToolInputSchema;
|
|
74
73
|
privateTraceResult?(result: unknown): unknown;
|
|
75
|
-
annotations?: ToolAnnotations;
|
|
76
74
|
/**
|
|
77
75
|
* @deprecated Put tool-selection and usage guidance directly in `description`
|
|
78
76
|
* and parameter descriptions. Retained for plugin compatibility; may be
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type KnownConversationEventType } from "@/chat/conversations/history";
|
|
2
|
+
import type { ToolRuntimeContext } from "@/chat/tools/types";
|
|
3
|
+
/** Create a deferred tool that returns a bounded raw conversation event page. */
|
|
4
|
+
export declare function createQueryConversationEventsTool(context: ToolRuntimeContext): Omit<import("./definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
|
|
5
|
+
inputSchema: import("./definition").JsonSchemaObject;
|
|
6
|
+
outputSchema: import("./definition").JsonSchemaObject;
|
|
7
|
+
prepareArguments(args: unknown): {
|
|
8
|
+
conversation_id: string;
|
|
9
|
+
after_seq?: number | null | undefined;
|
|
10
|
+
before_seq?: number | null | undefined;
|
|
11
|
+
limit?: number | null | undefined;
|
|
12
|
+
types?: ("message" | "handoff" | "user_message" | "assistant_message" | "tool_result" | "compaction" | "mcp_provider_connected" | "authorization_requested" | "authorization_completed" | "tool_execution_started" | "message_updated" | "message_handled" | "messages_summarized" | "turn_started" | "turn_routed" | "turn_completed" | "turn_failed" | "subagent_started" | "subagent_ended")[] | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
execute?: ((input: unknown, options: import("./definition").ToolExecuteOptions) => {
|
|
15
|
+
[x: string]: unknown;
|
|
16
|
+
ok: boolean;
|
|
17
|
+
status: "error" | "success";
|
|
18
|
+
conversation_id: string;
|
|
19
|
+
events: {
|
|
20
|
+
seq: number;
|
|
21
|
+
history_version: number;
|
|
22
|
+
created_at: string;
|
|
23
|
+
data: Record<string, unknown>;
|
|
24
|
+
idempotency_key?: string | undefined;
|
|
25
|
+
}[];
|
|
26
|
+
has_older: boolean;
|
|
27
|
+
has_newer: boolean;
|
|
28
|
+
target?: string | undefined;
|
|
29
|
+
data?: unknown;
|
|
30
|
+
truncated?: boolean | undefined;
|
|
31
|
+
continuation?: {
|
|
32
|
+
arguments: Record<string, unknown>;
|
|
33
|
+
reason?: string | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
error?: string | {
|
|
36
|
+
kind: string;
|
|
37
|
+
message: string;
|
|
38
|
+
retryable?: boolean | undefined;
|
|
39
|
+
} | undefined;
|
|
40
|
+
} | Promise<{
|
|
41
|
+
[x: string]: unknown;
|
|
42
|
+
ok: boolean;
|
|
43
|
+
status: "error" | "success";
|
|
44
|
+
conversation_id: string;
|
|
45
|
+
events: {
|
|
46
|
+
seq: number;
|
|
47
|
+
history_version: number;
|
|
48
|
+
created_at: string;
|
|
49
|
+
data: Record<string, unknown>;
|
|
50
|
+
idempotency_key?: string | undefined;
|
|
51
|
+
}[];
|
|
52
|
+
has_older: boolean;
|
|
53
|
+
has_newer: boolean;
|
|
54
|
+
target?: string | undefined;
|
|
55
|
+
data?: unknown;
|
|
56
|
+
truncated?: boolean | undefined;
|
|
57
|
+
continuation?: {
|
|
58
|
+
arguments: Record<string, unknown>;
|
|
59
|
+
reason?: string | undefined;
|
|
60
|
+
} | undefined;
|
|
61
|
+
error?: string | {
|
|
62
|
+
kind: string;
|
|
63
|
+
message: string;
|
|
64
|
+
retryable?: boolean | undefined;
|
|
65
|
+
} | undefined;
|
|
66
|
+
}>) | undefined;
|
|
67
|
+
};
|
|
68
|
+
export type { KnownConversationEventType };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type { SandboxFileSystem } from "@/chat/sandbox/workspace";
|
|
1
|
+
import type { SandboxCommandInput, SandboxCommandResult, SandboxFileSystem } from "@/chat/sandbox/workspace";
|
|
2
2
|
export type { SandboxFileSystem };
|
|
3
|
+
export type SandboxCommandRunner = (input: SandboxCommandInput) => Promise<SandboxCommandResult>;
|
|
3
4
|
export declare const MAX_TEXT_CHARS = 60000;
|
|
5
|
+
export declare const RIPGREP_EXCLUDED_GLOBS: readonly ["!**/.git/**", "!**/node_modules/**"];
|
|
4
6
|
export type TextSearchResultDetails = {
|
|
5
7
|
ok: true;
|
|
6
8
|
status?: "success";
|
|
@@ -47,6 +49,11 @@ export declare function missingPathSearchResult(params: {
|
|
|
47
49
|
}): TextSearchToolResult;
|
|
48
50
|
/** Keep sandbox filesystem tools scoped to the mounted workspace root. */
|
|
49
51
|
export declare function resolveWorkspacePath(input: string | undefined, fallback?: string): string;
|
|
52
|
+
/** Anchor ripgrep paths and globs to the requested search root. */
|
|
53
|
+
export declare function getRipgrepSearchLocation(root: string, rootIsDirectory: boolean): {
|
|
54
|
+
cwd: string;
|
|
55
|
+
target: string;
|
|
56
|
+
};
|
|
50
57
|
/** Share bounded workspace traversal across search tools so their skip rules stay aligned. */
|
|
51
58
|
export declare function collectFiles(params: {
|
|
52
59
|
fs: SandboxFileSystem;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SandboxFileSystem, type TextSearchResultDetails, type TextSearchToolResult } from "@/chat/tools/sandbox/file-utils";
|
|
1
|
+
import { type SandboxCommandRunner, type SandboxFileSystem, type TextSearchResultDetails, type TextSearchToolResult } from "@/chat/tools/sandbox/file-utils";
|
|
2
2
|
import { type JuniorToolResultEnvelope } from "@/chat/tool-support/structured-result";
|
|
3
3
|
interface FindFilesSuccessResult {
|
|
4
4
|
content: JuniorToolResultEnvelope["content"];
|
|
@@ -19,6 +19,7 @@ export declare function findFiles(params: {
|
|
|
19
19
|
limit?: unknown;
|
|
20
20
|
path?: string;
|
|
21
21
|
pattern: string;
|
|
22
|
+
runCommand?: SandboxCommandRunner;
|
|
22
23
|
}): Promise<FindFilesResult>;
|
|
23
24
|
/** Create the sandbox file discovery tool definition exposed to the agent. */
|
|
24
25
|
export declare function createFindFilesTool(): Omit<import("../definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SandboxFileSystem, type TextSearchResultDetails, type TextSearchToolResult } from "@/chat/tools/sandbox/file-utils";
|
|
1
|
+
import { type SandboxCommandRunner, type SandboxFileSystem, type TextSearchResultDetails, type TextSearchToolResult } from "@/chat/tools/sandbox/file-utils";
|
|
2
2
|
interface GrepResultData {
|
|
3
3
|
context: number;
|
|
4
4
|
glob?: string;
|
|
@@ -33,6 +33,7 @@ export declare function grepFiles(params: {
|
|
|
33
33
|
literal?: boolean;
|
|
34
34
|
path?: string;
|
|
35
35
|
pattern: string;
|
|
36
|
+
runCommand?: SandboxCommandRunner;
|
|
36
37
|
}): Promise<GrepResult>;
|
|
37
38
|
/** Create the sandbox grep tool definition exposed to the agent. */
|
|
38
39
|
export declare function createGrepTool(): Omit<import("../definition").AnyToolDefinition, "inputSchema" | "outputSchema" | "prepareArguments" | "execute"> & {
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SANDBOX_WORKSPACE_ROOT,
|
|
3
3
|
getStateAdapter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-53ZKTQO6.js";
|
|
5
5
|
import {
|
|
6
6
|
sleep
|
|
7
7
|
} from "./chunk-4ZNGQH7C.js";
|
|
8
8
|
import {
|
|
9
9
|
toOptionalTrimmed
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PZGPCOSD.js";
|
|
11
11
|
import {
|
|
12
12
|
pluginCatalogRuntime
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-25GU5B5E.js";
|
|
14
14
|
import {
|
|
15
15
|
setSpanAttributes,
|
|
16
16
|
setSpanStatus,
|
|
17
17
|
withSpan
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3JOGUT46.js";
|
|
19
19
|
|
|
20
20
|
// src/chat/sandbox/runtime-dependencies.ts
|
|
21
21
|
var GLOBAL_RUNTIME_DEPENDENCIES = [
|
|
22
|
-
{ type: "system", package: "docker" }
|
|
22
|
+
{ type: "system", package: "docker" },
|
|
23
|
+
{ type: "system", package: "ripgrep" }
|
|
23
24
|
];
|
|
24
25
|
|
|
25
26
|
// src/chat/sandbox/runtime-dependency-snapshots.ts
|
|
@@ -344,6 +345,29 @@ function throwSandboxOperationError(action, error, includeMissingPath = false) {
|
|
|
344
345
|
}
|
|
345
346
|
|
|
346
347
|
// src/chat/sandbox/workspace.ts
|
|
348
|
+
function bindSandboxFileSystem(fs, signal) {
|
|
349
|
+
if (!signal) {
|
|
350
|
+
return fs;
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
readFile(filePath, options) {
|
|
354
|
+
signal.throwIfAborted();
|
|
355
|
+
return fs.readFile(filePath, { ...options, signal });
|
|
356
|
+
},
|
|
357
|
+
writeFile(filePath, content, options) {
|
|
358
|
+
signal.throwIfAborted();
|
|
359
|
+
return fs.writeFile(filePath, content, { ...options, signal });
|
|
360
|
+
},
|
|
361
|
+
readdir(filePath) {
|
|
362
|
+
signal.throwIfAborted();
|
|
363
|
+
return fs.readdir(filePath, { signal });
|
|
364
|
+
},
|
|
365
|
+
stat(filePath) {
|
|
366
|
+
signal.throwIfAborted();
|
|
367
|
+
return fs.stat(filePath, { signal });
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
}
|
|
347
371
|
function createSandboxSession(sandbox, options) {
|
|
348
372
|
const session = sandbox.currentSession();
|
|
349
373
|
const fileSystem = new FileSystem(session);
|
|
@@ -362,8 +386,8 @@ function createSandboxSession(sandbox, options) {
|
|
|
362
386
|
writeFile: async (filePath, content, writeOptions) => await run(
|
|
363
387
|
async () => await fileSystem.writeFile(filePath, content, writeOptions)
|
|
364
388
|
),
|
|
365
|
-
readdir: async (filePath) => await run(async () => await fileSystem.readdir(filePath)),
|
|
366
|
-
stat: async (filePath) => await run(async () => await fileSystem.stat(filePath))
|
|
389
|
+
readdir: async (filePath, readOptions) => await run(async () => await fileSystem.readdir(filePath, readOptions)),
|
|
390
|
+
stat: async (filePath, statOptions) => await run(async () => await fileSystem.stat(filePath, statOptions))
|
|
367
391
|
};
|
|
368
392
|
return {
|
|
369
393
|
sandboxId: sandbox.name,
|
|
@@ -977,6 +1001,7 @@ export {
|
|
|
977
1001
|
runNonInteractiveCommand,
|
|
978
1002
|
getSandboxResources,
|
|
979
1003
|
GLOBAL_RUNTIME_DEPENDENCIES,
|
|
1004
|
+
bindSandboxFileSystem,
|
|
980
1005
|
createSandboxSession,
|
|
981
1006
|
getRuntimeDependencyProfileHash,
|
|
982
1007
|
resolveRuntimeDependencySnapshot,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
toOptionalNumber,
|
|
3
3
|
toOptionalString
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OB42YVAE.js";
|
|
5
5
|
import {
|
|
6
6
|
captureException,
|
|
7
7
|
getActiveSpan,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./chunk-6GWA276C.js";
|
|
14
14
|
import {
|
|
15
15
|
getDeploymentTelemetryAttributes
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-N7TMYLF2.js";
|
|
17
17
|
|
|
18
18
|
// src/chat/logging.ts
|
|
19
19
|
import path from "path";
|
|
@@ -186,11 +186,7 @@ var CONSOLE_ALWAYS_HIDDEN_KEYS = /* @__PURE__ */ new Set([
|
|
|
186
186
|
"url.path",
|
|
187
187
|
"user_agent.original"
|
|
188
188
|
]);
|
|
189
|
-
var CONSOLE_DROP_WHEN_COUNTED_KEYS = /* @__PURE__ */ new Set([
|
|
190
|
-
"app.capability.names",
|
|
191
|
-
"app.capability.providers",
|
|
192
|
-
"app.config.keys"
|
|
193
|
-
]);
|
|
189
|
+
var CONSOLE_DROP_WHEN_COUNTED_KEYS = /* @__PURE__ */ new Set(["app.config.keys"]);
|
|
194
190
|
var CONSOLE_PREVIEW_KEYS = /* @__PURE__ */ new Set([
|
|
195
191
|
"gen_ai.input.messages",
|
|
196
192
|
"gen_ai.output.messages",
|
|
@@ -677,7 +673,7 @@ function booleanConsoleToken(label, value) {
|
|
|
677
673
|
return typeof value === "boolean" ? `${label}=${value ? "yes" : "no"}` : void 0;
|
|
678
674
|
}
|
|
679
675
|
function shouldShowPrettyCorrelation(eventName) {
|
|
680
|
-
return !(eventName === "plugin_loaded" || eventName === "startup_discovery_summary" || eventName
|
|
676
|
+
return !(eventName === "plugin_loaded" || eventName === "startup_discovery_summary" || eventName.endsWith("_loaded"));
|
|
681
677
|
}
|
|
682
678
|
function getPrettyConsoleSummaryTokens(level, eventName, attributes) {
|
|
683
679
|
const tokens = [];
|
|
@@ -689,10 +685,6 @@ function getPrettyConsoleSummaryTokens(level, eventName, attributes) {
|
|
|
689
685
|
tokens,
|
|
690
686
|
eventName.startsWith("plugin_heartbeat") ? stringConsoleToken("plugin", attributes["app.plugin.name"]) : toOptionalString(attributes["app.plugin.name"]) ?? void 0
|
|
691
687
|
);
|
|
692
|
-
pushPrettyConsoleToken(
|
|
693
|
-
tokens,
|
|
694
|
-
numericConsoleToken("caps", attributes["app.plugin.capability_count"])
|
|
695
|
-
);
|
|
696
688
|
pushPrettyConsoleToken(
|
|
697
689
|
tokens,
|
|
698
690
|
numericConsoleToken("config", attributes["app.plugin.config_key_count"])
|
|
@@ -713,10 +705,6 @@ function getPrettyConsoleSummaryTokens(level, eventName, attributes) {
|
|
|
713
705
|
tokens,
|
|
714
706
|
numericConsoleToken("skills", attributes["app.skill.count"])
|
|
715
707
|
);
|
|
716
|
-
pushPrettyConsoleToken(
|
|
717
|
-
tokens,
|
|
718
|
-
numericConsoleToken("capabilities", attributes["app.capability.count"])
|
|
719
|
-
);
|
|
720
708
|
pushPrettyConsoleToken(
|
|
721
709
|
tokens,
|
|
722
710
|
numericConsoleToken("config", attributes["app.config.key_count"])
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getClient
|
|
3
|
+
} from "./chunk-6GWA276C.js";
|
|
4
|
+
|
|
5
|
+
// src/chat/sentry-links.ts
|
|
6
|
+
function getSentryOrgSlug() {
|
|
7
|
+
const slug = process.env.SENTRY_ORG_SLUG?.trim();
|
|
8
|
+
return slug || void 0;
|
|
9
|
+
}
|
|
10
|
+
function isSentrySaasDsnHost(host) {
|
|
11
|
+
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
12
|
+
}
|
|
13
|
+
function buildSentryWebBaseUrl(dsn) {
|
|
14
|
+
if (isSentrySaasDsnHost(dsn.host)) {
|
|
15
|
+
return "https://sentry.io";
|
|
16
|
+
}
|
|
17
|
+
const port = dsn.port ? `:${dsn.port}` : "";
|
|
18
|
+
const path = dsn.path ? `/${dsn.path}` : "";
|
|
19
|
+
return `${dsn.protocol}://${dsn.host}${port}${path}`;
|
|
20
|
+
}
|
|
21
|
+
function buildSentryConversationUrl(conversationId) {
|
|
22
|
+
const client = getClient();
|
|
23
|
+
const dsn = client?.getDsn();
|
|
24
|
+
if (!dsn?.host || !dsn.projectId) {
|
|
25
|
+
return void 0;
|
|
26
|
+
}
|
|
27
|
+
const orgSlug = getSentryOrgSlug();
|
|
28
|
+
if (!orgSlug) {
|
|
29
|
+
return void 0;
|
|
30
|
+
}
|
|
31
|
+
const encodedId = encodeURIComponent(conversationId);
|
|
32
|
+
const params = new URLSearchParams();
|
|
33
|
+
params.set("project", dsn.projectId);
|
|
34
|
+
const path = `explore/conversations/${encodedId}/?${params.toString()}`;
|
|
35
|
+
if (isSentrySaasDsnHost(dsn.host)) {
|
|
36
|
+
return `https://${orgSlug}.sentry.io/${path}`;
|
|
37
|
+
}
|
|
38
|
+
return `${buildSentryWebBaseUrl(dsn)}/organizations/${orgSlug}/${path}`;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export {
|
|
42
|
+
buildSentryConversationUrl
|
|
43
|
+
};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
healthReportSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-PE44LDDQ.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeSlackConversationId
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CI3VK7X5.js";
|
|
7
7
|
import {
|
|
8
8
|
parseSlackThreadId
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import {
|
|
11
|
-
getClient
|
|
12
|
-
} from "./chunk-6GWA276C.js";
|
|
9
|
+
} from "./chunk-FXOYURO4.js";
|
|
13
10
|
|
|
14
11
|
// src/handlers/health.ts
|
|
15
12
|
function readHealthReport() {
|
|
@@ -23,42 +20,6 @@ function GET() {
|
|
|
23
20
|
return Response.json(readHealthReport());
|
|
24
21
|
}
|
|
25
22
|
|
|
26
|
-
// src/chat/sentry-links.ts
|
|
27
|
-
function getSentryOrgSlug() {
|
|
28
|
-
const slug = process.env.SENTRY_ORG_SLUG?.trim();
|
|
29
|
-
return slug || void 0;
|
|
30
|
-
}
|
|
31
|
-
function isSentrySaasDsnHost(host) {
|
|
32
|
-
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
33
|
-
}
|
|
34
|
-
function buildSentryWebBaseUrl(dsn) {
|
|
35
|
-
if (isSentrySaasDsnHost(dsn.host)) {
|
|
36
|
-
return "https://sentry.io";
|
|
37
|
-
}
|
|
38
|
-
const port = dsn.port ? `:${dsn.port}` : "";
|
|
39
|
-
const path = dsn.path ? `/${dsn.path}` : "";
|
|
40
|
-
return `${dsn.protocol}://${dsn.host}${port}${path}`;
|
|
41
|
-
}
|
|
42
|
-
function buildSentryConversationUrl(conversationId) {
|
|
43
|
-
const client = getClient();
|
|
44
|
-
const dsn = client?.getDsn();
|
|
45
|
-
if (!dsn?.host || !dsn.projectId) {
|
|
46
|
-
return void 0;
|
|
47
|
-
}
|
|
48
|
-
const orgSlug = getSentryOrgSlug();
|
|
49
|
-
if (!orgSlug) {
|
|
50
|
-
return void 0;
|
|
51
|
-
}
|
|
52
|
-
const encodedId = encodeURIComponent(conversationId);
|
|
53
|
-
const params = new URLSearchParams();
|
|
54
|
-
params.set("project", dsn.projectId);
|
|
55
|
-
const path = `explore/conversations/${encodedId}/?${params.toString()}`;
|
|
56
|
-
if (isSentrySaasDsnHost(dsn.host)) {
|
|
57
|
-
return `https://${orgSlug}.sentry.io/${path}`;
|
|
58
|
-
}
|
|
59
|
-
return `${buildSentryWebBaseUrl(dsn)}/organizations/${orgSlug}/${path}`;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
23
|
// src/chat/slack/conversation-context.ts
|
|
63
24
|
function normalizeConversationName(type, channelName) {
|
|
64
25
|
const trimmed = channelName?.trim();
|
|
@@ -144,7 +105,6 @@ function formatSlackConversationRedactedLabel(context) {
|
|
|
144
105
|
export {
|
|
145
106
|
readHealthReport,
|
|
146
107
|
GET,
|
|
147
|
-
buildSentryConversationUrl,
|
|
148
108
|
conversationVisibilityFromSlackChannelType,
|
|
149
109
|
resolveSlackChannelTypeFromMessage,
|
|
150
110
|
resolveSlackConversationContext,
|