@synopackageland/cli 0.49.1 → 0.50.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 (75) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +10 -0
  3. package/dist/ctl/ai-tools.d.ts +9 -1
  4. package/dist/ctl/ai-tools.js +4 -4
  5. package/dist/ctl/cli.d.ts +8 -1
  6. package/dist/ctl/cli.js +40 -5
  7. package/dist/ctl/descriptor.d.ts +15 -2
  8. package/dist/ctl/descriptor.js +9 -4
  9. package/dist/ctl/flows.js +2 -0
  10. package/dist/ctl/input.d.ts +5 -3
  11. package/dist/ctl/input.js +3 -3
  12. package/dist/ctl/native-auth-command.d.ts +9 -0
  13. package/dist/ctl/native-auth-command.js +98 -0
  14. package/dist/ctl/native-executor.d.ts +16 -0
  15. package/dist/ctl/native-executor.js +187 -0
  16. package/dist/ctl/native-file-types.d.ts +16 -0
  17. package/dist/ctl/native-file-types.js +57 -0
  18. package/dist/ctl/native-files.d.ts +13 -0
  19. package/dist/ctl/native-files.js +115 -0
  20. package/dist/ctl/native-metadata.d.ts +10 -0
  21. package/dist/ctl/native-metadata.js +50 -0
  22. package/dist/ctl/native-paths.d.ts +4 -0
  23. package/dist/ctl/native-paths.js +54 -0
  24. package/dist/ctl/native-protocol.d.ts +21 -0
  25. package/dist/ctl/native-protocol.js +150 -0
  26. package/dist/ctl/native-registry.d.ts +8 -0
  27. package/dist/ctl/native-registry.js +182 -0
  28. package/dist/ctl/native-schemas.d.ts +7 -0
  29. package/dist/ctl/native-schemas.js +25 -0
  30. package/dist/ctl/native-store.d.ts +61 -0
  31. package/dist/ctl/native-store.js +348 -0
  32. package/dist/ctl/native-transfers.d.ts +13 -0
  33. package/dist/ctl/native-transfers.js +331 -0
  34. package/dist/ctl/native-transport.d.ts +30 -0
  35. package/dist/ctl/native-transport.js +148 -0
  36. package/dist/ctl/native-types.d.ts +15 -0
  37. package/dist/ctl/native-types.js +1 -0
  38. package/dist/ctl/registry.d.ts +5 -4
  39. package/dist/ctl/registry.js +12 -1
  40. package/dist/ctl/service.d.ts +32 -1
  41. package/dist/ctl/service.js +122 -1
  42. package/dist/error-registry.js +15 -0
  43. package/dist/generated/native-http.d.ts +189 -0
  44. package/dist/generated/native-http.js +1 -0
  45. package/dist/nas/store.d.ts +3 -1
  46. package/dist/nas/store.js +6 -3
  47. package/dist/nas/transport.d.ts +1 -0
  48. package/dist/native-http-schema/descriptor.schema.json +242 -0
  49. package/dist/native-http-schema/inventory.schema.json +121 -0
  50. package/dist/native-http-schema/registry.schema.json +872 -0
  51. package/dist/native-http-schema/source.json +1 -0
  52. package/dist/runtime/sdk-source.d.ts +1 -1
  53. package/dist/runtime/sdk-source.js +1 -1
  54. package/dist/standalone/api-description.d.ts +2 -5
  55. package/dist/standalone/build.js +5 -1
  56. package/dist/standalone/compose-errors.js +5 -0
  57. package/dist/standalone/inspect-spk.js +2 -17
  58. package/dist/standalone/lifecycle.js +9 -2
  59. package/dist/standalone/manifest.d.ts +1 -0
  60. package/dist/standalone/manifest.js +22 -5
  61. package/dist/standalone/native-http-inspect.d.ts +9 -0
  62. package/dist/standalone/native-http-inspect.js +43 -0
  63. package/dist/standalone/native-http.d.ts +31 -0
  64. package/dist/standalone/native-http.js +120 -0
  65. package/dist/standalone/operation-registry.d.ts +2 -7
  66. package/dist/standalone/operation-registry.js +3 -0
  67. package/dist/standalone/spk.d.ts +1 -0
  68. package/dist/standalone/spk.js +15 -1
  69. package/package.json +2 -2
  70. package/schema/dsm-api-contract.json +8 -7
  71. package/skills/SKILL.md +2 -2
  72. package/skills/reference/compose.md +21 -0
  73. package/skills/reference/ctl.md +198 -0
  74. package/skills/reference/daemon-mode.md +1 -1
  75. package/skills/reference/upstream-fork.md +5 -2
@@ -0,0 +1 @@
1
+ {"module":"github.com/synopackageland/syno-pkg-land-sdk","version":"development","local":true}
@@ -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.49.5";
4
+ export declare const DEFAULT_SDK_VERSION = "0.52.0";
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.49.5';
8
+ export const DEFAULT_SDK_VERSION = '0.52.0';
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,10 +1,7 @@
1
- import type { Descriptor } from '../ctl/descriptor.js';
2
1
  import { type StandaloneManifest } from './manifest.js';
3
2
  import type { CommandRunner } from './build.js';
4
- export declare function buildApiDescription(m: StandaloneManifest, bridgeMethods: string[] | undefined, run: CommandRunner): Promise<{
5
- description: Descriptor;
6
- registry: Record<string, string>;
7
- } | undefined>;
3
+ import type { NativeArtifacts } from './native-http.js';
4
+ export declare function buildApiDescription(m: StandaloneManifest, bridgeMethods: string[] | undefined, run: CommandRunner): Promise<NativeArtifacts | undefined>;
8
5
  export declare function describeApiRoutes(m: StandaloneManifest, bridgeMethods: string[] | undefined, run: CommandRunner): Promise<{
9
6
  method: string;
10
7
  permission: string;
@@ -4,6 +4,7 @@ import { buildAppBackup } from './hyper-backup.js';
4
4
  import { auditGoRoutes, httpRoutesDigest } from './route-audit.js';
5
5
  import { PORTAL_REQUIRES_EXECUTOR } from "../portal/alias.js";
6
6
  import { buildApiDescription } from "./api-description.js";
7
+ import { buildNativeMetadataCgi } from './native-http.js';
7
8
  import { goChildEnv } from "../runtime/go-env.js";
8
9
  import { spawn } from "node:child_process";
9
10
  import { goModulePath, privateSdkHint, SDK_MODULE, sdkSource, } from "../runtime/sdk-source.js";
@@ -154,7 +155,9 @@ export async function buildStandalone(options) {
154
155
  const executor = await buildExecutor(manifest, arch, archWork, run);
155
156
  executor?.warnings.forEach((warning) => warnings.add(warning));
156
157
  const builtManifest = executor ? { ...manifest, executor } : manifest;
157
- const { cgi: cgiPath, worker: backgroundWorker, app, } = await backendFor(builtManifest, arch, archWork, run, bridge);
158
+ const { cgi: cgiPath, worker: backgroundWorker, app, } = builtManifest.ctl?.enabled && builtManifest.ctl.transport === 'native-http'
159
+ ? { cgi: await buildNativeMetadataCgi(builtManifest, arch, archWork, run, apiDescription) }
160
+ : await backendFor(builtManifest, arch, archWork, run, bridge);
158
161
  const outputPath = join(stage, `${manifest.package}-${manifest.spkVersion}-${arch}.spk`);
159
162
  const daemonControl = await buildDaemonControl(manifest, arch, archWork, run);
160
163
  const identityGateway = await buildIdentityGateway(manifest, arch, archWork, run);
@@ -183,6 +186,7 @@ export async function buildStandalone(options) {
183
186
  portalText,
184
187
  apiDescription,
185
188
  apiRegistry: apiArtifact?.registry,
189
+ httpInventory: apiArtifact?.inventory,
186
190
  });
187
191
  return outputPath;
188
192
  }));
@@ -1,5 +1,10 @@
1
1
  /** SDK planner errors accepted at this versioned tool boundary. */
2
2
  export const COMPOSE_ERRORS = {
3
+ COMPOSE_STOP_UNCONFIRMED: {
4
+ code: "COMPOSE_STOP_UNCONFIRMED",
5
+ description: "The App's local stop operation failed.",
6
+ suggestion: "Inspect the failed App hook or local service cleanup, resolve that failure and retry Stop. Missing Container Manager profiles after Stop are normal; do not recreate or modify them.",
7
+ },
3
8
  COMPOSE_HOST_UDP_INVALID: {
4
9
  code: "COMPOSE_HOST_UDP_INVALID",
5
10
  description: "The host UDP listener declaration is invalid.",
@@ -10,7 +10,7 @@ import { nativePortal } from "./portal.js";
10
10
  import { nativeGatewaySupported, renderNativeGatewayConfig, renderNativeGatewayDiagnostic, renderNativeGatewayPrepare, NATIVE_GATEWAY_CONFIG, gatewayEntryPath } from './native-gateway.js';
11
11
  import { inspectPortalInfo } from "../portal/info.js";
12
12
  import { isDeepStrictEqual } from "node:util";
13
- import { inspectApiDescription } from "./api-description-inspect.js";
13
+ import { inspectCtlArtifacts } from './native-http-inspect.js';
14
14
  import { dsmLauncherType } from "../contract/app-launch.js";
15
15
  import { isWebLaunchMode, resolvedWebLaunch, trustedAppEntryPath, usesAuthGateway, } from "../contract/web-launch.js";
16
16
  import { loadContract } from "../contract/load.js";
@@ -182,6 +182,7 @@ export async function inspectSpk(spkPath, expectedKind) {
182
182
  return root;
183
183
  }, payload, metadata.hyperBackup, /^package="([^"]*)"$/m.exec(readOptional(join(dir, "INFO")) ?? "")?.[1] ?? "", familyOfArchToken(/^arch="([^"]*)"$/m.exec(readOptional(join(dir, "INFO")) ?? "")?.[1]?.split(/\s+/)[0] ?? "") ?? "x86_64", findings);
184
184
  const integrations = metadata.integrations ?? [];
185
+ await inspectCtlArtifacts(dir, paths, metadata.ctl, metadata.entry, findings);
185
186
  if (metadata.compose !== undefined) {
186
187
  const result = await inspectUnifiedCompose(dir, payload, { ...metadata, installSettings }, findings);
187
188
  if (dependencies) {
@@ -249,22 +250,6 @@ export async function inspectSpk(spkPath, expectedKind) {
249
250
  checkUninstall(dir, findings);
250
251
  if (kind === "container")
251
252
  await checkContainerExposure(dir, join(dir, "package.tgz"), findings);
252
- if (metadata.ctl || paths.has("synopkgland-api.json")) {
253
- if (!metadata.ctl ||
254
- !paths.has("synopkgland-api.json") ||
255
- [...paths].some((path) => path.startsWith("ui/") && path.endsWith("synopkgland-api.json")))
256
- findings.push("CTL_DESCRIPTOR_LAYOUT_INVALID API description must be private and match its build record.");
257
- else {
258
- const apiDir = join(dir, "api-description-inspection");
259
- mkdirSync(apiDir);
260
- await tar.x({
261
- file: join(dir, "package.tgz"),
262
- cwd: apiDir,
263
- filter: (path) => path.replace(/^\.\//, "") === "synopkgland-api.json",
264
- });
265
- findings.push(...inspectApiDescription(readFileSync(join(apiDir, "synopkgland-api.json"), "utf8"), { id: info.package, version: info.version }, metadata.ctl.hash, metadata.ctl.registry));
266
- }
267
- }
268
253
  const bridge = compiledKind && kind !== "native-go"
269
254
  ? await checkBridgeApp(dir, metadata.backend, info, payload, findings, metadata.entry)
270
255
  : undefined;
@@ -63,13 +63,20 @@ function renderStandaloneScriptInternal(name, manifest) {
63
63
  compose: undefined,
64
64
  daemon: manifest.identityGateway ? composeDaemon(manifest) : undefined,
65
65
  };
66
- const body = name === "preinst"
66
+ let body = name === "preinst"
67
67
  ? renderComposeInstall(manifest.package).replace("#!/bin/sh\n", () => "#!/bin/sh\n" + renderSharedFolderPreparation(manifest.sharedFolder))
68
68
  : renderStandaloneScriptInternal(name, { ...native, appScripts: undefined });
69
+ if (name === "start-stop-status" && !manifest.identityGateway) {
70
+ // Report real local teardown failures. Container Manager may remove
71
+ // profiles on STOP and recreate them in its START worker; neither
72
+ // action may require those profiles to exist.
73
+ body = `#!/bin/sh\nsynopkgland_compose_lifecycle() (\n${body.slice("#!/bin/sh\n".length)})\nsynopkgland_compose_result=0\nsynopkgland_compose_lifecycle "$@" || synopkgland_compose_result=$?\nif [ "$1" = stop ] && [ "$synopkgland_compose_result" != 0 ]; then\n echo "[COMPOSE_STOP_UNCONFIRMED] Local service teardown failed; inspect App hooks and local services, then retry Stop" >&2\nfi\nexit "$synopkgland_compose_result"\n`;
74
+ }
69
75
  const control = `"/var/packages/${manifest.package}/target/daemon/control"`;
70
76
  const paths = `"\${SYNOPKG_PKGDEST:-/var/packages/${manifest.package}/target}" "\${SYNOPKG_PKGVAR:-/var/packages/${manifest.package}/var}"`;
71
77
  const preflight = name === "start-stop-status"
72
- ? `case "$1" in prestart|start|restart)\n "\${SYNOPKG_PKGDEST:-/var/packages/${manifest.package}/target}/compose/control" preflight || exit $? ;;\nesac\n` +
78
+ ? (!manifest.identityGateway ? `if [ "$1" = restart ]; then\n "$0" stop || exit $?\n exec "$0" start\nfi\n` : "") +
79
+ `case "$1" in prestart|start|restart)\n "\${SYNOPKG_PKGDEST:-/var/packages/${manifest.package}/target}/compose/control" preflight || exit $? ;;\nesac\n` +
73
80
  (!manifest.identityGateway ? `case "$1" in prestart|prestop) exit 0 ;; esac\n` : "")
74
81
  : "";
75
82
  const remember = name === "postinst" &&
@@ -50,6 +50,7 @@ export interface StandaloneManifest {
50
50
  allowSecretFiles?: string[];
51
51
  ctl?: {
52
52
  enabled: boolean;
53
+ transport?: 'native-http';
53
54
  registry?: string;
54
55
  aliases?: string[];
55
56
  developedBy?: string;
@@ -1,3 +1,4 @@
1
+ import { validateNativeManifest } from './native-http.js';
1
2
  import { readMobile, mobileIconPath } from './mobile.js';
2
3
  import { daemonNoFileSdkProblem, daemonNoFileIdentityProblem, DAEMON_NOFILE_MIN_DSM, DAEMON_NOFILE_UNSUPPORTED, DAEMON_NOFILE_ACTIVATION_PROBLEM } from './daemon-nofile.js';
3
4
  import { readAllowedSecretFiles } from "../secret-files.js";
@@ -226,7 +227,7 @@ function readManifest(raw, c) {
226
227
  : undefined;
227
228
  if (binaryProblem)
228
229
  c.fail("STANDALONE_ROOT_PROGRAMS_INVALID", binaryProblem);
229
- const backend = raw.compose !== undefined && raw.backend === undefined
230
+ const backend = (raw.compose !== undefined || isRecord(raw.ctl) && raw.ctl.transport === 'native-http') && raw.backend === undefined
230
231
  ? { kind: "binary", files: {} }
231
232
  : arches && readBackend(raw.backend, arches, c);
232
233
  if (backend && backend.kind !== "binary" && rootOps) {
@@ -248,7 +249,7 @@ function readManifest(raw, c) {
248
249
  }
249
250
  let permissions;
250
251
  let integrations;
251
- if (backend && backend.kind !== "binary") {
252
+ if (backend && backend.kind !== "binary" && !(isRecord(raw.ctl) && raw.ctl.transport === 'native-http')) {
252
253
  try {
253
254
  const source = isRecord(raw.ctl) && typeof raw.ctl.registry === 'string' ? readRegistry(registryFile(c.root, raw.ctl.registry)) : undefined;
254
255
  permissions = readApiPermissions(backend, capabilities, source?.operations);
@@ -283,7 +284,7 @@ function readManifest(raw, c) {
283
284
  c.fail(problem.code, problem.message);
284
285
  }
285
286
  const gatewayRaw = isRecord(raw.identity_gateway) ? raw.identity_gateway : {};
286
- if (raw.compose !== undefined && isRecord(raw.ctl) && raw.ctl.enabled === true)
287
+ if (raw.compose !== undefined && isRecord(raw.ctl) && raw.ctl.enabled === true && raw.ctl.transport !== 'native-http')
287
288
  c.fail("CTL_UNSUPPORTED_BACKEND", "Compose does not support automatic ctl descriptions; disable ctl.");
288
289
  if (isRecord(raw.compose) && isRecord(raw.compose.web) && !isRecord(raw.compose.web.health))
289
290
  c.fail("COMPOSE_HEALTH_REQUIRED", "Select compose.web.health.path and expected 2xx status for the actual App. Readiness does not follow redirects; check is static and does not probe HTTP.");
@@ -420,7 +421,7 @@ function readManifest(raw, c) {
420
421
  }
421
422
  const entry = raw.entry === undefined
422
423
  ? undefined
423
- : raw.compose !== undefined &&
424
+ : (raw.compose !== undefined || isRecord(raw.ctl) && raw.ctl.transport === 'native-http') &&
424
425
  (raw.entry === "admin-only" || raw.entry === "app-privilege")
425
426
  ? raw.entry
426
427
  : readEntry(raw.entry, backend, permissions?.policy, c);
@@ -589,6 +590,8 @@ function readManifest(raw, c) {
589
590
  if (typeof raw.ctl.registry !== 'string' || raw.ctl.commands !== undefined)
590
591
  throw Error('Use ctl.registry without ctl.commands.');
591
592
  const registry = readRegistry(registryFile(c.root, raw.ctl.registry));
593
+ if (raw.ctl.transport !== undefined && raw.ctl.transport !== 'native-http' || (registry.version === 3) !== (raw.ctl.transport === 'native-http') || raw.ctl.transport === 'native-http' && (raw.ctl.external !== undefined || !identityGateway?.ingress || capabilities.identity))
594
+ throw Error('Native HTTP requires a v3 registry, protected same-origin ingress and no ctl.external or standalone identity.');
592
595
  raw.ctl.commands = Object.fromEntries(Object.entries(registry.operations).filter(([, op]) => op.ai !== 'hidden'));
593
596
  }
594
597
  catch (error) {
@@ -596,6 +599,10 @@ function readManifest(raw, c) {
596
599
  return undefined;
597
600
  }
598
601
  }
602
+ if (isRecord(raw.ctl) && raw.ctl.transport !== undefined && (raw.ctl.transport !== 'native-http' || typeof raw.ctl.registry !== 'string')) {
603
+ c.fail('CTL_DECLARATION_INVALID', 'Explicit native-http transport requires a v3 operation registry.');
604
+ return undefined;
605
+ }
599
606
  if (isRecord(raw.ctl) && raw.ctl.external !== undefined) {
600
607
  const external = raw.ctl.external;
601
608
  if (!isRecord(external) || Object.keys(external).length < 1 || Object.keys(external).length > 16 ||
@@ -606,7 +613,7 @@ function readManifest(raw, c) {
606
613
  return undefined;
607
614
  }
608
615
  }
609
- return {
616
+ const manifest = {
610
617
  ...(raw.ctl ? { ctl: raw.ctl } : {}),
611
618
  ...(allowSecretFiles ? { allowSecretFiles } : {}),
612
619
  root: c.root,
@@ -655,6 +662,16 @@ function readManifest(raw, c) {
655
662
  ...(loginStyle ? { loginStyle } : {}),
656
663
  ...(appScripts ? { appScripts } : {}),
657
664
  };
665
+ if (manifest.ctl?.transport === 'native-http') {
666
+ try {
667
+ validateNativeManifest(manifest);
668
+ }
669
+ catch (error) {
670
+ c.fail('CTL_NATIVE_REGISTRY_INVALID', error.message);
671
+ return undefined;
672
+ }
673
+ }
674
+ return manifest;
658
675
  }
659
676
  function checkBridgeMethods(backend, permissions, c) {
660
677
  for (const problem of bridgeMethodProblems(backend.methods, permissions, `${relative(c.root, backend.dir)}/permissions.json`))
@@ -0,0 +1,9 @@
1
+ export interface CtlBuildRecord {
2
+ hash: string;
3
+ registry?: Record<string, string>;
4
+ transport?: string;
5
+ inventorySha256?: string;
6
+ sdk?: string;
7
+ }
8
+ /** Runs before Compose's early inspect return as well as on native packages. */
9
+ export declare function inspectCtlArtifacts(dir: string, paths: Set<string>, record: CtlBuildRecord | undefined, entry: string | undefined, findings: string[]): Promise<void>;
@@ -0,0 +1,43 @@
1
+ import { readFileSync, mkdirSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import * as tar from 'tar';
4
+ import { validateNativeArtifacts, digest, HTTP_INVENTORY_FILE } from '../ctl/native-metadata.js';
5
+ import { gatewayEntryPolicyDigest } from './identity-gateway.js';
6
+ import { CGI_PAYLOAD_PATH } from './dsm-window.js';
7
+ import { inspectApiDescription } from './api-description-inspect.js';
8
+ import { strictJson } from '../ctl/json.js';
9
+ /** Runs before Compose's early inspect return as well as on native packages. */
10
+ export async function inspectCtlArtifacts(dir, paths, record, entry, findings) {
11
+ if (!record && !paths.has('synopkgland-api.json') && !paths.has(HTTP_INVENTORY_FILE))
12
+ return;
13
+ if (!record || !paths.has('synopkgland-api.json') || [...paths].some(path => path.startsWith('ui/') && (path.endsWith('synopkgland-api.json') || path.endsWith(HTTP_INVENTORY_FILE)))) {
14
+ findings.push('CTL_DESCRIPTOR_LAYOUT_INVALID metadata must be private and match its build record.');
15
+ return;
16
+ }
17
+ const root = join(dir, 'api-description-inspection');
18
+ mkdirSync(root, { recursive: true });
19
+ const wanted = new Set(['synopkgland-api.json', HTTP_INVENTORY_FILE, 'sso/gateway.json', CGI_PAYLOAD_PATH]);
20
+ await tar.x({ file: join(dir, 'package.tgz'), cwd: root, filter: path => wanted.has(path.replace(/^\.\//, '')) });
21
+ const raw = readFileSync(join(root, 'synopkgland-api.json'), 'utf8'), info = readFileSync(join(dir, 'INFO'), 'utf8'), id = /^package="([^"]+)"$/m.exec(info)?.[1] ?? '', version = /^version="([^"]+)"$/m.exec(info)?.[1] ?? '';
22
+ try {
23
+ const description = strictJson(raw);
24
+ if (description.version !== 3) {
25
+ if (record.transport || paths.has(HTTP_INVENTORY_FILE))
26
+ throw Error();
27
+ findings.push(...inspectApiDescription(raw, { id, version }, record.hash, record.registry));
28
+ return;
29
+ }
30
+ if (record.transport !== 'native-http' || !record.sdk || !paths.has(HTTP_INVENTORY_FILE) || !paths.has('sso/gateway.json') || !paths.has(CGI_PAYLOAD_PATH))
31
+ throw Error();
32
+ const { descriptor: d, inventory: i } = validateNativeArtifacts(description, strictJson(readFileSync(join(root, HTTP_INVENTORY_FILE))));
33
+ const p = d.payload;
34
+ const gateway = strictJson(readFileSync(join(root, 'sso/gateway.json')));
35
+ const permissions = Object.fromEntries(Object.entries(i.bindings).map(([name, b]) => [name, b.permission]));
36
+ const cgi = readFileSync(join(root, CGI_PAYLOAD_PATH));
37
+ if (p.package.id !== id || p.package.version !== version || p.entry !== (entry ?? 'policy') || d.sha256 !== record.hash || p.inventorySha256 !== record.inventorySha256 || digest(permissions) !== digest(record.registry) || p.entryPolicyDigest !== gatewayEntryPolicyDigest(gateway) || p.execution.basePath !== gateway.ingress_path || digest(i.upstreamAuthPaths) !== digest(gateway.upstream_auth_paths) || !cgi.includes(Buffer.from(d.sha256)) || !cgi.includes(Buffer.from('api/nativehttp.NewDescriptionHandler')))
38
+ throw Error();
39
+ }
40
+ catch {
41
+ findings.push('CTL_NATIVE_METADATA_MISMATCH descriptor, HTTP inventory, gateway policy, CGI pin or final INFO differs.');
42
+ }
43
+ }
@@ -0,0 +1,31 @@
1
+ import { type NativeArchFamily } from '../build-spk/dsm-arch.js';
2
+ import type { NativeInventory } from '../ctl/native-types.js';
3
+ import type { Descriptor } from '../ctl/descriptor.js';
4
+ import type { StandaloneManifest } from './manifest.js';
5
+ import type { CommandRunner } from './build.js';
6
+ export interface NativeArtifacts {
7
+ description: Descriptor;
8
+ registry: Record<string, string>;
9
+ inventory?: NativeInventory;
10
+ }
11
+ export declare function nativeSdk(m: StandaloneManifest): import("../runtime/sdk-source.js").SdkSource;
12
+ export declare function nativeBuildConfig(m: StandaloneManifest): {
13
+ package: {
14
+ id: string;
15
+ version: string;
16
+ displayName: string;
17
+ };
18
+ aliases: string[];
19
+ provenance: {
20
+ developedBy: string;
21
+ generator: string;
22
+ };
23
+ backend: string;
24
+ transport: string;
25
+ gateway: any;
26
+ };
27
+ export declare function validateNativeManifest(m: StandaloneManifest): void;
28
+ export declare function generateNativeOperations(m: StandaloneManifest, run: CommandRunner, check?: boolean): Promise<NativeArtifacts>;
29
+ /** Fixed SDK metadata-only CGI; no App business routes are linked. */
30
+ export declare function metadataCgiSource(pkg: string, entry: string, sha256: string): string;
31
+ export declare function buildNativeMetadataCgi(m: StandaloneManifest, arch: NativeArchFamily, work: string, run: CommandRunner, description: Descriptor): Promise<string>;
@@ -0,0 +1,120 @@
1
+ import { readFileSync, mkdtempSync, writeFileSync, rmSync, existsSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ import { tmpdir } from 'node:os';
4
+ import { sdkSource, SDK_MODULE } from '../runtime/sdk-source.js';
5
+ import { goChildEnv } from '../runtime/go-env.js';
6
+ import { goBuildEnv } from '../build-spk/dsm-arch.js';
7
+ import { identityGatewayConfig, gatewayEntryPolicyDigest } from './identity-gateway.js';
8
+ import { validateNativeArtifacts, HTTP_INVENTORY_FILE, digest } from '../ctl/native-metadata.js';
9
+ import { validateNativeRegistry } from '../ctl/native-registry.js';
10
+ import { registryFile, readRegistry, writeGenerated, registryReference, registryTools } from '../ctl/registry.js';
11
+ export function nativeSdk(m) {
12
+ if (!m.identityGateway?.sdk || !m.identityGateway.ingress)
13
+ throw Error('CTL_NATIVE_SDK_REQUIRED: native HTTP requires protected same-origin gateway ingress.');
14
+ const sdk = sdkSource(m.identityGateway.sdk);
15
+ for (const name of ['registry', 'descriptor', 'inventory']) {
16
+ const path = join(sdk.goDir, 'api/nativehttp/schema', name + '.schema.json');
17
+ if (!existsSync(path) || digest(JSON.parse(readFileSync(path, 'utf8'))) !== digest(JSON.parse(readFileSync(new URL(`../../dist/native-http-schema/${name}.schema.json`, import.meta.url), 'utf8'))))
18
+ throw Error('CTL_NATIVE_SDK_REQUIRED: use SDK after 0.51.1, containing native HTTP v3, matching this CLI.');
19
+ }
20
+ return sdk;
21
+ }
22
+ export function nativeBuildConfig(m) { return { package: { id: m.package, version: m.spkVersion, displayName: m.displayname }, aliases: m.ctl?.aliases ?? [m.package.toLowerCase()], provenance: { developedBy: m.ctl?.developedBy ?? 'unknown', generator: 'synopkgland-cli' }, backend: m.compose ? 'compose' : 'native', transport: 'native-http', gateway: JSON.parse(identityGatewayConfig(m)) }; }
23
+ export function validateNativeManifest(m) {
24
+ if (Object.keys(m.capabilities).some(name => name !== 'composeMounts') || !['binary', 'go'].includes(m.backend.kind))
25
+ throw Error('CTL_NATIVE_BACKEND_CONFLICT: metadata-only native HTTP cannot replace SDK business capabilities or bridge runtimes; keep their RPC transport.');
26
+ if (m.uninstall?.purge.exec === 'ui/cgi/api.cgi')
27
+ throw Error('CTL_NATIVE_BACKEND_CONFLICT: use a separate package uninstall executable with metadata-only native HTTP.');
28
+ nativeSdk(m);
29
+ const registry = readRegistry(registryFile(m.root, m.ctl.registry));
30
+ if (registry.version !== 3)
31
+ throw Error('CTL_NATIVE_REGISTRY_INVALID: native-http requires v3.');
32
+ const config = nativeBuildConfig(m), g = config.gateway;
33
+ if (g.access === 'public' || g.upstream_access === 'public' || g.entry === 'policy')
34
+ throw Error('CTL_NATIVE_REGISTRY_INVALID: native HTTP cannot bypass DSM entry.');
35
+ validateNativeRegistry(registry, { basePath: g.ingress_path, upstreamAuthPaths: g.upstream_auth_paths ?? [], entry: m.entry ?? 'policy' });
36
+ }
37
+ export async function generateNativeOperations(m, run, check = false) {
38
+ validateNativeManifest(m);
39
+ const sdk = nativeSdk(m), config = nativeBuildConfig(m), work = mkdtempSync(join(tmpdir(), 'synopkgland-native-metadata-'));
40
+ try {
41
+ const file = join(work, 'config.json');
42
+ writeFileSync(file, JSON.stringify(config));
43
+ const response = await run('go', ['run', './api/nativehttp/cmd/export', '-registry', registryFile(m.root, m.ctl.registry), '-config', file], { cwd: sdk.goDir, env: goChildEnv({ ...process.env, GOOS: undefined, GOARCH: undefined, GOARM: undefined, CGO_ENABLED: '0' }), capture: true });
44
+ if (response.status !== 0)
45
+ throw Error('CTL_NATIVE_EXPORT_FAILED: SDK native HTTP metadata export failed.');
46
+ let artifacts;
47
+ try {
48
+ const raw = JSON.parse(response.stdout ?? '');
49
+ artifacts = validateNativeArtifacts(raw.descriptor, raw.inventory);
50
+ }
51
+ catch {
52
+ throw Error('CTL_NATIVE_EXPORT_FAILED: invalid SDK metadata export.');
53
+ }
54
+ if (artifacts.descriptor.payload.entryPolicyDigest !== gatewayEntryPolicyDigest(config.gateway) || digest(artifacts.descriptor.payload.package) !== digest(config.package))
55
+ throw Error('CTL_NATIVE_EXPORT_FAILED: resolved metadata mismatch.');
56
+ const registry = readRegistry(registryFile(m.root, m.ctl.registry));
57
+ if (digest(registry) !== artifacts.descriptor.payload.registrySha256)
58
+ throw Error('CTL_NATIVE_REGISTRY_CHANGED: registry changed during metadata export.');
59
+ const write = (name, value) => writeGenerated(join(m.root, 'generated', name), JSON.stringify(value, null, 2) + '\n', check);
60
+ write('synopkgland-api.json', artifacts.descriptor);
61
+ write(HTTP_INVENTORY_FILE, artifacts.inventory);
62
+ write('ctl.json', { commands: artifacts.descriptor.payload.commands });
63
+ write('tools.json', { tools: registryTools(registry) });
64
+ write('routes.json', artifacts.inventory.bindings);
65
+ writeGenerated(join(m.root, 'generated', 'operations.md'), registryReference(registry), check);
66
+ return { description: artifacts.descriptor, inventory: artifacts.inventory, registry: Object.fromEntries(Object.entries(artifacts.inventory.bindings).map(([name, b]) => [name, b.permission])) };
67
+ }
68
+ finally {
69
+ rmSync(work, { recursive: true, force: true });
70
+ }
71
+ }
72
+ /** Fixed SDK metadata-only CGI; no App business routes are linked. */
73
+ export function metadataCgiSource(pkg, entry, sha256) {
74
+ return `package main
75
+ import (
76
+ "encoding/json"
77
+ "fmt"
78
+ "net/http/cgi"
79
+ "os"
80
+ "path/filepath"
81
+ "${SDK_MODULE}/api/nativehttp"
82
+ "${SDK_MODULE}/dsm"
83
+ )
84
+ func main() {
85
+ root := "/var/packages/${pkg}/target"
86
+ // Bind the packaged descriptor to the CGI build before constructing its handler.
87
+ raw, err := os.ReadFile(filepath.Join(root,"synopkgland-api.json"))
88
+ if err != nil { os.Exit(1) }
89
+ if err := check(raw); err != nil { os.Exit(1) }
90
+ auth, err := dsm.NewEntryGate(dsm.NewAuthenticator(),${JSON.stringify(entry)},${JSON.stringify(pkg)},"/var/packages/${pkg}/var")
91
+ if err != nil { os.Exit(1) }
92
+ handler, err := nativehttp.NewDescriptionHandler(auth,filepath.Join(root,"synopkgland-api.json"),filepath.Join(root,"${HTTP_INVENTORY_FILE}"))
93
+ if err != nil { os.Exit(1) }
94
+ if err = cgi.Serve(handler); err != nil { os.Exit(1) }
95
+ }
96
+ ` + `\n// The SDK's JCS hash is the build pin; raw formatting is deliberately irrelevant.
97
+ func check(raw []byte) error {
98
+ return checkDescription(raw,${JSON.stringify(sha256)})
99
+ }
100
+ `;
101
+ }
102
+ export async function buildNativeMetadataCgi(m, arch, work, run, description) {
103
+ const sdk = nativeSdk(m), source = join(work, 'native-metadata.go'), out = join(work, `native-metadata-${arch}.cgi`);
104
+ writeFileSync(source, metadataCgiSource(m.package, m.entry ?? '', description.sha256) + `\n` + checkSource);
105
+ // Build in the pinned SDK module; source is CLI-owned and uses only exported SDK APIs.
106
+ const result = await run('go', ['build', '-trimpath', '-buildvcs=false', '-ldflags', `-s -w -buildid= -X ${SDK_MODULE}/api.expectedEntryMode=${m.entry ?? ''}`, '-o', out, source], { cwd: sdk.goDir, env: goChildEnv({ ...process.env, ...goBuildEnv(arch) }) });
107
+ if (result.status !== 0 || !existsSync(out))
108
+ throw Error('CTL_NATIVE_CGI_BUILD_FAILED: SDK metadata CGI compilation failed.');
109
+ return out;
110
+ }
111
+ const checkSource = `
112
+ func checkDescription(raw []byte, expected string) error {
113
+ var d map[string]json.RawMessage
114
+ if err := json.Unmarshal(raw,&d); err != nil { return err }
115
+ delete(d,"sha256")
116
+ unsigned, err := json.Marshal(d); if err != nil { return err }
117
+ actual, err := nativehttp.Digest(unsigned); if err != nil { return err }
118
+ if actual != expected { return fmt.Errorf("packaged metadata changed") }; return nil
119
+ }
120
+ `;
@@ -1,13 +1,8 @@
1
1
  import { type Descriptor } from '../ctl/descriptor.js';
2
2
  import { type StandaloneManifest } from './manifest.js';
3
3
  import type { CommandRunner } from './build.js';
4
+ import { type NativeArtifacts } from './native-http.js';
4
5
  export declare function operationRegistry(m: StandaloneManifest): import("../ctl/registry.js").OperationRegistry;
5
6
  export declare function registryDescriptor(m: StandaloneManifest, registry?: import("../ctl/registry.js").OperationRegistry): Descriptor;
6
7
  /** Generation writes metadata only. The exporter constructs routes without running handlers. */
7
- export declare function generateOperations(m: StandaloneManifest, run: CommandRunner, check?: boolean, bridgeMethods?: string[]): Promise<{
8
- description: Descriptor;
9
- registry: {
10
- 'identity.session'?: string | undefined;
11
- 'identity.logout'?: string | undefined;
12
- };
13
- }>;
8
+ export declare function generateOperations(m: StandaloneManifest, run: CommandRunner, check?: boolean, bridgeMethods?: string[]): Promise<NativeArtifacts>;
@@ -6,6 +6,7 @@ import { makeDescriptor, validateDescriptor, flowMethods } from '../ctl/descript
6
6
  import { readApiPermissions, API_PERMISSIONS_FILE } from './api-permissions.js';
7
7
  import { sdkBackend } from './manifest.js';
8
8
  import { describeApiRoutes } from './api-description.js';
9
+ import { generateNativeOperations } from './native-http.js';
9
10
  export function operationRegistry(m) {
10
11
  if (!m.ctl?.registry)
11
12
  throw Error('CTL_REGISTRY_REQUIRED: declare ctl.registry with a synopkgland.api v2 spec.');
@@ -30,6 +31,8 @@ export function registryDescriptor(m, registry = operationRegistry(m)) {
30
31
  }
31
32
  /** Generation writes metadata only. The exporter constructs routes without running handlers. */
32
33
  export async function generateOperations(m, run, check = false, bridgeMethods) {
34
+ if (m.ctl?.transport === 'native-http')
35
+ return generateNativeOperations(m, run, check);
33
36
  const source = operationRegistry(m);
34
37
  const registry = structuredClone(source);
35
38
  if (m.backend.kind === 'binary' || m.compose)
@@ -30,6 +30,7 @@ export interface AssembleOptions {
30
30
  portalText?: PortalCatalogs;
31
31
  apiRegistry?: Record<string, string>;
32
32
  apiDescription?: import("../ctl/descriptor.js").Descriptor;
33
+ httpInventory?: import('../ctl/native-types.js').NativeInventory;
33
34
  }
34
35
  /**
35
36
  * Packs an unsigned Standalone Package SPK. DSM runs installation/lifecycle
@@ -1,3 +1,5 @@
1
+ import { validateNativeArtifacts, digest } from '../ctl/native-metadata.js';
2
+ import { gatewayEntryPolicyDigest } from './identity-gateway.js';
1
3
  import { renderMobileAssets } from './mobile.js';
2
4
  import { requireDaemonNoFileActivation } from "./daemon-nofile.js";
3
5
  import { gatewayIngressOwnershipSupported } from './gateway-ingress.js';
@@ -74,6 +76,16 @@ export class StandaloneBuildError extends Error {
74
76
  */
75
77
  export async function assembleStandaloneSpk(options) {
76
78
  const { manifest } = options;
79
+ if (manifest.ctl?.enabled && manifest.ctl.transport === 'native-http') {
80
+ if (!options.apiDescription || !options.httpInventory || !options.cgiPath)
81
+ throw new StandaloneBuildError('CTL_NATIVE_METADATA_REQUIRED', 'Native HTTP requires its descriptor, inventory and metadata CGI.');
82
+ const { descriptor, inventory } = validateNativeArtifacts(options.apiDescription, options.httpInventory);
83
+ const gateway = JSON.parse(identityGatewayConfig(manifest));
84
+ if (descriptor.payload.entryPolicyDigest !== gatewayEntryPolicyDigest(gateway) || descriptor.payload.package.id !== manifest.package || descriptor.payload.package.version !== manifest.spkVersion || inventory.basePath !== gateway.ingress_path || digest(inventory.upstreamAuthPaths) !== digest(gateway.upstream_auth_paths))
85
+ throw new StandaloneBuildError('CTL_NATIVE_METADATA_MISMATCH', 'Native metadata differs from the resolved package gateway.');
86
+ }
87
+ else if (options.apiDescription?.version === 3 || options.httpInventory)
88
+ throw new StandaloneBuildError('CTL_NATIVE_METADATA_MISMATCH', 'Native metadata requires explicit native-http transport.');
77
89
  requireDaemonNoFileActivation(manifest.daemon?.nofile);
78
90
  const staging = mkdtempSync(join(tmpdir(), "syno-standalone-spk-"));
79
91
  try {
@@ -115,6 +127,8 @@ export async function assembleStandaloneSpk(options) {
115
127
  writeUiTexts(uiRoot, appTitle(manifest), manifest.console);
116
128
  if (options.apiDescription)
117
129
  writeFile(join(staging, "package", "synopkgland-api.json"), JSON.stringify(options.apiDescription) + "\n");
130
+ if (options.httpInventory)
131
+ writeFile(join(staging, 'package', 'synopkgland-http-inventory.json'), JSON.stringify(options.httpInventory) + '\n');
118
132
  const cgiTarget = join(staging, "package", CGI_PAYLOAD_PATH);
119
133
  mkdirSync(dirname(cgiTarget), { recursive: true });
120
134
  if (options.cgiPath) {
@@ -273,7 +287,7 @@ export async function assembleStandaloneSpk(options) {
273
287
  ...(manifest.integrations ? { integrations: manifest.integrations } : {}),
274
288
  ...(manifest.lifecycleTimeouts ? { lifecycleTimeouts: manifest.lifecycleTimeouts } : {}),
275
289
  ...("timeoutSeconds" in manifest.backend && manifest.backend.timeoutSeconds ? { operationSeconds: manifest.backend.timeoutSeconds } : {}),
276
- ...(options.apiDescription ? { ctl: { hash: options.apiDescription.sha256, registry: options.apiRegistry } } : {}),
290
+ ...(options.apiDescription ? { ctl: { hash: options.apiDescription.sha256, registry: options.apiRegistry, ...(options.httpInventory ? { transport: 'native-http', inventorySha256: options.apiDescription.payload.inventorySha256, sdk: manifest.identityGateway.sdk } : {}) } } : {}),
277
291
  backend: manifest.backend.kind,
278
292
  ...(gatewayAdmissionPolicy(manifest.identityGateway, manifest.entry) ? { provider_only_oidc: gatewayAdmissionPolicy(manifest.identityGateway, manifest.entry) } : {}),
279
293
  ...(manifest.identityGateway && gatewayExternalAccess(manifest.identityGateway)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synopackageland/cli",
3
- "version": "0.49.1",
3
+ "version": "0.50.0",
4
4
  "description": "Syno Package Land Developer Kit CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "scripts": {
27
27
  "check:docs": "node --test scripts/check-doc-versions.test.mjs && node scripts/check-doc-versions.mjs",
28
- "build": "rm -rf dist && tsc",
28
+ "build": "rm -rf dist && node scripts/prepare-native-http.mjs && tsc",
29
29
  "test": "npm run build && node --import tsx --import ./test/helpers/strict-dsm-setup.ts --test --test-concurrency=${SYNOPKGLAND_GATE_JOBS:-3} test/*.test.ts test/ctl/*.test.ts",
30
30
  "test:glossary": "node --test scripts/test/glossary-drift.test.mjs",
31
31
  "test:scripts": "node --test scripts/test/gate.test.mjs scripts/test/release.test.mjs scripts/test/pack-docker.test.mjs scripts/test/npm-pack.test.mjs scripts/test/executor-bump.test.mjs scripts/test/smoke-exports.test.mjs scripts/test/parallel.test.mjs scripts/test/scaffold-matrix.test.mjs scripts/test/frontend-deps.test.mjs scripts/test/docker-gate.test.mjs scripts/test/gate-plan.test.mjs scripts/test/gates.test.mjs && python3 scripts/test/npm-publish.py",
@@ -1113,17 +1113,18 @@
1113
1113
  "build-spk/share-combobox.ts": "797cd3eea347e7fe57946f9584f725d6faef79fe9c56b690e1199ea7489fa973",
1114
1114
  "build-spk/share-validation.ts": "a51b160cea9bea096e6efb45879abbf6d0dfecf21c761dca7cd06647d44cef62",
1115
1115
  "cli.ts": "d45c74e012a6953ad17cd0135f97f3ba98b37d4ff8b2fb60ef0a894f15ce0d64",
1116
- "ctl/cli.ts": "a582aff3a048c14884b4ffae03efdb50142ca7d769feae97f0f9b0d11d66d6da",
1116
+ "ctl/cli.ts": "97d218069c6fac42f64573c68c354d7a0e549ca2900b9d8b2935c9786bc5d11d",
1117
1117
  "ctl/external.ts": "f66490ded838f934a0cf373f284418d4d02441edc8c8365066fc45b898ba81dc",
1118
- "ctl/flows.ts": "76a7b8c2e3991687e693797b7e02aae5c7e35d9a2f07220f1d223354c38e3469",
1119
- "ctl/service.ts": "c5bb01257db9f65f31db3fcd3d0b78c4a84a967cb96de43fa587934ea175826c",
1118
+ "ctl/flows.ts": "0f35d03176655bfe1d1df5d02ea36199e05973634dffcc6710112b7c8ce78b7e",
1119
+ "ctl/native-transport.ts": "83a1f8b1fd7b4470d0d34d5244d799e09bf36f528d5e46f67c337336f3f1c774",
1120
+ "ctl/service.ts": "2510f00072b202216d51dc436d4fd9d871bbf8487c2ba40723057e67be680db1",
1120
1121
  "deploy/deploy.ts": "3f593232e8e95d029f1389d16a13127baf51ef1f381211d8be2fde5c46759f1b",
1121
1122
  "deploy/identity.ts": "4822596d8b6e170f8aa4293bd877eb27bc549cb16f720b364e543d8037bd8071",
1122
1123
  "deploy/plan.ts": "1f772811ca963bdf863462a256d8e810c151e096a55a91a753bd5bf855921536",
1123
1124
  "deploy/spk-version.ts": "407a79491ffac8d00ecb9b056ab0b352e08bf6142871fa46f302fd217f98fc24",
1124
1125
  "e2e/certificates.ts": "e9801e5f4d326d31c3c281e5106f34138493e26cd7f0ad2b1dd3f6a566832389",
1125
1126
  "e2e/dsm.ts": "66c9b3f6d907a8069202c5f88f13f8051c07b099de66d3ebce5de51c6374201f",
1126
- "error-registry.ts": "ca7e717532a97d1bcd3a27018c2f036e8b19691338679f2651e49cf7e19e6e57",
1127
+ "error-registry.ts": "91f2de89bf98750a09fce54420e3a25e3527980be175ed704890a520181f1dc9",
1127
1128
  "host/catalog-install.ts": "df27409d835a901658dae7c2048c9028c2dc886e17575fe9189e88ae705c0fd2",
1128
1129
  "host/compose-project-recovery.ts": "c76efa505f8ba14f50a8705b63d0f9f8a022b70505fe6a5f5976146afae17532",
1129
1130
  "host/container-pull.ts": "d85314dd265f7609ab1fda87e23cce0fa81165baeeaf79a792d7bb6dc10338e3",
@@ -1143,16 +1144,16 @@
1143
1144
  "nas/connection.ts": "e7a2eafda8fa04203c70449ff3836795adaccb3c57bc86bc1458887e424783ad",
1144
1145
  "nas/credentials.ts": "14e539d2e6d257fcaa1ebde254ae82f1794db4122c77bdfaf22da1aed7b24843",
1145
1146
  "nas/http.ts": "00464e38218d2fe0c7185c910a4c1c796a1451996edd19aa34e5193919c57b4a",
1146
- "nas/store.ts": "b9c5c4d670afd3d63723c27c8271470e3af8a69afb9b3910297caafa747298e4",
1147
+ "nas/store.ts": "3ec3cb463ab5d0eb2a465bcbaf433285644ae40a443370605e337ed4ec0f9272",
1147
1148
  "nas/timeouts.ts": "4cc1347243b43af404a7e46603395768cb45c634b2e1c199e9f1a446f1ab45cb",
1148
1149
  "nas/transfers.ts": "e80ded3a930543fff499888dcfcf9dbc00017f34810478bd33f2fe16cc5a699d",
1149
- "nas/transport.ts": "3d6ac6d58903544d2158c518be88b186f1642ef1e7039f782b3d5d4614e540a3",
1150
+ "nas/transport.ts": "92f05f173aa7441fce27b43d2f84eef00828e3f343d543353a2f090cb091df13",
1150
1151
  "runtime/executor-scope-task.ts": "f8717a424b9f29323e4a5720eef5688db42e2caa14c70489641907c758b3a39b",
1151
1152
  "runtime/executor-tasks.ts": "017a58d65686b8e90f17c6a18ad3923b3e1c7b3b68ce6ea23db3bd0f8f066f18",
1152
1153
  "runtime/operation-budget.ts": "126a43530d9c659f2667ba10b2c7f718373f1e6a3b97374c2eaa8b75b942ce06",
1153
1154
  "runtime/sdk-timeouts.ts": "1b56ac9717d10d604b110120149e363b5bcb57218796acf98a64b6b4fba68339",
1154
1155
  "standalone/install-ports.ts": "1b317071803f127b600a5324ac7952d28db9910af25210f139bbf430a3c135ee",
1155
- "standalone/manifest.ts": "09682c938fb308df95c2da0dfac88578c54237b9fb38b98d0a950f9da4f0407b",
1156
+ "standalone/manifest.ts": "1183c92dc97520393289757ec6ba7884c94c2e0d7e44f322dace54f88b6d644d",
1156
1157
  "standalone/portal-window.ts": "bc0a16a73ff4de4acee5f5820dbad48c709a6c53d48670a98d8b23f9009650c9",
1157
1158
  "standalone/root-window.ts": "2b3f8f3dd1c77963d9485b16739a953ecedf2019939b4b5b608cd7ac61232231"
1158
1159
  },
package/skills/SKILL.md CHANGED
@@ -360,9 +360,9 @@ Schema 2 Compose 使用 `dsm-package.yaml` 的 `compose.files`、`compose.web`
360
360
  `identity_gateway`;不使用 file/targets/address_env 或手寫 upstream。
361
361
  省略 `ui.launch` 時預設 `new-page`,使用 SDK standalone launcher,不帶 Application Portal。
362
362
  Headless Compose 不產生 launcher。health 必須選實際 endpoint 與 2xx status;
363
- readiness 不跟隨 redirect,check 不會發 HTTP。Compose 不支援 ctl。
363
+ readiness 不跟隨 redirect,check 不會發 HTTP。Compose 的 legacy SDK RPC ctl 仍拒絕;原生 API 可明確選用 `ctl.transport: native-http`,需 matching SDK v3 metadata。
364
364
 
365
- For controlling installed Apps or designing task-level AI commands, read [reference/ctl.md](reference/ctl.md). Declare operations once in a synopkgland.api v2 registry with a required ai class; run `ctl generate`, `ctl generate --check` and `check`. Operation descriptions belong only in that registry; read the generated per-App reference. Import OSS APIs hidden and obtain explicit per-API opt-in grouped by area before exposing them. Use ctl host list, register/renew explicitly, discover all commands, and always name the host when agents may operate multiple NAS machines.
365
+ For controlling installed Apps or designing task-level AI commands, read [reference/ctl.md](reference/ctl.md). Declare operations once in a synopkgland.api v2 RPC registry or matching v3 native-http registry with a required ai class; run `ctl generate`, `ctl generate --check` and `check`. Operation descriptions belong only in that registry; read the generated per-App reference. Import OSS APIs hidden and obtain explicit per-API opt-in grouped by area before exposing them. Use ctl host list, register/renew explicitly, discover all commands, and always name the host when agents may operate multiple NAS machines. For native credentials, ask the human to run ctl auth in their own terminal; never request tokens in chat or invoke auth from an AI tool. Native tokens remain client-side, and DSM revocation does not revoke upstream tokens.
366
366
 
367
367
  ## Optional basic testing
368
368