@synopackageland/cli 0.52.8 → 0.52.10

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 (38) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/assets/go/compose-admin/go.mod +22 -0
  3. package/assets/go/compose-admin/go.sum +40 -0
  4. package/assets/go/compose-admin/main.go +443 -0
  5. package/assets/go/compose-admin/main_test.go +173 -0
  6. package/dist/build-spk/resource-worker.d.ts +3 -0
  7. package/dist/build-spk/resource-worker.js +20 -1
  8. package/dist/cli.js +9 -0
  9. package/dist/error-registry.js +1 -0
  10. package/dist/host/catalog-install.d.ts +1 -0
  11. package/dist/host/catalog-install.js +113 -6
  12. package/dist/host/compose-admin-build.d.ts +6 -0
  13. package/dist/host/compose-admin-build.js +17 -0
  14. package/dist/host/compose-admin.d.ts +22 -0
  15. package/dist/host/compose-admin.js +119 -0
  16. package/dist/host/compose-project-recovery.d.ts +2 -0
  17. package/dist/host/compose-project-recovery.js +2 -0
  18. package/dist/host/package-commands.d.ts +1 -1
  19. package/dist/host/package-commands.js +32 -2
  20. package/dist/load-env.js +1 -1
  21. package/dist/native-http-schema/source.json +1 -1
  22. package/dist/runtime/executor-policy.js +1 -1
  23. package/dist/runtime/sdk-source.d.ts +1 -1
  24. package/dist/runtime/sdk-source.js +1 -1
  25. package/dist/runtime/webapi-profile.d.ts +4 -1
  26. package/dist/runtime/webapi-profile.js +5 -2
  27. package/dist/standalone/executor-approval.js +1 -0
  28. package/dist/standalone/inspect-spk.js +2 -1
  29. package/dist/standalone/manifest.js +2 -2
  30. package/dist/standalone/root-window.js +1 -0
  31. package/dist/standalone/ui-guidance.js +11 -0
  32. package/docs/compose-admin.md +82 -0
  33. package/package.json +3 -2
  34. package/schema/dsm-api-contract.json +23 -4
  35. package/schema/dsm-package.schema.json +82 -0
  36. package/skills/SKILL.md +2 -0
  37. package/skills/reference/files.md +16 -0
  38. package/skills/reference/testing.md +10 -0
@@ -36,6 +36,8 @@ export async function reclaimOwnedComposeProject(options) {
36
36
  return;
37
37
  if (found.length !== 1 || !owned(found[0]))
38
38
  throw fail('COMPOSE_PROJECT_CONFLICT', `Container Manager project ${projectName} cannot be proved to belong to ${packageId}; it was left untouched`);
39
+ if (options.requireAbsent)
40
+ throw fail('COMPOSE_PROJECT_INVENTORY_REQUIRED', 'An existing Compose registration needs trusted installed inventory before cleanup; no install request was sent');
39
41
  if (!options.reclaim)
40
42
  return;
41
43
  const project = found[0];
@@ -61,7 +61,7 @@ export declare function uninstallPackage(id: string, options?: {
61
61
  host?: string;
62
62
  yes?: boolean;
63
63
  dryRun?: boolean;
64
- }): Promise<{
64
+ }, connection?: NasConnection): Promise<{
65
65
  dryRun?: boolean | undefined;
66
66
  host: string;
67
67
  package: string;
@@ -5,6 +5,8 @@ import { createInterface } from "node:readline/promises";
5
5
  import { CtlError } from "../ctl/errors.js";
6
6
  import { inspectAnySpk } from "../spk/inspect.js";
7
7
  import { containerImageReferences } from './container-pull.js';
8
+ import { composeAdminConfigured, composeAdminWarning } from './compose-admin.js';
9
+ import { progressReporter } from '../terminal-output.js';
8
10
  import { appUrlFromPackageInfo } from './open-url.js';
9
11
  import { connectNas, requireAdministrator, } from "./connection.js";
10
12
  import { fetchPackageSource } from "../package-source.js";
@@ -213,9 +215,9 @@ export async function installPackage(spec, options = {}, connection) {
213
215
  rmSync(stage, { recursive: true, force: true });
214
216
  }
215
217
  }
216
- export async function uninstallPackage(id, options = {}) {
218
+ export async function uninstallPackage(id, options = {}, connection) {
217
219
  packageId(id);
218
- const nas = await connectNas(options.host);
220
+ const nas = connection ?? await connectNas(options.host);
219
221
  const state = await fetchInstalledPackageState(nas.session.origin, nas.session.cookie, id);
220
222
  if (!state)
221
223
  throw fail('PACKAGE_STATUS_UNKNOWN', 'DSM did not return a verifiable package state');
@@ -228,7 +230,35 @@ export async function uninstallPackage(id, options = {}) {
228
230
  return { dryRun: true, host: nas.name, package: id, action: "uninstall" };
229
231
  await requireAdministrator(nas);
230
232
  await confirm(`Uninstall ${id} (package uninstall hooks may remove data)`, options.yes);
233
+ let composeProject;
234
+ try {
235
+ const packages = await inventory(nas);
236
+ if (packages.has('ContainerManager')) {
237
+ const projects = await nas.call('SYNO.Docker.Project', 'list', 1);
238
+ if (!projects || typeof projects !== 'object' || Array.isArray(projects))
239
+ throw fail('COMPOSE_PROJECT_INVENTORY_INVALID', 'Cannot verify installed Compose project inventory');
240
+ const matches = Object.values(projects).filter((p) => p?.package_name === id ||
241
+ p?.path === `/var/packages/${id}/target/compose` ||
242
+ typeof p?.path === 'string' && /^\/volume[1-9][0-9]*\/@appstore\/([^/]+)\/compose$/.exec(p.path)?.[1] === id);
243
+ if (matches.length > 1)
244
+ throw fail('COMPOSE_PROJECT_CONFLICT', 'Ambiguous installed Compose project');
245
+ if (matches.length) {
246
+ const p = matches[0];
247
+ if (p.is_package !== true || typeof p.name !== 'string' || !/^[a-z0-9][a-z0-9_-]*$/.test(p.name))
248
+ throw fail('COMPOSE_PROJECT_CONFLICT', 'Cannot verify installed Compose project');
249
+ composeProject = p.name;
250
+ }
251
+ }
252
+ }
253
+ catch (error) {
254
+ // Without a native channel this optional lookup must not block the normal
255
+ // DSM uninstall path. Configured channels retain strict inventory checks.
256
+ if (composeAdminConfigured())
257
+ throw error;
258
+ progressReporter()(composeAdminWarning(id));
259
+ }
231
260
  await uninstallPackageFromDsm({
261
+ composeProject,
232
262
  dsmOrigin: nas.session.origin,
233
263
  cookieHeader: nas.session.cookie,
234
264
  packageId: id,
package/dist/load-env.js CHANGED
@@ -19,7 +19,7 @@ export function loadDotEnv(fromDir = process.cwd()) {
19
19
  }
20
20
  const key = trimmed.slice(0, eq).trim();
21
21
  const value = trimmed.slice(eq + 1).trim();
22
- if (DOTENV_KEY.test(key) && process.env[key] === undefined) {
22
+ if (DOTENV_KEY.test(key) && key !== 'SYNOPKGLAND_COMPOSE_ADMIN_COMMAND' && process.env[key] === undefined) {
23
23
  process.env[key] = value;
24
24
  }
25
25
  }
@@ -1 +1 @@
1
- {"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"0.53.2","local":false}
1
+ {"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"0.53.11","local":false}
@@ -32,7 +32,7 @@ export const executorPolicyText = (policy) => JSON.stringify(policy) + '\n';
32
32
  export function executorPolicy(m, arch) {
33
33
  if (m.capabilities.delegate && !validDelegate(m.capabilities.delegate))
34
34
  throw new Error('[EXECUTOR_POLICY] Invalid delegate operations or scope.');
35
- if (m.capabilities.webapi && !validWebAPIProfiles(m.capabilities.webapi))
35
+ if (m.capabilities.webapi && !validWebAPIProfiles(m.capabilities.webapi, true))
36
36
  throw new Error('[EXECUTOR_POLICY] Invalid WebAPI profiles.');
37
37
  const portal = executorPortal(m);
38
38
  const operations = ['status', ...(portal ? PORTAL_OPERATIONS : [])];
@@ -1,7 +1,7 @@
1
1
  export { goPrivateCovers } from './go-env.js';
2
2
  import { type ExecutorManifest } from './sdk-executor-manifest.js';
3
3
  /** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
4
- export declare const DEFAULT_SDK_VERSION = "0.53.2";
4
+ export declare const DEFAULT_SDK_VERSION = "0.53.11";
5
5
  export declare const SDK_PACKAGE = "@synopackageland/sdk";
6
6
  export declare const SDK_MODULE = "github.com/synopackageland/syno-pkg-land-sdk";
7
7
  export declare const EXECUTOR_MODULE = "github.com/synopackageland/syno-pkg-land-sdk/executor";
@@ -5,7 +5,7 @@ import { tmpdir } from 'node:os';
5
5
  import { join } from 'node:path';
6
6
  import { readExecutorManifest, predatesExecutorManifest } from './sdk-executor-manifest.js';
7
7
  /** Pinned SDK for CLI-owned controllers and Compose planning; App pins take precedence. */
8
- export const DEFAULT_SDK_VERSION = '0.53.2';
8
+ export const DEFAULT_SDK_VERSION = '0.53.11';
9
9
  export const SDK_PACKAGE = '@synopackageland/sdk';
10
10
  export const SDK_MODULE = 'github.com/synopackageland/syno-pkg-land-sdk';
11
11
  export const EXECUTOR_MODULE = `${SDK_MODULE}/executor`;
@@ -1,9 +1,12 @@
1
1
  /** WebAPI profiles, independently enforced again by the pinned executor. */
2
2
  export interface WebAPIProfile {
3
3
  purpose: string;
4
+ purpose_i18n?: Partial<Record<WebAPIPurposeLocale, string>>;
4
5
  apis: Record<string, Record<string, number[]>>;
5
6
  raw_max_bytes?: number;
6
7
  }
8
+ export declare const webapiPurposeLocales: readonly ["en", "zh-TW", "zh-CN", "de", "fr", "ja", "ko", "es", "it"];
9
+ export type WebAPIPurposeLocale = typeof webapiPurposeLocales[number];
7
10
  export type WebAPIProfiles = Record<string, WebAPIProfile>;
8
- export declare function validWebAPIProfiles(value: unknown): value is WebAPIProfiles;
11
+ export declare function validWebAPIProfiles(value: unknown, allowPurposeI18n?: boolean): value is WebAPIProfiles;
9
12
  export declare function sortedWebAPIProfiles(profiles: WebAPIProfiles): WebAPIProfiles;
@@ -1,10 +1,13 @@
1
+ export const webapiPurposeLocales = ['en', 'zh-TW', 'zh-CN', 'de', 'fr', 'ja', 'ko', 'es', 'it'];
1
2
  const record = (v) => !!v && typeof v === 'object' && !Array.isArray(v);
2
- export function validWebAPIProfiles(value) {
3
+ export function validWebAPIProfiles(value, allowPurposeI18n = false) {
3
4
  if (!record(value) || !Object.keys(value).length || Object.keys(value).length > 32)
4
5
  return false;
5
6
  let total = 0;
6
7
  for (const [name, p] of Object.entries(value)) {
7
- if (!/^[a-z][a-z0-9_-]{0,63}$/.test(name) || name === 'home' || !record(p) || Object.keys(p).some(k => !['purpose', 'apis', 'raw_max_bytes'].includes(k)) || typeof p.purpose !== 'string' || !p.purpose.trim() || Buffer.byteLength(p.purpose) > 1024 || /[\x00-\x1f\x7f]/.test(p.purpose) || !record(p.apis) || !Object.keys(p.apis).length)
8
+ if (!/^[a-z][a-z0-9_-]{0,63}$/.test(name) || name === 'home' || !record(p) || Object.keys(p).some(k => !['purpose', 'apis', 'raw_max_bytes', ...(allowPurposeI18n ? ['purpose_i18n'] : [])].includes(k)) || typeof p.purpose !== 'string' || !p.purpose.trim() || Buffer.byteLength(p.purpose) > 1024 || /[\x00-\x1f\x7f]/.test(p.purpose) || !record(p.apis) || !Object.keys(p.apis).length)
9
+ return false;
10
+ if (p.purpose_i18n !== undefined && (!record(p.purpose_i18n) || Object.entries(p.purpose_i18n).some(([locale, text]) => !webapiPurposeLocales.includes(locale) || typeof text !== 'string' || !text.trim() || Buffer.byteLength(text) > 1024 || /[\x00-\x1f\x7f]/.test(text) || /[.。]$/.test(text.trim()))))
8
11
  return false;
9
12
  if (p.raw_max_bytes !== undefined && (!Number.isSafeInteger(p.raw_max_bytes) || Number(p.raw_max_bytes) < 0 || Number(p.raw_max_bytes) > 10737418240))
10
13
  return false;
@@ -12,6 +12,7 @@ ${PASSWORD_CONFIRM}
12
12
  })();
13
13
  ${ns}.createExecutorAccess = function (options) {
14
14
  options.tasks = ${ns}.rootTasks;
15
+ options.fileDelegate = ${!!manifest.capabilities.delegate};
15
16
  options.webapiProfiles = ${JSON.stringify(manifest.capabilities.webapi ?? {})};
16
17
  options.pins = ${JSON.stringify({ package: manifest.package, executorDigest: manifest.executor.executorDigest, policyDigest: manifest.executor.policyDigest })};
17
18
  options.wait = function (ms) { return new Promise(function (resolve) { setTimeout(resolve, ms); }); };
@@ -43,6 +43,7 @@ import { DELETE_STATE_KEY } from "../build-spk/uninstall-wizard.js";
43
43
  import { readUninstallRecord, stateItemTexts } from "./uninstall.js";
44
44
  import { DSM_LANGS } from "./i18n.js";
45
45
  import { BACKGROUND_UNIT_DIR, BACKGROUND_WORKER_PAYLOAD, BRIDGE_WORKER_ARGS, backgroundUnitName, renderBackgroundUnit, } from "./background.js";
46
+ import { matchesComposeWorkerResource } from '../build-spk/resource-worker.js';
46
47
  import { renderStandaloneResource } from "./resource.js";
47
48
  import { recoverSharedFolder, renderUpgradeWizardFiles, sharedFolderInstallSteps, SHARED_FOLDER_MARKER, } from "./shared-folder.js";
48
49
  import { renderInstallWizardFiles, integrationWizardSteps, renderNativeInstallWizard, } from "../build-spk/install-wizard.js";
@@ -859,7 +860,7 @@ async function inspectUnifiedCompose(dir, payload, metadata, findings) {
859
860
  throw new Error(`unexpected WIZARD_UIFILES/${name}; native share selection must match the declaration`);
860
861
  }
861
862
  const resource = renderStandaloneResource(manifest);
862
- if (readOptional(join(dir, "conf/resource")) !== resource)
863
+ if (!matchesComposeWorkerResource(readOptional(join(dir, "conf/resource")), resource))
863
864
  throw new Error("unexpected worker resource; unapproved Shares must never auto-acquire");
864
865
  if (readdirSync(join(dir, "conf")).some((n) => !["privilege", ...(resource ? ["resource"] : [])].includes(n)))
865
866
  throw new Error("unexpected Compose resource");
@@ -1135,10 +1135,10 @@ function readCapabilities(value, c) {
1135
1135
  if (name === "composeMounts" && setting === true)
1136
1136
  result.composeMounts = true;
1137
1137
  else if (name === "webapi") {
1138
- if (validWebAPIProfiles(setting))
1138
+ if (validWebAPIProfiles(setting, true))
1139
1139
  result.webapi = setting;
1140
1140
  else
1141
- c.fail("CAPABILITY_INVALID", "webapi requires named profiles with purpose and exact API/method/version lists.");
1141
+ c.fail("CAPABILITY_INVALID", "webapi requires named profiles with purpose and exact API/method/version lists; optional purpose_i18n uses supported locales and nonempty text without trailing periods.");
1142
1142
  }
1143
1143
  else if (name === "delegate") {
1144
1144
  if (validDelegate(setting))
@@ -399,6 +399,7 @@ export const ROOT_RUNTIME = `function createRootAccess(options) {
399
399
  }, verify);
400
400
  }
401
401
  return {
402
+ fileDelegate: options.fileDelegate,
402
403
  webapiProfiles: options.webapiProfiles || {},
403
404
  status: function () { return (isAdmin() ? adminStatus() : userStatus()).then(publish); },
404
405
  authorize: function (password, selectedScope) {
@@ -1,3 +1,4 @@
1
+ import { webapiPurposeLocales } from '../runtime/webapi-profile.js';
1
2
  import { lstatSync, readFileSync, readdirSync } from 'node:fs';
2
3
  import { join, relative } from 'node:path';
3
4
  import { resolvedSdkLaunch } from '../contract/app-launch.js';
@@ -6,6 +7,16 @@ const SKIP_DIRECTORIES = new Set(['node_modules', 'dist', 'build', 'coverage', '
6
7
  /** Advisory source heuristic, not Vue compilation or cross-file data-flow analysis. */
7
8
  export function uiGuidanceWarnings(manifest) {
8
9
  const warnings = [];
10
+ for (const [name, profile] of Object.entries(manifest.capabilities.webapi ?? {})) {
11
+ const missing = webapiPurposeLocales.filter(locale => !profile.purpose_i18n?.[locale]);
12
+ if (missing.length)
13
+ warnings.push({
14
+ code: 'WEBAPI_PURPOSE_I18N_MISSING', severity: 'warning',
15
+ span: { file: 'dsm-package.yaml', line: 1, column: 1 },
16
+ message: `WebAPI profile ${name} is missing purpose_i18n locales: ${missing.join(', ')}`,
17
+ suggestion: 'Add all nine purpose_i18n translations without trailing periods; missing locales fall back to English',
18
+ });
19
+ }
9
20
  if (manifest.capabilities.identity === 'standalone' && !manifest.portal) {
10
21
  warnings.push({
11
22
  code: 'STANDALONE_IDENTITY_WITHOUT_PORTAL', severity: 'warning',
@@ -0,0 +1,82 @@
1
+ # Compose administrator helper
2
+
3
+ Compose install, upgrade and uninstall work with the normal DSM administrator
4
+ HTTP session. When `SYNOPKGLAND_COMPOSE_ADMIN_COMMAND` is unset or empty, the CLI
5
+ continues the standard DSM lifecycle and prints one warning: verified
6
+ container/profile cleanup is disabled, so stale Container Manager profiles may
7
+ remain. The warning points here to enable verified cleanup and profile recovery.
8
+ No native helper or root/SSH channel is required for the standard workflow.
9
+
10
+ An explicitly configured native administrator channel enables installed ownership
11
+ inspection, SDK reconciliation and exact orphan cleanup. The HTTP APIs do not
12
+ expose trustworthy stored profile IDs. Once configured, invalid commands,
13
+ missing evidence and helper failures stop the operation; the CLI does not fall
14
+ back after an administrator action may have started. App hooks stay nonroot.
15
+
16
+ Build the adapter with the CLI and Go toolchain:
17
+
18
+ ```sh
19
+ synopkgland compose-admin-helper --arch x86_64 --output ./compose-admin
20
+ ```
21
+
22
+ Use `aarch64` for that NAS architecture. Install the reviewed executable in a
23
+ root-owned directory on the intended NAS. Configure an existing authenticated
24
+ administrator channel that executes it as root, for example an SSH alias with
25
+ key authentication and a restricted, passwordless sudo rule:
26
+
27
+ ```sh
28
+ export SYNOPKGLAND_COMPOSE_ADMIN_COMMAND='["ssh","-T","my-nas","sudo","-n","/opt/synopkgland/compose-admin","--origin","https://my-nas.example:5001"]'
29
+ synopkgland install ./MyApp.spk --yes
30
+ synopkgland uninstall MyApp --yes
31
+ ```
32
+
33
+ The configured command is a JSON argument array, never a shell fragment. The
34
+ helper's `--origin` must exactly match the DSM origin used for the operation.
35
+ Supply this setting through the administrator's process environment; project
36
+ `.env` files cannot set it. Use a channel scoped to that specific NAS. The CLI
37
+ sends no DSM credentials to this command. Authenticate SSH/sudo through your
38
+ existing credential mechanism; never put passwords in command arguments.
39
+ The CLI does not install an SSH server, change accounts or create sudo rules.
40
+
41
+ The helper is shipped as locked Go source in the CLI package and uses the same
42
+ pinned SDK release as the CLI. Build it for the NAS separately from an App; do
43
+ not put it in the SPK. Keep Container Manager edits and other package tools idle
44
+ during the operation. The helper holds a NAS package lock until the CLI completes
45
+ or closes the channel; concurrent CLI operations also share a local
46
+ origin/package lock.
47
+
48
+ With the native channel enabled, the helper captures the installed package
49
+ target, Compose lock services, CM package/project association and full container
50
+ labels before STOP. The CLI stops the package, waits for stopped readback, then
51
+ invokes `RemoveStoppedWorkerContainers` before upload/upgrade or uninstall.
52
+ Writable container layers are replaced; declared volumes and bind data are
53
+ retained. The worker uses `force_recreate: false`; image/config changes still
54
+ cause normal replacement. This flag alone does not repair existing profile
55
+ damage.
56
+
57
+ For a docker-project worker failure with code 272 and no native channel, the CLI
58
+ reports the original DSM error with channel-enablement guidance. It does not
59
+ infer that a profile is missing or attempt `RefreshWorkerProfiles` or a recovery
60
+ start. Enable the channel above, inspect the package's current state, then retry
61
+ the same-version repair with the inspected SPK or store release:
62
+
63
+ ```sh
64
+ synopkgland status MyApp
65
+ synopkgland install ./MyApp.spk --yes
66
+ ```
67
+
68
+ With the channel enabled, only a confirmed docker-project worker failure, the
69
+ selected installed version and verified lower-level missing/stale profile
70
+ evidence can invoke `RefreshWorkerProfiles`. After successful profile readback,
71
+ the CLI starts that version once. It never retries an uncertain write. Project
72
+ get error 2105, foreign ownership, unknown paths, unreadable profiles and
73
+ incomplete inventory stop the operation. Check DSM state before retrying after
74
+ any such failure.
75
+
76
+ Orphan cleanup only considers containers completely inspected earlier in the
77
+ same locked helper session. It checks their exact prior profile IDs and a full
78
+ all-container inventory to exclude any same-name resource, then uses Container
79
+ delete with `force=false` and `preserve_profile=false`, followed by readback.
80
+ It does not scan name prefixes or remove CM configuration files directly.
81
+ Existing orphan profiles without this prior inventory require administrator
82
+ investigation; the CLI cannot infer ownership from a filename.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/cli",
3
- "version": "0.52.8",
3
+ "version": "0.52.10",
4
4
  "description": "Syno Package Land Developer Kit CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -21,7 +21,8 @@
21
21
  "docs/path-ingress.md",
22
22
  "skills",
23
23
  "docs/shared-folders.md",
24
- "docs/daemon-nofile.md"
24
+ "docs/daemon-nofile.md",
25
+ "docs/compose-admin.md"
25
26
  ],
26
27
  "scripts": {
27
28
  "check:docs": "node --test scripts/check-doc-versions.test.mjs && node scripts/check-doc-versions.mjs",
@@ -421,6 +421,25 @@
421
421
  "7.4"
422
422
  ]
423
423
  },
424
+ {
425
+ "api": "SYNO.Core.Package.Control",
426
+ "method": "start",
427
+ "version": 1,
428
+ "dsm": {
429
+ "7.2": "unverified",
430
+ "7.3": "unverified",
431
+ "7.4": "confirmed"
432
+ },
433
+ "parameters": {
434
+ "id": {}
435
+ },
436
+ "sources": [
437
+ "host/catalog-install.ts"
438
+ ],
439
+ "hubConfirmed": [
440
+ "7.4"
441
+ ]
442
+ },
424
443
  {
425
444
  "api": "SYNO.Core.Package.Uninstallation",
426
445
  "method": "uninstall",
@@ -1114,7 +1133,7 @@
1114
1133
  "sourceAudit": {
1115
1134
  "build-spk/share-combobox.ts": "797cd3eea347e7fe57946f9584f725d6faef79fe9c56b690e1199ea7489fa973",
1116
1135
  "build-spk/share-validation.ts": "a51b160cea9bea096e6efb45879abbf6d0dfecf21c761dca7cd06647d44cef62",
1117
- "cli.ts": "d198112e9b2e238373f96e85da50f509f55915a3995704936591162c2a37a783",
1136
+ "cli.ts": "61cd00cb0f7dc1836717cc2ee666e93c3396ba79bc3bc30aad2a4fec85a661ad",
1118
1137
  "ctl/cli.ts": "97d218069c6fac42f64573c68c354d7a0e549ca2900b9d8b2935c9786bc5d11d",
1119
1138
  "ctl/external.ts": "f66490ded838f934a0cf373f284418d4d02441edc8c8365066fc45b898ba81dc",
1120
1139
  "ctl/flows.ts": "0f35d03176655bfe1d1df5d02ea36199e05973634dffcc6710112b7c8ce78b7e",
@@ -1127,13 +1146,13 @@
1127
1146
  "e2e/certificates.ts": "e9801e5f4d326d31c3c281e5106f34138493e26cd7f0ad2b1dd3f6a566832389",
1128
1147
  "e2e/dsm.ts": "66c9b3f6d907a8069202c5f88f13f8051c07b099de66d3ebce5de51c6374201f",
1129
1148
  "error-registry.ts": "91f2de89bf98750a09fce54420e3a25e3527980be175ed704890a520181f1dc9",
1130
- "host/catalog-install.ts": "df27409d835a901658dae7c2048c9028c2dc886e17575fe9189e88ae705c0fd2",
1131
- "host/compose-project-recovery.ts": "c76efa505f8ba14f50a8705b63d0f9f8a022b70505fe6a5f5976146afae17532",
1149
+ "host/catalog-install.ts": "13908fd47d75f8a2f4ed412c9310b80b2d0a1d190ce46db34f15850c2ed45578",
1150
+ "host/compose-project-recovery.ts": "51f93197898677b5daebd745ef848e07b7d6454fc86b5d4e1fa210fe089ac414",
1132
1151
  "host/container-pull.ts": "09908f48133ecc2580001afb4f7f0b6a949e4f35df1229e1e0860e37f2aa9a46",
1133
1152
  "host/dsm-client.ts": "52c34d520154e43d823a64dbb0ff7f3ae40e427fb835a5136ab6d847827a4b7a",
1134
1153
  "host/dsm-compound.ts": "5674b6f11d2b36a86a97ac7edf590abb34bd72f441c1f43ab057a43cfb5d7e88",
1135
1154
  "host/dsm-port-profile.ts": "9ebd06bbbc918267ef2d8a4ff9737b9d35579e45224dd4de362389921446ae8d",
1136
- "host/package-commands.ts": "2e54eeea40cdf3221d277697ab9b02b43377e58bd81b64d4507f85d4039a08e8",
1155
+ "host/package-commands.ts": "8a171c2ac3613697f52d81af3469250b7b28b190fcb7e863368876e056d189e7",
1137
1156
  "host/port-info-lookup.ts": "b7af19dd8194bc424eb2100ce5953cf0737e8158da373e93b66627c6a7028c8e",
1138
1157
  "host/port-info.ts": "9ab70c37860df681bee70039aebda9ad974fbd2e200fc2741daf9aacf7943905",
1139
1158
  "host/share-lookup.ts": "c158baffc774cb7b5b36a82b633bc48f7b8522f67972ef09ab1a15a8b4609196",
@@ -45,6 +45,88 @@
45
45
  "additionalProperties": false
46
46
  }
47
47
  },
48
+ "capabilities": {
49
+ "type": "object",
50
+ "properties": {
51
+ "webapi": {
52
+ "type": "object",
53
+ "additionalProperties": {
54
+ "type": "object",
55
+ "required": [
56
+ "purpose",
57
+ "apis"
58
+ ],
59
+ "properties": {
60
+ "purpose": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ },
64
+ "purpose_i18n": {
65
+ "type": "object",
66
+ "properties": {
67
+ "en": {
68
+ "type": "string",
69
+ "minLength": 1,
70
+ "maxLength": 1024
71
+ },
72
+ "zh-TW": {
73
+ "type": "string",
74
+ "minLength": 1,
75
+ "maxLength": 1024
76
+ },
77
+ "zh-CN": {
78
+ "type": "string",
79
+ "minLength": 1,
80
+ "maxLength": 1024
81
+ },
82
+ "de": {
83
+ "type": "string",
84
+ "minLength": 1,
85
+ "maxLength": 1024
86
+ },
87
+ "fr": {
88
+ "type": "string",
89
+ "minLength": 1,
90
+ "maxLength": 1024
91
+ },
92
+ "ja": {
93
+ "type": "string",
94
+ "minLength": 1,
95
+ "maxLength": 1024
96
+ },
97
+ "ko": {
98
+ "type": "string",
99
+ "minLength": 1,
100
+ "maxLength": 1024
101
+ },
102
+ "es": {
103
+ "type": "string",
104
+ "minLength": 1,
105
+ "maxLength": 1024
106
+ },
107
+ "it": {
108
+ "type": "string",
109
+ "minLength": 1,
110
+ "maxLength": 1024
111
+ }
112
+ },
113
+ "additionalProperties": false
114
+ },
115
+ "apis": {
116
+ "type": "object"
117
+ },
118
+ "raw_max_bytes": {
119
+ "type": "integer",
120
+ "minimum": 0,
121
+ "maximum": 10737418240
122
+ }
123
+ },
124
+ "additionalProperties": false
125
+ }
126
+ }
127
+ },
128
+ "additionalProperties": true
129
+ },
48
130
  "identity_gateway": {"$ref": "identity-gateway.v1.schema.json"},
49
131
  "mobile": {"$ref": "mobile.v1.schema.json"},
50
132
  "i18n": {
package/skills/SKILL.md CHANGED
@@ -470,3 +470,5 @@ npm pack and tarball content checks. Run `npm run gates:full` only when the user
470
470
  explicitly requests extended matrices and integration checks. Publishing does
471
471
  not require a full-gate result. Application fixture acceptance remains scoped
472
472
  to the application task's authorization.
473
+
474
+ WebAPI profile consent: supply all nine `purpose_i18n` locales, keep English `purpose`, and heed `WEBAPI_PURPOSE_I18N_MISSING` from `check`. See [files](reference/files.md). WebAPI-only Apps need no file delegate to approve system privileges.
@@ -172,3 +172,19 @@ never widens access, and files from different users never share a grant.
172
172
  ## Container mounts
173
173
 
174
174
  Containers use a fixed package identity and never inherit the signed-in user's File Station ACL. Mount grants are distinct from user destination grants. Per-user file access requires a session/Broker Adapter, outside this change. Read [compose.md](compose.md); official ACL/project control remains blocked.
175
+
176
+
177
+ WebAPI-only Apps use the shared executor approval without a file delegate.
178
+ Do not add a delegate capability solely to enable approval. The generated entry
179
+ passes `fileDelegate` from `capabilities.delegate` to the SDK; older backends
180
+ that answer `unknown_method` to `delegate.status` have no file scope to approve.
181
+
182
+ For every `capabilities.webapi.<profile>`, retain an English `purpose` and add
183
+ `purpose_i18n` with `en`, `zh-TW`, `zh-CN`, `de`, `fr`, `ja`, `ko`, `es`, `it`.
184
+ Write nonempty descriptions without trailing periods. `check` warns about
185
+ missing locales; the UI falls back to `purpose_i18n.en`, then `purpose`.
186
+ Translations are display metadata; only the original English purpose and exact
187
+ API/method/version allowlist enter the executor policy. Use matching SDK support
188
+ for localized consent and WebAPI-only approval. Test a WebAPI-only approval form
189
+ with a backend that does not register `delegate.status`, as well as a declared
190
+ file delegate with scope selection.
@@ -132,3 +132,13 @@ the endpoint, key location and model. Do not print keys or put them in argv.
132
132
 
133
133
  Set `APP_TEST_AI_ACTION` to one authorized fixture action. Keep a deterministic
134
134
  selector/result assertion after `agent.act`; an AI assertion alone is insufficient.
135
+
136
+
137
+ For the WebAPI-only executor approval regression, build the CLI and matching SDK,
138
+ then run `node test/browser/mobile-executor.mjs --webapi-only`. Set
139
+ `SYNOPKGLAND_BROWSER_DEPS` to a directory containing the SDK, Vue/UI peers and
140
+ `playwright-core`, and `SYNOPKGLAND_SDK_DIR` to that SDK checkout. Use
141
+ `CHROMIUM_PATH` for a system Chromium. The synthetic backend omits
142
+ `delegate.status`; first approval, password retry, upgrade, non-admin and
143
+ anonymous paths verify that no file-scope query is made. This smoke does not
144
+ establish NAS runtime acceptance.