@xtrape/capsule-contracts-node 0.1.0-public-review.1 → 0.3.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 +82 -11
- package/dist/index.cjs +56 -29
- package/dist/index.d.cts +728 -56
- package/dist/index.d.ts +728 -56
- package/dist/index.js +48 -27
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -41,14 +41,14 @@ The package currently exports:
|
|
|
41
41
|
- Zod itself as `z` for consumers that want one compatible Zod instance.
|
|
42
42
|
- Status enum arrays and types: `AgentStatus`, `CapsuleServiceStatus`,
|
|
43
43
|
`HealthStatus`, `CommandStatus`, `DangerLevel`, `AuditActorType`,
|
|
44
|
-
`AuditResult`, `TokenStatus`.
|
|
44
|
+
`AuditResult`, `TokenStatus`, `AgentMode`.
|
|
45
45
|
- Admin schemas: users, sessions, registration token requests/responses.
|
|
46
46
|
- Agent schemas: registration, heartbeat, service report, command result.
|
|
47
47
|
- Capsule Service schemas: manifest, health, config, action, service detail.
|
|
48
48
|
- Command schemas: create command, command detail, command result.
|
|
49
49
|
- Audit and dashboard schemas.
|
|
50
50
|
- System health/version schemas.
|
|
51
|
-
- Helpers: `
|
|
51
|
+
- Helpers: `parseSort`, `paginate`, `HttpError`, `ListQueryBase`.
|
|
52
52
|
|
|
53
53
|
## Validate Agent Registration
|
|
54
54
|
|
|
@@ -58,7 +58,7 @@ import { RegisterAgentRequestSchema } from "@xtrape/capsule-contracts-node";
|
|
|
58
58
|
const request = RegisterAgentRequestSchema.parse(input);
|
|
59
59
|
|
|
60
60
|
// request.registrationToken starts with opstage_reg_
|
|
61
|
-
// request.agent.mode is embedded
|
|
61
|
+
// request.agent.mode is embedded or ophub
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
Lowercase aliases are also exported for backend compatibility:
|
|
@@ -69,6 +69,52 @@ import { registerAgentRequestSchema } from "@xtrape/capsule-contracts-node";
|
|
|
69
69
|
const request = registerAgentRequestSchema.parse(input);
|
|
70
70
|
```
|
|
71
71
|
|
|
72
|
+
## v0.3 OpHub and Metadata
|
|
73
|
+
|
|
74
|
+
v0.3 adds the experimental `ophub` Agent mode. `sidecar` and `base-image`
|
|
75
|
+
remain OpHub deployment forms, but the wire contract should use
|
|
76
|
+
`mode: "ophub"` for an OpHub that represents one or more local Capsule
|
|
77
|
+
Services.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
import { RegisterAgentRequestSchema, ServiceReportRequestSchema } from "@xtrape/capsule-contracts-node";
|
|
81
|
+
|
|
82
|
+
RegisterAgentRequestSchema.parse({
|
|
83
|
+
registrationToken: "opstage_reg_...",
|
|
84
|
+
agent: {
|
|
85
|
+
code: "ophub-a",
|
|
86
|
+
name: "OpHub A",
|
|
87
|
+
mode: "ophub",
|
|
88
|
+
runtime: "go",
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
ServiceReportRequestSchema.parse({
|
|
93
|
+
services: [
|
|
94
|
+
{
|
|
95
|
+
code: "svc-one",
|
|
96
|
+
name: "Service One",
|
|
97
|
+
version: "0.3.0",
|
|
98
|
+
runtime: "nodejs",
|
|
99
|
+
manifest: {
|
|
100
|
+
kind: "CapsuleService",
|
|
101
|
+
code: "svc-one",
|
|
102
|
+
name: "Service One",
|
|
103
|
+
version: "0.3.0",
|
|
104
|
+
runtime: "nodejs",
|
|
105
|
+
agentMode: "ophub",
|
|
106
|
+
capabilities: [{ name: "inventory.read", label: "Inventory read" }],
|
|
107
|
+
events: [{ name: "inventory.changed", direction: "publish", designOnly: true }],
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
],
|
|
111
|
+
});
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Capability metadata is implemented as declarative service metadata. Event
|
|
115
|
+
metadata is intentionally a foundation for future Capsule Bus work; `designOnly`
|
|
116
|
+
events must not be treated as a working event bus.
|
|
117
|
+
|
|
72
118
|
## Validate Service Report
|
|
73
119
|
|
|
74
120
|
```ts
|
|
@@ -249,16 +295,27 @@ Currently exported codes include:
|
|
|
249
295
|
|
|
250
296
|
See the OpenAPI contract and docs site for endpoint-specific errors.
|
|
251
297
|
|
|
252
|
-
## ID
|
|
298
|
+
## ID generation
|
|
299
|
+
|
|
300
|
+
This package validates IDs at the wire boundary (via Zod) but does **not** mint
|
|
301
|
+
them. Until v0.1.x there was a small `newId()` helper plus an `idPrefixes`
|
|
302
|
+
table; both were removed in `0.2.0` to keep the contracts surface focused on
|
|
303
|
+
the wire spec — see [`CHANGELOG.md`](./CHANGELOG.md) and the
|
|
304
|
+
"Breaking changes" section at the top of this README.
|
|
305
|
+
|
|
306
|
+
Consumers that need local ID generation should provide their own factory.
|
|
307
|
+
Example using `nanoid` directly:
|
|
253
308
|
|
|
254
309
|
```ts
|
|
255
|
-
import {
|
|
310
|
+
import { customAlphabet } from "nanoid";
|
|
256
311
|
|
|
257
|
-
const
|
|
312
|
+
const idBody = customAlphabet("0123456789abcdefghijklmnopqrstuvwxyz", 21);
|
|
313
|
+
const commandId = `cmd_${idBody()}`;
|
|
258
314
|
```
|
|
259
315
|
|
|
260
|
-
|
|
261
|
-
`cfg_`, `act_`, `cmd_`, `crs_`, and
|
|
316
|
+
Documented ID prefixes in use across CE and the Agent SDK include `wks_`,
|
|
317
|
+
`usr_`, `agt_`, `tok_`, `svc_`, `hlr_`, `cfg_`, `act_`, `cmd_`, `crs_`, and
|
|
318
|
+
`aud_`. These are enforced by the Zod schemas via `z.string().startsWith(...)`.
|
|
262
319
|
|
|
263
320
|
## List Helpers
|
|
264
321
|
|
|
@@ -290,10 +347,24 @@ const response = paginate(items, query.page, query.pageSize, total);
|
|
|
290
347
|
|
|
291
348
|
| Package | Compatible with |
|
|
292
349
|
| -------------------------------------- | ---------------------------------------- |
|
|
350
|
+
| `@xtrape/capsule-contracts-node@0.2.x` | Opstage CE `0.2.x` and Agent SDK `0.2.x` |
|
|
293
351
|
| `@xtrape/capsule-contracts-node@0.1.x` | Opstage CE `0.1.x` and Agent SDK `0.1.x` |
|
|
294
352
|
|
|
295
|
-
|
|
296
|
-
|
|
353
|
+
Pin matching minor versions across CE, Agent SDK, and Contracts. The wire
|
|
354
|
+
protocol may still evolve before `v1.0`.
|
|
355
|
+
|
|
356
|
+
## Breaking changes in `0.2.0`
|
|
357
|
+
|
|
358
|
+
- **`newId()` removed.** The helper minted random IDs with a prefix; it was
|
|
359
|
+
never used by CE (entity IDs are minted in the backend). External consumers
|
|
360
|
+
that imported `newId` must wire their own factory — see the
|
|
361
|
+
[ID generation](#id-generation) section above.
|
|
362
|
+
- **`idPrefixes` constant and `IdPrefix` type removed.** Same rationale.
|
|
363
|
+
- **`nanoid` runtime dependency removed** as a consequence. Consumers that
|
|
364
|
+
relied on a transitive `nanoid` install must now add it directly.
|
|
365
|
+
|
|
366
|
+
The wire schemas themselves are **unchanged** between `0.1.x` and `0.2.x`;
|
|
367
|
+
existing `0.1.x` agents continue to validate against a `0.2.x` backend.
|
|
297
368
|
|
|
298
369
|
## Schema Stability
|
|
299
370
|
|
|
@@ -309,7 +380,7 @@ guarantees per schema group are:
|
|
|
309
380
|
| `ActionPrepareResultSchema` | Provisional | Added in `0.1.0-public-review.0`. Field shape may still tighten before `v1.0`. |
|
|
310
381
|
| `Command.type` enum | Evolving | Currently `ACTION_PREPARE` / `ACTION_EXECUTE`. New types may be added. |
|
|
311
382
|
| Error codes (`ErrorCode`) | Evolving | New codes may be added. Existing codes will not change meaning before `v1.0`. |
|
|
312
|
-
| Helpers (`
|
|
383
|
+
| Helpers (`parseSort`, `paginate`, `HttpError`, `ListQueryBase`) | Provisional | Helpful for backend-style consumers but not strictly part of the wire spec; may move to a separate utility package in a future minor. (`newId` / `idPrefixes` / `IdPrefix` were removed in `0.2.0` — see "Breaking changes in `0.2.0`" above.) |
|
|
313
384
|
|
|
314
385
|
**Until `v1.0`**, pin to a single minor across CE / Agent SDK / Contracts.
|
|
315
386
|
Breaking changes will be called out in `CHANGELOG.md`.
|
package/dist/index.cjs
CHANGED
|
@@ -27,6 +27,8 @@ __export(index_exports, {
|
|
|
27
27
|
AdminSessionSchema: () => AdminSessionSchema,
|
|
28
28
|
AgentHeartbeatRequestSchema: () => AgentHeartbeatRequestSchema,
|
|
29
29
|
AgentHeartbeatResponseSchema: () => AgentHeartbeatResponseSchema,
|
|
30
|
+
AgentMode: () => AgentMode,
|
|
31
|
+
AgentModeSchema: () => AgentModeSchema,
|
|
30
32
|
AgentSchema: () => AgentSchema,
|
|
31
33
|
AgentStatus: () => AgentStatus,
|
|
32
34
|
AgentStatusSchema: () => AgentStatusSchema,
|
|
@@ -54,6 +56,7 @@ __export(index_exports, {
|
|
|
54
56
|
DangerLevelSchema: () => DangerLevelSchema,
|
|
55
57
|
DashboardSummarySchema: () => DashboardSummarySchema,
|
|
56
58
|
ErrorCode: () => ErrorCode,
|
|
59
|
+
EventMetadataSchema: () => EventMetadataSchema,
|
|
57
60
|
HealthReportInputSchema: () => HealthReportInputSchema,
|
|
58
61
|
HealthReportSchema: () => HealthReportSchema,
|
|
59
62
|
HealthStatus: () => HealthStatus,
|
|
@@ -66,6 +69,9 @@ __export(index_exports, {
|
|
|
66
69
|
ReportCommandResultRequestSchema: () => ReportCommandResultRequestSchema,
|
|
67
70
|
ReportedServiceSchema: () => ReportedServiceSchema,
|
|
68
71
|
RuntimeKindSchema: () => RuntimeKindSchema,
|
|
72
|
+
ServiceCapabilitySchema: () => ServiceCapabilitySchema,
|
|
73
|
+
ServiceKind: () => ServiceKind,
|
|
74
|
+
ServiceKindSchema: () => ServiceKindSchema,
|
|
69
75
|
ServiceReportRequestSchema: () => ServiceReportRequestSchema,
|
|
70
76
|
SystemHealthSchema: () => SystemHealthSchema,
|
|
71
77
|
SystemVersionSchema: () => SystemVersionSchema,
|
|
@@ -80,21 +86,20 @@ __export(index_exports, {
|
|
|
80
86
|
createActionCommandRequestSchema: () => createActionCommandRequestSchema,
|
|
81
87
|
createRegistrationTokenRequestSchema: () => createRegistrationTokenRequestSchema,
|
|
82
88
|
createUserRequestSchema: () => createUserRequestSchema,
|
|
89
|
+
eventMetadataSchema: () => eventMetadataSchema,
|
|
83
90
|
healthReportInputSchema: () => healthReportInputSchema,
|
|
84
|
-
idPrefixes: () => idPrefixes,
|
|
85
|
-
newId: () => newId,
|
|
86
91
|
paginate: () => paginate,
|
|
87
92
|
parseSort: () => parseSort,
|
|
88
93
|
registerAgentRequestSchema: () => registerAgentRequestSchema,
|
|
89
94
|
reportCommandResultRequestSchema: () => reportCommandResultRequestSchema,
|
|
90
95
|
reportedServiceSchema: () => reportedServiceSchema,
|
|
91
96
|
resetUserPasswordRequestSchema: () => resetUserPasswordRequestSchema,
|
|
97
|
+
serviceCapabilitySchema: () => serviceCapabilitySchema,
|
|
92
98
|
serviceReportRequestSchema: () => serviceReportRequestSchema,
|
|
93
99
|
updateUserRequestSchema: () => updateUserRequestSchema,
|
|
94
100
|
z: () => import_zod.z
|
|
95
101
|
});
|
|
96
102
|
module.exports = __toCommonJS(index_exports);
|
|
97
|
-
var import_nanoid = require("nanoid");
|
|
98
103
|
var import_zod = require("zod");
|
|
99
104
|
var AgentStatus = ["PENDING", "ONLINE", "OFFLINE", "DISABLED", "REVOKED"];
|
|
100
105
|
var CapsuleServiceStatus = ["UNKNOWN", "HEALTHY", "UNHEALTHY", "STALE", "OFFLINE"];
|
|
@@ -104,32 +109,16 @@ var DangerLevel = ["LOW", "MEDIUM", "HIGH"];
|
|
|
104
109
|
var AuditActorType = ["USER", "AGENT", "SYSTEM"];
|
|
105
110
|
var AuditResult = ["SUCCESS", "FAILURE"];
|
|
106
111
|
var TokenStatus = ["ACTIVE", "REVOKED", "EXPIRED", "USED"];
|
|
107
|
-
var
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
UNAUTHORIZED: "UNAUTHORIZED",
|
|
111
|
-
FORBIDDEN: "FORBIDDEN",
|
|
112
|
-
NOT_FOUND: "NOT_FOUND",
|
|
113
|
-
CONFLICT: "CONFLICT",
|
|
114
|
-
CSRF_INVALID: "CSRF_INVALID",
|
|
115
|
-
ACTION_REQUIRES_CONFIRMATION: "ACTION_REQUIRES_CONFIRMATION",
|
|
116
|
-
COMMAND_EXPIRED: "COMMAND_EXPIRED",
|
|
117
|
-
TOKEN_REVOKED: "TOKEN_REVOKED",
|
|
118
|
-
TOKEN_EXPIRED: "TOKEN_EXPIRED",
|
|
119
|
-
AGENT_REVOKED: "AGENT_REVOKED",
|
|
120
|
-
AGENT_DISABLED: "AGENT_DISABLED"
|
|
121
|
-
};
|
|
122
|
-
var idPrefixes = ["wks_", "usr_", "agt_", "tok_", "svc_", "hlr_", "cfg_", "act_", "cmd_", "crs_", "aud_"];
|
|
123
|
-
var NANO = (0, import_nanoid.customAlphabet)("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_-", 21);
|
|
124
|
-
function newId(prefix) {
|
|
125
|
-
return `${prefix}${NANO()}`;
|
|
126
|
-
}
|
|
112
|
+
var AgentMode = ["embedded", "ophub"];
|
|
113
|
+
var ServiceKind = ["business", "infrastructure", "system"];
|
|
114
|
+
var ServiceKindSchema = import_zod.z.enum(ServiceKind);
|
|
127
115
|
var AnyJson = import_zod.z.record(import_zod.z.any());
|
|
128
116
|
var AgentStatusSchema = import_zod.z.enum(AgentStatus);
|
|
129
117
|
var CapsuleServiceStatusSchema = import_zod.z.enum(CapsuleServiceStatus);
|
|
130
118
|
var HealthStatusSchema = import_zod.z.enum(HealthStatus);
|
|
131
119
|
var CommandStatusSchema = import_zod.z.enum(CommandStatus);
|
|
132
120
|
var DangerLevelSchema = import_zod.z.enum(DangerLevel).default("LOW");
|
|
121
|
+
var AgentModeSchema = import_zod.z.enum(AgentMode);
|
|
133
122
|
var UserSchema = import_zod.z.object({ id: import_zod.z.string().startsWith("usr_"), username: import_zod.z.string(), displayName: import_zod.z.string().nullable().optional(), createdAt: import_zod.z.string(), updatedAt: import_zod.z.string() });
|
|
134
123
|
var UserRole = import_zod.z.enum(["owner", "operator", "viewer"]);
|
|
135
124
|
var createUserRequestSchema = import_zod.z.object({ username: import_zod.z.string().min(1), password: import_zod.z.string().min(12), displayName: import_zod.z.string().optional(), role: UserRole.default("viewer") });
|
|
@@ -138,24 +127,41 @@ var resetUserPasswordRequestSchema = import_zod.z.object({ password: import_zod.
|
|
|
138
127
|
var AdminLoginRequestSchema = import_zod.z.object({ username: import_zod.z.string().min(1), password: import_zod.z.string().min(1) });
|
|
139
128
|
var adminLoginRequestSchema = AdminLoginRequestSchema;
|
|
140
129
|
var AdminSessionSchema = import_zod.z.object({ user: UserSchema, csrfToken: import_zod.z.string(), expiresAt: import_zod.z.string() });
|
|
141
|
-
var AgentSchema = import_zod.z.object({ id: import_zod.z.string().startsWith("agt_"), code: import_zod.z.string(), name: import_zod.z.string().nullable().optional(), mode:
|
|
130
|
+
var AgentSchema = import_zod.z.object({ id: import_zod.z.string().startsWith("agt_"), code: import_zod.z.string(), name: import_zod.z.string().nullable().optional(), mode: AgentModeSchema, runtime: import_zod.z.string().nullable().optional(), status: AgentStatusSchema, lastHeartbeatAt: import_zod.z.string().nullable().optional(), createdAt: import_zod.z.string(), updatedAt: import_zod.z.string() });
|
|
142
131
|
var RegistrationTokenSchema = import_zod.z.object({ id: import_zod.z.string().startsWith("tok_"), name: import_zod.z.string(), status: import_zod.z.enum(TokenStatus), expiresAt: import_zod.z.string().nullable().optional(), usedAt: import_zod.z.string().nullable().optional(), createdAt: import_zod.z.string() });
|
|
143
132
|
var CreateRegistrationTokenRequestSchema = import_zod.z.object({ name: import_zod.z.string().default("Default registration token").optional(), expiresInSeconds: import_zod.z.number().int().min(60).optional() });
|
|
144
133
|
var createRegistrationTokenRequestSchema = CreateRegistrationTokenRequestSchema;
|
|
145
134
|
var CreateRegistrationTokenResponseSchema = RegistrationTokenSchema.extend({ rawToken: import_zod.z.string().startsWith("opstage_reg_") });
|
|
146
|
-
var
|
|
135
|
+
var ServiceCapabilitySchema = import_zod.z.object({ name: import_zod.z.string().min(1).max(120), label: import_zod.z.string().max(200).optional(), description: import_zod.z.string().max(2e3).optional(), metadata: AnyJson.optional() });
|
|
136
|
+
var serviceCapabilitySchema = ServiceCapabilitySchema;
|
|
137
|
+
var EventMetadataSchema = import_zod.z.object({ name: import_zod.z.string().min(1).max(160), direction: import_zod.z.enum(["publish", "subscribe"]).optional(), schema: AnyJson.optional(), designOnly: import_zod.z.boolean().default(true), metadata: AnyJson.optional() });
|
|
138
|
+
var eventMetadataSchema = EventMetadataSchema;
|
|
139
|
+
var CapsuleManifestSchema = import_zod.z.object({ kind: import_zod.z.literal("CapsuleService"), schemaVersion: import_zod.z.string().default("1.0").optional(), code: import_zod.z.string().min(1), name: import_zod.z.string().min(1), description: import_zod.z.string().optional(), version: import_zod.z.string().min(1), runtime: import_zod.z.enum(["nodejs", "java", "python", "go", "other"]), agentMode: AgentModeSchema, capabilities: import_zod.z.array(import_zod.z.union([import_zod.z.string(), ServiceCapabilitySchema])).optional(), events: import_zod.z.array(EventMetadataSchema).optional(), labels: import_zod.z.record(import_zod.z.string()).optional() }).passthrough();
|
|
147
140
|
var HealthReportInputSchema = import_zod.z.object({ status: HealthStatusSchema, message: import_zod.z.string().optional(), details: AnyJson.optional() });
|
|
148
141
|
var healthReportInputSchema = HealthReportInputSchema;
|
|
149
142
|
var ConfigItemInputSchema = import_zod.z.object({ key: import_zod.z.string(), label: import_zod.z.string().optional(), type: import_zod.z.string(), source: import_zod.z.string().optional(), editable: import_zod.z.boolean().optional(), sensitive: import_zod.z.boolean().optional(), valuePreview: import_zod.z.string().optional(), defaultValue: import_zod.z.string().optional(), secretRef: import_zod.z.string().optional() });
|
|
150
143
|
var configItemInputSchema = ConfigItemInputSchema;
|
|
151
144
|
var ActionDefinitionInputSchema = import_zod.z.object({ name: import_zod.z.string(), label: import_zod.z.string(), description: import_zod.z.string().optional(), dangerLevel: import_zod.z.enum(DangerLevel).default("LOW").optional(), requiresConfirmation: import_zod.z.boolean().optional(), category: import_zod.z.string().optional(), order: import_zod.z.number().int().optional(), inputSchema: AnyJson.optional(), outputSchema: AnyJson.optional(), timeoutSeconds: import_zod.z.number().int().positive().optional() });
|
|
152
145
|
var actionDefinitionInputSchema = ActionDefinitionInputSchema;
|
|
153
|
-
var ReportedServiceSchema = import_zod.z.object({
|
|
146
|
+
var ReportedServiceSchema = import_zod.z.object({
|
|
147
|
+
code: import_zod.z.string().min(1).max(80),
|
|
148
|
+
name: import_zod.z.string().min(1).max(200),
|
|
149
|
+
description: import_zod.z.string().max(2e3).optional(),
|
|
150
|
+
version: import_zod.z.string().max(80).optional(),
|
|
151
|
+
runtime: import_zod.z.string().optional(),
|
|
152
|
+
manifest: AnyJson,
|
|
153
|
+
capabilities: import_zod.z.array(ServiceCapabilitySchema).optional(),
|
|
154
|
+
events: import_zod.z.array(EventMetadataSchema).optional(),
|
|
155
|
+
health: HealthReportInputSchema.optional(),
|
|
156
|
+
configs: import_zod.z.array(ConfigItemInputSchema).optional(),
|
|
157
|
+
actions: import_zod.z.array(ActionDefinitionInputSchema).optional(),
|
|
158
|
+
serviceKind: ServiceKindSchema.optional()
|
|
159
|
+
});
|
|
154
160
|
var reportedServiceSchema = ReportedServiceSchema;
|
|
155
161
|
var ServiceReportRequestSchema = import_zod.z.object({ services: import_zod.z.array(ReportedServiceSchema).min(1) });
|
|
156
162
|
var serviceReportRequestSchema = ServiceReportRequestSchema;
|
|
157
163
|
var RuntimeKindSchema = import_zod.z.enum(["nodejs", "java", "python", "go", "other"]);
|
|
158
|
-
var RegisterAgentRequestSchema = import_zod.z.object({ registrationToken: import_zod.z.string().startsWith("opstage_reg_"), agent: import_zod.z.object({ code: import_zod.z.string(), name: import_zod.z.string().optional(), mode:
|
|
164
|
+
var RegisterAgentRequestSchema = import_zod.z.object({ registrationToken: import_zod.z.string().startsWith("opstage_reg_"), agent: import_zod.z.object({ code: import_zod.z.string(), name: import_zod.z.string().optional(), mode: AgentModeSchema.default("embedded"), runtime: RuntimeKindSchema.or(import_zod.z.string()).optional() }), service: ReportedServiceSchema.optional() });
|
|
159
165
|
var registerAgentRequestSchema = RegisterAgentRequestSchema;
|
|
160
166
|
var RegisterAgentResponseSchema = import_zod.z.object({ agentId: import_zod.z.string().startsWith("agt_"), agentToken: import_zod.z.string().startsWith("opstage_agent_"), heartbeatIntervalSeconds: import_zod.z.number().int(), commandPollIntervalSeconds: import_zod.z.number().int() });
|
|
161
167
|
var AgentHeartbeatResponseSchema = import_zod.z.object({ heartbeatIntervalSeconds: import_zod.z.number().int(), commandPollIntervalSeconds: import_zod.z.number().int() });
|
|
@@ -211,6 +217,21 @@ function parseSort(value, allowed) {
|
|
|
211
217
|
function paginate(items, page, pageSize, total) {
|
|
212
218
|
return { data: items, pagination: { page, pageSize, total } };
|
|
213
219
|
}
|
|
220
|
+
var ErrorCode = {
|
|
221
|
+
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
222
|
+
VALIDATION_FAILED: "VALIDATION_FAILED",
|
|
223
|
+
UNAUTHORIZED: "UNAUTHORIZED",
|
|
224
|
+
FORBIDDEN: "FORBIDDEN",
|
|
225
|
+
NOT_FOUND: "NOT_FOUND",
|
|
226
|
+
CONFLICT: "CONFLICT",
|
|
227
|
+
CSRF_INVALID: "CSRF_INVALID",
|
|
228
|
+
ACTION_REQUIRES_CONFIRMATION: "ACTION_REQUIRES_CONFIRMATION",
|
|
229
|
+
COMMAND_EXPIRED: "COMMAND_EXPIRED",
|
|
230
|
+
TOKEN_REVOKED: "TOKEN_REVOKED",
|
|
231
|
+
TOKEN_EXPIRED: "TOKEN_EXPIRED",
|
|
232
|
+
AGENT_REVOKED: "AGENT_REVOKED",
|
|
233
|
+
AGENT_DISABLED: "AGENT_DISABLED"
|
|
234
|
+
};
|
|
214
235
|
// Annotate the CommonJS export names for ESM import in node:
|
|
215
236
|
0 && (module.exports = {
|
|
216
237
|
ActionDefinitionInputSchema,
|
|
@@ -220,6 +241,8 @@ function paginate(items, page, pageSize, total) {
|
|
|
220
241
|
AdminSessionSchema,
|
|
221
242
|
AgentHeartbeatRequestSchema,
|
|
222
243
|
AgentHeartbeatResponseSchema,
|
|
244
|
+
AgentMode,
|
|
245
|
+
AgentModeSchema,
|
|
223
246
|
AgentSchema,
|
|
224
247
|
AgentStatus,
|
|
225
248
|
AgentStatusSchema,
|
|
@@ -247,6 +270,7 @@ function paginate(items, page, pageSize, total) {
|
|
|
247
270
|
DangerLevelSchema,
|
|
248
271
|
DashboardSummarySchema,
|
|
249
272
|
ErrorCode,
|
|
273
|
+
EventMetadataSchema,
|
|
250
274
|
HealthReportInputSchema,
|
|
251
275
|
HealthReportSchema,
|
|
252
276
|
HealthStatus,
|
|
@@ -259,6 +283,9 @@ function paginate(items, page, pageSize, total) {
|
|
|
259
283
|
ReportCommandResultRequestSchema,
|
|
260
284
|
ReportedServiceSchema,
|
|
261
285
|
RuntimeKindSchema,
|
|
286
|
+
ServiceCapabilitySchema,
|
|
287
|
+
ServiceKind,
|
|
288
|
+
ServiceKindSchema,
|
|
262
289
|
ServiceReportRequestSchema,
|
|
263
290
|
SystemHealthSchema,
|
|
264
291
|
SystemVersionSchema,
|
|
@@ -273,15 +300,15 @@ function paginate(items, page, pageSize, total) {
|
|
|
273
300
|
createActionCommandRequestSchema,
|
|
274
301
|
createRegistrationTokenRequestSchema,
|
|
275
302
|
createUserRequestSchema,
|
|
303
|
+
eventMetadataSchema,
|
|
276
304
|
healthReportInputSchema,
|
|
277
|
-
idPrefixes,
|
|
278
|
-
newId,
|
|
279
305
|
paginate,
|
|
280
306
|
parseSort,
|
|
281
307
|
registerAgentRequestSchema,
|
|
282
308
|
reportCommandResultRequestSchema,
|
|
283
309
|
reportedServiceSchema,
|
|
284
310
|
resetUserPasswordRequestSchema,
|
|
311
|
+
serviceCapabilitySchema,
|
|
285
312
|
serviceReportRequestSchema,
|
|
286
313
|
updateUserRequestSchema,
|
|
287
314
|
z
|