@enfocussw/switch-scripting-context 0.1.0

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 (33) hide show
  1. package/CHANGELOG.md +504 -0
  2. package/README.md +192 -0
  3. package/bin/cli.js +8 -0
  4. package/dist/init.d.ts +78 -0
  5. package/dist/init.js +894 -0
  6. package/docs/switch-api/api-versions.md +127 -0
  7. package/docs/switch-api/connection.md +82 -0
  8. package/docs/switch-api/document-classes.md +189 -0
  9. package/docs/switch-api/entry-points.md +185 -0
  10. package/docs/switch-api/enums.md +181 -0
  11. package/docs/switch-api/execution-environment.md +143 -0
  12. package/docs/switch-api/flow-element.md +143 -0
  13. package/docs/switch-api/http.md +96 -0
  14. package/docs/switch-api/job-patterns.md +238 -0
  15. package/docs/switch-api/job.md +187 -0
  16. package/docs/switch-api/logging.md +117 -0
  17. package/docs/switch-api/switch.md +210 -0
  18. package/docs/switch-appstore/app-guidelines.md +281 -0
  19. package/docs/switch-appstore/app-manual.md +84 -0
  20. package/docs/switch-appstore/app-store-listing.md +69 -0
  21. package/docs/switch-appstore/app-store-submission.md +83 -0
  22. package/docs/switch-project/debugging.md +61 -0
  23. package/docs/switch-project/logs-and-dataroot.md +80 -0
  24. package/docs/switch-project/node-versions.md +87 -0
  25. package/docs/switch-project/project-planning.md +149 -0
  26. package/docs/switch-project/property-documentation.md +75 -0
  27. package/docs/switch-project/property-editors.md +249 -0
  28. package/docs/switch-project/script-declaration.md +407 -0
  29. package/docs/switch-project/script-structure.md +157 -0
  30. package/docs/switch-project/tooling.md +165 -0
  31. package/docs/switch-project/vscode.md +90 -0
  32. package/docs/switch-scripting.md +70 -0
  33. package/package.json +65 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,504 @@
1
+ # Changelog
2
+
3
+ All notable changes to this package are documented here. Format follows
4
+ [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
+
6
+ ## [Unreleased]
7
+
8
+ ## [0.1.0] - 2026-10-09
9
+
10
+ ### Changed
11
+
12
+ - Cursor now loads the Switch rules in every chat, not only when a TypeScript or JavaScript file is
13
+ in context, so questions asked without a file get them too. Re-run `init` to update the rule. It
14
+ keeps the rule's frontmatter if you edited it.
15
+ - **Breaking:** Version numbers no longer follow Switch releases. The next version is 0.1.0, and
16
+ 1.0.0 marks the public release. A dependency pinned to `~25.11.0` or similar won't receive the
17
+ new versions, so change it to `^0.1.0`. Which Switch release added each API member is listed in
18
+ the docs themselves.
19
+
20
+ ### Added
21
+
22
+ - The docs now say that after a script's properties change, the element needs "Reload script" in
23
+ Switch Designer before the flow is activated. Until then a new property is missing and reading it
24
+ throws `Invalid tag`.
25
+ - The docs now explain the message Switch logs when an entry point returns with a promise, timer
26
+ or callback still pending. Switch logs it as a Warning before 26.11 and as a Debug message from
27
+ 26.11.
28
+
29
+ ### Fixed
30
+
31
+ - The webhook and debugging docs now link to the related entry point, tooling, execution mode and
32
+ logging docs. Before, they linked nowhere, so an agent that opened one had no route to the details
33
+ it named.
34
+ - The always-loaded rules told agents to bump the declaration's `Version` on every edit, which
35
+ contradicted the declaration docs. They now say to bump it only when the current value has already
36
+ been released.
37
+ - The global data docs now describe how `lock` behaves, measured on Switch 26.11. Other
38
+ invocations wait for a lock instead of failing, until released or their entry point times out.
39
+ Writing or removing the tag releases it, as does the entry point ending, even by a throw or
40
+ timeout. One invocation can hold only one lock, so retrying `Token is already locked` never works.
41
+ - Every agent now gets the same core rules. Cursor, Codex, Windsurf, Zed, Cline and Continue gain
42
+ the planning step, the Switch version check and the pitfall search. Claude Code, Copilot, Gemini
43
+ and Aider gain the rules to transpile with SwitchScriptTool and to pack a script before production
44
+ use. Re-run `init` to update the generated files.
45
+ - The `Job` docs now list JSON as a dataset model. They named only XML, XMP, JDF and Opaque, so an
46
+ agent could claim a JSON log or dataset had to travel as Opaque. `DatasetModel.JSON` exists from
47
+ Switch 22.0.
48
+ - The VS Code docs now list the entry point snippets SwitchScriptTool generates and their prefixes,
49
+ instead of pointing to a summary that had no details. The always-loaded rules no longer tell
50
+ agents to use snippets, which only a person typing in VS Code can expand.
51
+ - The docs now say that `flowElement.setTimerInterval()` only works when called from `timerFired`.
52
+ Called from another entry point, such as `flowStartTriggered`, Switch ignores the interval and logs
53
+ a Warning.
54
+ - Agents often looked for a doc at the project root, such as `switch-api/job.md`, and sometimes
55
+ answered that the docs were missing. The copied index now gives every doc path with the docs folder
56
+ in front. Re-run `init` to update the copy.
57
+ - The entry point docs gave 60 seconds as a time limit, which agents read as the limit on
58
+ `jobArrived` and `timerFired`. It is the limit on the `abort` handler. The docs now say those
59
+ entry points use the flow element's "Abort after (minutes)" property or the matching Switch
60
+ preference.
61
+ - The `Job` docs now say that `sendTo*()` routing reaches Switch only when the entry point returns,
62
+ and not at all if it throws or is aborted.
63
+
64
+ ## [25.11.1-beta.6] - 2026-10-07
65
+
66
+ ### Added
67
+
68
+ - The Node.js version table now lists Switch 26.11, which runs scripts on Node.js 24.
69
+ - Every doc over 100 lines now opens with a Contents list of its section headings. An agent that
70
+ reads only the first part of a file can still see which sections exist further down.
71
+ - `--tools pi` configures the Pi coding agent. It is an alias for `codex`, because Pi reads the
72
+ same instructions file as Codex.
73
+ - `--tools continue` writes a Continue rule that is always in context, with the same rules and doc
74
+ list the other tools get.
75
+ - `--tools aider` adds the docs index to the read-only files Aider loads at startup. If your Aider
76
+ config already lists read-only files, `init` leaves it alone and prints the line to add.
77
+
78
+ ### Changed
79
+
80
+ - The docs now list only publicly released Switch versions. Version tables drop unreleased builds,
81
+ and examples that named one now use Switch 25.11 or 26.11.
82
+ - The Node.js version table and the rules for `SwitchVersion` moved out of the script project
83
+ structure doc into their own doc, with its own row in the routing table. Agents
84
+ asking which Node.js version a script runs on now read only that section.
85
+
86
+ ### Fixed
87
+
88
+ - The example of packing changing the Node.js version said a `SwitchVersion` of 21.0 runs on
89
+ Node.js 16. It runs on Node.js 14, as the version table already said.
90
+ - Agents often answered a short Switch question from the index page alone, without opening the doc
91
+ that holds the answer, and got it wrong. The generated instructions now tell agents to read the
92
+ matching doc before answering any Switch question, not only before writing code.
93
+ - The `Job` private data docs did not point to the string values of `EnfocusSwitchPrivateDataTag`,
94
+ so agents reported bare names such as `userEmail`. They now link to the enum reference.
95
+ - The property editor docs told readers to verify the `getLibraryForMultipleProperty` entry point
96
+ name "against source", which a consuming project does not have. The note now says the name is
97
+ unconfirmed.
98
+ - Re-running `init` stacked a second copy of the YAML frontmatter in the Cursor and Copilot
99
+ scoped-instructions files, one copy per run, which left the frontmatter invalid for both tools.
100
+ `init` now replaces its own frontmatter instead of prepending a new one, and leaves frontmatter
101
+ you have edited alone.
102
+ - An agent working in an already-scaffolded script folder skipped the Script vs App question. The
103
+ planning docs now say to ask it anyway, because a scaffolded manifest is always typed `Script`.
104
+ - The execution environment docs said top-level script variables survive between jobs and
105
+ suggested using them as a cache. The executor re-evaluates the script on every call, so they do
106
+ not. The docs now list what can leak (globals, `require()` caches, open handles) and say not to
107
+ rely on any of it.
108
+
109
+ ## [25.11.1-beta.5] - 2026-09-21
110
+
111
+ ### Fixed
112
+
113
+ - The property editor and declaration docs listed a `rational` (decimal) inline editor type,
114
+ which Node.js scripts do not allow. The docs no longer offer it and now say it is not allowed.
115
+ - `createJob()` was documented as valid only from `jobArrived` and `timerFired`. It also works from
116
+ `httpRequestTriggeredAsync`, the only webhook entry point that receives `flowElement`.
117
+ - Documented that `Type="password"` needs `Subtype=""`, not `"inline"`. The latter fails at script
118
+ load with an unsupported-editor error, even though it is the usual `Subtype` for a single inline
119
+ editor.
120
+ - Documented that `IncomingConnections="Yes"` with `RequireAtLeastOne="No"` makes the incoming
121
+ connection optional per flow element instance, letting one script support both a flow-starting
122
+ role and a mid-flow role.
123
+
124
+ ## [25.11.1-beta.4] - 2026-09-20
125
+
126
+ ### Added
127
+
128
+ - Guidance in `docs/switch-project/property-editors.md` for a property whose shape varies by a
129
+ type selector. Declare an enum master and one dependent per shape instead of encoding JSON in a
130
+ single property, so each shape gets a native editor and most parsing disappears. Includes the
131
+ two constraints: the master must be static, and a hidden dependent throws when read.
132
+ - A rule in `docs/switch-api/logging.md` against adding a script-level verbosity property. Switch
133
+ already gates `Debug` behind a preference, so the property duplicates a control the user has and
134
+ costs a pane row and translated strings.
135
+
136
+ ### Changed
137
+
138
+ - `init` and `remove` now write to a docs folder named `docs-for-agents` instead of
139
+ `switch-docs`. Re-running `init` after an upgrade deletes the old folder, drops its gitignore
140
+ line, and repoints the generated AI config files, so no stale copy of the docs is left for an
141
+ agent to load. Pass `--docs-dir switch-docs` to keep the old name.
142
+ - The `DetailedInfo` item in `docs/switch-appstore/app-guidelines.md` no longer reads as requiring
143
+ it on every property and connection. It is optional, matching what the property documentation
144
+ and app manual guidance already said, and points at the app manual as the surface users read.
145
+
146
+ ### Fixed
147
+
148
+ - The secret property row in `docs/switch-project/property-editors.md` listed `password` as an
149
+ editor chain. It is a `Type`, and there is no such editor token, so following the row produced an
150
+ invalid declaration.
151
+ - The array property row in `docs/switch-project/property-editors.md` claimed the chain always
152
+ returns a `string[]`, which the modal editor table contradicts. Both files now say the behaviour
153
+ is unverified and that code should handle a bare string too.
154
+
155
+ ## [25.11.1-beta.3] - 2026-09-17
156
+
157
+ ### Added
158
+
159
+ - `init` now records the version that produced the docs on the first line of
160
+ `switch-scripting.md`, as an HTML comment reading `switch-scripting-context <version>`. A tool
161
+ that installs the docs can read it to tell which version a project has, including a checkout
162
+ someone else set up. Re-running `init` rewrites the line, and `--dry-run` prints it without
163
+ writing.
164
+
165
+ ## [25.11.1-beta.2] - 2026-09-17
166
+
167
+ ### Added
168
+
169
+ - Planning now has agents check whether a design needs more than one flow element, and propose
170
+ one script folder per element before creating files. The script structure docs describe laying
171
+ out several script folders side by side, and creating them without deleting the folder you
172
+ work in.
173
+
174
+ ### Fixed
175
+
176
+ - The tooling docs now warn that `SwitchScriptTool --create` deletes an existing target folder
177
+ and everything in it, including git history, without asking. Agents are told to check that the
178
+ target doesn't exist first.
179
+ - The tooling docs now list the files `--pack` actually includes. Pack copies a fixed set of files,
180
+ not the whole folder, so a script that imports a local module fails to pack. Before, the docs
181
+ said pack only left out the npm manifest and VS Code settings.
182
+
183
+ ## [25.11.1-beta.1] - 2026-09-17
184
+
185
+ ### Added
186
+
187
+ - `remove --tools <list>` removes the Switch section only from the named tools' AI config files.
188
+ The docs folder, the `.gitignore` entry and other tools' config stay in place. Without
189
+ `--tools`, or with every tool listed, `remove` still removes everything.
190
+
191
+ ### Fixed
192
+
193
+ - `remove` now deletes the Cursor rule file and the scoped GitHub Copilot instructions file,
194
+ plus their folders if nothing else is in them. Before, it left both files behind containing
195
+ only their frontmatter. A file whose frontmatter you edited or wrote yourself is kept, with only
196
+ the Switch section removed.
197
+
198
+ ## [25.11.1-beta.0] - 2026-09-15
199
+
200
+ ### Added
201
+
202
+ - New `api-versions.md` lists which Switch release added each scripting API class, method, and
203
+ enum value. The API docs now mark each method, class, and enum value that needs a newer release
204
+ than the baseline with its minimum Switch version. Agents can check calls against the oldest
205
+ Switch a script or app must support.
206
+
207
+ ### Changed
208
+
209
+ - The Node.js version table now covers Switch 25.07, 26.03, and 26.07. It also explains that
210
+ `--pack` and SwitchScripter overwrite `SwitchVersion`, so a packed script can run on a newer
211
+ Node.js than its folder. It covers fallbacks for unlisted values and notes that API methods
212
+ follow the running Switch, not the manifest.
213
+
214
+ ### Fixed
215
+
216
+ - The routing table in `switch-scripting.md` now renders correctly in strict markdown parsers,
217
+ including VS Code's preview. The generated marker comments previously sat between the table's
218
+ header and its first row, which ended the table early per the GFM table spec; they now wrap the
219
+ whole table instead.
220
+
221
+ ## [25.11.0-beta.18] - 2026-09-11
222
+
223
+ ### Fixed
224
+
225
+ - The script declaration doc no longer tells agents to bump `Version` on every declaration change.
226
+ It now says to bump once per release and keep an unreleased number while editing, matching the
227
+ Appstore guidelines. It also notes that SwitchScripter only accepts minor versions for apps.
228
+
229
+ ## [25.11.0-beta.17] - 2026-09-11
230
+
231
+ ### Changed
232
+ - `job.md`'s `sendToData()` entry and `connection.md`'s `getPropertyStringValue()` entry now warn
233
+ directly, at the point an agent is most likely to read them, that there is no way to check in
234
+ advance whether a connection accepts a given traffic light level. The warning previously lived
235
+ only in a separate section agents weren't always reaching first.
236
+
237
+ ## [25.11.0-beta.16] - 2026-09-10
238
+
239
+ ### Added
240
+ - Connection docs clarify that traffic light levels (`Connection.Level.Success`/`Warning`/`Error`)
241
+ only select where `sendToData()`/`sendToLog()` route a job; they cannot be read back from a
242
+ connection object, and `sendToData()` fails the job if no connected level matches. Scripts that
243
+ need optional traffic light routing should expose a custom property and fall back to
244
+ `sendToNull()`.
245
+
246
+ ### Fixed
247
+ - `switch-scripting.md`'s own text told agents to grep a `docs/` prefix that only exists in this
248
+ repo's source tree, not in a consuming project's copied docs folder. Agents following that
249
+ instruction literally hit a folder that doesn't exist. The text now describes the copied layout.
250
+
251
+ ## [25.11.0-beta.15] - 2026-09-10
252
+
253
+ ### Added
254
+ - `property-documentation.md`, `app-store-listing.md`, `app-manual.md`, and
255
+ `app-store-submission.md`: writing guidance for the four separate places app documentation
256
+ ends up (per-property `Tooltip`/`DetailedInfo`, the declaration's listing fields, the uploaded
257
+ app manual document, and the Appstore website submission forms), including which content is
258
+ reused between them, icon specs, and a shared checklist against generic-sounding text.
259
+
260
+ ### Changed
261
+ - Docs reorganized under `docs/`: the scripting API stays in `docs/switch-api/`; project structure
262
+ and tooling docs moved to `docs/switch-project/`; Appstore publishing guidance moved to
263
+ `docs/switch-appstore/`. Update any bookmarked doc paths after upgrading.
264
+ - Dropped the `api-` prefix from doc filenames, for example `switch-api/job.md`, since each file's
265
+ folder already says what kind of doc it is.
266
+ - Each doc file now carries its own routing metadata (trigger and summary) as YAML frontmatter,
267
+ generated into the routing table and README's doc list instead of hand-duplicated in both.
268
+ README's descriptions now match the table's wording exactly; a few had drifted apart.
269
+
270
+ ### Fixed
271
+ - `init` now removes the destination docs folder before copying, instead of only adding and
272
+ overwriting. Previously, a doc renamed or moved between versions left the old file behind
273
+ permanently after an upgrade, since the destination folder is gitignored and nothing surfaced
274
+ the stale copy.
275
+
276
+ ## [25.11.0-beta.14] - 2026-09-09
277
+
278
+ ### Added
279
+ - `switch-scripting.md` now tells agents to grep `docs/switch-api/` for `known issue`, `gotcha`,
280
+ `quirk`, `caveat` to find documented pitfalls before writing code in an area.
281
+ - `api-entry-points.md` documents that a flow restart replays every queued job through `jobArrived`
282
+ again, even one whose processing was deferred to `timerFired`. A script relying on that pattern
283
+ must recognize an already-registered job and return quickly, or a large backlog is slow to clear.
284
+ - `api-project-planning.md`, a pre-scaffolding checklist for new scripts and apps: Script vs App,
285
+ job-processing approach, target OS, Switch version baseline, concurrency, native/binary npm
286
+ dependency feasibility, and Appstore competition risk. Loaded before any files are scaffolded.
287
+
288
+ ### Changed
289
+ - `README.md` no longer uses dashes as punctuation. Wording is unchanged otherwise.
290
+ - The published README now links to the changelog on jsdelivr, pinned to the version being
291
+ installed. Relative links were rewritten by npm to the private repo, so they were dead for
292
+ consumers. `prepack` swaps them in and `postpack` swaps them back.
293
+
294
+ ## [25.11.0-beta.13] - 2026-09-09
295
+
296
+ ### Fixed
297
+ - README's two CHANGELOG links pointed at an unversioned jsdelivr URL, which always serves the
298
+ *latest published* file. On GitHub that showed the published file rather than the repo's live one,
299
+ hiding unreleased entries. Both are now relative links, so GitHub resolves them to the live file.
300
+ - Generated tool config (Cursor, Codex/OpenCode, Windsurf, Zed, Cline) — the "Core rules" block told
301
+ agents never to edit `<ScriptID>.xml` and to send the user to SwitchScripter instead. That has
302
+ contradicted `api-script-declaration.md` and the `switch-scripting.md` key rules since the agent
303
+ editing policy was added, and it sat in an always-on rules file that outranks any doc the agent
304
+ loads later. Now matches the docs: direct editing is fine under the declaration's rules.
305
+
306
+ ### Added
307
+ - `api-switch.md` — a "Translation extraction rules" section under `Switch.tr()`. Extraction is
308
+ static source analysis, so aliasing `Switch.tr`, concatenating with a variable, or interpolating
309
+ a template literal silently produces no translation entry at all. Documents what does work
310
+ (all quote styles, multi-line, literal-only concatenation, marking a string away from its use
311
+ site) and the `%1` + `messageParams` pattern for dynamic values.
312
+ - `api-job-patterns.md` — "Driving a third-party CLI application", the Node.js replacement for the
313
+ legacy `findApplicationPath`/`ApplicationPath` mechanism: a custom path property on the
314
+ `automatic;choosefile;sltextwithvar;scriptexp` chain, resolved once in `flowStartTriggered` into
315
+ `Scope.FlowElement` global data, with `failProcess()` when discovery fails and cleanup in
316
+ `flowStopTriggered`.
317
+ - `api-script-structure.md` — "Packing an app" and SwitchScripter/Switch version compatibility:
318
+ script folders can only be typed `Script` (pack, then retype to `App` in SwitchScripter), extra
319
+ files are unavailable in script-folder mode, the pack ID is always `com.enfocus.*` and is carried
320
+ over by opening the previous `.enfpack`, an app loads only in its build version or newer (no
321
+ Scripter for 25.07/25.11 — use 2024 Fall), and an unsigned app loads only on the machine that
322
+ built it.
323
+ - `api-app-guidelines.md` — the App-only section is now split into Identity and versioning,
324
+ Top-level declaration properties, Password protection, Localization, Icon, Extra files, Source
325
+ and review hygiene, and what review does and doesn't cover. New rules from the App SDK: script ID
326
+ charset and uniqueness, resubmit-without-bumping after a rejection, minor-version format, the
327
+ three-category limit and Product Management approval, unsigned apps always loading under
328
+ "Custom", `DetailedInfo` feeding the generated HTML docs, `ExecutionGroup` coordination for a
329
+ shared third-party application, `Compatibility`/`SupportInfo`/`AppDiscovery` being required to
330
+ build the pack at all, Node.js password protection being unrecoverable, the six-language limit on
331
+ app translations, the 200×200 Appstore icon, and macOS notarization checks via `codesign -dv`.
332
+ - Generated tool config and `switch-scripting.md` key rules — added the entry-point scanner
333
+ constraints (literal `function` keyword; no trailing-backslash string literals, regex literals, or
334
+ non-`word / word` division) to the always-on rules. Previously these lived only in
335
+ `api-entry-points.md`, so an agent making a small edit without opening that file had no signal
336
+ that the failure mode exists, and it fails silently.
337
+
338
+ ### Changed
339
+ - Generated tool config for Cursor, Codex/OpenCode, Windsurf, Zed and Cline now lists each API doc
340
+ with its "Load when" routing text instead of a bare filename, so those agents can open the one
341
+ file they need without reading `switch-scripting.md` first. Costs ~600 tokens in the always-on
342
+ block, saves a ~1,300-token hub read per session.
343
+ - The routing table in `docs/switch-scripting.md` is now the single source for that list. `init.ts`
344
+ parses it (`parseRoutingTable()`); the two hardcoded 19-entry arrays are gone, as is the drift
345
+ they invited.
346
+ - `api-script-structure.md` — moved "App Store submission guidelines" into
347
+ `api-app-guidelines.md` § App-only and "Execution modes" into `api-execution-environment.md`,
348
+ leaving pointers at both old headings. Reviewing an app or reasoning about concurrency previously
349
+ needed two files for one topic. Existing anchor links still resolve.
350
+ - `docs/switch-scripting.md` and `README.md` — sharpened the routing descriptions for
351
+ `api-job.md` (signatures) vs `api-job-patterns.md` (rules and gotchas), and for
352
+ `api-script-structure.md` vs `api-tooling.md`. Their triggers overlapped enough that an agent had
353
+ to load both files for any job-handling task.
354
+ - `init` no longer copies `docs/superpowers`, `docs/temp`, or `.DS_Store` into a consuming project.
355
+ The published tarball already excludes them, but `init` run from a git clone did not.
356
+
357
+ ## [25.11.0-beta.12] - 2026-09-08
358
+
359
+ ### Fixed
360
+ - `README.md` — linked the two `CHANGELOG.md` mentions to the jsdelivr-served copy of the file
361
+ instead of leaving them as unlinked plain text. A relative link would have npm rewrite it to a
362
+ GitHub blob URL that 404s on npmjs.com, since the source repo is private; jsdelivr serves the file
363
+ straight from the published tarball regardless of repo visibility.
364
+
365
+ ## [25.11.0-beta.11] - 2026-09-08
366
+
367
+ ### Added
368
+ - `api-entry-points.md` — documented that Switch's entry-point scanner is regex-based (not a real
369
+ parser) and can silently drop `function` declarations from certain source shapes: string literals
370
+ ending in a backslash, regex literals (especially ones containing an unescaped `/` inside a
371
+ character class), and division not in a plain `word / word` shape. Applies to every entry point,
372
+ not just the ones checked at load time; `calculateScriptExpression` is the one exception, since
373
+ it's dispatched directly rather than through this scanner. Verified against real
374
+ `SwitchScriptTool --pack` output for each failure mode.
375
+ - `api-tooling.md` — new "Verify entry points before packing" section with a Python/Node.js script
376
+ to check a built `main.js` for the expected entry points before relying on `--pack`, which doesn't
377
+ validate this itself.
378
+ - `api-script-structure.md` — cross-linked the entry-point scanner constraints from the "Agent
379
+ editing policy" callout.
380
+ - `api-app-guidelines.md` — new pre-publish checklist for scripts submitted to the Enfocus Appstore,
381
+ covering property naming/tooltip/editor/default requirements, entry point and `sendTo*()`
382
+ consistency with declared connections, logging quality, temp file/path handling, and app-only
383
+ packaging rules (no embedded Oracle JRE, universal signed macOS Mach-O binaries in extra files,
384
+ immutable extra files, translation completeness). Registered in the routing table, both `init.ts`
385
+ doc-file arrays, and the README's included-docs list.
386
+
387
+ ### Changed
388
+ - `switch-scripting.md` — broadened the `api-entry-points.md` routing-table trigger to any edit to
389
+ `main.ts`/`main.js`, not just adding a new entry point.
390
+ - `api-property-editors.md` — documented that the `nofiles`/`allfiles`/`allotherfiles` and
391
+ `nofolders`/`allfolders`/`allotherfolders` literal editors are specifically for connection
392
+ include/exclude filter mask properties, with the exact `Editor`/`Default`/`Subtype` chain verified
393
+ against Switch's own built-in connection filter declarations; added the matching rows to Common
394
+ practices. Noted that `next`/`current` have no confirmed script-facing use case. Noted that `none`
395
+ is the sanctioned way to allow an empty value under `Validation="Standard"`.
396
+ - `api-script-declaration.md` — cross-linked the `Validation` row to the `none` literal editor for
397
+ allowing empty values under `Standard` validation.
398
+ - `api-app-guidelines.md`, `api-script-declaration.md`, `api-property-editors.md`,
399
+ `api-entry-points.md`, `api-job-patterns.md`, `api-logging.md`, `api-script-structure.md` —
400
+ reclassified the Appstore submission rules added previously: most turned out to be universal
401
+ correctness rules (functional requirements or bugs if violated) rather than app-specific policy,
402
+ so their "App guideline" framing was removed and they're now stated as plain rules that apply to
403
+ every script. Only a handful remain "mandatory for apps, recommended for scripts" (property
404
+ naming/tooltip/default, non-module-editor requirement, log volume, platform-independent paths).
405
+ "No embedded Oracle JRE" moved out of the app-only section entirely, since it applies to any
406
+ script bundling extra files. `api-app-guidelines.md` is now organized into three explicit tiers
407
+ (Universal / Apps required-scripts recommended / Apps only) instead of one flat list.
408
+ - `api-script-declaration.md`, `api-property-editors.md`, `api-entry-points.md`, `api-job-patterns.md`,
409
+ `api-job.md`, `api-logging.md`, `api-script-structure.md` — wove the individual Appstore submission
410
+ rules (above) directly into the relevant existing sections (property attributes, editor tables,
411
+ entry point signatures, `sendTo*()`/`ConnectionType` rules, logging conventions, packaging), each
412
+ cross-linked to and from the new checklist, so they're followed from the start rather than caught
413
+ only at a pre-publish review.
414
+ - `api-script-declaration.md` — fixed the `Validation="Custom"` row, which named a nonexistent
415
+ `isPropertyValid` entry point; the actual entry point (per `api-entry-points.md`) is
416
+ `validateProperties`/`validateConnectionProperties`.
417
+ - `api-job-patterns.md` — clarified that the automatic executor-refresh cleanup only applies to
418
+ temp files created via `flowElement.createPathWithName()` (the recommended default); temp files
419
+ created any other way must be cleaned up explicitly by the script. Also notes that the `tmp` npm
420
+ package is not recommended, and if used anyway, its `setGracefulCleanup()` is not always reliable
421
+ in the Switch execution environment and `discardDescriptor: true` should be set.
422
+ - `api-flow-element.md`, `api-connection.md`, `api-script-declaration.md` — cross-linked and made
423
+ explicit that `getPropertyStringValue()`/`connection.getPropertyStringValue()` throws
424
+ `"Invalid tag: <tag>"` for a `Dependency` dependent property currently hidden by its master's
425
+ value, and that `hasProperty()`/`connection.hasProperty()` should be used to guard against this
426
+ (e.g. before fetching properties dependent on a drop-down/enum master). Also notes that the shown
427
+ set can vary per job if the master's value is dynamic, and that a hidden dependent's value cannot
428
+ be read at all — a script needing more than one dependency group's data at once must use a
429
+ different property structure, not `Dependency`-based hiding.
430
+
431
+ ## [25.11.0-beta.10] - 2026-09-03
432
+
433
+ ### Added
434
+ - `api-job-patterns.md` — documented a known ordering bug: creating a child job before writing a
435
+ pending dataset causes the child to inherit the stale dataset, leading to a destructive
436
+ file-move race at `sendTo*()`. `api-job.md`'s dataset/child-job entries now note which calls
437
+ are immediate vs. deferred.
438
+
439
+ ## [25.11.0-beta.9] - 2026-08-26
440
+
441
+ ### Added
442
+ - `package.json` now declares `"main": "dist/init.js"`. Deliberately no `"exports"` field, so
443
+ `switch-scripting-context/package.json` also stays reachable for consumers that need to read the
444
+ package's own version (e.g. to compare against a script's target Switch version).
445
+
446
+ ### Changed
447
+ - Package now publishes to the public npm registry instead of GitHub Packages.
448
+
449
+ ## [25.11.0-beta.8] - 2026-08-25
450
+
451
+ ### Removed
452
+ - `init` no longer copies `.vscode/switch.code-snippets` (or removes it on `remove`) — Switch script folders already come with these snippets via `SwitchScriptTool --create`, so this package's own copy was redundant.
453
+ - `snippets/switch.code-snippets` and `scripts/scrape_switch_docs.py` (unused internal tooling) removed from the repo.
454
+
455
+ ## [25.11.0-beta.7] - 2026-08-25
456
+
457
+ ### Added
458
+ - README — "Using this with your coding agent" usage guide.
459
+
460
+ ### Fixed
461
+ - `switch-scripting.md`'s routing table and the two hardcoded doc-list arrays in `src/init.ts` (used for Cursor's rules and the shared inline block for Codex/Windsurf/Zed/Cline) were missing `api-execution-environment.md`, `api-logging.md`, and `api-logs-and-dataroot.md` — those three docs were copied to `switch-docs/` but never referenced in 5 of the 8 tools' generated config, making them undiscoverable.
462
+
463
+ ## [25.11.0-beta.6] - 2026-08-25
464
+
465
+ ### Added
466
+ - `docs/switch-api/api-logs-and-dataroot.md` — locating the Application Data Root, querying `ServerLogs.db3` directly (schema, `%N` placeholder reconstruction, retention, and the debug-level logging gate) to diagnose or validate a script from its actual log output.
467
+
468
+ ## [25.11.0-beta.5] - 2026-08-25
469
+
470
+ ### Added
471
+ - `docs/switch-api/api-tooling.md` — `--generate-translations` command, `ScriptID` character constraint, macOS fallback binary path.
472
+
473
+ ### Fixed
474
+ Corrections found by live-testing `SwitchScriptTool` (create/pack/unpack/list/verbose) against `api-tooling.md`:
475
+ - Clarified `--transpile` is only needed for testing a script folder in Switch, not before packing — `--pack` always transpiles `main.ts` fresh and never touches an existing `main.js` in the source folder.
476
+ - Documented that `--pack` always excludes `package.json`/`.vscode/` from the package, and strengthened the `npm prune --production` advice with the concrete reason (unpruned `devDependencies`, especially `@types/*`, get bundled for no runtime benefit).
477
+ - Documented that `--unpack` strips `main.js`/`main.js.map` back out for a TypeScript-sourced package and prints `Type`/`Protection`/`Status` metadata.
478
+ - Clarified `--create` scaffolds into a new `<Path>/<ScriptID>/` subfolder, not into `<Path>` directly.
479
+
480
+ ## [25.11.0-beta.4] - 2026-08-25
481
+
482
+ ### Added
483
+ - `docs/switch-api/api-execution-environment.md` — process/concurrency model, state persistence across job invocations, unhandled-rejection behavior, npm/native module constraints.
484
+
485
+ ### Known issue
486
+ - `docs/switch-api/api-document-classes.md` — flagged that `PdfPage.getArtBoxHeight`/`getArtBoxWidth` (and the `PdfDocument` static equivalents) currently return the crop box value instead of the art box, due to a bug on the Switch side.
487
+
488
+ ### Fixed
489
+ Corrections found by auditing the docs against the actual API/runtime source:
490
+ - `api-execution-environment.md` — corrected the concurrency model: `NumberOfSlots`/`ExecutionGroup` gate job dispatch on the Switch Server per flow-element instance (or via a cross-element named lock for `Serialized` mode); they do not map to a dedicated Node.js OS process per slot. The executor process pool is sized independently and reused across jobs/elements.
491
+ - `api-connection.md` — `getFileCount`'s `nested` parameter is optional (defaults to `true`), not required. Tightened `getId()`'s stability description (renaming the flow is safe; renaming the flow element is not).
492
+ - `api-job.md` — `processLater`'s `seconds` parameter is optional (defaults to `300`). `sendToChannel` throws synchronously on no-subscriber/empty args rather than failing the job. Documented that `getPrivateData`/`listDatasets`/`getDataset` throw on jobs from `getJobs()`, while `setPrivateData`/`removePrivateData` are not restricted. Documented that `getxmlData`/`getxmpData`/`getJdfData`/`getJSONData` resolve to `undefined` on error rather than throwing.
493
+ - `api-flow-element.md` — `createPathWithName`'s `createFolder` parameter is required, not optional; corrected its return-value description (empty string only on a caught exception, not because the path already exists). `getFileCount`'s `nested` parameter is optional (defaults to `true`). Documented `failProcess`'s and `getJobs`'s throw conditions. Corrected `createJob`'s supported entry points (`jobArrived`/`timerFired` only). Documented `getPluginResourcesPath`'s local-only `.sscript` behavior and throw case.
494
+ - `api-http.md` / `api-switch.md` — fixed the `httpRequestSubscribe` example to use a leading-slash path; documented the path-format validation and `httpRequestUnsubscribe` example.
495
+ - `api-switch.md` — `getGlobalData` returns `''` for a missing tag, not `undefined`; documented the 100-call advisory warning. Documented `getPreferenceSetting`'s field redaction and JSON-stringify behavior, and `getServerVersion`'s `major + minor/100` numeric format.
496
+ - `api-document-classes.md` — documented `XmlDocument.evaluate()`'s `object` return case, the `jdf` default-namespace prefix, and `ImageDocument.getICCProfile()`'s EXIF fallback.
497
+ - `api-property-editors.md` / `api-script-declaration.md` — corrected `getPropertyType()`'s description (returns one of several `PropertyType` values, not a literal-vs-user-entered flag) and noted the XML `Type` vocabulary doesn't map one-to-one onto the runtime `PropertyType` enum.
498
+
499
+ ## [25.11.0-beta.3] - 2026-08-25
500
+
501
+ ### Added
502
+ - `docs/switch-api/api-logging.md` — log level semantics, logging practice, `console.log` limitation.
503
+ - `docs/switch-api/api-property-editors.md` — "Common practices" section recommending editor chains by property kind.
504
+ - `docs/switch-api/api-script-declaration.md` — clarified that `ApplicationPath`/`ApplicationLicense` are app-only properties set by the user via the Switch Scripter GUI after packing, not by editing the declaration file.