@enfocussw/switch-scripting-context 25.11.0-beta.8 → 25.11.1-beta.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 (35) hide show
  1. package/CHANGELOG.md +246 -0
  2. package/README.md +45 -48
  3. package/dist/init.d.ts +15 -0
  4. package/dist/init.js +77 -66
  5. package/docs/switch-api/api-versions.md +116 -0
  6. package/docs/switch-api/connection.md +82 -0
  7. package/docs/switch-api/{api-document-classes.md → document-classes.md} +13 -2
  8. package/docs/switch-api/entry-points.md +171 -0
  9. package/docs/switch-api/{api-enums.md → enums.md} +23 -12
  10. package/docs/switch-api/{api-execution-environment.md → execution-environment.md} +39 -12
  11. package/docs/switch-api/{api-flow-element.md → flow-element.md} +23 -7
  12. package/docs/switch-api/{api-http.md → http.md} +10 -1
  13. package/docs/switch-api/job-patterns.md +178 -0
  14. package/docs/switch-api/{api-job.md → job.md} +23 -9
  15. package/docs/switch-api/{api-logging.md → logging.md} +47 -5
  16. package/docs/switch-api/{api-switch.md → switch.md} +68 -4
  17. package/docs/switch-appstore/app-guidelines.md +258 -0
  18. package/docs/switch-appstore/app-manual.md +84 -0
  19. package/docs/switch-appstore/app-store-listing.md +69 -0
  20. package/docs/switch-appstore/app-store-submission.md +83 -0
  21. package/docs/{switch-api/api-debugging.md → switch-project/debugging.md} +9 -0
  22. package/docs/{switch-api/api-logs-and-dataroot.md → switch-project/logs-and-dataroot.md} +10 -1
  23. package/docs/switch-project/project-planning.md +117 -0
  24. package/docs/switch-project/property-documentation.md +75 -0
  25. package/docs/{switch-api/api-property-editors.md → switch-project/property-editors.md} +55 -8
  26. package/docs/{switch-api/api-script-declaration.md → switch-project/script-declaration.md} +47 -13
  27. package/docs/switch-project/script-structure.md +188 -0
  28. package/docs/{switch-api/api-tooling.md → switch-project/tooling.md} +87 -1
  29. package/docs/{switch-api/api-vscode.md → switch-project/vscode.md} +19 -0
  30. package/docs/switch-scripting.md +49 -23
  31. package/package.json +11 -7
  32. package/docs/switch-api/api-connection.md +0 -63
  33. package/docs/switch-api/api-entry-points.md +0 -82
  34. package/docs/switch-api/api-job-patterns.md +0 -79
  35. package/docs/switch-api/api-script-structure.md +0 -85
@@ -0,0 +1,258 @@
1
+ ---
2
+ id: app-guidelines
3
+ category: switch-appstore
4
+ order: 20
5
+ summary: "Pre-publish checklist for Appstore apps: property naming/tooltips/editors, entry point and sendTo consistency, logging quality, packaging, and the app-only submission rules (localization, signed universal macOS binaries)"
6
+ triggers:
7
+ - "Preparing a script for publication as an app, or reviewing one against Appstore submission criteria"
8
+ ---
9
+
10
+ # App Publishing Guidelines
11
+
12
+ A pre-publish checklist for a script intended for the Enfocus Appstore (`ScriptPackageType="App"`
13
+ — see [script-structure.md § Script vs App](../switch-project/script-structure.md#script-vs-app)). Each item
14
+ here is enforced in more detail at the linked section — this page exists to be read top-to-bottom
15
+ right before submission, not as the primary source for any individual rule. The one exception is
16
+ [App-only](#app-only) at the bottom, which is documented in full here.
17
+
18
+ Items fall into three tiers, marked on each one:
19
+
20
+ - **Universal** — a correctness rule for every script, app or not. Violating it is a bug, not a
21
+ style choice.
22
+ - **Apps required / scripts recommended** — mandatory for Appstore review; worth following in a
23
+ plain `Script` too, but not enforced there.
24
+ - **Apps only** — doesn't apply to a plain `Script` package at all.
25
+
26
+ ---
27
+
28
+ ## Properties
29
+
30
+ - [ ] **Apps required / scripts recommended.** Every property name (`LocalizedTagName`) is 30
31
+ characters or fewer and uses sentence-style capitalization ("Customer name", not "Customer
32
+ Name") — see [script-declaration.md](../switch-project/script-declaration.md#custom-property-elements-elementfields).
33
+ - [ ] **Apps required / scripts recommended.** Every property has a `Tooltip`, unless it's fully
34
+ self-explanatory with no extra constraints (e.g. "Number of copies" with no min/max) — see
35
+ [script-declaration.md](../switch-project/script-declaration.md#custom-property-elements-elementfields) for
36
+ the attribute and [property-documentation.md](../switch-project/property-documentation.md) for what to write in it.
37
+ - [ ] **Universal.** Dynamic editors (`sltextwithvar`/`mltextwithvar`, `conditionwithvar`,
38
+ `scriptexp`) are enabled wherever the value could plausibly vary per job, and omitted where the
39
+ value is inherently static (e.g. a dataset name) — see
40
+ [property-editors.md § Common practices](../switch-project/property-editors.md#common-practices).
41
+ - [ ] **Universal.** Keyword-style default values ("Default", "None", "Automatic", …) use the
42
+ matching literal editor (`default`, `none`, `automatic`, …), not a typed string default — see
43
+ [property-editors.md § Literal editors](../switch-project/property-editors.md#literal-editors).
44
+ - [ ] **Universal.** Every property using `askplugin`/`askplugin2` ("Select from library"/"Select
45
+ many from library") has a matching `getLibraryForProperty`/`getLibraryForConnectionProperty`
46
+ entry point — see [entry-points.md § Property UI callbacks](../switch-api/entry-points.md#property-ui-callbacks).
47
+ - [ ] **Apps required / scripts recommended.** Every property's editor chain includes at least one
48
+ editor that doesn't require an add-on Switch module — e.g. never offer `scriptexp` (Scripting
49
+ Module) as the only editor — see
50
+ [property-editors.md § Common practices](../switch-project/property-editors.md#common-practices).
51
+ - [ ] **Universal.** Every property using the `external`/`external2`/… editor has either a
52
+ non-empty dependent `Application` property or a `findExternalEditorPath` entry point — see
53
+ [property-editors.md § Notes](../switch-project/property-editors.md#notes).
54
+ - [ ] **Apps required / scripts recommended.** Every property has a default value unless one
55
+ genuinely isn't possible, in which case the `Tooltip` gives an example value instead — see
56
+ [script-declaration.md](../switch-project/script-declaration.md#custom-property-elements-elementfields).
57
+ - [ ] **Universal.** Every property/connection field declaring `Validation="Custom"` or `"Standard
58
+ and custom"` has a matching `validateProperties`/`validateConnectionProperties` entry point —
59
+ see [entry-points.md § Property UI callbacks](../switch-api/entry-points.md#property-ui-callbacks).
60
+
61
+ ## Entry points
62
+
63
+ - [ ] **Universal.** `jobArrived` is present when `IncomingConnections="Yes"`; `timerFired` is
64
+ present when `IncomingConnections="No"` (and may additionally be present alongside `jobArrived`)
65
+ — see [entry-points.md § Job processing](../switch-api/entry-points.md#job-processing).
66
+ - [ ] **Universal.** No empty `jobArrived` or `timerFired` — an entry point that does nothing is
67
+ removed entirely, not left in place — see
68
+ [entry-points.md § Job processing](../switch-api/entry-points.md#job-processing).
69
+
70
+ ## Sending jobs
71
+
72
+ All **universal** — see
73
+ [job-patterns.md § Sending jobs](../switch-api/job-patterns.md#sending-jobs) and
74
+ [script-declaration.md § ConnectionFields](../switch-project/script-declaration.md#connectionfields) for full
75
+ detail.
76
+
77
+ - [ ] If `OutgoingConnections` is not `No`, some `sendTo*()` method is called at least once for
78
+ any job actually routed (a purely timer/event-driven script that never touches a job is a
79
+ legitimate exception).
80
+ - [ ] If `OutgoingConnections="Unlimited"`, `job.sendToSingle()` is never used.
81
+ - [ ] `ConnectionType="Move"` never uses `job.sendToData()`/`job.sendToLog()`.
82
+ - [ ] `ConnectionType="TrafficLight"` uses only `job.sendToData()`/`job.sendToLog()`; `sendToData`
83
+ is used when a Data Success/Warning/Error connection is enabled, `sendToLog` when the
84
+ corresponding Log connection is enabled.
85
+ - [ ] An unused Success/Warning/Error connection is omitted from `ConnectionFields` entirely, not
86
+ left declared but unrouted.
87
+ - [ ] A job with no output calls `job.sendToNull()`.
88
+ - [ ] `job.fail()`/`flowElement.failProcess()` is used for genuine processing errors; an error
89
+ `TrafficLight` connection isn't used as a substitute for `fail()`.
90
+
91
+ ## Logging
92
+
93
+ - [ ] **Universal.** An `Error` is logged when a custom
94
+ `validateProperties`/`validateConnectionProperties` check returns `valid: false` for a tag, and
95
+ when `getLibraryForProperty`/`getLibraryForConnectionProperty` would otherwise return an empty
96
+ list — see [logging.md § Message quality](../switch-api/logging.md#message-quality).
97
+ - [ ] **Universal.** Log messages are free of grammatical errors and typos — see
98
+ [logging.md § Message quality](../switch-api/logging.md#message-quality).
99
+ - [ ] **Universal.** Log messages use `%1`/`%2`/… placeholders with `messageParams`, not string
100
+ concatenation or interpolation of dynamic values — required for correct translation. See
101
+ [logging.md § Placeholders instead of concatenation](../switch-api/logging.md#placeholders-instead-of-concatenation),
102
+ which also covers the separate, narrower literal-`%` escaping gotcha.
103
+ - [ ] **Apps required / scripts recommended.** Logging isn't excessive — no `Info`/`Debug` calls
104
+ that don't help a flow operator or support engineer understand what happened — see
105
+ [logging.md § Log volume](../switch-api/logging.md#log-volume).
106
+
107
+ ## Temp files and paths
108
+
109
+ - [ ] **Universal.** All temporary files and folders are removed by the script before it finishes,
110
+ rather than relying on Switch's executor-refresh cleanup — see
111
+ [job-patterns.md § Temp file cleanup](../switch-api/job-patterns.md#temp-file-cleanup).
112
+ - [ ] **Universal.** No Oracle JRE is embedded as an extra file, in a script or an app — see
113
+ [script-structure.md § Script folder files](../switch-project/script-structure.md#script-folder-files).
114
+ - [ ] **Apps required / scripts recommended.** File system path strings are built with Node's
115
+ `path` module, not hardcoded separators or string concatenation — see
116
+ [job-patterns.md § Platform-independent paths](../switch-api/job-patterns.md#platform-independent-paths).
117
+
118
+ ---
119
+
120
+ ## App-only
121
+
122
+ The following apply only to `ScriptPackageType="App"`, not to a plain `Script` package at all.
123
+ Unlike the sections above, these are documented in full here rather than deferring elsewhere.
124
+
125
+ ### Identity and versioning
126
+
127
+ - [ ] **`Name` (Script ID) matches `[A-Za-z0-9_-]+`** — letters, digits, hyphens and underscores
128
+ only, no spaces. It must also be globally unique across the Appstore; Enfocus checks for clashes
129
+ at review and may require a change. Pick something unlikely to collide.
130
+ - [ ] **`Name` never changes across versions.** It is what identifies the app in an existing
131
+ customer flow, so changing it breaks the upgrade path. `DisplayName` *can* change freely between
132
+ versions without breaking upgrades — so keep any third-party application version number out of
133
+ `Name`, and preferably out of `DisplayName` too, or every application release forces a rename.
134
+ - [ ] **`Version` is only incremented once the previous version was actually published.** If a
135
+ submission is rejected, resubmit under the *same* version number rather than bumping. Minor
136
+ versions are allowed to one level (`1.1`, `1.10`, `1.34`); leading zeros are not (`1.01` is
137
+ invalid).
138
+ - [ ] **Every app in an app bundle carries the same version**, including the master app entry.
139
+ - [ ] **The pack ID always starts with `com.enfocus.`**, generated from the script ID, regardless
140
+ of the company name and domain set in SwitchScripter preferences. To keep it stable when
141
+ updating, open the existing `.enfpack` (not the `.sscript`) before re-packing — SwitchScripter
142
+ remembers the pack ID from the pack it opened.
143
+
144
+ ### Top-level declaration properties
145
+
146
+ - [ ] **App-level `Tooltip` is filled in** — this is the tooltip on the icon in the Elements pane,
147
+ separate from the per-property tooltips above.
148
+ - [ ] **`Keywords` is populated and matches the keywords on the app's Appstore detail page.** Words
149
+ already in `DisplayName` are implicitly searchable and don't need repeating. Matching is
150
+ case-insensitive.
151
+ - [ ] **`ExecutionMode="Concurrent"` wherever the script allows it.** `Serialized` is the default
152
+ and the slower choice; concurrent is preferred for throughput. If you go concurrent, the script
153
+ must synchronise its own access to any shared resource — see
154
+ [execution-environment.md § Execution modes](../switch-api/execution-environment.md#execution-modes).
155
+ - [ ] **`ExecutionGroup` is shared across every app that drives the same non-concurrent third-party
156
+ application**, so Switch can stop them using it simultaneously. If your app is in that situation,
157
+ ask Enfocus which group name to use rather than inventing one.
158
+ - [ ] **`PerformanceTuning="Yes"` only with a concrete reason.** It exposes `IdleAfterJob` (and
159
+ `NumberOfSlots`) to the user; don't surface those knobs by default.
160
+ - [ ] **At most three categories, and `SubcategoryInElementPane` is filled in.** New categories need
161
+ Enfocus Product Management approval, and an app listed in more than three needs additional
162
+ approval. Note that an unsigned app always loads under the **Custom** subcategory regardless of
163
+ what it declares — the declared subcategory only takes effect once Enfocus has signed the app, and
164
+ review may change it.
165
+ - [ ] **`DetailedInfo` is present on every property and every connection**, not just `Tooltip`.
166
+ Switch Designer can export a *flow's* HTML documentation from every element in it, so an empty
167
+ `DetailedInfo` produces a blank entry there if a flow builder ever generates one — see
168
+ [property-documentation.md](../switch-project/property-documentation.md) for what to write in it, and when
169
+ it's fine to leave blank.
170
+ - [ ] **`Description`, `Compatibility`, `SupportInfo` and `AppDiscovery` are filled in.** These are
171
+ required to create the `.enfpack` at all, and `SupportInfo` must point at *your* support channel,
172
+ never Enfocus Support — see [app-store-listing.md](app-store-listing.md) for what to write
173
+ in each.
174
+ - [ ] **The app manual document is prepared**, following Enfocus's `documentation-app_name.docx`
175
+ template, and uploaded during Appstore review — see [app-manual.md](app-manual.md).
176
+ - [ ] **The declared incoming/outgoing connection topology matches what the code actually does** —
177
+ see [Entry points](#entry-points) and [Sending jobs](#sending-jobs) above.
178
+ - [ ] **Dependent properties have real dependency conditions and values, never left empty**, and the
179
+ script does not read a dependent property's value when its master isn't set to the value that
180
+ makes it relevant.
181
+
182
+ ### Password protection
183
+
184
+ - [ ] **The app is password protected with a non-trivial password** (8+ characters, mixed case,
185
+ digits, symbols). Enfocus checks the password strength at review.
186
+ - [ ] **Don't lose the password.** For a Node.js app, Switch runs an obfuscated copy of the code
187
+ produced at save time and never needs the original source, so the protection is genuinely
188
+ one-way: Enfocus cannot recover a Node.js script's source if the author forgets the password.
189
+ (For legacy JavaScript/VBScript a bypass mechanism exists internally at Enfocus, so that
190
+ protection is weaker — another reason to be on Node.js.)
191
+ - [ ] Note that a published Node.js app ships only the obfuscated code, re-protected with a random
192
+ password Enfocus generates during review — not the password you set.
193
+
194
+ ### Localization
195
+
196
+ - [ ] **Prefer more than one language.** An app is preferably localized beyond English — see
197
+ [Translation files](../switch-project/script-structure.md#script-folder-files) (`<LanguageCode>.ts`) and
198
+ `SwitchScriptTool --generate-translations` in [tooling.md](../switch-project/tooling.md).
199
+ - [ ] **The app's own translations are limited to the six Switch UI languages** (English, French,
200
+ German, Italian, Chinese, Japanese); other languages are not accepted for the app itself. The
201
+ separate Appstore *documentation* may be supplied in additional languages, since it isn't
202
+ generated through the SDK.
203
+ - [ ] **Translations must be complete, and logging must go through the translation mechanism.** A
204
+ partially-translated app (some strings translated, others not) is not acceptable — every
205
+ user-facing message needs an entry in each shipped language file, and log calls must go through
206
+ that mechanism rather than hardcoding English text that bypasses it. Note that
207
+ `Switch.tr()` extraction is static and silently skips anything that isn't a plain string literal
208
+ — see [switch.md § Translation extraction rules](../switch-api/switch.md#translation-extraction-rules).
209
+ Check the generated `.ts` files rather than assuming.
210
+
211
+ ### Icon
212
+
213
+ - [ ] **32×32 PNG, RGB, transparent background**, attached as the app icon. This is what appears in
214
+ the Elements pane and in flows.
215
+ - [ ] **A separate icon (at least 200×200, square) is uploaded to the Appstore submission form**
216
+ for the Appstore listing — it is not part of the pack. See
217
+ [app-store-submission.md § Icons](app-store-submission.md#icons) for both assets' exact
218
+ specs and how to derive/verify them from source art.
219
+
220
+ ### Extra files
221
+
222
+ - [ ] **macOS Mach-O binaries in extra files (`Resources/`) must be universal.** Any bundled macOS
223
+ application, framework bundle, executable, or dynamic library must include both `x86_64` and
224
+ `arm64` architectures. Relying on Rosetta 2 costs performance and isn't a long-term option.
225
+ - [ ] **macOS Mach-O binaries in extra files must be signed and notarized.** An unsigned or
226
+ incorrectly signed executable or dynamic library will fail Appstore review. At minimum, sign with
227
+ hardened runtime enabled and a secure timestamp; verify with `codesign -dv <file>` and check the
228
+ output contains a `Timestamp` line and the `runtime` flag on the `CodeDirectory` line.
229
+ - [ ] **Extra files must not change at runtime.** Don't place files the script might modify or
230
+ regenerate at runtime — license files included — inside the app's own package folder. Switch
231
+ validates the app package's signature, and content that changes after signing fails that
232
+ validation, causing Switch to remove the app. Write runtime-mutable data (temp files, caches,
233
+ generated output) outside the app folder — see
234
+ [job-patterns.md § Temp file cleanup](../switch-api/job-patterns.md#temp-file-cleanup).
235
+ - [ ] Find bundled files at runtime with `flowElement.getPluginResourcesPath()` — see
236
+ [flow-element.md](../switch-api/flow-element.md).
237
+
238
+ ### Source and review hygiene
239
+
240
+ - [ ] **Comments in the source are in English**, so Enfocus reviewers can read them.
241
+ - [ ] **No malicious or unrelated payload** — nothing that harms the user's machine or installs
242
+ additional software.
243
+ - [ ] **No Oracle JRE embedded**, in a script or an app, for licensing reasons — see
244
+ [script-structure.md § Script folder files](../switch-project/script-structure.md#script-folder-files).
245
+ - [ ] **Automating a third-party application doesn't breach that application's licence.** Some
246
+ vendors' terms explicitly exclude automation; check before building.
247
+
248
+ ### What review does and doesn't cover
249
+
250
+ Enfocus verifies that the app loads correctly and becomes available as a flow element, and checks
251
+ the items above. It does **not** test that the app works — functional correctness, error handling,
252
+ code structure and naming are the app creator's responsibility, though good practice in all of them
253
+ is assumed. Items marked as rejection-triggers in the SDK's own checklist are the identity,
254
+ password, icon, signing and architecture ones above.
255
+
256
+ Budget roughly **10 business days** for a review. An unsigned app only loads in Switch on the
257
+ machine that created it, which is what makes local testing possible before submission; once signed
258
+ it loads anywhere. Apps require Switch 13.1 or later.
@@ -0,0 +1,84 @@
1
+ ---
2
+ id: app-manual
3
+ category: switch-appstore
4
+ order: 23
5
+ summary: "Writing guidance for the separate app manual document uploaded during Appstore review (`documentation-app_name.docx` template)"
6
+ triggers:
7
+ - "Preparing the app manual document for Appstore submission"
8
+ ---
9
+
10
+ # Writing the App Manual
11
+
12
+ Guidance for the separate Word/PDF document an app creator uploads during Appstore review,
13
+ following Enfocus's `documentation-app_name.docx` template. Enfocus shows it as a downloadable
14
+ document on the app's Appstore detail page — distinct from the
15
+ [listing fields](app-store-listing.md) shown inline on the listing itself, and from
16
+ [Tooltip/DetailedInfo](../switch-project/property-documentation.md), seen only after installing. Follow the
17
+ template's section order below; don't invent your own structure.
18
+
19
+ **Delivery:** there's no declaration attribute for this content, since it isn't part of the app
20
+ itself. Write it to `./DOCUMENTATION.md` at the project root, using the section headers below. The
21
+ user copies each section into Enfocus's `documentation-app_name.docx` template and uploads the
22
+ result during Appstore review; tell them that's the next step once the file is written.
23
+
24
+ Same writing-quality bar as [property-documentation.md § Writing quality](../switch-project/property-documentation.md#writing-quality):
25
+ no restated field names, no generic marketing vocabulary, no meta-commentary about the
26
+ implementation, no vague filler, no copy-pasted boilerplate, nothing that won't translate cleanly.
27
+
28
+ ## App name
29
+
30
+ The declaration's `DisplayName`.
31
+
32
+ ## Description
33
+
34
+ Reuse [the listing's `Description`](app-store-listing.md#description) — adapt lightly if the
35
+ extra room here helps (e.g. a screenshot the listing field can't carry), but don't rewrite the
36
+ same facts from scratch.
37
+
38
+ ## Compatibility
39
+
40
+ **Not the same field as the declaration's `Compatibility` attribute** — see the naming trap in
41
+ [app-store-listing.md § Compatibility](app-store-listing.md#compatibility). This section
42
+ is the minimum **Switch** version the app requires, e.g. "Switch 24.10 and higher." There's no
43
+ declaration attribute for it; it's implicit in which SwitchScripter version built the app (see
44
+ [script-structure.md § SwitchScripter and Switch version compatibility](../switch-project/script-structure.md#switchscripter-and-switch-version-compatibility)).
45
+ The same value also goes in the "Switch Version" field on the
46
+ [Appstore App Version submission form](app-store-submission.md#fields-that-reuse-content-youve-already-written)
47
+ — state it explicitly here rather than leaving it for the reader to infer.
48
+
49
+ ## Compatibility third-party applications
50
+
51
+ Reuse [the listing's `Compatibility`](app-store-listing.md#compatibility) content — the
52
+ third-party application versions this app supports, with links to the vendor's download/version
53
+ page where one exists.
54
+
55
+ ## Application discovery details
56
+
57
+ Reuse [the listing's `AppDiscovery`](app-store-listing.md#appdiscovery) content. Add a
58
+ screenshot here if the discovery mechanism (or the manual-path property, when auto-detection
59
+ fails) is easier to show than describe.
60
+
61
+ ## Connections
62
+
63
+ Reuse [the listing's `Connections`](app-store-listing.md#connections) content, expanded with
64
+ whatever detail or screenshots the shorter listing field couldn't carry.
65
+
66
+ ## Properties detailed info
67
+
68
+ Reuse each property's and connection's [`DetailedInfo`](../switch-project/property-documentation.md#detailedinfo)
69
+ content — but don't limit this section to whatever `DetailedInfo` happens to contain. `DetailedInfo`
70
+ is optional and often left blank; this manual is the far more likely surface to actually be read,
71
+ so write real per-property content here even for properties where `DetailedInfo` was skipped.
72
+
73
+ For an app bundle (multiple flow elements in one pack), document each flow element separately —
74
+ the template repeats this section per element ("Flow element 1", "Flow element 2", …).
75
+
76
+ ### Flow elements properties
77
+
78
+ Per flow element, per property: what it controls, and any tip or constraint a user needs to get
79
+ the element working — the same content `DetailedInfo` would hold, written in full regardless of
80
+ whether `DetailedInfo` itself was filled in.
81
+
82
+ ### Outgoing connections properties
83
+
84
+ Same treatment, for injected connection properties.
@@ -0,0 +1,69 @@
1
+ ---
2
+ id: app-store-listing
3
+ category: switch-appstore
4
+ order: 22
5
+ summary: "Writing guidance for the declaration's Appstore listing fields: `Description`, `Compatibility`, `SupportInfo`, `AppDiscovery`, `Connections`"
6
+ triggers:
7
+ - "Writing or reviewing the app's Appstore listing text"
8
+ ---
9
+
10
+ # Writing the Appstore Listing Fields
11
+
12
+ Guidance for the *content* of the declaration's prose fields that appear on the app's Enfocus
13
+ Appstore listing: `Description`, `Compatibility`, `SupportInfo`, `AppDiscovery`, and `Connections`
14
+ — see [script-declaration.md](../switch-project/script-declaration.md#built-in-elementfields) for the
15
+ attribute mechanics.
16
+
17
+ Audience here is a prospective buyer browsing the Appstore, deciding whether to install the app at
18
+ all — they haven't seen the flow element yet. That's different from
19
+ [property-documentation.md](../switch-project/property-documentation.md) (`Tooltip`/`DetailedInfo`, read only
20
+ after installing) and from [app-manual.md](app-manual.md) (a separate uploaded document).
21
+ This content is also reused directly in the app manual's Description, Compatibility third-party
22
+ applications, Application discovery details, and Connections sections — write it once, here, well.
23
+
24
+ **Delivery:** write this content directly into the matching top-level attributes in
25
+ `<ScriptID>.xml` (`Description`, `Compatibility`, `SupportInfo`, `AppDiscovery`, `Connections`) —
26
+ there is no separate file. See
27
+ [script-declaration.md § Agent editing policy](../switch-project/script-declaration.md#agent-editing-policy)
28
+ for how to edit the declaration safely.
29
+
30
+ Same writing-quality bar as [property-documentation.md § Writing quality](../switch-project/property-documentation.md#writing-quality):
31
+ no restated field names, no generic marketing vocabulary, no meta-commentary about the
32
+ implementation, no vague filler, no copy-pasted boilerplate, nothing that won't translate cleanly.
33
+
34
+ ## `Description`
35
+
36
+ What the app does, who it's for, and the third-party application or service it automates. Lead
37
+ with the concrete task the app performs, not a category label — "Converts incoming PDFs to the
38
+ customer's house color profile using ColorLogic" tells a buyer more than "A color management
39
+ app." A screenshot is worth adding here if it clarifies the app's purpose faster than prose would.
40
+
41
+ ## `Compatibility`
42
+
43
+ **Naming trap:** despite the name, this is **third-party application** compatibility, not Switch
44
+ version compatibility — Switch has no declaration field for the minimum Switch version an app
45
+ requires (see [app-manual.md § Compatibility](app-manual.md#compatibility) for where that
46
+ goes instead). State which versions of the automated third-party application are supported, e.g.
47
+ "Requires Acrobat Pro DC 2023 or later." Link to the third-party vendor's own download or version
48
+ page if one exists.
49
+
50
+ ## `SupportInfo`
51
+
52
+ The app creator's own support channel (email or URL) — **never Enfocus Support**, this is
53
+ mandatory per [app-guidelines.md § App-only](app-guidelines.md#top-level-declaration-properties).
54
+ State the channel plainly; this field has no dedicated section in the app manual, so it's the only
55
+ place this information reliably reaches a buyer before they install.
56
+
57
+ ## `AppDiscovery`
58
+
59
+ How the app locates the third-party application on disk. State the actual mechanism, concretely
60
+ enough that a user who hits a failure knows what to check: which known install paths are searched
61
+ first, and — if auto-detection can fail — which property lets the user point at the install
62
+ location manually.
63
+
64
+ ## `Connections`
65
+
66
+ A prose overview of the flow element's incoming and outgoing connections: what triggers the
67
+ element, what each outgoing connection carries, and when a job is routed to which one. This is the
68
+ topology summary a flow builder reads before wiring the element into a flow, so describe behavior
69
+ ("routes to Error when validation fails"), not just connection names.
@@ -0,0 +1,83 @@
1
+ ---
2
+ id: app-store-submission
3
+ category: switch-appstore
4
+ order: 24
5
+ summary: "Writing guidance for the Create Appstore App / Create Appstore App Version web forms: Short Description, What's new, Eula, icon specs, and which fields reuse content already written elsewhere"
6
+ triggers:
7
+ - "Preparing content for the Appstore website submission forms"
8
+ ---
9
+
10
+ # Writing the Appstore Submission Forms
11
+
12
+ Guidance for the two web forms on the Enfocus Appstore site: **Create Appstore App** (once per
13
+ app) and **Create Appstore App Version** (once per release). These are separate from the
14
+ [listing fields](app-store-listing.md) in the declaration and from the
15
+ [app manual](app-manual.md) — a human fills these forms in directly on the Enfocus website, so
16
+ the agent's job is to prepare the content, not submit it. `Package Password`, `Binary`, and
17
+ `Signed Binary` are manual/security-sensitive steps on the App Version form; leave those to the
18
+ user entirely.
19
+
20
+ **Delivery:** write the content below to `./README.md` at the project root, labeled by field name,
21
+ for the user to copy into the two forms. If the project already has a `README.md` for other
22
+ purposes, add a clearly separated section rather than overwriting it.
23
+
24
+ Same writing-quality bar as [property-documentation.md § Writing quality](../switch-project/property-documentation.md#writing-quality).
25
+
26
+ ## Fields that reuse content you've already written
27
+
28
+ Point the user at the source instead of rewriting these:
29
+
30
+ | Form field | Source |
31
+ |---|---|
32
+ | Display Name | Declaration `DisplayName` |
33
+ | Internal Identifier | Declaration `Name` |
34
+ | Long Description | [Listing `Description`](app-store-listing.md#description) |
35
+ | Keywords | Declaration `Keywords` — the form must match it exactly, it's checked against the script source |
36
+ | Categories | Declaration `PositionInElementPane`/`SubcategoryInElementPane` — see [app-guidelines.md](app-guidelines.md#top-level-declaration-properties) |
37
+ | Support Website / Support Phone / Support Email | [Listing `SupportInfo`](app-store-listing.md#supportinfo), split across the three fields the form actually has |
38
+ | Third-party Compatibility | [Listing `Compatibility`](app-store-listing.md#compatibility) |
39
+ | Switch Version | The minimum Switch version, same content as [the app manual's Compatibility section](app-manual.md#compatibility) |
40
+
41
+ ## New content
42
+
43
+ Nothing above covers these — the form is the only place they're written.
44
+
45
+ ### Short Description
46
+
47
+ Max 500 characters. Distinct from Long Description: this is the search-result and marketing-email
48
+ summary, not a shorter copy of the full description. One or two sentences stating what the app
49
+ does and the third-party dependency, without repeating Display Name.
50
+
51
+ ### What's new
52
+
53
+ Per-version release notes: what changed in *this* version, for someone deciding whether to update.
54
+ Lead with the effect on the user (new capability, fixed behavior), not the implementation. Skip
55
+ internal refactors with no user-visible effect.
56
+
57
+ ### Eula
58
+
59
+ **Don't draft this from scratch.** A EULA is a binding legal document — write it only from the app
60
+ creator's existing legal-reviewed template, or leave it for them to supply. If neither exists, tell
61
+ the user this needs their own legal review rather than generating terms.
62
+
63
+ ## Icons
64
+
65
+ Two separate image assets, both uploaded on the Create Appstore App form:
66
+
67
+ | Field | Spec | Notes |
68
+ |---|---|---|
69
+ | Switch Icon | 32×32 px recommended (larger is resized down); PNG/GIF/JPG | Must match the `Icon` property already in the script source — use the same file you packaged with the app, don't create a second one |
70
+ | Appstore Icon | At least 200×200 px, square (a non-square image gets transparent padding added); PNG/GIF/JPG, under 100 MB | Used across the whole Appstore site: overview, detail page, search results |
71
+
72
+ Creating the actual artwork is a design task, not something to improvise without source material —
73
+ if the app creator hasn't supplied a logo or icon source image, say so rather than generating
74
+ placeholder art. Given a source image, verify and derive the two required files with a CLI image
75
+ tool (`sips` on macOS, or ImageMagick):
76
+
77
+ ```bash
78
+ # Verify dimensions and that the file is actually PNG
79
+ sips -g pixelWidth -g pixelHeight -g format icon-source.png
80
+
81
+ # Resize down to the 32x32 Switch icon (never upscale a smaller source)
82
+ sips -z 32 32 icon-source.png --out switch-icon.png
83
+ ```
@@ -1,3 +1,12 @@
1
+ ---
2
+ id: debugging
3
+ category: switch-project
4
+ order: 12
5
+ summary: "Enabling debug mode in Switch Designer, debuggable entry points, VS Code attach"
6
+ triggers:
7
+ - "Debugging a script"
8
+ ---
9
+
1
10
  # Debugging Scripts
2
11
 
3
12
  Debugging requires configuring the Script element in Switch Designer — the agent cannot do this directly but can guide the user through the steps.
@@ -1,8 +1,17 @@
1
+ ---
2
+ id: logs-and-dataroot
3
+ category: switch-project
4
+ order: 19
5
+ summary: "Locating the Application Data Root, querying `ServerLogs.db3` directly"
6
+ triggers:
7
+ - "Diagnosing or validating a script from its actual log output rather than by reading the code"
8
+ ---
9
+
1
10
  # Locating and Querying Switch's Log Database
2
11
 
3
12
  For diagnosing or validating a script from the outside — reading what the user themselves would see
4
13
  in Switch's Message pane — rather than instrumenting the script itself. See
5
- [api-logging.md](api-logging.md) for how a script produces these messages in the first place.
14
+ [logging.md](../switch-api/logging.md) for how a script produces these messages in the first place.
6
15
 
7
16
  ## Finding the Application Data Root
8
17
 
@@ -0,0 +1,117 @@
1
+ ---
2
+ id: project-planning
3
+ category: switch-project
4
+ order: 1
5
+ summary: "Pre-scaffolding checklist: Script vs App, job-processing approach, target OS, Switch version baseline, concurrency, native/binary npm dependencies, Appstore competition risk"
6
+ triggers:
7
+ - "Starting a new script or app, before scaffolding any files"
8
+ ---
9
+
10
+ # Project Planning
11
+
12
+ A pre-scaffolding checklist for a new script or app. Work through this with the user before
13
+ creating any files. The goal is to make a few decisions deliberately up front, because retrofitting
14
+ them after code exists is expensive: password protection and localization for an app, path handling
15
+ for a second target OS, synchronizing shared-resource access for concurrency, or restructuring entry
16
+ points around a job-processing approach chosen too casually.
17
+
18
+ Two items below are direct questions for the user. The rest are not questions to ask upfront; they
19
+ are checks the agent runs against what's actually being built, raised only when they become
20
+ relevant.
21
+
22
+ ## Ask the user directly
23
+
24
+ ### 1. Script or App?
25
+
26
+ Ask whether this is for private or internal use (a plain `Script`, distributed freely) or intended
27
+ for the Enfocus Appstore (an `App`). See
28
+ [script-structure.md § Script vs App](script-structure.md#script-vs-app) for what differs.
29
+
30
+ This answer gates several items below:
31
+
32
+ - **App**: localization, password protection, `Name`-never-changes discipline, `Concurrent`-by-default
33
+ expectation, icon/keywords, and the version-baseline and Appstore-competition checks further down
34
+ all apply. See [app-guidelines.md](../switch-appstore/app-guidelines.md) for the full pre-publish checklist,
35
+ most of which is worth designing toward from the start rather than retrofitting later.
36
+ - **Script**: none of the app-only items apply. Keep it simple and don't raise app concerns for a
37
+ plain script.
38
+
39
+ If App, also ask which languages it must support. English is required; more than one language is
40
+ preferable, see [app-guidelines.md § Localization](../switch-appstore/app-guidelines.md#localization).
41
+
42
+ ### 2. What should job processing look like in their flow?
43
+
44
+ Ask about job handling at a functional level: what should happen when a job arrives, does anything
45
+ need to wait on an external process or resource, could more than one job at a time contend for a
46
+ shared resource. Don't ask the user to pick entry points or connection types directly. Translate the
47
+ answer into a concrete proposal (which entry points, which `sendTo*()` methods, whether `jobArrived`
48
+ alone is enough or work must be deferred to `timerFired`) using
49
+ [entry-points.md](../switch-api/entry-points.md) and
50
+ [job-patterns.md § Sending jobs](../switch-api/job-patterns.md#sending-jobs), and be upfront about
51
+ limitations and tradeoffs so the user can make an informed choice, rather than silently picking an
52
+ approach.
53
+
54
+ If the design defers job processing to `timerFired` via global data, say explicitly that a flow
55
+ restart replays every queued job through `jobArrived` again, and the script must recognize and skip
56
+ an already-registered job quickly, or a large backlog is slow to clear, see
57
+ [entry-points.md § Job processing](../switch-api/entry-points.md#job-processing).
58
+
59
+ ## Evaluate and flag, don't ask upfront
60
+
61
+ ### Target OS
62
+
63
+ Switch Server runs on Windows and macOS. Default to writing platform-independent code (the `path`
64
+ module, no hardcoded separators, see
65
+ [job-patterns.md § Platform-independent paths](../switch-api/job-patterns.md#platform-independent-paths))
66
+ without asking. Only raise target OS as an explicit question once the script needs OS-specific code,
67
+ bundles a native binary, or ships a platform-specific package build, since only then does the answer
68
+ change anything.
69
+
70
+ ### Switch version baseline (apps only)
71
+
72
+ Once Script vs App is answered as App, ask or infer the oldest Switch version the app must support.
73
+ This sets two separate limits:
74
+
75
+ - Which SwitchScripter build is needed to produce a compatible `.enfpack`, and so which Node.js
76
+ version the app runs on (see
77
+ [script-structure.md § Node.js version per Switch version](script-structure.md#nodejs-version-per-switch-version)).
78
+ Write code for that Node.js version.
79
+ - Which scripting API methods the code may call. Methods follow the Switch version the app runs on,
80
+ so check every call against [api-versions.md](../switch-api/api-versions.md) for the oldest
81
+ supported version.
82
+
83
+ Don't ask this for a plain script. Assume it runs on the Switch version whose SwitchScriptTool packs
84
+ it (`SwitchScriptTool --version`), unless the user mentions an older Switch Server.
85
+
86
+ ### Concurrency
87
+
88
+ Default to `Concurrent` execution; it's the preferred choice for apps per
89
+ [app-guidelines.md § Top-level declaration properties](../switch-appstore/app-guidelines.md#top-level-declaration-properties).
90
+ Don't ask the user to choose upfront. Only raise `Serialized`, and explain why, when the design has
91
+ an actual reason to need it: a third-party application or shared resource that can't tolerate
92
+ concurrent access, or an API the script drives that isn't safe to call in parallel. See
93
+ [execution-environment.md § Execution modes](../switch-api/execution-environment.md#execution-modes).
94
+
95
+ ### Native or binary npm dependencies
96
+
97
+ A file-based script or app that ends up on the ESM bundling path cannot use native (binary) Node
98
+ addons at all, see
99
+ [execution-environment.md § Native (binary) addons are not supported](../switch-api/execution-environment.md#native-binary-addons-are-not-supported).
100
+ If a planned dependency needs one, for example `sharp` or native `sqlite3` bindings, say so before
101
+ the user commits to that library, and suggest a pure JavaScript alternative or a workaround, such as
102
+ shelling out to an external binary, see
103
+ [job-patterns.md § Driving a third-party CLI application](../switch-api/job-patterns.md#driving-a-third-party-cli-application),
104
+ where one exists.
105
+
106
+ ### Appstore competition risk (apps only)
107
+
108
+ An app whose core functionality duplicates an existing Switch module without requiring that module
109
+ risks Appstore rejection. For example, an app that performs database CRUD operations without
110
+ requiring the Database Module competes directly with it. If the planned app looks like it falls into
111
+ this category, say so before significant effort is spent, and suggest either gating the app behind
112
+ the relevant module license or contacting Enfocus to check before proceeding.
113
+
114
+ ---
115
+
116
+ This checklist stops at planning. Once these are answered, move to
117
+ [script-structure.md](script-structure.md) to scaffold the project.