@agentdock/wire 0.0.62 → 0.0.64

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.
@@ -274,16 +274,19 @@ export declare const SessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
274
274
  requestId: z.ZodString;
275
275
  action: z.ZodEnum<["approve", "approve-all-edits", "approve-tool", "deny"]>;
276
276
  reason: z.ZodOptional<z.ZodString>;
277
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
277
278
  }, "strip", z.ZodTypeAny, {
278
279
  t: "permission-resolved";
279
280
  requestId: string;
280
281
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
281
282
  reason?: string | undefined;
283
+ allowTools?: string[] | undefined;
282
284
  }, {
283
285
  t: "permission-resolved";
284
286
  requestId: string;
285
287
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
286
288
  reason?: string | undefined;
289
+ allowTools?: string[] | undefined;
287
290
  }>, z.ZodObject<{
288
291
  t: z.ZodLiteral<"image">;
289
292
  data: z.ZodString;
@@ -328,6 +331,7 @@ export declare const SessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
328
331
  requestId: string;
329
332
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
330
333
  reason?: string | undefined;
334
+ allowTools?: string[] | undefined;
331
335
  } | {
332
336
  t: "text";
333
337
  text: string;
@@ -420,6 +424,7 @@ export declare const SessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
420
424
  requestId: string;
421
425
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
422
426
  reason?: string | undefined;
427
+ allowTools?: string[] | undefined;
423
428
  } | {
424
429
  t: "text";
425
430
  text: string;
@@ -512,6 +517,7 @@ export declare const SessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
512
517
  requestId: string;
513
518
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
514
519
  reason?: string | undefined;
520
+ allowTools?: string[] | undefined;
515
521
  } | {
516
522
  t: "text";
517
523
  text: string;
@@ -604,6 +610,7 @@ export declare const SessionEnvelopeSchema: z.ZodEffects<z.ZodObject<{
604
610
  requestId: string;
605
611
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
606
612
  reason?: string | undefined;
613
+ allowTools?: string[] | undefined;
607
614
  } | {
608
615
  t: "text";
609
616
  text: string;
package/dist/events.d.ts CHANGED
@@ -495,16 +495,19 @@ export declare const SessionEventSchema: z.ZodDiscriminatedUnion<"t", [z.ZodObje
495
495
  requestId: z.ZodString;
496
496
  action: z.ZodEnum<["approve", "approve-all-edits", "approve-tool", "deny"]>;
497
497
  reason: z.ZodOptional<z.ZodString>;
498
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
498
499
  }, "strip", z.ZodTypeAny, {
499
500
  t: "permission-resolved";
500
501
  requestId: string;
501
502
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
502
503
  reason?: string | undefined;
504
+ allowTools?: string[] | undefined;
503
505
  }, {
504
506
  t: "permission-resolved";
505
507
  requestId: string;
506
508
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
507
509
  reason?: string | undefined;
510
+ allowTools?: string[] | undefined;
508
511
  }>, z.ZodObject<{
509
512
  t: z.ZodLiteral<"image">;
510
513
  /** Base64-encoded image data. */
package/dist/features.js CHANGED
@@ -1 +1 @@
1
- "use strict";import{satisfiesMin as u}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"},{id:"auto-upgrade-daemon",requiredMethods:["set-auto-upgrade-daemon"],sinceVersion:"0.0.31"}];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||!u(i,s.sinceVersion))return!1;if(s.requiredMethods){const o=new Set(t);return s.requiredMethods.every(d=>o.has(d))}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=!u(n,s.sinceVersion),d=s.requiredMethods!=null&&!s.requiredMethods.every(c=>i.has(c));(o||d)&&t.push({id:`${e.id}/${s.id}`,sinceVersion:s.sinceVersion})}return t}
1
+ "use strict";import{satisfiesMin as u}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"},{id:"auto-upgrade-daemon",requiredMethods:["set-auto-upgrade-daemon"],sinceVersion:"0.0.31"},{id:"file-upload",requiredMethods:["file-relay-receive"],sinceVersion:"0.0.36",edition:"personal"}];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||!u(i,s.sinceVersion))return!1;if(s.requiredMethods){const o=new Set(t);return s.requiredMethods.every(d=>o.has(d))}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=!u(n,s.sinceVersion),d=s.requiredMethods!=null&&!s.requiredMethods.every(c=>i.has(c));(o||d)&&t.push({id:`${e.id}/${s.id}`,sinceVersion:s.sinceVersion})}return t}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * File upload whitelist — single source of truth for personal-edition file
3
+ * upload validation, shared across web (PWA client), server (relay preflight),
4
+ * and daemon (receiver second-check).
5
+ *
6
+ * Contains ONLY isomorphic data + pure byte logic (no node:/DOM deps):
7
+ * - per-category extension lists and max sizes
8
+ * - blocked (executable) extensions
9
+ * - magic-byte signatures
10
+ * - category resolution + magic-byte verification over Uint8Array
11
+ *
12
+ * File reading differs per platform (File/FileReader on web, Buffer on
13
+ * server/daemon), so callers read the head bytes themselves and pass a
14
+ * Uint8Array in. Buffer is a Uint8Array subclass, so `verifyMagicBytes`
15
+ * works unchanged on both.
16
+ */
17
+ export type FileCategory = 'text' | 'document' | 'code' | 'image';
18
+ export declare const TEXT_EXTS: readonly string[];
19
+ export declare const CODE_EXTS: readonly string[];
20
+ export declare const DOC_EXTS: readonly string[];
21
+ export declare const IMG_EXTS: readonly string[];
22
+ /** Per-category max upload size in bytes. */
23
+ export declare const FILE_CATEGORY_MAX_SIZE: Readonly<Record<FileCategory, number>>;
24
+ /** Executable / dangerous extensions — always rejected. */
25
+ export declare const BLOCKED_EXTS: ReadonlySet<string>;
26
+ /** All allowed extensions across every category. */
27
+ export declare const ALLOWED_EXTENSIONS: ReadonlySet<string>;
28
+ /**
29
+ * Binary magic-byte signatures keyed by extension. `subSig` is checked at an
30
+ * offset immediately after `sig` (used by WEBP's RIFF...WEBP layout).
31
+ * Text-based formats (text/code/svg) are not here — they use UTF-8 validation.
32
+ */
33
+ export declare const FILE_SIGNATURES: Readonly<Record<string, {
34
+ sig: number[];
35
+ subSigAt?: number;
36
+ subSig?: number[];
37
+ }>>;
38
+ /** Lowercased extension (including leading dot) or '' if none. */
39
+ export declare function getFileExt(filename: string): string;
40
+ /**
41
+ * Resolve the whitelist category for an extension.
42
+ * Returns null for blocked, unknown, or extension-less files.
43
+ */
44
+ export declare function resolveFileCategory(ext: string): FileCategory | null;
45
+ /**
46
+ * Verify head bytes match the expected type for `ext`.
47
+ * - text/code: valid UTF-8
48
+ * - svg: XML text sniff
49
+ * - binary formats: magic-byte signature (+ optional sub-signature)
50
+ *
51
+ * `ext` must already be lowercased (use getFileExt). Buffer is a Uint8Array
52
+ * subclass, so server/daemon can pass a Buffer directly.
53
+ */
54
+ export declare function verifyMagicBytes(head: Uint8Array, ext: string): boolean;
55
+ //# sourceMappingURL=fileWhitelist.d.ts.map
@@ -0,0 +1 @@
1
+ "use strict";export const TEXT_EXTS=[".txt",".md",".log",".csv",".json",".xml",".yaml",".yml",".toml",".env"],CODE_EXTS=[".ts",".tsx",".js",".jsx",".py",".rs",".go",".java",".c",".cpp",".h",".css",".html",".sql",".sh"],DOC_EXTS=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx"],IMG_EXTS=[".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"],FILE_CATEGORY_MAX_SIZE={text:1048576,document:2097152,code:1048576,image:1048576},BLOCKED_EXTS=new Set([".exe",".bat",".cmd",".msi",".dmg",".app",".com",".scr"]),ALLOWED_EXTENSIONS=new Set([...TEXT_EXTS,...CODE_EXTS,...DOC_EXTS,...IMG_EXTS]);const r={text:TEXT_EXTS,code:CODE_EXTS,document:DOC_EXTS,image:IMG_EXTS};export const FILE_SIGNATURES={".pdf":{sig:[37,80,68,70,45]},".doc":{sig:[208,207,17,224,161,177,26,225]},".xls":{sig:[208,207,17,224,161,177,26,225]},".ppt":{sig:[208,207,17,224,161,177,26,225]},".docx":{sig:[80,75,3,4]},".xlsx":{sig:[80,75,3,4]},".pptx":{sig:[80,75,3,4]},".png":{sig:[137,80,78,71,13,10,26,10]},".jpg":{sig:[255,216,255]},".jpeg":{sig:[255,216,255]},".gif":{sig:[71,73,70,56]},".webp":{sig:[82,73,70,70],subSigAt:8,subSig:[87,69,66,80]},".bmp":{sig:[66,77]}};export function getFileExt(t){const x=t.lastIndexOf(".");return x>=0?t.substring(x).toLowerCase():""}export function resolveFileCategory(t){if(t===""||BLOCKED_EXTS.has(t))return null;for(const x of Object.keys(r))if(r[x].includes(t))return x;return null}function i(t){try{return new TextDecoder("utf-8",{fatal:!0}).decode(t)}catch{return null}}function o(t){const x=i(t.subarray(0,Math.min(t.length,512)));if(x===null)return!1;const e=(x.charCodeAt(0)===65279?x.slice(1):x).trimStart();return e.startsWith("<?xml")||e.startsWith("<svg")||e.startsWith("<!DOCTYPE svg")}export function verifyMagicBytes(t,x){if(TEXT_EXTS.includes(x)||CODE_EXTS.includes(x))return i(t)!==null;if(x===".svg")return o(t);const e=FILE_SIGNATURES[x];if(!e||t.length<e.sig.length)return!1;for(let s=0;s<e.sig.length;s++)if(t[s]!==e.sig[s])return!1;if(e.subSig){const s=e.subSigAt??e.sig.length;if(t.length<s+e.subSig.length)return!1;for(let n=0;n<e.subSig.length;n++)if(t[s+n]!==e.subSig[n])return!1}return!0}
package/dist/index.d.ts CHANGED
@@ -21,6 +21,8 @@ export { ModelUsageEntrySchema, DailyActivitySchema, DailyModelTokensSchema, Lon
21
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
+ export { TEXT_EXTS, CODE_EXTS, DOC_EXTS, IMG_EXTS, FILE_CATEGORY_MAX_SIZE, BLOCKED_EXTS, ALLOWED_EXTENSIONS, FILE_SIGNATURES, getFileExt, resolveFileCategory, verifyMagicBytes, } from './fileWhitelist.js';
25
+ export type { FileCategory } from './fileWhitelist.js';
24
26
  export { PairingState, PairingRequestSchema, PairingResponseSchema, PairingExchangeSchema, PairingDeliverSchema, PairingStatusSchema, parseVersionByte, encodeVersionByte, KNOWN_DERIVATION_VERSIONS, CURRENT_DERIVATION_VERSION, } from './pairing.js';
25
27
  export type { PairingRequest, PairingResponse, PairingExchange, PairingDeliver, PairingStatus, } from './pairing.js';
26
28
  export { PlatformSchema, SessionStatusSchema, MachineSummarySchema, MachineRegisterResultSchema, } from './machine.js';
@@ -44,6 +46,7 @@ export { createId } from './utils.js';
44
46
  export { errorMessage } from './errorMessage.js';
45
47
  export { BG_TASK_PREFIX, encodeBgTask, parseBgTask, isBgTaskLifecycleLine } from './bgTask.js';
46
48
  export type { BgTaskAction, ParsedBgTask, EncodeBgTaskInput } from './bgTask.js';
49
+ export { BASH_TOOL_NAMES, isBashToolName, extractCommandSubject, MIN_SUBJECT_LENGTH, } from './permissionSubject.js';
47
50
  export { SOCKET_EVENTS, type SocketEventName } from './socketEvents.js';
48
51
  export { TelemetryEventTypeSchema, TelemetryEventSchema, TelemetryReportPayloadSchema, sanitizeContext, } from './telemetry.js';
49
52
  export type { TelemetryEventType, TelemetryEvent, TelemetryReportPayload } from './telemetry.js';
package/dist/index.js CHANGED
@@ -1 +1 @@
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,parseVersionByte,encodeVersionByte,KNOWN_DERIVATION_VERSIONS,CURRENT_DERIVATION_VERSION}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{BG_TASK_PREFIX,encodeBgTask,parseBgTask,isBgTaskLifecycleLine}from"./bgTask.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,EnterpriseLicenseSchema,PrivateLicenseSchema}from"./license.js";export{FeedbackTypeSchema,FeedbackStatusSchema,DeviceInfoSchema,MachineSnapshotSchema,CreateFeedbackSchema,UpdateFeedbackSchema,RunModeSchema,RunModesSchema,BugFieldsSchema,SettingsSnapshotSchema}from"./feedback.js";
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{TEXT_EXTS,CODE_EXTS,DOC_EXTS,IMG_EXTS,FILE_CATEGORY_MAX_SIZE,BLOCKED_EXTS,ALLOWED_EXTENSIONS,FILE_SIGNATURES,getFileExt,resolveFileCategory,verifyMagicBytes}from"./fileWhitelist.js";export{PairingState,PairingRequestSchema,PairingResponseSchema,PairingExchangeSchema,PairingDeliverSchema,PairingStatusSchema,parseVersionByte,encodeVersionByte,KNOWN_DERIVATION_VERSIONS,CURRENT_DERIVATION_VERSION}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{BG_TASK_PREFIX,encodeBgTask,parseBgTask,isBgTaskLifecycleLine}from"./bgTask.js";export{BASH_TOOL_NAMES,isBashToolName,extractCommandSubject,MIN_SUBJECT_LENGTH}from"./permissionSubject.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,EnterpriseLicenseSchema,PrivateLicenseSchema}from"./license.js";export{FeedbackTypeSchema,FeedbackStatusSchema,DeviceInfoSchema,MachineSnapshotSchema,CreateFeedbackSchema,UpdateFeedbackSchema,RunModeSchema,RunModesSchema,BugFieldsSchema,SettingsSnapshotSchema}from"./feedback.js";
@@ -107,16 +107,20 @@ export declare const SessionPermissionResolvedEventSchema: z.ZodObject<{
107
107
  action: z.ZodEnum<["approve", "approve-all-edits", "approve-tool", "deny"]>;
108
108
  /** Optional feedback from user explaining why permission was denied. */
109
109
  reason: z.ZodOptional<z.ZodString>;
110
+ /** Optional tool whitelist entries (e.g. ['Bash(git:)']). Used for display. */
111
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
110
112
  }, "strip", z.ZodTypeAny, {
111
113
  t: "permission-resolved";
112
114
  requestId: string;
113
115
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
114
116
  reason?: string | undefined;
117
+ allowTools?: string[] | undefined;
115
118
  }, {
116
119
  t: "permission-resolved";
117
120
  requestId: string;
118
121
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
119
122
  reason?: string | undefined;
123
+ allowTools?: string[] | undefined;
120
124
  }>;
121
125
  export type SessionQuestionEvent = z.infer<typeof SessionQuestionEventSchema>;
122
126
  export type SessionPermissionRequestEvent = z.infer<typeof SessionPermissionRequestEventSchema>;
@@ -182,20 +186,20 @@ export declare const ApprovePermissionParamsSchema: z.ZodObject<{
182
186
  toolCallId: z.ZodString;
183
187
  /** Optional mode change (e.g. 'acceptEdits' for "allow all edits this session"). */
184
188
  mode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "autoEdit", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo", "suggest", "auto-edit", "full-auto"]>>;
185
- /** Optional tool whitelist (e.g. ['Bash(npm test)'] for "don't ask again for this tool"). */
189
+ /** Optional tool whitelist (e.g. ['Bash(git:)'] for "don't ask again"). */
186
190
  allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
187
191
  }, "strip", z.ZodTypeAny, {
188
192
  requestId: string;
189
193
  toolCallId: string;
190
194
  sessionId: string;
191
- mode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "autoEdit" | "read-only" | "safe-yolo" | "yolo" | "suggest" | "auto-edit" | "full-auto" | undefined;
192
195
  allowTools?: string[] | undefined;
196
+ mode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "autoEdit" | "read-only" | "safe-yolo" | "yolo" | "suggest" | "auto-edit" | "full-auto" | undefined;
193
197
  }, {
194
198
  requestId: string;
195
199
  toolCallId: string;
196
200
  sessionId: string;
197
- mode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "autoEdit" | "read-only" | "safe-yolo" | "yolo" | "suggest" | "auto-edit" | "full-auto" | undefined;
198
201
  allowTools?: string[] | undefined;
202
+ mode?: "default" | "acceptEdits" | "plan" | "bypassPermissions" | "autoEdit" | "read-only" | "safe-yolo" | "yolo" | "suggest" | "auto-edit" | "full-auto" | undefined;
199
203
  }>;
200
204
  /** Params for denying a tool permission request. */
201
205
  export declare const DenyPermissionParamsSchema: z.ZodObject<{
@@ -1 +1 @@
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()});
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(),allowTools:e.array(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()});
@@ -321,16 +321,19 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
321
321
  requestId: z.ZodString;
322
322
  action: z.ZodEnum<["approve", "approve-all-edits", "approve-tool", "deny"]>;
323
323
  reason: z.ZodOptional<z.ZodString>;
324
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
324
325
  }, "strip", z.ZodTypeAny, {
325
326
  t: "permission-resolved";
326
327
  requestId: string;
327
328
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
328
329
  reason?: string | undefined;
330
+ allowTools?: string[] | undefined;
329
331
  }, {
330
332
  t: "permission-resolved";
331
333
  requestId: string;
332
334
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
333
335
  reason?: string | undefined;
336
+ allowTools?: string[] | undefined;
334
337
  }>, z.ZodObject<{
335
338
  t: z.ZodLiteral<"image">;
336
339
  data: z.ZodString;
@@ -375,6 +378,7 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
375
378
  requestId: string;
376
379
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
377
380
  reason?: string | undefined;
381
+ allowTools?: string[] | undefined;
378
382
  } | {
379
383
  t: "text";
380
384
  text: string;
@@ -467,6 +471,7 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
467
471
  requestId: string;
468
472
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
469
473
  reason?: string | undefined;
474
+ allowTools?: string[] | undefined;
470
475
  } | {
471
476
  t: "text";
472
477
  text: string;
@@ -559,6 +564,7 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
559
564
  requestId: string;
560
565
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
561
566
  reason?: string | undefined;
567
+ allowTools?: string[] | undefined;
562
568
  } | {
563
569
  t: "text";
564
570
  text: string;
@@ -651,6 +657,7 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
651
657
  requestId: string;
652
658
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
653
659
  reason?: string | undefined;
660
+ allowTools?: string[] | undefined;
654
661
  } | {
655
662
  t: "text";
656
663
  text: string;
@@ -786,6 +793,7 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
786
793
  requestId: string;
787
794
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
788
795
  reason?: string | undefined;
796
+ allowTools?: string[] | undefined;
789
797
  } | {
790
798
  t: "text";
791
799
  text: string;
@@ -895,6 +903,7 @@ export declare const SessionProtocolMessageSchema: z.ZodObject<{
895
903
  requestId: string;
896
904
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
897
905
  reason?: string | undefined;
906
+ allowTools?: string[] | undefined;
898
907
  } | {
899
908
  t: "text";
900
909
  text: string;
@@ -1426,16 +1435,19 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1426
1435
  requestId: z.ZodString;
1427
1436
  action: z.ZodEnum<["approve", "approve-all-edits", "approve-tool", "deny"]>;
1428
1437
  reason: z.ZodOptional<z.ZodString>;
1438
+ allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1429
1439
  }, "strip", z.ZodTypeAny, {
1430
1440
  t: "permission-resolved";
1431
1441
  requestId: string;
1432
1442
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
1433
1443
  reason?: string | undefined;
1444
+ allowTools?: string[] | undefined;
1434
1445
  }, {
1435
1446
  t: "permission-resolved";
1436
1447
  requestId: string;
1437
1448
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
1438
1449
  reason?: string | undefined;
1450
+ allowTools?: string[] | undefined;
1439
1451
  }>, z.ZodObject<{
1440
1452
  t: z.ZodLiteral<"image">;
1441
1453
  data: z.ZodString;
@@ -1480,6 +1492,7 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1480
1492
  requestId: string;
1481
1493
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
1482
1494
  reason?: string | undefined;
1495
+ allowTools?: string[] | undefined;
1483
1496
  } | {
1484
1497
  t: "text";
1485
1498
  text: string;
@@ -1572,6 +1585,7 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1572
1585
  requestId: string;
1573
1586
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
1574
1587
  reason?: string | undefined;
1588
+ allowTools?: string[] | undefined;
1575
1589
  } | {
1576
1590
  t: "text";
1577
1591
  text: string;
@@ -1664,6 +1678,7 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1664
1678
  requestId: string;
1665
1679
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
1666
1680
  reason?: string | undefined;
1681
+ allowTools?: string[] | undefined;
1667
1682
  } | {
1668
1683
  t: "text";
1669
1684
  text: string;
@@ -1756,6 +1771,7 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1756
1771
  requestId: string;
1757
1772
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
1758
1773
  reason?: string | undefined;
1774
+ allowTools?: string[] | undefined;
1759
1775
  } | {
1760
1776
  t: "text";
1761
1777
  text: string;
@@ -1891,6 +1907,7 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
1891
1907
  requestId: string;
1892
1908
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
1893
1909
  reason?: string | undefined;
1910
+ allowTools?: string[] | undefined;
1894
1911
  } | {
1895
1912
  t: "text";
1896
1913
  text: string;
@@ -2000,6 +2017,7 @@ export declare const MessageContentSchema: z.ZodDiscriminatedUnion<"role", [z.Zo
2000
2017
  requestId: string;
2001
2018
  action: "approve" | "approve-all-edits" | "approve-tool" | "deny";
2002
2019
  reason?: string | undefined;
2020
+ allowTools?: string[] | undefined;
2003
2021
  } | {
2004
2022
  t: "text";
2005
2023
  text: string;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Raw agent tool names whose input carries a `command` field. These are the
3
+ * ORIGINAL agent-emitted names (NOT normalized): Claude `Bash`, OpenCode/Hermes/
4
+ * OpenClaw `execute`, Codex `shell`. The permission-request event and the danger
5
+ * detector both see raw names, so this set is matched against raw names.
6
+ */
7
+ export declare const BASH_TOOL_NAMES: ReadonlySet<string>;
8
+ /** True when `toolName` (a raw agent name) is a Bash-like command tool. */
9
+ export declare function isBashToolName(toolName: string): boolean;
10
+ /**
11
+ * Extract the prefix subject from a Bash-like command string:
12
+ * trim → first token (quote-aware so `"C:\Program Files\..."` isn't split on
13
+ * spaces) → basename (`.../pwsh.exe` → `pwsh.exe`).
14
+ *
15
+ * Returns '' ONLY for an empty/blank command. When the first token ends in a
16
+ * path separator its basename is empty; we fall back to the un-split token
17
+ * rather than '' — an empty subject makes every command match
18
+ * (`x.startsWith('')` is always true), the Bug 2 security hole.
19
+ */
20
+ export declare function extractCommandSubject(command: string): string;
21
+ /**
22
+ * Minimum length for a command subject to be used in a prefix rule.
23
+ * Single-char subjects (e.g. `#` from a comment line, `.` from a dotfile)
24
+ * are too broad — they effectively wildcard-match every command that starts
25
+ * with that character.
26
+ *
27
+ * Used by the front-end to reject overly broad rules before they are stored.
28
+ */
29
+ export declare const MIN_SUBJECT_LENGTH = 2;
30
+ //# sourceMappingURL=permissionSubject.d.ts.map
@@ -0,0 +1 @@
1
+ "use strict";export const BASH_TOOL_NAMES=new Set(["Bash","bash","execute","shell"]);export function isBashToolName(n){return BASH_TOOL_NAMES.has(n)}export function extractCommandSubject(n){const e=n.trim();if(!e)return"";let t;if(e[0]==='"'||e[0]==="'"){const c=e[0],o=e.indexOf(c,1);t=o>0?e.slice(1,o):e.slice(1)}else t=e.split(/\s+/)[0]??e;const s=t.split(/[/\\]/).pop();return(s||t).replace(/^["']|["']$/g,"")}export const MIN_SUBJECT_LENGTH=2;
package/dist/rpc.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- export declare const RpcMethod: z.ZodEnum<["spawn-session", "stop-session", "list-sessions", "abort", "switch-mode", "approve-permission", "deny-permission", "answer-question", "shutdown-daemon", "get-messages", "get-stats", "get-team-stats", "start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings", "get-labs-settings", "set-labs-settings", "set-auto-upgrade-daemon", "check-path", "backfill-history-session", "trigger-upgrade", "checkpoint-list", "checkpoint-diff", "checkpoint-rollback", "refresh-enterprise-models", "cancel-task"]>;
2
+ export declare const RpcMethod: z.ZodEnum<["spawn-session", "stop-session", "list-sessions", "abort", "switch-mode", "approve-permission", "deny-permission", "answer-question", "shutdown-daemon", "get-messages", "get-stats", "get-team-stats", "start-invite", "get-machine-info", "get-agent-settings", "set-agent-settings", "get-labs-settings", "set-labs-settings", "set-auto-upgrade-daemon", "check-path", "backfill-history-session", "trigger-upgrade", "checkpoint-list", "checkpoint-diff", "checkpoint-rollback", "refresh-enterprise-models", "cancel-task", "file-relay-receive", "set-debug", "get-debug", "record-usage", "update-agent-models", "update-agent-modes"]>;
3
3
  export type RpcMethodType = z.infer<typeof RpcMethod>;
4
4
  /**
5
5
  * Session-scoped RPC methods — registered by `agentdock start` (CLI process).
package/dist/rpc.js CHANGED
@@ -1 +1 @@
1
- "use strict";import{z as o}from"zod";import{SessionMessageSchema as e}from"./messages.js";import{CLI_AGENT_TYPES as n,SPAWNABLE_AGENTS as s}from"./messageMeta.js";import{PermissionModeSchema as i}from"./interactionEvents.js";export const RpcMethod=o.enum(["spawn-session","stop-session","list-sessions","abort","switch-mode","approve-permission","deny-permission","answer-question","shutdown-daemon","get-messages","get-stats","get-team-stats","start-invite","get-machine-info","get-agent-settings","set-agent-settings","get-labs-settings","set-labs-settings","set-auto-upgrade-daemon","check-path","backfill-history-session","trigger-upgrade","checkpoint-list","checkpoint-diff","checkpoint-rollback","refresh-enterprise-models","cancel-task"]),SESSION_RPC_METHODS=["answer-question","approve-permission","deny-permission","abort","stop-session","cancel-task"],MACHINE_RPC_METHODS=["start-invite","get-machine-info","get-agent-settings","set-agent-settings","get-labs-settings","set-labs-settings","set-auto-upgrade-daemon","check-path","backfill-history-session","trigger-upgrade","checkpoint-list","checkpoint-diff","checkpoint-rollback","refresh-enterprise-models"],DAEMON_REQUIRED_RPC_METHODS=[...SESSION_RPC_METHODS,...MACHINE_RPC_METHODS],RpcCallSchema=o.object({method:o.string().min(1),params:o.unknown(),timeout:o.number().int().positive().default(3e4)}),RpcResultSchema=o.discriminatedUnion("ok",[o.object({ok:o.literal(!0),result:o.unknown()}),o.object({ok:o.literal(!1),error:o.string()})]),SpawnSessionParamsSchema=o.object({agentType:o.enum(n),cwd:o.string().min(1),prompt:o.string().optional(),permissionMode:i.default("default"),env:o.record(o.string()).optional(),model:o.string().optional(),baseUrl:o.string().url().optional(),appendSystemPrompt:o.string().optional(),allowedTools:o.array(o.string()).optional(),disallowedTools:o.array(o.string()).optional(),mcpConfig:o.string().optional(),resumeSessionId:o.string().optional(),serverSessionId:o.string().optional(),maxTurns:o.number().int().positive().optional(),machineId:o.string().min(1).optional(),spawnToken:o.string().optional(),systemPrompt:o.string().optional(),systemPromptFile:o.string().optional(),appendSystemPromptFile:o.string().optional(),fallbackModel:o.string().optional(),maxBudgetUsd:o.number().positive().optional(),tools:o.array(o.string()).optional(),effort:o.enum(["low","medium","high","xhigh","max"]).optional(),addDirs:o.array(o.string()).optional(),agent:o.string().optional(),agents:o.string().optional(),jsonSchema:o.string().optional(),strictMcpConfig:o.boolean().optional(),chrome:o.boolean().optional(),worktree:o.union([o.boolean(),o.string()]).optional(),forkSession:o.boolean().optional(),sessionId:o.string().uuid().optional(),settings:o.string().optional(),betas:o.array(o.string()).optional(),brief:o.boolean().optional(),noSessionPersistence:o.boolean().optional(),includePartialMessages:o.boolean().optional(),replayUserMessages:o.boolean().optional(),settingSources:o.string().optional(),disableSlashCommands:o.boolean().optional(),files:o.array(o.string()).optional(),pluginDirs:o.array(o.string()).optional(),dangerouslySkipPermissions:o.boolean().optional(),allowDangerouslySkipPermissions:o.boolean().optional(),startupScripts:o.array(o.string()).optional(),source:o.enum(["managed","history","scheduled"]).default("managed"),background:o.boolean().default(!1),useWindowsTerminal:o.boolean().optional()}),GetMessagesParamsSchema=o.object({sessionId:o.string().min(1),fromSeq:o.number().int().nonnegative().optional(),limit:o.number().int().positive().default(100)}),GetMessagesResponseSchema=o.object({messages:o.array(e),total:o.number(),hasMore:o.boolean()}),CustomModelSchema=o.object({id:o.string().min(1),label:o.string().min(1)}),SkillDefinitionSchema=o.object({name:o.string().min(1),description:o.string(),userInvocable:o.boolean().default(!0),source:o.enum(["project","user"]).default("project"),projectPath:o.string().optional()}),AGENT_ENV_NONE="none",AgentEnvConfigSchema=o.object({httpProxy:o.string().optional(),httpsProxy:o.string().optional(),customEnv:o.record(o.string()).optional(),customModels:o.array(CustomModelSchema).optional()}),AgentSettingsSchema=o.object({defaults:AgentEnvConfigSchema.optional(),startupScripts:o.array(o.string()).optional(),telemetryEnabled:o.boolean().optional()}).merge(o.object(Object.fromEntries(s.map(t=>[t,AgentEnvConfigSchema.optional()])))),MachineInfoResponseSchema=o.object({homedir:o.string(),defaultCwd:o.string().optional(),recentCwds:o.array(o.string()),projectPaths:o.array(o.string()).optional().default([]),availableAgents:o.array(o.string()),agentModels:o.record(o.string(),o.array(o.object({id:o.string(),displayName:o.string(),isDefault:o.boolean(),hidden:o.boolean(),source:o.enum(["builtin","acp","env","custom"]).optional().default("acp")}))).optional(),agentModes:o.record(o.string(),o.array(o.object({id:o.string(),label:o.string()}))).optional(),agentCliPaths:o.record(o.string(),o.string()).optional(),agentSettings:AgentSettingsSchema.optional(),agentSkills:o.record(o.string(),o.array(SkillDefinitionSchema)).optional()}),CheckPathParamsSchema=o.object({cwd:o.string().min(1),machineId:o.string().min(1).optional()}),LabsSettingsSchema=o.object({historySessionSync:o.boolean().default(!1)});
1
+ "use strict";import{z as t}from"zod";import{SessionMessageSchema as e}from"./messages.js";import{CLI_AGENT_TYPES as n,SPAWNABLE_AGENTS as s}from"./messageMeta.js";import{PermissionModeSchema as i}from"./interactionEvents.js";export const RpcMethod=t.enum(["spawn-session","stop-session","list-sessions","abort","switch-mode","approve-permission","deny-permission","answer-question","shutdown-daemon","get-messages","get-stats","get-team-stats","start-invite","get-machine-info","get-agent-settings","set-agent-settings","get-labs-settings","set-labs-settings","set-auto-upgrade-daemon","check-path","backfill-history-session","trigger-upgrade","checkpoint-list","checkpoint-diff","checkpoint-rollback","refresh-enterprise-models","cancel-task","file-relay-receive","set-debug","get-debug","record-usage","update-agent-models","update-agent-modes"]),SESSION_RPC_METHODS=["answer-question","approve-permission","deny-permission","abort","stop-session","cancel-task"],MACHINE_RPC_METHODS=["start-invite","get-machine-info","get-agent-settings","set-agent-settings","get-labs-settings","set-labs-settings","set-auto-upgrade-daemon","check-path","backfill-history-session","trigger-upgrade","checkpoint-list","checkpoint-diff","checkpoint-rollback","refresh-enterprise-models"],DAEMON_REQUIRED_RPC_METHODS=[...SESSION_RPC_METHODS,...MACHINE_RPC_METHODS],RpcCallSchema=t.object({method:t.string().min(1),params:t.unknown(),timeout:t.number().int().positive().default(3e4)}),RpcResultSchema=t.discriminatedUnion("ok",[t.object({ok:t.literal(!0),result:t.unknown()}),t.object({ok:t.literal(!1),error:t.string()})]),SpawnSessionParamsSchema=t.object({agentType:t.enum(n),cwd:t.string().min(1),prompt:t.string().optional(),permissionMode:i.default("default"),env:t.record(t.string()).optional(),model:t.string().optional(),baseUrl:t.string().url().optional(),appendSystemPrompt:t.string().optional(),allowedTools:t.array(t.string()).optional(),disallowedTools:t.array(t.string()).optional(),mcpConfig:t.string().optional(),resumeSessionId:t.string().optional(),serverSessionId:t.string().optional(),maxTurns:t.number().int().positive().optional(),machineId:t.string().min(1).optional(),spawnToken:t.string().optional(),systemPrompt:t.string().optional(),systemPromptFile:t.string().optional(),appendSystemPromptFile:t.string().optional(),fallbackModel:t.string().optional(),maxBudgetUsd:t.number().positive().optional(),tools:t.array(t.string()).optional(),effort:t.enum(["low","medium","high","xhigh","max"]).optional(),addDirs:t.array(t.string()).optional(),agent:t.string().optional(),agents:t.string().optional(),jsonSchema:t.string().optional(),strictMcpConfig:t.boolean().optional(),chrome:t.boolean().optional(),worktree:t.union([t.boolean(),t.string()]).optional(),forkSession:t.boolean().optional(),sessionId:t.string().uuid().optional(),settings:t.string().optional(),betas:t.array(t.string()).optional(),brief:t.boolean().optional(),noSessionPersistence:t.boolean().optional(),includePartialMessages:t.boolean().optional(),replayUserMessages:t.boolean().optional(),settingSources:t.string().optional(),disableSlashCommands:t.boolean().optional(),files:t.array(t.string()).optional(),pluginDirs:t.array(t.string()).optional(),dangerouslySkipPermissions:t.boolean().optional(),allowDangerouslySkipPermissions:t.boolean().optional(),startupScripts:t.array(t.string()).optional(),source:t.enum(["managed","history","scheduled"]).default("managed"),background:t.boolean().default(!1),useWindowsTerminal:t.boolean().optional()}),GetMessagesParamsSchema=t.object({sessionId:t.string().min(1),fromSeq:t.number().int().nonnegative().optional(),limit:t.number().int().positive().default(100)}),GetMessagesResponseSchema=t.object({messages:t.array(e),total:t.number(),hasMore:t.boolean()}),CustomModelSchema=t.object({id:t.string().min(1),label:t.string().min(1)}),SkillDefinitionSchema=t.object({name:t.string().min(1),description:t.string(),userInvocable:t.boolean().default(!0),source:t.enum(["project","user"]).default("project"),projectPath:t.string().optional()}),AGENT_ENV_NONE="none",AgentEnvConfigSchema=t.object({httpProxy:t.string().optional(),httpsProxy:t.string().optional(),customEnv:t.record(t.string()).optional(),customModels:t.array(CustomModelSchema).optional()}),AgentSettingsSchema=t.object({defaults:AgentEnvConfigSchema.optional(),startupScripts:t.array(t.string()).optional(),telemetryEnabled:t.boolean().optional()}).merge(t.object(Object.fromEntries(s.map(o=>[o,AgentEnvConfigSchema.optional()])))),MachineInfoResponseSchema=t.object({homedir:t.string(),defaultCwd:t.string().optional(),recentCwds:t.array(t.string()),projectPaths:t.array(t.string()).optional().default([]),availableAgents:t.array(t.string()),agentModels:t.record(t.string(),t.array(t.object({id:t.string(),displayName:t.string(),isDefault:t.boolean(),hidden:t.boolean(),source:t.enum(["builtin","acp","env","custom"]).optional().default("acp")}))).optional(),agentModes:t.record(t.string(),t.array(t.object({id:t.string(),label:t.string()}))).optional(),agentCliPaths:t.record(t.string(),t.string()).optional(),agentSettings:AgentSettingsSchema.optional(),agentSkills:t.record(t.string(),t.array(SkillDefinitionSchema)).optional()}),CheckPathParamsSchema=t.object({cwd:t.string().min(1),machineId:t.string().min(1).optional()}),LabsSettingsSchema=t.object({historySessionSync:t.boolean().default(!1)});
@@ -13,6 +13,7 @@ export declare const SOCKET_EVENTS: Readonly<{
13
13
  readonly ENTERPRISE_ALERT: "enterprise-alert";
14
14
  readonly ACTIVITY_PREFERENCES_CHANGED: "activity-preferences-changed";
15
15
  readonly IMPROVEMENT_PREFERENCES_CHANGED: "improvement-preferences-changed";
16
+ readonly HISTORY_SESSION_BLOCKED: "history-session-blocked";
16
17
  readonly SESSION_CREATE: "session-create";
17
18
  readonly LIST_SESSIONS: "list-sessions";
18
19
  readonly UPDATE_METADATA: "update-metadata";
@@ -34,9 +35,13 @@ export declare const SOCKET_EVENTS: Readonly<{
34
35
  readonly MACHINE_REGISTER: "machine-register";
35
36
  readonly MACHINE_HEARTBEAT: "machine-heartbeat";
36
37
  readonly AGENT_CACHE_UPDATED: "agent-cache-updated";
38
+ readonly FILE_RELAY_CHUNK: "file-relay-chunk";
39
+ readonly FILE_RELAY_ACK: "file-relay-ack";
40
+ readonly FILE_RELAY_COMPLETE: "file-relay-complete";
37
41
  readonly GET_KNOWN_CLAUDE_SESSIONS: "get-known-claude-sessions";
38
42
  readonly REGISTER_HISTORY_SESSIONS: "register-history-sessions";
39
43
  readonly UPDATE_SYNC_STATUS: "update-sync-status";
44
+ readonly GET_HISTORY_BLOCKLIST: "get-history-blocklist";
40
45
  }>;
41
46
  export type SocketEventName = (typeof SOCKET_EVENTS)[keyof typeof SOCKET_EVENTS];
42
47
  //# sourceMappingURL=socketEvents.d.ts.map
@@ -1 +1 @@
1
- "use strict";export const SOCKET_EVENTS=Object.freeze({SESSION_STATUS:"session-status",PERMISSION_RESOLVED:"permission-resolved",CORE_UPDATE:"core-update",USAGE_REPORT:"usage-report",RPC_REQUEST:"rpc-request",HISTORY_SYNC_RESULT:"history-sync-result",BACKFILL_PROGRESS:"backfill-progress",MACHINE_STATUS_UPDATE:"machine-status-update",TELEMETRY_REPORT:"telemetry-report",UPDATE:"update",EPHEMERAL:"ephemeral",ENTERPRISE_ALERT:"enterprise-alert",ACTIVITY_PREFERENCES_CHANGED:"activity-preferences-changed",IMPROVEMENT_PREFERENCES_CHANGED:"improvement-preferences-changed",SESSION_CREATE:"session-create",LIST_SESSIONS:"list-sessions",UPDATE_METADATA:"update-metadata",UPDATE_STATE:"update-state",SESSION_ALIVE:"session-alive",LIVENESS_HEARTBEAT:"liveness-heartbeat",PROVISION_SESSION_DEK:"provision-session-dek",RENAME_SESSION:"rename-session",SESSION_END:"session-end",SESSION_DELETE:"delete-session",SESSION_SUMMARY:"session-summary",GET_MESSAGES:"get-messages",MESSAGE:"message",BATCH_MESSAGE:"batch-message",RPC_REGISTER:"rpc-register",RPC_UNREGISTER:"rpc-unregister",RPC_CALL:"rpc-call",CLIENT_VISIBILITY:"client-visibility",MACHINE_REGISTER:"machine-register",MACHINE_HEARTBEAT:"machine-heartbeat",AGENT_CACHE_UPDATED:"agent-cache-updated",GET_KNOWN_CLAUDE_SESSIONS:"get-known-claude-sessions",REGISTER_HISTORY_SESSIONS:"register-history-sessions",UPDATE_SYNC_STATUS:"update-sync-status"});
1
+ "use strict";export const SOCKET_EVENTS=Object.freeze({SESSION_STATUS:"session-status",PERMISSION_RESOLVED:"permission-resolved",CORE_UPDATE:"core-update",USAGE_REPORT:"usage-report",RPC_REQUEST:"rpc-request",HISTORY_SYNC_RESULT:"history-sync-result",BACKFILL_PROGRESS:"backfill-progress",MACHINE_STATUS_UPDATE:"machine-status-update",TELEMETRY_REPORT:"telemetry-report",UPDATE:"update",EPHEMERAL:"ephemeral",ENTERPRISE_ALERT:"enterprise-alert",ACTIVITY_PREFERENCES_CHANGED:"activity-preferences-changed",IMPROVEMENT_PREFERENCES_CHANGED:"improvement-preferences-changed",HISTORY_SESSION_BLOCKED:"history-session-blocked",SESSION_CREATE:"session-create",LIST_SESSIONS:"list-sessions",UPDATE_METADATA:"update-metadata",UPDATE_STATE:"update-state",SESSION_ALIVE:"session-alive",LIVENESS_HEARTBEAT:"liveness-heartbeat",PROVISION_SESSION_DEK:"provision-session-dek",RENAME_SESSION:"rename-session",SESSION_END:"session-end",SESSION_DELETE:"delete-session",SESSION_SUMMARY:"session-summary",GET_MESSAGES:"get-messages",MESSAGE:"message",BATCH_MESSAGE:"batch-message",RPC_REGISTER:"rpc-register",RPC_UNREGISTER:"rpc-unregister",RPC_CALL:"rpc-call",CLIENT_VISIBILITY:"client-visibility",MACHINE_REGISTER:"machine-register",MACHINE_HEARTBEAT:"machine-heartbeat",AGENT_CACHE_UPDATED:"agent-cache-updated",FILE_RELAY_CHUNK:"file-relay-chunk",FILE_RELAY_ACK:"file-relay-ack",FILE_RELAY_COMPLETE:"file-relay-complete",GET_KNOWN_CLAUDE_SESSIONS:"get-known-claude-sessions",REGISTER_HISTORY_SESSIONS:"register-history-sessions",UPDATE_SYNC_STATUS:"update-sync-status",GET_HISTORY_BLOCKLIST:"get-history-blocklist"});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentdock/wire",
3
- "version": "0.0.62",
3
+ "version": "0.0.64",
4
4
  "description": "Protocol definitions for AgentDock — Zod schemas, message formats, RPC types",
5
5
  "license": "UNLICENSED",
6
6
  "author": "CCPark",