pilotswarm-sdk 0.5.13 → 0.5.15
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/api/src/api-client.js +11 -7
- package/api/src/http-api-transport.js +33 -0
- package/api/src/protocol.js +122 -94
- package/dist/client.d.ts +7 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +9 -2
- package/dist/client.js.map +1 -1
- package/dist/cms-migrations.d.ts.map +1 -1
- package/dist/cms-migrations.js +5692 -3656
- package/dist/cms-migrations.js.map +1 -1
- package/dist/cms.d.ts +225 -13
- package/dist/cms.d.ts.map +1 -1
- package/dist/cms.js +153 -17
- package/dist/cms.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/managed-session.js +2 -2
- package/dist/managed-session.js.map +1 -1
- package/dist/management-client.d.ts +109 -7
- package/dist/management-client.d.ts.map +1 -1
- package/dist/management-client.js +115 -55
- package/dist/management-client.js.map +1 -1
- package/dist/message-sender.d.ts +38 -0
- package/dist/message-sender.d.ts.map +1 -0
- package/dist/message-sender.js +63 -0
- package/dist/message-sender.js.map +1 -0
- package/dist/orchestration/index.d.ts +2 -2
- package/dist/orchestration/index.js +1 -1
- package/dist/orchestration/lifecycle.d.ts.map +1 -1
- package/dist/orchestration/lifecycle.js +8 -0
- package/dist/orchestration/lifecycle.js.map +1 -1
- package/dist/orchestration/queue.d.ts.map +1 -1
- package/dist/orchestration/queue.js +27 -8
- package/dist/orchestration/queue.js.map +1 -1
- package/dist/orchestration/runtime.d.ts +1 -1
- package/dist/orchestration/state.d.ts +7 -0
- package/dist/orchestration/state.d.ts.map +1 -1
- package/dist/orchestration/state.js +7 -0
- package/dist/orchestration/state.js.map +1 -1
- package/dist/orchestration/turn.d.ts +2 -1
- package/dist/orchestration/turn.d.ts.map +1 -1
- package/dist/orchestration/turn.js +2 -1
- package/dist/orchestration/turn.js.map +1 -1
- package/dist/orchestration/utils.d.ts +17 -0
- package/dist/orchestration/utils.d.ts.map +1 -1
- package/dist/orchestration/utils.js +90 -0
- package/dist/orchestration/utils.js.map +1 -1
- package/dist/orchestration-registry.d.ts.map +1 -1
- package/dist/orchestration-registry.js +4 -2
- package/dist/orchestration-registry.js.map +1 -1
- package/dist/orchestration-version.d.ts +1 -1
- package/dist/orchestration-version.js +1 -1
- package/dist/orchestration.d.ts +2 -2
- package/dist/orchestration.js +1 -1
- package/dist/orchestration_1_0_46.d.ts +1 -1
- package/dist/orchestration_1_0_47.d.ts +1 -1
- package/dist/orchestration_1_0_48.d.ts +1 -1
- package/dist/orchestration_1_0_49.d.ts +1 -1
- package/dist/orchestration_1_0_50.d.ts +1 -1
- package/dist/orchestration_1_0_60/agents.d.ts +41 -0
- package/dist/orchestration_1_0_60/agents.d.ts.map +1 -0
- package/dist/orchestration_1_0_60/agents.js +773 -0
- package/dist/orchestration_1_0_60/agents.js.map +1 -0
- package/dist/orchestration_1_0_60/index.d.ts +24 -0
- package/dist/orchestration_1_0_60/index.d.ts.map +1 -0
- package/dist/orchestration_1_0_60/index.js +13 -0
- package/dist/orchestration_1_0_60/index.js.map +1 -0
- package/dist/orchestration_1_0_60/lifecycle.d.ts +48 -0
- package/dist/orchestration_1_0_60/lifecycle.d.ts.map +1 -0
- package/dist/orchestration_1_0_60/lifecycle.js +557 -0
- package/dist/orchestration_1_0_60/lifecycle.js.map +1 -0
- package/dist/orchestration_1_0_60/queue.d.ts +7 -0
- package/dist/orchestration_1_0_60/queue.d.ts.map +1 -0
- package/dist/orchestration_1_0_60/queue.js +665 -0
- package/dist/orchestration_1_0_60/queue.js.map +1 -0
- package/dist/orchestration_1_0_60/runtime.d.ts +29 -0
- package/dist/orchestration_1_0_60/runtime.d.ts.map +1 -0
- package/dist/orchestration_1_0_60/runtime.js +196 -0
- package/dist/orchestration_1_0_60/runtime.js.map +1 -0
- package/dist/orchestration_1_0_60/state.d.ts +134 -0
- package/dist/orchestration_1_0_60/state.d.ts.map +1 -0
- package/dist/orchestration_1_0_60/state.js +116 -0
- package/dist/orchestration_1_0_60/state.js.map +1 -0
- package/dist/orchestration_1_0_60/turn.d.ts +32 -0
- package/dist/orchestration_1_0_60/turn.d.ts.map +1 -0
- package/dist/orchestration_1_0_60/turn.js +1154 -0
- package/dist/orchestration_1_0_60/turn.js.map +1 -0
- package/dist/orchestration_1_0_60/utils.d.ts +22 -0
- package/dist/orchestration_1_0_60/utils.d.ts.map +1 -0
- package/dist/orchestration_1_0_60/utils.js +226 -0
- package/dist/orchestration_1_0_60/utils.js.map +1 -0
- package/dist/pg-migrator.d.ts +19 -3
- package/dist/pg-migrator.d.ts.map +1 -1
- package/dist/pg-migrator.js +71 -2
- package/dist/pg-migrator.js.map +1 -1
- package/dist/session-messages.d.ts.map +1 -1
- package/dist/session-messages.js +49 -5
- package/dist/session-messages.js.map +1 -1
- package/dist/session-proxy.d.ts +1 -0
- package/dist/session-proxy.d.ts.map +1 -1
- package/dist/session-proxy.js +20 -9
- package/dist/session-proxy.js.map +1 -1
- package/dist/types.d.ts +14 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/web/web-management-client.d.ts +10 -2
- package/dist/web/web-management-client.d.ts.map +1 -1
- package/dist/web/web-management-client.js +13 -3
- package/dist/web/web-management-client.js.map +1 -1
- package/package.json +1 -1
- package/plugins/system/agents/default.agent.md +2 -2
package/api/src/api-client.js
CHANGED
|
@@ -74,7 +74,7 @@ export class ApiClient {
|
|
|
74
74
|
return headers;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
async request(method, pathWithQuery, { body, headers } = {}) {
|
|
77
|
+
async request(method, pathWithQuery, { body, headers, authProbe = false } = {}) {
|
|
78
78
|
const requestHeaders = await this.authHeaders(headers || {});
|
|
79
79
|
if (body !== undefined && !requestHeaders["content-type"]) {
|
|
80
80
|
requestHeaders["content-type"] = "application/json";
|
|
@@ -90,7 +90,11 @@ export class ApiClient {
|
|
|
90
90
|
}
|
|
91
91
|
if (response.status === 403) {
|
|
92
92
|
const error = await readErrorEnvelope(response);
|
|
93
|
-
|
|
93
|
+
// Only an ADMISSION probe (/auth/me, /bootstrap) flips the whole
|
|
94
|
+
// app to the "access denied" gate. A per-operation 403 (e.g. a
|
|
95
|
+
// non-owner tries to rename) is a normal authz denial — throw it so
|
|
96
|
+
// the caller surfaces it inline, don't sign the user out of the app.
|
|
97
|
+
if (authProbe) this.onForbidden(error.message || "Forbidden");
|
|
94
98
|
throw error;
|
|
95
99
|
}
|
|
96
100
|
if (!response.ok) {
|
|
@@ -131,11 +135,11 @@ export class ApiClient {
|
|
|
131
135
|
}
|
|
132
136
|
|
|
133
137
|
async getAuthContext() {
|
|
134
|
-
return this.request("GET", `${API_PREFIX}/auth/me
|
|
138
|
+
return this.request("GET", `${API_PREFIX}/auth/me`, { authProbe: true });
|
|
135
139
|
}
|
|
136
140
|
|
|
137
141
|
async getBootstrap() {
|
|
138
|
-
return this.request("GET", `${API_PREFIX}/bootstrap
|
|
142
|
+
return this.request("GET", `${API_PREFIX}/bootstrap`, { authProbe: true });
|
|
139
143
|
}
|
|
140
144
|
|
|
141
145
|
/** Raw artifact download; returns the Response for streaming/blob use. */
|
|
@@ -150,9 +154,9 @@ export class ApiClient {
|
|
|
150
154
|
throw await readErrorEnvelope(response);
|
|
151
155
|
}
|
|
152
156
|
if (response.status === 403) {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
throw
|
|
157
|
+
// Per-artifact denial (no access to this session) — surface inline,
|
|
158
|
+
// don't flip the whole app to the admission gate.
|
|
159
|
+
throw await readErrorEnvelope(response);
|
|
156
160
|
}
|
|
157
161
|
if (!response.ok) throw await readErrorEnvelope(response);
|
|
158
162
|
return response;
|
|
@@ -89,6 +89,35 @@ export class HttpApiTransport {
|
|
|
89
89
|
return this.api.call("getSession", { sessionId });
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
// ── Session sharing / access (security model) ────────────────────────
|
|
93
|
+
async getSessionAccess(sessionId) {
|
|
94
|
+
return this.api.call("getSessionAccess", { sessionId });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
async setSessionVisibility(sessionId, visibility) {
|
|
98
|
+
return this.api.call("setSessionVisibility", { sessionId, visibility });
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
async grantSessionShare(sessionId, user, access) {
|
|
102
|
+
return this.api.call("grantSessionShare", { sessionId, user, access });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async revokeSessionShare(sessionId, user) {
|
|
106
|
+
return this.api.call("revokeSessionShare", { sessionId, user });
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async listSessionShares(sessionId) {
|
|
110
|
+
return this.api.call("listSessionShares", { sessionId });
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
async listKnownUsers(opts = {}) {
|
|
114
|
+
return this.api.call("listKnownUsers", { limit: opts?.limit });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async listAuthzAudit(opts = {}) {
|
|
118
|
+
return this.api.call("listAuthzAudit", { limit: opts?.limit, sessionId: opts?.sessionId });
|
|
119
|
+
}
|
|
120
|
+
|
|
92
121
|
async createSession(options = {}) {
|
|
93
122
|
return this.api.call("createSession", options);
|
|
94
123
|
}
|
|
@@ -161,6 +190,10 @@ export class HttpApiTransport {
|
|
|
161
190
|
return this.api.call("moveSessionsToGroup", { groupId: groupId ?? null, sessionIds });
|
|
162
191
|
}
|
|
163
192
|
|
|
193
|
+
async placeSessionsInGroup(sessionIds, groupId) {
|
|
194
|
+
return this.api.call("placeSessionsInGroup", { groupId: groupId ?? null, sessionIds });
|
|
195
|
+
}
|
|
196
|
+
|
|
164
197
|
async deleteSessionGroup(groupId) {
|
|
165
198
|
return this.api.call("deleteSessionGroup", { groupId });
|
|
166
199
|
}
|
package/api/src/protocol.js
CHANGED
|
@@ -14,6 +14,24 @@
|
|
|
14
14
|
* - "body" — JSON request body field
|
|
15
15
|
* Param types: "string" (default) | "number" | "boolean" | "json".
|
|
16
16
|
* "json" query params carry JSON-encoded values (e.g. the paging cursor).
|
|
17
|
+
*
|
|
18
|
+
* Access classification (`access`) — REQUIRED on every operation; the portal
|
|
19
|
+
* runtime enforces it at dispatch (docs/proposals/user-admin-security-model.md):
|
|
20
|
+
* - "authed" admission gate only (any admitted caller)
|
|
21
|
+
* - "session:list" viewer-scoped listing (non-admins see their visible set)
|
|
22
|
+
* - "session:create" create (still subject to session-creation policy)
|
|
23
|
+
* - "session:read" requires read access to the session's tree root
|
|
24
|
+
* - "session:write" requires write access (owner, shared_write, write grant)
|
|
25
|
+
* - "session:manage" owner or admin
|
|
26
|
+
* - "session:destroy" owner or admin
|
|
27
|
+
* - "session:share" owner or admin (visibility + share grants)
|
|
28
|
+
* - "group:list" owner-scoped group listing for non-admins
|
|
29
|
+
* - "group:manage" group owner or admin
|
|
30
|
+
* - "facts:read"|"facts:write" facts data-plane (role/session-scoped)
|
|
31
|
+
* - "fleet:read" admin-only observability
|
|
32
|
+
* - "fleet:admin" Tier-2 operational surface (admin)
|
|
33
|
+
* Ops whose session resource rides a non-standard param name declare
|
|
34
|
+
* `sessionParam` (e.g. listChildOutcomes → parentSessionId).
|
|
17
35
|
*/
|
|
18
36
|
|
|
19
37
|
export const API_PREFIX = "/api/v1";
|
|
@@ -44,123 +62,133 @@ const body = () => ({ in: "body" });
|
|
|
44
62
|
*/
|
|
45
63
|
export const OPERATIONS = [
|
|
46
64
|
// ── Sessions (client surface) ───────────────────────────────────────
|
|
47
|
-
{ name: "listSessions", method: "GET", path: "/sessions", summary: "List session summaries." },
|
|
48
|
-
{ name: "createSession", method: "POST", path: "/sessions", params: { model: body(), reasoningEffort: body(), contextTier: body(), groupId: body() }, summary: "Create a session. Owner is the authenticated principal." },
|
|
49
|
-
{ name: "createSessionForAgent", method: "POST", path: "/sessions/for-agent", params: { agentName: body(), model: body(), reasoningEffort: body(), contextTier: body(), title: body(), splash: body(), splashMobile: body(), initialPrompt: body(), groupId: body() }, summary: "Create a session bound to a named agent." },
|
|
50
|
-
{ name: "getSession", method: "GET", path: "/sessions/:sessionId", params: { sessionId: path("sessionId") }, summary: "Get one session view (live orchestration status)." },
|
|
51
|
-
{ name: "deleteSession", method: "DELETE", path: "/sessions/:sessionId", params: { sessionId: path("sessionId") }, summary: "Cancel and soft-delete a session." },
|
|
52
|
-
{ name: "sendMessage", method: "POST", path: "/sessions/:sessionId/messages", params: { sessionId: path("sessionId"), prompt: body(), options: body() }, summary: "Send a prompt (options: { enqueueOnly?, clientMessageIds? })." },
|
|
53
|
-
{ name: "sendAnswer", method: "POST", path: "/sessions/:sessionId/answers", params: { sessionId: path("sessionId"), answer: body() }, summary: "Answer a pending input-required question." },
|
|
54
|
-
{ name: "sendSessionEvent", method: "POST", path: "/sessions/:sessionId/events", params: { sessionId: path("sessionId"), eventName: body(), data: body() }, summary: "Send a custom event into the session." },
|
|
55
|
-
{ name: "cancelPendingMessage", method: "POST", path: "/sessions/:sessionId/cancel-pending", params: { sessionId: path("sessionId"), clientMessageIds: body() }, summary: "Cancel queued messages by client message ids." },
|
|
65
|
+
{ name: "listSessions", access: "session:list", method: "GET", path: "/sessions", summary: "List session summaries." },
|
|
66
|
+
{ name: "createSession", access: "session:create", method: "POST", path: "/sessions", params: { model: body(), reasoningEffort: body(), contextTier: body(), groupId: body(), visibility: body() }, summary: "Create a session. Owner is the authenticated principal; visibility defaults to the deployment default." },
|
|
67
|
+
{ name: "createSessionForAgent", access: "session:create", method: "POST", path: "/sessions/for-agent", params: { agentName: body(), model: body(), reasoningEffort: body(), contextTier: body(), title: body(), splash: body(), splashMobile: body(), initialPrompt: body(), groupId: body(), visibility: body() }, summary: "Create a session bound to a named agent." },
|
|
68
|
+
{ name: "getSession", access: "session:read", method: "GET", path: "/sessions/:sessionId", params: { sessionId: path("sessionId") }, summary: "Get one session view (live orchestration status)." },
|
|
69
|
+
{ name: "deleteSession", access: "session:destroy", method: "DELETE", path: "/sessions/:sessionId", params: { sessionId: path("sessionId") }, summary: "Cancel and soft-delete a session." },
|
|
70
|
+
{ name: "sendMessage", access: "session:write", method: "POST", path: "/sessions/:sessionId/messages", params: { sessionId: path("sessionId"), prompt: body(), options: body() }, summary: "Send a prompt (options: { enqueueOnly?, clientMessageIds? })." },
|
|
71
|
+
{ name: "sendAnswer", access: "session:write", method: "POST", path: "/sessions/:sessionId/answers", params: { sessionId: path("sessionId"), answer: body() }, summary: "Answer a pending input-required question." },
|
|
72
|
+
{ name: "sendSessionEvent", access: "session:write", method: "POST", path: "/sessions/:sessionId/events", params: { sessionId: path("sessionId"), eventName: body(), data: body() }, summary: "Send a custom event into the session." },
|
|
73
|
+
{ name: "cancelPendingMessage", access: "session:write", method: "POST", path: "/sessions/:sessionId/cancel-pending", params: { sessionId: path("sessionId"), clientMessageIds: body() }, summary: "Cancel queued messages by client message ids." },
|
|
74
|
+
|
|
75
|
+
// ── Session sharing (security model) ────────────────────────────────
|
|
76
|
+
{ name: "getSessionAccess", access: "session:read", method: "GET", path: "/sessions/:sessionId/access", params: { sessionId: path("sessionId") }, summary: "The caller's effective access to this session's tree: { visibility, relation, canWrite, canManage, owner }." },
|
|
77
|
+
{ name: "setSessionVisibility", access: "session:share", method: "PUT", path: "/sessions/:sessionId/visibility", params: { sessionId: path("sessionId"), visibility: body() }, summary: "Set the tree's sharing level (private | shared_read | shared_write). Owner or admin." },
|
|
78
|
+
{ name: "grantSessionShare", access: "session:share", method: "POST", path: "/sessions/:sessionId/shares", params: { sessionId: path("sessionId"), user: body(), access: body() }, summary: "Grant (or update) a targeted share ({ user: { provider, subject, email?, displayName? }, access: read|write }). Owner or admin." },
|
|
79
|
+
{ name: "revokeSessionShare", access: "session:share", method: "POST", path: "/sessions/:sessionId/shares/revoke", params: { sessionId: path("sessionId"), user: body() }, summary: "Revoke a targeted share ({ user: { provider, subject } }). Owner or admin." },
|
|
80
|
+
{ name: "listSessionShares", access: "session:share", method: "GET", path: "/sessions/:sessionId/shares", params: { sessionId: path("sessionId") }, summary: "List targeted shares on this session's tree. Owner or admin." },
|
|
81
|
+
{ name: "listAuthzAudit", access: "authz:audit", method: "GET", path: "/management/authz-audit", params: { limit: query("number"), sessionId: query("string") }, summary: "Authz audit records, newest first. Admin fleet-wide; owners for their own sessions (sessionId required)." },
|
|
56
82
|
|
|
57
83
|
// ── Session artifacts (JSON surface; binary download is a bespoke route) ──
|
|
58
|
-
{ name: "listArtifacts", method: "GET", path: "/sessions/:sessionId/artifacts", params: { sessionId: path("sessionId") }, summary: "List artifacts for a session." },
|
|
59
|
-
{ name: "getArtifactMetadata", method: "GET", path: "/sessions/:sessionId/artifacts/:filename/meta", params: { sessionId: path("sessionId"), filename: path("filename") }, summary: "Artifact metadata." },
|
|
60
|
-
{ name: "downloadArtifact", method: "GET", path: "/sessions/:sessionId/artifacts/:filename/text", params: { sessionId: path("sessionId"), filename: path("filename") }, summary: "Artifact content as text (JSON envelope). Binary: GET …/download." },
|
|
61
|
-
{ name: "uploadArtifact", method: "PUT", path: "/sessions/:sessionId/artifacts/:filename", params: { sessionId: path("sessionId"), filename: path("filename"), content: body(), contentType: body(), contentEncoding: body() }, summary: "Upload artifact content (base64 for binary; 2 MB JSON limit)." },
|
|
62
|
-
{ name: "deleteArtifact", method: "DELETE", path: "/sessions/:sessionId/artifacts/:filename", params: { sessionId: path("sessionId"), filename: path("filename") }, summary: "Delete an artifact." },
|
|
84
|
+
{ name: "listArtifacts", access: "session:read", method: "GET", path: "/sessions/:sessionId/artifacts", params: { sessionId: path("sessionId") }, summary: "List artifacts for a session." },
|
|
85
|
+
{ name: "getArtifactMetadata", access: "session:read", method: "GET", path: "/sessions/:sessionId/artifacts/:filename/meta", params: { sessionId: path("sessionId"), filename: path("filename") }, summary: "Artifact metadata." },
|
|
86
|
+
{ name: "downloadArtifact", access: "session:read", method: "GET", path: "/sessions/:sessionId/artifacts/:filename/text", params: { sessionId: path("sessionId"), filename: path("filename") }, summary: "Artifact content as text (JSON envelope). Binary: GET …/download." },
|
|
87
|
+
{ name: "uploadArtifact", access: "session:write", method: "PUT", path: "/sessions/:sessionId/artifacts/:filename", params: { sessionId: path("sessionId"), filename: path("filename"), content: body(), contentType: body(), contentEncoding: body() }, summary: "Upload artifact content (base64 for binary; 2 MB JSON limit)." },
|
|
88
|
+
{ name: "deleteArtifact", access: "session:manage", method: "DELETE", path: "/sessions/:sessionId/artifacts/:filename", params: { sessionId: path("sessionId"), filename: path("filename") }, summary: "Delete an artifact." },
|
|
63
89
|
|
|
64
90
|
// ── Management: sessions ────────────────────────────────────────────
|
|
65
|
-
{ name: "listSessionsPage", method: "GET", path: "/management/sessions", params: { limit: query("number"), cursor: query("json"), includeDeleted: query("boolean") }, summary: "Keyset-paginated session listing." },
|
|
66
|
-
{ name: "renameSession", method: "PATCH", path: "/management/sessions/:sessionId", params: { sessionId: path("sessionId"), title: body() }, summary: "Rename a session." },
|
|
67
|
-
{ name: "cancelSession", method: "POST", path: "/management/sessions/:sessionId/cancel", params: { sessionId: path("sessionId") }, summary: "Cancel a session." },
|
|
68
|
-
{ name: "completeSession", method: "POST", path: "/management/sessions/:sessionId/complete", params: { sessionId: path("sessionId"), reason: body() }, summary: "Mark a session completed." },
|
|
69
|
-
{ name: "stopSessionTurn", method: "POST", path: "/management/sessions/:sessionId/stop-turn", params: { sessionId: path("sessionId"), options: body() }, summary: "Abort the in-flight turn." },
|
|
70
|
-
{ name: "setSessionModel", method: "POST", path: "/management/sessions/:sessionId/model", params: { sessionId: path("sessionId"), options: body() }, summary: "Switch the session model ({ model, reasoningEffort?, contextTier? })." },
|
|
71
|
-
{ name: "restartSystemSession", method: "POST", path: "/management/sessions/:agentIdOrSessionId/restart-system", params: { agentIdOrSessionId: path("agentIdOrSessionId"), options: body() }, summary: "Restart a system session (complete | terminate | hard_delete)." },
|
|
72
|
-
{ name: "exportExecutionHistory", method: "POST", path: "/management/sessions/:sessionId/export-execution-history", params: { sessionId: path("sessionId") }, summary: "Export execution history to an artifact; returns artifact meta." },
|
|
73
|
-
{ name: "getSessionStatus", method: "GET", path: "/management/sessions/:sessionId/status", params: { sessionId: path("sessionId") }, summary: "Live custom status + orchestration status." },
|
|
74
|
-
{ name: "waitForStatusChange", method: "GET", path: "/management/sessions/:sessionId/status/wait", params: { sessionId: path("sessionId"), afterVersion: query("number"), timeoutMs: query("number") }, summary: "Long-poll for a status version change (server-capped timeout)." },
|
|
75
|
-
{ name: "getLatestResponse", method: "GET", path: "/management/sessions/:sessionId/latest-response", params: { sessionId: path("sessionId") }, summary: "Latest turn response payload, if any." },
|
|
76
|
-
{ name: "getOrchestrationStats", method: "GET", path: "/management/sessions/:sessionId/orchestration-stats", params: { sessionId: path("sessionId") }, summary: "Orchestration runtime stats." },
|
|
77
|
-
{ name: "getExecutionHistory", method: "GET", path: "/management/sessions/:sessionId/execution-history", params: { sessionId: path("sessionId"), executionId: query("number") }, summary: "Raw execution history events." },
|
|
78
|
-
{ name: "getSessionEvents", method: "GET", path: "/management/sessions/:sessionId/events", params: { sessionId: path("sessionId"), afterSeq: query("number"), limit: query("number"), eventTypes: query("json") }, summary: "Session events after a sequence number (reconnect catch-up). Optional eventTypes (JSON string array) narrows to those event types server-side." },
|
|
79
|
-
{ name: "getSessionEventsBefore", method: "GET", path: "/management/sessions/:sessionId/events-before", params: { sessionId: path("sessionId"), beforeSeq: query("number"), limit: query("number"), eventTypes: query("json") }, summary: "Older session events for history paging. Optional eventTypes (JSON string array) narrows to those event types server-side (chat transcript paging)." },
|
|
80
|
-
{ name: "getSessionMetricSummary", method: "GET", path: "/management/sessions/:sessionId/metric-summary", params: { sessionId: path("sessionId") }, summary: "Per-session metric summary." },
|
|
81
|
-
{ name: "getSessionTokensByModel", method: "GET", path: "/management/sessions/:sessionId/tokens-by-model", params: { sessionId: path("sessionId") }, summary: "Token totals grouped by model." },
|
|
82
|
-
{ name: "getSessionTreeStats", method: "GET", path: "/management/sessions/:sessionId/tree-stats", params: { sessionId: path("sessionId") }, summary: "Stats rolled up across the spawn tree." },
|
|
83
|
-
{ name: "getSessionSkillUsage", method: "GET", path: "/management/sessions/:sessionId/skill-usage", params: { sessionId: path("sessionId"), since: query("string") }, summary: "Skill usage for one session." },
|
|
84
|
-
{ name: "getSessionTreeSkillUsage", method: "GET", path: "/management/sessions/:sessionId/tree-skill-usage", params: { sessionId: path("sessionId"), since: query("string") }, summary: "Skill usage across the spawn tree." },
|
|
85
|
-
{ name: "getSessionFactsStats", method: "GET", path: "/management/sessions/:sessionId/facts-stats", params: { sessionId: path("sessionId") }, summary: "Facts stats for one session." },
|
|
86
|
-
{ name: "getSessionTreeFactsStats", method: "GET", path: "/management/sessions/:sessionId/tree-facts-stats", params: { sessionId: path("sessionId") }, summary: "Facts stats across the spawn tree." },
|
|
91
|
+
{ name: "listSessionsPage", access: "session:list", method: "GET", path: "/management/sessions", params: { limit: query("number"), cursor: query("json"), includeDeleted: query("boolean") }, summary: "Keyset-paginated session listing." },
|
|
92
|
+
{ name: "renameSession", access: "session:manage", method: "PATCH", path: "/management/sessions/:sessionId", params: { sessionId: path("sessionId"), title: body() }, summary: "Rename a session." },
|
|
93
|
+
{ name: "cancelSession", access: "session:manage", method: "POST", path: "/management/sessions/:sessionId/cancel", params: { sessionId: path("sessionId") }, summary: "Cancel a session." },
|
|
94
|
+
{ name: "completeSession", access: "session:manage", method: "POST", path: "/management/sessions/:sessionId/complete", params: { sessionId: path("sessionId"), reason: body() }, summary: "Mark a session completed." },
|
|
95
|
+
{ name: "stopSessionTurn", access: "session:write", method: "POST", path: "/management/sessions/:sessionId/stop-turn", params: { sessionId: path("sessionId"), options: body() }, summary: "Abort the in-flight turn." },
|
|
96
|
+
{ name: "setSessionModel", access: "session:manage", method: "POST", path: "/management/sessions/:sessionId/model", params: { sessionId: path("sessionId"), options: body() }, summary: "Switch the session model ({ model, reasoningEffort?, contextTier? })." },
|
|
97
|
+
{ name: "restartSystemSession", access: "fleet:admin", method: "POST", path: "/management/sessions/:agentIdOrSessionId/restart-system", params: { agentIdOrSessionId: path("agentIdOrSessionId"), options: body() }, summary: "Restart a system session (complete | terminate | hard_delete)." },
|
|
98
|
+
{ name: "exportExecutionHistory", access: "session:manage", method: "POST", path: "/management/sessions/:sessionId/export-execution-history", params: { sessionId: path("sessionId") }, summary: "Export execution history to an artifact; returns artifact meta." },
|
|
99
|
+
{ name: "getSessionStatus", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/status", params: { sessionId: path("sessionId") }, summary: "Live custom status + orchestration status." },
|
|
100
|
+
{ name: "waitForStatusChange", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/status/wait", params: { sessionId: path("sessionId"), afterVersion: query("number"), timeoutMs: query("number") }, summary: "Long-poll for a status version change (server-capped timeout)." },
|
|
101
|
+
{ name: "getLatestResponse", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/latest-response", params: { sessionId: path("sessionId") }, summary: "Latest turn response payload, if any." },
|
|
102
|
+
{ name: "getOrchestrationStats", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/orchestration-stats", params: { sessionId: path("sessionId") }, summary: "Orchestration runtime stats." },
|
|
103
|
+
{ name: "getExecutionHistory", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/execution-history", params: { sessionId: path("sessionId"), executionId: query("number") }, summary: "Raw execution history events." },
|
|
104
|
+
{ name: "getSessionEvents", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/events", params: { sessionId: path("sessionId"), afterSeq: query("number"), limit: query("number"), eventTypes: query("json") }, summary: "Session events after a sequence number (reconnect catch-up). Optional eventTypes (JSON string array) narrows to those event types server-side." },
|
|
105
|
+
{ name: "getSessionEventsBefore", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/events-before", params: { sessionId: path("sessionId"), beforeSeq: query("number"), limit: query("number"), eventTypes: query("json") }, summary: "Older session events for history paging. Optional eventTypes (JSON string array) narrows to those event types server-side (chat transcript paging)." },
|
|
106
|
+
{ name: "getSessionMetricSummary", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/metric-summary", params: { sessionId: path("sessionId") }, summary: "Per-session metric summary." },
|
|
107
|
+
{ name: "getSessionTokensByModel", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/tokens-by-model", params: { sessionId: path("sessionId") }, summary: "Token totals grouped by model." },
|
|
108
|
+
{ name: "getSessionTreeStats", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/tree-stats", params: { sessionId: path("sessionId") }, summary: "Stats rolled up across the spawn tree." },
|
|
109
|
+
{ name: "getSessionSkillUsage", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/skill-usage", params: { sessionId: path("sessionId"), since: query("string") }, summary: "Skill usage for one session." },
|
|
110
|
+
{ name: "getSessionTreeSkillUsage", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/tree-skill-usage", params: { sessionId: path("sessionId"), since: query("string") }, summary: "Skill usage across the spawn tree." },
|
|
111
|
+
{ name: "getSessionFactsStats", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/facts-stats", params: { sessionId: path("sessionId") }, summary: "Facts stats for one session." },
|
|
112
|
+
{ name: "getSessionTreeFactsStats", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/tree-facts-stats", params: { sessionId: path("sessionId") }, summary: "Facts stats across the spawn tree." },
|
|
87
113
|
// Retrieval / graph observability (tuner-grade diagnostics; read-only)
|
|
88
|
-
{ name: "getSessionRetrievalUsage", method: "GET", path: "/management/sessions/:sessionId/retrieval-usage", params: { sessionId: path("sessionId"), since: query("string") }, summary: "Retrieval (facts/graph search) usage for one session." },
|
|
89
|
-
{ name: "getSessionTreeRetrievalUsage", method: "GET", path: "/management/sessions/:sessionId/tree-retrieval-usage", params: { sessionId: path("sessionId"), since: query("string") }, summary: "Retrieval usage across the spawn tree." },
|
|
90
|
-
{ name: "getSessionGraphNodeUsage", method: "GET", path: "/management/sessions/:sessionId/graph-node-usage", params: { sessionId: path("sessionId"), since: query("string"), limit: query("number"), nodeKeyLike: query("string"), kind: query("string") }, summary: "Graph node usage for one session." },
|
|
91
|
-
{ name: "getSessionGraphEdgeSearchUsage", method: "GET", path: "/management/sessions/:sessionId/graph-edge-search-usage", params: { sessionId: path("sessionId"), since: query("string"), limit: query("number") }, summary: "Graph edge-search usage for one session." },
|
|
92
|
-
{ name: "getSessionGraphSearches", method: "GET", path: "/management/sessions/:sessionId/graph-searches", params: { sessionId: path("sessionId"), limit: query("number") }, summary: "Recent graph search events for one session." },
|
|
93
|
-
{ name: "listChildOutcomes", method: "GET", path: "/management/sessions/:parentSessionId/child-outcomes", params: { parentSessionId: path("parentSessionId") }, summary: "Child outcomes recorded under a parent session." },
|
|
94
|
-
{ name: "getChildOutcome", method: "GET", path: "/management/child-outcomes/:childSessionId", params: { childSessionId: path("childSessionId") }, summary: "One child outcome." },
|
|
114
|
+
{ name: "getSessionRetrievalUsage", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/retrieval-usage", params: { sessionId: path("sessionId"), since: query("string") }, summary: "Retrieval (facts/graph search) usage for one session." },
|
|
115
|
+
{ name: "getSessionTreeRetrievalUsage", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/tree-retrieval-usage", params: { sessionId: path("sessionId"), since: query("string") }, summary: "Retrieval usage across the spawn tree." },
|
|
116
|
+
{ name: "getSessionGraphNodeUsage", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/graph-node-usage", params: { sessionId: path("sessionId"), since: query("string"), limit: query("number"), nodeKeyLike: query("string"), kind: query("string") }, summary: "Graph node usage for one session." },
|
|
117
|
+
{ name: "getSessionGraphEdgeSearchUsage", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/graph-edge-search-usage", params: { sessionId: path("sessionId"), since: query("string"), limit: query("number") }, summary: "Graph edge-search usage for one session." },
|
|
118
|
+
{ name: "getSessionGraphSearches", access: "session:read", method: "GET", path: "/management/sessions/:sessionId/graph-searches", params: { sessionId: path("sessionId"), limit: query("number") }, summary: "Recent graph search events for one session." },
|
|
119
|
+
{ name: "listChildOutcomes", access: "session:read", sessionParam: "parentSessionId", method: "GET", path: "/management/sessions/:parentSessionId/child-outcomes", params: { parentSessionId: path("parentSessionId") }, summary: "Child outcomes recorded under a parent session." },
|
|
120
|
+
{ name: "getChildOutcome", access: "session:read", sessionParam: "childSessionId", method: "GET", path: "/management/child-outcomes/:childSessionId", params: { childSessionId: path("childSessionId") }, summary: "One child outcome." },
|
|
95
121
|
|
|
96
122
|
// ── Management: session groups ──────────────────────────────────────
|
|
97
|
-
{ name: "listSessionGroups", method: "GET", path: "/management/session-groups", summary: "List session groups." },
|
|
98
|
-
{ name: "createSessionGroup", method: "POST", path: "/management/session-groups", params: { input: body() }, summary: "Create a session group." },
|
|
99
|
-
{ name: "updateSessionGroup", method: "PATCH", path: "/management/session-groups/:groupId", params: { groupId: path("groupId"), patch: body() }, summary: "Update group title/description." },
|
|
100
|
-
{ name: "deleteSessionGroup", method: "DELETE", path: "/management/session-groups/:groupId", params: { groupId: path("groupId") }, summary: "Delete
|
|
101
|
-
{ name: "
|
|
102
|
-
{ name: "
|
|
103
|
-
{ name: "
|
|
104
|
-
{ name: "
|
|
123
|
+
{ name: "listSessionGroups", access: "group:list", method: "GET", path: "/management/session-groups", summary: "List session groups." },
|
|
124
|
+
{ name: "createSessionGroup", access: "authed", method: "POST", path: "/management/session-groups", params: { input: body() }, summary: "Create a session group." },
|
|
125
|
+
{ name: "updateSessionGroup", access: "group:manage", method: "PATCH", path: "/management/session-groups/:groupId", params: { groupId: path("groupId"), patch: body() }, summary: "Update group title/description." },
|
|
126
|
+
{ name: "deleteSessionGroup", access: "group:manage", method: "DELETE", path: "/management/session-groups/:groupId", params: { groupId: path("groupId") }, summary: "Delete a session group. Clears the owner's placements; sessions are untouched." },
|
|
127
|
+
{ name: "placeSessionsInGroup", access: "authed", method: "POST", path: "/management/session-groups/place", params: { groupId: body(), sessionIds: body() }, summary: "Place session trees into one of the caller's groups (groupId null = ungroup). Requires read access to each session; changes no shared session data." },
|
|
128
|
+
{ name: "assignSessionsToGroup", access: "authed", method: "POST", path: "/management/session-groups/:groupId/assign", params: { groupId: path("groupId"), sessionIds: body() }, summary: "Deprecated alias of placeSessionsInGroup." },
|
|
129
|
+
{ name: "cancelSessionGroup", access: "group:manage", method: "POST", path: "/management/session-groups/:groupId/cancel", params: { groupId: path("groupId"), reason: body() }, summary: "Deprecated: Cancel all sessions in a group." },
|
|
130
|
+
{ name: "completeSessionGroup", access: "group:manage", method: "POST", path: "/management/session-groups/:groupId/complete", params: { groupId: path("groupId"), options: body() }, summary: "Deprecated: Complete all sessions in a group." },
|
|
131
|
+
{ name: "moveSessionsToGroup", access: "authed", method: "POST", path: "/management/session-groups/move", params: { groupId: body(), sessionIds: body() }, summary: "Deprecated alias of placeSessionsInGroup." },
|
|
105
132
|
|
|
106
133
|
// ── Management: fleet / users / facts / events ──────────────────────
|
|
107
|
-
{ name: "getFleetStats", method: "GET", path: "/management/fleet/stats", params: { since: query("string"), includeDeleted: query("boolean") }, summary: "Fleet-wide stats." },
|
|
108
|
-
{ name: "getFleetSkillUsage", method: "GET", path: "/management/fleet/skill-usage", params: { since: query("string"), includeDeleted: query("boolean") }, summary: "Fleet-wide skill usage." },
|
|
109
|
-
{ name: "getFleetRetrievalUsage", method: "GET", path: "/management/fleet/retrieval-usage", params: { since: query("string"), includeDeleted: query("boolean") }, summary: "Fleet-wide retrieval usage." },
|
|
110
|
-
{ name: "getFleetGraphNodeUsage", method: "GET", path: "/management/fleet/graph-node-usage", params: { since: query("string"), includeDeleted: query("boolean"), limit: query("number"), nodeKeyLike: query("string"), kind: query("string") }, summary: "Fleet-wide graph node usage." },
|
|
111
|
-
{ name: "getUserStats", method: "GET", path: "/management/users/stats", params: { since: query("string"), includeDeleted: query("boolean") }, summary: "Per-user stats." },
|
|
112
|
-
{ name: "
|
|
113
|
-
{ name: "
|
|
114
|
-
{ name: "
|
|
115
|
-
{ name: "
|
|
134
|
+
{ name: "getFleetStats", access: "fleet:read", method: "GET", path: "/management/fleet/stats", params: { since: query("string"), includeDeleted: query("boolean") }, summary: "Fleet-wide stats." },
|
|
135
|
+
{ name: "getFleetSkillUsage", access: "fleet:read", method: "GET", path: "/management/fleet/skill-usage", params: { since: query("string"), includeDeleted: query("boolean") }, summary: "Fleet-wide skill usage." },
|
|
136
|
+
{ name: "getFleetRetrievalUsage", access: "fleet:read", method: "GET", path: "/management/fleet/retrieval-usage", params: { since: query("string"), includeDeleted: query("boolean") }, summary: "Fleet-wide retrieval usage." },
|
|
137
|
+
{ name: "getFleetGraphNodeUsage", access: "fleet:read", method: "GET", path: "/management/fleet/graph-node-usage", params: { since: query("string"), includeDeleted: query("boolean"), limit: query("number"), nodeKeyLike: query("string"), kind: query("string") }, summary: "Fleet-wide graph node usage." },
|
|
138
|
+
{ name: "getUserStats", access: "fleet:read", method: "GET", path: "/management/users/stats", params: { since: query("string"), includeDeleted: query("boolean") }, summary: "Per-user stats." },
|
|
139
|
+
{ name: "listKnownUsers", access: "authed", method: "GET", path: "/management/users", params: { limit: query("number") }, summary: "Member directory (provider/subject/email/displayName) for share autocomplete; excludes synthetic principals." },
|
|
140
|
+
{ name: "getSharedFactsStats", access: "fleet:read", method: "GET", path: "/management/facts/shared-stats", summary: "Shared facts stats." },
|
|
141
|
+
{ name: "getFactsTombstoneStats", access: "fleet:read", method: "GET", path: "/management/facts/tombstone-stats", params: { ttlSeconds: query("number") }, summary: "Soft-deleted facts awaiting reconciliation." },
|
|
142
|
+
{ name: "getTopEventEmitters", access: "fleet:read", method: "GET", path: "/management/events/top-emitters", params: { since: query("string"), limit: query("number") }, summary: "Noisiest event emitters since a date." },
|
|
143
|
+
{ name: "pruneDeletedSummaries", access: "fleet:admin", method: "POST", path: "/management/summaries/prune-deleted", params: { olderThan: body() }, summary: "Prune summaries of deleted sessions." },
|
|
116
144
|
|
|
117
145
|
// ── Facts data-plane (Tier 1: any admitted caller) ──────────────────
|
|
118
|
-
{ name: "factsCapabilities", method: "GET", path: "/facts/capabilities", summary: "Store capabilities: { search, embedder, graph } — the remote isEnhancedFactStore/isGraphStore." },
|
|
119
|
-
{ name: "readFacts", method: "GET", path: "/facts", params: { keyPattern: query("string"), scopeKeys: query("json"), tags: query("json"), sessionId: query("string"), agentId: query("string"), limit: query("number"), scope: query("string") }, summary: "Read facts (ReadFactsQuery params)." },
|
|
120
|
-
{ name: "storeFact", method: "POST", path: "/facts", params: { input: body() }, summary: "Store a fact or facts (StoreFactInput | StoreFactInput[])." },
|
|
121
|
-
{ name: "deleteFact", method: "POST", path: "/facts/delete", params: { input: body() }, summary: "Delete a fact / pattern (DeleteFactInput). POST because DELETE bodies are unreliable." },
|
|
122
|
-
{ name: "searchFacts", method: "POST", path: "/facts/search", params: { query: body(), opts: body() }, summary: "Retrieval over facts (lexical | semantic | hybrid). [enhanced]" },
|
|
123
|
-
{ name: "similarFacts", method: "POST", path: "/facts/similar", params: { scopeKey: body(), opts: body() }, summary: "Semantic nearest-neighbours of a known fact. [enhanced]" },
|
|
146
|
+
{ name: "factsCapabilities", access: "authed", method: "GET", path: "/facts/capabilities", summary: "Store capabilities: { search, embedder, graph } — the remote isEnhancedFactStore/isGraphStore." },
|
|
147
|
+
{ name: "readFacts", access: "facts:read", method: "GET", path: "/facts", params: { keyPattern: query("string"), scopeKeys: query("json"), tags: query("json"), sessionId: query("string"), agentId: query("string"), limit: query("number"), scope: query("string") }, summary: "Read facts (ReadFactsQuery params)." },
|
|
148
|
+
{ name: "storeFact", access: "facts:write", method: "POST", path: "/facts", params: { input: body() }, summary: "Store a fact or facts (StoreFactInput | StoreFactInput[])." },
|
|
149
|
+
{ name: "deleteFact", access: "facts:write", method: "POST", path: "/facts/delete", params: { input: body() }, summary: "Delete a fact / pattern (DeleteFactInput). POST because DELETE bodies are unreliable." },
|
|
150
|
+
{ name: "searchFacts", access: "facts:read", method: "POST", path: "/facts/search", params: { query: body(), opts: body() }, summary: "Retrieval over facts (lexical | semantic | hybrid). [enhanced]" },
|
|
151
|
+
{ name: "similarFacts", access: "facts:read", method: "POST", path: "/facts/similar", params: { scopeKey: body(), opts: body() }, summary: "Semantic nearest-neighbours of a known fact. [enhanced]" },
|
|
124
152
|
|
|
125
153
|
// ── Facts operational (Tier 2: admin) ───────────────────────────────
|
|
126
|
-
{ name: "getEmbedderStatus", method: "GET", path: "/facts/embedder", summary: "Durable embedder status. [enhanced]" },
|
|
127
|
-
{ name: "startFactsEmbedder", method: "POST", path: "/facts/embedder/start", params: { intervalSeconds: body(), batch: body() }, admin: true, summary: "Start the durable embedder loop. [enhanced, admin]" },
|
|
128
|
-
{ name: "stopFactsEmbedder", method: "POST", path: "/facts/embedder/stop", params: { reason: body() }, admin: true, summary: "Stop the durable embedder loop. [enhanced, admin]" },
|
|
129
|
-
{ name: "forcePurgeFacts", method: "POST", path: "/facts/purge", params: { input: body() }, admin: true, summary: "Force-purge soft-deleted facts (ForcePurgeFactsInput). [admin]" },
|
|
154
|
+
{ name: "getEmbedderStatus", access: "authed", method: "GET", path: "/facts/embedder", summary: "Durable embedder status. [enhanced]" },
|
|
155
|
+
{ name: "startFactsEmbedder", access: "fleet:admin", method: "POST", path: "/facts/embedder/start", params: { intervalSeconds: body(), batch: body() }, admin: true, summary: "Start the durable embedder loop. [enhanced, admin]" },
|
|
156
|
+
{ name: "stopFactsEmbedder", access: "fleet:admin", method: "POST", path: "/facts/embedder/stop", params: { reason: body() }, admin: true, summary: "Stop the durable embedder loop. [enhanced, admin]" },
|
|
157
|
+
{ name: "forcePurgeFacts", access: "fleet:admin", method: "POST", path: "/facts/purge", params: { input: body() }, admin: true, summary: "Force-purge soft-deleted facts (ForcePurgeFactsInput). [admin]" },
|
|
130
158
|
|
|
131
159
|
// ── Graph data-plane (Tier 1: any admitted caller) ──────────────────
|
|
132
|
-
{ name: "searchGraphNodes", method: "POST", path: "/graph/nodes/search", params: { query: body() }, summary: "Search graph nodes (GraphNodeQuery)." },
|
|
133
|
-
{ name: "searchGraphEdges", method: "POST", path: "/graph/edges/search", params: { query: body() }, summary: "Search graph edges (GraphEdgeQuery)." },
|
|
134
|
-
{ name: "graphNeighbourhood", method: "POST", path: "/graph/neighbourhood", params: { nodeKey: body(), depth: body(), namespace: body() }, summary: "Expand a subgraph around a node." },
|
|
135
|
-
{ name: "upsertGraphNode", method: "POST", path: "/graph/nodes", params: { input: body() }, summary: "Upsert a graph node (GraphNodeInput)." },
|
|
136
|
-
{ name: "upsertGraphEdge", method: "POST", path: "/graph/edges", params: { input: body() }, summary: "Upsert a graph edge (GraphEdgeInput)." },
|
|
137
|
-
{ name: "deleteGraphNode", method: "POST", path: "/graph/nodes/delete", params: { nodeKey: body(), namespace: body() }, summary: "Delete a graph node." },
|
|
138
|
-
{ name: "deleteGraphEdge", method: "POST", path: "/graph/edges/delete", params: { fromKey: body(), toKey: body(), predicateKey: body(), namespace: body() }, summary: "Delete a graph edge." },
|
|
139
|
-
{ name: "graphStats", method: "GET", path: "/graph/stats", params: { namespace: query("string") }, summary: "Graph node/edge counts." },
|
|
140
|
-
{ name: "listGraphNamespaces", method: "GET", path: "/graph/namespaces", params: { prefix: query("string"), includeArchived: query("boolean"), includeDetails: query("boolean") }, summary: "List graph namespaces (corpora)." },
|
|
141
|
-
{ name: "getGraphNamespace", method: "GET", path: "/graph/namespaces/:namespace", params: { namespace: path("namespace") }, summary: "One graph namespace descriptor." },
|
|
160
|
+
{ name: "searchGraphNodes", access: "authed", method: "POST", path: "/graph/nodes/search", params: { query: body() }, summary: "Search graph nodes (GraphNodeQuery)." },
|
|
161
|
+
{ name: "searchGraphEdges", access: "authed", method: "POST", path: "/graph/edges/search", params: { query: body() }, summary: "Search graph edges (GraphEdgeQuery)." },
|
|
162
|
+
{ name: "graphNeighbourhood", access: "authed", method: "POST", path: "/graph/neighbourhood", params: { nodeKey: body(), depth: body(), namespace: body() }, summary: "Expand a subgraph around a node." },
|
|
163
|
+
{ name: "upsertGraphNode", access: "authed", method: "POST", path: "/graph/nodes", params: { input: body() }, summary: "Upsert a graph node (GraphNodeInput)." },
|
|
164
|
+
{ name: "upsertGraphEdge", access: "authed", method: "POST", path: "/graph/edges", params: { input: body() }, summary: "Upsert a graph edge (GraphEdgeInput)." },
|
|
165
|
+
{ name: "deleteGraphNode", access: "authed", method: "POST", path: "/graph/nodes/delete", params: { nodeKey: body(), namespace: body() }, summary: "Delete a graph node." },
|
|
166
|
+
{ name: "deleteGraphEdge", access: "authed", method: "POST", path: "/graph/edges/delete", params: { fromKey: body(), toKey: body(), predicateKey: body(), namespace: body() }, summary: "Delete a graph edge." },
|
|
167
|
+
{ name: "graphStats", access: "authed", method: "GET", path: "/graph/stats", params: { namespace: query("string") }, summary: "Graph node/edge counts." },
|
|
168
|
+
{ name: "listGraphNamespaces", access: "authed", method: "GET", path: "/graph/namespaces", params: { prefix: query("string"), includeArchived: query("boolean"), includeDetails: query("boolean") }, summary: "List graph namespaces (corpora)." },
|
|
169
|
+
{ name: "getGraphNamespace", access: "authed", method: "GET", path: "/graph/namespaces/:namespace", params: { namespace: path("namespace") }, summary: "One graph namespace descriptor." },
|
|
142
170
|
|
|
143
171
|
// ── Graph operational (Tier 2: admin) ───────────────────────────────
|
|
144
|
-
{ name: "upsertGraphNamespace", method: "POST", path: "/graph/namespaces", params: { input: body() }, admin: true, summary: "Register/update a graph namespace. [admin]" },
|
|
145
|
-
{ name: "deleteGraphNamespace", method: "DELETE", path: "/graph/namespaces/:namespace", params: { namespace: path("namespace") }, admin: true, summary: "Delete a graph namespace and its data. [admin]" },
|
|
172
|
+
{ name: "upsertGraphNamespace", access: "fleet:admin", method: "POST", path: "/graph/namespaces", params: { input: body() }, admin: true, summary: "Register/update a graph namespace. [admin]" },
|
|
173
|
+
{ name: "deleteGraphNamespace", access: "fleet:admin", method: "DELETE", path: "/graph/namespaces/:namespace", params: { namespace: path("namespace") }, admin: true, summary: "Delete a graph namespace and its data. [admin]" },
|
|
146
174
|
|
|
147
175
|
// ── Models / agents / policy ────────────────────────────────────────
|
|
148
|
-
{ name: "listModels", method: "GET", path: "/models", summary: "All available models." },
|
|
149
|
-
{ name: "getModelsByProvider", method: "GET", path: "/models/by-provider", summary: "Models grouped by provider." },
|
|
150
|
-
{ name: "getDefaultModel", method: "GET", path: "/models/default", summary: "The deployment default model." },
|
|
151
|
-
{ name: "listCreatableAgents", method: "GET", path: "/agents", summary: "Agents sessions can be created for." },
|
|
152
|
-
{ name: "getSessionCreationPolicy", method: "GET", path: "/session-creation-policy", summary: "Session creation policy." },
|
|
176
|
+
{ name: "listModels", access: "authed", method: "GET", path: "/models", summary: "All available models." },
|
|
177
|
+
{ name: "getModelsByProvider", access: "authed", method: "GET", path: "/models/by-provider", summary: "Models grouped by provider." },
|
|
178
|
+
{ name: "getDefaultModel", access: "authed", method: "GET", path: "/models/default", summary: "The deployment default model." },
|
|
179
|
+
{ name: "listCreatableAgents", access: "authed", method: "GET", path: "/agents", summary: "Agents sessions can be created for." },
|
|
180
|
+
{ name: "getSessionCreationPolicy", access: "authed", method: "GET", path: "/session-creation-policy", summary: "Session creation policy." },
|
|
153
181
|
|
|
154
182
|
// ── Current user profile ────────────────────────────────────────────
|
|
155
|
-
{ name: "getCurrentUserProfile", method: "GET", path: "/me/profile", summary: "Profile of the authenticated principal." },
|
|
156
|
-
{ name: "setCurrentUserProfileSettings", method: "PATCH", path: "/me/profile/settings", params: { settings: body() }, summary: "Replace profile settings." },
|
|
157
|
-
{ name: "setCurrentUserGitHubCopilotKey", method: "PUT", path: "/me/github-copilot-key", params: { key: body() }, summary: "Set (or clear with null) the per-user GitHub Copilot key." },
|
|
158
|
-
{ name: "setSystemGitHubCopilotKey", method: "PUT", path: "/admin/system-github-copilot-key", params: { key: body() }, admin: true, summary: "Set (or clear with null) the System user's GitHub Copilot key, used by ownerless system sessions. [admin]" },
|
|
159
|
-
{ name: "getSystemGitHubCopilotKeyStatus", method: "GET", path: "/admin/system-github-copilot-key", admin: true, summary: "Whether a System GitHub Copilot key is configured and who last changed it. [admin]" },
|
|
183
|
+
{ name: "getCurrentUserProfile", access: "authed", method: "GET", path: "/me/profile", summary: "Profile of the authenticated principal." },
|
|
184
|
+
{ name: "setCurrentUserProfileSettings", access: "authed", method: "PATCH", path: "/me/profile/settings", params: { settings: body() }, summary: "Replace profile settings." },
|
|
185
|
+
{ name: "setCurrentUserGitHubCopilotKey", access: "authed", method: "PUT", path: "/me/github-copilot-key", params: { key: body() }, summary: "Set (or clear with null) the per-user GitHub Copilot key." },
|
|
186
|
+
{ name: "setSystemGitHubCopilotKey", access: "fleet:admin", method: "PUT", path: "/admin/system-github-copilot-key", params: { key: body() }, admin: true, summary: "Set (or clear with null) the System user's GitHub Copilot key, used by ownerless system sessions. [admin]" },
|
|
187
|
+
{ name: "getSystemGitHubCopilotKeyStatus", access: "fleet:admin", method: "GET", path: "/admin/system-github-copilot-key", admin: true, summary: "Whether a System GitHub Copilot key is configured and who last changed it. [admin]" },
|
|
160
188
|
|
|
161
189
|
// ── System ──────────────────────────────────────────────────────────
|
|
162
|
-
{ name: "getLogConfig", method: "GET", path: "/system/log-config", summary: "Log tail availability." },
|
|
163
|
-
{ name: "getWorkerCount", method: "GET", path: "/system/workers", summary: "Live worker count." },
|
|
190
|
+
{ name: "getLogConfig", access: "authed", method: "GET", path: "/system/log-config", summary: "Log tail availability." },
|
|
191
|
+
{ name: "getWorkerCount", access: "authed", method: "GET", path: "/system/workers", summary: "Live worker count." },
|
|
164
192
|
];
|
|
165
193
|
|
|
166
194
|
const OPERATIONS_BY_NAME = new Map(OPERATIONS.map((op) => [op.name, op]));
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { PilotSwarmClientOptions, ManagedSessionConfig, PilotSwarmSessionInfo, UserInputHandler, SessionOwnerInfo } from "./types.js";
|
|
2
|
-
import type { SessionCatalog, SessionEvent } from "./cms.js";
|
|
2
|
+
import type { SessionCatalog, SessionEvent, SessionVisibility } from "./cms.js";
|
|
3
|
+
import type { MessageSender } from "./message-sender.js";
|
|
3
4
|
import { type PilotSwarmWebOptions } from "./web/api-connection.js";
|
|
4
5
|
/**
|
|
5
6
|
* PilotSwarmClient — pure client-side session handle.
|
|
@@ -52,6 +53,8 @@ export declare class PilotSwarmClient {
|
|
|
52
53
|
owner?: SessionOwnerInfo | null;
|
|
53
54
|
/** Optional visual session group assignment. */
|
|
54
55
|
groupId?: string | null;
|
|
56
|
+
/** Sharing level for a new ROOT session (children resolve through their root). */
|
|
57
|
+
visibility?: SessionVisibility | null;
|
|
55
58
|
}): Promise<PilotSwarmSession>;
|
|
56
59
|
/**
|
|
57
60
|
* Create a session bound to a named agent.
|
|
@@ -74,6 +77,7 @@ export declare class PilotSwarmClient {
|
|
|
74
77
|
initialPrompt?: string;
|
|
75
78
|
owner?: SessionOwnerInfo | null;
|
|
76
79
|
groupId?: string | null;
|
|
80
|
+
visibility?: SessionVisibility | null;
|
|
77
81
|
}): Promise<PilotSwarmSession>;
|
|
78
82
|
/**
|
|
79
83
|
* Create a system session (e.g. Sweeper Agent).
|
|
@@ -117,6 +121,7 @@ export declare class PilotSwarmClient {
|
|
|
117
121
|
bootstrap?: boolean;
|
|
118
122
|
requiredTool?: string;
|
|
119
123
|
clientMessageIds?: string[];
|
|
124
|
+
sender?: MessageSender;
|
|
120
125
|
}): Promise<string>;
|
|
121
126
|
/** @internal */
|
|
122
127
|
_getDuroxideClient(): any;
|
|
@@ -162,6 +167,7 @@ export declare class PilotSwarmSession {
|
|
|
162
167
|
bootstrap?: boolean;
|
|
163
168
|
requiredTool?: string;
|
|
164
169
|
clientMessageIds?: string[];
|
|
170
|
+
sender?: MessageSender;
|
|
165
171
|
}): Promise<void>;
|
|
166
172
|
wait(timeout?: number, opts?: {
|
|
167
173
|
signal?: AbortSignal;
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,uBAAuB,EACvB,oBAAoB,EAGpB,qBAAqB,EAErB,gBAAgB,EAIhB,gBAAgB,EACnB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,UAAU,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;IAM/C,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,YAAY;YAON,KAAK;IAqBnB,OAAO,CAAC,SAAS;CAYpB"}
|
package/dist/client.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { RESPONSE_LATEST_KEY, } from "./types.js";
|
|
2
2
|
import { DURABLE_SESSION_LATEST_VERSION, DURABLE_SESSION_ORCHESTRATION_NAME, } from "./orchestration-registry.js";
|
|
3
|
+
import { normalizeMessageSender } from "./message-sender.js";
|
|
3
4
|
import { resolveStorageConfig } from "./storage-config.js";
|
|
4
5
|
import { getDuroxideStorageProvider, getRuntimeStorageProvider } from "./storage-providers.js";
|
|
5
6
|
import { deriveStatusFromCmsAndRuntime, shouldSyncCompletedStatus, shouldSyncFailedStatus } from "./session-status.js";
|
|
@@ -118,6 +119,7 @@ export class PilotSwarmClient {
|
|
|
118
119
|
parentSessionId: config?.parentSessionId,
|
|
119
120
|
owner: config?.owner ?? null,
|
|
120
121
|
groupId: config?.groupId ?? null,
|
|
122
|
+
visibility: config?.visibility ?? null,
|
|
121
123
|
});
|
|
122
124
|
// Track parentSessionId for sub-agent orchestration input
|
|
123
125
|
if (config?.parentSessionId) {
|
|
@@ -159,6 +161,7 @@ export class PilotSwarmClient {
|
|
|
159
161
|
promptLayering: { kind: "app-agent" },
|
|
160
162
|
owner: opts?.owner ?? null,
|
|
161
163
|
groupId: opts?.groupId ?? null,
|
|
164
|
+
visibility: opts?.visibility ?? null,
|
|
162
165
|
});
|
|
163
166
|
// Set agent metadata in CMS (agentId + prefixed title)
|
|
164
167
|
const shortId = session.sessionId.slice(0, 8);
|
|
@@ -289,7 +292,7 @@ export class PilotSwarmClient {
|
|
|
289
292
|
agentId: row.agentId ?? undefined,
|
|
290
293
|
splash: row.splash ?? undefined,
|
|
291
294
|
splashMobile: row.splashMobile ?? undefined,
|
|
292
|
-
|
|
295
|
+
viewerGroupId: row.groupId ?? undefined,
|
|
293
296
|
shortSummary: row.shortSummary ?? undefined,
|
|
294
297
|
summaryState: row.summaryState ?? undefined,
|
|
295
298
|
summaryUpdatedAt: row.summaryUpdatedAt ?? undefined,
|
|
@@ -508,6 +511,10 @@ export class PilotSwarmClient {
|
|
|
508
511
|
...(opts?.clientMessageIds && opts.clientMessageIds.length > 0
|
|
509
512
|
? { clientMessageIds: opts.clientMessageIds }
|
|
510
513
|
: {}),
|
|
514
|
+
...(() => {
|
|
515
|
+
const sender = normalizeMessageSender(opts?.sender);
|
|
516
|
+
return sender ? { sender } : {};
|
|
517
|
+
})(),
|
|
511
518
|
}));
|
|
512
519
|
trace(`[client] enqueueEvent done (${Date.now() - enqueueAt}ms bootstrap=${opts?.bootstrap === true})`);
|
|
513
520
|
trace("[client] ensureOrchestrationAndSend complete");
|
|
@@ -679,7 +686,7 @@ export class PilotSwarmClient {
|
|
|
679
686
|
title: cmsRow?.title ?? undefined,
|
|
680
687
|
agentId: cmsRow?.agentId ?? undefined,
|
|
681
688
|
owner: cmsRow?.owner ?? undefined,
|
|
682
|
-
|
|
689
|
+
viewerGroupId: cmsRow?.groupId ?? undefined,
|
|
683
690
|
shortSummary: cmsRow?.shortSummary ?? undefined,
|
|
684
691
|
summaryState: cmsRow?.summaryState ?? undefined,
|
|
685
692
|
summaryUpdatedAt: cmsRow?.summaryUpdatedAt ?? undefined,
|