@agentdock/wire 0.0.81 → 0.0.91
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/dist/activityPreferences.js +1 -2
- package/dist/agentCapabilities.d.ts +2 -0
- package/dist/agentCapabilities.js +1 -199
- package/dist/agentCommonEnv.js +1 -20
- package/dist/agentInstallGuide.js +1 -81
- package/dist/bgTask.js +1 -128
- package/dist/checkpointSchemas.d.ts +142 -98
- package/dist/checkpointSchemas.js +1 -46
- package/dist/controlLevel.js +1 -11
- package/dist/edition.js +1 -13
- package/dist/envelope.d.ts +5668 -563
- package/dist/envelope.js +1 -77
- package/dist/errorMessage.js +1 -6
- package/dist/events.d.ts +2053 -324
- package/dist/events.js +1 -107
- package/dist/features.js +1 -123
- package/dist/feedback.d.ts +2 -2
- package/dist/feedback.js +1 -61
- package/dist/fileWhitelist.js +1 -189
- package/dist/inboundEvents.d.ts +531 -0
- package/dist/inboundEvents.js +1 -0
- package/dist/index.d.ts +11 -5
- package/dist/index.js +1 -73
- package/dist/interactionEvents.d.ts +153 -106
- package/dist/interactionEvents.js +1 -111
- package/dist/legacyProtocol.d.ts +512 -272
- package/dist/legacyProtocol.js +1 -30
- package/dist/license.js +1 -28
- package/dist/machine.d.ts +108 -62
- package/dist/machine.js +1 -66
- package/dist/messageMeta.d.ts +34 -28
- package/dist/messageMeta.js +1 -60
- package/dist/messages.d.ts +34900 -1862
- package/dist/messages.js +1 -35
- package/dist/notification.d.ts +48 -0
- package/dist/notification.js +1 -0
- package/dist/ops.d.ts +165 -122
- package/dist/ops.js +1 -74
- package/dist/pairing.d.ts +4 -4
- package/dist/pairing.js +1 -150
- package/dist/permissionSubject.js +1 -68
- package/dist/protocol.js +1 -7
- package/dist/rpc.d.ts +749 -189
- package/dist/rpc.js +1 -269
- package/dist/scheduledTasks.d.ts +619 -304
- package/dist/scheduledTasks.js +1 -188
- package/dist/semver.js +1 -60
- package/dist/sessionResult.d.ts +31 -17
- package/dist/sessionResult.js +1 -23
- package/dist/socketEvents.d.ts +7 -0
- package/dist/socketEvents.js +1 -55
- package/dist/sourceMetadata.d.ts +44 -0
- package/dist/sourceMetadata.js +1 -0
- package/dist/spawnError.d.ts +21 -17
- package/dist/spawnError.js +1 -31
- package/dist/stats.d.ts +73 -73
- package/dist/stats.js +1 -117
- package/dist/sync.d.ts +2165 -819
- package/dist/sync.js +1 -99
- package/dist/taskResult.js +1 -113
- package/dist/telemetry.d.ts +120 -64
- package/dist/telemetry.js +1 -115
- package/dist/utils.js +1 -2
- package/package.json +3 -2
- package/dist/activityPreferences.d.ts.map +0 -1
- package/dist/activityPreferences.js.map +0 -1
- package/dist/agentCapabilities.d.ts.map +0 -1
- package/dist/agentCapabilities.js.map +0 -1
- package/dist/agentCommonEnv.d.ts.map +0 -1
- package/dist/agentCommonEnv.js.map +0 -1
- package/dist/agentInstallGuide.d.ts.map +0 -1
- package/dist/agentInstallGuide.js.map +0 -1
- package/dist/bgTask.d.ts.map +0 -1
- package/dist/bgTask.js.map +0 -1
- package/dist/checkpointSchemas.d.ts.map +0 -1
- package/dist/checkpointSchemas.js.map +0 -1
- package/dist/controlLevel.d.ts.map +0 -1
- package/dist/controlLevel.js.map +0 -1
- package/dist/edition.d.ts.map +0 -1
- package/dist/edition.js.map +0 -1
- package/dist/envelope.d.ts.map +0 -1
- package/dist/envelope.js.map +0 -1
- package/dist/errorMessage.d.ts.map +0 -1
- package/dist/errorMessage.js.map +0 -1
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/features.d.ts.map +0 -1
- package/dist/features.js.map +0 -1
- package/dist/feedback.d.ts.map +0 -1
- package/dist/feedback.js.map +0 -1
- package/dist/fileWhitelist.d.ts.map +0 -1
- package/dist/fileWhitelist.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/interactionEvents.d.ts.map +0 -1
- package/dist/interactionEvents.js.map +0 -1
- package/dist/legacyProtocol.d.ts.map +0 -1
- package/dist/legacyProtocol.js.map +0 -1
- package/dist/license.d.ts.map +0 -1
- package/dist/license.js.map +0 -1
- package/dist/machine.d.ts.map +0 -1
- package/dist/machine.js.map +0 -1
- package/dist/messageMeta.d.ts.map +0 -1
- package/dist/messageMeta.js.map +0 -1
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js.map +0 -1
- package/dist/ops.d.ts.map +0 -1
- package/dist/ops.js.map +0 -1
- package/dist/pairing.d.ts.map +0 -1
- package/dist/pairing.js.map +0 -1
- package/dist/permissionSubject.d.ts.map +0 -1
- package/dist/permissionSubject.js.map +0 -1
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js.map +0 -1
- package/dist/rpc.d.ts.map +0 -1
- package/dist/rpc.js.map +0 -1
- package/dist/scheduledTasks.d.ts.map +0 -1
- package/dist/scheduledTasks.js.map +0 -1
- package/dist/semver.d.ts.map +0 -1
- package/dist/semver.js.map +0 -1
- package/dist/sessionResult.d.ts.map +0 -1
- package/dist/sessionResult.js.map +0 -1
- package/dist/socketEvents.d.ts.map +0 -1
- package/dist/socketEvents.js.map +0 -1
- package/dist/spawnError.d.ts.map +0 -1
- package/dist/spawnError.js.map +0 -1
- package/dist/stats.d.ts.map +0 -1
- package/dist/stats.js.map +0 -1
- package/dist/sync.d.ts.map +0 -1
- package/dist/sync.js.map +0 -1
- package/dist/taskResult.d.ts.map +0 -1
- package/dist/taskResult.js.map +0 -1
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/telemetry.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
package/dist/messages.js
CHANGED
|
@@ -1,35 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Message schemas.
|
|
3
|
-
*
|
|
4
|
-
* SessionMessage: encrypted content container.
|
|
5
|
-
* Timestamps are Unix numbers (milliseconds).
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
import { SessionEnvelopeSchema } from './envelope.js';
|
|
9
|
-
import { MessageMetaSchema } from './messageMeta.js';
|
|
10
|
-
import { UserMessageSchema, AgentMessageSchema } from './legacyProtocol.js';
|
|
11
|
-
export const SessionMessageContentSchema = z.object({
|
|
12
|
-
c: z.string(),
|
|
13
|
-
t: z.enum(['encrypted', 'plaintext']),
|
|
14
|
-
});
|
|
15
|
-
export const SessionMessageSchema = z.object({
|
|
16
|
-
id: z.string(),
|
|
17
|
-
seq: z.number(),
|
|
18
|
-
localId: z.string().nullish(),
|
|
19
|
-
content: SessionMessageContentSchema,
|
|
20
|
-
createdAt: z.number(),
|
|
21
|
-
updatedAt: z.number(),
|
|
22
|
-
});
|
|
23
|
-
// ── SessionProtocolMessage (bridges envelope into message content) ──
|
|
24
|
-
export const SessionProtocolMessageSchema = z.object({
|
|
25
|
-
role: z.literal('session'),
|
|
26
|
-
content: SessionEnvelopeSchema,
|
|
27
|
-
meta: MessageMetaSchema.optional(),
|
|
28
|
-
});
|
|
29
|
-
// ── MessageContent (union of all message content types) ─────────────
|
|
30
|
-
export const MessageContentSchema = z.discriminatedUnion('role', [
|
|
31
|
-
UserMessageSchema,
|
|
32
|
-
AgentMessageSchema,
|
|
33
|
-
SessionProtocolMessageSchema,
|
|
34
|
-
]);
|
|
35
|
-
//# sourceMappingURL=messages.js.map
|
|
1
|
+
"use strict";import{z as e}from"zod";import{SessionEnvelopeSchema as t}from"./envelope.js";import{MessageMetaSchema as s}from"./messageMeta.js";import{UserMessageSchema as o,AgentMessageSchema as n}from"./legacyProtocol.js";export const SessionMessageContentSchema=e.object({c:e.string(),t:e.enum(["encrypted","plaintext"])}).passthrough(),SessionMessageSchema=e.object({id:e.string(),seq:e.number(),localId:e.string().nullish(),content:SessionMessageContentSchema,createdAt:e.number(),updatedAt:e.number()}).passthrough(),SessionProtocolMessageSchema=e.object({role:e.literal("session"),content:t,meta:s.optional()}).passthrough(),MessageContentSchema=e.discriminatedUnion("role",[o,n,SessionProtocolMessageSchema]);
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Event categories accepted by the daemon's local notification dispatcher. */
|
|
3
|
+
export declare const NotificationEventTypeSchema: z.ZodEnum<["completed", "error", "task_completed", "task_failed", "budget_warning", "daemon_disconnected"]>;
|
|
4
|
+
export type NotificationEventType = z.infer<typeof NotificationEventTypeSchema>;
|
|
5
|
+
/** Server-to-daemon RPC payload for dispatching a local IM notification. */
|
|
6
|
+
export declare const DispatchNotificationParamsSchema: z.ZodObject<{
|
|
7
|
+
type: z.ZodEnum<["completed", "error", "task_completed", "task_failed", "budget_warning", "daemon_disconnected"]>;
|
|
8
|
+
title: z.ZodString;
|
|
9
|
+
body: z.ZodString;
|
|
10
|
+
machineId: z.ZodString;
|
|
11
|
+
machineHostname: z.ZodDefault<z.ZodString>;
|
|
12
|
+
sessionId: z.ZodOptional<z.ZodString>;
|
|
13
|
+
taskId: z.ZodOptional<z.ZodString>;
|
|
14
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
15
|
+
url: z.ZodOptional<z.ZodString>;
|
|
16
|
+
}, "strict", z.ZodTypeAny, {
|
|
17
|
+
url?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
url?: string | undefined;
|
|
20
|
+
}>>;
|
|
21
|
+
timestamp: z.ZodNumber;
|
|
22
|
+
}, "strict", z.ZodTypeAny, {
|
|
23
|
+
type: "completed" | "error" | "task_completed" | "task_failed" | "budget_warning" | "daemon_disconnected";
|
|
24
|
+
title: string;
|
|
25
|
+
machineId: string;
|
|
26
|
+
timestamp: number;
|
|
27
|
+
body: string;
|
|
28
|
+
machineHostname: string;
|
|
29
|
+
data?: {
|
|
30
|
+
url?: string | undefined;
|
|
31
|
+
} | undefined;
|
|
32
|
+
sessionId?: string | undefined;
|
|
33
|
+
taskId?: string | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
type: "completed" | "error" | "task_completed" | "task_failed" | "budget_warning" | "daemon_disconnected";
|
|
36
|
+
title: string;
|
|
37
|
+
machineId: string;
|
|
38
|
+
timestamp: number;
|
|
39
|
+
body: string;
|
|
40
|
+
data?: {
|
|
41
|
+
url?: string | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
sessionId?: string | undefined;
|
|
44
|
+
taskId?: string | undefined;
|
|
45
|
+
machineHostname?: string | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
export type DispatchNotificationParams = z.infer<typeof DispatchNotificationParamsSchema>;
|
|
48
|
+
//# sourceMappingURL=notification.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{z as t}from"zod";export const NotificationEventTypeSchema=t.enum(["completed","error","task_completed","task_failed","budget_warning","daemon_disconnected"]),DispatchNotificationParamsSchema=t.object({type:NotificationEventTypeSchema,title:t.string(),body:t.string(),machineId:t.string(),machineHostname:t.string().default(""),sessionId:t.string().optional(),taskId:t.string().optional(),data:t.object({url:t.string().optional()}).strict().optional(),timestamp:t.number()}).strict();
|
package/dist/ops.d.ts
CHANGED
|
@@ -9,23 +9,38 @@ export declare const OpsMethodSchema: z.ZodString;
|
|
|
9
9
|
export type OpsMethod = z.infer<typeof OpsMethodSchema>;
|
|
10
10
|
export declare const OpsRpcTypeSchema: z.ZodEnum<["request", "response", "event"]>;
|
|
11
11
|
export type OpsRpcType = z.infer<typeof OpsRpcTypeSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* Docker image reference — used for system-upgrade imageTag validation.
|
|
14
|
+
*
|
|
15
|
+
* SECURITY (2026-07-27 #M1): the imageTag flows enterprise-admin → Ops Agent →
|
|
16
|
+
* `prepareSharedSystem` → `execAsync(\`docker create ... "${image}"\`)` which runs
|
|
17
|
+
* via a shell. Without a whitelist, an authenticated enterprise admin can inject
|
|
18
|
+
* `$(...)` / backticks inside the double quotes and achieve RCE on the Ops Agent
|
|
19
|
+
* host. This regex is an ALLOW-list of the only characters a valid image ref can
|
|
20
|
+
* contain (`registry[:port]/namespace/name[:tag][@digest]`); every shell
|
|
21
|
+
* metacharacter (`$` `` ` `` `"` `'` space `;` `|` `&` `(` `)` `<` `>` `\`) is
|
|
22
|
+
* excluded, so a passing value is safe to interpolate. Fail-closed: reject on any
|
|
23
|
+
* non-matching character rather than sanitizing.
|
|
24
|
+
*/
|
|
25
|
+
export declare const DockerImageRefSchema: z.ZodString;
|
|
26
|
+
export type DockerImageRef = z.infer<typeof DockerImageRefSchema>;
|
|
12
27
|
/** Unified RPC message over the ops-upstream tunnel. */
|
|
13
28
|
export declare const OpsRpcMessageSchema: z.ZodObject<{
|
|
14
29
|
id: z.ZodString;
|
|
15
30
|
type: z.ZodEnum<["request", "response", "event"]>;
|
|
16
31
|
method: z.ZodString;
|
|
17
32
|
payload: z.ZodUnknown;
|
|
18
|
-
}, "
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
method:
|
|
22
|
-
payload
|
|
23
|
-
}, {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
method:
|
|
27
|
-
payload
|
|
28
|
-
}
|
|
33
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
34
|
+
id: z.ZodString;
|
|
35
|
+
type: z.ZodEnum<["request", "response", "event"]>;
|
|
36
|
+
method: z.ZodString;
|
|
37
|
+
payload: z.ZodUnknown;
|
|
38
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
type: z.ZodEnum<["request", "response", "event"]>;
|
|
41
|
+
method: z.ZodString;
|
|
42
|
+
payload: z.ZodUnknown;
|
|
43
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
29
44
|
export type OpsRpcMessage = z.infer<typeof OpsRpcMessageSchema>;
|
|
30
45
|
/** Metrics tracked per ops tunnel connection (RFC-034 R7). */
|
|
31
46
|
export interface OpsTunnelMetrics {
|
|
@@ -42,19 +57,19 @@ export declare const FileEntrySchema: z.ZodObject<{
|
|
|
42
57
|
size: z.ZodNumber;
|
|
43
58
|
modifiedAt: z.ZodNumber;
|
|
44
59
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
45
|
-
}, "
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
size:
|
|
49
|
-
modifiedAt:
|
|
50
|
-
mimeType
|
|
51
|
-
}, {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
size:
|
|
55
|
-
modifiedAt:
|
|
56
|
-
mimeType
|
|
57
|
-
}
|
|
60
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
type: z.ZodEnum<["file", "directory"]>;
|
|
63
|
+
size: z.ZodNumber;
|
|
64
|
+
modifiedAt: z.ZodNumber;
|
|
65
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
66
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
67
|
+
name: z.ZodString;
|
|
68
|
+
type: z.ZodEnum<["file", "directory"]>;
|
|
69
|
+
size: z.ZodNumber;
|
|
70
|
+
modifiedAt: z.ZodNumber;
|
|
71
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
58
73
|
export type FileEntry = z.infer<typeof FileEntrySchema>;
|
|
59
74
|
export declare const FileStatSchema: z.ZodObject<{
|
|
60
75
|
name: z.ZodString;
|
|
@@ -64,37 +79,37 @@ export declare const FileStatSchema: z.ZodObject<{
|
|
|
64
79
|
modifiedAt: z.ZodString;
|
|
65
80
|
createdAt: z.ZodString;
|
|
66
81
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
67
|
-
}, "
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
size:
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
mimeType
|
|
75
|
-
}, {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
size:
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
mimeType
|
|
83
|
-
}
|
|
82
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
83
|
+
name: z.ZodString;
|
|
84
|
+
path: z.ZodString;
|
|
85
|
+
type: z.ZodEnum<["file", "directory"]>;
|
|
86
|
+
size: z.ZodNumber;
|
|
87
|
+
modifiedAt: z.ZodString;
|
|
88
|
+
createdAt: z.ZodString;
|
|
89
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
91
|
+
name: z.ZodString;
|
|
92
|
+
path: z.ZodString;
|
|
93
|
+
type: z.ZodEnum<["file", "directory"]>;
|
|
94
|
+
size: z.ZodNumber;
|
|
95
|
+
modifiedAt: z.ZodString;
|
|
96
|
+
createdAt: z.ZodString;
|
|
97
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
84
99
|
export type FileStat = z.infer<typeof FileStatSchema>;
|
|
85
100
|
export declare const StorageUsageSchema: z.ZodObject<{
|
|
86
101
|
used: z.ZodNumber;
|
|
87
102
|
limit: z.ZodNumber;
|
|
88
103
|
fileCount: z.ZodNumber;
|
|
89
|
-
}, "
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
fileCount:
|
|
93
|
-
}, {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
fileCount:
|
|
97
|
-
}
|
|
104
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
105
|
+
used: z.ZodNumber;
|
|
106
|
+
limit: z.ZodNumber;
|
|
107
|
+
fileCount: z.ZodNumber;
|
|
108
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
109
|
+
used: z.ZodNumber;
|
|
110
|
+
limit: z.ZodNumber;
|
|
111
|
+
fileCount: z.ZodNumber;
|
|
112
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
98
113
|
export type StorageUsage = z.infer<typeof StorageUsageSchema>;
|
|
99
114
|
/** A single user record in a full sync push. */
|
|
100
115
|
export declare const SyncUserSchema: z.ZodObject<{
|
|
@@ -104,21 +119,21 @@ export declare const SyncUserSchema: z.ZodObject<{
|
|
|
104
119
|
containerStatus: z.ZodString;
|
|
105
120
|
healthStatus: z.ZodNullable<z.ZodString>;
|
|
106
121
|
enabled: z.ZodBoolean;
|
|
107
|
-
}, "
|
|
108
|
-
|
|
109
|
-
displayName:
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}, {
|
|
115
|
-
|
|
116
|
-
displayName:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
123
|
+
username: z.ZodString;
|
|
124
|
+
displayName: z.ZodString;
|
|
125
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
126
|
+
containerStatus: z.ZodString;
|
|
127
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
128
|
+
enabled: z.ZodBoolean;
|
|
129
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
130
|
+
username: z.ZodString;
|
|
131
|
+
displayName: z.ZodString;
|
|
132
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
133
|
+
containerStatus: z.ZodString;
|
|
134
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
135
|
+
enabled: z.ZodBoolean;
|
|
136
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
122
137
|
export type SyncUser = z.infer<typeof SyncUserSchema>;
|
|
123
138
|
/** sync.full — all users pushed on tunnel connect/reconnect. */
|
|
124
139
|
export declare const SyncFullPayloadSchema: z.ZodObject<{
|
|
@@ -129,78 +144,106 @@ export declare const SyncFullPayloadSchema: z.ZodObject<{
|
|
|
129
144
|
containerStatus: z.ZodString;
|
|
130
145
|
healthStatus: z.ZodNullable<z.ZodString>;
|
|
131
146
|
enabled: z.ZodBoolean;
|
|
132
|
-
}, "
|
|
133
|
-
|
|
134
|
-
displayName:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}, {
|
|
140
|
-
|
|
141
|
-
displayName:
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
147
|
-
}, "
|
|
148
|
-
users: {
|
|
149
|
-
|
|
150
|
-
displayName:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
machineId:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
147
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
148
|
+
username: z.ZodString;
|
|
149
|
+
displayName: z.ZodString;
|
|
150
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
151
|
+
containerStatus: z.ZodString;
|
|
152
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
153
|
+
enabled: z.ZodBoolean;
|
|
154
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
155
|
+
username: z.ZodString;
|
|
156
|
+
displayName: z.ZodString;
|
|
157
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
158
|
+
containerStatus: z.ZodString;
|
|
159
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
160
|
+
enabled: z.ZodBoolean;
|
|
161
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
162
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
163
|
+
users: z.ZodArray<z.ZodObject<{
|
|
164
|
+
username: z.ZodString;
|
|
165
|
+
displayName: z.ZodString;
|
|
166
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
167
|
+
containerStatus: z.ZodString;
|
|
168
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
169
|
+
enabled: z.ZodBoolean;
|
|
170
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
171
|
+
username: z.ZodString;
|
|
172
|
+
displayName: z.ZodString;
|
|
173
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
174
|
+
containerStatus: z.ZodString;
|
|
175
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
176
|
+
enabled: z.ZodBoolean;
|
|
177
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
178
|
+
username: z.ZodString;
|
|
179
|
+
displayName: z.ZodString;
|
|
180
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
181
|
+
containerStatus: z.ZodString;
|
|
182
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
183
|
+
enabled: z.ZodBoolean;
|
|
184
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
185
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
186
|
+
users: z.ZodArray<z.ZodObject<{
|
|
187
|
+
username: z.ZodString;
|
|
188
|
+
displayName: z.ZodString;
|
|
189
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
190
|
+
containerStatus: z.ZodString;
|
|
191
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
192
|
+
enabled: z.ZodBoolean;
|
|
193
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
194
|
+
username: z.ZodString;
|
|
195
|
+
displayName: z.ZodString;
|
|
196
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
197
|
+
containerStatus: z.ZodString;
|
|
198
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
199
|
+
enabled: z.ZodBoolean;
|
|
200
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
201
|
+
username: z.ZodString;
|
|
202
|
+
displayName: z.ZodString;
|
|
203
|
+
machineId: z.ZodNullable<z.ZodString>;
|
|
204
|
+
containerStatus: z.ZodString;
|
|
205
|
+
healthStatus: z.ZodNullable<z.ZodString>;
|
|
206
|
+
enabled: z.ZodBoolean;
|
|
207
|
+
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
208
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
166
209
|
export type SyncFullPayload = z.infer<typeof SyncFullPayloadSchema>;
|
|
167
210
|
/** sync.user-created — single user just created. */
|
|
168
211
|
export declare const SyncUserCreatedPayloadSchema: z.ZodObject<{
|
|
169
212
|
username: z.ZodString;
|
|
170
213
|
displayName: z.ZodString;
|
|
171
|
-
}, "
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}, {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
214
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
215
|
+
username: z.ZodString;
|
|
216
|
+
displayName: z.ZodString;
|
|
217
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
218
|
+
username: z.ZodString;
|
|
219
|
+
displayName: z.ZodString;
|
|
220
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
178
221
|
export type SyncUserCreatedPayload = z.infer<typeof SyncUserCreatedPayloadSchema>;
|
|
179
222
|
/** sync.container-status — container state change. */
|
|
180
223
|
export declare const SyncContainerStatusPayloadSchema: z.ZodObject<{
|
|
181
224
|
username: z.ZodString;
|
|
182
225
|
containerStatus: z.ZodString;
|
|
183
226
|
healthStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
|
-
}, "
|
|
185
|
-
username:
|
|
186
|
-
containerStatus:
|
|
187
|
-
healthStatus
|
|
188
|
-
}, {
|
|
189
|
-
username:
|
|
190
|
-
containerStatus:
|
|
191
|
-
healthStatus
|
|
192
|
-
}
|
|
227
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
228
|
+
username: z.ZodString;
|
|
229
|
+
containerStatus: z.ZodString;
|
|
230
|
+
healthStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
232
|
+
username: z.ZodString;
|
|
233
|
+
containerStatus: z.ZodString;
|
|
234
|
+
healthStatus: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
235
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
193
236
|
export type SyncContainerStatusPayload = z.infer<typeof SyncContainerStatusPayloadSchema>;
|
|
194
237
|
/** sync.user-paired — daemon pairing detected, machineId available. */
|
|
195
238
|
export declare const SyncUserPairedPayloadSchema: z.ZodObject<{
|
|
196
239
|
username: z.ZodString;
|
|
197
240
|
machineId: z.ZodString;
|
|
198
|
-
}, "
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
}, {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
241
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
242
|
+
username: z.ZodString;
|
|
243
|
+
machineId: z.ZodString;
|
|
244
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
245
|
+
username: z.ZodString;
|
|
246
|
+
machineId: z.ZodString;
|
|
247
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
205
248
|
export type SyncUserPairedPayload = z.infer<typeof SyncUserPairedPayloadSchema>;
|
|
206
249
|
//# sourceMappingURL=ops.d.ts.map
|
package/dist/ops.js
CHANGED
|
@@ -1,74 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
/**
|
|
3
|
-
* Ops RPC method naming convention: namespace.action
|
|
4
|
-
* - file.* — RFC-033 file management
|
|
5
|
-
* - sync.* — RFC-034 data sync (Ops Agent → Server)
|
|
6
|
-
* - config.* — RFC-034 policy push (Server → Ops Agent)
|
|
7
|
-
*/
|
|
8
|
-
export const OpsMethodSchema = z
|
|
9
|
-
.string()
|
|
10
|
-
.min(1)
|
|
11
|
-
.regex(/^[a-z]+\.[a-z][a-z0-9-]*$/);
|
|
12
|
-
export const OpsRpcTypeSchema = z.enum(['request', 'response', 'event']);
|
|
13
|
-
/** Unified RPC message over the ops-upstream tunnel. */
|
|
14
|
-
export const OpsRpcMessageSchema = z.object({
|
|
15
|
-
id: z.string().min(1),
|
|
16
|
-
type: OpsRpcTypeSchema,
|
|
17
|
-
method: OpsMethodSchema,
|
|
18
|
-
payload: z.unknown(),
|
|
19
|
-
});
|
|
20
|
-
// FileEntry — directory listing item (shared by Ops RPC tunnel and REST API).
|
|
21
|
-
export const FileEntrySchema = z.object({
|
|
22
|
-
name: z.string(),
|
|
23
|
-
type: z.enum(['file', 'directory']),
|
|
24
|
-
size: z.number().int().nonnegative(),
|
|
25
|
-
modifiedAt: z.number(),
|
|
26
|
-
mimeType: z.string().optional(),
|
|
27
|
-
});
|
|
28
|
-
// FileStat — detailed metadata
|
|
29
|
-
export const FileStatSchema = z.object({
|
|
30
|
-
name: z.string(),
|
|
31
|
-
path: z.string(),
|
|
32
|
-
type: z.enum(['file', 'directory']),
|
|
33
|
-
size: z.number().int().nonnegative(),
|
|
34
|
-
modifiedAt: z.string(),
|
|
35
|
-
createdAt: z.string(),
|
|
36
|
-
mimeType: z.string().optional(),
|
|
37
|
-
});
|
|
38
|
-
// StorageUsage — quota info
|
|
39
|
-
export const StorageUsageSchema = z.object({
|
|
40
|
-
used: z.number().int().nonnegative(),
|
|
41
|
-
limit: z.number().int().nonnegative(),
|
|
42
|
-
fileCount: z.number().int().nonnegative(),
|
|
43
|
-
});
|
|
44
|
-
// ─── Sync payloads (RFC-034 P1) ─────────────────────────
|
|
45
|
-
/** A single user record in a full sync push. */
|
|
46
|
-
export const SyncUserSchema = z.object({
|
|
47
|
-
username: z.string().min(1),
|
|
48
|
-
displayName: z.string(),
|
|
49
|
-
machineId: z.string().nullable(),
|
|
50
|
-
containerStatus: z.string(),
|
|
51
|
-
healthStatus: z.string().nullable(),
|
|
52
|
-
enabled: z.boolean(),
|
|
53
|
-
});
|
|
54
|
-
/** sync.full — all users pushed on tunnel connect/reconnect. */
|
|
55
|
-
export const SyncFullPayloadSchema = z.object({
|
|
56
|
-
users: z.array(SyncUserSchema),
|
|
57
|
-
});
|
|
58
|
-
/** sync.user-created — single user just created. */
|
|
59
|
-
export const SyncUserCreatedPayloadSchema = z.object({
|
|
60
|
-
username: z.string().min(1),
|
|
61
|
-
displayName: z.string(),
|
|
62
|
-
});
|
|
63
|
-
/** sync.container-status — container state change. */
|
|
64
|
-
export const SyncContainerStatusPayloadSchema = z.object({
|
|
65
|
-
username: z.string().min(1),
|
|
66
|
-
containerStatus: z.string(),
|
|
67
|
-
healthStatus: z.string().nullable().optional(),
|
|
68
|
-
});
|
|
69
|
-
/** sync.user-paired — daemon pairing detected, machineId available. */
|
|
70
|
-
export const SyncUserPairedPayloadSchema = z.object({
|
|
71
|
-
username: z.string().min(1),
|
|
72
|
-
machineId: z.string().min(1),
|
|
73
|
-
});
|
|
74
|
-
//# sourceMappingURL=ops.js.map
|
|
1
|
+
"use strict";import{z as e}from"zod";export const OpsMethodSchema=e.string().min(1).regex(/^[a-z]+\.[a-z][a-z0-9-]*$/),OpsRpcTypeSchema=e.enum(["request","response","event"]),DockerImageRefSchema=e.string().min(1).max(256).regex(/^[a-zA-Z0-9][a-zA-Z0-9._/:@-]*$/),OpsRpcMessageSchema=e.object({id:e.string().min(1),type:OpsRpcTypeSchema,method:OpsMethodSchema,payload:e.unknown()}).passthrough(),FileEntrySchema=e.object({name:e.string(),type:e.enum(["file","directory"]),size:e.number().int().nonnegative(),modifiedAt:e.number(),mimeType:e.string().optional()}).passthrough(),FileStatSchema=e.object({name:e.string(),path:e.string(),type:e.enum(["file","directory"]),size:e.number().int().nonnegative(),modifiedAt:e.string(),createdAt:e.string(),mimeType:e.string().optional()}).passthrough(),StorageUsageSchema=e.object({used:e.number().int().nonnegative(),limit:e.number().int().nonnegative(),fileCount:e.number().int().nonnegative()}).passthrough(),SyncUserSchema=e.object({username:e.string().min(1),displayName:e.string(),machineId:e.string().nullable(),containerStatus:e.string(),healthStatus:e.string().nullable(),enabled:e.boolean()}).passthrough(),SyncFullPayloadSchema=e.object({users:e.array(SyncUserSchema)}).passthrough(),SyncUserCreatedPayloadSchema=e.object({username:e.string().min(1),displayName:e.string()}).passthrough(),SyncContainerStatusPayloadSchema=e.object({username:e.string().min(1),containerStatus:e.string(),healthStatus:e.string().nullable().optional()}).passthrough(),SyncUserPairedPayloadSchema=e.object({username:e.string().min(1),machineId:e.string().min(1)}).passthrough();
|
package/dist/pairing.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const PairingRequestSchema: z.ZodObject<{
|
|
|
24
24
|
pin: z.ZodOptional<z.ZodString>;
|
|
25
25
|
label: z.ZodOptional<z.ZodString>;
|
|
26
26
|
type: z.ZodOptional<z.ZodEnum<["join", "invite"]>>;
|
|
27
|
-
}, "
|
|
27
|
+
}, "strict", z.ZodTypeAny, {
|
|
28
28
|
publicKey: string;
|
|
29
29
|
type?: "join" | "invite" | undefined;
|
|
30
30
|
label?: string | undefined;
|
|
@@ -44,7 +44,7 @@ export declare const PairingRequestSchema: z.ZodObject<{
|
|
|
44
44
|
export declare const PairingResponseSchema: z.ZodObject<{
|
|
45
45
|
publicKey: z.ZodEffects<z.ZodString, string, string>;
|
|
46
46
|
encryptedPayload: z.ZodString;
|
|
47
|
-
}, "
|
|
47
|
+
}, "strict", z.ZodTypeAny, {
|
|
48
48
|
publicKey: string;
|
|
49
49
|
encryptedPayload: string;
|
|
50
50
|
}, {
|
|
@@ -58,7 +58,7 @@ export declare const PairingResponseSchema: z.ZodObject<{
|
|
|
58
58
|
export declare const PairingExchangeSchema: z.ZodObject<{
|
|
59
59
|
daemonPublicKey: z.ZodEffects<z.ZodString, string, string>;
|
|
60
60
|
devicePublicKey: z.ZodEffects<z.ZodString, string, string>;
|
|
61
|
-
}, "
|
|
61
|
+
}, "strict", z.ZodTypeAny, {
|
|
62
62
|
daemonPublicKey: string;
|
|
63
63
|
devicePublicKey: string;
|
|
64
64
|
}, {
|
|
@@ -72,7 +72,7 @@ export declare const PairingExchangeSchema: z.ZodObject<{
|
|
|
72
72
|
export declare const PairingDeliverSchema: z.ZodObject<{
|
|
73
73
|
publicKey: z.ZodEffects<z.ZodString, string, string>;
|
|
74
74
|
encryptedPayload: z.ZodString;
|
|
75
|
-
}, "
|
|
75
|
+
}, "strict", z.ZodTypeAny, {
|
|
76
76
|
publicKey: string;
|
|
77
77
|
encryptedPayload: string;
|
|
78
78
|
}, {
|