@sentry/junior 0.181.1 → 0.183.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-KO56HJ74.js → agent-hooks-SNRBZYAU.js} +11 -11
- package/dist/api/code/overview.d.ts +35 -0
- package/dist/api/code/routes.d.ts +4 -0
- package/dist/api/schema/code.d.ts +75 -0
- package/dist/api/schema.d.ts +2 -0
- package/dist/api/schema.js +9 -1
- package/dist/api.js +347 -149
- package/dist/app-adapter.d.ts +85 -0
- package/dist/app.d.ts +6 -1
- package/dist/app.js +380 -501
- package/dist/{catalog-runtime-CJTFLCK3.js → catalog-runtime-3I3JOIIH.js} +4 -4
- package/dist/chat/agent-invocations/store.d.ts +4 -2
- package/dist/chat/agent-invocations/work.d.ts +1 -3
- package/dist/chat/api-turns/adapter-conversations.d.ts +15 -0
- package/dist/chat/api-turns/stop.d.ts +12 -0
- package/dist/chat/api-turns/work.d.ts +9 -1
- package/dist/chat/app/conversation-work.d.ts +1 -1
- package/dist/chat/app/factory.d.ts +3 -3
- package/dist/chat/app/services.d.ts +3 -3
- package/dist/chat/code/publisher.d.ts +3 -0
- package/dist/chat/code/store.d.ts +9 -0
- package/dist/chat/event-tasks/store.d.ts +10 -0
- package/dist/chat/event-tasks/tool-support.d.ts +7 -1
- package/dist/chat/event-tasks/types.d.ts +1 -0
- package/dist/chat/experimental.d.ts +1 -1
- package/dist/chat/ingress/slack-webhook.d.ts +1 -1
- package/dist/chat/plugins/agent-hooks.d.ts +5 -0
- package/dist/chat/{runtime/slack-runtime.d.ts → providers/slack/runtime.d.ts} +2 -2
- package/dist/chat/{runtime/reply-executor.d.ts → providers/slack/turn.d.ts} +10 -9
- package/dist/chat/resource-events/catalog.d.ts +11 -1
- package/dist/chat/resource-events/store.d.ts +17 -1
- package/dist/chat/runtime/turn-execution.d.ts +30 -0
- package/dist/chat/services/subscribed-decision.d.ts +2 -1
- package/dist/chat/slack/dispatch-turn.d.ts +12 -14
- package/dist/chat/task-execution/slack-work.d.ts +1 -1
- package/dist/chat/tools/create-event-task.d.ts +3 -0
- package/dist/chat/tools/delete-event-task.d.ts +2 -0
- package/dist/chat/tools/list-event-tasks.d.ts +2 -0
- package/dist/chat/tools/list-resource-event-subscriptions.d.ts +2 -0
- package/dist/chat/tools/search-resource-event-types.d.ts +10 -0
- package/dist/chat/tools/update-event-task.d.ts +3 -0
- package/dist/chat/tools/watch-resource-events.d.ts +3 -0
- package/dist/{chunk-DTRCZOHE.js → chunk-24OJZ5OU.js} +6 -6
- package/dist/{chunk-Z2UG4FBT.js → chunk-2ADFGSUS.js} +1 -1
- package/dist/{chunk-RULGB5NX.js → chunk-2EPYYVJC.js} +9 -9
- package/dist/{chunk-VRS6WDK5.js → chunk-2LYHWMR4.js} +1 -1
- package/dist/{chunk-XQ56HNH5.js → chunk-35PM4YY5.js} +6 -6
- package/dist/{chunk-6TB7JN63.js → chunk-37IQ6DGU.js} +3 -3
- package/dist/{chunk-MR36BRPE.js → chunk-3HJ4F4L7.js} +4 -4
- package/dist/{chunk-4WYHL4EH.js → chunk-3L7CWDQQ.js} +1 -1
- package/dist/{chunk-CJRUBOJI.js → chunk-4WGFWHWP.js} +1 -1
- package/dist/{chunk-VHSBLFNT.js → chunk-56XONJPF.js} +1 -1
- package/dist/{chunk-ULM7P4EQ.js → chunk-6UXDTPEN.js} +233 -173
- package/dist/{chunk-WDNA4LML.js → chunk-AHMWPFIW.js} +188 -11
- package/dist/{chunk-YCW6RZGX.js → chunk-AX3UDIMA.js} +3 -3
- package/dist/{chunk-HG6HNOTQ.js → chunk-AYW7J6K4.js} +130 -200
- package/dist/{chunk-DXK3VTVP.js → chunk-E3OBGRHN.js} +1 -1
- package/dist/{chunk-7UF37LNL.js → chunk-EENQGEIP.js} +1 -1
- package/dist/{chunk-HRTW7FFX.js → chunk-FJMTMGBC.js} +1 -1
- package/dist/{chunk-H6MPFFBE.js → chunk-G2B2XZQW.js} +1 -1
- package/dist/{chunk-4GOZBB22.js → chunk-HUK5XIZL.js} +63 -7
- package/dist/{chunk-DINF4LMR.js → chunk-IO6KFXYE.js} +160 -97
- package/dist/{chunk-KH2SL2HT.js → chunk-KTXOGLNE.js} +2 -2
- package/dist/{chunk-S63LNPIV.js → chunk-LMNMMESF.js} +2 -2
- package/dist/{chunk-2CZ63QCL.js → chunk-LZBPGX5A.js} +1 -1
- package/dist/{chunk-PJ7EGFME.js → chunk-PLZT45VC.js} +5 -5
- package/dist/{chunk-ZQQWJMHE.js → chunk-QI5JW5AG.js} +6 -6
- package/dist/{chunk-IWRPJ3J5.js → chunk-QZV76CM4.js} +58 -32
- package/dist/{chunk-YFJDRORU.js → chunk-R767Y7QV.js} +202 -90
- package/dist/{chunk-4OSVTPYQ.js → chunk-SQHFVIMZ.js} +1 -1
- package/dist/{chunk-J4ID4ZI6.js → chunk-T5MTGX2E.js} +19 -19
- package/dist/{chunk-NRF23QZ4.js → chunk-V64JCZUV.js} +3 -3
- package/dist/{chunk-GITIZ6TZ.js → chunk-VOV3SCM3.js} +1 -1
- package/dist/{chunk-S5X2VQOD.js → chunk-W46NIB5H.js} +3 -2
- package/dist/{chunk-XL3C4NAR.js → chunk-W5JMPEBO.js} +9 -9
- package/dist/{chunk-HPFHC7YR.js → chunk-WOKJRLM2.js} +5 -5
- package/dist/chunk-WVIA7V3M.js +975 -0
- package/dist/{chunk-QA6RE6IB.js → chunk-X52ESOBP.js} +3 -3
- package/dist/cli/chat.js +35 -37
- package/dist/cli/check.js +5 -5
- package/dist/cli/plugins.js +12 -12
- package/dist/cli/snapshot-create.js +9 -9
- package/dist/cli/upgrade.js +6 -6
- package/dist/db/schema/code.d.ts +367 -0
- package/dist/db/schema.d.ts +367 -1
- package/dist/{db-4PXTD3OH.js → db-K2VMNLHQ.js} +6 -6
- package/dist/{experimental-SIJSRDJD.js → experimental-P5FZM4CU.js} +1 -1
- package/dist/instrumentation.js +3 -3
- package/dist/nitro.js +6 -6
- package/dist/{oauth-callback-server-TQWNEVR6.js → oauth-callback-server-DZZMTKSS.js} +26 -26
- package/dist/{runner-G5HLQA43.js → runner-IIAKWDXI.js} +18 -18
- package/dist/{skills-BNNNRYNT.js → skills-EXIQ7BP5.js} +5 -5
- package/dist/spawn-ZR6OOEAN.js +37 -0
- package/dist/task-runner-C52HYCVD.js +32 -0
- package/dist/{validation-IJSBB6JR.js → validation-XUGIWBJF.js} +5 -5
- package/dist/version.js +1 -1
- package/dist/{work-5FQI4P2A.js → work-G4RLJ634.js} +18 -18
- package/dist/worker-R2JEHK67.js +22 -0
- package/migrations/0036_complex_rage.sql +32 -0
- package/migrations/meta/0036_snapshot.json +3186 -0
- package/migrations/meta/_journal.json +8 -1
- package/package.json +6 -5
- package/dist/api/acp/route.d.ts +0 -13
- package/dist/chunk-CZYNWPWD.js +0 -930
- package/dist/spawn-U2RKOFP2.js +0 -37
- package/dist/task-runner-CDZJBEXP.js +0 -32
- package/dist/worker-KJ362GVB.js +0 -22
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import type { StateAdapter } from "chat";
|
|
2
|
+
import type { PluginRoute, PluginRouteMethod, User } from "@sentry/junior-plugin-api";
|
|
3
|
+
/** Shared state operations available to app adapters. */
|
|
4
|
+
export type JuniorAdapterState = Pick<StateAdapter, "acquireLock" | "appendToList" | "delete" | "extendLock" | "get" | "getList" | "releaseLock" | "set">;
|
|
5
|
+
/** One text Message exposed to an app adapter. */
|
|
6
|
+
export interface AdapterMessage {
|
|
7
|
+
id: string;
|
|
8
|
+
role: "assistant" | "user";
|
|
9
|
+
text: string;
|
|
10
|
+
}
|
|
11
|
+
/** Result of admitting one retry-safe prompt to a Conversation. */
|
|
12
|
+
export type AdapterPromptAdmission = {
|
|
13
|
+
afterCursor: number;
|
|
14
|
+
messageId: string;
|
|
15
|
+
status: "accepted";
|
|
16
|
+
turnId: string;
|
|
17
|
+
} | {
|
|
18
|
+
status: "active";
|
|
19
|
+
} | {
|
|
20
|
+
status: "not_found";
|
|
21
|
+
};
|
|
22
|
+
/** Terminal state for one correlated Conversation Turn. */
|
|
23
|
+
export type AdapterTurnTerminal = {
|
|
24
|
+
outcome: "cancelled" | "completed";
|
|
25
|
+
status: "completed";
|
|
26
|
+
} | {
|
|
27
|
+
failureCode: string;
|
|
28
|
+
status: "failed";
|
|
29
|
+
};
|
|
30
|
+
/** One ordered page of Messages and optional terminal Turn state. */
|
|
31
|
+
export interface AdapterTurnPage {
|
|
32
|
+
cursor: number;
|
|
33
|
+
messages: AdapterMessage[];
|
|
34
|
+
terminal?: AdapterTurnTerminal;
|
|
35
|
+
}
|
|
36
|
+
/** Conversation operations available to app adapters. */
|
|
37
|
+
export interface AdapterConversations {
|
|
38
|
+
cancel(args: {
|
|
39
|
+
conversationId: string;
|
|
40
|
+
user: User;
|
|
41
|
+
}): Promise<"cancelled" | "not_found">;
|
|
42
|
+
create(args: {
|
|
43
|
+
conversationId: string;
|
|
44
|
+
user: User;
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
hasAccess(args: {
|
|
47
|
+
conversationId: string;
|
|
48
|
+
user: User;
|
|
49
|
+
}): Promise<boolean>;
|
|
50
|
+
prompt(args: {
|
|
51
|
+
conversationId: string;
|
|
52
|
+
idempotencyKey: string;
|
|
53
|
+
text: string;
|
|
54
|
+
user: User;
|
|
55
|
+
}): Promise<AdapterPromptAdmission>;
|
|
56
|
+
readMessages(conversationId: string): Promise<AdapterMessage[]>;
|
|
57
|
+
readTurn(args: {
|
|
58
|
+
afterCursor: number;
|
|
59
|
+
conversationId: string;
|
|
60
|
+
messageId: string;
|
|
61
|
+
turnId: string;
|
|
62
|
+
}): Promise<AdapterTurnPage>;
|
|
63
|
+
}
|
|
64
|
+
/** One dashboard-authenticated HTTP route owned by an app adapter. */
|
|
65
|
+
export interface JuniorAuthenticatedRoute {
|
|
66
|
+
handler(request: Request, user: User): Promise<Response> | Response;
|
|
67
|
+
method?: PluginRouteMethod | readonly PluginRouteMethod[];
|
|
68
|
+
path: string;
|
|
69
|
+
}
|
|
70
|
+
/** Capabilities supplied once when Junior configures an app adapter. */
|
|
71
|
+
export interface JuniorAppAdapterContext {
|
|
72
|
+
agentName: string;
|
|
73
|
+
baseURL?: string;
|
|
74
|
+
conversations: AdapterConversations;
|
|
75
|
+
reportError(error: unknown, event: string, attributes?: Record<string, unknown>): void;
|
|
76
|
+
state: JuniorAdapterState;
|
|
77
|
+
version: string;
|
|
78
|
+
}
|
|
79
|
+
/** HTTP routes returned by one configured app adapter. */
|
|
80
|
+
export interface JuniorAppAdapterRoutes {
|
|
81
|
+
authenticatedRoutes?: readonly JuniorAuthenticatedRoute[];
|
|
82
|
+
routes?: readonly PluginRoute[];
|
|
83
|
+
}
|
|
84
|
+
/** Configure one non-plugin app adapter against Junior's runtime capabilities. */
|
|
85
|
+
export type JuniorAppAdapter = (context: JuniorAppAdapterContext) => JuniorAppAdapterRoutes | Promise<JuniorAppAdapterRoutes>;
|
package/dist/app.d.ts
CHANGED
|
@@ -4,10 +4,15 @@ import { type SandboxResourceConfig } from "@/chat/sandbox/resources";
|
|
|
4
4
|
import { type JuniorPluginSet } from "./plugins";
|
|
5
5
|
import type { ConversationWorkCallbackOptions } from "@/chat/app/conversation-work";
|
|
6
6
|
import type { WaitUntilFn } from "@/handlers/types";
|
|
7
|
+
import type { JuniorAppAdapter } from "./app-adapter";
|
|
8
|
+
import { JUNIOR_VERSION } from "./version";
|
|
7
9
|
export { defineJuniorPlugins } from "./plugins";
|
|
8
|
-
export { JUNIOR_VERSION }
|
|
10
|
+
export { JUNIOR_VERSION };
|
|
9
11
|
export type { JuniorPluginInput, JuniorPluginSet, JuniorPluginSetOptions, } from "./plugins";
|
|
12
|
+
export type { AdapterConversations, AdapterMessage, AdapterPromptAdmission, AdapterTurnPage, AdapterTurnTerminal, JuniorAdapterState, JuniorAppAdapter, JuniorAppAdapterContext, JuniorAppAdapterRoutes, JuniorAuthenticatedRoute, } from "./app-adapter";
|
|
10
13
|
export interface JuniorAppOptions {
|
|
14
|
+
/** Non-plugin adapters mounted against Junior's shared runtime. */
|
|
15
|
+
adapters?: readonly JuniorAppAdapter[];
|
|
11
16
|
/** Authenticated dashboard mounted by core when configured. */
|
|
12
17
|
dashboard?: JuniorDashboardOptions;
|
|
13
18
|
/**
|