zcode-app-cli 3.14.5-34 → 3.15.3-35

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/README.md +13 -2
  2. package/bin/zcode.js +4 -0
  3. package/docs/CONFIGURATION.md +36 -5
  4. package/docs/CONFIGURATION.zh-CN.md +29 -3
  5. package/docs/PROVIDER_CONFIG.md +25 -0
  6. package/docs/PROVIDER_CONFIG.zh-CN.md +20 -0
  7. package/package.json +4 -2
  8. package/vendor/cli-config.cjs +88 -0
  9. package/vendor/extraction.json +24 -6
  10. package/vendor/node_modules/@zcode/tui/dist/index.js +457 -85
  11. package/vendor/packages/browser-use-plugin/README.md +1 -1
  12. package/vendor/packages/browser-use-plugin/docs/api.json +1 -1
  13. package/vendor/packages/browser-use-plugin/docs/overview.md +6 -6
  14. package/vendor/packages/browser-use-plugin/docs/playwright.md +3 -3
  15. package/vendor/packages/browser-use-plugin/docs/workflow.md +2 -2
  16. package/vendor/packages/browser-use-plugin/scripts/browser-client.mjs +5 -7
  17. package/vendor/packages/browser-use-plugin/scripts/build.mjs +0 -1
  18. package/vendor/packages/browser-use-plugin/skills/control-browser/SKILL.md +9 -9
  19. package/vendor/packages/bundled-skills/skills/dynamic-workflows/SKILL.md +760 -687
  20. package/vendor/packages/bundled-skills/skills/dynamic-workflows/examples.md +310 -1
  21. package/vendor/packages/bundled-skills/skills/dynamic-workflows/patterns.md +336 -4
  22. package/vendor/packages/documents-plugin/.zcode-plugin/plugin.json +2 -2
  23. package/vendor/packages/documents-plugin/package.json +2 -2
  24. package/vendor/packages/documents-plugin/skills/docx/LICENSE.txt +10 -10
  25. package/vendor/packages/node-repl-host/.zcode-plugin/plugin.json +1 -1
  26. package/vendor/packages/node-repl-host/dist/mcp/server.js +116 -48
  27. package/vendor/packages/node-repl-host/package.json +1 -1
  28. package/vendor/packages/node-repl-host/scripts/build.mjs +4 -4
  29. package/vendor/packages/pdf-plugin/.zcode-plugin/plugin.json +2 -2
  30. package/vendor/packages/pdf-plugin/package.json +2 -2
  31. package/vendor/packages/pdf-plugin/skills/pdf/LICENSE.txt +10 -10
  32. package/vendor/packages/pdf-plugin/skills/pdf/references/resume-altacv.tex +1 -1
  33. package/vendor/packages/plugin-creator-plugin/skills/plugin-creator/SKILL.md +1 -1
  34. package/vendor/packages/plugin-creator-plugin/skills/plugin-creator/references/plugin-json-spec.md +1 -1
  35. package/vendor/packages/presentations-plugin/.zcode-plugin/plugin.json +2 -2
  36. package/vendor/packages/presentations-plugin/package.json +2 -2
  37. package/vendor/packages/presentations-plugin/skills/pptx/LICENSE.txt +10 -10
  38. package/vendor/packages/restore-legacy-sessions-plugin/skills/restore-legacy-sessions/SKILL.md +1 -1
  39. package/vendor/packages/spreadsheets-plugin/.zcode-plugin/plugin.json +2 -2
  40. package/vendor/packages/spreadsheets-plugin/package.json +2 -2
  41. package/vendor/packages/spreadsheets-plugin/skills/xlsx/LICENSE.txt +10 -10
  42. package/vendor/packages/visualize-plugin/.zcode-plugin/plugin.json +10 -0
  43. package/vendor/packages/visualize-plugin/package.json +8 -0
  44. package/vendor/packages/visualize-plugin/skills/visualize/LICENSE.md +5 -0
  45. package/vendor/packages/visualize-plugin/skills/visualize/SKILL.md +277 -0
  46. package/vendor/packages/visualize-plugin/skills/visualize/assets/calendar.js +273 -0
  47. package/vendor/packages/visualize-plugin/skills/visualize/assets/runtime-manifest.json +16 -0
  48. package/vendor/packages/visualize-plugin/skills/visualize/assets/standalone-host-bridge.js +256 -0
  49. package/vendor/packages/visualize-plugin/skills/visualize/assets/standalone-shell.js +183 -0
  50. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/d3-7.9.0.min.js +2 -0
  51. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/d3-7.9.0.min.js.LICENSE +13 -0
  52. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/floating-ui-core-1.7.3.min.js +1 -0
  53. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/floating-ui-core-1.7.3.min.js.LICENSE +20 -0
  54. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/floating-ui-dom-1.7.4.min.js +1 -0
  55. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/floating-ui-dom-1.7.4.min.js.LICENSE +20 -0
  56. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/lucide-1.17.0.js +19521 -0
  57. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/lucide-1.17.0.js.LICENSE +43 -0
  58. package/vendor/packages/visualize-plugin/skills/visualize/assets/vendor/manifest.json +57 -0
  59. package/vendor/packages/visualize-plugin/skills/visualize/assets/visualize.css +1222 -0
  60. package/vendor/packages/visualize-plugin/skills/visualize/assets/visualize.html +517 -0
  61. package/vendor/packages/visualize-plugin/skills/visualize/examples/calendar.html +10 -0
  62. package/vendor/packages/visualize-plugin/skills/visualize/references/api.md +128 -0
  63. package/vendor/packages/visualize-plugin/skills/visualize/references/styles.md +3 -0
  64. package/vendor/packages/visualize-plugin/skills/visualize/scripts/render.py +248 -0
  65. package/vendor/packages/visualize-plugin/skills/visualize/scripts/vendor.py +56 -0
  66. package/vendor/packages/visualize-plugin/skills/visualize/tweak.md +62 -0
  67. package/vendor/packages/visualize-plugin/skills/visualize/widgets/calendar.md +90 -0
  68. package/vendor/packages/zcode-cua-plugin/.zcode-plugin/plugin.json +1 -1
  69. package/vendor/packages/zcode-cua-plugin/docs/computer-use.md +1 -1
  70. package/vendor/packages/zcode-cua-plugin/package.json +1 -1
  71. package/vendor/packages/zcode-cua-plugin/scripts/computer-use-client.mjs +35 -41
  72. package/vendor/packages/zcode-guide-plugin/skills/zcode-configuration-guide/SKILL.md +2 -2
  73. package/vendor/provider/zcode-builtin.json +96 -1
  74. package/vendor/zcode.cjs +1622 -1425
  75. package/zcode-runtime.lock.json +3 -3
@@ -0,0 +1,183 @@
1
+ (() => {
2
+ const frame = document.getElementById("zcode-visualization");
3
+ if (!(frame instanceof HTMLIFrameElement)) {
4
+ return;
5
+ }
6
+ let viewportHeight = globalThis.innerHeight;
7
+ const storageKey = `zcode:visualization-widget-state-v2:${JSON.stringify([
8
+ globalThis.location.pathname,
9
+ globalThis.location.search,
10
+ ])}`;
11
+ const parseState = (serializedState) => {
12
+ if (
13
+ typeof serializedState !== "string" ||
14
+ new TextEncoder().encode(serializedState).length > 16 * 1024
15
+ ) {
16
+ throw new TypeError("Widget state must be a JSON object of at most 16 KiB");
17
+ }
18
+ /** @type {unknown} */
19
+ const state = JSON.parse(serializedState);
20
+ if (
21
+ state == null ||
22
+ typeof state !== "object" ||
23
+ Array.isArray(state) ||
24
+ ("imageIds" in state && (!Array.isArray(state.imageIds) || state.imageIds.length > 0))
25
+ ) {
26
+ throw new TypeError("Widget state must be a JSON object");
27
+ }
28
+ const storedState = { modelContent: null, privateContent: null, ...state };
29
+ const canonicalState = JSON.stringify(storedState, (_key, /** @type {unknown} */ value) => {
30
+ if (typeof value === "number" && !Number.isFinite(value)) {
31
+ throw new TypeError("Widget state must contain finite numbers");
32
+ }
33
+ return value;
34
+ });
35
+ if (new TextEncoder().encode(canonicalState).length > 16 * 1024) {
36
+ throw new TypeError("Widget state must be a JSON object of at most 16 KiB");
37
+ }
38
+ return storedState;
39
+ };
40
+ let storage = null;
41
+ let state = null;
42
+ try {
43
+ const localStorage = globalThis.localStorage;
44
+ const probeKey = `${storageKey}:probe`;
45
+ localStorage.setItem(probeKey, "1");
46
+ localStorage.removeItem(probeKey);
47
+ storage = localStorage;
48
+ const savedState = storage.getItem(storageKey);
49
+ if (savedState != null) {
50
+ try {
51
+ state = parseState(savedState);
52
+ } catch {
53
+ // Invalid saved state does not disable future writes.
54
+ }
55
+ }
56
+ } catch {
57
+ storage = null;
58
+ }
59
+ const initialGlobals = {
60
+ widgetState: state,
61
+ statePersistence: storage == null ? "none" : "local",
62
+ };
63
+
64
+ const channel = new MessageChannel();
65
+ channel.port1.addEventListener("message", (event) => {
66
+ const data = event.data;
67
+ if (typeof data !== "object" || data == null) {
68
+ return;
69
+ }
70
+ if (data.type === "widget-state-write") {
71
+ if (!Number.isSafeInteger(data.id) || data.id <= 0) {
72
+ return;
73
+ }
74
+ let ok = false;
75
+ try {
76
+ if (storage != null) {
77
+ const state = parseState(data.state);
78
+ storage.setItem(storageKey, JSON.stringify(state));
79
+ ok = true;
80
+ }
81
+ } catch {
82
+ // Storage denial, quota limits, and invalid state return a failed receipt.
83
+ }
84
+ channel.port1.postMessage({
85
+ type: "widget-state-result",
86
+ id: data.id,
87
+ ok,
88
+ });
89
+ return;
90
+ }
91
+ if (data.type === "height") {
92
+ const height = data.height;
93
+ if (
94
+ typeof height === "number" &&
95
+ Number.isFinite(height) &&
96
+ height >= 0 &&
97
+ height <= 10_000
98
+ ) {
99
+ frame.style.height = Math.ceil(height) + "px";
100
+ }
101
+ return;
102
+ }
103
+ if (data.type === "scroll-to") {
104
+ const top = data.top;
105
+ if (
106
+ typeof top === "number" &&
107
+ Number.isFinite(top) &&
108
+ top >= 0 &&
109
+ globalThis.navigator.userActivation?.isActive === true
110
+ ) {
111
+ globalThis.scrollTo({
112
+ top: Math.ceil(globalThis.scrollY + frame.getBoundingClientRect().top + top),
113
+ });
114
+ }
115
+ return;
116
+ }
117
+ if (data.type === "open-external") {
118
+ const rawHref = data.href;
119
+ if (typeof rawHref !== "string") {
120
+ return;
121
+ }
122
+ let href;
123
+ try {
124
+ const url = new URL(rawHref, document.baseURI);
125
+ if (url.protocol !== "https:") {
126
+ return;
127
+ }
128
+ href = url.href;
129
+ } catch {
130
+ return;
131
+ }
132
+ if (globalThis.navigator.userActivation?.isActive === true) {
133
+ const anchor = document.createElement("a");
134
+ anchor.href = href;
135
+ anchor.rel = "noopener noreferrer";
136
+ anchor.target = "_blank";
137
+ document.body.appendChild(anchor);
138
+ anchor.click();
139
+ anchor.remove();
140
+ }
141
+ return;
142
+ }
143
+ if (data.type === "follow-up") {
144
+ const prompt = data.prompt;
145
+ if (typeof prompt !== "string" || globalThis.navigator.userActivation?.isActive !== true) {
146
+ return;
147
+ }
148
+ const title = data.title;
149
+ globalThis.prompt(typeof title === "string" ? title : prompt, prompt);
150
+ }
151
+ });
152
+ channel.port1.start();
153
+ const srcdoc = frame.dataset.srcdoc;
154
+ if (srcdoc == null) {
155
+ return;
156
+ }
157
+ globalThis.addEventListener("resize", () => {
158
+ const height = Number.parseFloat(frame.style.height);
159
+ if (!Number.isFinite(height) || height <= viewportHeight) {
160
+ frame.style.removeProperty("height");
161
+ }
162
+ viewportHeight = globalThis.innerHeight;
163
+ channel.port1.postMessage({ type: "measure" });
164
+ });
165
+ frame.addEventListener(
166
+ "load",
167
+ () => {
168
+ frame.contentWindow?.postMessage({ type: "zcode-visualization-initialize" }, "*", [
169
+ channel.port2,
170
+ ]);
171
+ },
172
+ { once: true },
173
+ );
174
+ // Match the trusted bootstrap element, not the same text in an authored title.
175
+ frame.srcdoc = srcdoc.replace(
176
+ '<script type="application/json" id="zcode-visualization-widget-state">__ZCODE_VISUALIZATION_WIDGET_STATE__</script>',
177
+ () =>
178
+ '<script type="application/json" id="zcode-visualization-widget-state">' +
179
+ JSON.stringify(initialGlobals).replaceAll("<", "\\u003c") +
180
+ "</script>",
181
+ );
182
+ delete frame.dataset.srcdoc;
183
+ })();