@agentdock/wire 0.0.38 → 0.0.40
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.d.ts +5 -0
- package/dist/edition.js +1 -0
- package/dist/envelope.js +1 -78
- package/dist/errorMessage.js +1 -6
- package/dist/events.js +1 -97
- package/dist/features.d.ts +2 -0
- package/dist/features.js +1 -112
- package/dist/feedback.js +1 -26
- package/dist/index.d.ts +13 -4
- package/dist/index.js +1 -60
- package/dist/interactionEvents.js +1 -108
- package/dist/legacyProtocol.js +1 -30
- package/dist/license.d.ts +52 -0
- package/dist/license.js +1 -0
- package/dist/machine.d.ts +34 -0
- package/dist/machine.js +1 -56
- package/dist/messageMeta.js +1 -60
- package/dist/messages.d.ts +8 -8
- 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.d.ts +7 -7
- package/dist/rpc.js +1 -230
- 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 -43
- package/dist/spawnError.js +1 -31
- package/dist/stats.d.ts +28 -0
- package/dist/stats.js +1 -115
- package/dist/sync.d.ts +23 -23
- 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/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/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/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.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 t}from"zod";export const FeedbackTypeSchema=t.enum(["BUG","FEATURE","OTHER"]),FeedbackStatusSchema=t.enum(["UNREAD","READ","ARCHIVED"]),MachineSnapshotSchema=t.object({machineId:t.string(),platform:t.string().optional(),arch:t.string().optional(),hostname:t.string().optional(),daemonVersion:t.string().optional(),availableAgents:t.array(t.string()).optional(),nodeVersion:t.string().optional()}),DeviceInfoSchema=t.object({machines:t.array(MachineSnapshotSchema).optional(),appVersion:t.string().optional()}),CreateFeedbackSchema=t.object({type:FeedbackTypeSchema,description:t.string().min(1).max(5e3),screenshots:t.array(t.string().max(7e5)).max(3).optional(),deviceInfo:DeviceInfoSchema}),UpdateFeedbackStatusSchema=t.object({status:t.enum(["READ","ARCHIVED"])});
|
package/dist/index.d.ts
CHANGED
|
@@ -17,14 +17,14 @@ 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, } 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, SessionTokenSummarySchema, ClaudeStatsDataSchema, ProjectSummarySchema, StatsOverviewSchema, AgentTypeUsageSchema, ActivityUploadSchema, UsageReportSchema, TokenTrendPointSchema, ModelBreakdownEntrySchema, } from './stats.js';
|
|
21
|
-
export type { StatsOverview, ClaudeStatsData, ProjectSummary, ModelUsageEntry as WireModelUsageEntry, DailyActivity as WireDailyActivity, LongestSession as WireLongestSession, SessionTokenSummary, AgentTypeUsage, ActivityUpload, UsageReport, TokenTrendPoint, ModelBreakdownEntry, } from './stats.js';
|
|
20
|
+
export { ModelUsageEntrySchema, DailyActivitySchema, DailyModelTokensSchema, LongestSessionSchema, SessionTokenSummarySchema, 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, SessionTokenSummary, 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';
|
|
25
25
|
export type { PairingRequest, PairingResponse, PairingExchange, PairingDeliver, PairingStatus, } from './pairing.js';
|
|
26
|
-
export { PlatformSchema, SessionStatusSchema, MachineSummarySchema, MachineRegisterResultSchema, } from './machine.js';
|
|
27
|
-
export type { Platform, SessionStatus, MachineSummary, MachineRegisterResult } from './machine.js';
|
|
26
|
+
export { PlatformSchema, SessionStatusSchema, MachineSummarySchema, MachineRegisterResultSchema, MigrationInfoSchema, } from './machine.js';
|
|
27
|
+
export type { Platform, SessionStatus, MachineSummary, MachineRegisterResult, MigrationInfo, } from './machine.js';
|
|
28
28
|
export { FEATURE_REGISTRY, isFeatureAvailable, getUnavailableFeatures, isSubFeatureAvailable, getSubFeatureMinVersion, } from './features.js';
|
|
29
29
|
export type { FeatureDefinition, SubFeatureDefinition } from './features.js';
|
|
30
30
|
export { SessionResultSchema } from './sessionResult.js';
|
|
@@ -47,6 +47,15 @@ export { TelemetryEventTypeSchema, TelemetryEventSchema, TelemetryReportPayloadS
|
|
|
47
47
|
export type { TelemetryEventType, TelemetryEvent, TelemetryReportPayload } from './telemetry.js';
|
|
48
48
|
export * from './checkpointSchemas.js';
|
|
49
49
|
export { OpsRpcMessageSchema, OpsMethodSchema, OpsRpcTypeSchema, FileEntrySchema, FileStatSchema, StorageUsageSchema, SyncUserSchema, SyncFullPayloadSchema, SyncUserCreatedPayloadSchema, SyncContainerStatusPayloadSchema, SyncUserPairedPayloadSchema, type OpsRpcMessage, type OpsMethod, type OpsRpcType, type OpsTunnelMetrics, type FileEntry, type FileStat, type StorageUsage, type SyncUser, type SyncFullPayload, type SyncUserCreatedPayload, type SyncContainerStatusPayload, type SyncUserPairedPayload, } from './ops.js';
|
|
50
|
+
export * from './edition.js';
|
|
51
|
+
export { LicensePayloadSchema, LicenseFileSchema } from './license.js';
|
|
52
|
+
export type { LicensePayload, LicenseFile } from './license.js';
|
|
50
53
|
export { FeedbackTypeSchema, FeedbackStatusSchema, DeviceInfoSchema, CreateFeedbackSchema, UpdateFeedbackStatusSchema, } from './feedback.js';
|
|
51
54
|
export type { FeedbackType, FeedbackStatus, DeviceInfo, CreateFeedback, UpdateFeedbackStatus, } from './feedback.js';
|
|
55
|
+
export interface SetupProgress {
|
|
56
|
+
readonly provider: boolean;
|
|
57
|
+
readonly credential: boolean;
|
|
58
|
+
readonly group: boolean;
|
|
59
|
+
readonly user: boolean;
|
|
60
|
+
}
|
|
52
61
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,60 +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, } 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, } 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
|
-
// Feedback
|
|
59
|
-
export { FeedbackTypeSchema, FeedbackStatusSchema, DeviceInfoSchema, CreateFeedbackSchema, UpdateFeedbackStatusSchema, } from './feedback.js';
|
|
60
|
-
//# 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}from"./rpc.js";export{AGENT_CAPABILITIES,getAgentCapability,updateDynamicModes,getDynamicModes,normalizeModelId}from"./agentCapabilities.js";export{ModelUsageEntrySchema,DailyActivitySchema,DailyModelTokensSchema,LongestSessionSchema,SessionTokenSummarySchema,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,MigrationInfoSchema}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,CreateFeedbackSchema,UpdateFeedbackStatusSchema}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]);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const LicensePayloadSchema: z.ZodObject<{
|
|
3
|
+
licensee: z.ZodString;
|
|
4
|
+
edition: z.ZodLiteral<"enterprise">;
|
|
5
|
+
maxUsers: z.ZodNumber;
|
|
6
|
+
expiresAt: z.ZodString;
|
|
7
|
+
issuedAt: z.ZodString;
|
|
8
|
+
suffix: z.ZodString;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
licensee: string;
|
|
11
|
+
edition: "enterprise";
|
|
12
|
+
maxUsers: number;
|
|
13
|
+
expiresAt: string;
|
|
14
|
+
issuedAt: string;
|
|
15
|
+
suffix: string;
|
|
16
|
+
}, {
|
|
17
|
+
licensee: string;
|
|
18
|
+
edition: "enterprise";
|
|
19
|
+
maxUsers: number;
|
|
20
|
+
expiresAt: string;
|
|
21
|
+
issuedAt: string;
|
|
22
|
+
suffix: string;
|
|
23
|
+
}>;
|
|
24
|
+
export type LicensePayload = z.infer<typeof LicensePayloadSchema>;
|
|
25
|
+
export declare const LicenseFileSchema: z.ZodObject<{
|
|
26
|
+
licensee: z.ZodString;
|
|
27
|
+
edition: z.ZodLiteral<"enterprise">;
|
|
28
|
+
maxUsers: z.ZodNumber;
|
|
29
|
+
expiresAt: z.ZodString;
|
|
30
|
+
issuedAt: z.ZodString;
|
|
31
|
+
suffix: z.ZodString;
|
|
32
|
+
} & {
|
|
33
|
+
signature: z.ZodString;
|
|
34
|
+
}, "strip", z.ZodTypeAny, {
|
|
35
|
+
licensee: string;
|
|
36
|
+
edition: "enterprise";
|
|
37
|
+
maxUsers: number;
|
|
38
|
+
expiresAt: string;
|
|
39
|
+
issuedAt: string;
|
|
40
|
+
suffix: string;
|
|
41
|
+
signature: string;
|
|
42
|
+
}, {
|
|
43
|
+
licensee: string;
|
|
44
|
+
edition: "enterprise";
|
|
45
|
+
maxUsers: number;
|
|
46
|
+
expiresAt: string;
|
|
47
|
+
issuedAt: string;
|
|
48
|
+
suffix: string;
|
|
49
|
+
signature: string;
|
|
50
|
+
}>;
|
|
51
|
+
export type LicenseFile = z.infer<typeof LicenseFileSchema>;
|
|
52
|
+
//# sourceMappingURL=license.d.ts.map
|
package/dist/license.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
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)});
|
package/dist/machine.d.ts
CHANGED
|
@@ -78,6 +78,19 @@ export declare const MachineSummarySchema: z.ZodObject<{
|
|
|
78
78
|
superseded?: boolean | undefined;
|
|
79
79
|
}>;
|
|
80
80
|
export type MachineSummary = z.infer<typeof MachineSummarySchema>;
|
|
81
|
+
export declare const MigrationInfoSchema: z.ZodObject<{
|
|
82
|
+
/** The npm package to migrate to (e.g. 'ccpark'). */
|
|
83
|
+
targetPackage: z.ZodString;
|
|
84
|
+
/** User-facing message explaining the migration. */
|
|
85
|
+
message: z.ZodString;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
message: string;
|
|
88
|
+
targetPackage: string;
|
|
89
|
+
}, {
|
|
90
|
+
message: string;
|
|
91
|
+
targetPackage: string;
|
|
92
|
+
}>;
|
|
93
|
+
export type MigrationInfo = z.infer<typeof MigrationInfoSchema>;
|
|
81
94
|
export declare const MachineRegisterResultSchema: z.ZodObject<{
|
|
82
95
|
ok: z.ZodBoolean;
|
|
83
96
|
error: z.ZodOptional<z.ZodString>;
|
|
@@ -89,6 +102,19 @@ export declare const MachineRegisterResultSchema: z.ZodObject<{
|
|
|
89
102
|
}, {
|
|
90
103
|
historySessionSync?: boolean | undefined;
|
|
91
104
|
}>>;
|
|
105
|
+
/** Present when the daemon's brand has been renamed and should migrate. */
|
|
106
|
+
migration: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
/** The npm package to migrate to (e.g. 'ccpark'). */
|
|
108
|
+
targetPackage: z.ZodString;
|
|
109
|
+
/** User-facing message explaining the migration. */
|
|
110
|
+
message: z.ZodString;
|
|
111
|
+
}, "strip", z.ZodTypeAny, {
|
|
112
|
+
message: string;
|
|
113
|
+
targetPackage: string;
|
|
114
|
+
}, {
|
|
115
|
+
message: string;
|
|
116
|
+
targetPackage: string;
|
|
117
|
+
}>>;
|
|
92
118
|
}, "strip", z.ZodTypeAny, {
|
|
93
119
|
ok: boolean;
|
|
94
120
|
error?: string | undefined;
|
|
@@ -96,6 +122,10 @@ export declare const MachineRegisterResultSchema: z.ZodObject<{
|
|
|
96
122
|
labsSettings?: {
|
|
97
123
|
historySessionSync: boolean;
|
|
98
124
|
} | undefined;
|
|
125
|
+
migration?: {
|
|
126
|
+
message: string;
|
|
127
|
+
targetPackage: string;
|
|
128
|
+
} | undefined;
|
|
99
129
|
}, {
|
|
100
130
|
ok: boolean;
|
|
101
131
|
error?: string | undefined;
|
|
@@ -103,6 +133,10 @@ export declare const MachineRegisterResultSchema: z.ZodObject<{
|
|
|
103
133
|
labsSettings?: {
|
|
104
134
|
historySessionSync?: boolean | undefined;
|
|
105
135
|
} | undefined;
|
|
136
|
+
migration?: {
|
|
137
|
+
message: string;
|
|
138
|
+
targetPackage: string;
|
|
139
|
+
} | undefined;
|
|
106
140
|
}>;
|
|
107
141
|
export type MachineRegisterResult = z.infer<typeof MachineRegisterResultSchema>;
|
|
108
142
|
export declare const SetDefaultMachineBodySchema: z.ZodObject<{
|
package/dist/machine.js
CHANGED
|
@@ -1,56 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Machine and session status schemas for Dashboard & Machine Management.
|
|
3
|
-
*
|
|
4
|
-
* MachineSummary — device info returned by GET /v1/machines.
|
|
5
|
-
* SessionStatus — real-time session state indicator.
|
|
6
|
-
* Platform — OS platform enum matching Node's process.platform.
|
|
7
|
-
*/
|
|
8
|
-
import { z } from 'zod';
|
|
9
|
-
import { LabsSettingsSchema } from './rpc.js';
|
|
10
|
-
export const PlatformSchema = z.enum(['darwin', 'linux', 'win32']);
|
|
11
|
-
export const SessionStatusSchema = z.enum([
|
|
12
|
-
'idle',
|
|
13
|
-
'thinking',
|
|
14
|
-
'tool_running',
|
|
15
|
-
'permission_required',
|
|
16
|
-
'disconnected',
|
|
17
|
-
]);
|
|
18
|
-
export const MachineSummarySchema = z.object({
|
|
19
|
-
id: z.string(),
|
|
20
|
-
hostname: z.string(),
|
|
21
|
-
platform: PlatformSchema,
|
|
22
|
-
arch: z.string().optional(),
|
|
23
|
-
displayName: z.string().optional(),
|
|
24
|
-
daemonVersion: z.string().optional(),
|
|
25
|
-
active: z.boolean(),
|
|
26
|
-
activeAt: z.number(),
|
|
27
|
-
createdAt: z.number(),
|
|
28
|
-
/** Whether this machine has an active terminal-server tunnel. */
|
|
29
|
-
hasTerminal: z.boolean().optional(),
|
|
30
|
-
/** Number of active sessions on this machine. */
|
|
31
|
-
activeSessions: z.number().optional(),
|
|
32
|
-
/** Total number of sessions on this machine. */
|
|
33
|
-
totalSessions: z.number().optional(),
|
|
34
|
-
/** Agent types available on this machine (persisted on each daemon connect). */
|
|
35
|
-
availableAgents: z.array(z.string()).optional(),
|
|
36
|
-
/** RPC methods this machine's daemon has registered (RFC-035). */
|
|
37
|
-
supportedMethods: z.array(z.string()).optional(),
|
|
38
|
-
/** Why the machine disconnected — 'upgrade-required' triggers UI upgrade prompts (RFC-037). */
|
|
39
|
-
disconnectReason: z.enum(['normal', 'upgrade-required']).optional(),
|
|
40
|
-
/** Current upgrade state reported by the daemon (RFC-042). */
|
|
41
|
-
upgradeStatus: z.enum(['idle', 'preflight', 'downloading', 'switching', 'failed']).optional(),
|
|
42
|
-
/** Error message when upgradeStatus is 'failed' (RFC-042). */
|
|
43
|
-
upgradeError: z.string().optional(),
|
|
44
|
-
/** True when this machine has been replaced by a new one (container rebuild). */
|
|
45
|
-
superseded: z.boolean().optional(),
|
|
46
|
-
});
|
|
47
|
-
export const MachineRegisterResultSchema = z.object({
|
|
48
|
-
ok: z.boolean(),
|
|
49
|
-
error: z.string().optional(),
|
|
50
|
-
latestVersion: z.string().optional(),
|
|
51
|
-
labsSettings: LabsSettingsSchema.optional(),
|
|
52
|
-
});
|
|
53
|
-
export const SetDefaultMachineBodySchema = z.object({
|
|
54
|
-
machineId: z.string().nullable(),
|
|
55
|
-
});
|
|
56
|
-
//# sourceMappingURL=machine.js.map
|
|
1
|
+
"use strict";import{z as o}from"zod";import{LabsSettingsSchema as t}from"./rpc.js";export const PlatformSchema=o.enum(["darwin","linux","win32"]),SessionStatusSchema=o.enum(["idle","thinking","tool_running","permission_required","disconnected"]),MachineSummarySchema=o.object({id:o.string(),hostname:o.string(),platform:PlatformSchema,arch:o.string().optional(),displayName:o.string().optional(),daemonVersion:o.string().optional(),active:o.boolean(),activeAt:o.number(),createdAt:o.number(),hasTerminal:o.boolean().optional(),activeSessions:o.number().optional(),totalSessions:o.number().optional(),availableAgents:o.array(o.string()).optional(),supportedMethods:o.array(o.string()).optional(),disconnectReason:o.enum(["normal","upgrade-required"]).optional(),upgradeStatus:o.enum(["idle","preflight","downloading","switching","failed"]).optional(),upgradeError:o.string().optional(),superseded:o.boolean().optional()}),MigrationInfoSchema=o.object({targetPackage:o.string(),message:o.string()}),MachineRegisterResultSchema=o.object({ok:o.boolean(),error:o.string().optional(),latestVersion:o.string().optional(),labsSettings:t.optional(),migration:MigrationInfoSchema.optional()}),SetDefaultMachineBodySchema=o.object({machineId:o.string().nullable()});
|
package/dist/messageMeta.js
CHANGED
|
@@ -1,60 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { PermissionModeSchema } from './interactionEvents.js';
|
|
3
|
-
/** Supported agent types for avatar and UI differentiation. */
|
|
4
|
-
export const AgentTypeSchema = z.enum([
|
|
5
|
-
'claude',
|
|
6
|
-
'copilot',
|
|
7
|
-
'codex',
|
|
8
|
-
'gemini',
|
|
9
|
-
'opencode',
|
|
10
|
-
'hermes',
|
|
11
|
-
'openclaw',
|
|
12
|
-
'custom',
|
|
13
|
-
]);
|
|
14
|
-
/** All agent type values derived from the schema (single source of truth). */
|
|
15
|
-
export const AGENT_TYPES = AgentTypeSchema.options;
|
|
16
|
-
/** Agent types that can be spawned as sessions (excludes 'custom'). */
|
|
17
|
-
export const SPAWNABLE_AGENTS = AGENT_TYPES.filter((a) => a !== 'custom');
|
|
18
|
-
/** CLI identifiers accepted by spawn-session RPC. */
|
|
19
|
-
export const CLI_AGENT_TYPES = [
|
|
20
|
-
'claude',
|
|
21
|
-
'copilot',
|
|
22
|
-
'opencode',
|
|
23
|
-
'codex',
|
|
24
|
-
'gemini',
|
|
25
|
-
'hermes',
|
|
26
|
-
'openclaw',
|
|
27
|
-
];
|
|
28
|
-
export const MessageMetaSchema = z.object({
|
|
29
|
-
sentFrom: z.string().optional(),
|
|
30
|
-
permissionMode: PermissionModeSchema.optional(),
|
|
31
|
-
model: z.string().nullable().optional(),
|
|
32
|
-
fallbackModel: z.string().nullable().optional(),
|
|
33
|
-
customSystemPrompt: z.string().nullable().optional(),
|
|
34
|
-
appendSystemPrompt: z.string().nullable().optional(),
|
|
35
|
-
allowedTools: z.array(z.string()).nullable().optional(),
|
|
36
|
-
disallowedTools: z.array(z.string()).nullable().optional(),
|
|
37
|
-
displayText: z.string().optional(),
|
|
38
|
-
/** Agent type for UI differentiation (avatar, colors). */
|
|
39
|
-
agentType: AgentTypeSchema.nullable().optional(),
|
|
40
|
-
/** Session start timestamp (Unix ms). */
|
|
41
|
-
startedAt: z.number().nullable().optional(),
|
|
42
|
-
/** Session status for info display. */
|
|
43
|
-
sessionStatus: z
|
|
44
|
-
.enum(['running', 'idle', 'completed', 'failed', 'cancelled'])
|
|
45
|
-
.nullable()
|
|
46
|
-
.optional(),
|
|
47
|
-
});
|
|
48
|
-
/** Hardcoded per-agent image support. UX-driven: hides image button immediately on agent selection.
|
|
49
|
-
* Updated when agents add ACP promptCapabilities.image support. */
|
|
50
|
-
export const AGENT_SUPPORTS_IMAGES = {
|
|
51
|
-
claude: true,
|
|
52
|
-
copilot: true,
|
|
53
|
-
codex: false, // Only supports URL/localPath, not base64
|
|
54
|
-
gemini: true,
|
|
55
|
-
opencode: true,
|
|
56
|
-
hermes: false, // ACP: promptCapabilities.image = false
|
|
57
|
-
openclaw: false, // ACP: promptCapabilities.image = false
|
|
58
|
-
custom: true, // Unknown, assume yes
|
|
59
|
-
};
|
|
60
|
-
//# sourceMappingURL=messageMeta.js.map
|
|
1
|
+
"use strict";import{z as e}from"zod";import{PermissionModeSchema as l}from"./interactionEvents.js";export const AgentTypeSchema=e.enum(["claude","copilot","codex","gemini","opencode","hermes","openclaw","custom"]),AGENT_TYPES=AgentTypeSchema.options,SPAWNABLE_AGENTS=AGENT_TYPES.filter(o=>o!=="custom"),CLI_AGENT_TYPES=["claude","copilot","opencode","codex","gemini","hermes","openclaw"],MessageMetaSchema=e.object({sentFrom:e.string().optional(),permissionMode:l.optional(),model:e.string().nullable().optional(),fallbackModel:e.string().nullable().optional(),customSystemPrompt:e.string().nullable().optional(),appendSystemPrompt:e.string().nullable().optional(),allowedTools:e.array(e.string()).nullable().optional(),disallowedTools:e.array(e.string()).nullable().optional(),displayText:e.string().optional(),agentType:AgentTypeSchema.nullable().optional(),startedAt:e.number().nullable().optional(),sessionStatus:e.enum(["running","idle","completed","failed","cancelled"]).nullable().optional()}),AGENT_SUPPORTS_IMAGES={claude:!0,copilot:!0,codex:!1,gemini:!0,opencode:!0,hermes:!1,openclaw:!1,custom:!0};
|