@synopackageland/cli 0.14.1 → 0.15.1
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.
- package/CHANGELOG.md +20 -1
- package/README.md +33 -18
- package/dist/build-spk/generator.d.ts +3 -2
- package/dist/build-spk/generator.js +6 -846
- package/dist/build-spk/resource-worker.d.ts +2 -14
- package/dist/build-spk/resource-worker.js +3 -166
- package/dist/cli.js +208 -56
- package/dist/compose/analyze.d.ts +3 -61
- package/dist/compose/analyze.js +35 -776
- package/dist/compose/env.d.ts +5 -3
- package/dist/compose/env.js +17 -25
- package/dist/compose/runner.js +23 -6
- package/dist/contract/unsupported-types.js +1 -1
- package/dist/contract/validate.js +2 -2
- package/dist/contract/web-launch.d.ts +1 -12
- package/dist/contract/web-launch.js +10 -74
- package/dist/ctl/cli.d.ts +36 -0
- package/dist/ctl/cli.js +218 -0
- package/dist/ctl/descriptor.d.ts +81 -0
- package/dist/ctl/descriptor.js +93 -0
- package/dist/ctl/dsm-auth.d.ts +10 -0
- package/dist/ctl/dsm-auth.js +30 -0
- package/dist/ctl/errors.d.ts +17 -0
- package/dist/ctl/errors.js +32 -0
- package/dist/ctl/flows.d.ts +11 -0
- package/dist/ctl/flows.js +52 -0
- package/dist/ctl/input.d.ts +20 -0
- package/dist/ctl/input.js +128 -0
- package/dist/ctl/json.d.ts +2 -0
- package/dist/ctl/json.js +38 -0
- package/dist/ctl/redaction.d.ts +15 -0
- package/dist/ctl/redaction.js +198 -0
- package/dist/ctl/service.d.ts +38 -0
- package/dist/ctl/service.js +156 -0
- package/dist/ctl/store.d.ts +51 -0
- package/dist/ctl/store.js +93 -0
- package/dist/ctl/transfers.d.ts +14 -0
- package/dist/ctl/transfers.js +74 -0
- package/dist/ctl/transport.d.ts +11 -0
- package/dist/ctl/transport.js +79 -0
- package/dist/deploy/deploy.d.ts +4 -3
- package/dist/deploy/deploy.js +5 -210
- package/dist/deploy/plan.js +26 -7
- package/dist/dev.js +5 -4
- package/dist/e2e/dsm.d.ts +2 -2
- package/dist/e2e/dsm.js +10 -6
- package/dist/error-registry.js +1020 -834
- package/dist/host/share-permission-lookup.d.ts +1 -1
- package/dist/host/share-permission.d.ts +1 -1
- package/dist/host/share-permission.js +1 -1
- package/dist/info.js +120 -28
- package/dist/init.js +188 -64
- package/dist/inspect.js +21 -6
- package/dist/runtime/executor-digests.json +5 -5
- package/dist/skill.js +51 -9
- package/dist/standalone/api-description-inspect.d.ts +4 -0
- package/dist/standalone/api-description-inspect.js +12 -0
- package/dist/standalone/api-description.d.ts +7 -0
- package/dist/standalone/api-description.js +73 -0
- package/dist/standalone/build.d.ts +3 -0
- package/dist/standalone/build.js +140 -33
- package/dist/standalone/compose-errors.d.ts +3 -0
- package/dist/standalone/compose-errors.js +243 -0
- package/dist/standalone/compose.d.ts +97 -10
- package/dist/standalone/compose.js +306 -75
- package/dist/standalone/daemon.js +111 -29
- package/dist/standalone/dsm-window.js +39 -8
- package/dist/standalone/identity-gateway.d.ts +9 -2
- package/dist/standalone/identity-gateway.js +282 -66
- package/dist/standalone/inspect-spk.d.ts +12 -0
- package/dist/standalone/inspect-spk.js +666 -136
- package/dist/standalone/lifecycle.js +124 -42
- package/dist/standalone/manifest.d.ts +8 -1
- package/dist/standalone/manifest.js +303 -86
- package/dist/standalone/resource.js +6 -2
- package/dist/standalone/spk.d.ts +4 -1
- package/dist/standalone/spk.js +138 -39
- package/dist/template-paths.d.ts +0 -2
- package/dist/template-paths.js +0 -5
- package/dist/test-command.d.ts +1 -1
- package/dist/test-command.js +1 -1
- package/dist/validate.d.ts +3 -3
- package/dist/validate.js +32 -140
- package/package.json +5 -3
- package/schema/synopkgland-api-v1.schema.json +423 -0
- package/skills/SKILL.md +4 -2
- package/skills/reference/compose.md +349 -0
- package/skills/reference/create.md +9 -18
- package/skills/reference/ctl.md +41 -0
- package/skills/reference/deploy.md +1 -1
- package/skills/reference/files.md +5 -1
- package/skills/reference/identity-gateway.md +8 -144
- package/skills/reference/wrap.md +10 -39
- package/assets/go/daemon/fixture_linux_test.go +0 -15
- package/assets/go/daemon/fixture_other_test.go +0 -7
- package/assets/go/daemon/go.mod +0 -5
- package/assets/go/daemon/main.go +0 -636
- package/assets/go/daemon/main_test.go +0 -315
- package/assets/go/daemon/network.go +0 -107
- package/assets/go/daemon/network_test.go +0 -86
- package/assets/go/daemon/process_linux.go +0 -55
- package/assets/go/daemon/process_linux_test.go +0 -161
- package/assets/go/daemon/process_other.go +0 -14
- package/assets/go/daemon/testdata/child.go +0 -44
- package/assets/go/gateway/auth.go +0 -101
- package/assets/go/gateway/auth_test.go +0 -216
- package/assets/go/gateway/cgi.go +0 -133
- package/assets/go/gateway/cgi_test.go +0 -156
- package/assets/go/gateway/csrf.go +0 -73
- package/assets/go/gateway/csrf_test.go +0 -155
- package/assets/go/gateway/directory.go +0 -108
- package/assets/go/gateway/directory_test.go +0 -202
- package/assets/go/gateway/gateway.go +0 -412
- package/assets/go/gateway/gateway_test.go +0 -676
- package/assets/go/gateway/go.mod +0 -5
- package/assets/go/gateway/groups.go +0 -66
- package/assets/go/gateway/main.go +0 -45
- package/dist/build-spk/gateway.d.ts +0 -31
- package/dist/build-spk/gateway.js +0 -60
- package/dist/compose/privilege.d.ts +0 -14
- package/dist/compose/privilege.js +0 -102
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { type Document } from "yaml";
|
|
2
|
-
import type {
|
|
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
|
-
|
|
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[];
|