@sentry/junior 0.313.0 → 0.314.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/{adapter-CYAvJzZS.js → adapter-JARQvoLw.js} +1 -2
- package/dist/{adapter-context-CVsHoVSf.js → adapter-context-B4BrJZuS.js} +2 -2
- package/dist/{admin-Cyhb4TwZ.js → admin-BXGAySz0.js} +1 -1
- package/dist/{agent-runner-B5y9MsT-.js → agent-runner-qZU5TR8i.js} +797 -118
- package/dist/agent-update-cS7Z9mnG.js +26 -0
- package/dist/agent-update-delivery-CZ5M8RDa.js +85 -0
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +1 -1
- package/dist/api.js +334 -100
- package/dist/{app-DA8-hCMj.d.ts → app-D7tKnw9a.d.ts} +4 -21
- package/dist/app.d.ts +2 -2
- package/dist/app.js +80 -169
- package/dist/{background-compaction-queue-iZXadLV3.js → background-compaction-queue-C_uIBUvS.js} +6 -67
- package/dist/callback-C8SdXCwr.js +68 -0
- package/dist/{catalog-runtime-kkE3hvCX.js → catalog-runtime-BLKtnUL3.js} +1 -1
- package/dist/{channel-access-mt7K6dPh.js → channel-access-BOL29BG3.js} +6 -6
- package/dist/child-message--2G3Ft26.js +19 -0
- package/dist/cli/chat.js +18 -21
- package/dist/cli/check.js +4 -4
- package/dist/cli/main.js +2 -2
- package/dist/cli/plugins.js +5 -5
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +23 -4
- package/dist/{config-CWbwKj0j.js → config-BIfHKNXN.js} +40 -35
- package/dist/{continue-in-slack-CxyFzdlF.js → continue-in-slack-fnmD2Ifb.js} +5 -7
- package/dist/{conversation-feed-BEXLD3Me.js → conversation-feed-DdFQuQDR.js} +1 -1
- package/dist/{logging-DNt-qOIO.js → conversation-privacy-DtZhI91r.js} +188 -2
- package/dist/{conversation-turn-B35eu0uz.js → conversation-turn-DScuDYmN.js} +418 -33
- package/dist/create-CrNt4Ewu.js +212 -0
- package/dist/{credential-sync-DWTOEQrm.js → credential-sync-CtqsGjj1.js} +14 -17
- package/dist/{credentialed-Dyv8b-lu.js → credentialed-dWRA3-oJ.js} +910 -426
- package/dist/{db-PwSRzWWn.js → db-BTmLKZrp.js} +2235 -38
- package/dist/{db-DYGcXYl3.d.ts → db-DcmzbA55.d.ts} +2 -2
- package/dist/{history-CYstOMKX.js → history-CneKY7_V.js} +19 -1
- package/dist/{html-DidUcRhI.js → html-B8rBt7F4.js} +5 -7
- package/dist/{install-2urLLXNt.js → install-OtFboxOM.js} +2 -2
- package/dist/instrumentation.js +2 -2
- package/dist/{lineage-BXplQAVH.js → lineage-EULJkGO1.js} +1 -2
- package/dist/{list-DyIyReSV.js → list-C5400AlJ.js} +235 -77
- package/dist/{turn-membership-DTR3SaKD.js → mailbox-turn-DL3Lvsm0.js} +4698 -587
- package/dist/markers-DUP8aBOp.js +323 -0
- package/dist/{media-B0pZJ0bG.js → media-FYM-Bl3H.js} +33 -8
- package/dist/{message-Z5YKC-Af.js → message-DuDelZFr.js} +16 -29
- package/dist/{model-input-BhPJYdSV.js → model-input-0osF3pBS.js} +3 -3
- package/dist/nitro.d.ts +2 -4
- package/dist/nitro.js +340 -13
- package/dist/{oauth-callback-server-ByvDdcdY.js → oauth-callback-server-DX2fQ7Nq.js} +2 -2
- package/dist/{oauth-relay-D-kK0yoN.js → oauth-relay-PwPMdZJv.js} +1 -1
- package/dist/{plugins-Bkk0XRo2.js → plugins-BXMdNdyA.js} +1 -1
- package/dist/{registry-POH4bZC4.js → registry-D6kS6xYH.js} +1402 -64
- package/dist/{resolve-CWtBNSKP.js → resolve-D8CPJcNK.js} +3 -3
- package/dist/result-D090hxr5.js +402 -0
- package/dist/{runner-CsZ_VRxp.js → runner-BU7fgrm-.js} +7 -8
- package/dist/{sandbox-egress-signals-FbCk1FkN.js → sandbox-egress-signals-BUmVrsoG.js} +1 -1
- package/dist/{schema-DojR2uCL.js → schema-7gW9vBpJ.js} +90 -9
- package/dist/{schema-DBf18QPS.d.ts → schema-BB6E0wyV.d.ts} +138 -5
- package/dist/{service-account-CDYb9hfX.js → service-account-plA-uzIB.js} +6 -5
- package/dist/{skills-B0jP4whm.js → skills-CIosT6bS.js} +3 -3
- package/dist/{slack-conversation-unfurl-D26t9kBC.js → slack-conversation-unfurl-CBgZqth6.js} +8 -10
- package/dist/{spawn-BjljgExZ.js → spawn-DRjdzh3R.js} +9 -17
- package/dist/{start-conversation-DbVujrwO.js → start-conversation-a4NXH4X9.js} +12 -15
- package/dist/{store-CjXrp-Up.js → store-BuhF1QDm.js} +2 -4
- package/dist/{task-queue-Cwlatjz3.js → task-queue-CrRjFzOh.js} +5 -16
- package/dist/{task-runner--Ke8KSMf.js → task-runner-C-pXsgHM.js} +104 -50
- package/dist/{thread-context-B8exINEe.js → thread-context-CDX4dSZd.js} +8 -9
- package/dist/turn-session-routing-CZTRU8IY.js +116 -0
- package/dist/turn-wake-Bzq1Efrm.js +154 -0
- package/dist/user-customization-B27StpVQ.js +9 -0
- package/dist/{validation-Ce0qbMlT.js → validation-bTq88sya.js} +1 -1
- package/dist/{vercel-queue-q4z8w5QO.js → vercel-queue-nL0Hq3hr.js} +32 -147
- package/dist/{version-DFh4n9nr.js → version-DGUa1dZK.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{warmup-D5hzqTcp.js → warmup-CCOuIwAS.js} +639 -137
- package/dist/{worker-CDg9Lbpg.js → worker-AkZg7Dg1.js} +5 -6
- package/migrations/0160_money_micro_usd_repair.sql +99 -0
- package/migrations/0161_agent_config_backfill.sql +34 -0
- package/migrations/0162_inbox_item_deliveries.sql +15 -0
- package/migrations/0163_pg_trgm.sql +2 -0
- package/migrations/0164_search_indexes.sql +4 -0
- package/migrations/0165_drop_legacy_archive_columns.sql +4 -0
- package/migrations/0166_memory_prefix_index.sql +1 -0
- package/migrations/0167_todo_search_indexes.sql +2 -0
- package/migrations/0168_todo_inbox_items.sql +4 -0
- package/migrations/0169_drop_code_urls.sql +2 -0
- package/migrations/meta/0160_snapshot.json +6515 -0
- package/migrations/meta/0161_snapshot.json +6278 -0
- package/migrations/meta/0162_snapshot.json +6404 -0
- package/migrations/meta/0163_snapshot.json +6404 -0
- package/migrations/meta/0164_snapshot.json +6466 -0
- package/migrations/meta/0165_snapshot.json +6466 -0
- package/migrations/meta/0166_snapshot.json +6494 -0
- package/migrations/meta/0167_snapshot.json +6525 -0
- package/migrations/meta/0168_snapshot.json +6525 -0
- package/migrations/meta/0169_snapshot.json +6513 -0
- package/migrations/meta/_journal.json +70 -0
- package/package.json +9 -18
- package/skills/design-automation-skill/SKILL.md +2 -3
- package/dist/actor-BsBdxDXQ.js +0 -208
- package/dist/conversation-privacy-BrMiDN61.js +0 -189
- package/dist/executor-CgWyWfYz.js +0 -1858
- package/dist/fan-out-Cod-yEHG.js +0 -10
- package/dist/ingest-B0AggUEC.js +0 -7931
- package/dist/request-deadline-BUiRYQYj.js +0 -24
- package/dist/service-account-o15pZWcJ.js +0 -931
- package/dist/state-BTawTCme.js +0 -161
- package/dist/statuses-BKwqCPhj.js +0 -69
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-
|
|
2
|
-
import {
|
|
3
|
-
import { i as getStateAdapter } from "./adapter-
|
|
1
|
+
import { i as trace, n as postinstall, o as getSandboxResources, t as dependencies } from "./install-OtFboxOM.js";
|
|
2
|
+
import { an as create, is as sleep, ln as getSandboxProvider, sn as isStale } from "./credentialed-dWRA3-oJ.js";
|
|
3
|
+
import { i as getStateAdapter } from "./adapter-JARQvoLw.js";
|
|
4
4
|
import * as z from "zod";
|
|
5
5
|
// src/chat/sandbox/snapshot/resolve.ts
|
|
6
6
|
const SNAPSHOT_CACHE_PREFIX = "junior:sandbox_snapshot_profile:v2";
|
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
|
+
import { W as turnBehavior, dn as SYSTEM_IDENTITY_ID, i as getConversationStore, o as getSqlExecutor } from "./db-BTmLKZrp.js";
|
|
3
|
+
import { Bt as getConversationWorkState, G as enqueueAutomatedInput, K as getConversationStoppedAtMs, On as buildDeterministicTurnId, Or as EVENT_SYSTEM_ACTOR, T as getTurnReplyKey, a as resolveMailboxTurnWork, b as readAgentConfig, bi as readParentMessage, fn as closeOpenTodosOfChild, g as parentMessageText, h as logDroppedParentMessage, hi as readInboundMessageSender, i as listActiveMailboxTurns, k as EVENT_WAIT_MS, x as getAgentReplyMessageId } from "./mailbox-turn-DL3Lvsm0.js";
|
|
4
|
+
import { Fo as listWatches } from "./credentialed-dWRA3-oJ.js";
|
|
5
|
+
import { _ as isDroppedChildInput, c as listUnreportedSiblingAgents, g as getChildAgentInputSender, h as childAgentInput, r as hasWaitingParentWork, s as listOpenChildAgents, t as recordChildAgentEnded, v as readChildConversationSender } from "./markers-DUP8aBOp.js";
|
|
6
|
+
import { n as listChildMessages, t as childMessageSenderMetadata } from "./child-message--2G3Ft26.js";
|
|
7
|
+
import { gt as mapBounded, nt as renderDataTag } from "./config-BIfHKNXN.js";
|
|
8
|
+
import { an as AGENT_UPDATE_EVENT_TYPE, in as AGENT_MESSAGE_EVENT_TYPE, rn as AGENT_INVOCATION_EVENT_NAMESPACE } from "./media-FYM-Bl3H.js";
|
|
9
|
+
import { t as renderAgentResult } from "./agent-update-cS7Z9mnG.js";
|
|
10
|
+
import * as z from "zod";
|
|
11
|
+
import { actorSchema } from "@sentry/junior-plugin-api";
|
|
12
|
+
// src/chat/agent-invocations/store.ts
|
|
13
|
+
/**
|
|
14
|
+
* Read the name, agent type, fork flag, and title of one child Conversation,
|
|
15
|
+
* for labels, from its binding, title, and agent config.
|
|
16
|
+
*/
|
|
17
|
+
async function getChildAgentLabel(childConversationId) {
|
|
18
|
+
const [sender, options] = await Promise.all([readChildConversationSender(childConversationId), readAgentConfig(childConversationId)]);
|
|
19
|
+
return sender && options ? {
|
|
20
|
+
agentName: sender.agentName ?? null,
|
|
21
|
+
agentType: options.agentType ?? null,
|
|
22
|
+
fork: options.fork ?? false,
|
|
23
|
+
title: sender.title ?? null
|
|
24
|
+
} : void 0;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Return whether a child agent still works when its Turn sends a `reply`:
|
|
28
|
+
* one of its own child agents has open work, or a reply or message from one
|
|
29
|
+
* of them waits in its mailbox. That reply then goes to the parent as a
|
|
30
|
+
* message, not as the child's result.
|
|
31
|
+
*/
|
|
32
|
+
async function childAgentStillWorks(conversationId) {
|
|
33
|
+
if ((await listOpenChildAgents(conversationId)).length > 0) return true;
|
|
34
|
+
return ((await getConversationWorkState({ conversationId }))?.messages ?? []).some((message) => readInboundMessageSender(message) !== void 0);
|
|
35
|
+
}
|
|
36
|
+
// src/chat/agent-invocations/parent-result.ts
|
|
37
|
+
/**
|
|
38
|
+
* Return the Actor that a child Turn's result carries to its parent, whose
|
|
39
|
+
* Turn for it runs as that Actor. Only a Turn that agent work started, a
|
|
40
|
+
* parent message or an Event such as a child result, keeps its Actor. Any
|
|
41
|
+
* other Turn, such as a person's Turn in a Thread or a saved Turn with no
|
|
42
|
+
* Source, reports as the Event system Actor, so the parent never gets a
|
|
43
|
+
* person's access.
|
|
44
|
+
*/
|
|
45
|
+
function parentResultActor(actor, source) {
|
|
46
|
+
return source === "parent_message" || source === "event" ? actor : EVENT_SYSTEM_ACTOR;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Return whether a child's work ended with its Turn `turnId`, which ended
|
|
50
|
+
* with no answer: none of its own child agents still works, it has no active
|
|
51
|
+
* Watch or Timer, no input waits to run a later Turn that answers, and the
|
|
52
|
+
* Turn sent its parent nothing. A Turn can send its `reply` and then lose
|
|
53
|
+
* its worker, so its retry already reported.
|
|
54
|
+
*/
|
|
55
|
+
async function childWorkEnded(conversationId, turnId) {
|
|
56
|
+
const [stillWorks, watches, waiting, sender] = await Promise.all([
|
|
57
|
+
childAgentStillWorks(conversationId),
|
|
58
|
+
listWatches({ conversationId }),
|
|
59
|
+
hasWaitingParentWork(conversationId),
|
|
60
|
+
readChildConversationSender(conversationId)
|
|
61
|
+
]);
|
|
62
|
+
if (stillWorks || watches.length > 0 || waiting || !sender) return false;
|
|
63
|
+
const parent = await getConversationWorkState({ conversationId: sender.parentConversationId });
|
|
64
|
+
return !listChildMessages(parent?.execution.inboundMessageIds ?? [], parent?.execution.messageSenders ?? {}).some((message) => message.sender.conversationId === conversationId && message.sender.turnId === turnId);
|
|
65
|
+
}
|
|
66
|
+
// src/chat/agent-invocations/result-actors.ts
|
|
67
|
+
const senderActorMetadataSchema = z.object({ actor: actorSchema });
|
|
68
|
+
/**
|
|
69
|
+
* Return the Inbound message author id for results sent by one Actor.
|
|
70
|
+
* `selectContiguousTurnBatch` in `task-execution/worker.ts` puts messages in
|
|
71
|
+
* one attempt only when their author ids and sources match. Mid-Turn drains
|
|
72
|
+
* take only `interrupt` messages, and results are `defer`. So results never
|
|
73
|
+
* share a Turn and its credentials with another Actor or with watch Events.
|
|
74
|
+
* Keep this id unique per Actor if either rule changes.
|
|
75
|
+
*/
|
|
76
|
+
function resultAuthorId(actor) {
|
|
77
|
+
switch (actor.platform) {
|
|
78
|
+
case "system": return `agent-invocation:system:${actor.name}`;
|
|
79
|
+
case "slack": return `agent-invocation:slack:${actor.teamId}:${actor.userId}`;
|
|
80
|
+
default: return `agent-invocation:${actor.platform}:${actor.userId}`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/** Read the Actor of the child Turn that a reply or message carries. */
|
|
84
|
+
function senderActorFromMetadata(metadata) {
|
|
85
|
+
const parsed = senderActorMetadataSchema.safeParse(metadata);
|
|
86
|
+
return parsed.success ? parsed.data.actor : void 0;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Run each child reply or message as the Actor of the child Turn that sent
|
|
90
|
+
* it, which the input carries, so the parent never gets more authority than
|
|
91
|
+
* that Turn. A parent message from the stored parent runs as the Actor of the
|
|
92
|
+
* parent's Turn, with its grants and text. Input that a Turn with another
|
|
93
|
+
* Actor sent, or that names no child of this Conversation, runs as the Event
|
|
94
|
+
* system Actor. Input that `isDroppedChildInput` drops is left out. Returns
|
|
95
|
+
* undefined when no input is left.
|
|
96
|
+
*/
|
|
97
|
+
async function withAgentInvocationResultActors(work) {
|
|
98
|
+
if (work.kind !== "mailbox") return work;
|
|
99
|
+
const kept = (await mapBounded(work.batch, async (entry) => {
|
|
100
|
+
const parentMessage = readParentMessage(entry.message);
|
|
101
|
+
if (parentMessage) {
|
|
102
|
+
if (await isDroppedChildInput(entry.message)) {
|
|
103
|
+
logDroppedParentMessage(entry.message, parentMessage);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
const text = await parentMessageText(entry.message, parentMessage);
|
|
107
|
+
return {
|
|
108
|
+
...entry,
|
|
109
|
+
actor: parentMessage.actor,
|
|
110
|
+
requestText: entry.message.input.text.trim(),
|
|
111
|
+
...parentMessage.credentialContext ? { credentialContext: parentMessage.credentialContext } : void 0,
|
|
112
|
+
message: {
|
|
113
|
+
...entry.message,
|
|
114
|
+
input: {
|
|
115
|
+
...entry.message.input,
|
|
116
|
+
text
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
const input = childAgentInput(entry.message);
|
|
122
|
+
if (!input) return entry;
|
|
123
|
+
if (await isDroppedChildInput(entry.message)) return;
|
|
124
|
+
const sender = await getChildAgentInputSender(entry.message, input);
|
|
125
|
+
const actor = senderActorFromMetadata(entry.message.input.metadata);
|
|
126
|
+
if (!sender || !actor || entry.message.input.authorId !== resultAuthorId(actor)) return {
|
|
127
|
+
...entry,
|
|
128
|
+
actor: EVENT_SYSTEM_ACTOR
|
|
129
|
+
};
|
|
130
|
+
return {
|
|
131
|
+
...entry,
|
|
132
|
+
actor
|
|
133
|
+
};
|
|
134
|
+
})).filter((entry) => entry !== void 0);
|
|
135
|
+
return kept.length > 0 ? {
|
|
136
|
+
kind: "mailbox",
|
|
137
|
+
batch: kept
|
|
138
|
+
} : void 0;
|
|
139
|
+
}
|
|
140
|
+
// src/chat/agent-invocations/result.ts
|
|
141
|
+
var result_exports = /* @__PURE__ */ __exportAll({
|
|
142
|
+
createChildConversationWorker: () => createChildConversationWorker,
|
|
143
|
+
createDeliverToParent: () => createDeliverToParent
|
|
144
|
+
});
|
|
145
|
+
/**
|
|
146
|
+
* Render the parent agent input for one child agent result as one
|
|
147
|
+
* `<agent-result>`, the agent update that a Watch on the child also gets.
|
|
148
|
+
* The system prompt says what to do for each status, so the input repeats no
|
|
149
|
+
* guidance.
|
|
150
|
+
*/
|
|
151
|
+
function renderResultInput(sender, result, openSiblings) {
|
|
152
|
+
return renderAgentResult({
|
|
153
|
+
conversationId: sender.childConversationId,
|
|
154
|
+
name: sender.agentName,
|
|
155
|
+
source: "child_agent",
|
|
156
|
+
title: sender.title,
|
|
157
|
+
update: {
|
|
158
|
+
status: result.status,
|
|
159
|
+
text: result.output
|
|
160
|
+
},
|
|
161
|
+
waitingOn: openSiblings.length ? openSiblings.map(siblingLabel).join(", ") : void 0
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
function siblingLabel(sibling) {
|
|
165
|
+
return sibling.agentName ?? sibling.title ?? sibling.childConversationId;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Render one `<agent-result>` under the parent's mailbox lock. `waiting_on`
|
|
169
|
+
* then sees every `reply` that reached the parent, also one that a sibling
|
|
170
|
+
* sent at the same moment, so two siblings cannot each name the other.
|
|
171
|
+
*/
|
|
172
|
+
function renderResultUnderLock(sender, result) {
|
|
173
|
+
return async (parentInboundMessageIds, messageSenders) => renderResultInput(sender, result, await listUnreportedSiblingAgents(sender.parentConversationId, sender.childConversationId, listChildMessages(parentInboundMessageIds, messageSenders)));
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Drop the child's open To-dos of the parent before the parent reads that
|
|
177
|
+
* the child was stopped.
|
|
178
|
+
*/
|
|
179
|
+
async function dropTodosOfStoppedChild(sender, nowMs) {
|
|
180
|
+
await closeOpenTodosOfChild(getSqlExecutor(), {
|
|
181
|
+
childConversationId: sender.childConversationId,
|
|
182
|
+
nowMs,
|
|
183
|
+
parentConversationId: sender.parentConversationId,
|
|
184
|
+
status: "dropped"
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Read every child reply and result that reached the parent's mailbox. A
|
|
189
|
+
* sibling whose `reply` is among them has answered.
|
|
190
|
+
*/
|
|
191
|
+
async function readParentChildMessages(parentConversationId, state) {
|
|
192
|
+
const work = await getConversationWorkState({
|
|
193
|
+
conversationId: parentConversationId,
|
|
194
|
+
state
|
|
195
|
+
});
|
|
196
|
+
return listChildMessages(work?.execution.inboundMessageIds ?? [], work?.execution.messageSenders ?? {});
|
|
197
|
+
}
|
|
198
|
+
function childAgentLabel(sender) {
|
|
199
|
+
return sender.agentName ? `Child agent "${sender.agentName}"` : "Child agent";
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Mailbox metadata of a reply or message from a child. It carries the Actor
|
|
203
|
+
* of the child's Turn, so the parent runs with no more authority than that
|
|
204
|
+
* Turn. The author id must match it.
|
|
205
|
+
*/
|
|
206
|
+
function senderEventMetadata(actor, event) {
|
|
207
|
+
return {
|
|
208
|
+
kind: "event",
|
|
209
|
+
event,
|
|
210
|
+
actor
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
function renderMessageInput(sender, text) {
|
|
214
|
+
return renderDataTag("agent-message", {
|
|
215
|
+
conversation_id: sender.childConversationId,
|
|
216
|
+
name: sender.agentName,
|
|
217
|
+
source: "child_agent",
|
|
218
|
+
title: sender.title
|
|
219
|
+
}, "A child agent that you started", text.trim());
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Append one message from a child agent to its parent mailbox and wake the
|
|
223
|
+
* parent. `sender` names the child, and `actor` is the Actor of the child's
|
|
224
|
+
* Turn. The parent handles the message like a result. Repeat calls with the
|
|
225
|
+
* same `messageKey` are safe.
|
|
226
|
+
*/
|
|
227
|
+
async function enqueueAgentMessageToParent(args) {
|
|
228
|
+
const nowMs = args.nowMs ?? Date.now();
|
|
229
|
+
const senderId = args.sender.childConversationId;
|
|
230
|
+
const inboundMessageId = `agent-invocation:${senderId}:message:${args.messageKey}`;
|
|
231
|
+
const summary = `${childAgentLabel(args.sender)} sent a message.`;
|
|
232
|
+
const metadata = senderEventMetadata(args.actor, {
|
|
233
|
+
eventKey: inboundMessageId,
|
|
234
|
+
eventType: AGENT_MESSAGE_EVENT_TYPE,
|
|
235
|
+
identifier: senderId,
|
|
236
|
+
namespace: AGENT_INVOCATION_EVENT_NAMESPACE,
|
|
237
|
+
trustedSummary: summary
|
|
238
|
+
});
|
|
239
|
+
await enqueueAutomatedInput({
|
|
240
|
+
message: {
|
|
241
|
+
conversationId: args.sender.parentConversationId,
|
|
242
|
+
createdAtMs: nowMs,
|
|
243
|
+
delivery: "defer",
|
|
244
|
+
inboundMessageId,
|
|
245
|
+
input: {
|
|
246
|
+
authorId: resultAuthorId(args.actor),
|
|
247
|
+
authorIdentityId: SYSTEM_IDENTITY_ID,
|
|
248
|
+
metadata,
|
|
249
|
+
text: renderMessageInput(args.sender, args.text)
|
|
250
|
+
},
|
|
251
|
+
receivedAtMs: nowMs,
|
|
252
|
+
source: "event"
|
|
253
|
+
},
|
|
254
|
+
queue: args.queue,
|
|
255
|
+
queueDelayMs: EVENT_WAIT_MS,
|
|
256
|
+
state: args.state
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
const RESULT_SUMMARIES = {
|
|
260
|
+
blocked: "is blocked.",
|
|
261
|
+
completed: "finished.",
|
|
262
|
+
failed: "failed.",
|
|
263
|
+
reply: "replied.",
|
|
264
|
+
stopped: "was stopped."
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Append the result of one child agent Turn to its parent mailbox and wake
|
|
268
|
+
* the parent: a `reply`, which the parent reads as a completed
|
|
269
|
+
* `<agent-result>` or, while the child still works, as a message, or a
|
|
270
|
+
* completed, blocked, failed, or stopped result. `sender` names the child,
|
|
271
|
+
* and `actor` is the Actor of the child's Turn; the parent never runs with
|
|
272
|
+
* more authority than it. The key of the result, the `reply` tool call id or the
|
|
273
|
+
* Turn id, keys the message, so a repeat call is safe.
|
|
274
|
+
*/
|
|
275
|
+
async function enqueueChildResultToParent(args) {
|
|
276
|
+
const nowMs = args.nowMs ?? Date.now();
|
|
277
|
+
const senderId = args.sender.childConversationId;
|
|
278
|
+
const inboundMessageId = getAgentReplyMessageId(senderId, args.messageKey);
|
|
279
|
+
const rendered = args.result.kind === "reply" ? {
|
|
280
|
+
output: args.result.reply.text,
|
|
281
|
+
status: "completed"
|
|
282
|
+
} : {
|
|
283
|
+
output: args.result.text,
|
|
284
|
+
status: args.result.kind
|
|
285
|
+
};
|
|
286
|
+
const stillWorks = (args.result.kind === "reply" || args.result.kind === "completed") && await childAgentStillWorks(senderId);
|
|
287
|
+
const text = stillWorks ? renderMessageInput(args.sender, rendered.output) : renderResultInput(args.sender, rendered, []);
|
|
288
|
+
const metadata = {
|
|
289
|
+
...senderEventMetadata(args.actor, {
|
|
290
|
+
eventKey: inboundMessageId,
|
|
291
|
+
eventType: AGENT_UPDATE_EVENT_TYPE,
|
|
292
|
+
identifier: senderId,
|
|
293
|
+
namespace: AGENT_INVOCATION_EVENT_NAMESPACE,
|
|
294
|
+
...stillWorks ? void 0 : { status: rendered.status },
|
|
295
|
+
trustedSummary: `${childAgentLabel(args.sender)} ${stillWorks ? "sent a message." : RESULT_SUMMARIES[args.result.kind]}`
|
|
296
|
+
}),
|
|
297
|
+
...childMessageSenderMetadata({
|
|
298
|
+
conversationId: senderId,
|
|
299
|
+
turnId: args.turnId
|
|
300
|
+
})
|
|
301
|
+
};
|
|
302
|
+
if (args.result.kind === "stopped" && !(await readParentChildMessages(args.sender.parentConversationId, args.state)).some((message) => message.inboundMessageId === inboundMessageId)) await dropTodosOfStoppedChild(args.sender, nowMs);
|
|
303
|
+
await enqueueAutomatedInput({
|
|
304
|
+
message: {
|
|
305
|
+
conversationId: args.sender.parentConversationId,
|
|
306
|
+
createdAtMs: nowMs,
|
|
307
|
+
delivery: "defer",
|
|
308
|
+
inboundMessageId,
|
|
309
|
+
input: {
|
|
310
|
+
authorId: resultAuthorId(args.actor),
|
|
311
|
+
authorIdentityId: SYSTEM_IDENTITY_ID,
|
|
312
|
+
metadata,
|
|
313
|
+
text
|
|
314
|
+
},
|
|
315
|
+
receivedAtMs: nowMs,
|
|
316
|
+
source: "event"
|
|
317
|
+
},
|
|
318
|
+
renderText: async (parentInboundMessageIds, messageSenders) => args.result.kind !== "stopped" && await getConversationStoppedAtMs(senderId) !== void 0 ? void 0 : stillWorks ? text : await renderResultUnderLock(args.sender, rendered)(parentInboundMessageIds, messageSenders),
|
|
319
|
+
queue: args.queue,
|
|
320
|
+
queueDelayMs: EVENT_WAIT_MS,
|
|
321
|
+
state: args.state
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
const PARENT_RESULT_OUTCOMES = {
|
|
325
|
+
blocked: "blocked",
|
|
326
|
+
completed: "success",
|
|
327
|
+
failed: "error",
|
|
328
|
+
reply: "success",
|
|
329
|
+
stopped: "aborted"
|
|
330
|
+
};
|
|
331
|
+
/**
|
|
332
|
+
* Build the parent delivery of child agent Turns. The child Conversation
|
|
333
|
+
* names the child for the parent.
|
|
334
|
+
*/
|
|
335
|
+
function createDeliverToParent(options) {
|
|
336
|
+
return async ({ actor, result, conversationId, turnId }) => {
|
|
337
|
+
const sender = await readChildConversationSender(conversationId);
|
|
338
|
+
if (!sender) throw new Error(`Conversation ${conversationId} has no parent agent`);
|
|
339
|
+
await recordChildAgentEnded(conversationId, PARENT_RESULT_OUTCOMES[result.kind], options);
|
|
340
|
+
await enqueueChildResultToParent({
|
|
341
|
+
actor,
|
|
342
|
+
result,
|
|
343
|
+
messageKey: result.kind === "reply" ? getTurnReplyKey(turnId, result.reply.toolCallId) : turnId,
|
|
344
|
+
queue: options.queue,
|
|
345
|
+
sender,
|
|
346
|
+
state: options.state,
|
|
347
|
+
turnId
|
|
348
|
+
});
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* End the work of a child Conversation whose last attempt lost its worker.
|
|
353
|
+
* Its open markers end with `error`. Then the child tells its parent that it
|
|
354
|
+
* failed, as a failed Turn does.
|
|
355
|
+
*/
|
|
356
|
+
function createEndStoppedChildWork(options) {
|
|
357
|
+
const deliverToParent = createDeliverToParent(options);
|
|
358
|
+
return async (conversationId, inboundMessageIds) => {
|
|
359
|
+
await recordChildAgentEnded(conversationId, "error", { includeWaiting: true });
|
|
360
|
+
const conversation = await getConversationStore().get({ conversationId });
|
|
361
|
+
if (!conversation || turnBehavior({
|
|
362
|
+
kind: conversation.kind,
|
|
363
|
+
personInput: false
|
|
364
|
+
}).failureNotice !== "parent") return;
|
|
365
|
+
const turns = await listActiveMailboxTurns(conversationId);
|
|
366
|
+
const pending = (await getConversationWorkState({ conversationId }))?.execution.pendingMessages ?? [];
|
|
367
|
+
const turnIds = /* @__PURE__ */ new Set([...turns.map((turn) => turn.turnId), ...pending.map((message) => buildDeterministicTurnId(message.inboundMessageId))]);
|
|
368
|
+
const sender = await readChildConversationSender(conversationId);
|
|
369
|
+
if (sender && (await readParentChildMessages(sender.parentConversationId, void 0)).some((message) => message.sender.conversationId === conversationId && turnIds.has(message.sender.turnId))) return;
|
|
370
|
+
const [turn] = turns;
|
|
371
|
+
await deliverToParent({
|
|
372
|
+
actor: parentResultActor(turn?.actor ?? EVENT_SYSTEM_ACTOR, turn?.source?.kind),
|
|
373
|
+
result: {
|
|
374
|
+
kind: "failed",
|
|
375
|
+
text: `This ${conversation.kind} stopped because its worker failed repeatedly.`
|
|
376
|
+
},
|
|
377
|
+
conversationId,
|
|
378
|
+
turnId: turn?.turnId ?? `lost:${inboundMessageIds.at(-1) ?? "input"}`
|
|
379
|
+
});
|
|
380
|
+
};
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Build the worker for all work of a child Conversation. The caller selects
|
|
384
|
+
* it from the stored kind of the Conversation, never from a Turn Source.
|
|
385
|
+
* Every input, such as a parent task or message, a person's Message in a
|
|
386
|
+
* Thread, a Watch Event, or a reply of the child's own child agent, runs on
|
|
387
|
+
* the Conversation loop, like input to a root.
|
|
388
|
+
*/
|
|
389
|
+
function createChildConversationWorker(options) {
|
|
390
|
+
return async (context) => {
|
|
391
|
+
const work = await resolveMailboxTurnWork(context);
|
|
392
|
+
const kept = work ? await withAgentInvocationResultActors(work) : void 0;
|
|
393
|
+
if (!kept) {
|
|
394
|
+
await context.attempt.ack();
|
|
395
|
+
return { status: "completed" };
|
|
396
|
+
}
|
|
397
|
+
const result = await options.runTurn(context, kept);
|
|
398
|
+
if (result.status === "completed") await recordChildAgentEnded(context.conversationId, "success", options);
|
|
399
|
+
return result;
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
export { result_exports as a, parentResultActor as c, enqueueAgentMessageToParent as i, getChildAgentLabel as l, createDeliverToParent as n, withAgentInvocationResultActors as o, createEndStoppedChildWork as r, childWorkEnded as s, createChildConversationWorker as t };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { xt as messageCardText } from "./media-
|
|
2
|
-
import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Zt as SYSTEM_IDENTITY_ID, a as getConversationStore } from "./db-PwSRzWWn.js";
|
|
1
|
+
import { xt as messageCardText } from "./media-FYM-Bl3H.js";
|
|
2
|
+
import { a as buildDeliveredTurnStatePatch, o as loadPendingMessageCards, r as completeAuthPauseTurn, t as buildTurnThreadContext } from "./thread-context-CDX4dSZd.js";
|
|
3
|
+
import { Cr as recordDeliveredAssistantMessage, Er as upsertConversationMessage, Jn as commitAcceptedReply, Mi as finalizeFailedTurnReplyWithEvent, Rr as authorizationId, Sr as normalizeConversationText, Xr as saveTurnCheckpoint, Zi as getAssistantReplyText, Zn as loadConversationProjection, br as latestConversationMessageSeq, dr as hydrateConversationMessages, ft as markTurnFailed, gt as getPersistedThreadState, ht as getPersistedSandboxState, pr as persistConversationMessages, pt as startActiveTurn, rr as recordAuthorizationCompleted, sa as persistWithRetry, vt as persistThreadStateById, xi as getTurnLifecycle, xr as markConversationMessage, yt as coerceThreadConversationState } from "./mailbox-turn-DL3Lvsm0.js";
|
|
4
|
+
import { P as withLogContext, S as logException, j as setTags } from "./conversation-privacy-DtZhI91r.js";
|
|
5
|
+
import { n as scheduleSessionCompletedPluginTasks, t as processPluginTask } from "./task-runner-C-pXsgHM.js";
|
|
6
|
+
import { K as credentialContextForActor } from "./registry-D6kS6xYH.js";
|
|
7
|
+
import { dn as SYSTEM_IDENTITY_ID, i as getConversationStore } from "./db-BTmLKZrp.js";
|
|
9
8
|
import { randomUUID } from "node:crypto";
|
|
10
9
|
import { createLocalSource, localDestinationSchema } from "@sentry/junior-plugin-api";
|
|
11
10
|
// src/chat/local/runner.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Pn as sandboxEgressSignalsResponseSchema } from "./credentialed-dWRA3-oJ.js";
|
|
2
2
|
// src/chat/local/sandbox-egress-signals.ts
|
|
3
3
|
const SANDBOX_EGRESS_SIGNALS_PATH = "/api/internal/sandbox-egress/signals";
|
|
4
4
|
const LOCAL_DEV_SERVER_TIMEOUT_MS = 1e3;
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
-
import { Dt as inputFileSchema, Jt as inboxItemRequestSchema, U as conversationAuxiliaryCostsSchema, Y as conversationParamsSchema, at as idempotencyKeySchema, et as conversationSummaryReportSchema, nt as conversationUsageSchema, s as notificationScheduleSchema, st as conversationChildAgentTotalsSchema, z as actorIdentitySchema } from "./media-
|
|
2
|
-
import
|
|
3
|
-
import "./conversation-feed-BEXLD3Me.js";
|
|
1
|
+
import { Dt as inputFileSchema, Jt as inboxItemRequestSchema, U as conversationAuxiliaryCostsSchema, Y as conversationParamsSchema, at as idempotencyKeySchema, et as conversationSummaryReportSchema, nt as conversationUsageSchema, s as notificationScheduleSchema, st as conversationChildAgentTotalsSchema, z as actorIdentitySchema } from "./media-FYM-Bl3H.js";
|
|
2
|
+
import "./conversation-feed-DdFQuQDR.js";
|
|
4
3
|
import { i as fillUtcHours, r as fillUtcDays, s as sumUtcHoursIntoSixHours } from "./reporting-window-C4dbzDiR.js";
|
|
4
|
+
import { _ as TODO_STATUSES } from "./history-CneKY7_V.js";
|
|
5
5
|
import { t as isPushServiceEndpoint } from "./push-endpoint-CO-nomUd.js";
|
|
6
|
+
import "./user-customization-B27StpVQ.js";
|
|
6
7
|
import * as z from "zod";
|
|
7
8
|
import { codeChangeSizeSchema, codeChangeStateSchema, eventMatchSchema, objectTypeSchema, ownedObjectAnnotationSchema } from "@sentry/junior-plugin-api";
|
|
9
|
+
// src/chat/agent-invocations/statuses.ts
|
|
10
|
+
const AGENT_INVOCATION_STATUSES = [
|
|
11
|
+
"pending",
|
|
12
|
+
"running",
|
|
13
|
+
"paused",
|
|
14
|
+
"blocked",
|
|
15
|
+
"completed",
|
|
16
|
+
"failed",
|
|
17
|
+
"stopped"
|
|
18
|
+
];
|
|
8
19
|
// src/api/schema/conversation-fork.ts
|
|
9
20
|
/** Body of a request to fork a Conversation at one assistant reply. */
|
|
10
21
|
const forkConversationBodySchema = z.object({
|
|
@@ -72,7 +83,7 @@ const conversationOutlineSchema = z.object({ items: z.array(z.object({
|
|
|
72
83
|
createdAt: z.string().datetime(),
|
|
73
84
|
/** Identity id of the author. Detail `authors` maps it to the person. */
|
|
74
85
|
actorIdentityId: z.string().min(1).optional(),
|
|
75
|
-
/**
|
|
86
|
+
/** Set on input that an earlier release's agent wrote. */
|
|
76
87
|
agentInvocationId: z.string().min(1).optional(),
|
|
77
88
|
text: z.string().min(1),
|
|
78
89
|
/** The last Junior text before the next item. */
|
|
@@ -160,7 +171,7 @@ const continueConversationInSlackResponseSchema = z.object({
|
|
|
160
171
|
}).strict();
|
|
161
172
|
// src/api/schema/child-agent.ts
|
|
162
173
|
/**
|
|
163
|
-
* One direct child agent of a Conversation, from agent
|
|
174
|
+
* One direct child agent of a Conversation, from its stored agent config.
|
|
164
175
|
*
|
|
165
176
|
* Viewers who cannot see private content get the status, time, and usage, but
|
|
166
177
|
* not the name, task, title, or error. Usage covers the child Conversation and
|
|
@@ -568,6 +579,12 @@ const locationDetailReportSchema = locationSummaryReportSchema.extend({
|
|
|
568
579
|
/** The viewer's Lead. Messages to it use the Conversation message route. */
|
|
569
580
|
const leadSchema = z.object({
|
|
570
581
|
conversationId: z.string().min(1),
|
|
582
|
+
/**
|
|
583
|
+
* The Lead's newest event seq, read before its Watches, or -1 before its
|
|
584
|
+
* first event. Watches change only in the Lead's Turns, so a transcript
|
|
585
|
+
* event past this seq means the Watches may be out of date.
|
|
586
|
+
*/
|
|
587
|
+
lastSeq: z.number().int().min(-1),
|
|
571
588
|
/** The Conversations that the Lead has an active Watch on. */
|
|
572
589
|
watchedConversationIds: z.array(z.string().min(1))
|
|
573
590
|
}).strict();
|
|
@@ -717,12 +734,67 @@ const createPersonalTokenBodySchema = z.object({
|
|
|
717
734
|
const createdPersonalTokenSchema = personalTokenMetadataSchema.extend({ token: z.string().startsWith("jr_pat_") }).strict();
|
|
718
735
|
const personalTokenParamsSchema = z.object({ id: z.string().uuid() }).strict();
|
|
719
736
|
const revokePersonalTokenResponseSchema = z.object({ revoked: z.literal(true) }).strict();
|
|
737
|
+
/**
|
|
738
|
+
* A search while a person types. `sources` names the groups to search,
|
|
739
|
+
* comma separated, such as `inboxItems,automations`.
|
|
740
|
+
*/
|
|
741
|
+
const searchQuerySchema = z.object({
|
|
742
|
+
q: z.string().trim().min(1).max(100),
|
|
743
|
+
sources: z.string().transform((value) => [...new Set(value.split(","))]).pipe(z.array(z.enum([
|
|
744
|
+
"inboxItems",
|
|
745
|
+
"automations",
|
|
746
|
+
"memories",
|
|
747
|
+
"todos"
|
|
748
|
+
])).min(1))
|
|
749
|
+
}).strict();
|
|
750
|
+
/** An Inbox item that matches a search. */
|
|
751
|
+
const searchInboxItemSchema = z.object({
|
|
752
|
+
id: z.string().min(1),
|
|
753
|
+
status: z.enum([
|
|
754
|
+
"open",
|
|
755
|
+
"done",
|
|
756
|
+
"dismissed"
|
|
757
|
+
]),
|
|
758
|
+
title: z.string()
|
|
759
|
+
}).strict();
|
|
760
|
+
/** An Automation that matches a search. */
|
|
761
|
+
const searchAutomationSchema = z.object({
|
|
762
|
+
id: z.string().min(1),
|
|
763
|
+
kind: z.enum(["scheduled", "event"]),
|
|
764
|
+
status: z.enum([
|
|
765
|
+
"active",
|
|
766
|
+
"blocked",
|
|
767
|
+
"paused",
|
|
768
|
+
"completed"
|
|
769
|
+
]),
|
|
770
|
+
title: z.string()
|
|
771
|
+
}).strict();
|
|
772
|
+
/** A memory that matches a search, its text cut to one menu row. */
|
|
773
|
+
const searchMemorySchema = z.object({
|
|
774
|
+
id: z.string().min(1),
|
|
775
|
+
title: z.string()
|
|
776
|
+
}).strict();
|
|
777
|
+
/** A To-do that matches a search, in a Conversation that shows its title. */
|
|
778
|
+
const searchTodoSchema = z.object({
|
|
779
|
+
conversationId: z.string().min(1),
|
|
780
|
+
id: z.number().int(),
|
|
781
|
+
status: z.enum(TODO_STATUSES),
|
|
782
|
+
title: z.string()
|
|
783
|
+
}).strict();
|
|
784
|
+
/** One group of matches for each source that the search named. */
|
|
785
|
+
const searchReportSchema = z.object({
|
|
786
|
+
automations: z.array(searchAutomationSchema).optional(),
|
|
787
|
+
inboxItems: z.array(searchInboxItemSchema).optional(),
|
|
788
|
+
memories: z.array(searchMemorySchema).optional(),
|
|
789
|
+
todos: z.array(searchTodoSchema).optional()
|
|
790
|
+
}).strict();
|
|
720
791
|
// src/api/schema/service-account.ts
|
|
721
792
|
const serviceAccountSchema = z.object({
|
|
722
793
|
provider: z.string(),
|
|
723
794
|
displayName: z.string(),
|
|
724
795
|
userOAuth: z.boolean(),
|
|
725
796
|
tools: z.array(z.string()),
|
|
797
|
+
operations: z.array(z.string()),
|
|
726
798
|
connected: z.boolean(),
|
|
727
799
|
connectedAt: z.string().optional(),
|
|
728
800
|
connectedBy: z.string().optional()
|
|
@@ -893,7 +965,7 @@ const itemRowSchema = z.object({ inboxItemId: z.string().min(1) }).strict();
|
|
|
893
965
|
const inboxSnoozeSubjectSchema = z.union([conversationRowSchema, itemRowSchema]);
|
|
894
966
|
/**
|
|
895
967
|
* An Event that ends a snooze: `wake` shows the item again, and `resolve`
|
|
896
|
-
* dismisses it. The Event is on the page at `resourceUrl`, such as another
|
|
968
|
+
* dismisses it, or marks a To-do item's To-do done. The Event is on the page at `resourceUrl`, such as another
|
|
897
969
|
* pull request, or on each item's subject when it is unset.
|
|
898
970
|
*/
|
|
899
971
|
const inboxSnoozeTriggerSchema = z.object({
|
|
@@ -981,7 +1053,7 @@ const inboxItemSchema = z.object({
|
|
|
981
1053
|
assignees: z.array(personSchema),
|
|
982
1054
|
automationId: z.string().min(1).optional(),
|
|
983
1055
|
body: z.string(),
|
|
984
|
-
/** True when the viewer can take, submit, or
|
|
1056
|
+
/** True when the viewer can take, submit, dismiss, or mark it done. */
|
|
985
1057
|
canAct: z.boolean(),
|
|
986
1058
|
/** True when the viewer can act and is not already the only assignee. */
|
|
987
1059
|
canTake: z.boolean(),
|
|
@@ -1065,6 +1137,12 @@ const inboxItemSchema = z.object({
|
|
|
1065
1137
|
url: z.string().min(1).optional()
|
|
1066
1138
|
}).strict().optional(),
|
|
1067
1139
|
title: z.string().min(1),
|
|
1140
|
+
/**
|
|
1141
|
+
* The id of the To-do that the item shows, for a To-do assigned to the
|
|
1142
|
+
* viewer. Its owner Conversation holds the To-do. The item takes Done
|
|
1143
|
+
* instead of an answer or Dismiss.
|
|
1144
|
+
*/
|
|
1145
|
+
todoId: z.number().int().positive().optional(),
|
|
1068
1146
|
updatedAt: z.string().datetime(),
|
|
1069
1147
|
visibility: z.enum(["public", "private"]),
|
|
1070
1148
|
/**
|
|
@@ -1160,7 +1238,9 @@ const inboxItemCountSchema = z.object({
|
|
|
1160
1238
|
* The Inbox rows that the viewer snoozed and that still have an open
|
|
1161
1239
|
* item for them, as Snoozed lists them. 0 without `include=snoozed`.
|
|
1162
1240
|
*/
|
|
1163
|
-
snoozed: z.number().int().nonnegative()
|
|
1241
|
+
snoozed: z.number().int().nonnegative(),
|
|
1242
|
+
/** The `needsViewer` items that show a To-do (`todoId`). */
|
|
1243
|
+
todos: z.number().int().nonnegative()
|
|
1164
1244
|
}).strict();
|
|
1165
1245
|
/**
|
|
1166
1246
|
* Conversations linked to an open action item assigned to the viewer. `title`
|
|
@@ -1183,6 +1263,7 @@ const inboxItemParamsSchema = z.object({ id: z.string().min(1) }).strict();
|
|
|
1183
1263
|
const inboxItemActionSchema = z.discriminatedUnion("action", [
|
|
1184
1264
|
z.object({ action: z.literal("take") }).strict(),
|
|
1185
1265
|
z.object({ action: z.literal("dismiss") }).strict(),
|
|
1266
|
+
z.object({ action: z.literal("done") }).strict(),
|
|
1186
1267
|
z.object({
|
|
1187
1268
|
action: z.literal("submit"),
|
|
1188
1269
|
answer: answerSchema.omit({ requestId: true })
|
|
@@ -1279,4 +1360,4 @@ const versionsSchema = z.object({
|
|
|
1279
1360
|
/** The viewer's rolling model spend. */
|
|
1280
1361
|
spend: z.string().min(1)
|
|
1281
1362
|
}).strict();
|
|
1282
|
-
export {
|
|
1363
|
+
export { actorProfileReportSchema as $, objectLinksQuerySchema as $t, cacheHealthQuerySchema as A, codeChangeSummarySchema as At, serviceAccountParamsSchema as B, conversationTodosReportSchema as Bt, inboxSnoozeResourceQuerySchema as C, disconnectConnectionResponseSchema as Ct, inboxSnoozeWakesClearSchema as D, codeChangeSearchQuerySchema as Dt, inboxSnoozeSubjectSchema as E, codeActivityDaySchema as Et, cacheWarmingSavingsRefillResponseSchema as F, codeRepositoryReportSchema as Ft, createPersonalTokenBodySchema as G, watchParamsSchema as Gt, startServiceAccountSignInResponseSchema as H, todoStatusBodySchema as Ht, cacheWarmingSavingsReportSchema as I, codeRepositorySummarySchema as It, personalTokenMetadataSchema as J, continueConversationInSlackBodySchema as Jt, createdPersonalTokenSchema as K, conversationChildAgentSchema as Kt, closeCacheWarmingBreakerResponseSchema as L, mentionableCodeChangeSchema as Lt, cacheWarmingBreakerListSchema as M, codePersonReportSchema as Mt, cacheWarmingBreakerParamsSchema as N, codeRepositoryParamsSchema as Nt, gatewayProvidersSchema as O, codeChangeSearchReportSchema as Ot, cacheWarmingSavingsQuerySchema as P, codeRepositoryQuerySchema as Pt, actorDirectoryReportSchema as Q, attachObjectLinkResponseSchema as Qt, disconnectServiceAccountResponseSchema as R, personCodeQuerySchema as Rt, inboxSnoozeCreateSchema as S, connectionSchema as St, inboxSnoozeSchema as T, IDLE_CHANGE_DAYS as Tt, searchQuerySchema as U, conversationWatchSchema as Ut, serviceAccountSchema as V, todoParamsSchema as Vt, searchReportSchema as W, conversationWatchesReportSchema as Wt, revokePersonalTokenResponseSchema as X, MAX_OBJECT_LINKS as Xt, personalTokenParamsSchema as Y, continueConversationInSlackResponseSchema as Yt, PERSON_CARD_RECENT_LIMIT as Z, attachObjectLinkBodySchema as Zt, inboxItemListSchema as _, pushSubscriptionBodySchema as _t, statsReportSchema as a, conversationDeliveryResponseSchema as an, personParamsSchema as at, inboxItemWaitingConversationsSchema as b, connectionListSchema as bt, workspaceBodySchema as c, attachmentUploadParamsSchema as cn, locationActivityDayReportSchema as ct, workspaceRepoSchema as d, forkConversationBodySchema as dn, locationParamsSchema as dt, objectLinksReportSchema as en, avatarParamsSchema as et, workspaceSchema as f, forkConversationResponseSchema as fn, activityDays as ft, inboxItemListQuerySchema as g, notificationSettingsSchema as gt, inboxItemCountSchema as h, dailyConversationActivitySchema as ht, statSchema as i, conversationDeliveryBodySchema as in, personCardReportSchema as it, cacheHealthReportSchema as j, codeOverviewReportSchema as jt, updateGatewayProvidersBodySchema as k, codeChangeSummaryReportSchema as kt, workspaceListSchema as l, attachmentUploadSchema as ln, locationDetailReportSchema as lt, inboxItemCountQuerySchema as m, activitySixHours as mt, versionsQuerySchema as n, CONVERSATION_OUTLINE_TEXT_LENGTH as nn, peopleSearchQuerySchema as nt, baselineSnapshotSchema as o, conversationCatchUpBodySchema as on, personalSpendReportSchema as ot, inboxItemActionSchema as p, activityHours as pt, personalTokenListSchema as q, conversationChildAgentsReportSchema as qt, versionsSchema as r, conversationOutlineSchema as rn, peopleSearchReportSchema as rt, deleteWorkspaceResponseSchema as s, conversationCatchUpSchema as sn, leadSchema as st, VERSIONS_CONVERSATION_LIMIT as t, conversationStatsReportSchema as tn, mentionablePersonSchema as tt, workspaceParamsSchema as u, createAttachmentUploadBodySchema as un, locationDirectoryReportSchema as ut, inboxItemParamsSchema as v, pushSubscriptionDeleteBodySchema as vt, inboxSnoozeResourceSchema as w, startConnectionResponseSchema as wt, INBOX_SNOOZE_MAX_TRIGGERS as x, connectionParamsSchema as xt, inboxItemSchema as y, testNotificationResponseSchema as yt, serviceAccountListSchema as z, conversationTodoSchema as zt };
|