@sentry/junior 0.311.0 → 0.313.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-B1wujchl.js → adapter-CYAvJzZS.js} +1 -1
- package/dist/{adapter-context-G2M0y6rP.js → adapter-context-CVsHoVSf.js} +2 -2
- package/dist/{admin-DCiBhUT1.js → admin-Cyhb4TwZ.js} +1 -1
- package/dist/{agent-runner-BVHPUIc8.js → agent-runner-B5y9MsT-.js} +3487 -3493
- package/dist/api/schema.d.ts +2 -2
- package/dist/api/schema.js +6 -6
- package/dist/api.d.ts +2 -2
- package/dist/api.js +294 -311
- package/dist/{app-Cw5Vy6H6.d.ts → app-DA8-hCMj.d.ts} +2 -9
- package/dist/app.d.ts +1 -1
- package/dist/app.js +336 -604
- package/dist/{background-compaction-queue-CJDnWVOJ.js → background-compaction-queue-iZXadLV3.js} +60 -85
- package/dist/{catalog-runtime-DMY3VV-D.js → catalog-runtime-kkE3hvCX.js} +1 -1
- package/dist/channel-access-mt7K6dPh.js +221 -0
- package/dist/cli/chat.js +18 -19
- package/dist/cli/check.js +3 -3
- package/dist/cli/init.js +0 -1
- package/dist/cli/main.js +3 -7
- package/dist/cli/plugins.js +4 -4
- package/dist/cli/run.d.ts +1 -2
- package/dist/cli/run.js +1 -2
- package/dist/cli/snapshot-create.js +5 -5
- package/dist/cli/upgrade.d.ts +1 -1
- package/dist/cli/upgrade.js +3 -3
- package/dist/{config-BrXDQefC.js → config-CWbwKj0j.js} +59 -27
- package/dist/{continue-in-slack-DNXSC9So.js → continue-in-slack-CxyFzdlF.js} +7 -8
- package/dist/{conversation-feed-DkinDu5o.js → conversation-feed-BEXLD3Me.js} +86 -21
- package/dist/{conversation-privacy-DxttrKb9.js → conversation-privacy-BrMiDN61.js} +1 -1
- package/dist/{conversation-turn-DWw7Xhdr.js → conversation-turn-B35eu0uz.js} +78 -56
- package/dist/{credential-sync-Bk8wGb8Y.js → credential-sync-DWTOEQrm.js} +15 -15
- package/dist/{projection-Cns7XwWa.js → credentialed-Dyv8b-lu.js} +16306 -20732
- package/dist/{db-7ETESH44.d.ts → db-DYGcXYl3.d.ts} +11 -6
- package/dist/{db-DTxzH7u5.js → db-PwSRzWWn.js} +181 -100
- package/dist/{executor-DqTiYj9S.js → executor-CgWyWfYz.js} +117 -99
- package/dist/{html-B9Sl4Axb.js → html-DidUcRhI.js} +6 -6
- package/dist/ingest-B0AggUEC.js +7931 -0
- package/dist/{install-Sg4ePfLl.js → install-2urLLXNt.js} +2 -2
- package/dist/instrumentation.js +3 -3
- package/dist/{lineage-BHAMpNKr.js → lineage-BXplQAVH.js} +2 -2
- package/dist/{stop-CYsfc0Ed.js → list-DyIyReSV.js} +709 -475
- package/dist/{logging-FjclQsXu.js → logging-DNt-qOIO.js} +1 -1
- package/dist/{schedule-BLJ476XQ.js → media-B0pZJ0bG.js} +1058 -11
- package/dist/{message-CJ7_RL50.js → message-Z5YKC-Af.js} +35 -28
- package/dist/{model-input-CMLh4Cwq.js → model-input-BhPJYdSV.js} +3 -3
- package/dist/nitro.d.ts +1 -1
- package/dist/nitro.js +4 -3
- package/dist/{oauth-callback-server-RVcbiDjL.js → oauth-callback-server-ByvDdcdY.js} +2 -2
- package/dist/{oauth-relay-Bu9kkaQu.js → oauth-relay-D-kK0yoN.js} +1 -1
- package/dist/{registry-BPwuOP2O.js → registry-POH4bZC4.js} +1 -1
- package/dist/reporting-window-C4dbzDiR.js +124 -0
- package/dist/request-deadline-BUiRYQYj.js +24 -0
- package/dist/{resolve-BK29bBry.js → resolve-CWtBNSKP.js} +3 -3
- package/dist/{runner-BcAE-cJm.js → runner-CsZ_VRxp.js} +14 -16
- package/dist/{sandbox-egress-signals-C-q0go5b.js → sandbox-egress-signals-FbCk1FkN.js} +1 -1
- package/dist/{schema-DYcJeV7d.d.ts → schema-DBf18QPS.d.ts} +2773 -3630
- package/dist/{schema-BLgSZXcL.js → schema-DojR2uCL.js} +106 -121
- package/dist/{service-account-iJoCtkHR.js → service-account-CDYb9hfX.js} +3 -3
- package/dist/{service-account-gN0zqf0S.js → service-account-o15pZWcJ.js} +5 -5
- package/dist/{skills-BoZ80epJ.js → skills-B0jP4whm.js} +2 -2
- package/dist/{slack-conversation-unfurl-CogYrITA.js → slack-conversation-unfurl-D26t9kBC.js} +9 -9
- package/dist/{spawn-Dk92r7mX.js → spawn-BjljgExZ.js} +14 -32
- package/dist/start-conversation-DbVujrwO.js +755 -0
- package/dist/{state-DH3Cmgp3.js → state-BTawTCme.js} +4 -4
- package/dist/statuses-BKwqCPhj.js +69 -0
- package/dist/store-CjXrp-Up.js +492 -0
- package/dist/task-queue-Cwlatjz3.js +90 -0
- package/dist/task-runner--Ke8KSMf.js +1432 -0
- package/dist/{thread-context-BW2BsQbH.js → thread-context-B8exINEe.js} +6 -7
- package/dist/turn-membership-DTR3SaKD.js +5859 -0
- package/dist/{validation-DrJd0nnq.js → validation-Ce0qbMlT.js} +1 -1
- package/dist/{task-queue-C_zldF5J.js → vercel-queue-q4z8w5QO.js} +93 -172
- package/dist/{version-CNKZ8owc.js → version-DFh4n9nr.js} +1 -1
- package/dist/version.js +1 -1
- package/dist/{warmup-BWdHew2H.js → warmup-D5hzqTcp.js} +4853 -13605
- package/dist/web-message-id-C6P83ans.js +10 -0
- package/dist/{worker-t9qpu_Zx.js → worker-CDg9Lbpg.js} +20 -7
- package/migrations/0143_todos.sql +14 -0
- package/migrations/0144_inbox_items.sql +32 -0
- package/migrations/0145_todo_changed_by_agent.sql +1 -0
- package/migrations/0146_inbox_item_subject_title_parts.sql +1 -0
- package/migrations/0147_inbox_snooze_wake_reason.sql +1 -0
- package/migrations/0148_authorization_request_index.sql +1 -0
- package/migrations/0149_conversation_metadata.sql +10 -0
- package/migrations/0150_conversation_metadata_fill.sql +39 -0
- package/migrations/0151_conversation_search_index.sql +1 -0
- package/migrations/0152_inbox_item_legacy_automation_keys.sql +21 -0
- package/migrations/0153_artifact_expiry.sql +1 -0
- package/migrations/0154_artifact_permanent_sha_index.sql +1 -0
- package/migrations/0155_artifact_drop_public_sha_index.sql +3 -0
- package/migrations/0156_conversation_kind_lead.sql +6 -0
- package/migrations/0157_conversation_lead_actor_index.sql +1 -0
- package/migrations/0158_keep_legacy_archive_columns.sql +5 -0
- package/migrations/0159_conversation_embeddings_fk_validate.sql +5 -0
- package/migrations/meta/0143_snapshot.json +6434 -0
- package/migrations/meta/0144_snapshot.json +6434 -0
- package/migrations/meta/0145_snapshot.json +6440 -0
- package/migrations/meta/0146_snapshot.json +6446 -0
- package/migrations/meta/0147_snapshot.json +6452 -0
- package/migrations/meta/0148_snapshot.json +6474 -0
- package/migrations/meta/0149_snapshot.json +6490 -0
- package/migrations/meta/0150_snapshot.json +6490 -0
- package/migrations/meta/0151_snapshot.json +6505 -0
- package/migrations/meta/0152_snapshot.json +6505 -0
- package/migrations/meta/0153_snapshot.json +6511 -0
- package/migrations/meta/0154_snapshot.json +6533 -0
- package/migrations/meta/0155_snapshot.json +6511 -0
- package/migrations/meta/0156_snapshot.json +6511 -0
- package/migrations/meta/0157_snapshot.json +6527 -0
- package/migrations/meta/0158_snapshot.json +6515 -0
- package/migrations/meta/0159_snapshot.json +6515 -0
- package/migrations/meta/_journal.json +120 -1
- package/package.json +6 -6
- package/skills/design-automation-skill/SKILL.md +108 -0
- package/dist/briefs-BDjnug6Y.js +0 -395
- package/dist/conversation-ca__NDQW.js +0 -1063
- package/dist/prompt-CDqcsDYC.js +0 -910
- package/dist/store-DmmMIrQi.js +0 -335
- package/dist/task-runner-C7oCJQIx.js +0 -294
- package/dist/turn-session-routing-Xh_2nSQe.js +0 -261
- package/dist/web-message-id-Ch5dPq-a.js +0 -306
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-BKpuH2hG.js";
|
|
2
1
|
import { t as mapBounded } from "./fan-out-Cod-yEHG.js";
|
|
3
|
-
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-
|
|
4
|
-
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-
|
|
2
|
+
import { E as withSpan, g as normalizeGenAiFinishReason, h as logWarn, i as extractGenAiUsageAttributes, p as logException, v as serializeGenAiAttribute } from "./logging-DNt-qOIO.js";
|
|
3
|
+
import { a as toCanonicalInputMessage, n as getCurrentConversationPrivacy, o as toCanonicalOutputMessage, s as toGenAiMessagesTraceAttributes } from "./conversation-privacy-BrMiDN61.js";
|
|
5
4
|
import { t as gatewayOnlyProviders } from "./rule-DAxQY-1h.js";
|
|
6
5
|
import { AwsClient } from "aws4fetch";
|
|
7
6
|
import { del, get, issueSignedToken, presignUrl, put } from "@vercel/blob";
|
|
@@ -504,7 +503,7 @@ const PERMISSION_PATTERN = /permission denied|forbidden|not authorized|authoriza
|
|
|
504
503
|
const INVALID_REQUEST_PATTERN = /context.?length|context.?window|validation (?:error|failed)|bad request|unsupported model|invalid model|unknown (?:ai gateway )?model|mismatched api/i;
|
|
505
504
|
const CAPACITY_PATTERN = /overloaded|at capacity|capacity exceeded/i;
|
|
506
505
|
const TIMEOUT_PATTERN = /timed? out|timeout|gateway timeout/i;
|
|
507
|
-
const NETWORK_PATTERN = /network.?error|connection (?:error|refused|lost|closed)|fetch failed|socket (?:hang up|closed)|stream ended before/i;
|
|
506
|
+
const NETWORK_PATTERN = /network.?error|connection (?:error|refused|lost|closed)|fetch failed|cannot connect to api|socket (?:hang up|closed)|stream ended before/i;
|
|
508
507
|
const SERVER_PATTERN = /service(?: temporarily)?[ _-]?unavailable|server.?error|internal.?error|bad gateway|upstream (?:request )?failed/i;
|
|
509
508
|
const TERMINAL_KINDS = /* @__PURE__ */ new Set([
|
|
510
509
|
"auth",
|
|
@@ -540,6 +539,7 @@ function extractTransportKind(error, depth = 0) {
|
|
|
540
539
|
const code = typeof providerError.code === "string" ? providerError.code.toUpperCase() : void 0;
|
|
541
540
|
if (code && TIMEOUT_ERROR_CODES.has(code)) return "timeout";
|
|
542
541
|
if (code && NETWORK_ERROR_CODES.has(code)) return "network";
|
|
542
|
+
if (depth > 0 && NETWORK_PATTERN.test(providerError.message)) return "network";
|
|
543
543
|
return extractTransportKind(providerError.cause, depth + 1);
|
|
544
544
|
}
|
|
545
545
|
function extractStatus(error, message) {
|
|
@@ -578,19 +578,27 @@ function classifyProviderError(status, message, transportKind) {
|
|
|
578
578
|
if (status !== void 0 && status >= 400) return "invalid_request";
|
|
579
579
|
return "unknown";
|
|
580
580
|
}
|
|
581
|
+
/**
|
|
582
|
+
* The AI SDK retries a call and then throws `AI_RetryError`. The error of
|
|
583
|
+
* its last attempt has the status and the transport cause.
|
|
584
|
+
*/
|
|
585
|
+
function lastAttemptError(error) {
|
|
586
|
+
return error instanceof Error && error.name === "AI_RetryError" && "lastError" in error ? error.lastError : error;
|
|
587
|
+
}
|
|
581
588
|
/** Normalize SDK, Gateway, and Pi failures into one provider error contract. */
|
|
582
589
|
function createProviderError(error, options = {}) {
|
|
583
590
|
if (error instanceof ProviderError) return error;
|
|
584
591
|
const message = providerMessage(error);
|
|
585
|
-
const
|
|
586
|
-
const
|
|
592
|
+
const attempt = lastAttemptError(error);
|
|
593
|
+
const status = extractStatus(attempt, message);
|
|
594
|
+
const kind = options.kind ?? classifyProviderError(status, message, extractTransportKind(attempt));
|
|
587
595
|
const retryable = !TERMINAL_KINDS.has(kind) && (options.retryable ?? RETRYABLE_KINDS.has(kind));
|
|
588
596
|
return new ProviderError({
|
|
589
597
|
cause: error,
|
|
590
598
|
kind,
|
|
591
599
|
modelId: options.modelId,
|
|
592
600
|
retryable,
|
|
593
|
-
retryAfterMs: extractRetryAfterMs(
|
|
601
|
+
retryAfterMs: extractRetryAfterMs(attempt, message),
|
|
594
602
|
status
|
|
595
603
|
});
|
|
596
604
|
}
|
|
@@ -620,25 +628,49 @@ function findProviderError(error) {
|
|
|
620
628
|
current = current.cause;
|
|
621
629
|
}
|
|
622
630
|
}
|
|
623
|
-
const
|
|
631
|
+
const PROVIDER_NAMES = {
|
|
632
|
+
anthropic: "Anthropic",
|
|
633
|
+
google: "Google",
|
|
634
|
+
openai: "OpenAI",
|
|
635
|
+
xai: "xAI"
|
|
636
|
+
};
|
|
637
|
+
/**
|
|
638
|
+
* Name the failing model for user copy, such as `OpenAI (gpt-6-luna)`. A
|
|
639
|
+
* model that serves another step, such as action review, says so, because
|
|
640
|
+
* the person did not pick it.
|
|
641
|
+
*/
|
|
642
|
+
function providerSubject(modelId, purpose) {
|
|
643
|
+
const slash = modelId?.indexOf("/") ?? -1;
|
|
644
|
+
if (!modelId || slash <= 0) return purpose ? `The model provider used for ${purpose}` : "The model provider";
|
|
645
|
+
const vendor = modelId.slice(0, slash);
|
|
646
|
+
const model = modelId.slice(slash + 1);
|
|
647
|
+
const details = purpose ? `${model}, used for ${purpose}` : model;
|
|
648
|
+
return `${PROVIDER_NAMES[vendor] ?? vendor} (${details})`;
|
|
649
|
+
}
|
|
650
|
+
const UPSTREAM = "This is an upstream provider problem, not something you did. Please try again shortly.";
|
|
624
651
|
const PROVIDER_ERROR_MESSAGES = {
|
|
625
|
-
capacity:
|
|
626
|
-
rate_limit:
|
|
627
|
-
timeout:
|
|
628
|
-
network:
|
|
629
|
-
server:
|
|
630
|
-
auth:
|
|
631
|
-
permission:
|
|
632
|
-
quota:
|
|
633
|
-
content_policy:
|
|
634
|
-
invalid_request:
|
|
635
|
-
invalid_response:
|
|
636
|
-
unknown:
|
|
652
|
+
capacity: (subject) => `${subject} is at capacity right now. ${UPSTREAM}`,
|
|
653
|
+
rate_limit: (subject) => `${subject} is rate-limiting requests right now. Please try again shortly.`,
|
|
654
|
+
timeout: (subject) => `${subject} is timing out right now. ${UPSTREAM}`,
|
|
655
|
+
network: (subject) => `${subject} cannot be reached right now. ${UPSTREAM}`,
|
|
656
|
+
server: (subject) => `${subject} is returning errors right now. ${UPSTREAM}`,
|
|
657
|
+
auth: (subject) => `${subject} rejected the configured credentials. This needs an administrator or configuration fix.`,
|
|
658
|
+
permission: (subject) => `${subject} denied access to this model or request. Ask an administrator to check model access, organization policy, and region availability.`,
|
|
659
|
+
quota: (subject) => `${subject} reports that the usage quota is exhausted. This needs an administrator or billing configuration fix.`,
|
|
660
|
+
content_policy: (subject) => `${subject} blocked this request under its content policy. Please revise the request and try again.`,
|
|
661
|
+
invalid_request: (subject) => `${subject} rejected this request as invalid. Please revise the request or ask an administrator to check the model configuration.`,
|
|
662
|
+
invalid_response: (subject) => `${subject} returned an invalid response. ${UPSTREAM}`,
|
|
663
|
+
unknown: (subject) => `${subject} returned an error. ${UPSTREAM}`
|
|
637
664
|
};
|
|
638
|
-
/**
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
665
|
+
/**
|
|
666
|
+
* Return stable, sanitized copy suitable for a terminal user response. It
|
|
667
|
+
* names the provider and model, and `purpose` names the step that the model
|
|
668
|
+
* serves when it is not the agent model.
|
|
669
|
+
*/
|
|
670
|
+
function getProviderErrorUserMessage(error, options = {}) {
|
|
671
|
+
const subject = providerSubject(error.modelId, options.purpose);
|
|
672
|
+
if (error.kind === "rate_limit" && error.retryAfterMs) return `${subject} is rate-limiting requests right now. Please try again in about ${Math.max(1, Math.ceil(error.retryAfterMs / 1e3))} seconds.`;
|
|
673
|
+
return PROVIDER_ERROR_MESSAGES[error.kind](subject);
|
|
642
674
|
}
|
|
643
675
|
/** Return safe structured fields for terminal failure telemetry. */
|
|
644
676
|
function getProviderErrorAttributes(error) {
|
|
@@ -668,6 +700,7 @@ const RUNTIME_INPUT_TAGS = [
|
|
|
668
700
|
"agent-result",
|
|
669
701
|
"agent-message",
|
|
670
702
|
"parent-agent-task",
|
|
703
|
+
"inbox-item-answer",
|
|
671
704
|
"review-item-answer",
|
|
672
705
|
"review-item-dismissed",
|
|
673
706
|
"relayed-review-item-answer",
|
|
@@ -1328,7 +1361,7 @@ async function readServedProviders(state, modelId) {
|
|
|
1328
1361
|
}));
|
|
1329
1362
|
}
|
|
1330
1363
|
async function gatewayOnlyForModel(modelId) {
|
|
1331
|
-
const { getStateAdapter } = await import("./adapter-
|
|
1364
|
+
const { getStateAdapter } = await import("./adapter-CYAvJzZS.js").then((n) => n.t);
|
|
1332
1365
|
const state = getStateAdapter();
|
|
1333
1366
|
const enabled = await readLocal(localEnabledProviders, "enabled", () => readEnabledProviders(state));
|
|
1334
1367
|
if (enabled === null) return void 0;
|
|
@@ -1965,7 +1998,6 @@ function toPiReasoningLevel(level) {
|
|
|
1965
1998
|
return level === "none" ? "off" : level;
|
|
1966
1999
|
}
|
|
1967
2000
|
// src/chat/config.ts
|
|
1968
|
-
var config_exports = /* @__PURE__ */ __exportAll({ botConfig: () => botConfig });
|
|
1969
2001
|
const MIN_AGENT_TURN_TIMEOUT_MS = 1e4;
|
|
1970
2002
|
const DEFAULT_AGENT_TURN_TIMEOUT_MS = 72e4;
|
|
1971
2003
|
const MAX_SLICES_PER_TURN = 100;
|
|
@@ -2296,4 +2328,4 @@ function setSlackReactionConfig(overrides) {
|
|
|
2296
2328
|
if (overrides.processingReactionEmoji !== void 0) chatConfig.slack.processingReactionEmoji = parseReactionEmoji("processingReactionEmoji", overrides.processingReactionEmoji, chatConfig.slack.processingReactionEmoji);
|
|
2297
2329
|
if (overrides.completedReactionEmoji !== void 0) chatConfig.slack.completedReactionEmoji = parseReactionEmoji("completedReactionEmoji", overrides.completedReactionEmoji, chatConfig.slack.completedReactionEmoji);
|
|
2298
2330
|
}
|
|
2299
|
-
export {
|
|
2331
|
+
export { authorAttrs as $, readEnabledProviders as A, requestPrefixAttributes as B, completeText as C, rerankTexts as D, generateImages as E, ACTIVE_LOCK_TTL_MS as F, gatewayRoutingAttributes as G, estimateRequestOverheadTokens as H, MUTATION_LOCK_TTL_MS as I, isCompactionSummaryText as J, COMPACTION_SUMMARY_PREFIX as K, acquireActiveLock as L, saveEnabledProviders as M, cacheKeyPrefix as N, resolveGatewayModel as O, createCache as P, THREAD_CONTEXT_TAGS as Q, fenceLock as R, completeObject as S, gatewayCostUsd as T, estimateTextTokens as U, estimateMessagesTokens as V, textCharsForTokens as W, renderCurrentInstruction as X, hasCurrentInstruction as Y, unwrapCurrentInstruction as Z, toPiReasoningLevel as _, toOptionalTrimmed as _t, getSlackBotToken as a, ProviderError as at, GEN_AI_SERVER_ADDRESS as b, getSlackSigningSecret as c, findProviderError as ct, setBotModelConfig as d, isProviderRefusal as dt, isRuntimeInputText as et, setBotName as f, isProviderRetryError as ft, TURN_REASONING_LEVELS as g, getAttachmentStorage as gt, snapshotRuntimeConfig as h, bufferBody as ht, getRuntimeMetadata as i, renderUntrustedTag as it, readServedProviders as j, searchWeb as k, resetRuntimeConfig as l, getProviderErrorAttributes as lt, setSlackReactionConfig as m, resolveGatewayCredential as mt, botConfig as n, renderParentAgentTask as nt, getSlackClientId as o, createAssistantProviderError as ot, setRuntimeLimits as p, getGatewayApiKey as pt, hasCompactedConversationContext as q, getChatConfig as r, renderThreadContext as rt, getSlackClientSecret as s, createProviderError as st, DEFAULT_SQL_STATEMENT_TIMEOUT_MS as t, readParentAgentTask as tt, restoreRuntimeConfig as u, getProviderErrorUserMessage as ut, normalizeSlackEmojiName as v, embedTexts as w, completeDecision as x, GEN_AI_PROVIDER_NAME as y, withLock as z };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { B as claimProviderConversation, R as setFirstConversationLocation, V as getConversationIdByProviderConversation, a as getConversationStore, o as getDb, s as getSqlExecutor, w as withConversationMutationLock } from "./db-PwSRzWWn.js";
|
|
2
|
+
import { Gr as deleteSlackMessage, Kr as getSlackMessagePermalink, Xr as postSlackMessage, ai as escapeSlackMrkdwnText, oi as formatSlackLink, wi as getDashboardConversationLink } from "./credentialed-Dyv8b-lu.js";
|
|
3
3
|
import { u as parseSlackChannelId, v as parseSlackMessageTs } from "./actor-BsBdxDXQ.js";
|
|
4
|
-
import {
|
|
5
|
-
import { i as getStateAdapter } from "./adapter-
|
|
6
|
-
import "./
|
|
7
|
-
import { q as juniorDestinations } from "./executor-
|
|
4
|
+
import { n as joinPublicChannelForRead, t as checkSlackChannelReadAccess } from "./channel-access-mt7K6dPh.js";
|
|
5
|
+
import { i as getStateAdapter } from "./adapter-CYAvJzZS.js";
|
|
6
|
+
import { mn as moveIdleConversationDestination } from "./turn-membership-DTR3SaKD.js";
|
|
7
|
+
import { q as juniorDestinations } from "./executor-CgWyWfYz.js";
|
|
8
8
|
import { and, eq } from "drizzle-orm";
|
|
9
9
|
// src/chat/slack/continue-in-slack.ts
|
|
10
10
|
/** Refusal for a move that cannot wait for the active Run. */
|
|
@@ -28,10 +28,9 @@ function canContinueInSlack(conversation, access) {
|
|
|
28
28
|
async function movedMessageText(conversation, actorName) {
|
|
29
29
|
const title = conversation.title ?? "Untitled conversation";
|
|
30
30
|
const url = getDashboardConversationLink(conversation.conversationId);
|
|
31
|
-
const brief = await readLatestConversationBrief(getDb(), conversation.conversationId);
|
|
32
31
|
return [
|
|
33
32
|
`*${url ? formatSlackLink(url, title) : escapeSlackMrkdwnText(title)}*`,
|
|
34
|
-
...
|
|
33
|
+
...conversation.summary ? [`> ${escapeSlackMrkdwnText(conversation.summary)}`] : [],
|
|
35
34
|
`${escapeSlackMrkdwnText(actorName)} moved this conversation here from the dashboard. Mention me in this thread to continue.`
|
|
36
35
|
].join("\n");
|
|
37
36
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { G as conversationDetailReportSchema, Ot as messageAttachmentSchema, et as conversationSummaryReportSchema, vt as inboxItemChangeRecordSchema, z as actorIdentitySchema } from "./media-B0pZJ0bG.js";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
// src/api/objects/cards.ts
|
|
4
4
|
const MAX_LABEL_CHARS = 256;
|
|
@@ -12,8 +12,8 @@ function personName(person) {
|
|
|
12
12
|
return person.fullName ?? person.slackUserName ?? person.email;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
-
* Build the card of one Conversation that the viewer may read. Give
|
|
16
|
-
* only when the viewer may see
|
|
15
|
+
* Build the card of one Conversation that the viewer may read. Give
|
|
16
|
+
* `description` only when the viewer may see private content.
|
|
17
17
|
*/
|
|
18
18
|
function conversationObjectCard(args) {
|
|
19
19
|
const { summary } = args;
|
|
@@ -26,7 +26,7 @@ function conversationObjectCard(args) {
|
|
|
26
26
|
title: summary.displayTitle.slice(0, 512),
|
|
27
27
|
url: args.url,
|
|
28
28
|
status: summary.archivedAt ? "archived" : conversationStates[summary.status],
|
|
29
|
-
...args.
|
|
29
|
+
...args.description ? { description: args.description.slice(0, 4e3) } : void 0,
|
|
30
30
|
facts: {
|
|
31
31
|
type: "conversation",
|
|
32
32
|
...participants.length > 0 ? { participants } : void 0,
|
|
@@ -230,8 +230,8 @@ const conversationPendingMessageSchema = z.object({
|
|
|
230
230
|
/** People mentioned in the text, resolved at read time. */
|
|
231
231
|
mentions: z.array(actorIdentitySchema).optional(),
|
|
232
232
|
attachments: z.array(messageAttachmentSchema).optional(),
|
|
233
|
-
/**
|
|
234
|
-
reviewItemChange:
|
|
233
|
+
/** Inbox item change that this Message records. */
|
|
234
|
+
reviewItemChange: inboxItemChangeRecordSchema.optional(),
|
|
235
235
|
redacted: z.literal(true).optional()
|
|
236
236
|
}).strict().superRefine((data, context) => {
|
|
237
237
|
if (data.text === void 0 === (data.redacted !== true)) context.addIssue({
|
|
@@ -240,7 +240,7 @@ const conversationPendingMessageSchema = z.object({
|
|
|
240
240
|
});
|
|
241
241
|
if (data.redacted && (data.actorIdentity || data.attachments || data.mentions || data.reviewItemChange)) context.addIssue({
|
|
242
242
|
code: "custom",
|
|
243
|
-
message: "redacted pending messages must not expose actor identity, attachments, mentions, or
|
|
243
|
+
message: "redacted pending messages must not expose actor identity, attachments, mentions, or an inbox item"
|
|
244
244
|
});
|
|
245
245
|
});
|
|
246
246
|
/** Participant-only authorization prompt for a parked web turn. */
|
|
@@ -268,12 +268,12 @@ const conversationUnchangedDetailWithMailboxSchema = z.object({
|
|
|
268
268
|
}).strict();
|
|
269
269
|
/** Optional filters for cancelling accepted mailbox rows. */
|
|
270
270
|
const cancelConversationPendingMessagesBodySchema = z.object({
|
|
271
|
-
inboundMessageIds: z.array(z.string().min(1)).min(1).optional(),
|
|
272
|
-
receivedBefore: z.string().datetime().optional()
|
|
271
|
+
inboundMessageIds: z.array(z.string().min(1)).min(1).optional().describe("Drop only these waiting messages."),
|
|
272
|
+
receivedBefore: z.string().datetime().optional().describe("Drop only the waiting messages received before this time.")
|
|
273
273
|
}).strict();
|
|
274
274
|
/** Result of cancelling accepted human-facing mailbox rows. */
|
|
275
275
|
const cancelConversationPendingMessagesResponseSchema = z.object({
|
|
276
|
-
cancelledCount: z.number().int().nonnegative(),
|
|
276
|
+
cancelledCount: z.number().int().nonnegative().describe("Messages dropped."),
|
|
277
277
|
cancelledInboundMessageIds: z.array(z.string().min(1)),
|
|
278
278
|
conversationId: z.string().min(1)
|
|
279
279
|
}).strict();
|
|
@@ -284,16 +284,71 @@ const steerConversationPendingMessagesResponseSchema = z.object({
|
|
|
284
284
|
conversationId: z.string().min(1),
|
|
285
285
|
steeredInboundMessageIds: z.array(z.string().min(1))
|
|
286
286
|
}).strict();
|
|
287
|
-
// src/api/schema/conversation-
|
|
287
|
+
// src/api/schema/conversation-archive.ts
|
|
288
288
|
/**
|
|
289
|
-
*
|
|
290
|
-
*
|
|
289
|
+
* Archive or restore one conversation. `applyToChildren` applies to a child
|
|
290
|
+
* only: archive refuses while a descendant is unarchived unless it is true,
|
|
291
|
+
* and restore also restores the descendants archived with the child when it
|
|
292
|
+
* is true. A root archive is per viewer and writes no child rows.
|
|
291
293
|
*/
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
294
|
+
const archiveConversationBodySchema = z.object({
|
|
295
|
+
applyToChildren: z.boolean().optional().describe("On archive, true also archives every child of this conversation at any depth; without it, the archive fails while any of its children is not archived. On restore, true also restores the children that were archived with this conversation."),
|
|
296
|
+
archived: z.boolean().default(true).describe("False restores an archived conversation."),
|
|
297
|
+
lastSeenAt: z.string().datetime().describe("`lastSeenAt` from searchConversations or getConversation. The archive fails when the conversation has newer activity.")
|
|
296
298
|
}).strict();
|
|
299
|
+
const archiveConversationResponseSchema = z.object({ archivedAt: z.string().datetime().nullable().describe("Null when the conversation is not archived.") }).strict();
|
|
300
|
+
/** Viewer's auto-archive choice for one conversation. */
|
|
301
|
+
const conversationAutoArchiveSchema = z.object({ autoArchive: z.boolean().describe("True lets auto-archive archive the conversation for everyone after its work is done. False keeps it from auto-archive for everyone.") }).strict();
|
|
302
|
+
/** Result of archiving all of the viewer's done conversations once. */
|
|
303
|
+
const archiveDoneConversationsResponseSchema = z.object({ archived: z.number().int().nonnegative().describe("Conversations archived.") }).strict();
|
|
304
|
+
// src/api/schema/conversation-pin.ts
|
|
305
|
+
/** Pin or unpin one Conversation for the signed-in viewer. */
|
|
306
|
+
const pinConversationBodySchema = z.object({ pinned: z.boolean().default(true).describe("False unpins the conversation.") }).strict();
|
|
307
|
+
/** The viewer's pin time after the change, or null when unpinned. */
|
|
308
|
+
const pinConversationResponseSchema = z.object({ pinnedAt: z.string().datetime().nullable().describe("Null when the conversation is not pinned.") }).strict();
|
|
309
|
+
/**
|
|
310
|
+
* The viewer's full Pinned order, first to last. Each pin takes its index as
|
|
311
|
+
* its new place.
|
|
312
|
+
*/
|
|
313
|
+
const reorderPinnedConversationsBodySchema = z.object({ conversationIds: z.array(z.string().min(1)).min(1).max(500).refine((ids) => new Set(ids).size === ids.length, { message: "Each Conversation can appear once." }) }).strict();
|
|
314
|
+
/** The pinned Conversations that got a new place, in order. */
|
|
315
|
+
const reorderPinnedConversationsResponseSchema = z.object({ conversationIds: z.array(z.string()) }).strict();
|
|
316
|
+
// src/api/schema/conversation-subscription.ts
|
|
317
|
+
/** Subscribe to or unsubscribe from one Conversation for the viewer. */
|
|
318
|
+
const conversationSubscriptionBodySchema = z.object({ subscribed: z.boolean().describe("False unsubscribes you.") }).strict();
|
|
319
|
+
/**
|
|
320
|
+
* The viewer's subscription after the change. `archivedAt` is set when the
|
|
321
|
+
* viewer was the last subscriber, so the unsubscribe archived the
|
|
322
|
+
* Conversation for everyone.
|
|
323
|
+
*/
|
|
324
|
+
const conversationSubscriptionResponseSchema = z.object({
|
|
325
|
+
archivedAt: z.string().datetime().nullable().describe("Set when the conversation is archived for everyone."),
|
|
326
|
+
subscribed: z.boolean()
|
|
327
|
+
}).strict();
|
|
328
|
+
/** Invite one mentioned person, by Slack user id, to a public Conversation. */
|
|
329
|
+
const conversationInviteBodySchema = z.object({ slackUserId: z.string().min(1).max(64) }).strict();
|
|
330
|
+
/** `added` is false when the person was already a Participant. */
|
|
331
|
+
const conversationInviteResponseSchema = z.object({ added: z.boolean() }).strict();
|
|
332
|
+
// src/api/schema/conversation-stop.ts
|
|
333
|
+
/** One queued web message from the viewer that a stop removed. */
|
|
334
|
+
const stoppedConversationMessageSchema = z.object({
|
|
335
|
+
inboundMessageId: z.string().min(1),
|
|
336
|
+
text: z.string().min(1)
|
|
337
|
+
}).strict();
|
|
338
|
+
/**
|
|
339
|
+
* Result of stopping the active Turn.
|
|
340
|
+
*
|
|
341
|
+
* `stoppedInboundMessageIds` lists every queued human message the stop
|
|
342
|
+
* removes. `stoppedMessages` holds only the viewer's own web text, so the
|
|
343
|
+
* dashboard can return it to the composer.
|
|
344
|
+
*/
|
|
345
|
+
const stopConversationTurnResponseSchema = z.object({
|
|
346
|
+
conversationId: z.string().min(1),
|
|
347
|
+
status: z.enum(["no_work", "requested"]).describe("`requested` when the running turn was asked to stop. `no_work` when no turn was running. Child agents are stopped in both cases."),
|
|
348
|
+
stoppedInboundMessageIds: z.array(z.string().min(1)).describe("Messages that waited for the turn and were dropped."),
|
|
349
|
+
stoppedMessages: z.array(stoppedConversationMessageSchema).describe("Your own dropped messages, with their text.")
|
|
350
|
+
}).strict();
|
|
351
|
+
// src/api/schema/conversation-feed.ts
|
|
297
352
|
const conversationFeedIncludeSchema = z.enum(["links", "media"]);
|
|
298
353
|
/** Query of `GET /api/conversations`. */
|
|
299
354
|
const conversationFeedQuerySchema = z.object({
|
|
@@ -320,7 +375,7 @@ const conversationFeedMediaSchema = z.object({
|
|
|
320
375
|
id: z.string().min(1)
|
|
321
376
|
}).strict();
|
|
322
377
|
/**
|
|
323
|
-
* The viewer's newest answer to
|
|
378
|
+
* The viewer's newest answer to an Inbox item that the Conversation added:
|
|
324
379
|
* when it closed and the options they picked. A text answer has no choices.
|
|
325
380
|
*/
|
|
326
381
|
const conversationFeedViewerAnswerSchema = z.object({
|
|
@@ -332,7 +387,6 @@ const conversationFeedViewerAnswerSchema = z.object({
|
|
|
332
387
|
* its nearest visible Thread ancestor, or under the root. Tasks never show.
|
|
333
388
|
*/
|
|
334
389
|
const conversationFeedItemSchema = conversationSummaryReportSchema.extend({
|
|
335
|
-
brief: conversationFeedBriefSchema.optional(),
|
|
336
390
|
/**
|
|
337
391
|
* Web links from the Conversation's recent messages, newest first, for
|
|
338
392
|
* the row to resolve into cards. URLs only: never message text. Only
|
|
@@ -341,6 +395,11 @@ const conversationFeedItemSchema = conversationSummaryReportSchema.extend({
|
|
|
341
395
|
links: z.array(z.url()).max(3).optional(),
|
|
342
396
|
/** Only with `include=media`. */
|
|
343
397
|
media: z.array(conversationFeedMediaSchema).max(3).optional(),
|
|
398
|
+
/**
|
|
399
|
+
* Threads that `CONVERSATION_FEED_THREAD_LIMIT` left out of `threads`.
|
|
400
|
+
* Only on a root, and only when the cap cut some.
|
|
401
|
+
*/
|
|
402
|
+
omittedThreadCount: z.number().int().positive().optional(),
|
|
344
403
|
threads: z.lazy(() => z.array(conversationFeedItemSchema)).optional(),
|
|
345
404
|
/** Only on the viewer's own feed. */
|
|
346
405
|
viewerAnswer: conversationFeedViewerAnswerSchema.optional()
|
|
@@ -350,6 +409,12 @@ const conversationFeedSchema = z.object({
|
|
|
350
409
|
source: z.literal("conversation_index"),
|
|
351
410
|
generatedAt: z.string(),
|
|
352
411
|
/** Present when older conversations follow this page. */
|
|
353
|
-
nextCursor: z.string().optional()
|
|
412
|
+
nextCursor: z.string().optional(),
|
|
413
|
+
/**
|
|
414
|
+
* Present when `CONVERSATION_FEED_WAITING_LIMIT` cut the waiting rows
|
|
415
|
+
* that this first page adds from outside it. The rest come on later
|
|
416
|
+
* pages.
|
|
417
|
+
*/
|
|
418
|
+
waitingRowsTruncated: z.literal(true).optional()
|
|
354
419
|
}).strict();
|
|
355
|
-
export {
|
|
420
|
+
export { pluginPackageContentReportSchema as A, webPageObjectCard as B, conversationUnchangedDetailWithMailboxSchema as C, pluginOperationalReportFeedSchema as D, healthReportSchema as E, skillReportSchema as F, skillReportsSchema as I, conversationObjectCard as L, pluginsSchema as M, runtimeInfoReportSchema as N, pluginOperationalReportSchema as O, skillDetailReportSchema as P, messageObjectCard as R, conversationPendingMessagesReportSchema as S, steerConversationPendingMessagesResponseSchema as T, cancelConversationPendingMessagesResponseSchema as _, conversationInviteResponseSchema as a, conversationPendingMessageDeliverySchema as b, pinConversationBodySchema as c, reorderPinnedConversationsResponseSchema as d, archiveConversationBodySchema as f, cancelConversationPendingMessagesBodySchema as g, conversationAutoArchiveSchema as h, conversationInviteBodySchema as i, pluginSchema as j, pluginPackageContentItemReportSchema as k, pinConversationResponseSchema as l, archiveDoneConversationsResponseSchema as m, conversationFeedSchema as n, conversationSubscriptionBodySchema as o, archiveConversationResponseSchema as p, stopConversationTurnResponseSchema as r, conversationSubscriptionResponseSchema as s, conversationFeedQuerySchema as t, reorderPinnedConversationsBodySchema as u, conversationDetailWithMailboxReportSchema as v, steerConversationPendingMessagesBodySchema as w, conversationPendingMessageSchema as x, conversationPendingAuthorizationSchema as y, personObjectCard as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h as logWarn } from "./logging-
|
|
1
|
+
import { h as logWarn } from "./logging-DNt-qOIO.js";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
3
|
import { renderSystemMessageUpdate } from "@earendil-works/pi-ai";
|
|
4
4
|
// src/chat/conversation-privacy.ts
|