@synopackageland/cli 0.49.0 → 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.
- package/CHANGELOG.md +17 -0
- package/README.md +10 -0
- package/dist/ctl/ai-tools.d.ts +9 -1
- package/dist/ctl/ai-tools.js +4 -4
- package/dist/ctl/cli.d.ts +8 -1
- package/dist/ctl/cli.js +40 -5
- package/dist/ctl/descriptor.d.ts +15 -2
- package/dist/ctl/descriptor.js +9 -4
- package/dist/ctl/flows.js +2 -0
- package/dist/ctl/input.d.ts +5 -3
- package/dist/ctl/input.js +3 -3
- package/dist/ctl/native-auth-command.d.ts +9 -0
- package/dist/ctl/native-auth-command.js +98 -0
- package/dist/ctl/native-executor.d.ts +16 -0
- package/dist/ctl/native-executor.js +187 -0
- package/dist/ctl/native-file-types.d.ts +16 -0
- package/dist/ctl/native-file-types.js +57 -0
- package/dist/ctl/native-files.d.ts +13 -0
- package/dist/ctl/native-files.js +115 -0
- package/dist/ctl/native-metadata.d.ts +10 -0
- package/dist/ctl/native-metadata.js +50 -0
- package/dist/ctl/native-paths.d.ts +4 -0
- package/dist/ctl/native-paths.js +54 -0
- package/dist/ctl/native-protocol.d.ts +21 -0
- package/dist/ctl/native-protocol.js +150 -0
- package/dist/ctl/native-registry.d.ts +8 -0
- package/dist/ctl/native-registry.js +182 -0
- package/dist/ctl/native-schemas.d.ts +7 -0
- package/dist/ctl/native-schemas.js +25 -0
- package/dist/ctl/native-store.d.ts +61 -0
- package/dist/ctl/native-store.js +348 -0
- package/dist/ctl/native-transfers.d.ts +13 -0
- package/dist/ctl/native-transfers.js +331 -0
- package/dist/ctl/native-transport.d.ts +30 -0
- package/dist/ctl/native-transport.js +148 -0
- package/dist/ctl/native-types.d.ts +15 -0
- package/dist/ctl/native-types.js +1 -0
- package/dist/ctl/registry.d.ts +5 -4
- package/dist/ctl/registry.js +12 -1
- package/dist/ctl/service.d.ts +32 -1
- package/dist/ctl/service.js +122 -1
- package/dist/error-registry.js +15 -0
- package/dist/generated/native-http.d.ts +189 -0
- package/dist/generated/native-http.js +1 -0
- package/dist/nas/store.d.ts +3 -1
- package/dist/nas/store.js +6 -3
- package/dist/nas/transport.d.ts +1 -0
- package/dist/native-http-schema/descriptor.schema.json +242 -0
- package/dist/native-http-schema/inventory.schema.json +121 -0
- package/dist/native-http-schema/registry.schema.json +872 -0
- package/dist/native-http-schema/source.json +1 -0
- package/dist/runtime/sdk-source.d.ts +1 -1
- package/dist/runtime/sdk-source.js +1 -1
- package/dist/standalone/api-description.d.ts +2 -5
- package/dist/standalone/build.js +5 -1
- package/dist/standalone/compose-errors.js +5 -0
- package/dist/standalone/inspect-spk.js +2 -17
- package/dist/standalone/lifecycle.js +9 -2
- package/dist/standalone/manifest.d.ts +1 -0
- package/dist/standalone/manifest.js +22 -5
- package/dist/standalone/mobile.js +4 -4
- package/dist/standalone/native-http-inspect.d.ts +9 -0
- package/dist/standalone/native-http-inspect.js +43 -0
- package/dist/standalone/native-http.d.ts +31 -0
- package/dist/standalone/native-http.js +120 -0
- package/dist/standalone/operation-registry.d.ts +2 -7
- package/dist/standalone/operation-registry.js +3 -0
- package/dist/standalone/spk.d.ts +1 -0
- package/dist/standalone/spk.js +15 -1
- package/package.json +3 -3
- package/schema/dsm-api-contract.json +8 -7
- package/skills/SKILL.md +2 -2
- package/skills/reference/compose.md +21 -0
- package/skills/reference/ctl.md +198 -0
- package/skills/reference/daemon-mode.md +1 -1
- package/skills/reference/mobile.md +7 -3
- package/skills/reference/upstream-fork.md +5 -2
|
@@ -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": "
|
|
1116
|
+
"ctl/cli.ts": "97d218069c6fac42f64573c68c354d7a0e549ca2900b9d8b2935c9786bc5d11d",
|
|
1117
1117
|
"ctl/external.ts": "f66490ded838f934a0cf373f284418d4d02441edc8c8365066fc45b898ba81dc",
|
|
1118
|
-
"ctl/flows.ts": "
|
|
1119
|
-
"ctl/
|
|
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": "
|
|
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": "
|
|
1147
|
+
"nas/store.ts": "3ec3cb463ab5d0eb2a465bcbaf433285644ae40a443370605e337ed4ec0f9272",
|
|
1147
1148
|
"nas/timeouts.ts": "4cc1347243b43af404a7e46603395768cb45c634b2e1c199e9f1a446f1ab45cb",
|
|
1148
1149
|
"nas/transfers.ts": "e80ded3a930543fff499888dcfcf9dbc00017f34810478bd33f2fe16cc5a699d",
|
|
1149
|
-
"nas/transport.ts": "
|
|
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": "
|
|
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
|
|
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
|
|
|
@@ -40,6 +40,18 @@ No backend, dummy CGI, UI directory or helper payload is required. Omit `web`,
|
|
|
40
40
|
architecture-specific native payloads for token/account adapters. All lifecycle
|
|
41
41
|
scripts run as the package account; containers are managed by Container Manager.
|
|
42
42
|
|
|
43
|
+
START preflight checks Container Manager availability, share authorization and
|
|
44
|
+
package-owned runtime settings. It does not require Container Manager profiles:
|
|
45
|
+
the official STOP worker can remove them and START recreates them. Waiting for
|
|
46
|
+
those files before START would prevent the worker from running.
|
|
47
|
+
|
|
48
|
+
Headless STOP preserves local service cleanup failures and reports
|
|
49
|
+
`COMPOSE_STOP_UNCONFIRMED` for actual local teardown failure. Missing profiles
|
|
50
|
+
after STOP are normal and are not an error. Restart stops first and never
|
|
51
|
+
continues to START after a failed STOP. INSTALL and UPGRADE keep their existing
|
|
52
|
+
worker sequence. SDK and CLI hooks do not read or modify private profiles, and
|
|
53
|
+
local cleanup success does not attest that DSM later stopped actual containers.
|
|
54
|
+
|
|
43
55
|
For external access, pin both `compose.sdk` and `identity_gateway.sdk` to
|
|
44
56
|
the same release with external access support and use the gateway's
|
|
45
57
|
[`external_access` policy and DSM settings entry](identity-gateway.md#external-access).
|
|
@@ -513,3 +525,12 @@ verifies planner/lock agreement and `inspect --json` reports `compose.hostUdp`.
|
|
|
513
525
|
Rebuild with a CLI and SDK that support the declaration; older planners reject
|
|
514
526
|
it. Discovery and multicast coexistence need real LAN verification; this guard
|
|
515
527
|
is not a firewall and does not reserve ports or configure reuse.
|
|
528
|
+
|
|
529
|
+
## Native HTTP ctl
|
|
530
|
+
|
|
531
|
+
Compose Apps may explicitly declare `ctl.transport: native-http` with a matching
|
|
532
|
+
SDK v3 registry and same-origin ingress. The SDK serves DSM-protected metadata;
|
|
533
|
+
the CLI calls the existing native API with a client-held App token. Legacy
|
|
534
|
+
Compose SDK RPC ctl stays refused. Follow [native credentials](ctl.md#native-app-credentials)
|
|
535
|
+
for human enrollment, per-API exposure review, scope, lifecycle and bounded flows.
|
|
536
|
+
Do not add a gateway business dispatcher or store user credentials on the NAS.
|
package/skills/reference/ctl.md
CHANGED
|
@@ -36,6 +36,109 @@ known alias matches. `ctl list` reports pending approvals in `data.diagnostics`.
|
|
|
36
36
|
|
|
37
37
|
Use `host show nas` to inspect approvals/pins, `host revoke nas PackageID` to remove an App approval, `host logout nas` to retain registration, and `host remove nas --yes` to delete sessions, device token, approvals and cache. A failed NAS logout is reported independently from successful local removal.
|
|
38
38
|
|
|
39
|
+
## Native App credentials
|
|
40
|
+
|
|
41
|
+
Apps may opt into `ctl.transport: native-http` with a matching SDK v3 registry.
|
|
42
|
+
This transport works with Compose or native backends and the App's existing
|
|
43
|
+
same-origin ingress. Legacy Compose SDK RPC ctl stays refused. The registry is
|
|
44
|
+
the only operation source; declarations cannot supply arbitrary URLs, scripts,
|
|
45
|
+
credential headers or browser login recipes. Keep `ctl.external` separate;
|
|
46
|
+
native credentials do not extend external MCP or local file authority.
|
|
47
|
+
|
|
48
|
+
The official client still requires the approved installed package/version/hash
|
|
49
|
+
and a fresh DSM-authenticated metadata description before native execution.
|
|
50
|
+
Native business HTTP uses only the App's own token. It sends no DSM cookie,
|
|
51
|
+
SynoToken, SDK session, Origin or trusted identity headers. Resource permissions,
|
|
52
|
+
expiry and revocation belong to the upstream App. DSM logout, disabled users or
|
|
53
|
+
revoked App entry do not revoke a raw native token used by other HTTP clients.
|
|
54
|
+
An App account selected by the user is not proof that it represents the DSM user.
|
|
55
|
+
|
|
56
|
+
Have the human run this in their own terminal:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
synopkgland ctl auth --host <profile> --app <package>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
The command shows the declared credential page and UI instructions, offers to
|
|
63
|
+
open that page in a browser, hides secret input, verifies the native identity and
|
|
64
|
+
asks before saving it in the OS keychain. The SDK never logs into the App for the
|
|
65
|
+
user. For header auth, copy an existing API token from the native UI. For
|
|
66
|
+
greader-client-login, supply the native account name and existing API password;
|
|
67
|
+
the client performs the fixed ClientLogin/user-info protocol and saves only the
|
|
68
|
+
exchanged Auth token. It never saves the API password or mints, rotates or revokes
|
|
69
|
+
upstream credentials. Fixed action T is obtained only for the current mutation.
|
|
70
|
+
That fixed action-token response alone accepts text/plain or PHP's text/html;
|
|
71
|
+
it must be a UTF-8 single-line token within 4 KiB (one terminal newline is allowed),
|
|
72
|
+
without markup (`<`), embedded whitespace or additional lines. This exception
|
|
73
|
+
never relaxes ClientLogin or ordinary business-response MIME checks.
|
|
74
|
+
|
|
75
|
+
Trusted human automation can use `--secret-stdin`: one token line for header
|
|
76
|
+
auth, or one strict JSON object with only `username` and `apiPassword` for
|
|
77
|
+
greader. Input is bounded and never echoed. No token/password argv or environment
|
|
78
|
+
option exists. **AI agents must ask the user to run ctl auth. Never ask for a token
|
|
79
|
+
in chat, read a secret file or run auth on the user's behalf.** Auth/reset are not
|
|
80
|
+
AI tools. Credential acquisition is never an ordinary operation binding.
|
|
81
|
+
|
|
82
|
+
Keychain records use service `synopkgland.ctl.native`, separate from DSM sessions.
|
|
83
|
+
Keys bind the registered profile name, canonical origin, DSM username, package and
|
|
84
|
+
auth contract digest. Same-origin profiles never fall back to each other or to an
|
|
85
|
+
administrator. Descriptor/version updates retain credentials only when the auth
|
|
86
|
+
contract is unchanged. Two DSM profiles under one OS login are not a security
|
|
87
|
+
boundary; use separate OS accounts for that isolation.
|
|
88
|
+
|
|
89
|
+
When the keychain is unavailable, unlock it or explicitly choose
|
|
90
|
+
`ctl auth --app <package> --store encrypted-file`. There is no silent fallback.
|
|
91
|
+
The independent passphrase is hidden, process-local and never derived from DSM
|
|
92
|
+
credentials. The vault uses scrypt and AES-256-GCM, bounded authenticated metadata,
|
|
93
|
+
private file permissions (user-only ACL on Windows), exclusive locking and atomic
|
|
94
|
+
replacement. Wrong passphrase, tamper, symlinks or unsafe permissions refuse
|
|
95
|
+
access. Headless encrypted-file unlock is unsupported; automation requires an OS
|
|
96
|
+
secret service. Actual OS availability must be verified on the target platform.
|
|
97
|
+
Changing storage backends requires explicit `--reset` and enrollment, which
|
|
98
|
+
prevents a failed migration from leaving an unindexed old secret behind.
|
|
99
|
+
|
|
100
|
+
`ctl list` reports native auth scheme, instructions, credential URL and state.
|
|
101
|
+
`stored` means a record was enrolled, not that it is unlocked or still valid.
|
|
102
|
+
After a 401, listing shows `invalid` until a verified replacement or local reset.
|
|
103
|
+
Listing never unlocks or probes native credentials. Help, tools and dry-run work
|
|
104
|
+
without a native token. Missing/locked auth in JSON, non-TTY or AI execution gives
|
|
105
|
+
instructions without prompting. An interactive first call can enroll, then asks
|
|
106
|
+
the user to rerun the original command; it never replays the original operation.
|
|
107
|
+
A 401 shows the cause, credential URL and App instructions before offering
|
|
108
|
+
"Enter a new token now? [y/N]". Declining preserves the invalid record. FreshRSS
|
|
109
|
+
renewal asks for the native account and API password again, exchanges and verifies
|
|
110
|
+
it, and stores only the exchanged token. A 403 remains a permission error.
|
|
111
|
+
|
|
112
|
+
`ctl auth --app <package>` updates an existing record without reset, retaining its
|
|
113
|
+
storage backend unless explicitly selected. Replacement verifies first; a failed
|
|
114
|
+
verification preserves the previous record. `ctl auth --reset` only deletes the
|
|
115
|
+
current local scope; run auth again to enroll.
|
|
116
|
+
`host remove` deletes all native keychain/vault records for that profile, including
|
|
117
|
+
old auth digests. `host logout` retains them but requires restored DSM metadata
|
|
118
|
+
admission. `host revoke` retains them and blocks official use until reapproval.
|
|
119
|
+
None of these commands revoke an upstream token. Rotate it intentionally in the
|
|
120
|
+
native App when upstream revocation is wanted.
|
|
121
|
+
|
|
122
|
+
| Native result | Client behavior |
|
|
123
|
+
| --- | --- |
|
|
124
|
+
| 401 | `CTL_NATIVE_AUTH_INVALID` (2); mark invalid; offer interactive renewal; never replay the request |
|
|
125
|
+
| 403 | `CTL_NATIVE_ACCESS_DENIED` (4); preserve credential and check native permissions |
|
|
126
|
+
| 503 | `CTL_NATIVE_UNAVAILABLE` (5); check API enablement/configuration |
|
|
127
|
+
| 3xx or login HTML | Refuse; no redirect, browser fallback or cookie reuse |
|
|
128
|
+
| Lost mutation request/receipt | `CTL_NATIVE_OUTCOME_UNKNOWN` (6); inspect the App before retrying |
|
|
129
|
+
|
|
130
|
+
All native requests use the shared profile TLS policy and never automatically
|
|
131
|
+
retry. Plans respect schema writeOnly fields and contain no auth carriers. Auth
|
|
132
|
+
exchange replies are private protocol input; diagnostics never echo them or raw
|
|
133
|
+
exception bodies. Business responses preserve their declared values without
|
|
134
|
+
content redaction. JSON/NDJSON/schema/projection bounds reject invalid results.
|
|
135
|
+
Page pagination never follows `next` URLs; cursor pagination uses only the fixed
|
|
136
|
+
bounded continuation token. Bound exhaustion or repeated cursor/no progress
|
|
137
|
+
returns `incomplete:true` and explicit continuation rather than claiming a full
|
|
138
|
+
result. Pagination is not an upstream snapshot guarantee. A dry-run is a request
|
|
139
|
+
plan; it is not a native preview. Draft AI mutations require a real read-only
|
|
140
|
+
preview, and writes still require human execution with `--yes`.
|
|
141
|
+
|
|
39
142
|
Stdout defaults to JSON without a TTY. Success is {ok:true,data}; failure is {ok:false,error:{code,message,hint,allowed?}}. Multi-host output uses {ok,results:[{host,ok,data|error}]}. Follow the concrete hint and complete allowed list; do not guess another method or bypass ctl with raw HTTP. Exit codes: 2 authentication, 3 parameters/names, 4 permissions/trust, 5 App/contract, 6 network, 7 confirmation, 8 partial failure.
|
|
40
143
|
|
|
41
144
|
## Local MCP external callers
|
|
@@ -264,3 +367,98 @@ Request previews (plans, dry-run and missing-yes plans) mask schema-marked input
|
|
|
264
367
|
Prefer `<resource> <verb>`. Common verbs are `list`, `get`, `export` (often reads), `create`, `update`, `import`, `run` (often writes), and `delete` (often destructive). Pick one synonym within an App; avoid mixing show/get/status for the same task. These are recommendations only: Apps may use domain verbs such as `pause` and `resume`.
|
|
265
368
|
|
|
266
369
|
Every command must explicitly declare its required `effect`. CLI/build never infer or overwrite effect from the verb. The existing check that command effect must not be less restrictive than its bindings remains. There is no verb allowlist or new verb rejection rule.
|
|
370
|
+
|
|
371
|
+
### Native HTTP metadata and builds
|
|
372
|
+
|
|
373
|
+
Native HTTP packaging requires a matching SDK containing native HTTP v3. The
|
|
374
|
+
CLI uses the SDK's `api/nativehttp/schema` resources and build-time exporter;
|
|
375
|
+
it has no independent schema grammar. `ctl generate` writes private
|
|
376
|
+
`generated/synopkgland-api.json` and
|
|
377
|
+
`generated/synopkgland-http-inventory.json`, plus command/tool/reference output.
|
|
378
|
+
`ctl generate --check` and `check` compare every generated artifact. Build compiles
|
|
379
|
+
a metadata-only CGI with the SDK DSM authenticator and matching entry gate;
|
|
380
|
+
no Go business handlers, second listener, per-user NAS store or HTTP relay is
|
|
381
|
+
required. The CGI serves only the fixed authenticated describe request.
|
|
382
|
+
|
|
383
|
+
The registry's full operation map, including hidden specs, participates in the
|
|
384
|
+
registry hash and HTTP inventory. Hidden operations stay absent from human
|
|
385
|
+
command selection and AI tools. The inventory includes required
|
|
386
|
+
`upstreamAuthPaths`; build/inspect compare them and the existing unscoped gateway
|
|
387
|
+
entry-policy digest to the resolved gateway config. Auth scope uses the SDK's
|
|
388
|
+
`authSha256`, including basePath, the entire auth declaration and entry policy.
|
|
389
|
+
Every artifact uses the SDK's JCS rules; explicit empty optional maps survive.
|
|
390
|
+
Exact features are required; unknown features never fall back to SDK RPC.
|
|
391
|
+
|
|
392
|
+
The frozen describe wire carries the descriptor. Its SDK handler validates the
|
|
393
|
+
private inventory before serving it. The client independently validates the
|
|
394
|
+
registry/auth/descriptor hashes and binding equality, and sends native requests
|
|
395
|
+
only to the exact declared path templates and auth endpoints. Original upstream
|
|
396
|
+
prefix containment and inventory hashing are additionally checked by the SDK
|
|
397
|
+
handler and SPK inspect. Business effects are explicitly authored: POST can be a
|
|
398
|
+
read and a confirmed GET can be an action. Never infer effect from the HTTP verb.
|
|
399
|
+
|
|
400
|
+
For CLI development, set `SYNOPKGLAND_SDK_DIR` to an authorized matching SDK
|
|
401
|
+
checkout before `npm run build` and focused native tests. The build generates
|
|
402
|
+
contract types and packaged schema assets directly from that checkout. Release
|
|
403
|
+
builds must use a published matching SDK selected by
|
|
404
|
+
`SYNOPKGLAND_NATIVE_HTTP_SDK_VERSION`; development checkouts are test inputs,
|
|
405
|
+
not release pins. Keep the release dependency open until that SDK exists.
|
|
406
|
+
|
|
407
|
+
### Native HTTP local file flows (unreleased)
|
|
408
|
+
|
|
409
|
+
The human CLI installs `upload-http` and `download-file` through the authenticated
|
|
410
|
+
native transport. Both require `ai: human-only`; neither becomes an AI tool or an
|
|
411
|
+
external MCP file capability. Local `fileParam` / `outputParam` values never enter
|
|
412
|
+
the native query/body. Existing dry-run, write confirmation and fresh DSM metadata
|
|
413
|
+
admission still apply. These flows require the matching SDK v3 sources described
|
|
414
|
+
above; these changes are not included in the latest published CLI.
|
|
415
|
+
|
|
416
|
+
Multipart uploads send the declared part, optional bounded form fields and a safe
|
|
417
|
+
basename. PDF/PNG/JPEG require a matching signature and declared MIME. Raw uploads
|
|
418
|
+
accept UTF-8 OPML XML only, with a 1 MiB cap, an OPML root, and no DTD/entity
|
|
419
|
+
declarations. There is no XML entity resolver. The effective file limit is the
|
|
420
|
+
minimum of package, flow, response (downloads) and CLI hard 16 GiB limits. Form
|
|
421
|
+
fields are limited to 16 parts / 64 KiB and upload receipts to 64 KiB. Uploads
|
|
422
|
+
retain the upstream receipt/task ID; acceptance does not mean OCR completion.
|
|
423
|
+
|
|
424
|
+
Files stream with backpressure and bounded buffers. Connection/header/idle budgets
|
|
425
|
+
apply without a productive-stream total deadline. Interactive progress goes to
|
|
426
|
+
stderr; JSON stdout contains only the final receipt or error. One transfer runs
|
|
427
|
+
per process. Ctrl-C stops local IO and returns failure. An interrupted mutation
|
|
428
|
+
has `outcome_unknown`; inspect the original native task/resource before retrying.
|
|
429
|
+
There is no retry, resume, redirect following or implicit upstream cancellation.
|
|
430
|
+
|
|
431
|
+
Local sources require a no-follow regular-file descriptor and unchanged file
|
|
432
|
+
metadata through completion. Downloads use an exclusive 0600 partial on the same
|
|
433
|
+
filesystem, validate status/MIME/identity encoding, length and actual bytes, then
|
|
434
|
+
publish with an atomic no-replace hard link. Existing destinations are refused,
|
|
435
|
+
including symlinks; response filenames never choose the destination. Failed
|
|
436
|
+
transfers remove their partial. Completion returns `{bytes, sha256}` for the
|
|
437
|
+
received bytes, without claiming upstream authenticity. Filesystems without hard
|
|
438
|
+
links fail closed. A process crash can leave a hidden `.ctl-partial-*` file; it
|
|
439
|
+
never becomes the requested output automatically.
|
|
440
|
+
|
|
441
|
+
Ancestors are resolved once to the longest existing canonical directory before
|
|
442
|
+
file traversal is anchored to held descriptors. Root/current-user owned symlinks
|
|
443
|
+
are allowed only through safe directories: no group/world writes unless a public
|
|
444
|
+
directory has sticky-bit entry protection. Link targets follow the same checks.
|
|
445
|
+
Source/output leaves still refuse symlinks. Native credential state uses the same
|
|
446
|
+
ancestor policy, while the ctl and native directories themselves remain no-follow,
|
|
447
|
+
current-user owned and 0700, with the existing private-file checks retained.
|
|
448
|
+
This implementation uses Linux descriptor-relative filesystem aliases; macOS has
|
|
449
|
+
an equivalent implementation path pending platform verification. Unsupported
|
|
450
|
+
platforms, including Windows, fail closed before native IO rather than falling
|
|
451
|
+
back to unsafe path-based writes. Linux fixtures cover source changes, publication
|
|
452
|
+
races, truncated streams, disk-full, cancellation and slow sparse transfers.
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
### Empty native mutation acknowledgements (unreleased)
|
|
456
|
+
|
|
457
|
+
An explicitly authored write/destructive operation can accept an empty declared
|
|
458
|
+
204, or an empty declared 200 with Content-Length 0, without Content-Type. The
|
|
459
|
+
client verifies that the body really is empty, requires identity encoding and
|
|
460
|
+
returns `{ok: true, status}`. The receipt must satisfy the declared result schema;
|
|
461
|
+
there is no representation to project. Nonempty replies still require their
|
|
462
|
+
declared MIME and decoder. Read operations receive no such exception. This is an
|
|
463
|
+
HTTP acknowledgement, not proof of the final App state: run the App's declared
|
|
464
|
+
readback command as usual. No mutation is replayed or synthetic readback added.
|
|
@@ -41,7 +41,7 @@ cache an upper bound and measure it filled.
|
|
|
41
41
|
These numbers come from Studio Office. Use them as an example of what
|
|
42
42
|
to measure, not as a budget.
|
|
43
43
|
|
|
44
|
-
- **CGI cost per request.** On a
|
|
44
|
+
- **CGI cost per request.** On a measured NAS with 25 Apps, every Studio call
|
|
45
45
|
spent 100–140 ms before the handler did any work: process start, the DSM
|
|
46
46
|
sign-in check (`authenticate.cgi`), the App Privileges check and schema
|
|
47
47
|
checks. Recompiling App definitions on each request took about 70% of
|
|
@@ -23,8 +23,8 @@ mobile:
|
|
|
23
23
|
|
|
24
24
|
`entry: app` requires an SDK UI exporting `mount(root, ctx)` as `app.module.js`,
|
|
25
25
|
or a classic `app.js` registering `window.DsmPackageApps[packageId]`.
|
|
26
|
-
Install `@synopackageland/sdk` with its `/entry` export in the UI
|
|
27
|
-
or project root. The CLI bundles this installed SDK into `entry.js`; the NAS
|
|
26
|
+
Install the current `@synopackageland/sdk` with its `/entry` export in the UI
|
|
27
|
+
build directory or project root. The CLI bundles this installed SDK into `entry.js`; the NAS
|
|
28
28
|
never loads npm or a CDN. Plain UI Apps can install the SDK at the project root.
|
|
29
29
|
Run the normal UI build before `synopkgland check` and `synopkgland build`.
|
|
30
30
|
|
|
@@ -49,7 +49,11 @@ and bundled `entry.js` into the SPK only. The generated DSM window loads
|
|
|
49
49
|
to the same SDK context builder. One immutable content hash appears in
|
|
50
50
|
the entry build meta tag, `bootEntryPage.build`, registration, and every generated
|
|
51
51
|
entry script, stylesheet and icon URL. Module UI assets retain their immutable
|
|
52
|
-
snapshot directory.
|
|
52
|
+
snapshot directory. The generated `bootEntryPage.appBundle` is the exact URL
|
|
53
|
+
loaded by `mount`, including its build query. SDK boot preloads same-origin App
|
|
54
|
+
assets while token/identity requests run; App execution still waits for verified
|
|
55
|
+
identity. Classic bundles retain their script carrier and package dataset.
|
|
56
|
+
SDK boot owns token acquisition, non-aborting hedges, portal
|
|
53
57
|
probing, language fallback and the package-specific identity cache.
|
|
54
58
|
|
|
55
59
|
App-owned `app.status` should use SDK Go `api.AppStatusHandler`, registered via
|
|
@@ -61,7 +61,9 @@ Cover common reads and writes through existing native APIs, including the main
|
|
|
61
61
|
UI tasks; `status` and `service status` alone are incomplete. Keep upstream code
|
|
62
62
|
unchanged and run adapters as the package account. Report unsupported transports
|
|
63
63
|
or synchronous-only long operations for discussion; do not invent App features
|
|
64
|
-
or bypass the
|
|
64
|
+
or bypass the legacy Compose RPC restriction. For an existing native API, opt into
|
|
65
|
+
matching v3 native-http metadata and client-side credentials; read the native
|
|
66
|
+
credential contract in [ctl.md](ctl.md#native-app-credentials).
|
|
65
67
|
|
|
66
68
|
## Container: official image and a matching source tag
|
|
67
69
|
|
|
@@ -257,7 +259,8 @@ with both init flags, or fill `compose.web.health` before check/build. No guesse
|
|
|
257
259
|
`/` + 200. Readiness **does not follow redirects**: a 302 to a dashboard/login is
|
|
258
260
|
unhealthy even if its destination is 200. A favicon/robots probe proves HTTP
|
|
259
261
|
availability only; verify database setup and full readiness separately. `check`
|
|
260
|
-
is static, not an HTTP or UID/storage probe. Compose ctl is rejected
|
|
262
|
+
is static, not an HTTP or UID/storage probe. Legacy Compose RPC ctl is rejected;
|
|
263
|
+
native-http requires a matching v3 declaration and same-origin ingress;
|
|
261
264
|
dedicated origin `/` is supported, automatic subpath rewriting is not.
|
|
262
265
|
|
|
263
266
|
Public npm availability does not grant anonymous Go SDK access. Obtain authorised
|