@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.
- package/.next-prod/BUILD_ID +1 -1
- package/.next-prod/app-path-routes-manifest.json +2 -2
- package/.next-prod/build-manifest.json +2 -2
- package/.next-prod/prerender-manifest.json +3 -3
- package/.next-prod/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_global-error.html +1 -1
- package/.next-prod/server/app/_global-error.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next-prod/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/_not-found.html +1 -1
- package/.next-prod/server/app/_not-found.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next-prod/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next-prod/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next-prod/server/app/api/chat/deepseek/route.js +1 -1
- package/.next-prod/server/app/api/chat/route.js +1 -1
- package/.next-prod/server/app/api/extension/version/route.js.nft.json +1 -1
- package/.next-prod/server/app/api/projectGraph/file-functions/route.js +1 -1
- package/.next-prod/server/app/api/scheduled-tasks/route.js +1 -1
- package/.next-prod/server/app/api/terminal/bubble-order/route.js +1 -1
- package/.next-prod/server/app/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/project/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app/review/[id]/page_client-reference-manifest.js +1 -1
- package/.next-prod/server/app-paths-manifest.json +2 -2
- package/.next-prod/server/chunks/2939.js +1 -1
- package/.next-prod/server/chunks/8916.js +1 -1
- package/.next-prod/server/chunks/9658.js +7 -7
- package/.next-prod/server/chunks/9877.js +1 -1
- package/.next-prod/server/functions-config-manifest.json +1 -0
- package/.next-prod/server/middleware-build-manifest.js +1 -1
- package/.next-prod/server/pages/404.html +1 -1
- package/.next-prod/server/pages/500.html +1 -1
- package/.next-prod/server/server-reference-manifest.json +1 -1
- package/.next-prod/static/chunks/6345-2637497e8b101740.js +14 -0
- package/.next-prod/static/chunks/6917-ed0e9c62a123d529.js +29 -0
- package/.next-prod/static/chunks/app/{layout-a0362651ba6e6e6f.js → layout-1659a95e6c4a6bb5.js} +1 -1
- package/.next-prod/static/chunks/app/{page-1b14cabf47df9ff7.js → page-afcbd897b4c3600f.js} +1 -1
- package/.next-prod/static/chunks/app/project/{page-1b14cabf47df9ff7.js → page-afcbd897b4c3600f.js} +1 -1
- package/.next-prod/static/css/f4a773117ca8af75.css +1 -0
- package/.next-prod/trace +13 -13
- package/.next-prod/trace-build +1 -1
- package/README.md +8 -7
- package/README.zh.md +8 -7
- package/bin/cock-browser.messages.mjs +176 -0
- package/bin/cock-browser.mjs +290 -18
- package/bin/cock-codegraph.mjs +21 -6
- package/bin/cock-connection.mjs +151 -0
- package/bin/cock.mjs +12 -1
- package/bin/setup-dev.mjs +15 -13
- package/chrome-extension/automation.js +684 -32
- package/chrome-extension/manifest.json +1 -1
- package/chrome-extension/messages.js +45 -0
- package/dist/{chunk-CZWJPTRO.mjs → chunk-GCYLMG43.mjs} +2486 -1047
- package/dist/chunk-O4P2J44N.mjs +314 -0
- package/dist/{chunk-KRTISG5I.mjs → chunk-WOM47O75.mjs} +245 -10
- package/dist/httpApi.mjs +140 -7
- package/dist/scheduledTasks.mjs +15 -1159
- package/dist/{server-OSOMFNXR.mjs → server-SNB4H35J.mjs} +8 -2
- package/dist/wsServer.mjs +27 -19
- package/package.json +3 -5
- package/server.mjs +5 -1
- package/.next-prod/static/chunks/5188-415582403ef0e29c.js +0 -29
- package/.next-prod/static/chunks/6345-e5ceeb2aeb698eb6.js +0 -14
- package/.next-prod/static/css/cc6d733cdf607b30.css +0 -1
- package/dist/chunk-ZJ6CC3MH.mjs +0 -223
- /package/.next-prod/static/{GAYKr2BmQpFqJgRJfvQ3D → bOkuiIr_nWzG5GjPLNqdN}/_buildManifest.js +0 -0
- /package/.next-prod/static/{GAYKr2BmQpFqJgRJfvQ3D → bOkuiIr_nWzG5GjPLNqdN}/_ssgManifest.js +0 -0
|
@@ -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 };
|