@surething/cockpit 1.0.216 → 1.0.218

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.
Files changed (75) hide show
  1. package/.next-prod/BUILD_ID +1 -1
  2. package/.next-prod/app-path-routes-manifest.json +2 -2
  3. package/.next-prod/build-manifest.json +2 -2
  4. package/.next-prod/prerender-manifest.json +3 -3
  5. package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next-prod/server/app/_global-error.html +1 -1
  7. package/.next-prod/server/app/_global-error.rsc +1 -1
  8. package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next-prod/server/app/_not-found.html +1 -1
  16. package/.next-prod/server/app/_not-found.rsc +3 -3
  17. package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
  18. package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
  20. package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  23. package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
  24. package/.next-prod/server/app/api/chat/route.js +1 -1
  25. package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
  26. package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
  27. package/.next-prod/server/app/api/scheduled-tasks/route.js +1 -1
  28. package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
  29. package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
  30. package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
  31. package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
  32. package/.next-prod/server/app-paths-manifest.json +2 -2
  33. package/.next-prod/server/chunks/2939.js +1 -1
  34. package/.next-prod/server/chunks/8916.js +1 -1
  35. package/.next-prod/server/chunks/9658.js +7 -7
  36. package/.next-prod/server/chunks/9877.js +1 -1
  37. package/.next-prod/server/functions-config-manifest.json +1 -0
  38. package/.next-prod/server/middleware-build-manifest.js +1 -1
  39. package/.next-prod/server/pages/404.html +1 -1
  40. package/.next-prod/server/pages/500.html +1 -1
  41. package/.next-prod/server/server-reference-manifest.json +1 -1
  42. package/.next-prod/static/chunks/6345-2637497e8b101740.js +14 -0
  43. package/.next-prod/static/chunks/6917-ed0e9c62a123d529.js +29 -0
  44. package/.next-prod/static/chunks/app/{layout-a0362651ba6e6e6f.js → layout-1659a95e6c4a6bb5.js} +1 -1
  45. package/.next-prod/static/chunks/app/{page-1b14cabf47df9ff7.js → page-afcbd897b4c3600f.js} +1 -1
  46. package/.next-prod/static/chunks/app/project/{page-1b14cabf47df9ff7.js → page-afcbd897b4c3600f.js} +1 -1
  47. package/.next-prod/static/css/f4a773117ca8af75.css +1 -0
  48. package/.next-prod/trace +13 -13
  49. package/.next-prod/trace-build +1 -1
  50. package/README.md +8 -7
  51. package/README.zh.md +8 -7
  52. package/bin/cock-browser.messages.mjs +176 -0
  53. package/bin/cock-browser.mjs +290 -18
  54. package/bin/cock-codegraph.mjs +21 -6
  55. package/bin/cock-connection.mjs +151 -0
  56. package/bin/cock.mjs +12 -1
  57. package/bin/setup-dev.mjs +15 -13
  58. package/chrome-extension/automation.js +684 -32
  59. package/chrome-extension/manifest.json +1 -1
  60. package/chrome-extension/messages.js +45 -0
  61. package/dist/{chunk-CZWJPTRO.mjs → chunk-GCYLMG43.mjs} +2486 -1047
  62. package/dist/chunk-O4P2J44N.mjs +314 -0
  63. package/dist/{chunk-KRTISG5I.mjs → chunk-WOM47O75.mjs} +245 -10
  64. package/dist/httpApi.mjs +140 -7
  65. package/dist/scheduledTasks.mjs +15 -1159
  66. package/dist/{server-OSOMFNXR.mjs → server-SNB4H35J.mjs} +8 -2
  67. package/dist/wsServer.mjs +27 -19
  68. package/package.json +3 -5
  69. package/server.mjs +5 -1
  70. package/.next-prod/static/chunks/5188-415582403ef0e29c.js +0 -29
  71. package/.next-prod/static/chunks/6345-e5ceeb2aeb698eb6.js +0 -14
  72. package/.next-prod/static/css/cc6d733cdf607b30.css +0 -1
  73. package/dist/chunk-ZJ6CC3MH.mjs +0 -223
  74. /package/.next-prod/static/{GAYKr2BmQpFqJgRJfvQ3D → bOkuiIr_nWzG5GjPLNqdN}/_buildManifest.js +0 -0
  75. /package/.next-prod/static/{GAYKr2BmQpFqJgRJfvQ3D → bOkuiIr_nWzG5GjPLNqdN}/_ssgManifest.js +0 -0
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "web_accessible_resources": [
32
32
  {
33
- "resources": ["disguise.js", "automation.js", "network-capture.js"],
33
+ "resources": ["disguise.js", "automation.js", "network-capture.js", "messages.js"],
34
34
  "matches": ["<all_urls>"]
35
35
  }
36
36
  ],
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Extension-side error templates.
3
+ *
4
+ * Used by automation.js. Generated strings are returned to the CLI as
5
+ * `data.error` and printed verbatim — so they MUST be self-contained and
6
+ * include actionable next steps with generic examples (no case-specific
7
+ * selectors or API paths).
8
+ *
9
+ * The CLI side has its own copy in bin/cock-browser.messages.mjs; this file
10
+ * stays in sync manually (only ~3 templates here, drift risk is low).
11
+ */
12
+
13
+ const EXAMPLES = Object.freeze({
14
+ selectorSubmit: 'button[type="submit"]',
15
+ selectorAriaSave: 'button[aria-label="Save"]',
16
+ textSignIn: 'Sign in',
17
+ textSave: 'Save',
18
+ });
19
+
20
+ function staleRefMsg(ref, currentEpoch, kind) {
21
+ return `Element ref "${ref}" is stale (current snapshot v=${currentEpoch}; kind: ${kind}).
22
+ Refs are valid only until the next snapshot / re-render / route change.
23
+ Fix one of:
24
+ 1. Re-run \`snapshot\` to get fresh refs (look for v=${currentEpoch} in the banner).
25
+ 2. Use a CSS selector or visible text directly:
26
+ cockpit browser <id> click --text "${EXAMPLES.textSignIn}"
27
+ cockpit browser <id> click --selector '${EXAMPLES.selectorSubmit}'
28
+ 3. Drop to evaluate:
29
+ cockpit browser <id> evaluate "(() => document.querySelector('${EXAMPLES.selectorAriaSave}').click())()"`;
30
+ }
31
+
32
+ function unknownActionMsg(action, suggestions) {
33
+ const hint = suggestions && suggestions.length
34
+ ? `\n Did you mean: ${suggestions.join(', ')}?`
35
+ : '';
36
+ return `Unknown action "${action}".${hint}
37
+ Run: cockpit browser --help-all`;
38
+ }
39
+
40
+ // Expose on globalThis so automation.js (loaded as module) can use them
41
+ // without an explicit import path that differs by build mode.
42
+ if (typeof window !== 'undefined') {
43
+ window.__cockpitBrowserMessages = { staleRefMsg, unknownActionMsg, EXAMPLES };
44
+ }
45
+ export { staleRefMsg, unknownActionMsg, EXAMPLES };