@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.
@@ -488,6 +488,9 @@ function parseStatusResult(value) {
488
488
  dispatch
489
489
  });
490
490
  }
491
+ function isExternalHandoffFramework(value) {
492
+ return import_external_handoff_browser2.EXTERNAL_HANDOFF_FRAMEWORKS.some((framework) => framework === value);
493
+ }
491
494
  function parseSummary(value) {
492
495
  if (!record(value)) throw new ExternalHandoffApiError();
493
496
  const expectedKeys = [
@@ -503,7 +506,7 @@ function parseSummary(value) {
503
506
  "targetCount",
504
507
  ...value.pickedUpAt === void 0 ? [] : ["pickedUpAt"]
505
508
  ];
506
- 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 > import_external_handoff_browser2.EXTERNAL_HANDOFF_LIMITS.maximumConnectorReceipts || value.pickedUpAt !== void 0 && !validTimestamp(value.pickedUpAt)) {
509
+ 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 > import_external_handoff_browser2.EXTERNAL_HANDOFF_LIMITS.maximumConnectorReceipts || value.pickedUpAt !== void 0 && !validTimestamp(value.pickedUpAt)) {
507
510
  throw new ExternalHandoffApiError();
508
511
  }
509
512
  return Object.freeze({
@@ -1033,18 +1036,18 @@ function createButton(document, label, className = "") {
1033
1036
  // src/ui/ask-picker.ts
1034
1037
  var SELECT_PICKER_STYLES = `
1035
1038
  .spotpatch-select-picker { position: relative; display: grid; gap: 5px; min-width: 0; }
1036
- .spotpatch-select-trigger { box-sizing: border-box; display: flex; width: 100%; min-height: 38px; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--spotpatch-border); border-radius: 9px; padding: 0 11px; overflow: hidden; color: var(--spotpatch-text); background: var(--spotpatch-bg-input); cursor: pointer; font: inherit; outline: none; text-align: left; }
1039
+ .spotpatch-select-trigger { box-sizing: border-box; display: flex; width: 100%; min-height: 38px; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--spotpatch-border); border-radius: var(--spotpatch-radius-md); padding: 0 12px; overflow: hidden; color: var(--spotpatch-text); background: var(--spotpatch-bg-input); cursor: pointer; font: inherit; outline: none; text-align: left; transition: border-color var(--spotpatch-duration-fast) ease, box-shadow var(--spotpatch-duration-fast) ease; }
1040
+ .spotpatch-select-trigger:hover:not(:disabled) { border-color: var(--spotpatch-border-strong); }
1037
1041
  .spotpatch-select-trigger > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1038
- .spotpatch-select-trigger[data-expandable="true"]::after { width: 7px; height: 7px; flex: 0 0 auto; border-right: 1.5px solid #8f96a3; border-bottom: 1.5px solid #8f96a3; content: ""; transform: translateY(-2px) rotate(45deg); }
1042
+ .spotpatch-select-trigger[data-expandable="true"]::after { width: 7px; height: 7px; flex: 0 0 auto; border-right: 1.5px solid var(--spotpatch-text-muted); border-bottom: 1.5px solid var(--spotpatch-text-muted); content: ""; transform: translateY(-2px) rotate(45deg); transition: transform var(--spotpatch-duration-base) var(--spotpatch-ease-out); }
1039
1043
  .spotpatch-select-trigger[aria-expanded="true"]::after { transform: translateY(2px) rotate(225deg); }
1040
- .spotpatch-select-trigger:focus-visible { border-color: rgb(139 123 255 / 68%); box-shadow: 0 0 0 3px rgb(139 123 255 / 12%); }
1041
- .spotpatch-select-trigger:disabled { color: var(--spotpatch-text); background: rgb(255 255 255 / 3%); cursor: default; opacity: 1; }
1044
+ .spotpatch-select-trigger:focus-visible { border-color: var(--spotpatch-accent-line); box-shadow: 0 0 0 3px var(--spotpatch-accent-tint); }
1045
+ .spotpatch-select-trigger:disabled { color: var(--spotpatch-text); background: var(--spotpatch-hover); cursor: default; opacity: 1; }
1042
1046
  .spotpatch-select-trigger[data-empty="true"]:disabled { color: var(--spotpatch-text-muted); }
1043
- .spotpatch-select-menu { position: relative; z-index: 1; display: grid; gap: 3px; max-height: 224px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--spotpatch-border); border-radius: 9px; padding: 4px; background: var(--spotpatch-bg-input); box-shadow: 0 10px 28px rgb(0 0 0 / 28%); scrollbar-width: thin; }
1044
- .spotpatch-select-menu[hidden] { display: none; }
1045
- .spotpatch-select-option { box-sizing: border-box; min-height: 34px; border: 0; border-radius: 6px; padding: 7px 9px; overflow-wrap: anywhere; color: var(--spotpatch-text-secondary); background: transparent; cursor: pointer; font: inherit; text-align: left; }
1046
- .spotpatch-select-option[data-active="true"], .spotpatch-select-option:hover { color: #fff; background: rgb(139 123 255 / 13%); outline: none; }
1047
- .spotpatch-select-option[aria-selected="true"] { color: #f4f1ff; background: rgb(139 123 255 / 20%); }
1047
+ .spotpatch-select-menu { position: relative; z-index: 1; display: grid; gap: 2px; max-height: 224px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--spotpatch-border); border-radius: var(--spotpatch-radius-md); padding: 4px; background: var(--spotpatch-bg-raised); box-shadow: var(--spotpatch-shadow-panel); animation: spotpatch-enter var(--spotpatch-duration-base) var(--spotpatch-ease-out) both; }
1048
+ .spotpatch-select-option { box-sizing: border-box; min-height: 34px; border: 0; border-radius: var(--spotpatch-radius-xs); padding: 7px 10px; overflow-wrap: anywhere; color: var(--spotpatch-text-secondary); background: transparent; cursor: pointer; font: inherit; text-align: left; }
1049
+ .spotpatch-select-option[data-active="true"], .spotpatch-select-option:hover { color: var(--spotpatch-text); background: var(--spotpatch-hover); outline: none; }
1050
+ .spotpatch-select-option[aria-selected="true"] { color: var(--spotpatch-text); background: var(--spotpatch-accent-tint); }
1048
1051
  .spotpatch-select-native { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; border: 0; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
1049
1052
  `;
1050
1053
  function createSelectPicker(document, onViewChange) {
@@ -1392,41 +1395,45 @@ function createStyles(document) {
1392
1395
  const styles = document.createElement("style");
1393
1396
  styles.textContent = `
1394
1397
  ${SELECT_PICKER_STYLES}
1395
- .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%); }
1396
- .spotpatch-external-handoff[hidden] { display: none; }
1398
+ .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); }
1397
1399
  .spotpatch-external-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
1398
- .spotpatch-external-heading strong { font-size: 12px; font-weight: 680; color: var(--spotpatch-text); }
1399
- .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); }
1400
- .spotpatch-external-status { padding-left: 10px; border-left: 2px solid var(--spotpatch-accent-cyan); color: #cbd5e1; }
1401
- .spotpatch-external-status[data-state="error"] { border-color: var(--spotpatch-danger); color: #fecdd3; }
1402
- .spotpatch-external-status[data-state="picked-up"] { border-color: var(--spotpatch-success); color: #a7f3d0; }
1403
- .spotpatch-external-control { margin-top: 9px; padding: 9px; border: 1px solid var(--spotpatch-border); border-radius: 8px; background: rgb(3 7 18 / 28%); }
1400
+ .spotpatch-external-heading strong { font-size: 13px; font-weight: 620; }
1401
+ .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; }
1402
+ .spotpatch-external-status { border-left: 2px solid var(--spotpatch-accent-cyan); padding-left: 10px; color: var(--spotpatch-text); }
1403
+ .spotpatch-external-status[data-state="error"] { border-color: var(--spotpatch-danger); color: var(--spotpatch-danger-text); }
1404
+ .spotpatch-external-status[data-state="picked-up"] { border-color: var(--spotpatch-success); color: var(--spotpatch-success-text); }
1405
+ .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); }
1404
1406
  .spotpatch-external-control-field { display: grid; gap: 5px; min-width: 0; }
1405
- .spotpatch-external-control-field + .spotpatch-external-control-field { margin-top: 9px; }
1406
- .spotpatch-external-control-field > label { color: var(--spotpatch-text-secondary); font-size: 10px; }
1407
- .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; }
1408
- .spotpatch-external-control-status { margin: 7px 0 0; color: #cbd5e1; font-size: 10.5px; line-height: 1.5; white-space: pre-wrap; }
1407
+ .spotpatch-external-control-field + .spotpatch-external-control-field { margin-top: 10px; }
1408
+ .spotpatch-external-control-field > label { color: var(--spotpatch-text-secondary); font-size: 11px; }
1409
+ .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; }
1410
+ .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; }
1409
1411
  .spotpatch-external-control-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
1410
- .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; }
1411
- .spotpatch-external-control-actions button:disabled { cursor: default; opacity: .45; }
1412
- .spotpatch-external-result { margin-top: 8px; color: var(--spotpatch-text-secondary); font-size: 10px; }
1413
- .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; }
1414
- .spotpatch-external-settings { margin-top: 9px; }
1415
- .spotpatch-external-settings summary { cursor: pointer; color: #c4b5fd; font-size: 11px; }
1416
- .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; }
1417
- .spotpatch-external-refresh:disabled { cursor: default; opacity: .45; }
1418
- .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; }
1419
- .spotpatch-external-resolve[hidden] { display: none; }
1420
- .spotpatch-external-resolve:disabled { cursor: default; opacity: .45; }
1421
- .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); }
1422
- .spotpatch-external-disclosure[hidden] { display: none; }
1423
- .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); }
1424
- .spotpatch-external-disclosure-card h3 { margin: 0; color: var(--spotpatch-text); font-size: 15px; }
1425
- .spotpatch-external-disclosure-card p { margin: 9px 0 0; color: #c4c7d0; font-size: 11.5px; line-height: 1.55; }
1426
- .spotpatch-external-files { max-height: 96px; overflow: auto; color: #a5b4fc; font: 10px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
1427
- .spotpatch-external-disclosure-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 15px; }
1428
- .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; }
1429
- .spotpatch-external-disclosure-actions .spotpatch-primary { border-color: transparent; background: var(--spotpatch-accent); color: var(--spotpatch-text-on-accent); }
1412
+ .spotpatch-external-control-actions button,
1413
+ .spotpatch-external-refresh,
1414
+ .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; }
1415
+ .spotpatch-external-control-actions button { padding: 5px 10px; font-size: 11.5px; }
1416
+ .spotpatch-external-refresh { padding: 3px 8px; color: var(--spotpatch-text-secondary); background: transparent; font-size: 11px; }
1417
+ .spotpatch-external-control-actions button:hover:not(:disabled),
1418
+ .spotpatch-external-refresh:hover:not(:disabled),
1419
+ .spotpatch-external-disclosure-actions button:hover:not(:disabled) { border-color: var(--spotpatch-border-strong); background: var(--spotpatch-bg-active); }
1420
+ .spotpatch-external-control-actions button:disabled,
1421
+ .spotpatch-external-refresh:disabled,
1422
+ .spotpatch-external-resolve:disabled { cursor: default; opacity: .4; }
1423
+ .spotpatch-external-result { margin-top: 8px; color: var(--spotpatch-text-secondary); font-size: 11px; }
1424
+ .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; }
1425
+ .spotpatch-external-settings { margin-top: 10px; }
1426
+ .spotpatch-external-settings summary { color: var(--spotpatch-accent-soft); cursor: pointer; font-size: 12px; }
1427
+ .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; }
1428
+ .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); }
1429
+ .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; }
1430
+ .spotpatch-external-disclosure-card h3 { margin: 0; font-size: 15px; font-weight: 650; }
1431
+ .spotpatch-external-disclosure-card p { margin: 9px 0 0; color: var(--spotpatch-text-secondary); font-size: 12px; line-height: 1.55; }
1432
+ .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; }
1433
+ .spotpatch-external-disclosure-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
1434
+ .spotpatch-external-disclosure-actions button { min-height: 34px; padding: 0 12px; font-size: 12.5px; font-weight: 600; }
1435
+ .spotpatch-external-disclosure-actions .spotpatch-primary { border-color: transparent; color: var(--spotpatch-text-on-accent); background: var(--spotpatch-primary-fill); }
1436
+ .spotpatch-external-disclosure-actions .spotpatch-primary:hover:not(:disabled) { border-color: transparent; background: var(--spotpatch-primary-fill); filter: brightness(1.1); }
1430
1437
  `;
1431
1438
  return styles;
1432
1439
  }