@skrr-ai/cli 0.1.71 → 0.1.72

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.
@@ -1322,6 +1322,7 @@ class BaseCommand extends core_1.Command {
1322
1322
  exit: 1,
1323
1323
  retryable: isRetryableFailure(e.status, body),
1324
1324
  details: body ?? undefined,
1325
+ requestId: stringProp(body, 'requestId') || e.requestId,
1325
1326
  });
1326
1327
  }
1327
1328
  else if ((0, outbox_1.isOutageFailure)(e)) {
@@ -14,6 +14,7 @@ const node_fs_1 = require("node:fs");
14
14
  const core_1 = require("@oclif/core");
15
15
  const data_provider_1 = require("@skrr-ai/data-provider");
16
16
  const base_command_1 = require("../../base-command");
17
+ const api_fetch_1 = require("../../lib/api-fetch");
17
18
  const agent_home_workspace_1 = require("../../lib/agent-home-workspace");
18
19
  const agentic_stream_1 = require("../../lib/agentic-stream");
19
20
  const web_url_1 = require("../../lib/web-url");
@@ -594,6 +595,7 @@ class AgentsChat extends base_command_1.BaseCommand {
594
595
  quiet,
595
596
  approveTools: flags['approve-tools'],
596
597
  reconcileTerminal,
598
+ replayEnvelopes: (from) => (0, api_fetch_1.apiFetch)(`/api/agentic/sessions/${encodeURIComponent(started.sessionId)}/envelopes?from=${from}&limit=500`, { credential: this.resolvedCredential, signal: AbortSignal.timeout(5000) }),
597
599
  });
598
600
  // OSK-2938 — Ctrl-C must be bounded, visible, and honest about what it
599
601
  // did NOT stop.
@@ -105,6 +105,9 @@ class DedicatedMachinesCp extends base_command_1.BaseCommand {
105
105
  if (err instanceof dedicated_copy_1.DedicatedCopyError) {
106
106
  this.error(err.message, { exit: 1, code: err.code });
107
107
  }
108
+ // Keep the API status, request id and explicit retry decision together.
109
+ if ((0, base_command_1.apiRefusal)(err).body?.retryable === true)
110
+ this.handleApiError(err);
108
111
  const message = (0, dedicated_machines_1.formatDedicatedRuntimeApiError)(err);
109
112
  if (message)
110
113
  this.error(message, { exit: 1, code: (0, dedicated_machines_1.dedicatedRuntimeApiErrorCode)(err) });
@@ -154,6 +154,9 @@ class DedicatedMachinesExec extends base_command_1.BaseCommand {
154
154
  err instanceof dedicated_exec_1.DedicatedExecIdempotencyUnsupportedError) {
155
155
  this.error(err.message, { exit: 1, code: err.code });
156
156
  }
157
+ // Keep the API status, request id and explicit retry decision together.
158
+ if ((0, base_command_1.apiRefusal)(err).body?.retryable === true)
159
+ this.handleApiError(err);
157
160
  const message = (0, dedicated_machines_1.formatDedicatedRuntimeApiError)(err);
158
161
  if (message)
159
162
  this.error(message, { exit: 1, code: (0, dedicated_machines_1.dedicatedRuntimeApiErrorCode)(err) });
@@ -60,6 +60,12 @@ export type ReconciledTerminal = {
60
60
  * drift (OSK-7629).
61
61
  */
62
62
  export declare function writeJsonLine(output: NodeJS.WritableStream, value: unknown): void;
63
+ export type EnvelopeReplayPage = {
64
+ envelopes: unknown[];
65
+ hasMore?: boolean;
66
+ nextSeq?: number;
67
+ gap?: boolean;
68
+ };
63
69
  export type AgenticStreamOptions = {
64
70
  baseURL: string;
65
71
  token: string;
@@ -89,6 +95,10 @@ export type AgenticStreamOptions = {
89
95
  * the stream alone.
90
96
  */
91
97
  reconcileTerminal?: () => Promise<ReconciledTerminal | null>;
98
+ /** Owner-authorized canonical envelopes, including events emitted before room admission. */
99
+ replayEnvelopes?: (from: number) => Promise<EnvelopeReplayPage>;
100
+ /** Bounded live catch-up cadence while a run is active. Default 2s. */
101
+ envelopeReplayIntervalMs?: number;
92
102
  /** Silence before the first durable-record probe. Default 20s. */
93
103
  idleTerminalProbeMs?: number;
94
104
  /** How long to keep trying to attach before reporting a detach. Default 30s. */
@@ -376,6 +386,12 @@ export declare class AgenticStreamClient {
376
386
  private accumulated;
377
387
  /** Highest envelope `__seq` folded into `accumulated`, for gap detection. */
378
388
  private highestSeq;
389
+ private readonly pendingEnvelopes;
390
+ private replayTimer;
391
+ private replayFlight;
392
+ private replayGeneration;
393
+ private replayFailures;
394
+ private finishingReplay;
379
395
  private reportedGap;
380
396
  private readonly seenEnvelopes;
381
397
  /**
@@ -487,6 +503,12 @@ export declare class AgenticStreamClient {
487
503
  * what the run reports — only what the reader is told while it is happening.
488
504
  */
489
505
  private reportSeqGap;
506
+ /** Keep later live frames behind missing earlier frames while canonical replay catches up. */
507
+ private receiveSessionOutput;
508
+ private flushPendingEnvelopes;
509
+ /** Poll even while a tool is quiet: a pre-join start has no later live event to reveal its gap. */
510
+ private catchUpEnvelopes;
511
+ private applySessionOutput;
490
512
  private installHandlers;
491
513
  private handlePermission;
492
514
  private handleQuestion;
@@ -534,6 +556,7 @@ export declare class AgenticStreamClient {
534
556
  private emitToolEvent;
535
557
  private emit;
536
558
  private finish;
559
+ private finishAfterReplay;
537
560
  /**
538
561
  * The answer as the durable record holds it, for a run whose stream had a
539
562
  * hole. Bounded: the record is written before the terminal event is sent, so
@@ -628,6 +628,12 @@ class AgenticStreamClient {
628
628
  accumulated = '';
629
629
  /** Highest envelope `__seq` folded into `accumulated`, for gap detection. */
630
630
  highestSeq = 0;
631
+ pendingEnvelopes = new Map();
632
+ replayTimer = null;
633
+ replayFlight = null;
634
+ replayGeneration = 0;
635
+ replayFailures = 0;
636
+ finishingReplay = false;
631
637
  reportedGap = false;
632
638
  // Envelope keys already applied, so a re-delivered `session:output` frame is
633
639
  // not appended twice (OSK-4834). Cleared on `execution:stream-reset`.
@@ -726,6 +732,7 @@ class AgenticStreamClient {
726
732
  this.socket.emit('session:join', this.sessionJoinPayload());
727
733
  this.emit({ type: 'session.joined', sessionId: this.options.sessionId });
728
734
  this.armIdleProbe();
735
+ void this.catchUpEnvelopes();
729
736
  return result;
730
737
  }
731
738
  /**
@@ -835,6 +842,10 @@ class AgenticStreamClient {
835
842
  clearTimeout(this.idleTimer);
836
843
  this.idleTimer = null;
837
844
  }
845
+ if (this.replayTimer)
846
+ clearTimeout(this.replayTimer);
847
+ this.replayTimer = null;
848
+ this.pendingEnvelopes.clear();
838
849
  this.abandonConnectWait?.();
839
850
  const socket = this.socket;
840
851
  this.socket = null;
@@ -883,12 +894,145 @@ class AgenticStreamClient {
883
894
  this.highestSeq = seq;
884
895
  }
885
896
  }
897
+ /** Keep later live frames behind missing earlier frames while canonical replay catches up. */
898
+ receiveSessionOutput(event) {
899
+ if (this.closed || this.settled)
900
+ return;
901
+ const envelopes = event.envelopes;
902
+ if (!this.options.replayEnvelopes || !Array.isArray(envelopes)) {
903
+ this.applySessionOutput(event);
904
+ return;
905
+ }
906
+ for (const envelope of envelopes) {
907
+ const seq = Number(envelope?.__seq);
908
+ if (!Number.isSafeInteger(seq) || seq <= 0) {
909
+ this.applySessionOutput({ ...event, envelopes: [envelope] });
910
+ }
911
+ else if (seq > this.highestSeq && !this.pendingEnvelopes.has(seq)) {
912
+ this.pendingEnvelopes.set(seq, { envelope, event });
913
+ }
914
+ }
915
+ this.flushPendingEnvelopes(false);
916
+ if (this.pendingEnvelopes.size > 2000)
917
+ this.flushPendingEnvelopes(true);
918
+ if (this.pendingEnvelopes.size)
919
+ void this.catchUpEnvelopes();
920
+ }
921
+ flushPendingEnvelopes(allowGap, through = Infinity) {
922
+ const seqs = [...this.pendingEnvelopes.keys()].sort((a, b) => a - b);
923
+ for (const seq of seqs) {
924
+ if (seq > through)
925
+ break;
926
+ if (!allowGap && seq !== this.highestSeq + 1)
927
+ break;
928
+ const item = this.pendingEnvelopes.get(seq);
929
+ this.pendingEnvelopes.delete(seq);
930
+ this.applySessionOutput({ ...item.event, envelopes: [item.envelope] });
931
+ }
932
+ }
933
+ /** Poll even while a tool is quiet: a pre-join start has no later live event to reveal its gap. */
934
+ catchUpEnvelopes() {
935
+ if (!this.options.replayEnvelopes || this.closed || this.settled)
936
+ return Promise.resolve();
937
+ if (this.replayFlight)
938
+ return this.replayFlight;
939
+ if (this.replayTimer)
940
+ clearTimeout(this.replayTimer);
941
+ this.replayTimer = null;
942
+ const generation = this.replayGeneration;
943
+ this.replayFlight = (async () => {
944
+ try {
945
+ for (let page = 0; page < 4; page += 1) {
946
+ const from = this.highestSeq;
947
+ const result = await this.options.replayEnvelopes(from);
948
+ if (this.closed || this.settled || generation !== this.replayGeneration)
949
+ return;
950
+ this.replayFailures = 0;
951
+ this.receiveSessionOutput({ type: 'session.output', sessionId: this.options.sessionId, source: 'replay', envelopes: result.envelopes });
952
+ // The canonical endpoint explicitly identifies retention gaps. Only
953
+ // then may later frames pass with the existing honest gap notice.
954
+ if (result.gap) {
955
+ // A retention gap proves only this page, never a later live frame.
956
+ const pageSeqs = result.envelopes.map((e) => Number(e?.__seq)).filter(Number.isSafeInteger);
957
+ if (pageSeqs.length)
958
+ this.flushPendingEnvelopes(true, Math.max(...pageSeqs));
959
+ this.flushPendingEnvelopes(false);
960
+ }
961
+ if (!result.hasMore || this.highestSeq <= from)
962
+ break;
963
+ }
964
+ }
965
+ catch {
966
+ // Recovery failure says nothing about the producer. After bounded
967
+ // retries retain the existing live/gap/final-record fallback.
968
+ this.replayFailures += 1;
969
+ if (this.replayFailures >= 3)
970
+ this.flushPendingEnvelopes(true);
971
+ }
972
+ })().finally(() => {
973
+ this.replayFlight = null;
974
+ if (!this.closed && !this.settled && !this.finishingReplay) {
975
+ this.replayTimer = setTimeout(() => void this.catchUpEnvelopes(), this.options.envelopeReplayIntervalMs ?? 2000);
976
+ }
977
+ });
978
+ return this.replayFlight;
979
+ }
980
+ applySessionOutput(event) {
981
+ // The agent's words arrive HERE for agentic runs, inside `envelopes`, and
982
+ // `event.text` is null. Normalising the frame without reading them meant
983
+ // `skrr agents chat` printed two header lines and exited having shown
984
+ // nothing, while the agent had answered perfectly — and `--no-stream
985
+ // --json` returned `status: completed` with `response: ""`.
986
+ //
987
+ // Only `ev.t === 'text'` counts. The same envelope stream carries tool
988
+ // and status frames, and folding those into the answer would put machine
989
+ // chatter in `response`.
990
+ // Dedupe re-delivered envelopes (session room + user room + join replay):
991
+ // append and reprint only the ones we have not applied yet (OSK-4834).
992
+ const rawEnvelopes = event.envelopes;
993
+ if (Array.isArray(rawEnvelopes) && rawEnvelopes.length > 0) {
994
+ const fresh = unseenEnvelopes(event, this.seenEnvelopes);
995
+ if (fresh.length === 0)
996
+ return; // a pure re-delivery — drop it whole
997
+ const scoped = { ...event, envelopes: fresh };
998
+ // Say what never arrived, once, before folding this batch in
999
+ // (OSK-7631). Checked against the FRESH set: a re-delivery carries old
1000
+ // seqs and would read as a gap that never happened.
1001
+ this.reportSeqGap(fresh);
1002
+ const envelopeText = envelopesText(scoped);
1003
+ if (envelopeText) {
1004
+ this.accumulated += envelopeText;
1005
+ this.emit({ ...scoped, type: 'text.delta', text: this.accumulated });
1006
+ }
1007
+ // A daemon-routed turn carries its tool calls HERE and nowhere else.
1008
+ // Projecting them gives both execution paths one vocabulary (OSK-7730).
1009
+ for (const projected of projectDaemonToolEvents(fresh, this.toolNamesByCall)) {
1010
+ this.emitToolEvent({ ...projected, sessionId: this.options.sessionId });
1011
+ }
1012
+ // Notices meant for the person — a local harness that could not resume
1013
+ // its previous session and started a fresh one (OSK-12131). A plain
1014
+ // `service` line is diagnostic chatter and stays in the envelope; one
1015
+ // marked `notice` is said out loud.
1016
+ for (const notice of projectSessionNotices(fresh)) {
1017
+ this.emit({ ...notice, sessionId: this.options.sessionId });
1018
+ }
1019
+ // Who decided each permission request — a person (and where), the
1020
+ // mode, a policy — said beside the decision (OSK-12113).
1021
+ for (const resolved of projectPermissionResolutions(fresh, this.toolNamesByPermission)) {
1022
+ this.emit({ ...resolved, sessionId: this.options.sessionId });
1023
+ }
1024
+ this.emit({ ...scoped, type: 'session.output' });
1025
+ return;
1026
+ }
1027
+ this.emit({ ...event, type: 'session.output' });
1028
+ }
886
1029
  installHandlers() {
887
1030
  const socket = this.socket;
888
1031
  const match = (event) => !event.sessionId || event.sessionId === this.options.sessionId;
889
1032
  socket.on('connect', () => {
890
1033
  socket.emit('session:join', this.sessionJoinPayload());
891
1034
  this.emit({ type: 'transport.connected', sessionId: this.options.sessionId });
1035
+ void this.catchUpEnvelopes();
892
1036
  });
893
1037
  socket.on('disconnect', (reason) => {
894
1038
  this.transportDropped = true;
@@ -942,55 +1086,8 @@ class AgenticStreamClient {
942
1086
  this.emit({ ...event, type: 'text.delta' });
943
1087
  });
944
1088
  socket.on('session:output', (event) => {
945
- if (!match(event))
946
- return;
947
- // The agent's words arrive HERE for agentic runs, inside `envelopes`, and
948
- // `event.text` is null. Normalising the frame without reading them meant
949
- // `skrr agents chat` printed two header lines and exited having shown
950
- // nothing, while the agent had answered perfectly — and `--no-stream
951
- // --json` returned `status: completed` with `response: ""`.
952
- //
953
- // Only `ev.t === 'text'` counts. The same envelope stream carries tool
954
- // and status frames, and folding those into the answer would put machine
955
- // chatter in `response`.
956
- // Dedupe re-delivered envelopes (session room + user room + join replay):
957
- // append and reprint only the ones we have not applied yet (OSK-4834).
958
- const rawEnvelopes = event.envelopes;
959
- if (Array.isArray(rawEnvelopes) && rawEnvelopes.length > 0) {
960
- const fresh = unseenEnvelopes(event, this.seenEnvelopes);
961
- if (fresh.length === 0)
962
- return; // a pure re-delivery — drop it whole
963
- const scoped = { ...event, envelopes: fresh };
964
- // Say what never arrived, once, before folding this batch in
965
- // (OSK-7631). Checked against the FRESH set: a re-delivery carries old
966
- // seqs and would read as a gap that never happened.
967
- this.reportSeqGap(fresh);
968
- const envelopeText = envelopesText(scoped);
969
- if (envelopeText) {
970
- this.accumulated += envelopeText;
971
- this.emit({ ...scoped, type: 'text.delta', text: this.accumulated });
972
- }
973
- // A daemon-routed turn carries its tool calls HERE and nowhere else.
974
- // Projecting them gives both execution paths one vocabulary (OSK-7730).
975
- for (const projected of projectDaemonToolEvents(fresh, this.toolNamesByCall)) {
976
- this.emitToolEvent({ ...projected, sessionId: this.options.sessionId });
977
- }
978
- // Notices meant for the person — a local harness that could not resume
979
- // its previous session and started a fresh one (OSK-12131). A plain
980
- // `service` line is diagnostic chatter and stays in the envelope; one
981
- // marked `notice` is said out loud.
982
- for (const notice of projectSessionNotices(fresh)) {
983
- this.emit({ ...notice, sessionId: this.options.sessionId });
984
- }
985
- // Who decided each permission request — a person (and where), the
986
- // mode, a policy — said beside the decision (OSK-12113).
987
- for (const resolved of projectPermissionResolutions(fresh, this.toolNamesByPermission)) {
988
- this.emit({ ...resolved, sessionId: this.options.sessionId });
989
- }
990
- this.emit({ ...scoped, type: 'session.output' });
991
- return;
992
- }
993
- this.emit({ ...event, type: 'session.output' });
1089
+ if (match(event))
1090
+ this.receiveSessionOutput(event);
994
1091
  });
995
1092
  socket.on('tool:start', (event) => {
996
1093
  if (match(event))
@@ -1011,6 +1108,8 @@ class AgenticStreamClient {
1011
1108
  this.renderedText = '';
1012
1109
  // Seqs restart with the stream, so a fresh low seq is not a gap.
1013
1110
  this.highestSeq = 0;
1111
+ this.replayGeneration += 1;
1112
+ this.pendingEnvelopes.clear();
1014
1113
  this.reportedGap = false;
1015
1114
  // A reset restarts the stream, so envelope seqs may repeat; forget the
1016
1115
  // seen keys or the fresh post-reset text would be deduped away (OSK-4834).
@@ -1429,6 +1528,27 @@ class AgenticStreamClient {
1429
1528
  }
1430
1529
  }
1431
1530
  finish(status, event) {
1531
+ if (this.settled || this.finishingReplay)
1532
+ return;
1533
+ if (this.options.replayEnvelopes) {
1534
+ this.finishingReplay = true;
1535
+ const activeReplay = this.replayFlight;
1536
+ void (async () => {
1537
+ if (activeReplay)
1538
+ await activeReplay;
1539
+ // A request already in flight may have read before the terminal event.
1540
+ await this.catchUpEnvelopes();
1541
+ })().finally(() => {
1542
+ if (this.closed || this.settled)
1543
+ return;
1544
+ this.flushPendingEnvelopes(true);
1545
+ this.finishAfterReplay(status, event);
1546
+ });
1547
+ return;
1548
+ }
1549
+ this.finishAfterReplay(status, event);
1550
+ }
1551
+ finishAfterReplay(status, event) {
1432
1552
  if (this.settled)
1433
1553
  return;
1434
1554
  this.settled = true;
@@ -39213,7 +39213,7 @@ var pf = { notify: { label: "Notice", detail: "Installers are told about a probl
39213
39213
  var mf = { active: { label: "In force", detail: "The remedy applies to every copy running this release." }, lifted: { label: "Lifted", detail: "Two curators lifted the remedy. Copies running this release run as before." }, retracted: { label: "Retracted", detail: "Two curators retracted this advisory as issued in error. It no longer applies." } };
39214
39214
  var ff = Object.freeze(["name", "description", "instructions", "promptComposition", "avatar", "character3DId", "provider", "model", "model_parameters", "artifacts", "access_level", "recursion_limit", "tools", "tool_kwargs", "actions", "hide_sequential_outputs", "end_after_tools", "agent_ids", "network_mode", "network_agent_ids", "network_agent_release_pins", "network_include_public", "conversation_starters", "agentActions", "tool_resources", "category", "support_contact", "shareMode", "skills", "allowedCapabilities", "toolPolicy", "commitmentResponsibilityDefault", "commitmentResponsibilityCeiling", "reasoningToolEscapes", "executionPolicy", "workingDirectory", "defaultPermissionMode", "todoWorkingHours", "welcomeMessage", "installFirstContact", "serviceDelivery", "proactiveInstall", "marketplaceMedia"]);
39215
39215
  var gf = Object.freeze(["executionPolicy", "workingDirectory", "defaultPermissionMode", "tool_resources", "marketplaceMedia"]);
39216
- var vf = Object.freeze(["isAlwaysOn", "alwaysOnControl", "defaultForHarness", "nativeRole", "marketplaceStoreSourceState", "marketplaceStoreSourceReleaseId", "network_shell_write_agent_ids", "installKind"]);
39216
+ var vf = Object.freeze(["isAlwaysOn", "alwaysOnControl", "defaultForHarness", "nativeRole", "marketplaceStoreSourceState", "marketplaceStoreSourceReleaseId", "network_shell_write_agent_ids", "installKind", "marketplaceSpaceId"]);
39217
39217
  var hf = Object.freeze(["_id", "id", "author", "authorName", "workspaceId", "createdAt", "updatedAt", "price", "rating", "ratingCount", "installCount", "is_listed", "is_promoted", "storeFeaturedPlacement", "is_banned", "banned_at", "banned_by", "delisted_at", "delisted_by", "versions", "latestReleaseId", "latestPublicReleaseId", "latestVersionLabel", "installedReleaseId", "forkedFrom", "forkedFromReleaseId", "forkedFromVersionLabel", "releasePolicy", "storeInstallState", "storeInstallReservationId", "storeInstallSourceAgentId", "storeInstallReleaseId", "storeInstallWorkspaceId", "storeInstallReservedAt", "storeInstallExpiresAt", "storeInstallCompletedAt", "storeInstallSharedMemoryDefault", "marketplaceEntitlementState", "marketplaceEntitlementEvidence", "marketplaceFulfillmentState", "marketplaceTeamOrderId", "learnedCapabilityProfile", "directModeRegret", "toneMode", "toneId", "toneNotes", "sceneBackground", "maxTurns", "maxConcurrentTaskExecutions", "projectIds", "isCollaborative", "is_onboarding", "mgmtVersion", "mgmtPublishedAt", "mgmtPublic"]);
39218
39218
  var yf = Object.freeze(ff.filter(function(e2) {
39219
39219
  return !gf.includes(e2);
@@ -41849,7 +41849,7 @@ function FE(e2, t2, n2, o2, r2) {
41849
41849
  var l2 = WE(e3.parts), u2 = r3 ? { id: n3(), kind: "thinking", text: t3.text, status: "streaming" } : { id: n3(), kind: "text", text: t3.text, status: "streaming" };
41850
41850
  return S(S({}, e3), { parts: w(w([], l2, true), [u2], false), updatedAt: o3 });
41851
41851
  })(e2, t2, o2, r2);
41852
- return e2.pending ? a2 : S(S({}, a2), { parts: WE(a2.parts) });
41852
+ return e2.status ? S(S({}, a2), { pending: false, parts: WE(a2.parts) }) : S(S({}, a2), { pending: "agent" === e2.role || e2.pending });
41853
41853
  case "service":
41854
41854
  case "session-handoff":
41855
41855
  case "slash-commands-available":
@@ -41908,7 +41908,7 @@ function FE(e2, t2, n2, o2, r2) {
41908
41908
  return S(S({}, e3), { parts: g2, pending: BE(g2), updatedAt: o3 });
41909
41909
  })(e2, t2, o2, r2);
41910
41910
  case "turn-start":
41911
- return S(S({}, e2), { pending: true, updatedAt: r2 });
41911
+ return S(S({}, e2), { pending: true, status: void 0, updatedAt: r2 });
41912
41912
  case "turn-end":
41913
41913
  return (function(e3, t3, n3) {
41914
41914
  var o3 = (function(e4, t4, n4) {
@@ -45139,10 +45139,10 @@ var gR = Object.freeze({ __proto__: null, acceptAgentIntuition: function(e2, t2,
45139
45139
  return "".concat(er(), "/agents/").concat(e3, "/install");
45140
45140
  })(t2), { releaseId: n2, spaceId: o2, fork: r2, includeBootstrap: a2, includeMemory: i2, proactiveInstall: s2, preinstallReservationId: c2, reservedInstalledAgentId: l2, expectedOfferVersionId: u2, expectedPrice: d2, executionPlacement: p2, outcomeSharing: m2, shareMemory: f2 });
45141
45141
  }, installStoreService: function(e2) {
45142
- var t2 = e2.listingId, n2 = e2.title, o2 = e2.agentMapping;
45142
+ var t2 = e2.listingId, n2 = e2.title, o2 = e2.agentMapping, r2 = e2.acknowledgedRequirements;
45143
45143
  return oR.post((function(e3) {
45144
45144
  return "".concat(er(), "/services/").concat(encodeURIComponent(e3), "/install");
45145
- })(t2), { title: n2, agentMapping: o2 });
45145
+ })(t2), { title: n2, agentMapping: o2, acknowledgedRequirements: r2 });
45146
45146
  }, installStoreTeam: function(e2) {
45147
45147
  var t2 = e2.teamId, n2 = e2.spaceId;
45148
45148
  return oR.post((function(e3) {
@@ -48842,18 +48842,21 @@ exports.describeStoreReleaseAdvisoryStatus = function(e2) {
48842
48842
  }), d2 = new Set(e2.semantic.nodes.map(function(e3) {
48843
48843
  return e3.key;
48844
48844
  })), p2 = e2.semantic.nodes.map(function(e3) {
48845
- for (var t3, n3, o3, r3, a3 = null !== (t3 = dv[e3.type]) && void 0 !== t3 ? t3 : {}, u3 = S({}, null !== (n3 = e3.config) && void 0 !== n3 ? n3 : {}), d3 = 0, p3 = Object.entries(a3); d3 < p3.length; d3++) {
48846
- var m3 = p3[d3], f3 = m3[0], g3 = m3[1];
48847
- if ("keep" !== g3.action) {
48848
- var v3 = Object.prototype.hasOwnProperty.call(u3, f3), h3 = u3[f3];
48849
- if (i2.has("".concat(e3.key, ".").concat(f3))) v3 && !pv(h3) && s2.push({ nodeKey: e3.key, configPath: f3, kind: "blank", message: "".concat(e3.key, ".").concat(f3, " keeps a concrete value, so this template only works where that value exists") });
48850
- else if ("blank" !== g3.action) {
48851
- var y3 = v3 && !pv(h3), b3 = null === (o3 = g3.required) || void 0 === o3 || o3;
48852
- (b3 || y3) && (u3[f3] = g3.empty, c2.push({ ref: fv(e3.key, f3, l2), kind: g3.kind, label: g3.label, required: b3, nodeKey: e3.key, configPath: f3, multiple: null !== (r3 = g3.multiple) && void 0 !== r3 && r3 }), y3 && s2.push({ nodeKey: e3.key, configPath: f3, kind: "slot", message: "".concat(g3.label, " on ").concat(e3.key, " will be asked for when this template is inserted") }));
48853
- } else v3 && (void 0 === g3.empty ? delete u3[f3] : u3[f3] = g3.empty);
48854
- }
48855
- }
48856
- return S(S({}, e3), { config: u3 });
48845
+ for (var n3, o3, r3, a3, u3, d3 = null !== (n3 = dv[e3.type]) && void 0 !== n3 ? n3 : {}, p3 = S({}, null !== (o3 = e3.config) && void 0 !== o3 ? o3 : {}), m3 = function(n4, o4) {
48846
+ if ("keep" === o4.action) return "continue";
48847
+ var d4 = Object.prototype.hasOwnProperty.call(p3, n4), m4 = p3[n4];
48848
+ if (i2.has("".concat(e3.key, ".").concat(n4))) return d4 && !pv(m4) && s2.push({ nodeKey: e3.key, configPath: n4, kind: "blank", message: "".concat(e3.key, ".").concat(n4, " keeps a concrete value, so this template only works where that value exists") }), "continue";
48849
+ if ("blank" === o4.action) return d4 && (void 0 === o4.empty ? delete p3[n4] : p3[n4] = o4.empty), "continue";
48850
+ var f4 = d4 && !pv(m4), g4 = null === (r3 = o4.required) || void 0 === r3 || r3, v4 = null === (a3 = null == t2 ? void 0 : t2.preserveSlots) || void 0 === a3 ? void 0 : a3.find(function(t3) {
48851
+ return t3.nodeKey === e3.key && t3.configPath === n4 && t3.kind === o4.kind;
48852
+ });
48853
+ if (!g4 && !f4 && !v4) return "continue";
48854
+ p3[n4] = o4.empty, c2.push({ ref: (null == v4 ? void 0 : v4.ref) && /^[a-zA-Z0-9_-]{1,200}$/.test(v4.ref) && !l2.has(v4.ref) ? (l2.add(v4.ref), v4.ref) : fv(e3.key, n4, l2), kind: o4.kind, label: o4.label, required: g4, nodeKey: e3.key, configPath: n4, multiple: null !== (u3 = o4.multiple) && void 0 !== u3 && u3 }), f4 && s2.push({ nodeKey: e3.key, configPath: n4, kind: "slot", message: "".concat(o4.label, " on ").concat(e3.key, " will be asked for when this template is inserted") });
48855
+ }, f3 = 0, g3 = Object.entries(d3); f3 < g3.length; f3++) {
48856
+ var v3 = g3[f3];
48857
+ m3(v3[0], v3[1]);
48858
+ }
48859
+ return S(S({}, e3), { config: p3 });
48857
48860
  }), m2 = /* @__PURE__ */ new Map(), f2 = /* @__PURE__ */ new Set(), g2 = p2.map(function(e3) {
48858
48861
  if (!e3.bindings || !Object.keys(e3.bindings).length) return e3;
48859
48862
  for (var t3 = {}, n3 = 0, o3 = Object.entries(e3.bindings); n3 < o3.length; n3++) {
@@ -48882,7 +48885,12 @@ exports.describeStoreReleaseAdvisoryStatus = function(e2) {
48882
48885
  var b2 = y2[h2], _2 = null === (a2 = null === (r2 = e2.presentation) || void 0 === r2 ? void 0 : r2.nodes) || void 0 === a2 ? void 0 : a2[b2.key];
48883
48886
  _2 && (v2[b2.key] = { x: _2.x, y: _2.y });
48884
48887
  }
48885
- return { body: { semantic: { nodes: g2, edges: u2 }, presentation: { nodes: v2 } }, slots: c2, inputs: Array.from(m2.values()), warnings: s2 };
48888
+ return { body: { semantic: { nodes: g2, edges: u2 }, presentation: { nodes: v2 } }, slots: c2, inputs: Array.from(m2.values()).map(function(e3) {
48889
+ var n3, o3 = null === (n3 = null == t2 ? void 0 : t2.preserveInputs) || void 0 === n3 ? void 0 : n3.find(function(t3) {
48890
+ return t3.name === e3.name;
48891
+ });
48892
+ return o3 ? S(S(S({}, e3), { label: o3.label }), o3.originalReference ? { originalReference: o3.originalReference } : {}) : e3;
48893
+ }), warnings: s2 };
48886
48894
  }, exports.extractSpaceToolName = rA, exports.extractTaskAssetIds = function(e2) {
48887
48895
  if ("string" != typeof e2 || -1 === e2.indexOf(Eu)) return [];
48888
48896
  var t2 = e2.match(Au);