@synopackageland/cli 0.13.1 → 0.15.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 (119) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +44 -1
  3. package/dist/build-spk/generator.d.ts +3 -2
  4. package/dist/build-spk/generator.js +6 -850
  5. package/dist/build-spk/resource-worker.d.ts +2 -14
  6. package/dist/build-spk/resource-worker.js +3 -166
  7. package/dist/cli.js +208 -56
  8. package/dist/compose/analyze.d.ts +3 -61
  9. package/dist/compose/analyze.js +35 -776
  10. package/dist/compose/env.d.ts +5 -3
  11. package/dist/compose/env.js +17 -25
  12. package/dist/compose/runner.js +23 -6
  13. package/dist/contract/app-launch.d.ts +11 -0
  14. package/dist/contract/app-launch.js +18 -0
  15. package/dist/contract/web-launch.d.ts +3 -13
  16. package/dist/contract/web-launch.js +14 -81
  17. package/dist/ctl/cli.d.ts +36 -0
  18. package/dist/ctl/cli.js +218 -0
  19. package/dist/ctl/descriptor.d.ts +81 -0
  20. package/dist/ctl/descriptor.js +93 -0
  21. package/dist/ctl/dsm-auth.d.ts +10 -0
  22. package/dist/ctl/dsm-auth.js +30 -0
  23. package/dist/ctl/errors.d.ts +17 -0
  24. package/dist/ctl/errors.js +32 -0
  25. package/dist/ctl/flows.d.ts +11 -0
  26. package/dist/ctl/flows.js +52 -0
  27. package/dist/ctl/input.d.ts +20 -0
  28. package/dist/ctl/input.js +128 -0
  29. package/dist/ctl/json.d.ts +2 -0
  30. package/dist/ctl/json.js +38 -0
  31. package/dist/ctl/redaction.d.ts +15 -0
  32. package/dist/ctl/redaction.js +198 -0
  33. package/dist/ctl/service.d.ts +38 -0
  34. package/dist/ctl/service.js +156 -0
  35. package/dist/ctl/store.d.ts +51 -0
  36. package/dist/ctl/store.js +93 -0
  37. package/dist/ctl/transfers.d.ts +14 -0
  38. package/dist/ctl/transfers.js +74 -0
  39. package/dist/ctl/transport.d.ts +11 -0
  40. package/dist/ctl/transport.js +79 -0
  41. package/dist/deploy/deploy.d.ts +4 -3
  42. package/dist/deploy/deploy.js +5 -210
  43. package/dist/deploy/plan.js +26 -7
  44. package/dist/dev.js +5 -4
  45. package/dist/error-registry.js +1020 -831
  46. package/dist/info.js +120 -28
  47. package/dist/init.js +188 -64
  48. package/dist/inspect.js +21 -6
  49. package/dist/runtime/executor-digests.json +1 -12
  50. package/dist/skill.js +51 -9
  51. package/dist/standalone/api-description-inspect.d.ts +4 -0
  52. package/dist/standalone/api-description-inspect.js +12 -0
  53. package/dist/standalone/api-description.d.ts +7 -0
  54. package/dist/standalone/api-description.js +73 -0
  55. package/dist/standalone/build.d.ts +3 -0
  56. package/dist/standalone/build.js +140 -33
  57. package/dist/standalone/compose-errors.d.ts +3 -0
  58. package/dist/standalone/compose-errors.js +243 -0
  59. package/dist/standalone/compose.d.ts +97 -10
  60. package/dist/standalone/compose.js +306 -75
  61. package/dist/standalone/daemon.js +111 -29
  62. package/dist/standalone/dsm-window.js +55 -9
  63. package/dist/standalone/identity-gateway.d.ts +9 -2
  64. package/dist/standalone/identity-gateway.js +282 -66
  65. package/dist/standalone/inspect-spk.d.ts +15 -0
  66. package/dist/standalone/inspect-spk.js +714 -128
  67. package/dist/standalone/lifecycle.js +124 -42
  68. package/dist/standalone/manifest.d.ts +10 -1
  69. package/dist/standalone/manifest.js +308 -87
  70. package/dist/standalone/resource.js +6 -2
  71. package/dist/standalone/spk.d.ts +4 -1
  72. package/dist/standalone/spk.js +139 -39
  73. package/dist/template-paths.d.ts +0 -2
  74. package/dist/template-paths.js +0 -5
  75. package/dist/test-command.d.ts +1 -1
  76. package/dist/test-command.js +1 -1
  77. package/dist/validate.d.ts +3 -3
  78. package/dist/validate.js +32 -140
  79. package/package.json +5 -3
  80. package/schema/synology-app.schema.json +1 -1
  81. package/schema/synopkgland-api-v1.schema.json +423 -0
  82. package/skills/SKILL.md +34 -1
  83. package/skills/reference/compose.md +349 -0
  84. package/skills/reference/create.md +26 -4
  85. package/skills/reference/ctl.md +41 -0
  86. package/skills/reference/deploy.md +1 -1
  87. package/skills/reference/files.md +4 -0
  88. package/skills/reference/identity-gateway.md +8 -138
  89. package/skills/reference/portal.md +31 -0
  90. package/skills/reference/ui-vue.md +31 -0
  91. package/skills/reference/wrap.md +10 -30
  92. package/assets/go/daemon/fixture_linux_test.go +0 -15
  93. package/assets/go/daemon/fixture_other_test.go +0 -7
  94. package/assets/go/daemon/go.mod +0 -5
  95. package/assets/go/daemon/main.go +0 -636
  96. package/assets/go/daemon/main_test.go +0 -315
  97. package/assets/go/daemon/network.go +0 -107
  98. package/assets/go/daemon/network_test.go +0 -86
  99. package/assets/go/daemon/process_linux.go +0 -55
  100. package/assets/go/daemon/process_linux_test.go +0 -161
  101. package/assets/go/daemon/process_other.go +0 -14
  102. package/assets/go/daemon/testdata/child.go +0 -44
  103. package/assets/go/gateway/auth.go +0 -101
  104. package/assets/go/gateway/auth_test.go +0 -216
  105. package/assets/go/gateway/cgi.go +0 -133
  106. package/assets/go/gateway/cgi_test.go +0 -156
  107. package/assets/go/gateway/csrf.go +0 -73
  108. package/assets/go/gateway/csrf_test.go +0 -155
  109. package/assets/go/gateway/directory.go +0 -108
  110. package/assets/go/gateway/directory_test.go +0 -202
  111. package/assets/go/gateway/gateway.go +0 -412
  112. package/assets/go/gateway/gateway_test.go +0 -676
  113. package/assets/go/gateway/go.mod +0 -5
  114. package/assets/go/gateway/groups.go +0 -66
  115. package/assets/go/gateway/main.go +0 -45
  116. package/dist/build-spk/gateway.d.ts +0 -31
  117. package/dist/build-spk/gateway.js +0 -60
  118. package/dist/compose/privilege.d.ts +0 -14
  119. package/dist/compose/privilege.js +0 -102
@@ -1,12 +1,12 @@
1
1
  import { type Document } from "yaml";
2
- import type { AppContract, ComposeDocument, ComposeService, ValidationError } from "../types.js";
3
- import { type PrivilegeFlag } from "./privilege.js";
2
+ import type { ComposeDocument, ComposeService } from "../types.js";
4
3
  export interface ParsedCompose {
5
4
  compose: ComposeDocument;
6
5
  source: string;
7
6
  document: Document;
8
7
  }
9
- export declare function loadCompose(composePath: string): ParsedCompose | null;
8
+ /** Raw structural utilities for tooling; SDK compose owns all runtime policy. */
9
+ export declare function loadCompose(path: string): ParsedCompose | null;
10
10
  export declare function listServiceNames(compose: ComposeDocument): string[];
11
11
  export declare function extractPublishedTcpPorts(service: ComposeService): number[];
12
12
  export interface PortExposure {
@@ -22,67 +22,9 @@ export interface PortExposure {
22
22
  /** Every way a Compose service is reachable from outside its container network. */
23
23
  export declare function listPortExposures(compose: ComposeDocument): PortExposure[];
24
24
  export declare function collectPublishedTcpPorts(compose: ComposeDocument): Map<number, string[]>;
25
- export type ResourceWorkerIneligibleReason = "HAS_INSTALL_PARAMETERS" | "HAS_COMPOSE_INTERPOLATION" | "HAS_COMPOSE_SECRETS_OR_CONFIGS" | "HAS_BUILD_STANZA" | "HAS_PRIVILEGED_CAPABILITY" | "WEB_APP_MISSING_OR_AMBIGUOUS_ADMINPORT";
26
- export interface ResourceWorkerEligibility {
27
- eligible: boolean;
28
- reasons: ResourceWorkerIneligibleReason[];
29
- headless: boolean;
30
- adminport?: number;
31
- }
32
- /**
33
- * Checks if a Compose contract and document are eligible for the zero-config DSM resource-worker path.
34
- * Zero-config slice rejects:
35
- * - any install parameter
36
- * - any ${...} interpolation anywhere in compose document
37
- * - compose secrets or configs
38
- * - build: stanzas
39
- * - privileged / host network / device / root-like capabilities
40
- * - any non-headless App without a unique literal published adminport status probe
41
- */
42
- export declare function resourceWorkerEligibility(contract: AppContract, compose: ComposeDocument): ResourceWorkerEligibility;
43
25
  export interface UnpinnedImage {
44
26
  service: string;
45
27
  image: string;
46
28
  }
47
29
  /** Service images a registry can move: anything without a trailing `@sha256:<64 hex>` digest. */
48
30
  export declare function collectUnpinnedImages(compose: ComposeDocument): UnpinnedImage[];
49
- export type ComposeRoute = "static-zero-config" | "dynamic" | "reject";
50
- export interface ComposeRouteClassification {
51
- route: ComposeRoute;
52
- eligibility: ResourceWorkerEligibility;
53
- errors: ValidationError[];
54
- }
55
- /**
56
- * Chooses the local route D0 can safely emit. The first dynamic slice is
57
- * deliberately small: only string/boolean wizard answers interpolated as
58
- * ordinary Compose values. Secrets/configs remain rejected because the live
59
- * DSM worker does not load docker-compose.override.yml, and no secret may be
60
- * placed in the project .env.
61
- */
62
- export declare function classifyComposeRoute(contract: AppContract, parsed: ParsedCompose, composeFile?: string): ComposeRouteClassification;
63
- export declare function collectComposeInterpolations(compose: ComposeDocument): Set<string>;
64
- export declare function validateComposeSecurity(compose: ComposeDocument, composeFile: string, options: {
65
- profile: "personal" | "listing";
66
- declaredPrivilege: ReadonlySet<PrivilegeFlag>;
67
- }): ValidationError[];
68
- /**
69
- * DSM's Docker Project resource worker can lose YAML quotes while acquiring a
70
- * project. A quoted numeric command argument can therefore become a number;
71
- * reject that platform-invalid shape before it reaches the NAS.
72
- */
73
- export declare function validateComposeNumericCommandArgs(compose: ComposeDocument, composeFile: string): ValidationError[];
74
- export interface HostBindContext {
75
- sharedFolderParams: ReadonlySet<string>;
76
- homesParams?: ReadonlySet<string>;
77
- posixAllSharesParams?: ReadonlySet<string>;
78
- installParamNames: ReadonlySet<string>;
79
- }
80
- export declare function collectVolumeSourceInterpolations(compose: ComposeDocument): Set<string>;
81
- export declare function validateComposeHostBinds(compose: ComposeDocument, composeFile: string, context: HostBindContext): ValidationError[];
82
- export declare function validateComposeRunAs(compose: ComposeDocument, composeFile: string, context: {
83
- hasSharedFolder: boolean;
84
- hasDsmUser?: boolean;
85
- }): ValidationError[];
86
- /** The gateway is the only door: the container's web port must not be reachable except through it. */
87
- export declare function validateGatewayPortLoopback(adminport: number, compose: ComposeDocument, composeFile: string): ValidationError[];
88
- export declare function validateAdminPortMapping(adminport: number, compose: ComposeDocument, composeFile: string): ValidationError[];