@synopackageland/cli 0.14.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 (114) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +26 -16
  3. package/dist/build-spk/generator.d.ts +3 -2
  4. package/dist/build-spk/generator.js +6 -846
  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/web-launch.d.ts +1 -12
  14. package/dist/contract/web-launch.js +10 -74
  15. package/dist/ctl/cli.d.ts +36 -0
  16. package/dist/ctl/cli.js +218 -0
  17. package/dist/ctl/descriptor.d.ts +81 -0
  18. package/dist/ctl/descriptor.js +93 -0
  19. package/dist/ctl/dsm-auth.d.ts +10 -0
  20. package/dist/ctl/dsm-auth.js +30 -0
  21. package/dist/ctl/errors.d.ts +17 -0
  22. package/dist/ctl/errors.js +32 -0
  23. package/dist/ctl/flows.d.ts +11 -0
  24. package/dist/ctl/flows.js +52 -0
  25. package/dist/ctl/input.d.ts +20 -0
  26. package/dist/ctl/input.js +128 -0
  27. package/dist/ctl/json.d.ts +2 -0
  28. package/dist/ctl/json.js +38 -0
  29. package/dist/ctl/redaction.d.ts +15 -0
  30. package/dist/ctl/redaction.js +198 -0
  31. package/dist/ctl/service.d.ts +38 -0
  32. package/dist/ctl/service.js +156 -0
  33. package/dist/ctl/store.d.ts +51 -0
  34. package/dist/ctl/store.js +93 -0
  35. package/dist/ctl/transfers.d.ts +14 -0
  36. package/dist/ctl/transfers.js +74 -0
  37. package/dist/ctl/transport.d.ts +11 -0
  38. package/dist/ctl/transport.js +79 -0
  39. package/dist/deploy/deploy.d.ts +4 -3
  40. package/dist/deploy/deploy.js +5 -210
  41. package/dist/deploy/plan.js +26 -7
  42. package/dist/dev.js +5 -4
  43. package/dist/error-registry.js +1020 -834
  44. package/dist/info.js +120 -28
  45. package/dist/init.js +188 -64
  46. package/dist/inspect.js +21 -6
  47. package/dist/runtime/executor-digests.json +1 -12
  48. package/dist/skill.js +51 -9
  49. package/dist/standalone/api-description-inspect.d.ts +4 -0
  50. package/dist/standalone/api-description-inspect.js +12 -0
  51. package/dist/standalone/api-description.d.ts +7 -0
  52. package/dist/standalone/api-description.js +73 -0
  53. package/dist/standalone/build.d.ts +3 -0
  54. package/dist/standalone/build.js +140 -33
  55. package/dist/standalone/compose-errors.d.ts +3 -0
  56. package/dist/standalone/compose-errors.js +243 -0
  57. package/dist/standalone/compose.d.ts +97 -10
  58. package/dist/standalone/compose.js +306 -75
  59. package/dist/standalone/daemon.js +111 -29
  60. package/dist/standalone/dsm-window.js +39 -8
  61. package/dist/standalone/identity-gateway.d.ts +9 -2
  62. package/dist/standalone/identity-gateway.js +282 -66
  63. package/dist/standalone/inspect-spk.d.ts +12 -0
  64. package/dist/standalone/inspect-spk.js +666 -136
  65. package/dist/standalone/lifecycle.js +124 -42
  66. package/dist/standalone/manifest.d.ts +8 -1
  67. package/dist/standalone/manifest.js +303 -86
  68. package/dist/standalone/resource.js +6 -2
  69. package/dist/standalone/spk.d.ts +4 -1
  70. package/dist/standalone/spk.js +138 -39
  71. package/dist/template-paths.d.ts +0 -2
  72. package/dist/template-paths.js +0 -5
  73. package/dist/test-command.d.ts +1 -1
  74. package/dist/test-command.js +1 -1
  75. package/dist/validate.d.ts +3 -3
  76. package/dist/validate.js +32 -140
  77. package/package.json +5 -3
  78. package/schema/synopkgland-api-v1.schema.json +423 -0
  79. package/skills/SKILL.md +3 -1
  80. package/skills/reference/compose.md +349 -0
  81. package/skills/reference/create.md +8 -17
  82. package/skills/reference/ctl.md +41 -0
  83. package/skills/reference/deploy.md +1 -1
  84. package/skills/reference/files.md +4 -0
  85. package/skills/reference/identity-gateway.md +8 -144
  86. package/skills/reference/wrap.md +10 -39
  87. package/assets/go/daemon/fixture_linux_test.go +0 -15
  88. package/assets/go/daemon/fixture_other_test.go +0 -7
  89. package/assets/go/daemon/go.mod +0 -5
  90. package/assets/go/daemon/main.go +0 -636
  91. package/assets/go/daemon/main_test.go +0 -315
  92. package/assets/go/daemon/network.go +0 -107
  93. package/assets/go/daemon/network_test.go +0 -86
  94. package/assets/go/daemon/process_linux.go +0 -55
  95. package/assets/go/daemon/process_linux_test.go +0 -161
  96. package/assets/go/daemon/process_other.go +0 -14
  97. package/assets/go/daemon/testdata/child.go +0 -44
  98. package/assets/go/gateway/auth.go +0 -101
  99. package/assets/go/gateway/auth_test.go +0 -216
  100. package/assets/go/gateway/cgi.go +0 -133
  101. package/assets/go/gateway/cgi_test.go +0 -156
  102. package/assets/go/gateway/csrf.go +0 -73
  103. package/assets/go/gateway/csrf_test.go +0 -155
  104. package/assets/go/gateway/directory.go +0 -108
  105. package/assets/go/gateway/directory_test.go +0 -202
  106. package/assets/go/gateway/gateway.go +0 -412
  107. package/assets/go/gateway/gateway_test.go +0 -676
  108. package/assets/go/gateway/go.mod +0 -5
  109. package/assets/go/gateway/groups.go +0 -66
  110. package/assets/go/gateway/main.go +0 -45
  111. package/dist/build-spk/gateway.d.ts +0 -31
  112. package/dist/build-spk/gateway.js +0 -60
  113. package/dist/compose/privilege.d.ts +0 -14
  114. 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[];