@sema-agent/sdk 41.1.1 → 42.0.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/README.md +81 -1
- package/dist/bitless-surfaces.d.ts +12 -1
- package/dist/bitless-surfaces.d.ts.map +1 -1
- package/dist/bitless-surfaces.js +14 -1
- package/dist/bitless-surfaces.js.map +1 -1
- package/dist/client.d.ts +14 -11
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -5
- package/dist/client.js.map +1 -1
- package/dist/errors.d.ts +50 -8
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +56 -17
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +185 -6
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +6 -0
- package/dist/events.js.map +1 -1
- package/dist/health.d.ts +9 -2
- package/dist/health.d.ts.map +1 -1
- package/dist/health.js +15 -3
- package/dist/health.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/registry-conflict.d.ts +23 -2
- package/dist/registry-conflict.d.ts.map +1 -1
- package/dist/registry-conflict.js +37 -6
- package/dist/registry-conflict.js.map +1 -1
- package/dist/resources/adoption.d.ts +2 -4
- package/dist/resources/adoption.d.ts.map +1 -1
- package/dist/resources/adoption.js +30 -1
- package/dist/resources/adoption.js.map +1 -1
- package/dist/resources/approvals.d.ts +16 -11
- package/dist/resources/approvals.d.ts.map +1 -1
- package/dist/resources/approvals.js +19 -4
- package/dist/resources/approvals.js.map +1 -1
- package/dist/resources/assistant.d.ts +3 -5
- package/dist/resources/assistant.d.ts.map +1 -1
- package/dist/resources/assistant.js +23 -2
- package/dist/resources/assistant.js.map +1 -1
- package/dist/resources/attachments.d.ts +2 -4
- package/dist/resources/attachments.d.ts.map +1 -1
- package/dist/resources/attachments.js +27 -1
- package/dist/resources/attachments.js.map +1 -1
- package/dist/resources/control/auth-providers.d.ts +2 -4
- package/dist/resources/control/auth-providers.d.ts.map +1 -1
- package/dist/resources/control/auth-providers.js +13 -1
- package/dist/resources/control/auth-providers.js.map +1 -1
- package/dist/resources/control/config.d.ts +5 -12
- package/dist/resources/control/config.d.ts.map +1 -1
- package/dist/resources/control/config.js +13 -4
- package/dist/resources/control/config.js.map +1 -1
- package/dist/resources/control/fleet.d.ts +6 -16
- package/dist/resources/control/fleet.d.ts.map +1 -1
- package/dist/resources/control/fleet.js +13 -5
- package/dist/resources/control/fleet.js.map +1 -1
- package/dist/resources/control/images.d.ts +4 -10
- package/dist/resources/control/images.d.ts.map +1 -1
- package/dist/resources/control/images.js +14 -3
- package/dist/resources/control/images.js.map +1 -1
- package/dist/resources/control/publish.d.ts +2 -4
- package/dist/resources/control/publish.d.ts.map +1 -1
- package/dist/resources/control/publish.js +8 -1
- package/dist/resources/control/publish.js.map +1 -1
- package/dist/resources/control/secrets.d.ts +3 -6
- package/dist/resources/control/secrets.d.ts.map +1 -1
- package/dist/resources/control/secrets.js +16 -2
- package/dist/resources/control/secrets.js.map +1 -1
- package/dist/resources/control/users.d.ts +2 -4
- package/dist/resources/control/users.d.ts.map +1 -1
- package/dist/resources/control/users.js +12 -1
- package/dist/resources/control/users.js.map +1 -1
- package/dist/resources/control/versioning.d.ts +3 -6
- package/dist/resources/control/versioning.d.ts.map +1 -1
- package/dist/resources/control/versioning.js +10 -2
- package/dist/resources/control/versioning.js.map +1 -1
- package/dist/resources/control/workers.d.ts +2 -4
- package/dist/resources/control/workers.d.ts.map +1 -1
- package/dist/resources/control/workers.js +9 -1
- package/dist/resources/control/workers.js.map +1 -1
- package/dist/resources/devices.d.ts +2 -4
- package/dist/resources/devices.d.ts.map +1 -1
- package/dist/resources/devices.js +59 -1
- package/dist/resources/devices.js.map +1 -1
- package/dist/resources/fleet.d.ts +5 -4
- package/dist/resources/fleet.d.ts.map +1 -1
- package/dist/resources/fleet.js +2 -1
- package/dist/resources/fleet.js.map +1 -1
- package/dist/resources/images.d.ts +5 -12
- package/dist/resources/images.d.ts.map +1 -1
- package/dist/resources/images.js +13 -4
- package/dist/resources/images.js.map +1 -1
- package/dist/resources/leader.d.ts +3 -7
- package/dist/resources/leader.d.ts.map +1 -1
- package/dist/resources/leader.js +9 -2
- package/dist/resources/leader.js.map +1 -1
- package/dist/resources/memory.d.ts +3 -7
- package/dist/resources/memory.d.ts.map +1 -1
- package/dist/resources/memory.js +32 -4
- package/dist/resources/memory.js.map +1 -1
- package/dist/resources/models.d.ts +4 -5
- package/dist/resources/models.d.ts.map +1 -1
- package/dist/resources/models.js +13 -2
- package/dist/resources/models.js.map +1 -1
- package/dist/resources/ops.d.ts +8 -20
- package/dist/resources/ops.d.ts.map +1 -1
- package/dist/resources/ops.js +16 -7
- package/dist/resources/ops.js.map +1 -1
- package/dist/resources/policy.d.ts +2 -4
- package/dist/resources/policy.d.ts.map +1 -1
- package/dist/resources/policy.js +9 -1
- package/dist/resources/policy.js.map +1 -1
- package/dist/resources/projects.d.ts +3 -6
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +8 -2
- package/dist/resources/projects.js.map +1 -1
- package/dist/resources/rules.d.ts +2 -4
- package/dist/resources/rules.d.ts.map +1 -1
- package/dist/resources/rules.js +67 -1
- package/dist/resources/rules.js.map +1 -1
- package/dist/resources/runs.d.ts +5 -9
- package/dist/resources/runs.d.ts.map +1 -1
- package/dist/resources/runs.js +8 -4
- package/dist/resources/runs.js.map +1 -1
- package/dist/resources/session-sync.d.ts +6 -11
- package/dist/resources/session-sync.d.ts.map +1 -1
- package/dist/resources/session-sync.js +45 -4
- package/dist/resources/session-sync.js.map +1 -1
- package/dist/resources/sessions.d.ts +40 -37
- package/dist/resources/sessions.d.ts.map +1 -1
- package/dist/resources/sessions.js +45 -13
- package/dist/resources/sessions.js.map +1 -1
- package/dist/resources/tool-approvals.d.ts +25 -17
- package/dist/resources/tool-approvals.d.ts.map +1 -1
- package/dist/resources/tool-approvals.js +22 -1
- package/dist/resources/tool-approvals.js.map +1 -1
- package/dist/resources/trace.d.ts +6 -12
- package/dist/resources/trace.d.ts.map +1 -1
- package/dist/resources/trace.js +9 -5
- package/dist/resources/trace.js.map +1 -1
- package/dist/resources/usage.d.ts +9 -12
- package/dist/resources/usage.d.ts.map +1 -1
- package/dist/resources/usage.js +13 -4
- package/dist/resources/usage.js.map +1 -1
- package/dist/resources/workflows.d.ts +7 -10
- package/dist/resources/workflows.d.ts.map +1 -1
- package/dist/resources/workflows.js +13 -3
- package/dist/resources/workflows.js.map +1 -1
- package/dist/sse.d.ts +2 -0
- package/dist/sse.d.ts.map +1 -1
- package/dist/sse.js +2 -1
- package/dist/sse.js.map +1 -1
- package/dist/sync.d.ts +16 -27
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +40 -44
- package/dist/sync.js.map +1 -1
- package/dist/transport.d.ts +31 -2
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +22 -9
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +245 -28
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +14 -1
- package/dist/types.js.map +1 -1
- package/openapi.yaml +558 -55
- package/package.json +1 -1
|
@@ -8,26 +8,20 @@
|
|
|
8
8
|
* profile/bands → a concrete `ref` (repo@digest) to bind onto a worker; it builds nothing. The registry
|
|
9
9
|
* 503s when the upstream image API is unconfigured (surfaced as a ControlError) and 409s when no image
|
|
10
10
|
* satisfies the selection (ControlConflictError). */
|
|
11
|
-
import type
|
|
11
|
+
import { type ReadCallOptions, type Transport } from "../../transport.js";
|
|
12
12
|
import type { ControlImageList, ControlImageEntry, ImageListQuery, ImageSelectQuery, ImageSelectResolution } from "../../control-types.js";
|
|
13
13
|
export declare class ControlImagesResource {
|
|
14
14
|
private readonly t;
|
|
15
15
|
constructor(t: Transport);
|
|
16
16
|
/** GET /api/config/images[?status=&profile=&capability=&visibility=&latest=&limit=&cursor=] → a page of image
|
|
17
17
|
* rows. Only the documented list params are forwarded; `nextCursor` (when present) feeds the next call. editor+. */
|
|
18
|
-
list(query?: ImageListQuery, opts?:
|
|
19
|
-
signal?: AbortSignal;
|
|
20
|
-
}): Promise<ControlImageList>;
|
|
18
|
+
list(query?: ImageListQuery, opts?: ReadCallOptions): Promise<ControlImageList>;
|
|
21
19
|
/** GET /api/config/images/:profile → the latest published entry for a profile (404 → ControlNotFoundError).
|
|
22
20
|
* The registry unwraps the upstream `{ image }` envelope; this returns the bare entry. editor+. */
|
|
23
|
-
get(profile: string, opts?:
|
|
24
|
-
signal?: AbortSignal;
|
|
25
|
-
}): Promise<ControlImageEntry>;
|
|
21
|
+
get(profile: string, opts?: ReadCallOptions): Promise<ControlImageEntry>;
|
|
26
22
|
/** GET /api/config/images/digests/:digest → one entry by its immutable digest (`sha256:<64 hex>`; the drift
|
|
27
23
|
* lookup). 404 → ControlNotFoundError; a malformed digest → 400 ControlValidationError. editor+. */
|
|
28
|
-
byDigest(digest: string, opts?:
|
|
29
|
-
signal?: AbortSignal;
|
|
30
|
-
}): Promise<ControlImageEntry>;
|
|
24
|
+
byDigest(digest: string, opts?: ReadCallOptions): Promise<ControlImageEntry>;
|
|
31
25
|
/** POST /api/config/images/select → resolve a profile/bands to a concrete pull `ref` (repo@digest) for binding
|
|
32
26
|
* onto a worker. PURE resolution + visibility/capability admission — builds NOTHING. One of `profile`/`bands`
|
|
33
27
|
* is required. No image satisfies the selection → 409 ControlConflictError. NOT submit-class (idempotent,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../src/resources/control/images.ts"],"names":[],"mappings":"AAAA;;;;;;;;;yDASyD;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../../src/resources/control/images.ts"],"names":[],"mappings":"AAAA;;;;;;;;;yDASyD;AACzD,OAAO,EAAY,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EACV,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,gBAAgB,EAAE,qBAAqB,EAC7F,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,SAAS;IAEzC;yHACqH;IAC/G,IAAI,CAAC,KAAK,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAWrF;wGACoG;IAC9F,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAI9E;yGACqG;IAC/F,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAIlF;;;qGAGiG;IAC3F,MAAM,CAAC,IAAI,EAAE,gBAAgB,GAAG;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAIhG"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/** control.images — the shared sandbox-image pool, read + resolve. Backend: sema-registry GET
|
|
2
|
+
* /api/config/images, GET /api/config/images/:profile, GET /api/config/images/digests/:digest,
|
|
3
|
+
* POST /api/config/images/select. The registry is a BFF RELAY in front of the worker's /v1/images: it reaches
|
|
4
|
+
* the worker with its OWN server-side IMAGE_API_TOKEN (never echoed) and zod-validates every relayed row.
|
|
5
|
+
*
|
|
6
|
+
* 🔴 All four are gated by the EDITOR Bearer (the SAME registry token) — NOT the service pull token. list/get/
|
|
7
|
+
* byDigest are read-only (viewer-shaped, editor+ here). select() is a PURE resolution PREVIEW: it resolves a
|
|
8
|
+
* profile/bands → a concrete `ref` (repo@digest) to bind onto a worker; it builds nothing. The registry
|
|
9
|
+
* 503s when the upstream image API is unconfigured (surfaced as a ControlError) and 409s when no image
|
|
10
|
+
* satisfies the selection (ControlConflictError). */
|
|
11
|
+
import { readCall } from "../../transport.js";
|
|
1
12
|
export class ControlImagesResource {
|
|
2
13
|
t;
|
|
3
14
|
constructor(t) {
|
|
@@ -14,17 +25,17 @@ export class ControlImagesResource {
|
|
|
14
25
|
}
|
|
15
26
|
}
|
|
16
27
|
const qs = q.toString();
|
|
17
|
-
return this.t.request({ method: "GET", path: `/api/config/images${qs ? `?${qs}` : ""}`,
|
|
28
|
+
return this.t.request({ method: "GET", path: `/api/config/images${qs ? `?${qs}` : ""}`, ...readCall(opts) });
|
|
18
29
|
}
|
|
19
30
|
/** GET /api/config/images/:profile → the latest published entry for a profile (404 → ControlNotFoundError).
|
|
20
31
|
* The registry unwraps the upstream `{ image }` envelope; this returns the bare entry. editor+. */
|
|
21
32
|
async get(profile, opts) {
|
|
22
|
-
return this.t.request({ method: "GET", path: `/api/config/images/${encodeURIComponent(profile)}`,
|
|
33
|
+
return this.t.request({ method: "GET", path: `/api/config/images/${encodeURIComponent(profile)}`, ...readCall(opts) });
|
|
23
34
|
}
|
|
24
35
|
/** GET /api/config/images/digests/:digest → one entry by its immutable digest (`sha256:<64 hex>`; the drift
|
|
25
36
|
* lookup). 404 → ControlNotFoundError; a malformed digest → 400 ControlValidationError. editor+. */
|
|
26
37
|
async byDigest(digest, opts) {
|
|
27
|
-
return this.t.request({ method: "GET", path: `/api/config/images/digests/${encodeURIComponent(digest)}`,
|
|
38
|
+
return this.t.request({ method: "GET", path: `/api/config/images/digests/${encodeURIComponent(digest)}`, ...readCall(opts) });
|
|
28
39
|
}
|
|
29
40
|
/** POST /api/config/images/select → resolve a profile/bands to a concrete pull `ref` (repo@digest) for binding
|
|
30
41
|
* onto a worker. PURE resolution + visibility/capability admission — builds NOTHING. One of `profile`/`bands`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"images.js","sourceRoot":"","sources":["../../../src/resources/control/images.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"images.js","sourceRoot":"","sources":["../../../src/resources/control/images.ts"],"names":[],"mappings":"AAAA;;;;;;;;;yDASyD;AACzD,OAAO,EAAE,QAAQ,EAAwC,MAAM,oBAAoB,CAAC;AAKpF,MAAM,OAAO,qBAAqB;IACH;IAA7B,YAA6B,CAAY;QAAZ,MAAC,GAAD,CAAC,CAAW;IAAG,CAAC;IAE7C;yHACqH;IACrH,KAAK,CAAC,IAAI,CAAC,KAAsB,EAAE,IAAsB;QACvD,MAAM,CAAC,GAAG,IAAI,eAAe,EAAE,CAAC;QAChC,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC3C,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI;oBAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACzD,CAAC;QACH,CAAC;QACD,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/G,CAAC;IAED;wGACoG;IACpG,KAAK,CAAC,GAAG,CAAC,OAAe,EAAE,IAAsB;QAC/C,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzH,CAAC;IAED;yGACqG;IACrG,KAAK,CAAC,QAAQ,CAAC,MAAc,EAAE,IAAsB;QACnD,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,8BAA8B,kBAAkB,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChI,CAAC;IAED;;;qGAGiG;IACjG,KAAK,CAAC,MAAM,CAAC,IAAiD;QAC5D,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QACjC,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACnG,CAAC;CACF"}
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
* request()/approve()/cancel() are publisher+ (admin token ⊇ publisher); state() is viewer+. Separation of
|
|
5
5
|
* duties is enforced SERVER-SIDE: the requester may not approve their own request (403 ControlForbiddenError),
|
|
6
6
|
* and a draft that moved since the request invalidates pending approvals (409 ControlConflictError). */
|
|
7
|
-
import type
|
|
7
|
+
import { type ReadCallOptions, type Transport } from "../../transport.js";
|
|
8
8
|
import type { PublishState, PublishResult, ApprovePublishResult, CancelPublishResult } from "../../control-types.js";
|
|
9
9
|
export declare class ControlPublishResource {
|
|
10
10
|
private readonly t;
|
|
11
11
|
constructor(t: Transport);
|
|
12
12
|
/** GET /api/config/publish → gate state { published, pending, approvalsRequired }. viewer+. */
|
|
13
|
-
state(opts?:
|
|
14
|
-
signal?: AbortSignal;
|
|
15
|
-
}): Promise<PublishState>;
|
|
13
|
+
state(opts?: ReadCallOptions): Promise<PublishState>;
|
|
16
14
|
/** POST /api/config/publish {summary?} → publish immediately (approvals=0) OR open a pending request (N>0).
|
|
17
15
|
* publisher+. NOT submit-class (re-POSTing would open a duplicate request → the route 409s anyway). */
|
|
18
16
|
request(body?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/resources/control/publish.ts"],"names":[],"mappings":"AAAA;;;;;yGAKyG;AACzG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"publish.d.ts","sourceRoot":"","sources":["../../../src/resources/control/publish.ts"],"names":[],"mappings":"AAAA;;;;;yGAKyG;AACzG,OAAO,EAAY,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAErH,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,SAAS;IAEzC,+FAA+F;IACzF,KAAK,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,YAAY,CAAC;IAI1D;4GACwG;IAClG,OAAO,CAAC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC;IAKxF;qHACiH;IAC3G,OAAO,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAI7E,qGAAqG;IAC/F,MAAM,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAG5E"}
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/** control.publish — the draft→production publish gate + optional N-approver approval workflow.
|
|
2
|
+
* Backend: sema-registry POST/GET/DELETE /api/config/publish, POST /api/config/publish/approve.
|
|
3
|
+
*
|
|
4
|
+
* request()/approve()/cancel() are publisher+ (admin token ⊇ publisher); state() is viewer+. Separation of
|
|
5
|
+
* duties is enforced SERVER-SIDE: the requester may not approve their own request (403 ControlForbiddenError),
|
|
6
|
+
* and a draft that moved since the request invalidates pending approvals (409 ControlConflictError). */
|
|
7
|
+
import { readCall } from "../../transport.js";
|
|
1
8
|
export class ControlPublishResource {
|
|
2
9
|
t;
|
|
3
10
|
constructor(t) {
|
|
@@ -5,7 +12,7 @@ export class ControlPublishResource {
|
|
|
5
12
|
}
|
|
6
13
|
/** GET /api/config/publish → gate state { published, pending, approvalsRequired }. viewer+. */
|
|
7
14
|
async state(opts) {
|
|
8
|
-
return this.t.request({ method: "GET", path: "/api/config/publish",
|
|
15
|
+
return this.t.request({ method: "GET", path: "/api/config/publish", ...readCall(opts) });
|
|
9
16
|
}
|
|
10
17
|
/** POST /api/config/publish {summary?} → publish immediately (approvals=0) OR open a pending request (N>0).
|
|
11
18
|
* publisher+. NOT submit-class (re-POSTing would open a duplicate request → the route 409s anyway). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/resources/control/publish.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"publish.js","sourceRoot":"","sources":["../../../src/resources/control/publish.ts"],"names":[],"mappings":"AAAA;;;;;yGAKyG;AACzG,OAAO,EAAE,QAAQ,EAAwC,MAAM,oBAAoB,CAAC;AAGpF,MAAM,OAAO,sBAAsB;IACJ;IAA7B,YAA6B,CAAY;QAAZ,MAAC,GAAD,CAAC,CAAW;IAAG,CAAC;IAE7C,+FAA+F;IAC/F,KAAK,CAAC,KAAK,CAAC,IAAsB;QAChC,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,qBAAqB,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3F,CAAC;IAED;4GACwG;IACxG,KAAK,CAAC,OAAO,CAAC,IAAiD;QAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC;QACvC,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED;qHACiH;IACjH,KAAK,CAAC,OAAO,CAAC,IAA+B;QAC3C,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACjH,CAAC;IAED,qGAAqG;IACrG,KAAK,CAAC,MAAM,CAAC,IAA+B;QAC1C,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACjG,CAAC;CACF"}
|
|
@@ -11,16 +11,15 @@
|
|
|
11
11
|
* inventory/set/rotate/delete are publisher+ (injecting/recreating credentials). refs() is admin. A name a
|
|
12
12
|
* worker references → 409 on delete unless force (ControlConflictError); a write colliding with a DIFFERENT
|
|
13
13
|
* existing value → 409 unless overwrite. */
|
|
14
|
-
import type
|
|
14
|
+
import { type ReadCallOptions, type Transport } from "../../transport.js";
|
|
15
15
|
import type { SecretInventory, SecretWriteResult, SecretRotateResult, SecretDeleteResult, SecretRefsResult } from "../../control-types.js";
|
|
16
16
|
export declare class ControlSecretsResource {
|
|
17
17
|
private readonly t;
|
|
18
18
|
constructor(t: Transport);
|
|
19
19
|
/** GET /api/config/secrets[?orphans=true] → the env-NAMEs in the secret source (NEVER values), each tagged
|
|
20
20
|
* referenced/orphan. `orphans` returns only the unreferenced (reclaimable) ones. publisher+. */
|
|
21
|
-
inventory(opts?: {
|
|
21
|
+
inventory(opts?: ReadCallOptions & {
|
|
22
22
|
orphans?: boolean;
|
|
23
|
-
signal?: AbortSignal;
|
|
24
23
|
}): Promise<SecretInventory>;
|
|
25
24
|
/** POST /api/config/secrets {name, value} → write-through ONE secret value to the orchestrator secret source.
|
|
26
25
|
* 🔴 The `value` goes up in the body ONCE and is NEVER returned/logged (I1) — the result carries only `name`
|
|
@@ -57,8 +56,6 @@ export declare class ControlSecretsResource {
|
|
|
57
56
|
}): Promise<SecretDeleteResult>;
|
|
58
57
|
/** GET /api/config/secrets/refs → every env-NAME the effective config references, grouped by name with where
|
|
59
58
|
* it's used (audit which env vars each host/service must provide). NAMES only, never values. admin. */
|
|
60
|
-
refs(opts?:
|
|
61
|
-
signal?: AbortSignal;
|
|
62
|
-
}): Promise<SecretRefsResult>;
|
|
59
|
+
refs(opts?: ReadCallOptions): Promise<SecretRefsResult>;
|
|
63
60
|
}
|
|
64
61
|
//# sourceMappingURL=secrets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../src/resources/control/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;6CAY6C;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../../src/resources/control/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;6CAY6C;AAC7C,OAAO,EAAY,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EACV,eAAe,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAC7F,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,SAAS;IAEzC;qGACiG;IAC3F,SAAS,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,eAAe,CAAC;IAKzF;;;;;;;;;;;;;iDAa6C;IACvC,GAAG,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAOvH;;uFAEmF;IAC7E,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIxF;;2DAEuD;IACjD,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAKzG;4GACwG;IAClG,IAAI,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAG9D"}
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/** control.secrets — worker app-secret write-through + inventory + batch-rotate + reclaim. Backend: sema-registry
|
|
2
|
+
* GET/POST /api/config/secrets, DELETE /api/config/secrets/<name>, POST /api/config/secrets/<name>/rotate,
|
|
3
|
+
* GET /api/config/secrets/refs.
|
|
4
|
+
*
|
|
5
|
+
* 🔴 INVARIANT I1 (registry-enforced AND mirrored here): a secret VALUE is never persisted, returned, logged, or
|
|
6
|
+
* audited — only the NAME. There is NO value-read endpoint by design. The SDK upholds it structurally:
|
|
7
|
+
* - set() sends the value ONCE (in the request body) and the result type carries NO value field.
|
|
8
|
+
* - The value is NEVER placed in a URL/query/log; the result echoes only the name + advisory next-steps.
|
|
9
|
+
* - inventory()/rotate()/delete()/refs() touch NAMES only.
|
|
10
|
+
*
|
|
11
|
+
* inventory/set/rotate/delete are publisher+ (injecting/recreating credentials). refs() is admin. A name a
|
|
12
|
+
* worker references → 409 on delete unless force (ControlConflictError); a write colliding with a DIFFERENT
|
|
13
|
+
* existing value → 409 unless overwrite. */
|
|
14
|
+
import { readCall } from "../../transport.js";
|
|
1
15
|
export class ControlSecretsResource {
|
|
2
16
|
t;
|
|
3
17
|
constructor(t) {
|
|
@@ -7,7 +21,7 @@ export class ControlSecretsResource {
|
|
|
7
21
|
* referenced/orphan. `orphans` returns only the unreferenced (reclaimable) ones. publisher+. */
|
|
8
22
|
async inventory(opts) {
|
|
9
23
|
const qs = opts?.orphans ? "?orphans=true" : "";
|
|
10
|
-
return this.t.request({ method: "GET", path: `/api/config/secrets${qs}`,
|
|
24
|
+
return this.t.request({ method: "GET", path: `/api/config/secrets${qs}`, ...readCall(opts) });
|
|
11
25
|
}
|
|
12
26
|
/** POST /api/config/secrets {name, value} → write-through ONE secret value to the orchestrator secret source.
|
|
13
27
|
* 🔴 The `value` goes up in the body ONCE and is NEVER returned/logged (I1) — the result carries only `name`
|
|
@@ -45,7 +59,7 @@ export class ControlSecretsResource {
|
|
|
45
59
|
/** GET /api/config/secrets/refs → every env-NAME the effective config references, grouped by name with where
|
|
46
60
|
* it's used (audit which env vars each host/service must provide). NAMES only, never values. admin. */
|
|
47
61
|
async refs(opts) {
|
|
48
|
-
return this.t.request({ method: "GET", path: "/api/config/secrets/refs",
|
|
62
|
+
return this.t.request({ method: "GET", path: "/api/config/secrets/refs", ...readCall(opts) });
|
|
49
63
|
}
|
|
50
64
|
}
|
|
51
65
|
//# sourceMappingURL=secrets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../../src/resources/control/secrets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../../src/resources/control/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;6CAY6C;AAC7C,OAAO,EAAE,QAAQ,EAAwC,MAAM,oBAAoB,CAAC;AAKpF,MAAM,OAAO,sBAAsB;IACJ;IAA7B,YAA6B,CAAY;QAAZ,MAAC,GAAD,CAAC,CAAW;IAAG,CAAC;IAE7C;qGACiG;IACjG,KAAK,CAAC,SAAS,CAAC,IAA8C;QAC5D,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAAE,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;;;;;;;iDAa6C;IAC7C,KAAK,CAAC,GAAG,CAAC,IAAgF;QACxF,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;QAChD,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9C,mEAAmE;QACnE,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7G,CAAC;IAED;;uFAEmF;IACnF,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,IAA+B;QACxD,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5I,CAAC;IAED;;2DAEuD;IACvD,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,IAAgD;QACzE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,uBAAuB,kBAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAClI,CAAC;IAED;4GACwG;IACxG,KAAK,CAAC,IAAI,CAAC,IAAsB;QAC/B,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,0BAA0B,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChG,CAAC;CACF"}
|
|
@@ -8,15 +8,13 @@
|
|
|
8
8
|
* 🔴 SECRET DISCIPLINE: passwords are write-only (a NEW user needs one; omit on a role-only update — never read
|
|
9
9
|
* back; GET never returns hashes). mintToken() returns a PLAINTEXT token ONCE (the registry stores only its
|
|
10
10
|
* hash, response is no-store) — treat it like any secret: surface it to the operator once, never log/persist. */
|
|
11
|
-
import type
|
|
11
|
+
import { type ReadCallOptions, type Transport } from "../../transport.js";
|
|
12
12
|
import type { UsersResult, UserUpsertResult, ControlRole, UserTokenMintResult, UserTokenRevokeResult } from "../../control-types.js";
|
|
13
13
|
export declare class ControlUsersResource {
|
|
14
14
|
private readonly t;
|
|
15
15
|
constructor(t: Transport);
|
|
16
16
|
/** GET /api/config/users → console users (NO password hashes). admin. */
|
|
17
|
-
list(opts?:
|
|
18
|
-
signal?: AbortSignal;
|
|
19
|
-
}): Promise<UsersResult>;
|
|
17
|
+
list(opts?: ReadCallOptions): Promise<UsersResult>;
|
|
20
18
|
/** PUT /api/config/users {username, role, password?} → upsert. `password` is REQUIRED for a NEW user (≥8
|
|
21
19
|
* chars), OMIT on a role-only update (keeps the existing hash) — it is write-only, never read back. Demoting
|
|
22
20
|
* your own account → 400 ControlValidationError. admin. NOT submit-class (idempotent on username). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/resources/control/users.ts"],"names":[],"mappings":"AAAA;;;;;;;;;qHASqH;AACrH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../../src/resources/control/users.ts"],"names":[],"mappings":"AAAA;;;;;;;;;qHASqH;AACrH,OAAO,EAAY,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EACV,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,mBAAmB,EAAE,qBAAqB,EACvF,MAAM,wBAAwB,CAAC;AAEhC,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,SAAS;IAEzC,yEAAyE;IACnE,IAAI,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC;IAIxD;;2GAEuG;IACjG,MAAM,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,WAAW,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAK/H;yCACqC;IAC/B,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,EAAE,EAAE,IAAI,CAAA;KAAE,CAAC;IAItF;;;+FAG2F;IACrF,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI5F;uEACmE;IAC7D,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAGjG"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
/** control.users — console user (RBAC) management + per-user scoped API tokens. Backend: sema-registry
|
|
2
|
+
* GET/PUT/DELETE /api/config/users, POST/DELETE /api/config/users/<name>/token. admin-only.
|
|
3
|
+
*
|
|
4
|
+
* These are least-privilege credentials so an external AI/system gets a scoped token instead of the god
|
|
5
|
+
* registry admin token. The env bootstrap admin is NOT here (a recovery cred). Self-demotion / self-delete are
|
|
6
|
+
* refused server-side (400 ControlValidationError) so the last admin can't lock itself out.
|
|
7
|
+
*
|
|
8
|
+
* 🔴 SECRET DISCIPLINE: passwords are write-only (a NEW user needs one; omit on a role-only update — never read
|
|
9
|
+
* back; GET never returns hashes). mintToken() returns a PLAINTEXT token ONCE (the registry stores only its
|
|
10
|
+
* hash, response is no-store) — treat it like any secret: surface it to the operator once, never log/persist. */
|
|
11
|
+
import { readCall } from "../../transport.js";
|
|
1
12
|
export class ControlUsersResource {
|
|
2
13
|
t;
|
|
3
14
|
constructor(t) {
|
|
@@ -5,7 +16,7 @@ export class ControlUsersResource {
|
|
|
5
16
|
}
|
|
6
17
|
/** GET /api/config/users → console users (NO password hashes). admin. */
|
|
7
18
|
async list(opts) {
|
|
8
|
-
return this.t.request({ method: "GET", path: "/api/config/users",
|
|
19
|
+
return this.t.request({ method: "GET", path: "/api/config/users", ...readCall(opts) });
|
|
9
20
|
}
|
|
10
21
|
/** PUT /api/config/users {username, role, password?} → upsert. `password` is REQUIRED for a NEW user (≥8
|
|
11
22
|
* chars), OMIT on a role-only update (keeps the existing hash) — it is write-only, never read back. Demoting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/resources/control/users.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"users.js","sourceRoot":"","sources":["../../../src/resources/control/users.ts"],"names":[],"mappings":"AAAA;;;;;;;;;qHASqH;AACrH,OAAO,EAAE,QAAQ,EAAwC,MAAM,oBAAoB,CAAC;AAKpF,MAAM,OAAO,oBAAoB;IACF;IAA7B,YAA6B,CAAY;QAAZ,MAAC,GAAD,CAAC,CAAW;IAAG,CAAC;IAE7C,yEAAyE;IACzE,KAAK,CAAC,IAAI,CAAC,IAAsB;QAC/B,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;2GAEuG;IACvG,KAAK,CAAC,MAAM,CAAC,IAAsF;QACjG,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QACjC,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;yCACqC;IACrC,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,IAA+B;QAC5D,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,8BAA8B,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACxI,CAAC;IAED;;;+FAG2F;IAC3F,KAAK,CAAC,SAAS,CAAC,IAAY,EAAE,IAA+B;QAC3D,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACzI,CAAC;IAED;uEACmE;IACnE,KAAK,CAAC,WAAW,CAAC,IAAY,EAAE,IAA+B;QAC7D,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,qBAAqB,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACjI,CAAC;CACF"}
|
|
@@ -5,24 +5,21 @@
|
|
|
5
5
|
* (re-checks the historical snapshot against the CURRENT schema + cross-domain integrity + quota), appended as
|
|
6
6
|
* a NEW change (forward-only history). A stale base / concurrent edit → 409 ControlConflictError; the change's target scope
|
|
7
7
|
* deleted / re-created under the same name → 409 ControlScopeGoneError (K-17 — nothing written, do not retry). */
|
|
8
|
-
import type
|
|
8
|
+
import { type ReadCallOptions, type Transport } from "../../transport.js";
|
|
9
9
|
import type { ConfigDomain, ConfigChange, ChangeDiff, RollbackResult } from "../../control-types.js";
|
|
10
10
|
export declare class ControlVersioningResource {
|
|
11
11
|
private readonly t;
|
|
12
12
|
constructor(t: Transport);
|
|
13
13
|
/** GET /api/config/changes[?domain=&limit=] → recent ConfigChange metadata (newest-first). `limit` is capped
|
|
14
14
|
* server-side (≤500). viewer+. */
|
|
15
|
-
changes(opts?: {
|
|
15
|
+
changes(opts?: ReadCallOptions & {
|
|
16
16
|
domain?: ConfigDomain;
|
|
17
17
|
limit?: number;
|
|
18
|
-
signal?: AbortSignal;
|
|
19
18
|
}): Promise<{
|
|
20
19
|
changes: ConfigChange[];
|
|
21
20
|
}>;
|
|
22
21
|
/** GET /api/config/changes/<id>/diff → the domain payload before/after a change (404 → ControlNotFoundError). */
|
|
23
|
-
diff(changeId: string, opts?:
|
|
24
|
-
signal?: AbortSignal;
|
|
25
|
-
}): Promise<ChangeDiff>;
|
|
22
|
+
diff(changeId: string, opts?: ReadCallOptions): Promise<ChangeDiff>;
|
|
26
23
|
/** POST /api/config/rollback {changeId} → re-apply that change's snapshot as a new change. publisher+. NOT
|
|
27
24
|
* submit-class (no idempotency key — a rollback is a CAS write, surfaced 409 on a concurrent edit). A snapshot
|
|
28
25
|
* that no longer validates / would break references → 409 ControlConflictError. The change's scope no longer exists
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../../src/resources/control/versioning.ts"],"names":[],"mappings":"AAAA;;;;;;mHAMmH;AACnH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../../src/resources/control/versioning.ts"],"names":[],"mappings":"AAAA;;;;;;mHAMmH;AACnH,OAAO,EAAY,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAErG,qBAAa,yBAAyB;IACxB,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,SAAS;IAEzC;uCACmC;IAC7B,OAAO,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG;QAAE,MAAM,CAAC,EAAE,YAAY,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC;IAQvH,iHAAiH;IAC3G,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IAIzE;;;;;yEAKqE;IAC/D,QAAQ,CAAC,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,CAAC;CAI1F"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/** control.versioning — config audit trail: list changes, diff one change, rollback to a past snapshot.
|
|
2
|
+
* Backend: sema-registry GET /api/config/changes, GET /api/config/changes/<id>/diff, POST /api/config/rollback.
|
|
3
|
+
*
|
|
4
|
+
* list/diff are viewer+ (read-only, no version bump). rollback is publisher+ and is itself a validated write
|
|
5
|
+
* (re-checks the historical snapshot against the CURRENT schema + cross-domain integrity + quota), appended as
|
|
6
|
+
* a NEW change (forward-only history). A stale base / concurrent edit → 409 ControlConflictError; the change's target scope
|
|
7
|
+
* deleted / re-created under the same name → 409 ControlScopeGoneError (K-17 — nothing written, do not retry). */
|
|
8
|
+
import { readCall } from "../../transport.js";
|
|
1
9
|
export class ControlVersioningResource {
|
|
2
10
|
t;
|
|
3
11
|
constructor(t) {
|
|
@@ -12,11 +20,11 @@ export class ControlVersioningResource {
|
|
|
12
20
|
if (opts?.limit !== undefined)
|
|
13
21
|
q.set("limit", String(opts.limit));
|
|
14
22
|
const qs = q.toString();
|
|
15
|
-
return this.t.request({ method: "GET", path: `/api/config/changes${qs ? `?${qs}` : ""}`,
|
|
23
|
+
return this.t.request({ method: "GET", path: `/api/config/changes${qs ? `?${qs}` : ""}`, ...readCall(opts) });
|
|
16
24
|
}
|
|
17
25
|
/** GET /api/config/changes/<id>/diff → the domain payload before/after a change (404 → ControlNotFoundError). */
|
|
18
26
|
async diff(changeId, opts) {
|
|
19
|
-
return this.t.request({ method: "GET", path: `/api/config/changes/${encodeURIComponent(changeId)}/diff`,
|
|
27
|
+
return this.t.request({ method: "GET", path: `/api/config/changes/${encodeURIComponent(changeId)}/diff`, ...readCall(opts) });
|
|
20
28
|
}
|
|
21
29
|
/** POST /api/config/rollback {changeId} → re-apply that change's snapshot as a new change. publisher+. NOT
|
|
22
30
|
* submit-class (no idempotency key — a rollback is a CAS write, surfaced 409 on a concurrent edit). A snapshot
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioning.js","sourceRoot":"","sources":["../../../src/resources/control/versioning.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"versioning.js","sourceRoot":"","sources":["../../../src/resources/control/versioning.ts"],"names":[],"mappings":"AAAA;;;;;;mHAMmH;AACnH,OAAO,EAAE,QAAQ,EAAwC,MAAM,oBAAoB,CAAC;AAGpF,MAAM,OAAO,yBAAyB;IACP;IAA7B,YAA6B,CAAY;QAAZ,MAAC,GAAD,CAAC,CAAW;IAAG,CAAC;IAE7C;uCACmC;IACnC,KAAK,CAAC,OAAO,CAAC,IAAkE;QAC9E,MAAM,CAAC,GAAG,IAAI,eAAe,EAAE,CAAC;QAChC,IAAI,IAAI,EAAE,MAAM;YAAE,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAC/C,IAAI,IAAI,EAAE,KAAK,KAAK,SAAS;YAAE,CAAC,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QAClE,MAAM,EAAE,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC;QACxB,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,sBAAsB,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChH,CAAC;IAED,iHAAiH;IACjH,KAAK,CAAC,IAAI,CAAC,QAAgB,EAAE,IAAsB;QACjD,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,uBAAuB,kBAAkB,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAChI,CAAC;IAED;;;;;yEAKqE;IACrE,KAAK,CAAC,QAAQ,CAAC,IAAgD;QAC7D,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QACjC,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF"}
|
|
@@ -5,15 +5,13 @@
|
|
|
5
5
|
* status() is admin-readable (viewer+ via the admin path). roll()/rotate() are publisher+ (publishing /
|
|
6
6
|
* recreating production). The reconciler-only POST/DELETE on workers/status (SERVICE_PULL_TOKEN, NOT the
|
|
7
7
|
* editor Bearer) is DELIBERATELY out of scope — it's a service-token write, a different auth plane. */
|
|
8
|
-
import type
|
|
8
|
+
import { type ReadCallOptions, type Transport } from "../../transport.js";
|
|
9
9
|
import type { WorkerStatuses, RollResult, RotateResult } from "../../control-types.js";
|
|
10
10
|
export declare class ControlWorkersResource {
|
|
11
11
|
private readonly t;
|
|
12
12
|
constructor(t: Transport);
|
|
13
13
|
/** GET /api/config/workers/status → reconciler-reported worker health rows. Admin-readable (viewer+). */
|
|
14
|
-
status(opts?:
|
|
15
|
-
signal?: AbortSignal;
|
|
16
|
-
}): Promise<WorkerStatuses>;
|
|
14
|
+
status(opts?: ReadCallOptions): Promise<WorkerStatuses>;
|
|
17
15
|
/** POST /api/config/workers/roll {sha, repo?} → re-tag matching workers to <base>:<sha> and PUBLISH (full-auto
|
|
18
16
|
* CD; bypasses the human approval gate by design). publisher+. No matching worker → clean 200 no-op
|
|
19
17
|
* `{rolled:[], published:false}`. NOT submit-class (re-rolling the same sha is an idempotent no-op-publish
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workers.d.ts","sourceRoot":"","sources":["../../../src/resources/control/workers.ts"],"names":[],"mappings":"AAAA;;;;;;wGAMwG;AACxG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"workers.d.ts","sourceRoot":"","sources":["../../../src/resources/control/workers.ts"],"names":[],"mappings":"AAAA;;;;;;wGAMwG;AACxG,OAAO,EAAY,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEvF,qBAAa,sBAAsB;IACrB,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,SAAS;IAEzC,yGAAyG;IACnG,MAAM,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,CAAC;IAI7D;;;0DAGsD;IAChD,IAAI,CAAC,IAAI,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,CAAC;IAK3F;sHACkH;IAC5G,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;CAGnF"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/** control.workers — per-worker operations: read reconciler-reported health, roll the image (full-auto CD),
|
|
2
|
+
* rotate (force recreate). Backend: sema-registry GET /api/config/workers/status, POST
|
|
3
|
+
* /api/config/workers/roll, POST /api/config/workers/<name>/rotate.
|
|
4
|
+
*
|
|
5
|
+
* status() is admin-readable (viewer+ via the admin path). roll()/rotate() are publisher+ (publishing /
|
|
6
|
+
* recreating production). The reconciler-only POST/DELETE on workers/status (SERVICE_PULL_TOKEN, NOT the
|
|
7
|
+
* editor Bearer) is DELIBERATELY out of scope — it's a service-token write, a different auth plane. */
|
|
8
|
+
import { readCall } from "../../transport.js";
|
|
1
9
|
export class ControlWorkersResource {
|
|
2
10
|
t;
|
|
3
11
|
constructor(t) {
|
|
@@ -5,7 +13,7 @@ export class ControlWorkersResource {
|
|
|
5
13
|
}
|
|
6
14
|
/** GET /api/config/workers/status → reconciler-reported worker health rows. Admin-readable (viewer+). */
|
|
7
15
|
async status(opts) {
|
|
8
|
-
return this.t.request({ method: "GET", path: "/api/config/workers/status",
|
|
16
|
+
return this.t.request({ method: "GET", path: "/api/config/workers/status", ...readCall(opts) });
|
|
9
17
|
}
|
|
10
18
|
/** POST /api/config/workers/roll {sha, repo?} → re-tag matching workers to <base>:<sha> and PUBLISH (full-auto
|
|
11
19
|
* CD; bypasses the human approval gate by design). publisher+. No matching worker → clean 200 no-op
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workers.js","sourceRoot":"","sources":["../../../src/resources/control/workers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workers.js","sourceRoot":"","sources":["../../../src/resources/control/workers.ts"],"names":[],"mappings":"AAAA;;;;;;wGAMwG;AACxG,OAAO,EAAE,QAAQ,EAAwC,MAAM,oBAAoB,CAAC;AAGpF,MAAM,OAAO,sBAAsB;IACJ;IAA7B,YAA6B,CAAY;QAAZ,MAAC,GAAD,CAAC,CAAW;IAAG,CAAC;IAE7C,yGAAyG;IACzG,KAAK,CAAC,MAAM,CAAC,IAAsB;QACjC,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,4BAA4B,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;;;0DAGsD;IACtD,KAAK,CAAC,IAAI,CAAC,IAA0D;QACnE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QACjC,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAClG,CAAC;IAED;sHACkH;IAClH,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,IAA+B;QACxD,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5I,CAAC;CACF"}
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
* 按 `errorCode` 分支,**不按 status**(409 上骑着 4 个不同处置的码)。逐码处置见
|
|
56
56
|
* {@link import("../errors.js").DeviceError} 的顶注。
|
|
57
57
|
*/
|
|
58
|
-
import type
|
|
58
|
+
import { type ReadCallOptions, type Transport } from "../transport.js";
|
|
59
59
|
import type { DeviceEnrollRequest, DeviceRebindRequest, DeviceRevokeRequest, DeviceEnrollResult, DeviceEnrollToken, DeviceListResult, DeviceRebindResult, DeviceRevokeResult } from "../types.js";
|
|
60
60
|
export declare class DevicesResource {
|
|
61
61
|
private readonly t;
|
|
@@ -69,9 +69,7 @@ export declare class DevicesResource {
|
|
|
69
69
|
*
|
|
70
70
|
* 403 `auth.forbidden`(判不出调用方域)/ 501 `capability.device_lane_required`(非 device 部署)。
|
|
71
71
|
*/
|
|
72
|
-
list(opts?:
|
|
73
|
-
signal?: AbortSignal;
|
|
74
|
-
}): Promise<DeviceListResult>;
|
|
72
|
+
list(opts?: ReadCallOptions): Promise<DeviceListResult>;
|
|
75
73
|
/**
|
|
76
74
|
* POST /v1/devices/sessions/:rootSessionId/rebind — **显式**换绑(§14.3;v1 无隐式重绑)。
|
|
77
75
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../src/resources/devices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"devices.d.ts","sourceRoot":"","sources":["../../src/resources/devices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,EAAY,KAAK,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,CAAC;gBAAD,CAAC,EAAE,SAAS;IAEzC;;;;;;;;OAQG;IACG,IAAI,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAI7D;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,MAAM,CACV,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,mBAAmB,EACzB,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAC9B,OAAO,CAAC,kBAAkB,CAAC;IAS9B;;;;;;;;;;;;;;;OAeG;IACG,gBAAgB,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAInF;;;;;;;;;;;;;;;;;;;OAmBG;IACG,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIrG;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,mBAAmB,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAWzH"}
|
|
@@ -1,3 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* devices — **device 车道的管理面**(server ≥7.88.0;契约 `docs/ASSISTANT-WIRE-CONTRACT.md` §14。
|
|
3
|
+
* 形逐字取自 server `src/http/routes/devices.ts` 的 `sendJson` / `sendError` 铸造点)。
|
|
4
|
+
*
|
|
5
|
+
* `list()` → GET /v1/devices §14.1
|
|
6
|
+
* `rebind(rootSessionId, {...})` → POST /v1/devices/sessions/{id}/rebind §14.3
|
|
7
|
+
* `issueEnrollToken()` → POST /v1/devices/enroll-tokens §14.4
|
|
8
|
+
* `enroll({...})` → POST /v1/devices/enroll §14.4
|
|
9
|
+
* `revoke(deviceId, {...})` → POST /v1/devices/{deviceId}/revoke §14.5
|
|
10
|
+
*
|
|
11
|
+
* 🔴 **绑定读面 `sessionBinding(rootSessionId)`(`GET /v1/devices/sessions/{id}`,§14.2)随 sdk 30.0.0 整删**(零别名):server 7.139.0 删了这条路由(MIGRATION 7.139.0 节第 15 条;老路径答全局
|
|
12
|
+
* `404 not_found.route`),绑定成了根会话行上执行放置的一格。**换读 `client.sessions.executionPlacement(rootSessionId)`**(`GET /v1/sessions/{id}/execution-placement`):
|
|
13
|
+
* 旧体 `boundDevice.deviceId` / `boundDevice.rev` ⇒ 新体 `writer` 臂的 `device.deviceId` / `device.rev`(`rev` 仍是 {@link DevicesResource.rebind} 的 `expectedRev` 要回显的前态);`boundAt` 没有了;
|
|
14
|
+
* 「没有绑定」此前答 `404 not_found.device`,现在是 200(格不是 `writer`,或没有 `device` 键);可见性按**会话属主 ∨ explicit operator** 判,不再按设备域判。
|
|
15
|
+
* ⚠️ 代价如实:支持地板仍是 7.52.0,而 <7.139.0 的部署上读绑定的那条 GET 还在、`executionPlacement` 的路径却不存在(老 server 答 404 `not_found.route`)—— 本包在那些部署上没有读绑定的动词(零别名,不留双读):**server ≥7.139.0 换读 `GET /v1/sessions/:id/execution-placement`;仍在 <7.139.0 server 上读绑定的部署钉 sdk 29.x。**
|
|
16
|
+
*
|
|
17
|
+
* 首绑**不在这里** —— 它是提交体的顶层键 {@link import("../types.js").TaskRequest.deviceId}(§14.6):
|
|
18
|
+
* 「在我名下的设备里挑一台跑」是**提交**的属性,不是一次管理动作。v1 **无隐式重绑**,换设备是 {@link
|
|
19
|
+
* DevicesResource.rebind} 那一次显式动作(它有前态 CAS + 无活跃 run 门 + 审计行)。
|
|
20
|
+
*
|
|
21
|
+
* ── 探测:**位缺席 ≠ 位为假** ─────────────────────────────────────────────────────────────────────
|
|
22
|
+
* 先读 `capabilities().deviceExecutor`:
|
|
23
|
+
* · `false` ⇒ 本部署没有 device 车道,管理面动词一律 **501 `capability.device_lane_required`**
|
|
24
|
+
* ({@link import("../errors.js").CapabilityUnavailableError})—— **别渲入口**;
|
|
25
|
+
* · 对象且 `management === true` ⇒ 管理面动词在场(谓词与该族 501 判据逐字同源:store + hub + 准入链三件齐);
|
|
26
|
+
* · 对象但 `management` **缺席** ⇒ 对面是 **7.88.0 之前**的 server,判不出来 ⇒ 只能按 501 试探。
|
|
27
|
+
* 🔴 别把缺席读成 `false`(两者处置不同),也别把 `deviceExecutor` 是对象读成「管理面一定在」——
|
|
28
|
+
* 那一位问的是**设备侧**接入面(executor 连不连得上),本位问的是**壳侧**管理动词。
|
|
29
|
+
*
|
|
30
|
+
* ── 鉴权与调用方域(管理面动词同一口径)────────────────────────────────────────────────────────────────
|
|
31
|
+
* owner 域 = **验证过的** `(tenant, subject)` 复合身份:subject 取 verified principal 链,tenant 取
|
|
32
|
+
* registry auth-bridge JWT 的 `scope` claim(签名真源,**恒不取自自报头**)。缺 tenant claim 且非 explicit
|
|
33
|
+
* operator ⇒ **403 `auth.forbidden`**(响亮拒,不给静默空视图)。
|
|
34
|
+
* 🔴 **签发口没有 operator 豁免**:它只为调用方**自己**签(体里没有 `target` 键),所以一个没有 tenant
|
|
35
|
+
* claim 的 operator 在那一口与任何无域凭据同答 403 —— 静默签给 operator 自己会把一个没人授权过的复合
|
|
36
|
+
* 身份写进 devices 行的 owner。
|
|
37
|
+
*
|
|
38
|
+
* ── 反枚举:404 是**一种**答案 ─────────────────────────────────────────────────────────────────────
|
|
39
|
+
* 🔴 `not_found.device`({@link import("../errors.js").NotFoundError})**五臂同码同串**:绑定不在 /
|
|
40
|
+
* 绑定不是你的 / 目标设备不在 / 不是绑定域的 / 已吊销。换绑上读作「这条路不通,材料从 `client.sessions.executionPlacement` 重取」。**别按文案分岔,也别据此推断存在性。**
|
|
41
|
+
*
|
|
42
|
+
* ── 重试姿态:四个 POST 都是 **AT-MOST-ONCE**(亲读 `transport.ts` 的 `canRetry`)────────────────────
|
|
43
|
+
* `canRetry = GET || (submit && idempotencyKey !== null)`,而本族四个写动词都**不是** submit-class、也不挂
|
|
44
|
+
* 幂等键 ⇒ SDK **一次都不重试**(读动词 `list` 是 GET,照常重试)。这不是遗漏,是各口的语义各自要求的:
|
|
45
|
+
* · `rebind` 是**前态 CAS** —— 一次「成功了但响应丢了」的自动重试会拿到 409 `device.rebind_rev_conflict`,
|
|
46
|
+
* 在壳上与「别人刚把绑定挪走了」**完全同形**。让调用方自己决定(正解 = 回读 `client.sessions.executionPlacement`
|
|
47
|
+
* 看落在哪,而不是重发);
|
|
48
|
+
* · `enroll` 本身幂等(同 token + 同 pubkey 同 200),重试**安全**,但那是调用方的判断,不是 SDK 替它
|
|
49
|
+
* 默认打开 —— 它也过限速;
|
|
50
|
+
* · `issueEnrollToken` 重试会**多签一枚** token(无害但烧限速额,且多一份明文要收好);
|
|
51
|
+
* · `revoke` 幂等(二次仍 200,不写第二条审计行),重试安全。
|
|
52
|
+
* 要自动重试的调用方自己包一层,并按上面逐口的判据决定重发还是回读。
|
|
53
|
+
*
|
|
54
|
+
* ── typed 错误(`device.*` 前缀族 → {@link import("../errors.js").DeviceError})──────────────────────
|
|
55
|
+
* 按 `errorCode` 分支,**不按 status**(409 上骑着 4 个不同处置的码)。逐码处置见
|
|
56
|
+
* {@link import("../errors.js").DeviceError} 的顶注。
|
|
57
|
+
*/
|
|
58
|
+
import { readCall } from "../transport.js";
|
|
1
59
|
export class DevicesResource {
|
|
2
60
|
t;
|
|
3
61
|
constructor(t) {
|
|
@@ -13,7 +71,7 @@ export class DevicesResource {
|
|
|
13
71
|
* 403 `auth.forbidden`(判不出调用方域)/ 501 `capability.device_lane_required`(非 device 部署)。
|
|
14
72
|
*/
|
|
15
73
|
async list(opts) {
|
|
16
|
-
return this.t.request({ method: "GET", path: "/v1/devices",
|
|
74
|
+
return this.t.request({ method: "GET", path: "/v1/devices", ...readCall(opts) });
|
|
17
75
|
}
|
|
18
76
|
/**
|
|
19
77
|
* POST /v1/devices/sessions/:rootSessionId/rebind — **显式**换绑(§14.3;v1 无隐式重绑)。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devices.js","sourceRoot":"","sources":["../../src/resources/devices.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"devices.js","sourceRoot":"","sources":["../../src/resources/devices.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,EAAE,QAAQ,EAAwC,MAAM,iBAAiB,CAAC;AAYjF,MAAM,OAAO,eAAe;IACG;IAA7B,YAA6B,CAAY;QAAZ,MAAC,GAAD,CAAC,CAAW;IAAG,CAAC;IAE7C;;;;;;;;OAQG;IACH,KAAK,CAAC,IAAI,CAAC,IAAsB;QAC/B,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAmB,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACH,KAAK,CAAC,MAAM,CACV,aAAqB,EACrB,IAAyB,EACzB,IAA+B;QAE/B,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAqB;YACxC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,wBAAwB,kBAAkB,CAAC,aAAa,CAAC,SAAS;YACxE,IAAI;YACJ,MAAM,EAAE,IAAI,EAAE,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,KAAK,CAAC,gBAAgB,CAAC,IAA+B;QACpD,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAoB,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACxH,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,KAAK,CAAC,MAAM,CAAC,IAAyB,EAAE,IAA+B;QACrE,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IACxH,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,IAA0B,EAAE,IAA+B;QACxF,OAAO,IAAI,CAAC,CAAC,CAAC,OAAO,CAAqB;YACxC,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,eAAe,kBAAkB,CAAC,QAAQ,CAAC,SAAS;YAC1D,0EAA0E;YAC1E,oEAAoE;YACpE,2CAA2C;YAC3C,IAAI,EAAE,IAAI,IAAI,EAAE;YAChB,MAAM,EAAE,IAAI,EAAE,MAAM;SACrB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReadCallOptions, type Transport } from "../transport.js";
|
|
2
2
|
/** The fleet vocabulary the shell renders (MF-Fleet `FleetTask.status`, byte-aligned to service `FleetTaskStatus`
|
|
3
3
|
* fleet-bus.ts:27-36). The service maps its run/workflow status onto this NEUTRAL set:
|
|
4
4
|
* `awaiting approval` = a needs-review / plan-approval park, `waiting` = a durable suspend. CLOSED on the wire,
|
|
@@ -22,6 +22,9 @@ export interface FleetTaskRow {
|
|
|
22
22
|
* teammate 的实例名。**值由 core/service 在 fleet 行发**(今天可能缺,缺则 consumer fallback 到 `name`)。additive/tolerate-absent。 */
|
|
23
23
|
agentType?: string;
|
|
24
24
|
agentName?: string;
|
|
25
|
+
/** server ≥7.148.0(契约附录 H.3c):这一行**跑在哪个模型上**(模型名串;server 出行前过展示洗涤 `scrub`,与 `description` / `agentType` 同一信任边界 —— 对展示用的自由文本一视同仁)。🔴 **缺席 = 不知道**(老 server / 这一行没有可说的模型),不是「默认模型」;
|
|
26
|
+
* 类型包 40.0.0 / 41.1.x 漏声明本位(server 一直在发):客户端此前要自带一行过渡补位,42.0.0 起删它读本位。ADDITIVE / tolerate-absent。 */
|
|
27
|
+
model?: string;
|
|
25
28
|
/** Subagent nesting — the RESOLVED parent ROW id(行链接域;悬空不发);top-level when absent。 */
|
|
26
29
|
parentId?: string;
|
|
27
30
|
/** [1832] P1-2(server ≥1.290 / engine 1.432,「出生就在场」语义):发起本子代的父 tool_use id
|
|
@@ -458,9 +461,7 @@ export declare class FleetResource {
|
|
|
458
461
|
* 🔴 **反枚举**:别的租户的行**在名册里根本不存在**(不是 403,也不是「空 200 但 total 多 1」)—— 没有「存在但不属于你」的可判别面;`total` 同是属主口径。
|
|
459
462
|
* 拒臂落既有错误类:没有 durable 后台 agent 店的部署 ⇒ 501 `capability.background_agent_store_required`(`CapabilityUnavailableError`;先读 `capabilities.agentRoster`);坏查询 ⇒ 400 `request.query_invalid`(`BadRequestError`);无身份 ⇒ 401。
|
|
460
463
|
*/
|
|
461
|
-
agentRoster(params?: AgentRosterParams, opts?:
|
|
462
|
-
signal?: AbortSignal;
|
|
463
|
-
}): Promise<AgentRosterPage>;
|
|
464
|
+
agentRoster(params?: AgentRosterParams, opts?: ReadCallOptions): Promise<AgentRosterPage>;
|
|
464
465
|
/**
|
|
465
466
|
* GET /v1/fleet/stream — the LIVE fleet (active task + workflow rows). SSE; the SDK PRODUCES frames, the
|
|
466
467
|
* consumer maintains the active-set state (update-in-place / remove by `id`).
|