@botiverse/raft-daemon 0.72.12 → 1.0.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/{chunk-LHJUHF42.js → chunk-FGXAADHM.js} +202 -11
- package/dist/cli/index.js +115 -13
- package/dist/core.js +1 -1
- package/dist/{dist-ME3NQ5JP.js → dist-YLMDSQ55.js} +113 -13
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1359,6 +1359,71 @@ function randomHex(length) {
|
|
|
1359
1359
|
}
|
|
1360
1360
|
|
|
1361
1361
|
// ../shared/src/tracing/eventRows.ts
|
|
1362
|
+
var TRACE_EVENT_ROW_V2_PROJECTION_COLUMNS = [
|
|
1363
|
+
["row_kind", "string"],
|
|
1364
|
+
["service_name", "string"],
|
|
1365
|
+
["deployment_environment", "string"],
|
|
1366
|
+
["service_version", "string"],
|
|
1367
|
+
["service_revision", "string"],
|
|
1368
|
+
["service_instance_id", "string"],
|
|
1369
|
+
["deployment_instance_source", "string"],
|
|
1370
|
+
["deployment_identity_state", "string"],
|
|
1371
|
+
["ecs_task_id", "string"],
|
|
1372
|
+
["ecs_task_family", "string"],
|
|
1373
|
+
["ecs_task_revision", "string"],
|
|
1374
|
+
["trace_id", "string"],
|
|
1375
|
+
["span_id", "string"],
|
|
1376
|
+
["parent_span_id", "string"],
|
|
1377
|
+
["span_name", "string"],
|
|
1378
|
+
["span_kind", "string"],
|
|
1379
|
+
["span_surface", "string"],
|
|
1380
|
+
["span_status", "string"],
|
|
1381
|
+
["span_start_time_ms", "int"],
|
|
1382
|
+
["span_end_time_ms", "int"],
|
|
1383
|
+
["event_name", "string"],
|
|
1384
|
+
["event_kind", "string"],
|
|
1385
|
+
["event_time", "timestamp"],
|
|
1386
|
+
["event_time_ms", "int"],
|
|
1387
|
+
["event_index", "int"],
|
|
1388
|
+
["server_id", "string"],
|
|
1389
|
+
["machine_id", "string"],
|
|
1390
|
+
["agent_id", "string"],
|
|
1391
|
+
["launch_id", "string"],
|
|
1392
|
+
["session_id", "string"],
|
|
1393
|
+
["request_id", "string"],
|
|
1394
|
+
["route_pattern", "string"],
|
|
1395
|
+
["caller_kind", "string"],
|
|
1396
|
+
["outcome", "string"],
|
|
1397
|
+
["reason", "string"],
|
|
1398
|
+
["source", "string"],
|
|
1399
|
+
["authority", "string"],
|
|
1400
|
+
["activity_write_site", "string"],
|
|
1401
|
+
["activity_source", "string"],
|
|
1402
|
+
["hint_source", "string"],
|
|
1403
|
+
["resolved_activity", "string"],
|
|
1404
|
+
["previous_activity", "string"],
|
|
1405
|
+
["next_activity", "string"],
|
|
1406
|
+
["repair_kind", "string"],
|
|
1407
|
+
["action", "string"],
|
|
1408
|
+
["error_class", "string"],
|
|
1409
|
+
["status_bucket", "string"],
|
|
1410
|
+
["shadow_agent_id", "string"],
|
|
1411
|
+
["shadow_signal_site", "string"],
|
|
1412
|
+
["shadow_observation_class", "string"],
|
|
1413
|
+
["shadow_prior_projection", "string"],
|
|
1414
|
+
["shadow_projection", "string"],
|
|
1415
|
+
["shadow_legacy_outcome", "string"],
|
|
1416
|
+
["shadow_action", "string"],
|
|
1417
|
+
["shadow_reason", "string"],
|
|
1418
|
+
["shadow_direction", "string"],
|
|
1419
|
+
["shadow_plan_kind", "string"]
|
|
1420
|
+
];
|
|
1421
|
+
var TRACE_EVENT_ROW_V2_INGEST_STATEMENT = [
|
|
1422
|
+
"SELECT",
|
|
1423
|
+
TRACE_EVENT_ROW_V2_PROJECTION_COLUMNS.map(([column, type]) => `$0["${column}"]::${type} AS ${column}`).join(", "),
|
|
1424
|
+
"INSERT INTO raft.trace_events_v2",
|
|
1425
|
+
`(${TRACE_EVENT_ROW_V2_PROJECTION_COLUMNS.map(([column]) => column).join(", ")})`
|
|
1426
|
+
].join(" ");
|
|
1362
1427
|
var PROMOTED_IDENTITY_ATTRS = [
|
|
1363
1428
|
"server_id",
|
|
1364
1429
|
"machine_id",
|
|
@@ -2020,7 +2085,7 @@ var integrationAppDraftFieldsSchema = z.object({
|
|
|
2020
2085
|
var integrationRegisterAppOperationSchema = integrationAppDraftFieldsSchema.extend({
|
|
2021
2086
|
type: z.literal("integration:register_app"),
|
|
2022
2087
|
name: z.string().trim().min(1).max(120),
|
|
2023
|
-
clientKey: z.string().trim().min(1).max(120),
|
|
2088
|
+
clientKey: z.string().trim().min(1).max(120).optional(),
|
|
2024
2089
|
returnUrl: z.string().trim().min(1).max(2e3),
|
|
2025
2090
|
scopes: z.array(z.string().trim().min(1).max(120)).max(64).default([]),
|
|
2026
2091
|
unsafeDemoUrlOverride: z.boolean().optional(),
|
|
@@ -2440,10 +2505,8 @@ var agentApiIntegrationLoginBodySchema = passthroughObject({
|
|
|
2440
2505
|
scopes: optionalStringArraySchema,
|
|
2441
2506
|
target: optionalStringSchema
|
|
2442
2507
|
});
|
|
2443
|
-
var
|
|
2444
|
-
mode: z3.enum(["register", "update"]),
|
|
2508
|
+
var agentApiIntegrationAppPrepareCommonBodyShape = {
|
|
2445
2509
|
target: z3.string().trim().min(1),
|
|
2446
|
-
clientKey: z3.string().trim().min(1),
|
|
2447
2510
|
name: optionalStringSchema,
|
|
2448
2511
|
description: optionalStringSchema,
|
|
2449
2512
|
homepageUrl: optionalStringSchema,
|
|
@@ -2452,7 +2515,19 @@ var agentApiIntegrationAppPrepareBodySchema = passthroughObject({
|
|
|
2452
2515
|
scopes: optionalStringArraySchema,
|
|
2453
2516
|
unsafeDemoUrlOverride: optionalBooleanSchema,
|
|
2454
2517
|
draftHint: optionalStringSchema
|
|
2455
|
-
}
|
|
2518
|
+
};
|
|
2519
|
+
var agentApiIntegrationAppPrepareBodySchema = z3.discriminatedUnion("mode", [
|
|
2520
|
+
passthroughObject({
|
|
2521
|
+
mode: z3.literal("register"),
|
|
2522
|
+
...agentApiIntegrationAppPrepareCommonBodyShape,
|
|
2523
|
+
clientKey: optionalStringSchema
|
|
2524
|
+
}),
|
|
2525
|
+
passthroughObject({
|
|
2526
|
+
mode: z3.literal("update"),
|
|
2527
|
+
...agentApiIntegrationAppPrepareCommonBodyShape,
|
|
2528
|
+
clientKey: z3.string().trim().min(1)
|
|
2529
|
+
})
|
|
2530
|
+
]);
|
|
2456
2531
|
var agentApiIntegrationAppRotateSecretBodySchema = passthroughObject({
|
|
2457
2532
|
clientKey: z3.string().trim().min(1)
|
|
2458
2533
|
});
|
|
@@ -5135,14 +5210,14 @@ Threads are sub-conversations attached to a specific message. They let you discu
|
|
|
5135
5210
|
- **Start a new thread**: Use the \`msg=\` field from the header as the thread suffix. For example, if you see \`[target=#general msg=00000000 ...]\`, reply with \`raft message send --target "#general:00000000" <<'${D}'\` followed by the message body and \`${D}\`. The thread will be auto-created if it doesn't exist yet. Example IDs like \`00000000\` are placeholders; real message IDs come from received messages.
|
|
5136
5211
|
- When you send a message, the response includes the message ID. You can use it to start a thread on your own message.
|
|
5137
5212
|
- You can read thread history: \`raft message read --target "#general:00000000"\`
|
|
5138
|
-
-
|
|
5213
|
+
- Unfollowing a thread removes its follow record and stops its ordinary delivery while the parent channel is unmuted: \`raft thread unfollow --target "#general:00000000"\`. A parent channel mute already suppresses ordinary delivery from its threads, so do not unfollow solely to mute the parent channel. Only unfollow when your work in that thread is clearly complete or no longer relevant.
|
|
5139
5214
|
- Threads cannot be nested \u2014 you cannot start a thread inside a thread.`;
|
|
5140
5215
|
}
|
|
5141
5216
|
function buildDiscoverySection() {
|
|
5142
5217
|
return `### Discovering people and channels
|
|
5143
5218
|
|
|
5144
5219
|
Call \`raft server info\` to see all channels in this server, which ones you have joined, other agents, and humans.
|
|
5145
|
-
Visible public channels may appear even when \`joined=false\`. In that state you can still inspect them with \`raft message read\` and \`raft channel members\`, but you cannot send messages there or receive ordinary channel delivery until you join with \`raft channel join --target "#channel-name"\`. Private channels require a human with access to add you. To leave a regular channel you have joined, use \`raft channel leave --target "#channel-name"\`. To mute ordinary Activity delivery
|
|
5220
|
+
Visible public channels may appear even when \`joined=false\`. In that state you can still inspect them with \`raft message read\` and \`raft channel members\`, but you cannot send messages there or receive ordinary channel delivery until you join with \`raft channel join --target "#channel-name"\`. Private channels require a human with access to add you. To leave a regular channel you have joined, use \`raft channel leave --target "#channel-name"\`. To mute ordinary Activity delivery from a regular channel and its threads without leaving, use \`raft channel mute --target "#channel-name"\`; personal @mentions and DMs still pierce (a task pierces only when it personally @mentions you), while existing thread follow records remain. To reverse that setting, use \`raft channel unmute --target "#channel-name"\`. To remove a thread's follow record without leaving its parent channel, use \`raft thread unfollow --target "#channel-name:shortid"\`.
|
|
5146
5221
|
Private channels are membership-gated. If \`raft server info\` shows a channel as private, treat its name, members, and content as private to that channel; do not disclose that information in other channels, DMs, summaries, or task reports unless a human explicitly asks within an authorized context. In \`raft channel members\`, human role labels such as owner/admin show server-level authority; no role label means ordinary member.`;
|
|
5147
5222
|
}
|
|
5148
5223
|
function buildChannelAwarenessSection() {
|
|
@@ -6677,6 +6752,32 @@ async function handleProxyRequest(req, res) {
|
|
|
6677
6752
|
const method = req.method ?? "GET";
|
|
6678
6753
|
const correlationId = randomBytes(8).toString("hex");
|
|
6679
6754
|
let target;
|
|
6755
|
+
const inboundTraceparent = firstRequestHeader(req.headers.traceparent);
|
|
6756
|
+
const parent = parseTraceparent(inboundTraceparent);
|
|
6757
|
+
const traceContextState = parent ? "continued" : inboundTraceparent ? "malformed" : "new_root";
|
|
6758
|
+
let localPathname = "unknown";
|
|
6759
|
+
try {
|
|
6760
|
+
localPathname = new URL2(req.url ?? "/", "http://agent-proxy.local").pathname;
|
|
6761
|
+
} catch {
|
|
6762
|
+
}
|
|
6763
|
+
const proxySpan = registration.tracer.startSpan("daemon.agent_proxy.request", {
|
|
6764
|
+
parent,
|
|
6765
|
+
surface: "daemon",
|
|
6766
|
+
kind: "client",
|
|
6767
|
+
attrs: {
|
|
6768
|
+
route_family: routeFamilyForPath(localPathname),
|
|
6769
|
+
method: normalizedProxyMethod(method),
|
|
6770
|
+
trace_context_state: traceContextState,
|
|
6771
|
+
proxy_launch_id_present: registration.launchId !== null,
|
|
6772
|
+
correlation_id: correlationId
|
|
6773
|
+
}
|
|
6774
|
+
});
|
|
6775
|
+
let proxySpanStatus = "error";
|
|
6776
|
+
let proxySpanEndAttrs = {
|
|
6777
|
+
outcome: "proxy_failure",
|
|
6778
|
+
normalized_code: "transport_failure",
|
|
6779
|
+
response_started: false
|
|
6780
|
+
};
|
|
6680
6781
|
try {
|
|
6681
6782
|
target = new URL2(req.url ?? "/", registration.serverUrl);
|
|
6682
6783
|
const headers = new Headers();
|
|
@@ -6697,6 +6798,7 @@ async function handleProxyRequest(req, res) {
|
|
|
6697
6798
|
headers.set("X-Agent-Id", registration.agentId);
|
|
6698
6799
|
headers.set("X-Slock-Client", "cli");
|
|
6699
6800
|
headers.set("X-Slock-Agent-Active-Capabilities", registration.activeCapabilities);
|
|
6801
|
+
headers.set("traceparent", formatTraceparent(proxySpan.context));
|
|
6700
6802
|
let body;
|
|
6701
6803
|
let rawBodyBuffer;
|
|
6702
6804
|
if (method !== "GET" && method !== "HEAD") {
|
|
@@ -6711,6 +6813,12 @@ async function handleProxyRequest(req, res) {
|
|
|
6711
6813
|
if (method === "GET" && target.pathname === "/internal/agent-api/inbox") {
|
|
6712
6814
|
const localInbox = localAgentApiInboxResponse(registration);
|
|
6713
6815
|
if (localInbox) {
|
|
6816
|
+
proxySpanStatus = "ok";
|
|
6817
|
+
proxySpanEndAttrs = {
|
|
6818
|
+
outcome: "local_response",
|
|
6819
|
+
local_response_kind: "inbox",
|
|
6820
|
+
http_status: localInbox.status
|
|
6821
|
+
};
|
|
6714
6822
|
res.writeHead(localInbox.status, { "content-type": "application/json" });
|
|
6715
6823
|
res.end(JSON.stringify(localInbox.body));
|
|
6716
6824
|
return;
|
|
@@ -6719,6 +6827,12 @@ async function handleProxyRequest(req, res) {
|
|
|
6719
6827
|
if (method === "GET" && target.pathname === "/internal/agent-api/events") {
|
|
6720
6828
|
const localEvents = localAgentApiEventsResponse(registration, target);
|
|
6721
6829
|
if (localEvents) {
|
|
6830
|
+
proxySpanStatus = "ok";
|
|
6831
|
+
proxySpanEndAttrs = {
|
|
6832
|
+
outcome: "local_response",
|
|
6833
|
+
local_response_kind: "events",
|
|
6834
|
+
http_status: localEvents.status
|
|
6835
|
+
};
|
|
6722
6836
|
res.writeHead(localEvents.status, { "content-type": "application/json" });
|
|
6723
6837
|
res.end(JSON.stringify(localEvents.body));
|
|
6724
6838
|
return;
|
|
@@ -6728,6 +6842,12 @@ async function handleProxyRequest(req, res) {
|
|
|
6728
6842
|
const rawBody = rawBodyBuffer?.toString("utf8") ?? "";
|
|
6729
6843
|
const prepared = await prepareAgentApiSideEffectForward(registration, headers, rawBody, sideEffectAction);
|
|
6730
6844
|
if (prepared.localResponse) {
|
|
6845
|
+
proxySpanStatus = "ok";
|
|
6846
|
+
proxySpanEndAttrs = {
|
|
6847
|
+
outcome: "local_response",
|
|
6848
|
+
local_response_kind: "freshness_hold",
|
|
6849
|
+
http_status: 200
|
|
6850
|
+
};
|
|
6731
6851
|
const responseText = JSON.stringify(prepared.localResponse);
|
|
6732
6852
|
res.writeHead(200, { "content-type": "application/json" });
|
|
6733
6853
|
res.end(responseText);
|
|
@@ -6750,10 +6870,23 @@ async function handleProxyRequest(req, res) {
|
|
|
6750
6870
|
);
|
|
6751
6871
|
if (upstream.status >= 500) {
|
|
6752
6872
|
const transportError = transportNormalizedErrorForHttpStatus(target, upstream.status, registration.launchId);
|
|
6873
|
+
proxySpanStatus = "error";
|
|
6874
|
+
proxySpanEndAttrs = {
|
|
6875
|
+
outcome: "upstream_5xx",
|
|
6876
|
+
http_status: upstream.status,
|
|
6877
|
+
normalized_code: transportError.normalizedCode,
|
|
6878
|
+
response_started: transportError.responseStarted
|
|
6879
|
+
};
|
|
6753
6880
|
logger.warn(
|
|
6754
6881
|
`[Agent Credential Proxy] upstream returned HTTP ${upstream.status} (agent=${registration.agentId}, launch=${registration.launchId ?? "none"}, correlation=${correlationId}, method=${method}, path=${target.pathname}, route_family=${transportError.routeFamily}, target_host_class=${transportError.targetHostClass})`
|
|
6755
6882
|
);
|
|
6756
6883
|
registration.inboxCoordinator?.recordTransportNormalizedError?.(transportError);
|
|
6884
|
+
} else {
|
|
6885
|
+
proxySpanStatus = "ok";
|
|
6886
|
+
proxySpanEndAttrs = {
|
|
6887
|
+
outcome: "upstream_response",
|
|
6888
|
+
http_status: upstream.status
|
|
6889
|
+
};
|
|
6757
6890
|
}
|
|
6758
6891
|
if (shouldBufferJsonResponse(upstream, target.pathname, registration)) {
|
|
6759
6892
|
const responseText = await upstream.text();
|
|
@@ -6785,9 +6918,29 @@ async function handleProxyRequest(req, res) {
|
|
|
6785
6918
|
);
|
|
6786
6919
|
registration.inboxCoordinator?.recordProxyFailure?.(failure);
|
|
6787
6920
|
registration.inboxCoordinator?.recordTransportNormalizedError?.(transportError);
|
|
6921
|
+
proxySpanStatus = "error";
|
|
6922
|
+
proxySpanEndAttrs = {
|
|
6923
|
+
outcome: "proxy_failure",
|
|
6924
|
+
normalized_code: transportError.normalizedCode,
|
|
6925
|
+
response_started: transportError.responseStarted,
|
|
6926
|
+
...transportError.upstreamStatus === void 0 ? {} : { http_status: transportError.upstreamStatus }
|
|
6927
|
+
};
|
|
6788
6928
|
writeProxyFailureResponse(res, failure);
|
|
6929
|
+
} finally {
|
|
6930
|
+
proxySpan.end(proxySpanStatus, { attrs: proxySpanEndAttrs });
|
|
6789
6931
|
}
|
|
6790
6932
|
}
|
|
6933
|
+
function firstRequestHeader(value) {
|
|
6934
|
+
if (typeof value === "string") return value;
|
|
6935
|
+
return value?.[0];
|
|
6936
|
+
}
|
|
6937
|
+
function normalizedProxyMethod(method) {
|
|
6938
|
+
const normalized = method.toUpperCase();
|
|
6939
|
+
if (normalized === "GET" || normalized === "POST" || normalized === "PUT" || normalized === "PATCH" || normalized === "DELETE" || normalized === "HEAD" || normalized === "OPTIONS") {
|
|
6940
|
+
return normalized;
|
|
6941
|
+
}
|
|
6942
|
+
return "OTHER";
|
|
6943
|
+
}
|
|
6791
6944
|
function writeProxyFailureResponse(res, failure) {
|
|
6792
6945
|
if (res.writableEnded) return;
|
|
6793
6946
|
if (res.headersSent) {
|
|
@@ -7087,7 +7240,12 @@ async function loadRecentTargetMessages(registration, headers, target) {
|
|
|
7087
7240
|
const historyHeaders = new Headers(headers);
|
|
7088
7241
|
historyHeaders.delete("content-length");
|
|
7089
7242
|
historyHeaders.delete("content-type");
|
|
7090
|
-
const res = await
|
|
7243
|
+
const res = await daemonFetch(
|
|
7244
|
+
historyUrl,
|
|
7245
|
+
{ method: "GET", headers: historyHeaders },
|
|
7246
|
+
process.env,
|
|
7247
|
+
{ isolationKey: AGENT_CREDENTIAL_PROXY_FETCH_ISOLATION_KEY }
|
|
7248
|
+
);
|
|
7091
7249
|
if (!res.ok) return [];
|
|
7092
7250
|
const parsed = await res.json().catch(() => null);
|
|
7093
7251
|
return Array.isArray(parsed?.messages) ? normalizeInboxVisibleMessages(parsed.messages, target) : [];
|
|
@@ -7203,7 +7361,8 @@ async function registerAgentCredentialProxy(input) {
|
|
|
7203
7361
|
agentId: input.agentId,
|
|
7204
7362
|
launchId: input.launchId ?? null,
|
|
7205
7363
|
activeCapabilities: input.activeCapabilities,
|
|
7206
|
-
inboxCoordinator: input.inboxCoordinator
|
|
7364
|
+
inboxCoordinator: input.inboxCoordinator,
|
|
7365
|
+
tracer: input.tracer ?? noopTracer
|
|
7207
7366
|
});
|
|
7208
7367
|
return {
|
|
7209
7368
|
proxyUrl: server.proxyUrl,
|
|
@@ -7462,7 +7621,8 @@ async function prepareCliTransport(ctx, extraEnv = {}, platform = process.platfo
|
|
|
7462
7621
|
serverUrl: ctx.config.serverUrl,
|
|
7463
7622
|
apiKey: agentCredentialKey,
|
|
7464
7623
|
activeCapabilities: DEFAULT_ACTIVE_CAPABILITIES,
|
|
7465
|
-
inboxCoordinator: ctx.agentCredentialProxyInboxCoordinator
|
|
7624
|
+
inboxCoordinator: ctx.agentCredentialProxyInboxCoordinator,
|
|
7625
|
+
tracer: ctx.tracer
|
|
7466
7626
|
});
|
|
7467
7627
|
const launchPart = buildCliTransportLaunchPart(ctx.launchId);
|
|
7468
7628
|
const proxyTokenDir = path2.join(slockHome, "agent-proxy-tokens", safePathPart(ctx.agentId));
|
|
@@ -21902,6 +22062,10 @@ var systemClock = {
|
|
|
21902
22062
|
clearTimeout: (timer) => clearTimeout(timer)
|
|
21903
22063
|
};
|
|
21904
22064
|
var INBOUND_WATCHDOG_MS = 7e4;
|
|
22065
|
+
var LEGACY_MACHINE_KEY_MIGRATED_REASON = "legacy_machine_key_migrated";
|
|
22066
|
+
function isTerminalMigratedKeyRejection(statusCode, reason) {
|
|
22067
|
+
return statusCode === 401 && reason === LEGACY_MACHINE_KEY_MIGRATED_REASON;
|
|
22068
|
+
}
|
|
21905
22069
|
function normalizeHandshakeReason(value) {
|
|
21906
22070
|
const raw = Array.isArray(value) ? value[0] : value;
|
|
21907
22071
|
if (typeof raw !== "string") return null;
|
|
@@ -22078,6 +22242,17 @@ var DaemonConnection = class {
|
|
|
22078
22242
|
slock_reason_present: Boolean(reason),
|
|
22079
22243
|
slock_reason: reason
|
|
22080
22244
|
}, "error");
|
|
22245
|
+
if (isTerminalMigratedKeyRejection(statusCode, reason)) {
|
|
22246
|
+
this.shouldConnect = false;
|
|
22247
|
+
logger.error(
|
|
22248
|
+
'[Daemon] This legacy machine key was already migrated to Raft Computer. Reconnects are stopped because this key cannot authenticate again.\nStop and disable this legacy raft-daemon process. In Raft, open this offline Computer and choose "raft-computer: command not found? Install or re-run setup" to copy the install and setup commands for this server.'
|
|
22249
|
+
);
|
|
22250
|
+
this.trace("daemon.connection.reconnect_stopped", {
|
|
22251
|
+
status_code: statusCode,
|
|
22252
|
+
slock_reason: reason,
|
|
22253
|
+
terminal: true
|
|
22254
|
+
}, "error");
|
|
22255
|
+
}
|
|
22081
22256
|
this.options.onHandshakeRejected?.({ statusCode, reason });
|
|
22082
22257
|
response.resume();
|
|
22083
22258
|
try {
|
|
@@ -24670,6 +24845,22 @@ var DAEMON_CORE_TRACE_ATTR_CONTRACTS = {
|
|
|
24670
24845
|
},
|
|
24671
24846
|
endAttrs: ["outcome", "ackSeq", "deliveryId", "error_class", "pending_count"]
|
|
24672
24847
|
},
|
|
24848
|
+
"daemon.agent_proxy.request": {
|
|
24849
|
+
spanAttrs: [
|
|
24850
|
+
"route_family",
|
|
24851
|
+
"method",
|
|
24852
|
+
"trace_context_state",
|
|
24853
|
+
"proxy_launch_id_present",
|
|
24854
|
+
"correlation_id"
|
|
24855
|
+
],
|
|
24856
|
+
endAttrs: [
|
|
24857
|
+
"outcome",
|
|
24858
|
+
"local_response_kind",
|
|
24859
|
+
"http_status",
|
|
24860
|
+
"normalized_code",
|
|
24861
|
+
"response_started"
|
|
24862
|
+
]
|
|
24863
|
+
},
|
|
24673
24864
|
"daemon.runtime_profile.control.received": {
|
|
24674
24865
|
spanAttrs: ["agentId", "control_kind", "key_present", "launchId"],
|
|
24675
24866
|
endAttrs: ["outcome", "error_class"]
|
|
@@ -24905,7 +25096,7 @@ function resolveSlockCliPathOrEmpty(moduleUrl = import.meta.url) {
|
|
|
24905
25096
|
}
|
|
24906
25097
|
async function runBundledSlockCli(argv) {
|
|
24907
25098
|
process.argv = [process.execPath, "slock", ...argv];
|
|
24908
|
-
await import("./dist-
|
|
25099
|
+
await import("./dist-YLMDSQ55.js");
|
|
24909
25100
|
}
|
|
24910
25101
|
function detectRuntimes(tracer = noopTracer) {
|
|
24911
25102
|
const ids = [];
|
package/dist/cli/index.js
CHANGED
|
@@ -28774,6 +28774,71 @@ function randomHex(length) {
|
|
|
28774
28774
|
|
|
28775
28775
|
// ../shared/src/tracing/eventRows.ts
|
|
28776
28776
|
init_esm_shims();
|
|
28777
|
+
var TRACE_EVENT_ROW_V2_PROJECTION_COLUMNS = [
|
|
28778
|
+
["row_kind", "string"],
|
|
28779
|
+
["service_name", "string"],
|
|
28780
|
+
["deployment_environment", "string"],
|
|
28781
|
+
["service_version", "string"],
|
|
28782
|
+
["service_revision", "string"],
|
|
28783
|
+
["service_instance_id", "string"],
|
|
28784
|
+
["deployment_instance_source", "string"],
|
|
28785
|
+
["deployment_identity_state", "string"],
|
|
28786
|
+
["ecs_task_id", "string"],
|
|
28787
|
+
["ecs_task_family", "string"],
|
|
28788
|
+
["ecs_task_revision", "string"],
|
|
28789
|
+
["trace_id", "string"],
|
|
28790
|
+
["span_id", "string"],
|
|
28791
|
+
["parent_span_id", "string"],
|
|
28792
|
+
["span_name", "string"],
|
|
28793
|
+
["span_kind", "string"],
|
|
28794
|
+
["span_surface", "string"],
|
|
28795
|
+
["span_status", "string"],
|
|
28796
|
+
["span_start_time_ms", "int"],
|
|
28797
|
+
["span_end_time_ms", "int"],
|
|
28798
|
+
["event_name", "string"],
|
|
28799
|
+
["event_kind", "string"],
|
|
28800
|
+
["event_time", "timestamp"],
|
|
28801
|
+
["event_time_ms", "int"],
|
|
28802
|
+
["event_index", "int"],
|
|
28803
|
+
["server_id", "string"],
|
|
28804
|
+
["machine_id", "string"],
|
|
28805
|
+
["agent_id", "string"],
|
|
28806
|
+
["launch_id", "string"],
|
|
28807
|
+
["session_id", "string"],
|
|
28808
|
+
["request_id", "string"],
|
|
28809
|
+
["route_pattern", "string"],
|
|
28810
|
+
["caller_kind", "string"],
|
|
28811
|
+
["outcome", "string"],
|
|
28812
|
+
["reason", "string"],
|
|
28813
|
+
["source", "string"],
|
|
28814
|
+
["authority", "string"],
|
|
28815
|
+
["activity_write_site", "string"],
|
|
28816
|
+
["activity_source", "string"],
|
|
28817
|
+
["hint_source", "string"],
|
|
28818
|
+
["resolved_activity", "string"],
|
|
28819
|
+
["previous_activity", "string"],
|
|
28820
|
+
["next_activity", "string"],
|
|
28821
|
+
["repair_kind", "string"],
|
|
28822
|
+
["action", "string"],
|
|
28823
|
+
["error_class", "string"],
|
|
28824
|
+
["status_bucket", "string"],
|
|
28825
|
+
["shadow_agent_id", "string"],
|
|
28826
|
+
["shadow_signal_site", "string"],
|
|
28827
|
+
["shadow_observation_class", "string"],
|
|
28828
|
+
["shadow_prior_projection", "string"],
|
|
28829
|
+
["shadow_projection", "string"],
|
|
28830
|
+
["shadow_legacy_outcome", "string"],
|
|
28831
|
+
["shadow_action", "string"],
|
|
28832
|
+
["shadow_reason", "string"],
|
|
28833
|
+
["shadow_direction", "string"],
|
|
28834
|
+
["shadow_plan_kind", "string"]
|
|
28835
|
+
];
|
|
28836
|
+
var TRACE_EVENT_ROW_V2_INGEST_STATEMENT = [
|
|
28837
|
+
"SELECT",
|
|
28838
|
+
TRACE_EVENT_ROW_V2_PROJECTION_COLUMNS.map(([column, type]) => `$0["${column}"]::${type} AS ${column}`).join(", "),
|
|
28839
|
+
"INSERT INTO raft.trace_events_v2",
|
|
28840
|
+
`(${TRACE_EVENT_ROW_V2_PROJECTION_COLUMNS.map(([column]) => column).join(", ")})`
|
|
28841
|
+
].join(" ");
|
|
28777
28842
|
var PROMOTED_IDENTITY_ATTRS = [
|
|
28778
28843
|
"server_id",
|
|
28779
28844
|
"machine_id",
|
|
@@ -42899,7 +42964,7 @@ var integrationAppDraftFieldsSchema = external_exports.object({
|
|
|
42899
42964
|
var integrationRegisterAppOperationSchema = integrationAppDraftFieldsSchema.extend({
|
|
42900
42965
|
type: external_exports.literal("integration:register_app"),
|
|
42901
42966
|
name: external_exports.string().trim().min(1).max(120),
|
|
42902
|
-
clientKey: external_exports.string().trim().min(1).max(120),
|
|
42967
|
+
clientKey: external_exports.string().trim().min(1).max(120).optional(),
|
|
42903
42968
|
returnUrl: external_exports.string().trim().min(1).max(2e3),
|
|
42904
42969
|
scopes: external_exports.array(external_exports.string().trim().min(1).max(120)).max(64).default([]),
|
|
42905
42970
|
unsafeDemoUrlOverride: external_exports.boolean().optional(),
|
|
@@ -43343,10 +43408,8 @@ var agentApiIntegrationLoginBodySchema = passthroughObject({
|
|
|
43343
43408
|
scopes: optionalStringArraySchema,
|
|
43344
43409
|
target: optionalStringSchema
|
|
43345
43410
|
});
|
|
43346
|
-
var
|
|
43347
|
-
mode: external_exports.enum(["register", "update"]),
|
|
43411
|
+
var agentApiIntegrationAppPrepareCommonBodyShape = {
|
|
43348
43412
|
target: external_exports.string().trim().min(1),
|
|
43349
|
-
clientKey: external_exports.string().trim().min(1),
|
|
43350
43413
|
name: optionalStringSchema,
|
|
43351
43414
|
description: optionalStringSchema,
|
|
43352
43415
|
homepageUrl: optionalStringSchema,
|
|
@@ -43355,7 +43418,19 @@ var agentApiIntegrationAppPrepareBodySchema = passthroughObject({
|
|
|
43355
43418
|
scopes: optionalStringArraySchema,
|
|
43356
43419
|
unsafeDemoUrlOverride: optionalBooleanSchema,
|
|
43357
43420
|
draftHint: optionalStringSchema
|
|
43358
|
-
}
|
|
43421
|
+
};
|
|
43422
|
+
var agentApiIntegrationAppPrepareBodySchema = external_exports.discriminatedUnion("mode", [
|
|
43423
|
+
passthroughObject({
|
|
43424
|
+
mode: external_exports.literal("register"),
|
|
43425
|
+
...agentApiIntegrationAppPrepareCommonBodyShape,
|
|
43426
|
+
clientKey: optionalStringSchema
|
|
43427
|
+
}),
|
|
43428
|
+
passthroughObject({
|
|
43429
|
+
mode: external_exports.literal("update"),
|
|
43430
|
+
...agentApiIntegrationAppPrepareCommonBodyShape,
|
|
43431
|
+
clientKey: external_exports.string().trim().min(1)
|
|
43432
|
+
})
|
|
43433
|
+
]);
|
|
43359
43434
|
var agentApiIntegrationAppRotateSecretBodySchema = passthroughObject({
|
|
43360
43435
|
clientKey: external_exports.string().trim().min(1)
|
|
43361
43436
|
});
|
|
@@ -45404,6 +45479,9 @@ init_esm_shims();
|
|
|
45404
45479
|
// ../shared/src/sync-core/testing.ts
|
|
45405
45480
|
init_esm_shims();
|
|
45406
45481
|
|
|
45482
|
+
// ../shared/src/onboardingStateMachineContract.ts
|
|
45483
|
+
init_esm_shims();
|
|
45484
|
+
|
|
45407
45485
|
// ../shared/src/testing/failpoints.ts
|
|
45408
45486
|
init_esm_shims();
|
|
45409
45487
|
var NoopFailpointRegistry = class {
|
|
@@ -51525,6 +51603,7 @@ function formatPendingMentionActions(actions, opts = {}) {
|
|
|
51525
51603
|
const lines = opts.source === "send" ? [
|
|
51526
51604
|
"Undelivered mentions",
|
|
51527
51605
|
"Message was sent, but these @mentions were not delivered:",
|
|
51606
|
+
"For a literal name rather than a recipient, wrap the @handle in inline or fenced code.",
|
|
51528
51607
|
""
|
|
51529
51608
|
] : ["Pending mention actions", ""];
|
|
51530
51609
|
for (const action of actions) {
|
|
@@ -51538,7 +51617,7 @@ function formatPendingMentionActions(actions, opts = {}) {
|
|
|
51538
51617
|
lines.push(" recovery commands:");
|
|
51539
51618
|
lines.push(...commands);
|
|
51540
51619
|
if (commands.some((command) => command.includes(" mention notify "))) {
|
|
51541
|
-
lines.push(" note: notify
|
|
51620
|
+
lines.push(" note: notify exits nonzero unless the target queue accepts the delivery.");
|
|
51542
51621
|
}
|
|
51543
51622
|
}
|
|
51544
51623
|
}
|
|
@@ -51917,12 +51996,19 @@ ${driveByTip}` : "";
|
|
|
51917
51996
|
if (pendingMentionActions.length > 0) {
|
|
51918
51997
|
writeUndeliveredMentionWarning(ctx.io, pendingMentionActions.length);
|
|
51919
51998
|
}
|
|
51999
|
+
const mentionDeliveryError = pendingMentionActions.length > 0 ? cliError(
|
|
52000
|
+
"MENTION_DELIVERY_FAILED",
|
|
52001
|
+
`Message ${data.messageId} was sent, but ${pendingMentionActions.length} @mention${pendingMentionActions.length === 1 ? " was" : "s were"} not delivered.`,
|
|
52002
|
+
{ suggestedNextAction: "Run `raft mention pending` and complete or explicitly resolve every pending mention action." }
|
|
52003
|
+
) : null;
|
|
51920
52004
|
if (opts.json) {
|
|
51921
52005
|
writeJson(ctx.io, data);
|
|
52006
|
+
if (mentionDeliveryError) throw mentionDeliveryError;
|
|
51922
52007
|
return;
|
|
51923
52008
|
}
|
|
51924
52009
|
writeText(ctx.io, `${sentStatusLine}${replyHint}${driveBySection}${mentionSection}${unreadSection}
|
|
51925
52010
|
`);
|
|
52011
|
+
if (mentionDeliveryError) throw mentionDeliveryError;
|
|
51926
52012
|
}
|
|
51927
52013
|
var messageSendCommand = defineCommand(
|
|
51928
52014
|
{
|
|
@@ -53122,6 +53208,17 @@ init_esm_shims();
|
|
|
53122
53208
|
|
|
53123
53209
|
// src/commands/mention/execute.ts
|
|
53124
53210
|
init_esm_shims();
|
|
53211
|
+
function resultSucceeded(action, status) {
|
|
53212
|
+
return action === "notify" ? status === "queued" : status === "delivered";
|
|
53213
|
+
}
|
|
53214
|
+
function formatFailedMentionActions(action, requestedIds, results) {
|
|
53215
|
+
const returnedIds = new Set(results.map((result2) => result2.resolutionId));
|
|
53216
|
+
const failures = results.filter((result2) => !resultSucceeded(action, result2.status)).map((result2) => `${result2.resolutionId}: ${result2.status}${result2.reason ? ` (${result2.reason})` : ""}`);
|
|
53217
|
+
for (const id of requestedIds) {
|
|
53218
|
+
if (!returnedIds.has(id)) failures.push(`${id}: missing_result`);
|
|
53219
|
+
}
|
|
53220
|
+
return failures.length > 0 ? failures.join(", ") : null;
|
|
53221
|
+
}
|
|
53125
53222
|
function normalizeResolutionIds(rawIds) {
|
|
53126
53223
|
const ids = (rawIds ?? []).map((id) => id.trim()).filter(Boolean);
|
|
53127
53224
|
if (ids.length === 0) {
|
|
@@ -53149,6 +53246,13 @@ function buildMentionExecuteCommand(action) {
|
|
|
53149
53246
|
throw cliError(res.status >= 500 ? "SERVER_5XX" : "MENTION_ACTION_FAILED", res.error ?? `HTTP ${res.status}`);
|
|
53150
53247
|
}
|
|
53151
53248
|
const results = normalizeMentionActionResults(res.data);
|
|
53249
|
+
const failure3 = formatFailedMentionActions(action, ids, results);
|
|
53250
|
+
if (failure3) {
|
|
53251
|
+
throw cliError(
|
|
53252
|
+
"MENTION_ACTION_FAILED",
|
|
53253
|
+
`Mention ${action} did not complete for every requested target: ${failure3}`
|
|
53254
|
+
);
|
|
53255
|
+
}
|
|
53152
53256
|
if (opts.json) {
|
|
53153
53257
|
writeJson(ctx.io, { ok: true, action, results });
|
|
53154
53258
|
return;
|
|
@@ -54731,7 +54835,7 @@ function optionalTrimmed(value) {
|
|
|
54731
54835
|
function formatAppPrepare(data) {
|
|
54732
54836
|
const lines = [
|
|
54733
54837
|
`Integration app ${data.mode} card prepared`,
|
|
54734
|
-
`client key: ${data.action.clientKey}`,
|
|
54838
|
+
`client key: ${data.action.clientKey ?? "auto-generated on commit"}`,
|
|
54735
54839
|
`card: ${data.actionCardMessageId}`,
|
|
54736
54840
|
`target: ${data.target}`
|
|
54737
54841
|
];
|
|
@@ -54749,14 +54853,11 @@ function formatAppPrepare(data) {
|
|
|
54749
54853
|
}
|
|
54750
54854
|
async function prepareApp(mode, ctx, opts) {
|
|
54751
54855
|
const target = requiredTrimmed(opts.target, "--target");
|
|
54752
|
-
const clientKey = requiredTrimmed(opts.clientKey, "--client-key");
|
|
54753
54856
|
const scopes = normalizeScopes3([...opts.scope ?? [], ...opts.scopes ?? []]);
|
|
54754
54857
|
const agentContext = ctx.loadAgentContext();
|
|
54755
54858
|
const client = ctx.createApiClient(agentContext);
|
|
54756
|
-
const
|
|
54757
|
-
mode,
|
|
54859
|
+
const commonBody = {
|
|
54758
54860
|
target,
|
|
54759
|
-
clientKey,
|
|
54760
54861
|
name: optionalTrimmed(opts.name),
|
|
54761
54862
|
description: optionalTrimmed(opts.description),
|
|
54762
54863
|
homepageUrl: optionalTrimmed(opts.homepageUrl) ?? optionalTrimmed(opts.appUrl),
|
|
@@ -54765,7 +54866,8 @@ async function prepareApp(mode, ctx, opts) {
|
|
|
54765
54866
|
scopes,
|
|
54766
54867
|
unsafeDemoUrlOverride: opts.unsafeDemoUrlOverride === true
|
|
54767
54868
|
};
|
|
54768
|
-
|
|
54869
|
+
const body = mode === "update" ? { ...commonBody, mode: "update", clientKey: requiredTrimmed(opts.clientKey, "--client-key") } : { ...commonBody, mode: "register", clientKey: optionalTrimmed(opts.clientKey) };
|
|
54870
|
+
if (body.mode === "register") {
|
|
54769
54871
|
requiredTrimmed(body.name, "--name");
|
|
54770
54872
|
requiredTrimmed(body.returnUrl, "--redirect-url");
|
|
54771
54873
|
}
|
|
@@ -54944,7 +55046,7 @@ var integrationAppPrepareRecoverOwnerCommand = defineCommand(
|
|
|
54944
55046
|
async (ctx, opts) => prepareRecoverOwner(ctx, opts)
|
|
54945
55047
|
);
|
|
54946
55048
|
var sharedOptions = [
|
|
54947
|
-
{ flags: "--client-key <key>", description: "Stable app client key / OAuth client_id to reserve or update" },
|
|
55049
|
+
{ flags: "--client-key <key>", description: "Stable app client key / OAuth client_id to reserve or update; register defaults to server-generated" },
|
|
54948
55050
|
{ flags: "--name <name>", description: "App display name" },
|
|
54949
55051
|
{ flags: "--redirect-url <url>", description: "OAuth redirect/callback URL" },
|
|
54950
55052
|
{ flags: "--app-url <url>", description: "App homepage URL" },
|
package/dist/core.js
CHANGED
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
stageAgentMigrationObjectStoreBundle,
|
|
37
37
|
subscribeDaemonLogs,
|
|
38
38
|
verifyAgentMigrationAdoptPlan
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-FGXAADHM.js";
|
|
40
40
|
export {
|
|
41
41
|
AGENT_MIGRATION_BUNDLE_SCHEMA_VERSION,
|
|
42
42
|
AGENT_MIGRATION_CONTROL_SEAM_ENV,
|
|
@@ -28522,6 +28522,71 @@ function randomHex(length) {
|
|
|
28522
28522
|
return [...bytes].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
28523
28523
|
}
|
|
28524
28524
|
init_esm_shims();
|
|
28525
|
+
var TRACE_EVENT_ROW_V2_PROJECTION_COLUMNS = [
|
|
28526
|
+
["row_kind", "string"],
|
|
28527
|
+
["service_name", "string"],
|
|
28528
|
+
["deployment_environment", "string"],
|
|
28529
|
+
["service_version", "string"],
|
|
28530
|
+
["service_revision", "string"],
|
|
28531
|
+
["service_instance_id", "string"],
|
|
28532
|
+
["deployment_instance_source", "string"],
|
|
28533
|
+
["deployment_identity_state", "string"],
|
|
28534
|
+
["ecs_task_id", "string"],
|
|
28535
|
+
["ecs_task_family", "string"],
|
|
28536
|
+
["ecs_task_revision", "string"],
|
|
28537
|
+
["trace_id", "string"],
|
|
28538
|
+
["span_id", "string"],
|
|
28539
|
+
["parent_span_id", "string"],
|
|
28540
|
+
["span_name", "string"],
|
|
28541
|
+
["span_kind", "string"],
|
|
28542
|
+
["span_surface", "string"],
|
|
28543
|
+
["span_status", "string"],
|
|
28544
|
+
["span_start_time_ms", "int"],
|
|
28545
|
+
["span_end_time_ms", "int"],
|
|
28546
|
+
["event_name", "string"],
|
|
28547
|
+
["event_kind", "string"],
|
|
28548
|
+
["event_time", "timestamp"],
|
|
28549
|
+
["event_time_ms", "int"],
|
|
28550
|
+
["event_index", "int"],
|
|
28551
|
+
["server_id", "string"],
|
|
28552
|
+
["machine_id", "string"],
|
|
28553
|
+
["agent_id", "string"],
|
|
28554
|
+
["launch_id", "string"],
|
|
28555
|
+
["session_id", "string"],
|
|
28556
|
+
["request_id", "string"],
|
|
28557
|
+
["route_pattern", "string"],
|
|
28558
|
+
["caller_kind", "string"],
|
|
28559
|
+
["outcome", "string"],
|
|
28560
|
+
["reason", "string"],
|
|
28561
|
+
["source", "string"],
|
|
28562
|
+
["authority", "string"],
|
|
28563
|
+
["activity_write_site", "string"],
|
|
28564
|
+
["activity_source", "string"],
|
|
28565
|
+
["hint_source", "string"],
|
|
28566
|
+
["resolved_activity", "string"],
|
|
28567
|
+
["previous_activity", "string"],
|
|
28568
|
+
["next_activity", "string"],
|
|
28569
|
+
["repair_kind", "string"],
|
|
28570
|
+
["action", "string"],
|
|
28571
|
+
["error_class", "string"],
|
|
28572
|
+
["status_bucket", "string"],
|
|
28573
|
+
["shadow_agent_id", "string"],
|
|
28574
|
+
["shadow_signal_site", "string"],
|
|
28575
|
+
["shadow_observation_class", "string"],
|
|
28576
|
+
["shadow_prior_projection", "string"],
|
|
28577
|
+
["shadow_projection", "string"],
|
|
28578
|
+
["shadow_legacy_outcome", "string"],
|
|
28579
|
+
["shadow_action", "string"],
|
|
28580
|
+
["shadow_reason", "string"],
|
|
28581
|
+
["shadow_direction", "string"],
|
|
28582
|
+
["shadow_plan_kind", "string"]
|
|
28583
|
+
];
|
|
28584
|
+
var TRACE_EVENT_ROW_V2_INGEST_STATEMENT = [
|
|
28585
|
+
"SELECT",
|
|
28586
|
+
TRACE_EVENT_ROW_V2_PROJECTION_COLUMNS.map(([column, type]) => `$0["${column}"]::${type} AS ${column}`).join(", "),
|
|
28587
|
+
"INSERT INTO raft.trace_events_v2",
|
|
28588
|
+
`(${TRACE_EVENT_ROW_V2_PROJECTION_COLUMNS.map(([column]) => column).join(", ")})`
|
|
28589
|
+
].join(" ");
|
|
28525
28590
|
var PROMOTED_IDENTITY_ATTRS = [
|
|
28526
28591
|
"server_id",
|
|
28527
28592
|
"machine_id",
|
|
@@ -42461,7 +42526,7 @@ var integrationAppDraftFieldsSchema = external_exports.object({
|
|
|
42461
42526
|
var integrationRegisterAppOperationSchema = integrationAppDraftFieldsSchema.extend({
|
|
42462
42527
|
type: external_exports.literal("integration:register_app"),
|
|
42463
42528
|
name: external_exports.string().trim().min(1).max(120),
|
|
42464
|
-
clientKey: external_exports.string().trim().min(1).max(120),
|
|
42529
|
+
clientKey: external_exports.string().trim().min(1).max(120).optional(),
|
|
42465
42530
|
returnUrl: external_exports.string().trim().min(1).max(2e3),
|
|
42466
42531
|
scopes: external_exports.array(external_exports.string().trim().min(1).max(120)).max(64).default([]),
|
|
42467
42532
|
unsafeDemoUrlOverride: external_exports.boolean().optional(),
|
|
@@ -42895,10 +42960,8 @@ var agentApiIntegrationLoginBodySchema = passthroughObject({
|
|
|
42895
42960
|
scopes: optionalStringArraySchema,
|
|
42896
42961
|
target: optionalStringSchema
|
|
42897
42962
|
});
|
|
42898
|
-
var
|
|
42899
|
-
mode: external_exports.enum(["register", "update"]),
|
|
42963
|
+
var agentApiIntegrationAppPrepareCommonBodyShape = {
|
|
42900
42964
|
target: external_exports.string().trim().min(1),
|
|
42901
|
-
clientKey: external_exports.string().trim().min(1),
|
|
42902
42965
|
name: optionalStringSchema,
|
|
42903
42966
|
description: optionalStringSchema,
|
|
42904
42967
|
homepageUrl: optionalStringSchema,
|
|
@@ -42907,7 +42970,19 @@ var agentApiIntegrationAppPrepareBodySchema = passthroughObject({
|
|
|
42907
42970
|
scopes: optionalStringArraySchema,
|
|
42908
42971
|
unsafeDemoUrlOverride: optionalBooleanSchema,
|
|
42909
42972
|
draftHint: optionalStringSchema
|
|
42910
|
-
}
|
|
42973
|
+
};
|
|
42974
|
+
var agentApiIntegrationAppPrepareBodySchema = external_exports.discriminatedUnion("mode", [
|
|
42975
|
+
passthroughObject({
|
|
42976
|
+
mode: external_exports.literal("register"),
|
|
42977
|
+
...agentApiIntegrationAppPrepareCommonBodyShape,
|
|
42978
|
+
clientKey: optionalStringSchema
|
|
42979
|
+
}),
|
|
42980
|
+
passthroughObject({
|
|
42981
|
+
mode: external_exports.literal("update"),
|
|
42982
|
+
...agentApiIntegrationAppPrepareCommonBodyShape,
|
|
42983
|
+
clientKey: external_exports.string().trim().min(1)
|
|
42984
|
+
})
|
|
42985
|
+
]);
|
|
42911
42986
|
var agentApiIntegrationAppRotateSecretBodySchema = passthroughObject({
|
|
42912
42987
|
clientKey: external_exports.string().trim().min(1)
|
|
42913
42988
|
});
|
|
@@ -44918,6 +44993,7 @@ init_esm_shims();
|
|
|
44918
44993
|
init_esm_shims();
|
|
44919
44994
|
init_esm_shims();
|
|
44920
44995
|
init_esm_shims();
|
|
44996
|
+
init_esm_shims();
|
|
44921
44997
|
var NoopFailpointRegistry = class {
|
|
44922
44998
|
get enabled() {
|
|
44923
44999
|
return false;
|
|
@@ -50897,6 +50973,7 @@ function formatPendingMentionActions(actions, opts = {}) {
|
|
|
50897
50973
|
const lines = opts.source === "send" ? [
|
|
50898
50974
|
"Undelivered mentions",
|
|
50899
50975
|
"Message was sent, but these @mentions were not delivered:",
|
|
50976
|
+
"For a literal name rather than a recipient, wrap the @handle in inline or fenced code.",
|
|
50900
50977
|
""
|
|
50901
50978
|
] : ["Pending mention actions", ""];
|
|
50902
50979
|
for (const action of actions) {
|
|
@@ -50910,7 +50987,7 @@ function formatPendingMentionActions(actions, opts = {}) {
|
|
|
50910
50987
|
lines.push(" recovery commands:");
|
|
50911
50988
|
lines.push(...commands);
|
|
50912
50989
|
if (commands.some((command) => command.includes(" mention notify "))) {
|
|
50913
|
-
lines.push(" note: notify
|
|
50990
|
+
lines.push(" note: notify exits nonzero unless the target queue accepts the delivery.");
|
|
50914
50991
|
}
|
|
50915
50992
|
}
|
|
50916
50993
|
}
|
|
@@ -51282,12 +51359,19 @@ ${driveByTip}` : "";
|
|
|
51282
51359
|
if (pendingMentionActions.length > 0) {
|
|
51283
51360
|
writeUndeliveredMentionWarning(ctx.io, pendingMentionActions.length);
|
|
51284
51361
|
}
|
|
51362
|
+
const mentionDeliveryError = pendingMentionActions.length > 0 ? cliError(
|
|
51363
|
+
"MENTION_DELIVERY_FAILED",
|
|
51364
|
+
`Message ${data.messageId} was sent, but ${pendingMentionActions.length} @mention${pendingMentionActions.length === 1 ? " was" : "s were"} not delivered.`,
|
|
51365
|
+
{ suggestedNextAction: "Run `raft mention pending` and complete or explicitly resolve every pending mention action." }
|
|
51366
|
+
) : null;
|
|
51285
51367
|
if (opts.json) {
|
|
51286
51368
|
writeJson(ctx.io, data);
|
|
51369
|
+
if (mentionDeliveryError) throw mentionDeliveryError;
|
|
51287
51370
|
return;
|
|
51288
51371
|
}
|
|
51289
51372
|
writeText(ctx.io, `${sentStatusLine}${replyHint}${driveBySection}${mentionSection}${unreadSection}
|
|
51290
51373
|
`);
|
|
51374
|
+
if (mentionDeliveryError) throw mentionDeliveryError;
|
|
51291
51375
|
}
|
|
51292
51376
|
var messageSendCommand = defineCommand(
|
|
51293
51377
|
{
|
|
@@ -52442,6 +52526,17 @@ function registerTaskUpdateCommand(parent, runtimeOptions) {
|
|
|
52442
52526
|
}
|
|
52443
52527
|
init_esm_shims();
|
|
52444
52528
|
init_esm_shims();
|
|
52529
|
+
function resultSucceeded(action, status) {
|
|
52530
|
+
return action === "notify" ? status === "queued" : status === "delivered";
|
|
52531
|
+
}
|
|
52532
|
+
function formatFailedMentionActions(action, requestedIds, results) {
|
|
52533
|
+
const returnedIds = new Set(results.map((result2) => result2.resolutionId));
|
|
52534
|
+
const failures = results.filter((result2) => !resultSucceeded(action, result2.status)).map((result2) => `${result2.resolutionId}: ${result2.status}${result2.reason ? ` (${result2.reason})` : ""}`);
|
|
52535
|
+
for (const id of requestedIds) {
|
|
52536
|
+
if (!returnedIds.has(id)) failures.push(`${id}: missing_result`);
|
|
52537
|
+
}
|
|
52538
|
+
return failures.length > 0 ? failures.join(", ") : null;
|
|
52539
|
+
}
|
|
52445
52540
|
function normalizeResolutionIds(rawIds) {
|
|
52446
52541
|
const ids = (rawIds ?? []).map((id) => id.trim()).filter(Boolean);
|
|
52447
52542
|
if (ids.length === 0) {
|
|
@@ -52469,6 +52564,13 @@ function buildMentionExecuteCommand(action) {
|
|
|
52469
52564
|
throw cliError(res.status >= 500 ? "SERVER_5XX" : "MENTION_ACTION_FAILED", res.error ?? `HTTP ${res.status}`);
|
|
52470
52565
|
}
|
|
52471
52566
|
const results = normalizeMentionActionResults(res.data);
|
|
52567
|
+
const failure3 = formatFailedMentionActions(action, ids, results);
|
|
52568
|
+
if (failure3) {
|
|
52569
|
+
throw cliError(
|
|
52570
|
+
"MENTION_ACTION_FAILED",
|
|
52571
|
+
`Mention ${action} did not complete for every requested target: ${failure3}`
|
|
52572
|
+
);
|
|
52573
|
+
}
|
|
52472
52574
|
if (opts.json) {
|
|
52473
52575
|
writeJson(ctx.io, { ok: true, action, results });
|
|
52474
52576
|
return;
|
|
@@ -54016,7 +54118,7 @@ function optionalTrimmed(value) {
|
|
|
54016
54118
|
function formatAppPrepare(data) {
|
|
54017
54119
|
const lines = [
|
|
54018
54120
|
`Integration app ${data.mode} card prepared`,
|
|
54019
|
-
`client key: ${data.action.clientKey}`,
|
|
54121
|
+
`client key: ${data.action.clientKey ?? "auto-generated on commit"}`,
|
|
54020
54122
|
`card: ${data.actionCardMessageId}`,
|
|
54021
54123
|
`target: ${data.target}`
|
|
54022
54124
|
];
|
|
@@ -54034,14 +54136,11 @@ function formatAppPrepare(data) {
|
|
|
54034
54136
|
}
|
|
54035
54137
|
async function prepareApp(mode, ctx, opts) {
|
|
54036
54138
|
const target = requiredTrimmed(opts.target, "--target");
|
|
54037
|
-
const clientKey = requiredTrimmed(opts.clientKey, "--client-key");
|
|
54038
54139
|
const scopes = normalizeScopes3([...opts.scope ?? [], ...opts.scopes ?? []]);
|
|
54039
54140
|
const agentContext = ctx.loadAgentContext();
|
|
54040
54141
|
const client = ctx.createApiClient(agentContext);
|
|
54041
|
-
const
|
|
54042
|
-
mode,
|
|
54142
|
+
const commonBody = {
|
|
54043
54143
|
target,
|
|
54044
|
-
clientKey,
|
|
54045
54144
|
name: optionalTrimmed(opts.name),
|
|
54046
54145
|
description: optionalTrimmed(opts.description),
|
|
54047
54146
|
homepageUrl: optionalTrimmed(opts.homepageUrl) ?? optionalTrimmed(opts.appUrl),
|
|
@@ -54050,7 +54149,8 @@ async function prepareApp(mode, ctx, opts) {
|
|
|
54050
54149
|
scopes,
|
|
54051
54150
|
unsafeDemoUrlOverride: opts.unsafeDemoUrlOverride === true
|
|
54052
54151
|
};
|
|
54053
|
-
|
|
54152
|
+
const body = mode === "update" ? { ...commonBody, mode: "update", clientKey: requiredTrimmed(opts.clientKey, "--client-key") } : { ...commonBody, mode: "register", clientKey: optionalTrimmed(opts.clientKey) };
|
|
54153
|
+
if (body.mode === "register") {
|
|
54054
54154
|
requiredTrimmed(body.name, "--name");
|
|
54055
54155
|
requiredTrimmed(body.returnUrl, "--redirect-url");
|
|
54056
54156
|
}
|
|
@@ -54229,7 +54329,7 @@ var integrationAppPrepareRecoverOwnerCommand = defineCommand(
|
|
|
54229
54329
|
async (ctx, opts) => prepareRecoverOwner(ctx, opts)
|
|
54230
54330
|
);
|
|
54231
54331
|
var sharedOptions = [
|
|
54232
|
-
{ flags: "--client-key <key>", description: "Stable app client key / OAuth client_id to reserve or update" },
|
|
54332
|
+
{ flags: "--client-key <key>", description: "Stable app client key / OAuth client_id to reserve or update; register defaults to server-generated" },
|
|
54233
54333
|
{ flags: "--name <name>", description: "App display name" },
|
|
54234
54334
|
{ flags: "--redirect-url <url>", description: "OAuth redirect/callback URL" },
|
|
54235
54335
|
{ flags: "--app-url <url>", description: "App homepage URL" },
|
package/dist/index.js
CHANGED