@agentdock/wire 0.0.46 → 0.0.47
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.js +1 -195
- package/dist/agentCommonEnv.js +1 -20
- package/dist/agentInstallGuide.js +1 -81
- package/dist/checkpointSchemas.js +1 -46
- package/dist/controlLevel.js +1 -11
- package/dist/edition.js +1 -13
- package/dist/envelope.d.ts +34 -0
- package/dist/envelope.js +1 -78
- package/dist/errorMessage.js +1 -6
- package/dist/events.d.ts +36 -0
- package/dist/events.js +1 -97
- package/dist/features.js +1 -112
- package/dist/feedback.d.ts +23 -5
- package/dist/feedback.js +1 -26
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -64
- package/dist/interactionEvents.js +1 -108
- package/dist/legacyProtocol.js +1 -30
- package/dist/license.js +1 -17
- package/dist/machine.d.ts +4 -0
- package/dist/machine.js +1 -56
- package/dist/messageMeta.js +1 -60
- package/dist/messages.d.ts +84 -0
- package/dist/messages.js +1 -35
- package/dist/ops.js +1 -74
- package/dist/pairing.js +1 -115
- package/dist/protocol.js +1 -7
- package/dist/rpc.js +1 -246
- package/dist/scheduledTasks.js +1 -81
- package/dist/semver.js +1 -60
- package/dist/sessionResult.js +1 -23
- package/dist/socketEvents.d.ts +1 -0
- package/dist/socketEvents.js +1 -44
- package/dist/spawnError.js +1 -31
- package/dist/stats.d.ts +27 -422
- package/dist/stats.js +1 -126
- package/dist/sync.js +1 -78
- package/dist/telemetry.js +1 -80
- package/dist/utils.js +1 -2
- package/package.json +1 -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/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/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/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/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/events.js
CHANGED
|
@@ -1,97 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Session event schemas — aligned with Happy sessionProtocol.
|
|
3
|
-
*
|
|
4
|
-
* Event types: text, service, tool-call-start, tool-call-end,
|
|
5
|
-
* file, turn-start, turn-end, start, stop.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
import { SessionQuestionEventSchema, SessionPermissionRequestEventSchema, SessionAnswerEventSchema, SessionPermissionResolvedEventSchema, } from './interactionEvents.js';
|
|
9
|
-
export const SessionTextEventSchema = z.object({
|
|
10
|
-
t: z.literal('text'),
|
|
11
|
-
text: z.string(),
|
|
12
|
-
thinking: z.boolean().optional(),
|
|
13
|
-
});
|
|
14
|
-
export const SessionServiceEventSchema = z.object({
|
|
15
|
-
t: z.literal('service'),
|
|
16
|
-
text: z.string(),
|
|
17
|
-
});
|
|
18
|
-
export const SessionToolCallStartEventSchema = z.object({
|
|
19
|
-
t: z.literal('tool-call-start'),
|
|
20
|
-
call: z.string(),
|
|
21
|
-
name: z.string(),
|
|
22
|
-
title: z.string(),
|
|
23
|
-
description: z.string(),
|
|
24
|
-
args: z.record(z.string(), z.unknown()),
|
|
25
|
-
});
|
|
26
|
-
export const SessionToolCallEndEventSchema = z.object({
|
|
27
|
-
t: z.literal('tool-call-end'),
|
|
28
|
-
call: z.string(),
|
|
29
|
-
/** Tool output text (may be truncated at source). */
|
|
30
|
-
result: z.string().optional(),
|
|
31
|
-
/** True when the tool returned an error result. */
|
|
32
|
-
error: z.boolean().optional(),
|
|
33
|
-
});
|
|
34
|
-
export const SessionFileEventSchema = z.object({
|
|
35
|
-
t: z.literal('file'),
|
|
36
|
-
ref: z.string(),
|
|
37
|
-
name: z.string(),
|
|
38
|
-
size: z.number(),
|
|
39
|
-
image: z
|
|
40
|
-
.object({
|
|
41
|
-
width: z.number(),
|
|
42
|
-
height: z.number(),
|
|
43
|
-
thumbhash: z.string(),
|
|
44
|
-
})
|
|
45
|
-
.optional(),
|
|
46
|
-
});
|
|
47
|
-
export const SessionTurnStartEventSchema = z.object({
|
|
48
|
-
t: z.literal('turn-start'),
|
|
49
|
-
});
|
|
50
|
-
export const SessionTurnEndStatusSchema = z.enum(['completed', 'failed', 'cancelled']);
|
|
51
|
-
/** Token usage stats reported at turn end. */
|
|
52
|
-
export const TurnUsageSchema = z.object({
|
|
53
|
-
inputTokens: z.number().int().nonnegative(),
|
|
54
|
-
outputTokens: z.number().int().nonnegative(),
|
|
55
|
-
cacheReadTokens: z.number().int().nonnegative().optional(),
|
|
56
|
-
cacheWriteTokens: z.number().int().nonnegative().optional(),
|
|
57
|
-
});
|
|
58
|
-
export const SessionTurnEndEventSchema = z.object({
|
|
59
|
-
t: z.literal('turn-end'),
|
|
60
|
-
status: SessionTurnEndStatusSchema,
|
|
61
|
-
usage: TurnUsageSchema.optional(),
|
|
62
|
-
model: z.string().optional(),
|
|
63
|
-
});
|
|
64
|
-
export const SessionStartEventSchema = z.object({
|
|
65
|
-
t: z.literal('start'),
|
|
66
|
-
title: z.string().optional(),
|
|
67
|
-
});
|
|
68
|
-
export const SessionStopEventSchema = z.object({
|
|
69
|
-
t: z.literal('stop'),
|
|
70
|
-
});
|
|
71
|
-
/** User-sent image stored inline in envelope (base64). */
|
|
72
|
-
export const SessionImageEventSchema = z.object({
|
|
73
|
-
t: z.literal('image'),
|
|
74
|
-
/** Base64-encoded image data. */
|
|
75
|
-
data: z.string(),
|
|
76
|
-
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
77
|
-
mediaType: z.string(),
|
|
78
|
-
});
|
|
79
|
-
export const SessionEventSchema = z.discriminatedUnion('t', [
|
|
80
|
-
SessionTextEventSchema,
|
|
81
|
-
SessionServiceEventSchema,
|
|
82
|
-
SessionToolCallStartEventSchema,
|
|
83
|
-
SessionToolCallEndEventSchema,
|
|
84
|
-
SessionFileEventSchema,
|
|
85
|
-
SessionTurnStartEventSchema,
|
|
86
|
-
SessionTurnEndEventSchema,
|
|
87
|
-
SessionStartEventSchema,
|
|
88
|
-
SessionStopEventSchema,
|
|
89
|
-
SessionQuestionEventSchema,
|
|
90
|
-
SessionPermissionRequestEventSchema,
|
|
91
|
-
SessionAnswerEventSchema,
|
|
92
|
-
SessionPermissionResolvedEventSchema,
|
|
93
|
-
SessionImageEventSchema,
|
|
94
|
-
]);
|
|
95
|
-
// Re-export interaction event schemas for convenience
|
|
96
|
-
export { SessionQuestionEventSchema, SessionPermissionRequestEventSchema, SessionAnswerEventSchema, SessionPermissionResolvedEventSchema, PermissionActionSchema, ImageAttachmentSchema, } from './interactionEvents.js';
|
|
97
|
-
//# sourceMappingURL=events.js.map
|
|
1
|
+
"use strict";import{z as e}from"zod";import{SessionQuestionEventSchema as t,SessionPermissionRequestEventSchema as n,SessionAnswerEventSchema as o,SessionPermissionResolvedEventSchema as s}from"./interactionEvents.js";export const SessionTextEventSchema=e.object({t:e.literal("text"),text:e.string(),thinking:e.boolean().optional(),images:e.array(e.object({data:e.string(),mediaType:e.string()})).optional()}),SessionServiceEventSchema=e.object({t:e.literal("service"),text:e.string()}),SessionToolCallStartEventSchema=e.object({t:e.literal("tool-call-start"),call:e.string(),name:e.string(),title:e.string(),description:e.string(),args:e.record(e.string(),e.unknown())}),SessionToolCallEndEventSchema=e.object({t:e.literal("tool-call-end"),call:e.string(),result:e.string().optional(),error:e.boolean().optional()}),SessionFileEventSchema=e.object({t:e.literal("file"),ref:e.string(),name:e.string(),size:e.number(),image:e.object({width:e.number(),height:e.number(),thumbhash:e.string()}).optional()}),SessionTurnStartEventSchema=e.object({t:e.literal("turn-start")}),SessionTurnEndStatusSchema=e.enum(["completed","failed","cancelled"]),TurnUsageSchema=e.object({inputTokens:e.number().int().nonnegative(),outputTokens:e.number().int().nonnegative(),cacheReadTokens:e.number().int().nonnegative().optional(),cacheWriteTokens:e.number().int().nonnegative().optional()}),SessionTurnEndEventSchema=e.object({t:e.literal("turn-end"),status:SessionTurnEndStatusSchema,usage:TurnUsageSchema.optional(),model:e.string().optional()}),SessionStartEventSchema=e.object({t:e.literal("start"),title:e.string().optional()}),SessionStopEventSchema=e.object({t:e.literal("stop")}),SessionImageEventSchema=e.object({t:e.literal("image"),data:e.string(),mediaType:e.string()}),SessionEventSchema=e.discriminatedUnion("t",[SessionTextEventSchema,SessionServiceEventSchema,SessionToolCallStartEventSchema,SessionToolCallEndEventSchema,SessionFileEventSchema,SessionTurnStartEventSchema,SessionTurnEndEventSchema,SessionStartEventSchema,SessionStopEventSchema,t,n,o,s,SessionImageEventSchema]);export{SessionQuestionEventSchema,SessionPermissionRequestEventSchema,SessionAnswerEventSchema,SessionPermissionResolvedEventSchema,PermissionActionSchema,ImageAttachmentSchema}from"./interactionEvents.js";
|
package/dist/features.js
CHANGED
|
@@ -1,112 +1 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
* Maps high-level features to the RPC methods they require.
|
|
4
|
-
* Used by web to determine which features a daemon supports
|
|
5
|
-
* based on the methods it has registered.
|
|
6
|
-
*/
|
|
7
|
-
import { satisfiesMin } from './semver.js';
|
|
8
|
-
/**
|
|
9
|
-
* Registry of all known features and their RPC dependencies.
|
|
10
|
-
* Add new entries here when introducing features that require new daemon RPC methods.
|
|
11
|
-
*/
|
|
12
|
-
export const FEATURE_REGISTRY = [
|
|
13
|
-
{
|
|
14
|
-
id: 'agent-settings',
|
|
15
|
-
requiredMethods: ['get-agent-settings', 'set-agent-settings'],
|
|
16
|
-
sinceVersion: '0.0.4',
|
|
17
|
-
subFeatures: [{ id: 'startup-scripts', sinceVersion: '0.0.30' }],
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
id: 'labs-settings',
|
|
21
|
-
requiredMethods: ['get-labs-settings', 'set-labs-settings'],
|
|
22
|
-
sinceVersion: '0.0.12',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: 'history-sync',
|
|
26
|
-
requiredMethods: ['backfill-history-session'],
|
|
27
|
-
sinceVersion: '0.0.12',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
id: 'check-path',
|
|
31
|
-
requiredMethods: ['check-path'],
|
|
32
|
-
sinceVersion: '0.0.7',
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
id: 'remote-upgrade',
|
|
36
|
-
requiredMethods: ['trigger-upgrade'],
|
|
37
|
-
sinceVersion: '0.0.30',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
id: 'checkpoint',
|
|
41
|
-
requiredMethods: ['checkpoint-list', 'checkpoint-diff', 'checkpoint-rollback'],
|
|
42
|
-
sinceVersion: '0.0.30',
|
|
43
|
-
subFeatures: [{ id: 'conversation-rollback', sinceVersion: '0.0.32' }],
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
id: 'scheduled-tasks',
|
|
47
|
-
requiredMethods: ['spawn-session'],
|
|
48
|
-
sinceVersion: '0.0.35',
|
|
49
|
-
},
|
|
50
|
-
];
|
|
51
|
-
/**
|
|
52
|
-
* Check whether a specific feature is available given the set of supported methods.
|
|
53
|
-
* A feature is available when ALL its required methods are present.
|
|
54
|
-
*/
|
|
55
|
-
export function isFeatureAvailable(featureId, supportedMethods) {
|
|
56
|
-
const feature = FEATURE_REGISTRY.find((f) => f.id === featureId);
|
|
57
|
-
if (!feature)
|
|
58
|
-
return false;
|
|
59
|
-
const methodSet = new Set(supportedMethods);
|
|
60
|
-
return feature.requiredMethods.every((m) => methodSet.has(m));
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Check whether a sub-feature is available given supported methods and daemon version.
|
|
64
|
-
* Requires the parent feature to be available AND the daemon version to satisfy the sub-feature minimum.
|
|
65
|
-
*/
|
|
66
|
-
export function isSubFeatureAvailable(featureId, subFeatureId, supportedMethods, daemonVersion) {
|
|
67
|
-
const feature = FEATURE_REGISTRY.find((f) => f.id === featureId);
|
|
68
|
-
if (!feature)
|
|
69
|
-
return false;
|
|
70
|
-
if (!isFeatureAvailable(featureId, supportedMethods))
|
|
71
|
-
return false;
|
|
72
|
-
const sub = feature.subFeatures?.find((s) => s.id === subFeatureId);
|
|
73
|
-
if (!sub)
|
|
74
|
-
return false;
|
|
75
|
-
if (!daemonVersion || !satisfiesMin(daemonVersion, sub.sinceVersion))
|
|
76
|
-
return false;
|
|
77
|
-
if (sub.requiredMethods) {
|
|
78
|
-
const methodSet = new Set(supportedMethods);
|
|
79
|
-
return sub.requiredMethods.every((m) => methodSet.has(m));
|
|
80
|
-
}
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
/** Look up the minimum version required for a sub-feature. */
|
|
84
|
-
export function getSubFeatureMinVersion(featureId, subFeatureId) {
|
|
85
|
-
const feature = FEATURE_REGISTRY.find((f) => f.id === featureId);
|
|
86
|
-
return feature?.subFeatures?.find((s) => s.id === subFeatureId)?.sinceVersion;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Return all features (and sub-features) that are NOT available.
|
|
90
|
-
* Sub-features are returned as "parentId/subId" when the parent is available
|
|
91
|
-
* but the daemon version is too low for the sub-feature.
|
|
92
|
-
*/
|
|
93
|
-
export function getUnavailableFeatures(supportedMethods, daemonVersion) {
|
|
94
|
-
const results = [];
|
|
95
|
-
const methodSet = new Set(supportedMethods);
|
|
96
|
-
for (const f of FEATURE_REGISTRY) {
|
|
97
|
-
if (!f.requiredMethods.every((m) => methodSet.has(m))) {
|
|
98
|
-
results.push({ id: f.id, sinceVersion: f.sinceVersion });
|
|
99
|
-
}
|
|
100
|
-
else if (f.subFeatures && daemonVersion) {
|
|
101
|
-
for (const sub of f.subFeatures) {
|
|
102
|
-
const versionLocked = !satisfiesMin(daemonVersion, sub.sinceVersion);
|
|
103
|
-
const methodsLocked = sub.requiredMethods != null && !sub.requiredMethods.every((m) => methodSet.has(m));
|
|
104
|
-
if (versionLocked || methodsLocked) {
|
|
105
|
-
results.push({ id: `${f.id}/${sub.id}`, sinceVersion: sub.sinceVersion });
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
return results;
|
|
111
|
-
}
|
|
112
|
-
//# sourceMappingURL=features.js.map
|
|
1
|
+
"use strict";import{satisfiesMin as d}from"./semver.js";export const FEATURE_REGISTRY=[{id:"agent-settings",requiredMethods:["get-agent-settings","set-agent-settings"],sinceVersion:"0.0.4",subFeatures:[{id:"startup-scripts",sinceVersion:"0.0.30"}]},{id:"labs-settings",requiredMethods:["get-labs-settings","set-labs-settings"],sinceVersion:"0.0.12"},{id:"history-sync",requiredMethods:["backfill-history-session"],sinceVersion:"0.0.12"},{id:"check-path",requiredMethods:["check-path"],sinceVersion:"0.0.7"},{id:"remote-upgrade",requiredMethods:["trigger-upgrade"],sinceVersion:"0.0.30"},{id:"checkpoint",requiredMethods:["checkpoint-list","checkpoint-diff","checkpoint-rollback"],sinceVersion:"0.0.30",subFeatures:[{id:"conversation-rollback",sinceVersion:"0.0.32"}]},{id:"scheduled-tasks",requiredMethods:["spawn-session"],sinceVersion:"0.0.35"}];export function isFeatureAvailable(r,n){const t=FEATURE_REGISTRY.find(e=>e.id===r);if(!t)return!1;const i=new Set(n);return t.requiredMethods.every(e=>i.has(e))}export function isSubFeatureAvailable(r,n,t,i){const e=FEATURE_REGISTRY.find(o=>o.id===r);if(!e||!isFeatureAvailable(r,t))return!1;const s=e.subFeatures?.find(o=>o.id===n);if(!s||!i||!d(i,s.sinceVersion))return!1;if(s.requiredMethods){const o=new Set(t);return s.requiredMethods.every(u=>o.has(u))}return!0}export function getSubFeatureMinVersion(r,n){return FEATURE_REGISTRY.find(i=>i.id===r)?.subFeatures?.find(i=>i.id===n)?.sinceVersion}export function getUnavailableFeatures(r,n){const t=[],i=new Set(r);for(const e of FEATURE_REGISTRY)if(!e.requiredMethods.every(s=>i.has(s)))t.push({id:e.id,sinceVersion:e.sinceVersion});else if(e.subFeatures&&n)for(const s of e.subFeatures){const o=!d(n,s.sinceVersion),u=s.requiredMethods!=null&&!s.requiredMethods.every(c=>i.has(c));(o||u)&&t.push({id:`${e.id}/${s.id}`,sinceVersion:s.sinceVersion})}return t}
|
package/dist/feedback.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export declare const MachineSnapshotSchema: z.ZodObject<{
|
|
|
10
10
|
hostname: z.ZodOptional<z.ZodString>;
|
|
11
11
|
daemonVersion: z.ZodOptional<z.ZodString>;
|
|
12
12
|
availableAgents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
13
|
+
agentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
14
|
nodeVersion: z.ZodOptional<z.ZodString>;
|
|
14
15
|
}, "strip", z.ZodTypeAny, {
|
|
15
16
|
machineId: string;
|
|
@@ -18,6 +19,7 @@ export declare const MachineSnapshotSchema: z.ZodObject<{
|
|
|
18
19
|
platform?: string | undefined;
|
|
19
20
|
arch?: string | undefined;
|
|
20
21
|
daemonVersion?: string | undefined;
|
|
22
|
+
agentVersions?: Record<string, string> | undefined;
|
|
21
23
|
nodeVersion?: string | undefined;
|
|
22
24
|
}, {
|
|
23
25
|
machineId: string;
|
|
@@ -26,6 +28,7 @@ export declare const MachineSnapshotSchema: z.ZodObject<{
|
|
|
26
28
|
platform?: string | undefined;
|
|
27
29
|
arch?: string | undefined;
|
|
28
30
|
daemonVersion?: string | undefined;
|
|
31
|
+
agentVersions?: Record<string, string> | undefined;
|
|
29
32
|
nodeVersion?: string | undefined;
|
|
30
33
|
}>;
|
|
31
34
|
export type MachineSnapshot = z.infer<typeof MachineSnapshotSchema>;
|
|
@@ -37,6 +40,7 @@ export declare const DeviceInfoSchema: z.ZodObject<{
|
|
|
37
40
|
hostname: z.ZodOptional<z.ZodString>;
|
|
38
41
|
daemonVersion: z.ZodOptional<z.ZodString>;
|
|
39
42
|
availableAgents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
43
|
+
agentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
40
44
|
nodeVersion: z.ZodOptional<z.ZodString>;
|
|
41
45
|
}, "strip", z.ZodTypeAny, {
|
|
42
46
|
machineId: string;
|
|
@@ -45,6 +49,7 @@ export declare const DeviceInfoSchema: z.ZodObject<{
|
|
|
45
49
|
platform?: string | undefined;
|
|
46
50
|
arch?: string | undefined;
|
|
47
51
|
daemonVersion?: string | undefined;
|
|
52
|
+
agentVersions?: Record<string, string> | undefined;
|
|
48
53
|
nodeVersion?: string | undefined;
|
|
49
54
|
}, {
|
|
50
55
|
machineId: string;
|
|
@@ -53,6 +58,7 @@ export declare const DeviceInfoSchema: z.ZodObject<{
|
|
|
53
58
|
platform?: string | undefined;
|
|
54
59
|
arch?: string | undefined;
|
|
55
60
|
daemonVersion?: string | undefined;
|
|
61
|
+
agentVersions?: Record<string, string> | undefined;
|
|
56
62
|
nodeVersion?: string | undefined;
|
|
57
63
|
}>, "many">>;
|
|
58
64
|
appVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -64,6 +70,7 @@ export declare const DeviceInfoSchema: z.ZodObject<{
|
|
|
64
70
|
platform?: string | undefined;
|
|
65
71
|
arch?: string | undefined;
|
|
66
72
|
daemonVersion?: string | undefined;
|
|
73
|
+
agentVersions?: Record<string, string> | undefined;
|
|
67
74
|
nodeVersion?: string | undefined;
|
|
68
75
|
}[] | undefined;
|
|
69
76
|
appVersion?: string | undefined;
|
|
@@ -75,6 +82,7 @@ export declare const DeviceInfoSchema: z.ZodObject<{
|
|
|
75
82
|
platform?: string | undefined;
|
|
76
83
|
arch?: string | undefined;
|
|
77
84
|
daemonVersion?: string | undefined;
|
|
85
|
+
agentVersions?: Record<string, string> | undefined;
|
|
78
86
|
nodeVersion?: string | undefined;
|
|
79
87
|
}[] | undefined;
|
|
80
88
|
appVersion?: string | undefined;
|
|
@@ -92,6 +100,7 @@ export declare const CreateFeedbackSchema: z.ZodObject<{
|
|
|
92
100
|
hostname: z.ZodOptional<z.ZodString>;
|
|
93
101
|
daemonVersion: z.ZodOptional<z.ZodString>;
|
|
94
102
|
availableAgents: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
103
|
+
agentVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
95
104
|
nodeVersion: z.ZodOptional<z.ZodString>;
|
|
96
105
|
}, "strip", z.ZodTypeAny, {
|
|
97
106
|
machineId: string;
|
|
@@ -100,6 +109,7 @@ export declare const CreateFeedbackSchema: z.ZodObject<{
|
|
|
100
109
|
platform?: string | undefined;
|
|
101
110
|
arch?: string | undefined;
|
|
102
111
|
daemonVersion?: string | undefined;
|
|
112
|
+
agentVersions?: Record<string, string> | undefined;
|
|
103
113
|
nodeVersion?: string | undefined;
|
|
104
114
|
}, {
|
|
105
115
|
machineId: string;
|
|
@@ -108,6 +118,7 @@ export declare const CreateFeedbackSchema: z.ZodObject<{
|
|
|
108
118
|
platform?: string | undefined;
|
|
109
119
|
arch?: string | undefined;
|
|
110
120
|
daemonVersion?: string | undefined;
|
|
121
|
+
agentVersions?: Record<string, string> | undefined;
|
|
111
122
|
nodeVersion?: string | undefined;
|
|
112
123
|
}>, "many">>;
|
|
113
124
|
appVersion: z.ZodOptional<z.ZodString>;
|
|
@@ -119,6 +130,7 @@ export declare const CreateFeedbackSchema: z.ZodObject<{
|
|
|
119
130
|
platform?: string | undefined;
|
|
120
131
|
arch?: string | undefined;
|
|
121
132
|
daemonVersion?: string | undefined;
|
|
133
|
+
agentVersions?: Record<string, string> | undefined;
|
|
122
134
|
nodeVersion?: string | undefined;
|
|
123
135
|
}[] | undefined;
|
|
124
136
|
appVersion?: string | undefined;
|
|
@@ -130,6 +142,7 @@ export declare const CreateFeedbackSchema: z.ZodObject<{
|
|
|
130
142
|
platform?: string | undefined;
|
|
131
143
|
arch?: string | undefined;
|
|
132
144
|
daemonVersion?: string | undefined;
|
|
145
|
+
agentVersions?: Record<string, string> | undefined;
|
|
133
146
|
nodeVersion?: string | undefined;
|
|
134
147
|
}[] | undefined;
|
|
135
148
|
appVersion?: string | undefined;
|
|
@@ -145,6 +158,7 @@ export declare const CreateFeedbackSchema: z.ZodObject<{
|
|
|
145
158
|
platform?: string | undefined;
|
|
146
159
|
arch?: string | undefined;
|
|
147
160
|
daemonVersion?: string | undefined;
|
|
161
|
+
agentVersions?: Record<string, string> | undefined;
|
|
148
162
|
nodeVersion?: string | undefined;
|
|
149
163
|
}[] | undefined;
|
|
150
164
|
appVersion?: string | undefined;
|
|
@@ -161,6 +175,7 @@ export declare const CreateFeedbackSchema: z.ZodObject<{
|
|
|
161
175
|
platform?: string | undefined;
|
|
162
176
|
arch?: string | undefined;
|
|
163
177
|
daemonVersion?: string | undefined;
|
|
178
|
+
agentVersions?: Record<string, string> | undefined;
|
|
164
179
|
nodeVersion?: string | undefined;
|
|
165
180
|
}[] | undefined;
|
|
166
181
|
appVersion?: string | undefined;
|
|
@@ -168,12 +183,15 @@ export declare const CreateFeedbackSchema: z.ZodObject<{
|
|
|
168
183
|
screenshots?: string[] | undefined;
|
|
169
184
|
}>;
|
|
170
185
|
export type CreateFeedback = z.infer<typeof CreateFeedbackSchema>;
|
|
171
|
-
export declare const
|
|
172
|
-
status: z.ZodEnum<["READ", "ARCHIVED"]
|
|
186
|
+
export declare const UpdateFeedbackSchema: z.ZodObject<{
|
|
187
|
+
status: z.ZodOptional<z.ZodEnum<["READ", "ARCHIVED"]>>;
|
|
188
|
+
reply: z.ZodOptional<z.ZodString>;
|
|
173
189
|
}, "strip", z.ZodTypeAny, {
|
|
174
|
-
status
|
|
190
|
+
status?: "READ" | "ARCHIVED" | undefined;
|
|
191
|
+
reply?: string | undefined;
|
|
175
192
|
}, {
|
|
176
|
-
status
|
|
193
|
+
status?: "READ" | "ARCHIVED" | undefined;
|
|
194
|
+
reply?: string | undefined;
|
|
177
195
|
}>;
|
|
178
|
-
export type
|
|
196
|
+
export type UpdateFeedback = z.infer<typeof UpdateFeedbackSchema>;
|
|
179
197
|
//# sourceMappingURL=feedback.d.ts.map
|
package/dist/feedback.js
CHANGED
|
@@ -1,26 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export const FeedbackTypeSchema = z.enum(['BUG', 'FEATURE', 'OTHER']);
|
|
3
|
-
export const FeedbackStatusSchema = z.enum(['UNREAD', 'READ', 'ARCHIVED']);
|
|
4
|
-
export const MachineSnapshotSchema = z.object({
|
|
5
|
-
machineId: z.string(),
|
|
6
|
-
platform: z.string().optional(),
|
|
7
|
-
arch: z.string().optional(),
|
|
8
|
-
hostname: z.string().optional(),
|
|
9
|
-
daemonVersion: z.string().optional(),
|
|
10
|
-
availableAgents: z.array(z.string()).optional(),
|
|
11
|
-
nodeVersion: z.string().optional(),
|
|
12
|
-
});
|
|
13
|
-
export const DeviceInfoSchema = z.object({
|
|
14
|
-
machines: z.array(MachineSnapshotSchema).optional(),
|
|
15
|
-
appVersion: z.string().optional(),
|
|
16
|
-
});
|
|
17
|
-
export const CreateFeedbackSchema = z.object({
|
|
18
|
-
type: FeedbackTypeSchema,
|
|
19
|
-
description: z.string().min(1).max(5000),
|
|
20
|
-
screenshots: z.array(z.string().max(700_000)).max(3).optional(),
|
|
21
|
-
deviceInfo: DeviceInfoSchema,
|
|
22
|
-
});
|
|
23
|
-
export const UpdateFeedbackStatusSchema = z.object({
|
|
24
|
-
status: z.enum(['READ', 'ARCHIVED']),
|
|
25
|
-
});
|
|
26
|
-
//# sourceMappingURL=feedback.js.map
|
|
1
|
+
"use strict";import{z as o}from"zod";export const FeedbackTypeSchema=o.enum(["BUG","FEATURE","OTHER"]),FeedbackStatusSchema=o.enum(["UNREAD","READ","ARCHIVED"]),MachineSnapshotSchema=o.object({machineId:o.string(),platform:o.string().optional(),arch:o.string().optional(),hostname:o.string().optional(),daemonVersion:o.string().optional(),availableAgents:o.array(o.string()).optional(),agentVersions:o.record(o.string()).optional(),nodeVersion:o.string().optional()}),DeviceInfoSchema=o.object({machines:o.array(MachineSnapshotSchema).optional(),appVersion:o.string().optional()}),CreateFeedbackSchema=o.object({type:FeedbackTypeSchema,description:o.string().min(1).max(5e3),screenshots:o.array(o.string().max(7e5)).max(3).optional(),deviceInfo:DeviceInfoSchema}),UpdateFeedbackSchema=o.object({status:o.enum(["READ","ARCHIVED"]).optional(),reply:o.string().min(1).max(5e3).optional()});
|
package/dist/index.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ export { RpcMethod, type RpcMethodType, SESSION_RPC_METHODS, MACHINE_RPC_METHODS
|
|
|
17
17
|
export type { RpcCall, RpcResult, SpawnSessionParams, CheckPathParams, GetMessagesParams, GetMessagesResponse, MachineInfoResponse, AgentEnvConfig, AgentSettings, LabsSettings, CustomModel, SkillDefinition, } from './rpc.js';
|
|
18
18
|
export { AGENT_CAPABILITIES, getAgentCapability, updateDynamicModes, getDynamicModes, normalizeModelId, } from './agentCapabilities.js';
|
|
19
19
|
export type { AgentCapability, AgentPermissionMode, AgentModelOption, } from './agentCapabilities.js';
|
|
20
|
-
export { ModelUsageEntrySchema, DailyActivitySchema, DailyModelTokensSchema, LongestSessionSchema,
|
|
21
|
-
export type { StatsOverview, ClaudeStatsData, ProjectSummary, ModelUsageEntry as WireModelUsageEntry, DailyActivity as WireDailyActivity, LongestSession as WireLongestSession,
|
|
20
|
+
export { ModelUsageEntrySchema, DailyActivitySchema, DailyModelTokensSchema, LongestSessionSchema, ClaudeStatsDataSchema, ProjectSummarySchema, StatsOverviewSchema, AgentTypeUsageSchema, ActivityUploadSchema, UsageReportSchema, TokenTrendPointSchema, ModelBreakdownEntrySchema, QuotaConfigSchema, } from './stats.js';
|
|
21
|
+
export type { StatsOverview, ClaudeStatsData, ProjectSummary, ModelUsageEntry as WireModelUsageEntry, DailyActivity as WireDailyActivity, LongestSession as WireLongestSession, AgentTypeUsage, ActivityUpload, UsageReport, TokenTrendPoint, ModelBreakdownEntry, QuotaConfig, QuotaStatusSchema, QuotaStatus, } from './stats.js';
|
|
22
22
|
export { ControlLevel } from './controlLevel.js';
|
|
23
23
|
export type { ControlLevelType } from './controlLevel.js';
|
|
24
24
|
export { PairingState, PairingRequestSchema, PairingResponseSchema, PairingExchangeSchema, PairingDeliverSchema, PairingStatusSchema, } from './pairing.js';
|
|
@@ -50,8 +50,8 @@ export { OpsRpcMessageSchema, OpsMethodSchema, OpsRpcTypeSchema, FileEntrySchema
|
|
|
50
50
|
export * from './edition.js';
|
|
51
51
|
export { LicensePayloadSchema, LicenseFileSchema } from './license.js';
|
|
52
52
|
export type { LicensePayload, LicenseFile } from './license.js';
|
|
53
|
-
export { FeedbackTypeSchema, FeedbackStatusSchema, DeviceInfoSchema, CreateFeedbackSchema,
|
|
54
|
-
export type { FeedbackType, FeedbackStatus, DeviceInfo, CreateFeedback,
|
|
53
|
+
export { FeedbackTypeSchema, FeedbackStatusSchema, DeviceInfoSchema, MachineSnapshotSchema, CreateFeedbackSchema, UpdateFeedbackSchema, } from './feedback.js';
|
|
54
|
+
export type { FeedbackType, FeedbackStatus, DeviceInfo, MachineSnapshot, CreateFeedback, UpdateFeedback, } from './feedback.js';
|
|
55
55
|
export interface SetupProgress {
|
|
56
56
|
readonly provider: boolean;
|
|
57
57
|
readonly credential: boolean;
|
package/dist/index.js
CHANGED
|
@@ -1,64 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// This is the "constitution" of the system.
|
|
3
|
-
// All components communicate through formats defined here.
|
|
4
|
-
// Session events
|
|
5
|
-
export { SessionTextEventSchema, SessionServiceEventSchema, SessionToolCallStartEventSchema, SessionToolCallEndEventSchema, SessionFileEventSchema, SessionTurnStartEventSchema, SessionTurnEndEventSchema, SessionTurnEndStatusSchema, TurnUsageSchema, SessionStartEventSchema, SessionStopEventSchema, SessionEventSchema, SessionPermissionResolvedEventSchema, PermissionActionSchema, SessionImageEventSchema, ImageAttachmentSchema, } from './events.js';
|
|
6
|
-
// Interaction events
|
|
7
|
-
export { QuestionOptionSchema, SessionQuestionEventSchema, SessionPermissionRequestEventSchema, SessionAnswerEventSchema, AnswerQuestionParamsSchema, ApprovePermissionParamsSchema, DenyPermissionParamsSchema, PermissionModeSchema, } from './interactionEvents.js';
|
|
8
|
-
// Session envelope
|
|
9
|
-
export { SessionRoleSchema, SessionEnvelopeSchema, createEnvelope } from './envelope.js';
|
|
10
|
-
// Message meta
|
|
11
|
-
export { AgentTypeSchema, MessageMetaSchema, AGENT_TYPES, SPAWNABLE_AGENTS, CLI_AGENT_TYPES, } from './messageMeta.js';
|
|
12
|
-
export { AGENT_SUPPORTS_IMAGES } from './messageMeta.js';
|
|
13
|
-
// Messages
|
|
14
|
-
export { SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, MessageContentSchema, } from './messages.js';
|
|
15
|
-
// Legacy protocol
|
|
16
|
-
export { UserMessageSchema, AgentMessageSchema, LegacyMessageContentSchema, } from './legacyProtocol.js';
|
|
17
|
-
// Sync update protocol
|
|
18
|
-
export { VersionedEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VersionedMachineEncryptedValueSchema, UpdateNewMessageBodySchema, UpdateSessionBodySchema, UpdateMachineBodySchema, UpdateSessionResetBodySchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, } from './sync.js';
|
|
19
|
-
// RPC
|
|
20
|
-
export { RpcMethod, SESSION_RPC_METHODS, MACHINE_RPC_METHODS, DAEMON_REQUIRED_RPC_METHODS, RpcCallSchema, RpcResultSchema, SpawnSessionParamsSchema, GetMessagesParamsSchema, GetMessagesResponseSchema, MachineInfoResponseSchema, CheckPathParamsSchema, AGENT_ENV_NONE, AgentEnvConfigSchema, AgentSettingsSchema, LabsSettingsSchema, CustomModelSchema, SkillDefinitionSchema, } from './rpc.js';
|
|
21
|
-
// Agent capabilities
|
|
22
|
-
export { AGENT_CAPABILITIES, getAgentCapability, updateDynamicModes, getDynamicModes, normalizeModelId, } from './agentCapabilities.js';
|
|
23
|
-
// Stats (OBS-2)
|
|
24
|
-
export { ModelUsageEntrySchema, DailyActivitySchema, DailyModelTokensSchema, LongestSessionSchema, SessionTokenSummarySchema, ClaudeStatsDataSchema, ProjectSummarySchema, StatsOverviewSchema, AgentTypeUsageSchema, ActivityUploadSchema, UsageReportSchema, TokenTrendPointSchema, ModelBreakdownEntrySchema, QuotaConfigSchema, } from './stats.js';
|
|
25
|
-
// Control level
|
|
26
|
-
export { ControlLevel } from './controlLevel.js';
|
|
27
|
-
// Pairing protocol
|
|
28
|
-
export { PairingState, PairingRequestSchema, PairingResponseSchema, PairingExchangeSchema, PairingDeliverSchema, PairingStatusSchema, } from './pairing.js';
|
|
29
|
-
// Machine & session status (DASH-2)
|
|
30
|
-
export { PlatformSchema, SessionStatusSchema, MachineSummarySchema, MachineRegisterResultSchema, } from './machine.js';
|
|
31
|
-
// Feature availability (RFC-035)
|
|
32
|
-
export { FEATURE_REGISTRY, isFeatureAvailable, getUnavailableFeatures, isSubFeatureAvailable, getSubFeatureMinVersion, } from './features.js';
|
|
33
|
-
// Session result (PROTO-2)
|
|
34
|
-
export { SessionResultSchema } from './sessionResult.js';
|
|
35
|
-
// Spawn errors
|
|
36
|
-
export { SpawnErrorCodeSchema, SpawnErrorSchema, createSpawnError } from './spawnError.js';
|
|
37
|
-
// Agent install guide
|
|
38
|
-
export { AGENT_INSTALL_GUIDE } from './agentInstallGuide.js';
|
|
39
|
-
// Agent common env vars
|
|
40
|
-
export { AGENT_COMMON_ENV_VARS } from './agentCommonEnv.js';
|
|
41
|
-
// Scheduled tasks (RFC-044)
|
|
42
|
-
export { RetryPolicySchema, MissedRunPolicySchema, ScheduledSpawnParamsSchema, TaskExecutionStatusSchema, TaskExecutionTriggerSchema, CreateScheduledTaskSchema, UpdateScheduledTaskSchema, ScheduledTaskSummarySchema, TaskExecutionSchema, CRON_RE, } from './scheduledTasks.js';
|
|
43
|
-
// Protocol version (RFC-021)
|
|
44
|
-
export { PROTOCOL_VERSION } from './protocol.js';
|
|
45
|
-
// Semver
|
|
46
|
-
export { parseSemver, compareVersions, satisfiesMin } from './semver.js';
|
|
47
|
-
// Utils
|
|
48
|
-
export { createId } from './utils.js';
|
|
49
|
-
export { errorMessage } from './errorMessage.js';
|
|
50
|
-
// Socket.IO event name constants
|
|
51
|
-
export { SOCKET_EVENTS } from './socketEvents.js';
|
|
52
|
-
// Telemetry (RFC-043)
|
|
53
|
-
export { TelemetryEventTypeSchema, TelemetryEventSchema, TelemetryReportPayloadSchema, sanitizeContext, } from './telemetry.js';
|
|
54
|
-
// Checkpoint RPC (RFC-044)
|
|
55
|
-
export * from './checkpointSchemas.js';
|
|
56
|
-
// Ops RPC (RFC-034)
|
|
57
|
-
export { OpsRpcMessageSchema, OpsMethodSchema, OpsRpcTypeSchema, FileEntrySchema, FileStatSchema, StorageUsageSchema, SyncUserSchema, SyncFullPayloadSchema, SyncUserCreatedPayloadSchema, SyncContainerStatusPayloadSchema, SyncUserPairedPayloadSchema, } from './ops.js';
|
|
58
|
-
// Edition (RFC-053)
|
|
59
|
-
export * from './edition.js';
|
|
60
|
-
// License
|
|
61
|
-
export { LicensePayloadSchema, LicenseFileSchema } from './license.js';
|
|
62
|
-
// Feedback
|
|
63
|
-
export { FeedbackTypeSchema, FeedbackStatusSchema, DeviceInfoSchema, CreateFeedbackSchema, UpdateFeedbackStatusSchema, } from './feedback.js';
|
|
64
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";export{SessionTextEventSchema,SessionServiceEventSchema,SessionToolCallStartEventSchema,SessionToolCallEndEventSchema,SessionFileEventSchema,SessionTurnStartEventSchema,SessionTurnEndEventSchema,SessionTurnEndStatusSchema,TurnUsageSchema,SessionStartEventSchema,SessionStopEventSchema,SessionEventSchema,SessionPermissionResolvedEventSchema,PermissionActionSchema,SessionImageEventSchema,ImageAttachmentSchema}from"./events.js";export{QuestionOptionSchema,SessionQuestionEventSchema,SessionPermissionRequestEventSchema,SessionAnswerEventSchema,AnswerQuestionParamsSchema,ApprovePermissionParamsSchema,DenyPermissionParamsSchema,PermissionModeSchema}from"./interactionEvents.js";export{SessionRoleSchema,SessionEnvelopeSchema,createEnvelope}from"./envelope.js";export{AgentTypeSchema,MessageMetaSchema,AGENT_TYPES,SPAWNABLE_AGENTS,CLI_AGENT_TYPES}from"./messageMeta.js";export{AGENT_SUPPORTS_IMAGES}from"./messageMeta.js";export{SessionMessageContentSchema,SessionMessageSchema,SessionProtocolMessageSchema,MessageContentSchema}from"./messages.js";export{UserMessageSchema,AgentMessageSchema,LegacyMessageContentSchema}from"./legacyProtocol.js";export{VersionedEncryptedValueSchema,VersionedNullableEncryptedValueSchema,VersionedMachineEncryptedValueSchema,UpdateNewMessageBodySchema,UpdateSessionBodySchema,UpdateMachineBodySchema,UpdateSessionResetBodySchema,CoreUpdateBodySchema,CoreUpdateContainerSchema}from"./sync.js";export{RpcMethod,SESSION_RPC_METHODS,MACHINE_RPC_METHODS,DAEMON_REQUIRED_RPC_METHODS,RpcCallSchema,RpcResultSchema,SpawnSessionParamsSchema,GetMessagesParamsSchema,GetMessagesResponseSchema,MachineInfoResponseSchema,CheckPathParamsSchema,AGENT_ENV_NONE,AgentEnvConfigSchema,AgentSettingsSchema,LabsSettingsSchema,CustomModelSchema,SkillDefinitionSchema}from"./rpc.js";export{AGENT_CAPABILITIES,getAgentCapability,updateDynamicModes,getDynamicModes,normalizeModelId}from"./agentCapabilities.js";export{ModelUsageEntrySchema,DailyActivitySchema,DailyModelTokensSchema,LongestSessionSchema,ClaudeStatsDataSchema,ProjectSummarySchema,StatsOverviewSchema,AgentTypeUsageSchema,ActivityUploadSchema,UsageReportSchema,TokenTrendPointSchema,ModelBreakdownEntrySchema,QuotaConfigSchema}from"./stats.js";export{ControlLevel}from"./controlLevel.js";export{PairingState,PairingRequestSchema,PairingResponseSchema,PairingExchangeSchema,PairingDeliverSchema,PairingStatusSchema}from"./pairing.js";export{PlatformSchema,SessionStatusSchema,MachineSummarySchema,MachineRegisterResultSchema}from"./machine.js";export{FEATURE_REGISTRY,isFeatureAvailable,getUnavailableFeatures,isSubFeatureAvailable,getSubFeatureMinVersion}from"./features.js";export{SessionResultSchema}from"./sessionResult.js";export{SpawnErrorCodeSchema,SpawnErrorSchema,createSpawnError}from"./spawnError.js";export{AGENT_INSTALL_GUIDE}from"./agentInstallGuide.js";export{AGENT_COMMON_ENV_VARS}from"./agentCommonEnv.js";export{RetryPolicySchema,MissedRunPolicySchema,ScheduledSpawnParamsSchema,TaskExecutionStatusSchema,TaskExecutionTriggerSchema,CreateScheduledTaskSchema,UpdateScheduledTaskSchema,ScheduledTaskSummarySchema,TaskExecutionSchema,CRON_RE}from"./scheduledTasks.js";export{PROTOCOL_VERSION}from"./protocol.js";export{parseSemver,compareVersions,satisfiesMin}from"./semver.js";export{createId}from"./utils.js";export{errorMessage}from"./errorMessage.js";export{SOCKET_EVENTS}from"./socketEvents.js";export{TelemetryEventTypeSchema,TelemetryEventSchema,TelemetryReportPayloadSchema,sanitizeContext}from"./telemetry.js";export*from"./checkpointSchemas.js";export{OpsRpcMessageSchema,OpsMethodSchema,OpsRpcTypeSchema,FileEntrySchema,FileStatSchema,StorageUsageSchema,SyncUserSchema,SyncFullPayloadSchema,SyncUserCreatedPayloadSchema,SyncContainerStatusPayloadSchema,SyncUserPairedPayloadSchema}from"./ops.js";export*from"./edition.js";export{LicensePayloadSchema,LicenseFileSchema}from"./license.js";export{FeedbackTypeSchema,FeedbackStatusSchema,DeviceInfoSchema,MachineSnapshotSchema,CreateFeedbackSchema,UpdateFeedbackSchema}from"./feedback.js";
|
|
@@ -1,108 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Interaction event schemas for bidirectional communication.
|
|
3
|
-
*
|
|
4
|
-
* Event types: question, permission-request, answer.
|
|
5
|
-
* RPC params: answer-question, approve-permission, deny-permission.
|
|
6
|
-
*/
|
|
7
|
-
import { z } from 'zod';
|
|
8
|
-
// ── Session Events ──
|
|
9
|
-
/** Option for structured (multiple-choice) questions. */
|
|
10
|
-
export const QuestionOptionSchema = z.object({
|
|
11
|
-
label: z.string(),
|
|
12
|
-
description: z.string().default(''),
|
|
13
|
-
});
|
|
14
|
-
/** Agent asks the user a question. */
|
|
15
|
-
export const SessionQuestionEventSchema = z.object({
|
|
16
|
-
t: z.literal('question'),
|
|
17
|
-
requestId: z.string(),
|
|
18
|
-
text: z.string(),
|
|
19
|
-
questionType: z
|
|
20
|
-
.enum(['free-text', 'yes-no', 'single-select', 'multi-select'])
|
|
21
|
-
.default('free-text'),
|
|
22
|
-
/** Header/category chip for structured questions. */
|
|
23
|
-
header: z.string().optional(),
|
|
24
|
-
/** Options for single-select / multi-select questions. */
|
|
25
|
-
options: z.array(QuestionOptionSchema).optional(),
|
|
26
|
-
/** Whether multiple options can be selected. */
|
|
27
|
-
multiSelect: z.boolean().optional(),
|
|
28
|
-
});
|
|
29
|
-
/** Agent requests tool execution approval. */
|
|
30
|
-
export const SessionPermissionRequestEventSchema = z.object({
|
|
31
|
-
t: z.literal('permission-request'),
|
|
32
|
-
requestId: z.string(),
|
|
33
|
-
toolName: z.string(),
|
|
34
|
-
toolCallId: z.string(),
|
|
35
|
-
args: z.record(z.unknown()),
|
|
36
|
-
description: z.string().default(''),
|
|
37
|
-
});
|
|
38
|
-
/** User's answer to a question or acknowledgement. */
|
|
39
|
-
export const SessionAnswerEventSchema = z.object({
|
|
40
|
-
t: z.literal('answer'),
|
|
41
|
-
requestId: z.string(),
|
|
42
|
-
text: z.string(),
|
|
43
|
-
});
|
|
44
|
-
/** How a permission was resolved — persisted in envelope stream for history replay. */
|
|
45
|
-
export const PermissionActionSchema = z.enum([
|
|
46
|
-
'approve',
|
|
47
|
-
'approve-all-edits',
|
|
48
|
-
'approve-tool',
|
|
49
|
-
'deny',
|
|
50
|
-
]);
|
|
51
|
-
/** Records the user's decision on a permission request (sent immediately after resolution). */
|
|
52
|
-
export const SessionPermissionResolvedEventSchema = z.object({
|
|
53
|
-
t: z.literal('permission-resolved'),
|
|
54
|
-
requestId: z.string(),
|
|
55
|
-
action: PermissionActionSchema,
|
|
56
|
-
/** Optional feedback from user explaining why permission was denied. */
|
|
57
|
-
reason: z.string().optional(),
|
|
58
|
-
});
|
|
59
|
-
// ── Image Attachment ──
|
|
60
|
-
/** A single image attachment (base64-encoded, frontend-compressed). */
|
|
61
|
-
export const ImageAttachmentSchema = z.object({
|
|
62
|
-
/** Base64-encoded image data (no data URI prefix). */
|
|
63
|
-
data: z.string(),
|
|
64
|
-
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
65
|
-
mediaType: z.string(),
|
|
66
|
-
});
|
|
67
|
-
// ── RPC Params ──
|
|
68
|
-
/** Params for answering a free-text question. */
|
|
69
|
-
export const AnswerQuestionParamsSchema = z.object({
|
|
70
|
-
sessionId: z.string(),
|
|
71
|
-
requestId: z.string(),
|
|
72
|
-
text: z.string(),
|
|
73
|
-
/** Optional image attachments (max 5, each ≤200KB base64 after compression). */
|
|
74
|
-
images: z.array(ImageAttachmentSchema).max(5).optional(),
|
|
75
|
-
});
|
|
76
|
-
/** Permission mode for Claude sessions. */
|
|
77
|
-
export const PermissionModeSchema = z.enum([
|
|
78
|
-
'default',
|
|
79
|
-
'acceptEdits',
|
|
80
|
-
'autoEdit',
|
|
81
|
-
'bypassPermissions',
|
|
82
|
-
'plan',
|
|
83
|
-
'read-only',
|
|
84
|
-
'safe-yolo',
|
|
85
|
-
'yolo',
|
|
86
|
-
'suggest',
|
|
87
|
-
'auto-edit',
|
|
88
|
-
'full-auto',
|
|
89
|
-
]);
|
|
90
|
-
/** Params for approving a tool permission request. */
|
|
91
|
-
export const ApprovePermissionParamsSchema = z.object({
|
|
92
|
-
sessionId: z.string(),
|
|
93
|
-
requestId: z.string(),
|
|
94
|
-
toolCallId: z.string(),
|
|
95
|
-
/** Optional mode change (e.g. 'acceptEdits' for "allow all edits this session"). */
|
|
96
|
-
mode: PermissionModeSchema.optional(),
|
|
97
|
-
/** Optional tool whitelist (e.g. ['Bash(npm test)'] for "don't ask again for this tool"). */
|
|
98
|
-
allowTools: z.array(z.string()).optional(),
|
|
99
|
-
});
|
|
100
|
-
/** Params for denying a tool permission request. */
|
|
101
|
-
export const DenyPermissionParamsSchema = z.object({
|
|
102
|
-
sessionId: z.string(),
|
|
103
|
-
requestId: z.string(),
|
|
104
|
-
toolCallId: z.string(),
|
|
105
|
-
/** Optional feedback from user explaining why permission was denied. */
|
|
106
|
-
reason: z.string().optional(),
|
|
107
|
-
});
|
|
108
|
-
//# sourceMappingURL=interactionEvents.js.map
|
|
1
|
+
"use strict";import{z as e}from"zod";export const QuestionOptionSchema=e.object({label:e.string(),description:e.string().default("")}),SessionQuestionEventSchema=e.object({t:e.literal("question"),requestId:e.string(),text:e.string(),questionType:e.enum(["free-text","yes-no","single-select","multi-select"]).default("free-text"),header:e.string().optional(),options:e.array(QuestionOptionSchema).optional(),multiSelect:e.boolean().optional()}),SessionPermissionRequestEventSchema=e.object({t:e.literal("permission-request"),requestId:e.string(),toolName:e.string(),toolCallId:e.string(),args:e.record(e.unknown()),description:e.string().default("")}),SessionAnswerEventSchema=e.object({t:e.literal("answer"),requestId:e.string(),text:e.string()}),PermissionActionSchema=e.enum(["approve","approve-all-edits","approve-tool","deny"]),SessionPermissionResolvedEventSchema=e.object({t:e.literal("permission-resolved"),requestId:e.string(),action:PermissionActionSchema,reason:e.string().optional()}),ImageAttachmentSchema=e.object({data:e.string(),mediaType:e.string()}),AnswerQuestionParamsSchema=e.object({sessionId:e.string(),requestId:e.string(),text:e.string(),images:e.array(ImageAttachmentSchema).max(5).optional()}),PermissionModeSchema=e.enum(["default","acceptEdits","autoEdit","bypassPermissions","plan","read-only","safe-yolo","yolo","suggest","auto-edit","full-auto"]),ApprovePermissionParamsSchema=e.object({sessionId:e.string(),requestId:e.string(),toolCallId:e.string(),mode:PermissionModeSchema.optional(),allowTools:e.array(e.string()).optional()}),DenyPermissionParamsSchema=e.object({sessionId:e.string(),requestId:e.string(),toolCallId:e.string(),reason:e.string().optional()});
|
package/dist/legacyProtocol.js
CHANGED
|
@@ -1,30 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Legacy protocol — aligned with Happy legacyProtocol.ts.
|
|
3
|
-
*
|
|
4
|
-
* Defines UserMessage and AgentMessage for backward compatibility.
|
|
5
|
-
*/
|
|
6
|
-
import { z } from 'zod';
|
|
7
|
-
import { MessageMetaSchema } from './messageMeta.js';
|
|
8
|
-
export const UserMessageSchema = z.object({
|
|
9
|
-
role: z.literal('user'),
|
|
10
|
-
content: z.object({
|
|
11
|
-
type: z.literal('text'),
|
|
12
|
-
text: z.string(),
|
|
13
|
-
}),
|
|
14
|
-
localKey: z.string().optional(),
|
|
15
|
-
meta: MessageMetaSchema.optional(),
|
|
16
|
-
});
|
|
17
|
-
export const AgentMessageSchema = z.object({
|
|
18
|
-
role: z.literal('agent'),
|
|
19
|
-
content: z
|
|
20
|
-
.object({
|
|
21
|
-
type: z.string(),
|
|
22
|
-
})
|
|
23
|
-
.passthrough(),
|
|
24
|
-
meta: MessageMetaSchema.optional(),
|
|
25
|
-
});
|
|
26
|
-
export const LegacyMessageContentSchema = z.discriminatedUnion('role', [
|
|
27
|
-
UserMessageSchema,
|
|
28
|
-
AgentMessageSchema,
|
|
29
|
-
]);
|
|
30
|
-
//# sourceMappingURL=legacyProtocol.js.map
|
|
1
|
+
"use strict";import{z as e}from"zod";import{MessageMetaSchema as t}from"./messageMeta.js";export const UserMessageSchema=e.object({role:e.literal("user"),content:e.object({type:e.literal("text"),text:e.string()}),localKey:e.string().optional(),meta:t.optional()}),AgentMessageSchema=e.object({role:e.literal("agent"),content:e.object({type:e.string()}).passthrough(),meta:t.optional()}),LegacyMessageContentSchema=e.discriminatedUnion("role",[UserMessageSchema,AgentMessageSchema]);
|
package/dist/license.js
CHANGED
|
@@ -1,17 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export const LicensePayloadSchema = z.object({
|
|
3
|
-
licensee: z.string().min(1),
|
|
4
|
-
edition: z.literal('enterprise'),
|
|
5
|
-
maxUsers: z.number().int().positive(),
|
|
6
|
-
expiresAt: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
7
|
-
issuedAt: z.string().regex(/^\d{4}-\d{2}-\d{2}$/),
|
|
8
|
-
suffix: z
|
|
9
|
-
.string()
|
|
10
|
-
.min(1)
|
|
11
|
-
.max(32)
|
|
12
|
-
.regex(/^[a-z0-9_-]+$/),
|
|
13
|
-
});
|
|
14
|
-
export const LicenseFileSchema = LicensePayloadSchema.extend({
|
|
15
|
-
signature: z.string().min(1),
|
|
16
|
-
});
|
|
17
|
-
//# sourceMappingURL=license.js.map
|
|
1
|
+
"use strict";import{z as e}from"zod";export const LicensePayloadSchema=e.object({licensee:e.string().min(1),edition:e.literal("enterprise"),maxUsers:e.number().int().positive(),expiresAt:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),issuedAt:e.string().regex(/^\d{4}-\d{2}-\d{2}$/),suffix:e.string().min(1).max(32).regex(/^[a-z0-9_-]+$/)}),LicenseFileSchema=LicensePayloadSchema.extend({signature:e.string().min(1)});
|