@agentdock/wire 0.0.96 → 0.0.97
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/agentCapabilities.d.ts +5 -2
- package/dist/agentCapabilities.js +1 -1
- package/dist/agentCompatibility.d.ts +83 -0
- package/dist/agentCompatibility.js +1 -0
- package/dist/agentInstallGuide.js +1 -1
- package/dist/checkpointSchemas.d.ts +5 -0
- package/dist/checkpointSchemas.js +1 -1
- package/dist/enterpriseDirectory.d.ts +8 -8
- package/dist/enterpriseFileService.d.ts +7 -0
- package/dist/enterpriseFileService.js +1 -0
- package/dist/enterprisePolicy.d.ts +169 -0
- package/dist/enterprisePolicy.js +1 -1
- package/dist/enterprisePolicyExports.d.ts +4 -2
- package/dist/enterprisePolicyExports.js +1 -1
- package/dist/enterpriseRuntime.d.ts +445 -20
- package/dist/enterpriseRuntime.js +1 -1
- package/dist/enterpriseUserContainer.d.ts +2 -0
- package/dist/enterpriseUserContainer.js +1 -0
- package/dist/gateway.d.ts +6 -6
- package/dist/gatewayUsage.d.ts +26 -10
- package/dist/gatewayUsage.js +1 -1
- package/dist/inboundEvents.d.ts +0 -6
- package/dist/inboundEvents.js +1 -1
- package/dist/index.d.ts +10 -4
- package/dist/index.js +1 -1
- package/dist/interactionEvents.d.ts +2 -2
- package/dist/legacyProtocol.d.ts +36 -36
- package/dist/machine.d.ts +1 -6
- package/dist/machine.js +1 -1
- package/dist/messageMeta.d.ts +9 -7
- package/dist/messageMeta.js +1 -1
- package/dist/messages.d.ts +36 -36
- package/dist/ops.d.ts +112 -0
- package/dist/ops.js +1 -1
- package/dist/opsExports.d.ts +4 -0
- package/dist/opsExports.js +1 -0
- package/dist/pushPreferences.d.ts +12 -0
- package/dist/pushPreferences.js +1 -0
- package/dist/rpc.d.ts +537 -66
- package/dist/rpc.js +1 -1
- package/dist/scheduledTasks.d.ts +96 -21
- package/dist/scheduledTasks.js +1 -1
- package/dist/session.d.ts +4 -0
- package/dist/session.js +1 -0
- package/dist/sessionFiles.d.ts +70 -0
- package/dist/sessionFiles.js +1 -0
- package/dist/sessionSlashCommands.d.ts +15 -0
- package/dist/sessionSlashCommands.js +1 -0
- package/dist/spawnError.d.ts +3 -3
- package/dist/stats.d.ts +31 -31
- package/dist/sync.d.ts +45 -45
- package/dist/sync.js +1 -1
- package/dist/telemetry.d.ts +13 -13
- package/dist/telemetry.js +1 -1
- package/dist/workspaceFileReaderProtocol.d.ts +270 -0
- package/dist/workspaceFileReaderProtocol.js +1 -0
- package/dist/workspaceFileRelay.d.ts +188 -0
- package/dist/workspaceFileRelay.js +1 -0
- package/package.json +1 -1
- package/dist/agentRuntimeSettings.d.ts +0 -139
- package/dist/agentRuntimeSettings.js +0 -1
- package/dist/enterpriseGateway.d.ts +0 -214
- package/dist/enterpriseGateway.js +0 -1
- package/dist/goals.d.ts +0 -829
- package/dist/goals.js +0 -1
package/dist/telemetry.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const TelemetryEventTypeSchema: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
2
|
+
export declare const TelemetryEventTypeSchema: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
3
3
|
export type TelemetryEventType = z.infer<typeof TelemetryEventTypeSchema>;
|
|
4
4
|
export declare function sanitizeContext(type: TelemetryEventType, ctx: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
|
|
5
5
|
export declare const TelemetryEventSchema: z.ZodObject<{
|
|
6
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
6
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
7
7
|
timestamp: z.ZodString;
|
|
8
8
|
agentType: z.ZodOptional<z.ZodString>;
|
|
9
9
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -12,7 +12,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
|
|
|
12
12
|
message: z.ZodString;
|
|
13
13
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
14
14
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
15
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
15
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
16
16
|
timestamp: z.ZodString;
|
|
17
17
|
agentType: z.ZodOptional<z.ZodString>;
|
|
18
18
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -21,7 +21,7 @@ export declare const TelemetryEventSchema: z.ZodObject<{
|
|
|
21
21
|
message: z.ZodString;
|
|
22
22
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
23
23
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
24
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
24
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
25
25
|
timestamp: z.ZodString;
|
|
26
26
|
agentType: z.ZodOptional<z.ZodString>;
|
|
27
27
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -45,7 +45,7 @@ export type TelemetryEventStrict = {
|
|
|
45
45
|
export declare const TelemetryReportPayloadSchema: z.ZodObject<{
|
|
46
46
|
machineId: z.ZodString;
|
|
47
47
|
events: z.ZodArray<z.ZodObject<{
|
|
48
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
48
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
49
49
|
timestamp: z.ZodString;
|
|
50
50
|
agentType: z.ZodOptional<z.ZodString>;
|
|
51
51
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -54,7 +54,7 @@ export declare const TelemetryReportPayloadSchema: z.ZodObject<{
|
|
|
54
54
|
message: z.ZodString;
|
|
55
55
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
56
56
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
57
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
57
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
58
58
|
timestamp: z.ZodString;
|
|
59
59
|
agentType: z.ZodOptional<z.ZodString>;
|
|
60
60
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -63,7 +63,7 @@ export declare const TelemetryReportPayloadSchema: z.ZodObject<{
|
|
|
63
63
|
message: z.ZodString;
|
|
64
64
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
65
65
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
66
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
66
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
67
67
|
timestamp: z.ZodString;
|
|
68
68
|
agentType: z.ZodOptional<z.ZodString>;
|
|
69
69
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -75,7 +75,7 @@ export declare const TelemetryReportPayloadSchema: z.ZodObject<{
|
|
|
75
75
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
76
76
|
machineId: z.ZodString;
|
|
77
77
|
events: z.ZodArray<z.ZodObject<{
|
|
78
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
78
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
79
79
|
timestamp: z.ZodString;
|
|
80
80
|
agentType: z.ZodOptional<z.ZodString>;
|
|
81
81
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -84,7 +84,7 @@ export declare const TelemetryReportPayloadSchema: z.ZodObject<{
|
|
|
84
84
|
message: z.ZodString;
|
|
85
85
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
86
86
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
87
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
87
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
88
88
|
timestamp: z.ZodString;
|
|
89
89
|
agentType: z.ZodOptional<z.ZodString>;
|
|
90
90
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -93,7 +93,7 @@ export declare const TelemetryReportPayloadSchema: z.ZodObject<{
|
|
|
93
93
|
message: z.ZodString;
|
|
94
94
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
95
95
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
96
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
96
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
97
97
|
timestamp: z.ZodString;
|
|
98
98
|
agentType: z.ZodOptional<z.ZodString>;
|
|
99
99
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -105,7 +105,7 @@ export declare const TelemetryReportPayloadSchema: z.ZodObject<{
|
|
|
105
105
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
106
106
|
machineId: z.ZodString;
|
|
107
107
|
events: z.ZodArray<z.ZodObject<{
|
|
108
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
108
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
109
109
|
timestamp: z.ZodString;
|
|
110
110
|
agentType: z.ZodOptional<z.ZodString>;
|
|
111
111
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -114,7 +114,7 @@ export declare const TelemetryReportPayloadSchema: z.ZodObject<{
|
|
|
114
114
|
message: z.ZodString;
|
|
115
115
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
116
116
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
117
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
117
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
118
118
|
timestamp: z.ZodString;
|
|
119
119
|
agentType: z.ZodOptional<z.ZodString>;
|
|
120
120
|
agentVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -123,7 +123,7 @@ export declare const TelemetryReportPayloadSchema: z.ZodObject<{
|
|
|
123
123
|
message: z.ZodString;
|
|
124
124
|
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
125
125
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
126
|
-
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired"]>;
|
|
126
|
+
type: z.ZodEnum<["scanner.format_mismatch", "scanner.parse_error", "scanner.version_unknown", "session.start_failed", "session.crash", "rpc.call_failed", "upgrade.failed", "upgrade.skipped", "upgrade.stuck", "protocol.incompatible", "daemon.log", "daemon.crash", "daemon.health", "hook.server_failed", "hook.never_fired", "agent.protocol_incompatible"]>;
|
|
127
127
|
timestamp: z.ZodString;
|
|
128
128
|
agentType: z.ZodOptional<z.ZodString>;
|
|
129
129
|
agentVersion: z.ZodOptional<z.ZodString>;
|
package/dist/telemetry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";import{z as e}from"zod";export const TelemetryEventTypeSchema=e.enum(["scanner.format_mismatch","scanner.parse_error","scanner.version_unknown","session.start_failed","session.crash","rpc.call_failed","upgrade.failed","upgrade.skipped","upgrade.stuck","protocol.incompatible","daemon.log","daemon.crash","daemon.health","hook.server_failed","hook.never_fired"]);const
|
|
1
|
+
"use strict";import{z as e}from"zod";export const TelemetryEventTypeSchema=e.enum(["scanner.format_mismatch","scanner.parse_error","scanner.version_unknown","session.start_failed","session.crash","rpc.call_failed","upgrade.failed","upgrade.skipped","upgrade.stuck","protocol.incompatible","daemon.log","daemon.crash","daemon.health","hook.server_failed","hook.never_fired","agent.protocol_incompatible"]);const c={"scanner.format_mismatch":["filePath","totalLines","parsedLines","errorCount","unknownLines","samples"],"scanner.parse_error":["filePath","totalLines","errorCount","error","lineNumber"],"scanner.version_unknown":["detectedVersion","supportedRange"],"session.start_failed":["cwd","agentBinary","exitCode","stderr"],"session.crash":["exitCode","signal","stderr","agentType","sessionId","pid","durationMs","platform","arch","nodeVersion","totalMemoryMB","freeMemoryMB","cpuCores","shell","concurrentSessions"],"rpc.call_failed":["method","error"],"upgrade.failed":["fromVersion","toVersion","stage","error"],"upgrade.skipped":["fromVersion","toVersion","activeSessions","reason"],"upgrade.stuck":["toVersion","activeSessions","blockedForMinutes","consecutiveSkips"],"protocol.incompatible":["clientVersion","serverVersion","minRequired"],"daemon.log":["module","hostname","platform","arch","stack"],"daemon.crash":["crashType","hostname","platform","arch","stack"],"daemon.health":["stateFileSize","sessionFilesTracked","statsDays","statsMessages","uptimeMinutes","memoryMB","platform","arch","agentTypes","activeClients"],"hook.server_failed":["error"],"hook.never_fired":["sessionId","cid","mode","durationMs"],"agent.protocol_incompatible":["protocol","stage","reasonCode","platform","architecture","policyVersion"]},d=/\b(?:\d{1,3}\.){3}\d{1,3}\b|[\w.+-]+@[\w.-]+\.\w+|\b(?:Bearer|token|sk-|api[_-]?key)\s*[:=]?\s*\S+/gi;function a(r){if(typeof r=="string")return r.replace(d,"[REDACTED]");if(Array.isArray(r))return r.map(a);if(typeof r=="number"||typeof r=="boolean"||r===null)return r}export function sanitizeContext(r,n){if(!n)return;const t=c[r];if(!t)return;const o={};for(const s of t)if(s in n){const i=a(n[s]);i!==void 0&&(o[s]=i)}return typeof o.stderr=="string"&&o.stderr.length>500&&(o.stderr=o.stderr.slice(0,500)),Object.keys(o).length>0?o:void 0}export const TelemetryEventSchema=e.object({type:TelemetryEventTypeSchema,timestamp:e.string(),agentType:e.string().optional(),agentVersion:e.string().optional(),daemonVersion:e.string(),code:e.string(),message:e.string(),context:e.record(e.unknown()).optional()}).passthrough(),TelemetryReportPayloadSchema=e.object({machineId:e.string(),events:e.array(TelemetryEventSchema).max(100)}).passthrough();
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export declare const WorkspaceFileReaderVersionFrameSchema: z.ZodObject<{
|
|
4
|
+
frame: z.ZodLiteral<"version">;
|
|
5
|
+
protocol: z.ZodLiteral<"workspace-file-relay/1">;
|
|
6
|
+
|
|
7
|
+
readerVersion: z.ZodString;
|
|
8
|
+
}, "strict", z.ZodTypeAny, {
|
|
9
|
+
protocol: "workspace-file-relay/1";
|
|
10
|
+
frame: "version";
|
|
11
|
+
readerVersion: string;
|
|
12
|
+
}, {
|
|
13
|
+
protocol: "workspace-file-relay/1";
|
|
14
|
+
frame: "version";
|
|
15
|
+
readerVersion: string;
|
|
16
|
+
}>;
|
|
17
|
+
export type WorkspaceFileReaderVersionFrame = z.infer<typeof WorkspaceFileReaderVersionFrameSchema>;
|
|
18
|
+
|
|
19
|
+
export declare const WorkspaceFileReaderRangeResolutionSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
20
|
+
kind: z.ZodLiteral<"none">;
|
|
21
|
+
}, "strict", z.ZodTypeAny, {
|
|
22
|
+
kind: "none";
|
|
23
|
+
}, {
|
|
24
|
+
kind: "none";
|
|
25
|
+
}>, z.ZodObject<{
|
|
26
|
+
kind: z.ZodLiteral<"partial">;
|
|
27
|
+
start: z.ZodNumber;
|
|
28
|
+
end: z.ZodNumber;
|
|
29
|
+
}, "strict", z.ZodTypeAny, {
|
|
30
|
+
start: number;
|
|
31
|
+
kind: "partial";
|
|
32
|
+
end: number;
|
|
33
|
+
}, {
|
|
34
|
+
start: number;
|
|
35
|
+
kind: "partial";
|
|
36
|
+
end: number;
|
|
37
|
+
}>, z.ZodObject<{
|
|
38
|
+
kind: z.ZodLiteral<"unsatisfiable">;
|
|
39
|
+
}, "strict", z.ZodTypeAny, {
|
|
40
|
+
kind: "unsatisfiable";
|
|
41
|
+
}, {
|
|
42
|
+
kind: "unsatisfiable";
|
|
43
|
+
}>]>;
|
|
44
|
+
export type WorkspaceFileReaderRangeResolution = z.infer<typeof WorkspaceFileReaderRangeResolutionSchema>;
|
|
45
|
+
|
|
46
|
+
export declare const WorkspaceFileReaderStatFrameSchema: z.ZodObject<{
|
|
47
|
+
frame: z.ZodLiteral<"stat">;
|
|
48
|
+
size: z.ZodNumber;
|
|
49
|
+
etag: z.ZodString;
|
|
50
|
+
lastModified: z.ZodString;
|
|
51
|
+
resolution: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
52
|
+
kind: z.ZodLiteral<"none">;
|
|
53
|
+
}, "strict", z.ZodTypeAny, {
|
|
54
|
+
kind: "none";
|
|
55
|
+
}, {
|
|
56
|
+
kind: "none";
|
|
57
|
+
}>, z.ZodObject<{
|
|
58
|
+
kind: z.ZodLiteral<"partial">;
|
|
59
|
+
start: z.ZodNumber;
|
|
60
|
+
end: z.ZodNumber;
|
|
61
|
+
}, "strict", z.ZodTypeAny, {
|
|
62
|
+
start: number;
|
|
63
|
+
kind: "partial";
|
|
64
|
+
end: number;
|
|
65
|
+
}, {
|
|
66
|
+
start: number;
|
|
67
|
+
kind: "partial";
|
|
68
|
+
end: number;
|
|
69
|
+
}>, z.ZodObject<{
|
|
70
|
+
kind: z.ZodLiteral<"unsatisfiable">;
|
|
71
|
+
}, "strict", z.ZodTypeAny, {
|
|
72
|
+
kind: "unsatisfiable";
|
|
73
|
+
}, {
|
|
74
|
+
kind: "unsatisfiable";
|
|
75
|
+
}>]>;
|
|
76
|
+
}, "strict", z.ZodTypeAny, {
|
|
77
|
+
size: number;
|
|
78
|
+
etag: string;
|
|
79
|
+
lastModified: string;
|
|
80
|
+
frame: "stat";
|
|
81
|
+
resolution: {
|
|
82
|
+
kind: "none";
|
|
83
|
+
} | {
|
|
84
|
+
start: number;
|
|
85
|
+
kind: "partial";
|
|
86
|
+
end: number;
|
|
87
|
+
} | {
|
|
88
|
+
kind: "unsatisfiable";
|
|
89
|
+
};
|
|
90
|
+
}, {
|
|
91
|
+
size: number;
|
|
92
|
+
etag: string;
|
|
93
|
+
lastModified: string;
|
|
94
|
+
frame: "stat";
|
|
95
|
+
resolution: {
|
|
96
|
+
kind: "none";
|
|
97
|
+
} | {
|
|
98
|
+
start: number;
|
|
99
|
+
kind: "partial";
|
|
100
|
+
end: number;
|
|
101
|
+
} | {
|
|
102
|
+
kind: "unsatisfiable";
|
|
103
|
+
};
|
|
104
|
+
}>;
|
|
105
|
+
export type WorkspaceFileReaderStatFrame = z.infer<typeof WorkspaceFileReaderStatFrameSchema>;
|
|
106
|
+
|
|
107
|
+
export declare const WorkspaceFileReaderDataFrameSchema: z.ZodObject<{
|
|
108
|
+
frame: z.ZodLiteral<"data">;
|
|
109
|
+
length: z.ZodNumber;
|
|
110
|
+
}, "strict", z.ZodTypeAny, {
|
|
111
|
+
length: number;
|
|
112
|
+
frame: "data";
|
|
113
|
+
}, {
|
|
114
|
+
length: number;
|
|
115
|
+
frame: "data";
|
|
116
|
+
}>;
|
|
117
|
+
export type WorkspaceFileReaderDataFrame = z.infer<typeof WorkspaceFileReaderDataFrameSchema>;
|
|
118
|
+
|
|
119
|
+
export declare const WorkspaceFileReaderDoneFrameSchema: z.ZodObject<{
|
|
120
|
+
frame: z.ZodLiteral<"done">;
|
|
121
|
+
bytesWritten: z.ZodNumber;
|
|
122
|
+
}, "strict", z.ZodTypeAny, {
|
|
123
|
+
frame: "done";
|
|
124
|
+
bytesWritten: number;
|
|
125
|
+
}, {
|
|
126
|
+
frame: "done";
|
|
127
|
+
bytesWritten: number;
|
|
128
|
+
}>;
|
|
129
|
+
export type WorkspaceFileReaderDoneFrame = z.infer<typeof WorkspaceFileReaderDoneFrameSchema>;
|
|
130
|
+
|
|
131
|
+
export declare const WorkspaceFileReaderErrorFrameSchema: z.ZodObject<{
|
|
132
|
+
frame: z.ZodLiteral<"error">;
|
|
133
|
+
code: z.ZodEnum<["internal-unauthorized", "invalid-request", "path-denied", "not-found", "range-unsatisfiable", "container-unavailable", "reader-unavailable", "reader-incompatible"]>;
|
|
134
|
+
}, "strict", z.ZodTypeAny, {
|
|
135
|
+
code: "invalid-request" | "internal-unauthorized" | "path-denied" | "not-found" | "range-unsatisfiable" | "container-unavailable" | "reader-unavailable" | "reader-incompatible";
|
|
136
|
+
frame: "error";
|
|
137
|
+
}, {
|
|
138
|
+
code: "invalid-request" | "internal-unauthorized" | "path-denied" | "not-found" | "range-unsatisfiable" | "container-unavailable" | "reader-unavailable" | "reader-incompatible";
|
|
139
|
+
frame: "error";
|
|
140
|
+
}>;
|
|
141
|
+
export type WorkspaceFileReaderErrorFrame = z.infer<typeof WorkspaceFileReaderErrorFrameSchema>;
|
|
142
|
+
export declare const WorkspaceFileReaderJsonFrameSchema: z.ZodDiscriminatedUnion<"frame", [z.ZodObject<{
|
|
143
|
+
frame: z.ZodLiteral<"version">;
|
|
144
|
+
protocol: z.ZodLiteral<"workspace-file-relay/1">;
|
|
145
|
+
|
|
146
|
+
readerVersion: z.ZodString;
|
|
147
|
+
}, "strict", z.ZodTypeAny, {
|
|
148
|
+
protocol: "workspace-file-relay/1";
|
|
149
|
+
frame: "version";
|
|
150
|
+
readerVersion: string;
|
|
151
|
+
}, {
|
|
152
|
+
protocol: "workspace-file-relay/1";
|
|
153
|
+
frame: "version";
|
|
154
|
+
readerVersion: string;
|
|
155
|
+
}>, z.ZodObject<{
|
|
156
|
+
frame: z.ZodLiteral<"stat">;
|
|
157
|
+
size: z.ZodNumber;
|
|
158
|
+
etag: z.ZodString;
|
|
159
|
+
lastModified: z.ZodString;
|
|
160
|
+
resolution: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
161
|
+
kind: z.ZodLiteral<"none">;
|
|
162
|
+
}, "strict", z.ZodTypeAny, {
|
|
163
|
+
kind: "none";
|
|
164
|
+
}, {
|
|
165
|
+
kind: "none";
|
|
166
|
+
}>, z.ZodObject<{
|
|
167
|
+
kind: z.ZodLiteral<"partial">;
|
|
168
|
+
start: z.ZodNumber;
|
|
169
|
+
end: z.ZodNumber;
|
|
170
|
+
}, "strict", z.ZodTypeAny, {
|
|
171
|
+
start: number;
|
|
172
|
+
kind: "partial";
|
|
173
|
+
end: number;
|
|
174
|
+
}, {
|
|
175
|
+
start: number;
|
|
176
|
+
kind: "partial";
|
|
177
|
+
end: number;
|
|
178
|
+
}>, z.ZodObject<{
|
|
179
|
+
kind: z.ZodLiteral<"unsatisfiable">;
|
|
180
|
+
}, "strict", z.ZodTypeAny, {
|
|
181
|
+
kind: "unsatisfiable";
|
|
182
|
+
}, {
|
|
183
|
+
kind: "unsatisfiable";
|
|
184
|
+
}>]>;
|
|
185
|
+
}, "strict", z.ZodTypeAny, {
|
|
186
|
+
size: number;
|
|
187
|
+
etag: string;
|
|
188
|
+
lastModified: string;
|
|
189
|
+
frame: "stat";
|
|
190
|
+
resolution: {
|
|
191
|
+
kind: "none";
|
|
192
|
+
} | {
|
|
193
|
+
start: number;
|
|
194
|
+
kind: "partial";
|
|
195
|
+
end: number;
|
|
196
|
+
} | {
|
|
197
|
+
kind: "unsatisfiable";
|
|
198
|
+
};
|
|
199
|
+
}, {
|
|
200
|
+
size: number;
|
|
201
|
+
etag: string;
|
|
202
|
+
lastModified: string;
|
|
203
|
+
frame: "stat";
|
|
204
|
+
resolution: {
|
|
205
|
+
kind: "none";
|
|
206
|
+
} | {
|
|
207
|
+
start: number;
|
|
208
|
+
kind: "partial";
|
|
209
|
+
end: number;
|
|
210
|
+
} | {
|
|
211
|
+
kind: "unsatisfiable";
|
|
212
|
+
};
|
|
213
|
+
}>, z.ZodObject<{
|
|
214
|
+
frame: z.ZodLiteral<"data">;
|
|
215
|
+
length: z.ZodNumber;
|
|
216
|
+
}, "strict", z.ZodTypeAny, {
|
|
217
|
+
length: number;
|
|
218
|
+
frame: "data";
|
|
219
|
+
}, {
|
|
220
|
+
length: number;
|
|
221
|
+
frame: "data";
|
|
222
|
+
}>, z.ZodObject<{
|
|
223
|
+
frame: z.ZodLiteral<"done">;
|
|
224
|
+
bytesWritten: z.ZodNumber;
|
|
225
|
+
}, "strict", z.ZodTypeAny, {
|
|
226
|
+
frame: "done";
|
|
227
|
+
bytesWritten: number;
|
|
228
|
+
}, {
|
|
229
|
+
frame: "done";
|
|
230
|
+
bytesWritten: number;
|
|
231
|
+
}>, z.ZodObject<{
|
|
232
|
+
frame: z.ZodLiteral<"error">;
|
|
233
|
+
code: z.ZodEnum<["internal-unauthorized", "invalid-request", "path-denied", "not-found", "range-unsatisfiable", "container-unavailable", "reader-unavailable", "reader-incompatible"]>;
|
|
234
|
+
}, "strict", z.ZodTypeAny, {
|
|
235
|
+
code: "invalid-request" | "internal-unauthorized" | "path-denied" | "not-found" | "range-unsatisfiable" | "container-unavailable" | "reader-unavailable" | "reader-incompatible";
|
|
236
|
+
frame: "error";
|
|
237
|
+
}, {
|
|
238
|
+
code: "invalid-request" | "internal-unauthorized" | "path-denied" | "not-found" | "range-unsatisfiable" | "container-unavailable" | "reader-unavailable" | "reader-incompatible";
|
|
239
|
+
frame: "error";
|
|
240
|
+
}>]>;
|
|
241
|
+
export type WorkspaceFileReaderJsonFrame = z.infer<typeof WorkspaceFileReaderJsonFrameSchema>;
|
|
242
|
+
|
|
243
|
+
export declare const WORKSPACE_FILE_READER_FRAME_HEADER_BYTES = 4;
|
|
244
|
+
|
|
245
|
+
export declare const WORKSPACE_FILE_READER_MAX_FRAME_BYTES = 1048576;
|
|
246
|
+
|
|
247
|
+
export declare function encodeWorkspaceFileReaderFrame(payload: Uint8Array): Uint8Array;
|
|
248
|
+
export declare function encodeWorkspaceFileReaderJsonFrame(frame: WorkspaceFileReaderJsonFrame): Uint8Array;
|
|
249
|
+
|
|
250
|
+
export type WorkspaceFileReaderFrameEvent = {
|
|
251
|
+
readonly kind: 'json';
|
|
252
|
+
readonly frame: WorkspaceFileReaderJsonFrame;
|
|
253
|
+
} | {
|
|
254
|
+
readonly kind: 'data';
|
|
255
|
+
readonly bytes: Uint8Array;
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
export interface WorkspaceFileReaderFrameDecoder {
|
|
259
|
+
|
|
260
|
+
push(chunk: Uint8Array): WorkspaceFileReaderFrameEvent[];
|
|
261
|
+
|
|
262
|
+
end(): void;
|
|
263
|
+
}
|
|
264
|
+
export declare function createWorkspaceFileReaderFrameDecoder(): WorkspaceFileReaderFrameDecoder;
|
|
265
|
+
|
|
266
|
+
export declare function workspaceFileEtag(size: number, mtimeMs: number): string;
|
|
267
|
+
|
|
268
|
+
export declare function workspaceFileLastModified(mtimeMs: number): string;
|
|
269
|
+
|
|
270
|
+
export declare function workspaceFileRangeResolution(size: number, range: string | undefined): WorkspaceFileReaderRangeResolution;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{z as t}from"zod";import{WORKSPACE_FILE_RELAY_PROTOCOL as p,WorkspaceFileRelayErrorCodeSchema as b}from"./workspaceFileRelay.js";export const WorkspaceFileReaderVersionFrameSchema=t.object({frame:t.literal("version"),protocol:t.literal(p),readerVersion:t.string().min(1).max(64)}).strict(),WorkspaceFileReaderRangeResolutionSchema=t.discriminatedUnion("kind",[t.object({kind:t.literal("none")}).strict(),t.object({kind:t.literal("partial"),start:t.number().int().nonnegative(),end:t.number().int().nonnegative()}).strict(),t.object({kind:t.literal("unsatisfiable")}).strict()]),WorkspaceFileReaderStatFrameSchema=t.object({frame:t.literal("stat"),size:t.number().int().nonnegative(),etag:t.string().min(1),lastModified:t.string().min(1),resolution:WorkspaceFileReaderRangeResolutionSchema}).strict(),WorkspaceFileReaderDataFrameSchema=t.object({frame:t.literal("data"),length:t.number().int().positive()}).strict(),WorkspaceFileReaderDoneFrameSchema=t.object({frame:t.literal("done"),bytesWritten:t.number().int().nonnegative()}).strict(),WorkspaceFileReaderErrorFrameSchema=t.object({frame:t.literal("error"),code:b}).strict(),WorkspaceFileReaderJsonFrameSchema=t.discriminatedUnion("frame",[WorkspaceFileReaderVersionFrameSchema,WorkspaceFileReaderStatFrameSchema,WorkspaceFileReaderDataFrameSchema,WorkspaceFileReaderDoneFrameSchema,WorkspaceFileReaderErrorFrameSchema]),WORKSPACE_FILE_READER_FRAME_HEADER_BYTES=4,WORKSPACE_FILE_READER_MAX_FRAME_BYTES=1048576;export function encodeWorkspaceFileReaderFrame(e){const r=new Uint8Array(WORKSPACE_FILE_READER_FRAME_HEADER_BYTES+e.byteLength);return new DataView(r.buffer,r.byteOffset,WORKSPACE_FILE_READER_FRAME_HEADER_BYTES).setUint32(0,e.byteLength,!1),r.set(e,WORKSPACE_FILE_READER_FRAME_HEADER_BYTES),r}export function encodeWorkspaceFileReaderJsonFrame(e){return encodeWorkspaceFileReaderFrame(new TextEncoder().encode(JSON.stringify(e)))}function m(e){return new Error(`workspace-file-relay-frame:${e}`)}function h(e){return new DataView(e.buffer,e.byteOffset,WORKSPACE_FILE_READER_FRAME_HEADER_BYTES).getUint32(0,!1)}export function createWorkspaceFileReaderFrameDecoder(){let e=new Uint8Array(0),r=null;return{push(a){const s=new Uint8Array(e.byteLength+a.byteLength);s.set(e,0),s.set(a,e.byteLength);let o=s;const f=[];for(;!(o.byteLength<WORKSPACE_FILE_READER_FRAME_HEADER_BYTES);){const l=h(o);if(l===0)throw m("empty-frame");if(l>WORKSPACE_FILE_READER_MAX_FRAME_BYTES)throw m("frame-too-large");const i=WORKSPACE_FILE_READER_FRAME_HEADER_BYTES+l;if(o.byteLength<i)break;const n=o.subarray(WORKSPACE_FILE_READER_FRAME_HEADER_BYTES,i);if(o=o.subarray(i),r!==null){if(l!==r)throw m("data-length-mismatch");r=null,f.push({kind:"data",bytes:n.slice()});continue}let d;try{d=WorkspaceFileReaderJsonFrameSchema.parse(JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(n)))}catch{throw m("malformed-json-frame")}d.frame==="data"&&(r=d.length),f.push({kind:"json",frame:d})}return e=o.slice(),f},end(){if(e.byteLength!==0||r!==null)throw m("truncated")}}}export function workspaceFileEtag(e,r){return`W/"${e.toString(16)}-${Math.trunc(r).toString(16)}"`}export function workspaceFileLastModified(e){return new Date(e).toUTCString()}function g(e,r){const a=[],s=r.slice(r.indexOf("=")+1).split(",");for(const[i,n]of s.entries()){const d=n.indexOf("-");let u=Number.parseInt(n.slice(0,d),10),c=Number.parseInt(n.slice(d+1),10);Number.isNaN(u)?(u=e-c,c=e-1):(Number.isNaN(c)||c>e-1)&&(c=e-1),!Number.isNaN(u)&&!Number.isNaN(c)&&u>=0&&u<=c&&a.push({start:u,end:c,index:i})}if(a.length<2)return a;const o=[...a].sort((i,n)=>i.start-n.start),f=o[0];if(!f)return[];const l=[f];for(const i of o.slice(1)){const n=l.at(-1);n&&(i.start>n.end+1?l.push(i):i.end>n.end&&(n.end=i.end,n.index=Math.min(n.index,i.index)))}return l.sort((i,n)=>i.index-n.index)}const F=/^bytes=/;export function workspaceFileRangeResolution(e,r){if(r===void 0||!F.test(r))return{kind:"none"};const a=g(e,r);if(a.length===0)return{kind:"unsatisfiable"};const s=a.length===1?a[0]:void 0;return s?{kind:"partial",start:s.start,end:s.end}:{kind:"none"}}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
export declare const WORKSPACE_FILE_RELAY_PROTOCOL = "workspace-file-relay/1";
|
|
4
|
+
|
|
5
|
+
export declare const WORKSPACE_FILE_READER_CLI_PATH = "/opt/agentdock/packages/workspace-file-reader/dist/cli.js";
|
|
6
|
+
export declare const WorkspaceFileRelayScopeSchema: z.ZodEnum<["workspace", "shared"]>;
|
|
7
|
+
export type WorkspaceFileRelayScope = z.infer<typeof WorkspaceFileRelayScopeSchema>;
|
|
8
|
+
|
|
9
|
+
export declare const WORKSPACE_FILE_RELAY_SCOPE_ROOTS: Readonly<Record<WorkspaceFileRelayScope, string>>;
|
|
10
|
+
export declare const WorkspaceFileRelayMethodSchema: z.ZodEnum<["GET", "HEAD"]>;
|
|
11
|
+
export type WorkspaceFileRelayMethod = z.infer<typeof WorkspaceFileRelayMethodSchema>;
|
|
12
|
+
|
|
13
|
+
export declare const WorkspaceFileRelayRangeSchema: z.ZodString;
|
|
14
|
+
export type WorkspaceFileRelayRange = z.infer<typeof WorkspaceFileRelayRangeSchema>;
|
|
15
|
+
|
|
16
|
+
export declare const WorkspaceFileRelayConditionsSchema: z.ZodObject<{
|
|
17
|
+
ifMatch: z.ZodOptional<z.ZodString>;
|
|
18
|
+
ifNoneMatch: z.ZodOptional<z.ZodString>;
|
|
19
|
+
ifModifiedSince: z.ZodOptional<z.ZodString>;
|
|
20
|
+
ifUnmodifiedSince: z.ZodOptional<z.ZodString>;
|
|
21
|
+
ifRange: z.ZodOptional<z.ZodString>;
|
|
22
|
+
noCache: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
}, "strict", z.ZodTypeAny, {
|
|
24
|
+
ifMatch?: string | undefined;
|
|
25
|
+
ifNoneMatch?: string | undefined;
|
|
26
|
+
ifModifiedSince?: string | undefined;
|
|
27
|
+
ifUnmodifiedSince?: string | undefined;
|
|
28
|
+
ifRange?: string | undefined;
|
|
29
|
+
noCache?: boolean | undefined;
|
|
30
|
+
}, {
|
|
31
|
+
ifMatch?: string | undefined;
|
|
32
|
+
ifNoneMatch?: string | undefined;
|
|
33
|
+
ifModifiedSince?: string | undefined;
|
|
34
|
+
ifUnmodifiedSince?: string | undefined;
|
|
35
|
+
ifRange?: string | undefined;
|
|
36
|
+
noCache?: boolean | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
export type WorkspaceFileRelayConditions = z.infer<typeof WorkspaceFileRelayConditionsSchema>;
|
|
39
|
+
|
|
40
|
+
export declare const WorkspaceFileRelayRequestSchema: z.ZodEffects<z.ZodObject<{
|
|
41
|
+
|
|
42
|
+
requestId: z.ZodString;
|
|
43
|
+
|
|
44
|
+
nonce: z.ZodString;
|
|
45
|
+
|
|
46
|
+
scope: z.ZodEnum<["workspace", "shared"]>;
|
|
47
|
+
|
|
48
|
+
basePath: z.ZodString;
|
|
49
|
+
|
|
50
|
+
relativePath: z.ZodString;
|
|
51
|
+
method: z.ZodEnum<["GET", "HEAD"]>;
|
|
52
|
+
range: z.ZodOptional<z.ZodString>;
|
|
53
|
+
conditions: z.ZodOptional<z.ZodObject<{
|
|
54
|
+
ifMatch: z.ZodOptional<z.ZodString>;
|
|
55
|
+
ifNoneMatch: z.ZodOptional<z.ZodString>;
|
|
56
|
+
ifModifiedSince: z.ZodOptional<z.ZodString>;
|
|
57
|
+
ifUnmodifiedSince: z.ZodOptional<z.ZodString>;
|
|
58
|
+
ifRange: z.ZodOptional<z.ZodString>;
|
|
59
|
+
noCache: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
}, "strict", z.ZodTypeAny, {
|
|
61
|
+
ifMatch?: string | undefined;
|
|
62
|
+
ifNoneMatch?: string | undefined;
|
|
63
|
+
ifModifiedSince?: string | undefined;
|
|
64
|
+
ifUnmodifiedSince?: string | undefined;
|
|
65
|
+
ifRange?: string | undefined;
|
|
66
|
+
noCache?: boolean | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
ifMatch?: string | undefined;
|
|
69
|
+
ifNoneMatch?: string | undefined;
|
|
70
|
+
ifModifiedSince?: string | undefined;
|
|
71
|
+
ifUnmodifiedSince?: string | undefined;
|
|
72
|
+
ifRange?: string | undefined;
|
|
73
|
+
noCache?: boolean | undefined;
|
|
74
|
+
}>>;
|
|
75
|
+
}, "strict", z.ZodTypeAny, {
|
|
76
|
+
requestId: string;
|
|
77
|
+
method: "GET" | "HEAD";
|
|
78
|
+
scope: "workspace" | "shared";
|
|
79
|
+
nonce: string;
|
|
80
|
+
basePath: string;
|
|
81
|
+
relativePath: string;
|
|
82
|
+
range?: string | undefined;
|
|
83
|
+
conditions?: {
|
|
84
|
+
ifMatch?: string | undefined;
|
|
85
|
+
ifNoneMatch?: string | undefined;
|
|
86
|
+
ifModifiedSince?: string | undefined;
|
|
87
|
+
ifUnmodifiedSince?: string | undefined;
|
|
88
|
+
ifRange?: string | undefined;
|
|
89
|
+
noCache?: boolean | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
}, {
|
|
92
|
+
requestId: string;
|
|
93
|
+
method: "GET" | "HEAD";
|
|
94
|
+
scope: "workspace" | "shared";
|
|
95
|
+
nonce: string;
|
|
96
|
+
basePath: string;
|
|
97
|
+
relativePath: string;
|
|
98
|
+
range?: string | undefined;
|
|
99
|
+
conditions?: {
|
|
100
|
+
ifMatch?: string | undefined;
|
|
101
|
+
ifNoneMatch?: string | undefined;
|
|
102
|
+
ifModifiedSince?: string | undefined;
|
|
103
|
+
ifUnmodifiedSince?: string | undefined;
|
|
104
|
+
ifRange?: string | undefined;
|
|
105
|
+
noCache?: boolean | undefined;
|
|
106
|
+
} | undefined;
|
|
107
|
+
}>, {
|
|
108
|
+
requestId: string;
|
|
109
|
+
method: "GET" | "HEAD";
|
|
110
|
+
scope: "workspace" | "shared";
|
|
111
|
+
nonce: string;
|
|
112
|
+
basePath: string;
|
|
113
|
+
relativePath: string;
|
|
114
|
+
range?: string | undefined;
|
|
115
|
+
conditions?: {
|
|
116
|
+
ifMatch?: string | undefined;
|
|
117
|
+
ifNoneMatch?: string | undefined;
|
|
118
|
+
ifModifiedSince?: string | undefined;
|
|
119
|
+
ifUnmodifiedSince?: string | undefined;
|
|
120
|
+
ifRange?: string | undefined;
|
|
121
|
+
noCache?: boolean | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
}, {
|
|
124
|
+
requestId: string;
|
|
125
|
+
method: "GET" | "HEAD";
|
|
126
|
+
scope: "workspace" | "shared";
|
|
127
|
+
nonce: string;
|
|
128
|
+
basePath: string;
|
|
129
|
+
relativePath: string;
|
|
130
|
+
range?: string | undefined;
|
|
131
|
+
conditions?: {
|
|
132
|
+
ifMatch?: string | undefined;
|
|
133
|
+
ifNoneMatch?: string | undefined;
|
|
134
|
+
ifModifiedSince?: string | undefined;
|
|
135
|
+
ifUnmodifiedSince?: string | undefined;
|
|
136
|
+
ifRange?: string | undefined;
|
|
137
|
+
noCache?: boolean | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
}>;
|
|
140
|
+
export type WorkspaceFileRelayRequest = z.infer<typeof WorkspaceFileRelayRequestSchema>;
|
|
141
|
+
|
|
142
|
+
export type WorkspaceFileRelayPathProblem = 'empty' | 'control-character' | 'separator' | 'not-absolute' | 'absolute-relative-path' | 'trailing-separator' | 'unsafe-segment' | 'outside-scope-root';
|
|
143
|
+
|
|
144
|
+
export declare function workspaceFileRelayPathProblem(root: string, basePath: string, relativePath: string): WorkspaceFileRelayPathProblem | null;
|
|
145
|
+
|
|
146
|
+
export declare function workspaceFileRelayProofRoot(scope: WorkspaceFileRelayScope, basePath: string): string | null;
|
|
147
|
+
|
|
148
|
+
export declare const WorkspaceFileRelayFileHeadersSchema: z.ZodObject<{
|
|
149
|
+
etag: z.ZodString;
|
|
150
|
+
lastModified: z.ZodString;
|
|
151
|
+
acceptRanges: z.ZodLiteral<"bytes">;
|
|
152
|
+
contentLength: z.ZodNumber;
|
|
153
|
+
|
|
154
|
+
contentRange: z.ZodOptional<z.ZodString>;
|
|
155
|
+
}, "strict", z.ZodTypeAny, {
|
|
156
|
+
etag: string;
|
|
157
|
+
lastModified: string;
|
|
158
|
+
acceptRanges: "bytes";
|
|
159
|
+
contentLength: number;
|
|
160
|
+
contentRange?: string | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
etag: string;
|
|
163
|
+
lastModified: string;
|
|
164
|
+
acceptRanges: "bytes";
|
|
165
|
+
contentLength: number;
|
|
166
|
+
contentRange?: string | undefined;
|
|
167
|
+
}>;
|
|
168
|
+
export type WorkspaceFileRelayFileHeaders = z.infer<typeof WorkspaceFileRelayFileHeadersSchema>;
|
|
169
|
+
export declare const WorkspaceFileRelayErrorCodeSchema: z.ZodEnum<["internal-unauthorized", "invalid-request", "path-denied", "not-found", "range-unsatisfiable", "container-unavailable", "reader-unavailable", "reader-incompatible"]>;
|
|
170
|
+
export type WorkspaceFileRelayErrorCode = z.infer<typeof WorkspaceFileRelayErrorCodeSchema>;
|
|
171
|
+
|
|
172
|
+
export declare const WORKSPACE_FILE_RELAY_CONTENT_LENGTH_HEADER = "x-agentdock-content-length";
|
|
173
|
+
|
|
174
|
+
export declare const WORKSPACE_FILE_RELAY_ERROR_STATUS: Readonly<Record<WorkspaceFileRelayErrorCode, number>>;
|
|
175
|
+
|
|
176
|
+
export declare const WORKSPACE_FILE_OFFLINE_ERROR_CODES: readonly WorkspaceFileRelayErrorCode[];
|
|
177
|
+
|
|
178
|
+
export declare const WorkspaceFileRelayErrorResponseSchema: z.ZodObject<{
|
|
179
|
+
ok: z.ZodLiteral<false>;
|
|
180
|
+
error: z.ZodEnum<["internal-unauthorized", "invalid-request", "path-denied", "not-found", "range-unsatisfiable", "container-unavailable", "reader-unavailable", "reader-incompatible"]>;
|
|
181
|
+
}, "strict", z.ZodTypeAny, {
|
|
182
|
+
error: "invalid-request" | "internal-unauthorized" | "path-denied" | "not-found" | "range-unsatisfiable" | "container-unavailable" | "reader-unavailable" | "reader-incompatible";
|
|
183
|
+
ok: false;
|
|
184
|
+
}, {
|
|
185
|
+
error: "invalid-request" | "internal-unauthorized" | "path-denied" | "not-found" | "range-unsatisfiable" | "container-unavailable" | "reader-unavailable" | "reader-incompatible";
|
|
186
|
+
ok: false;
|
|
187
|
+
}>;
|
|
188
|
+
export type WorkspaceFileRelayErrorResponse = z.infer<typeof WorkspaceFileRelayErrorResponseSchema>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";import{z as e}from"zod";export const WORKSPACE_FILE_RELAY_PROTOCOL="workspace-file-relay/1",WORKSPACE_FILE_READER_CLI_PATH="/opt/agentdock/packages/workspace-file-reader/dist/cli.js",WorkspaceFileRelayScopeSchema=e.enum(["workspace","shared"]),WORKSPACE_FILE_RELAY_SCOPE_ROOTS={workspace:"/workspace",shared:"/agentdock/shared"},WorkspaceFileRelayMethodSchema=e.enum(["GET","HEAD"]),WorkspaceFileRelayRangeSchema=e.string().min(1).max(80).regex(/^bytes=(?:\d+-\d*|-\d+)(?:,(?:\d+-\d*|-\d+))*$/),WorkspaceFileRelayConditionsSchema=e.object({ifMatch:e.string().min(1).max(256).optional(),ifNoneMatch:e.string().min(1).max(256).optional(),ifModifiedSince:e.string().min(1).max(64).optional(),ifUnmodifiedSince:e.string().min(1).max(64).optional(),ifRange:e.string().min(1).max(256).optional(),noCache:e.boolean().optional()}).strict(),WorkspaceFileRelayRequestSchema=e.object({requestId:e.string().regex(/^[A-Za-z0-9_-]{1,64}$/),nonce:e.string().regex(/^[A-Za-z0-9_-]{16,128}$/),scope:WorkspaceFileRelayScopeSchema,basePath:e.string().min(1).max(4096),relativePath:e.string().min(1).max(4096),method:WorkspaceFileRelayMethodSchema,range:WorkspaceFileRelayRangeSchema.optional(),conditions:WorkspaceFileRelayConditionsSchema.optional()}).strict().superRefine((o,t)=>{const n=workspaceFileRelayPathProblem(WORKSPACE_FILE_RELAY_SCOPE_ROOTS[o.scope],o.basePath,o.relativePath);n!==null&&t.addIssue({code:e.ZodIssueCode.custom,path:["basePath"],message:`workspace-file-relay-path:${n}`})});const i=/[\u0000-\u001f\u007f]/;function a(o){return o.split("/").some((t,n)=>t==="."||t===".."||t===""&&n>0)}export function workspaceFileRelayPathProblem(o,t,n){return t.length===0||n.length===0?"empty":i.test(t)||i.test(n)?"control-character":t.includes("\\")||n.includes("\\")?"separator":t.startsWith("/")?n.startsWith("/")?"absolute-relative-path":t.endsWith("/")||n.endsWith("/")?"trailing-separator":a(t)||a(n)?"unsafe-segment":t!==o&&!t.startsWith(`${o}/`)?"outside-scope-root":null:"not-absolute"}export function workspaceFileRelayProofRoot(o,t){const n=WORKSPACE_FILE_RELAY_SCOPE_ROOTS[o];if(t!==n&&!t.startsWith(`${n}/`))return null;if(o==="shared")return n;const r=t.slice(n.length+1).split("/")[0];return r?`${n}/${r}`:null}export const WorkspaceFileRelayFileHeadersSchema=e.object({etag:e.string().min(1),lastModified:e.string().min(1),acceptRanges:e.literal("bytes"),contentLength:e.number().int().nonnegative(),contentRange:e.string().min(1).optional()}).strict(),WorkspaceFileRelayErrorCodeSchema=e.enum(["internal-unauthorized","invalid-request","path-denied","not-found","range-unsatisfiable","container-unavailable","reader-unavailable","reader-incompatible"]),WORKSPACE_FILE_RELAY_CONTENT_LENGTH_HEADER="x-agentdock-content-length",WORKSPACE_FILE_RELAY_ERROR_STATUS={"internal-unauthorized":502,"invalid-request":400,"path-denied":404,"not-found":404,"range-unsatisfiable":416,"container-unavailable":503,"reader-unavailable":503,"reader-incompatible":503},WORKSPACE_FILE_OFFLINE_ERROR_CODES=["container-unavailable","reader-unavailable","reader-incompatible"],WorkspaceFileRelayErrorResponseSchema=e.object({ok:e.literal(!1),error:WorkspaceFileRelayErrorCodeSchema}).strict();
|