@spotpatch/runtime 1.15.3 → 1.15.5

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.
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  SELECT_PICKER_STYLES,
7
7
  createSelectPicker
8
- } from "./chunk-ELCIEQGT.js";
8
+ } from "./chunk-HVI76KFV.js";
9
9
  import {
10
10
  createButton,
11
11
  createMarkedElement
@@ -17,6 +17,7 @@ import {
17
17
  EXTERNAL_AGENT_CONTROL_LIMITS as EXTERNAL_AGENT_CONTROL_LIMITS2,
18
18
  EXTERNAL_AGENT_MANAGED_PROFILE,
19
19
  EXTERNAL_HANDOFF_BROKER_PROTOCOL_VERSION,
20
+ EXTERNAL_HANDOFF_FRAMEWORKS,
20
21
  EXTERNAL_HANDOFF_LIMITS,
21
22
  EXTERNAL_HANDOFF_SNAPSHOT_SCHEMA_VERSION,
22
23
  SPOTPATCH_ENDPOINTS as SPOTPATCH_ENDPOINTS2,
@@ -498,6 +499,9 @@ function parseStatusResult(value) {
498
499
  dispatch
499
500
  });
500
501
  }
502
+ function isExternalHandoffFramework(value) {
503
+ return EXTERNAL_HANDOFF_FRAMEWORKS.some((framework) => framework === value);
504
+ }
501
505
  function parseSummary(value) {
502
506
  if (!record(value)) throw new ExternalHandoffApiError();
503
507
  const expectedKeys = [
@@ -513,7 +517,7 @@ function parseSummary(value) {
513
517
  "targetCount",
514
518
  ...value.pickedUpAt === void 0 ? [] : ["pickedUpAt"]
515
519
  ];
516
- if (!exactKeys(value, expectedKeys) || typeof value.sessionId !== "string" || !OPAQUE_ID_PATTERN.test(value.sessionId) || value.framework !== "vite" && value.framework !== "next" || !Number.isSafeInteger(value.revision) || value.revision <= 0 || typeof value.cursor !== "string" || !OPAQUE_ID_PATTERN.test(value.cursor) || !Number.isSafeInteger(value.targetCount) || value.targetCount <= 0 || !record(value.page) || !exactKeys(value.page, ["origin", "pathname"]) || typeof value.page.origin !== "string" || typeof value.page.pathname !== "string" || !validTimestamp(value.publishedAt) || !validTimestamp(value.expiresAt) || value.state !== "available" && value.state !== "expired" && value.state !== "superseded" || !Number.isSafeInteger(value.pickupCount) || value.pickupCount < 0 || value.pickupCount > EXTERNAL_HANDOFF_LIMITS.maximumConnectorReceipts || value.pickedUpAt !== void 0 && !validTimestamp(value.pickedUpAt)) {
520
+ if (!exactKeys(value, expectedKeys) || typeof value.sessionId !== "string" || !OPAQUE_ID_PATTERN.test(value.sessionId) || !isExternalHandoffFramework(value.framework) || !Number.isSafeInteger(value.revision) || value.revision <= 0 || typeof value.cursor !== "string" || !OPAQUE_ID_PATTERN.test(value.cursor) || !Number.isSafeInteger(value.targetCount) || value.targetCount <= 0 || !record(value.page) || !exactKeys(value.page, ["origin", "pathname"]) || typeof value.page.origin !== "string" || typeof value.page.pathname !== "string" || !validTimestamp(value.publishedAt) || !validTimestamp(value.expiresAt) || value.state !== "available" && value.state !== "expired" && value.state !== "superseded" || !Number.isSafeInteger(value.pickupCount) || value.pickupCount < 0 || value.pickupCount > EXTERNAL_HANDOFF_LIMITS.maximumConnectorReceipts || value.pickedUpAt !== void 0 && !validTimestamp(value.pickedUpAt)) {
517
521
  throw new ExternalHandoffApiError();
518
522
  }
519
523
  return Object.freeze({
@@ -1199,41 +1203,45 @@ function createStyles(document) {
1199
1203
  const styles = document.createElement("style");
1200
1204
  styles.textContent = `
1201
1205
  ${SELECT_PICKER_STYLES}
1202
- .spotpatch-external-handoff { margin-top: 12px; padding: 12px; border: 1px solid var(--spotpatch-border); border-radius: var(--spotpatch-radius-card); background: rgb(82 168 255 / 5%); }
1203
- .spotpatch-external-handoff[hidden] { display: none; }
1206
+ .spotpatch-external-handoff { margin-top: 10px; padding: 12px; border: 1px solid var(--spotpatch-cyan-line); border-radius: var(--spotpatch-radius-card); background: var(--spotpatch-cyan-tint); }
1204
1207
  .spotpatch-external-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
1205
- .spotpatch-external-heading strong { font-size: 12px; font-weight: 680; color: var(--spotpatch-text); }
1206
- .spotpatch-external-description, .spotpatch-external-status, .spotpatch-external-settings p { margin: 6px 0 0; font-size: 11px; line-height: 1.5; color: var(--spotpatch-text-secondary); }
1207
- .spotpatch-external-status { padding-left: 10px; border-left: 2px solid var(--spotpatch-accent-cyan); color: #cbd5e1; }
1208
- .spotpatch-external-status[data-state="error"] { border-color: var(--spotpatch-danger); color: #fecdd3; }
1209
- .spotpatch-external-status[data-state="picked-up"] { border-color: var(--spotpatch-success); color: #a7f3d0; }
1210
- .spotpatch-external-control { margin-top: 9px; padding: 9px; border: 1px solid var(--spotpatch-border); border-radius: 8px; background: rgb(3 7 18 / 28%); }
1208
+ .spotpatch-external-heading strong { font-size: 13px; font-weight: 620; }
1209
+ .spotpatch-external-description, .spotpatch-external-status, .spotpatch-external-settings p { margin: 6px 0 0; color: var(--spotpatch-text-secondary); font-size: 12px; line-height: 1.5; }
1210
+ .spotpatch-external-status { border-left: 2px solid var(--spotpatch-accent-cyan); padding-left: 10px; color: var(--spotpatch-text); }
1211
+ .spotpatch-external-status[data-state="error"] { border-color: var(--spotpatch-danger); color: var(--spotpatch-danger-text); }
1212
+ .spotpatch-external-status[data-state="picked-up"] { border-color: var(--spotpatch-success); color: var(--spotpatch-success-text); }
1213
+ .spotpatch-external-control { margin-top: 10px; padding: 10px; border: 1px solid var(--spotpatch-border-subtle); border-radius: var(--spotpatch-radius-md); background: var(--spotpatch-bg-input); }
1211
1214
  .spotpatch-external-control-field { display: grid; gap: 5px; min-width: 0; }
1212
- .spotpatch-external-control-field + .spotpatch-external-control-field { margin-top: 9px; }
1213
- .spotpatch-external-control-field > label { color: var(--spotpatch-text-secondary); font-size: 10px; }
1214
- .spotpatch-external-agent-value { box-sizing: border-box; display: flex; width: 100%; min-height: 38px; align-items: center; border: 1px solid var(--spotpatch-border); border-radius: 9px; padding: 0 11px; overflow: hidden; color: var(--spotpatch-text); background: rgb(255 255 255 / 3%); font: inherit; text-overflow: ellipsis; white-space: nowrap; }
1215
- .spotpatch-external-control-status { margin: 7px 0 0; color: #cbd5e1; font-size: 10.5px; line-height: 1.5; white-space: pre-wrap; }
1215
+ .spotpatch-external-control-field + .spotpatch-external-control-field { margin-top: 10px; }
1216
+ .spotpatch-external-control-field > label { color: var(--spotpatch-text-secondary); font-size: 11px; }
1217
+ .spotpatch-external-agent-value { box-sizing: border-box; display: flex; width: 100%; min-height: 38px; align-items: center; overflow: hidden; border: 1px solid var(--spotpatch-border); border-radius: var(--spotpatch-radius-md); padding: 0 12px; color: var(--spotpatch-text); background: var(--spotpatch-hover); font: inherit; text-overflow: ellipsis; white-space: nowrap; }
1218
+ .spotpatch-external-control-status { margin: 8px 0 0; color: var(--spotpatch-text-secondary); font-size: 11.5px; line-height: 1.5; white-space: pre-wrap; }
1216
1219
  .spotpatch-external-control-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
1217
- .spotpatch-external-control-actions button { padding: 5px 8px; border: 1px solid var(--spotpatch-border); border-radius: 6px; background: var(--spotpatch-bg-active); color: var(--spotpatch-text); font: inherit; font-size: 10px; cursor: pointer; }
1218
- .spotpatch-external-control-actions button:disabled { cursor: default; opacity: .45; }
1219
- .spotpatch-external-result { margin-top: 8px; color: var(--spotpatch-text-secondary); font-size: 10px; }
1220
- .spotpatch-external-result pre { max-height: 180px; overflow: auto; margin: 6px 0 0; padding: 7px; border-radius: 6px; background: var(--spotpatch-bg-input); color: #d8d6ff; font: 9px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
1221
- .spotpatch-external-settings { margin-top: 9px; }
1222
- .spotpatch-external-settings summary { cursor: pointer; color: #c4b5fd; font-size: 11px; }
1223
- .spotpatch-external-refresh { padding: 3px 7px; border: 1px solid var(--spotpatch-border); border-radius: 6px; background: transparent; color: var(--spotpatch-text-secondary); font: inherit; font-size: 10px; cursor: pointer; }
1224
- .spotpatch-external-refresh:disabled { cursor: default; opacity: .45; }
1225
- .spotpatch-external-resolve { margin-top: 8px; padding: 6px 8px; border: 1px solid #f59e0b; border-radius: 6px; background: rgb(245 158 11 / 10%); color: #fde68a; font: inherit; font-size: 10px; cursor: pointer; }
1226
- .spotpatch-external-resolve[hidden] { display: none; }
1227
- .spotpatch-external-resolve:disabled { cursor: default; opacity: .45; }
1228
- .spotpatch-external-disclosure { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; padding: 20px; background: rgb(3 3 8 / 72%); backdrop-filter: blur(3px); }
1229
- .spotpatch-external-disclosure[hidden] { display: none; }
1230
- .spotpatch-external-disclosure-card { width: min(420px, calc(100vw - 40px)); max-height: calc(100vh - 40px); overflow: auto; padding: 18px; border: 1px solid rgb(139 123 255 / 55%); border-radius: 14px; background: var(--spotpatch-bg-raised); box-shadow: var(--spotpatch-shadow-panel); }
1231
- .spotpatch-external-disclosure-card h3 { margin: 0; color: var(--spotpatch-text); font-size: 15px; }
1232
- .spotpatch-external-disclosure-card p { margin: 9px 0 0; color: #c4c7d0; font-size: 11.5px; line-height: 1.55; }
1233
- .spotpatch-external-files { max-height: 96px; overflow: auto; color: #a5b4fc; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
1234
- .spotpatch-external-disclosure-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
1235
- .spotpatch-external-disclosure-actions button { padding: 7px 10px; border: 1px solid var(--spotpatch-border); border-radius: 7px; background: var(--spotpatch-bg-active); color: var(--spotpatch-text); font: inherit; cursor: pointer; }
1236
- .spotpatch-external-disclosure-actions .spotpatch-primary { border-color: transparent; background: var(--spotpatch-accent); color: var(--spotpatch-text-on-accent); }
1220
+ .spotpatch-external-control-actions button,
1221
+ .spotpatch-external-refresh,
1222
+ .spotpatch-external-disclosure-actions button { border: 1px solid var(--spotpatch-border); border-radius: var(--spotpatch-radius-sm); color: var(--spotpatch-text); background: var(--spotpatch-bg-raised); cursor: pointer; font: inherit; transition: border-color var(--spotpatch-duration-fast) ease, background var(--spotpatch-duration-fast) ease; }
1223
+ .spotpatch-external-control-actions button { padding: 5px 10px; font-size: 11.5px; }
1224
+ .spotpatch-external-refresh { padding: 3px 8px; color: var(--spotpatch-text-secondary); background: transparent; font-size: 11px; }
1225
+ .spotpatch-external-control-actions button:hover:not(:disabled),
1226
+ .spotpatch-external-refresh:hover:not(:disabled),
1227
+ .spotpatch-external-disclosure-actions button:hover:not(:disabled) { border-color: var(--spotpatch-border-strong); background: var(--spotpatch-bg-active); }
1228
+ .spotpatch-external-control-actions button:disabled,
1229
+ .spotpatch-external-refresh:disabled,
1230
+ .spotpatch-external-resolve:disabled { cursor: default; opacity: .4; }
1231
+ .spotpatch-external-result { margin-top: 8px; color: var(--spotpatch-text-secondary); font-size: 11px; }
1232
+ .spotpatch-external-result pre { max-height: 180px; overflow: auto; margin: 6px 0 0; border-radius: var(--spotpatch-radius-xs); padding: 8px; color: var(--spotpatch-text); background: var(--spotpatch-bg); font: 10.5px/1.5 var(--spotpatch-font-mono); white-space: pre; }
1233
+ .spotpatch-external-settings { margin-top: 10px; }
1234
+ .spotpatch-external-settings summary { color: var(--spotpatch-accent-soft); cursor: pointer; font-size: 12px; }
1235
+ .spotpatch-external-resolve { margin-top: 8px; border: 1px solid var(--spotpatch-warning-line); border-radius: var(--spotpatch-radius-sm); padding: 6px 10px; color: var(--spotpatch-warning-text); background: var(--spotpatch-warning-tint); cursor: pointer; font: inherit; font-size: 11.5px; }
1236
+ .spotpatch-external-disclosure { position: fixed; inset: 0; z-index: 4; display: grid; place-items: center; padding: 20px; background: var(--spotpatch-scrim); backdrop-filter: blur(4px); }
1237
+ .spotpatch-external-disclosure-card { width: min(420px, calc(100vw - 40px)); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid var(--spotpatch-border); border-radius: var(--spotpatch-radius-panel); padding: 20px; background: var(--spotpatch-surface-fill); box-shadow: var(--spotpatch-shadow-panel), var(--spotpatch-shadow-inset); animation: spotpatch-pop var(--spotpatch-duration-base) var(--spotpatch-ease-spring) both; }
1238
+ .spotpatch-external-disclosure-card h3 { margin: 0; font-size: 15px; font-weight: 650; }
1239
+ .spotpatch-external-disclosure-card p { margin: 9px 0 0; color: var(--spotpatch-text-secondary); font-size: 12px; line-height: 1.55; }
1240
+ .spotpatch-external-files { max-height: 96px; overflow: auto; color: var(--spotpatch-accent-soft); font: 11px/1.5 var(--spotpatch-font-mono); white-space: pre-wrap; }
1241
+ .spotpatch-external-disclosure-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
1242
+ .spotpatch-external-disclosure-actions button { min-height: 34px; padding: 0 12px; font-size: 12.5px; font-weight: 600; }
1243
+ .spotpatch-external-disclosure-actions .spotpatch-primary { border-color: transparent; color: var(--spotpatch-text-on-accent); background: var(--spotpatch-primary-fill); }
1244
+ .spotpatch-external-disclosure-actions .spotpatch-primary:hover:not(:disabled) { border-color: transparent; background: var(--spotpatch-primary-fill); filter: brightness(1.1); }
1237
1245
  `;
1238
1246
  return styles;
1239
1247
  }