@agentdock/wire 0.0.90 → 0.0.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activityPreferences.js +1 -2
- package/dist/agentCapabilities.d.ts +2 -0
- package/dist/agentCapabilities.js +1 -199
- package/dist/agentCommonEnv.js +1 -20
- package/dist/agentInstallGuide.js +1 -81
- package/dist/bgTask.js +1 -128
- package/dist/checkpointSchemas.d.ts +142 -98
- package/dist/checkpointSchemas.js +1 -46
- package/dist/controlLevel.js +1 -11
- package/dist/edition.js +1 -13
- package/dist/envelope.d.ts +5668 -563
- package/dist/envelope.js +1 -77
- package/dist/errorMessage.js +1 -6
- package/dist/events.d.ts +2053 -324
- package/dist/events.js +1 -107
- package/dist/features.js +1 -123
- package/dist/feedback.d.ts +2 -2
- package/dist/feedback.js +1 -61
- package/dist/fileWhitelist.js +1 -189
- package/dist/inboundEvents.d.ts +531 -0
- package/dist/inboundEvents.js +1 -0
- package/dist/index.d.ts +11 -5
- package/dist/index.js +1 -73
- package/dist/interactionEvents.d.ts +153 -106
- package/dist/interactionEvents.js +1 -111
- package/dist/legacyProtocol.d.ts +512 -272
- package/dist/legacyProtocol.js +1 -30
- package/dist/license.js +1 -28
- package/dist/machine.d.ts +108 -62
- package/dist/machine.js +1 -66
- package/dist/messageMeta.d.ts +34 -28
- package/dist/messageMeta.js +1 -60
- package/dist/messages.d.ts +34900 -1862
- package/dist/messages.js +1 -35
- package/dist/notification.d.ts +48 -0
- package/dist/notification.js +1 -0
- package/dist/ops.d.ts +165 -122
- package/dist/ops.js +1 -74
- package/dist/pairing.d.ts +4 -4
- package/dist/pairing.js +1 -150
- package/dist/permissionSubject.js +1 -68
- package/dist/protocol.js +1 -7
- package/dist/rpc.d.ts +749 -189
- package/dist/rpc.js +1 -269
- package/dist/scheduledTasks.d.ts +619 -304
- package/dist/scheduledTasks.js +1 -188
- package/dist/semver.js +1 -60
- package/dist/sessionResult.d.ts +31 -17
- package/dist/sessionResult.js +1 -23
- package/dist/socketEvents.d.ts +7 -0
- package/dist/socketEvents.js +1 -55
- package/dist/sourceMetadata.d.ts +44 -0
- package/dist/sourceMetadata.js +1 -0
- package/dist/spawnError.d.ts +21 -17
- package/dist/spawnError.js +1 -31
- package/dist/stats.d.ts +73 -73
- package/dist/stats.js +1 -117
- package/dist/sync.d.ts +2165 -819
- package/dist/sync.js +1 -99
- package/dist/taskResult.js +1 -113
- package/dist/telemetry.d.ts +120 -64
- package/dist/telemetry.js +1 -115
- package/dist/utils.js +1 -2
- package/package.json +3 -2
- package/dist/activityPreferences.d.ts.map +0 -1
- package/dist/activityPreferences.js.map +0 -1
- package/dist/agentCapabilities.d.ts.map +0 -1
- package/dist/agentCapabilities.js.map +0 -1
- package/dist/agentCommonEnv.d.ts.map +0 -1
- package/dist/agentCommonEnv.js.map +0 -1
- package/dist/agentInstallGuide.d.ts.map +0 -1
- package/dist/agentInstallGuide.js.map +0 -1
- package/dist/bgTask.d.ts.map +0 -1
- package/dist/bgTask.js.map +0 -1
- package/dist/checkpointSchemas.d.ts.map +0 -1
- package/dist/checkpointSchemas.js.map +0 -1
- package/dist/controlLevel.d.ts.map +0 -1
- package/dist/controlLevel.js.map +0 -1
- package/dist/edition.d.ts.map +0 -1
- package/dist/edition.js.map +0 -1
- package/dist/envelope.d.ts.map +0 -1
- package/dist/envelope.js.map +0 -1
- package/dist/errorMessage.d.ts.map +0 -1
- package/dist/errorMessage.js.map +0 -1
- package/dist/events.d.ts.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/features.d.ts.map +0 -1
- package/dist/features.js.map +0 -1
- package/dist/feedback.d.ts.map +0 -1
- package/dist/feedback.js.map +0 -1
- package/dist/fileWhitelist.d.ts.map +0 -1
- package/dist/fileWhitelist.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/interactionEvents.d.ts.map +0 -1
- package/dist/interactionEvents.js.map +0 -1
- package/dist/legacyProtocol.d.ts.map +0 -1
- package/dist/legacyProtocol.js.map +0 -1
- package/dist/license.d.ts.map +0 -1
- package/dist/license.js.map +0 -1
- package/dist/machine.d.ts.map +0 -1
- package/dist/machine.js.map +0 -1
- package/dist/messageMeta.d.ts.map +0 -1
- package/dist/messageMeta.js.map +0 -1
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js.map +0 -1
- package/dist/ops.d.ts.map +0 -1
- package/dist/ops.js.map +0 -1
- package/dist/pairing.d.ts.map +0 -1
- package/dist/pairing.js.map +0 -1
- package/dist/permissionSubject.d.ts.map +0 -1
- package/dist/permissionSubject.js.map +0 -1
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js.map +0 -1
- package/dist/rpc.d.ts.map +0 -1
- package/dist/rpc.js.map +0 -1
- package/dist/scheduledTasks.d.ts.map +0 -1
- package/dist/scheduledTasks.js.map +0 -1
- package/dist/semver.d.ts.map +0 -1
- package/dist/semver.js.map +0 -1
- package/dist/sessionResult.d.ts.map +0 -1
- package/dist/sessionResult.js.map +0 -1
- package/dist/socketEvents.d.ts.map +0 -1
- package/dist/socketEvents.js.map +0 -1
- package/dist/spawnError.d.ts.map +0 -1
- package/dist/spawnError.js.map +0 -1
- package/dist/stats.d.ts.map +0 -1
- package/dist/stats.js.map +0 -1
- package/dist/sync.d.ts.map +0 -1
- package/dist/sync.js.map +0 -1
- package/dist/taskResult.d.ts.map +0 -1
- package/dist/taskResult.js.map +0 -1
- package/dist/telemetry.d.ts.map +0 -1
- package/dist/telemetry.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,73 +1 @@
|
|
|
1
|
-
|
|
2
|
-
// @agentdock/wire — Protocol definitions
|
|
3
|
-
// This is the "constitution" of the system.
|
|
4
|
-
// All components communicate through formats defined here.
|
|
5
|
-
// Session events
|
|
6
|
-
export { SessionTextEventSchema, SessionServiceEventSchema, SessionToolCallStartEventSchema, SessionToolCallEndEventSchema, SessionFileEventSchema, SessionTurnStartEventSchema, SessionTurnEndEventSchema, SessionTurnEndStatusSchema, TurnUsageSchema, SessionStartEventSchema, SessionStopEventSchema, SessionEventSchema, SessionPermissionResolvedEventSchema, PermissionActionSchema, SessionImageEventSchema, ImageAttachmentSchema, } from './events.js';
|
|
7
|
-
// Interaction events
|
|
8
|
-
export { QuestionOptionSchema, SessionQuestionEventSchema, SessionPermissionRequestEventSchema, SessionAnswerEventSchema, AnswerQuestionParamsSchema, ApprovePermissionParamsSchema, DenyPermissionParamsSchema, PermissionModeSchema, } from './interactionEvents.js';
|
|
9
|
-
// Session envelope
|
|
10
|
-
export { SessionRoleSchema, SessionEnvelopeSchema, createEnvelope } from './envelope.js';
|
|
11
|
-
// Message meta
|
|
12
|
-
export { AgentTypeSchema, MessageMetaSchema, AGENT_TYPES, SPAWNABLE_AGENTS, CLI_AGENT_TYPES, } from './messageMeta.js';
|
|
13
|
-
export { AGENT_SUPPORTS_IMAGES } from './messageMeta.js';
|
|
14
|
-
// Messages
|
|
15
|
-
export { SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, MessageContentSchema, } from './messages.js';
|
|
16
|
-
// Legacy protocol
|
|
17
|
-
export { UserMessageSchema, AgentMessageSchema, LegacyMessageContentSchema, } from './legacyProtocol.js';
|
|
18
|
-
// Sync update protocol
|
|
19
|
-
export { VersionedEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VersionedMachineEncryptedValueSchema, UpdateNewMessageBodySchema, UpdateSessionBodySchema, UpdateMachineBodySchema, UpdateSessionResetBodySchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, } from './sync.js';
|
|
20
|
-
// RPC
|
|
21
|
-
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';
|
|
22
|
-
// Agent capabilities
|
|
23
|
-
export { AGENT_CAPABILITIES, getAgentCapability, updateDynamicModes, getDynamicModes, normalizeModelId, } from './agentCapabilities.js';
|
|
24
|
-
// Stats (OBS-2)
|
|
25
|
-
export { ModelUsageEntrySchema, DailyActivitySchema, DailyModelTokensSchema, LongestSessionSchema, ClaudeStatsDataSchema, ProjectSummarySchema, StatsOverviewSchema, AgentTypeUsageSchema, ActivityUploadSchema, UsageReportSchema, TokenTrendPointSchema, ModelBreakdownEntrySchema, QuotaConfigSchema, } from './stats.js';
|
|
26
|
-
// Control level
|
|
27
|
-
export { ControlLevel } from './controlLevel.js';
|
|
28
|
-
// File upload whitelist (personal edition)
|
|
29
|
-
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';
|
|
30
|
-
// Pairing protocol
|
|
31
|
-
export { PairingState, PairingRequestSchema, PairingResponseSchema, PairingExchangeSchema, PairingDeliverSchema, PairingStatusSchema, parseVersionByte, encodeVersionByte, KNOWN_DERIVATION_VERSIONS, CURRENT_DERIVATION_VERSION, } from './pairing.js';
|
|
32
|
-
// Machine & session status (DASH-2)
|
|
33
|
-
export { PlatformSchema, SessionStatusSchema, MachineSummarySchema, MachineRegisterResultSchema, } from './machine.js';
|
|
34
|
-
// Feature availability (RFC-035)
|
|
35
|
-
export { FEATURE_REGISTRY, isFeatureAvailable, getUnavailableFeatures, isSubFeatureAvailable, getSubFeatureMinVersion, } from './features.js';
|
|
36
|
-
// Session result (PROTO-2)
|
|
37
|
-
export { SessionResultSchema } from './sessionResult.js';
|
|
38
|
-
// Spawn errors
|
|
39
|
-
export { SpawnErrorCodeSchema, SpawnErrorSchema, createSpawnError } from './spawnError.js';
|
|
40
|
-
// Agent install guide
|
|
41
|
-
export { AGENT_INSTALL_GUIDE } from './agentInstallGuide.js';
|
|
42
|
-
// Agent common env vars
|
|
43
|
-
export { AGENT_COMMON_ENV_VARS } from './agentCommonEnv.js';
|
|
44
|
-
// Scheduled tasks (RFC-044)
|
|
45
|
-
export { RetryPolicySchema, MissedRunPolicySchema, ScheduledSpawnParamsSchema, TaskExecutionStatusSchema, TaskExecutionTriggerSchema, TaskTriggerTypeSchema, TaskResultSchema, TaskStatsSchema, TaskExecutionBarSchema, TaskCardStatsSchema, CreateScheduledTaskSchema, UpdateScheduledTaskSchema, ScheduledTaskSummarySchema, TaskExecutionSchema, TriggerCallSchema, TriggerExecutionSchema, RegenerateTokenResponseSchema, CRON_RE, } from './scheduledTasks.js';
|
|
46
|
-
// Task delivery protocol (structured <task-result>)
|
|
47
|
-
export { TASK_RESULT_PREFIX, serializeTaskResult, parseTaskResultPayload, extractTaskResultFromText, } from './taskResult.js';
|
|
48
|
-
// Protocol version (RFC-021)
|
|
49
|
-
export { PROTOCOL_VERSION } from './protocol.js';
|
|
50
|
-
// Semver
|
|
51
|
-
export { parseSemver, compareVersions, satisfiesMin } from './semver.js';
|
|
52
|
-
// Utils
|
|
53
|
-
export { createId } from './utils.js';
|
|
54
|
-
export { errorMessage } from './errorMessage.js';
|
|
55
|
-
// bg-task line protocol (RFC-058 background-task service envelopes)
|
|
56
|
-
export { BG_TASK_PREFIX, encodeBgTask, parseBgTask, isBgTaskLifecycleLine } from './bgTask.js';
|
|
57
|
-
// Permission subject extraction (shared by web rule-gen + daemon matcher)
|
|
58
|
-
export { BASH_TOOL_NAMES, isBashToolName, extractCommandSubject, MIN_SUBJECT_LENGTH, } from './permissionSubject.js';
|
|
59
|
-
// Socket.IO event name constants
|
|
60
|
-
export { SOCKET_EVENTS } from './socketEvents.js';
|
|
61
|
-
// Telemetry (RFC-043)
|
|
62
|
-
export { TelemetryEventTypeSchema, TelemetryEventSchema, TelemetryReportPayloadSchema, sanitizeContext, } from './telemetry.js';
|
|
63
|
-
// Checkpoint RPC (RFC-044)
|
|
64
|
-
export * from './checkpointSchemas.js';
|
|
65
|
-
// Ops RPC (RFC-034)
|
|
66
|
-
export { OpsRpcMessageSchema, OpsMethodSchema, OpsRpcTypeSchema, FileEntrySchema, FileStatSchema, StorageUsageSchema, SyncUserSchema, SyncFullPayloadSchema, SyncUserCreatedPayloadSchema, SyncContainerStatusPayloadSchema, SyncUserPairedPayloadSchema, } from './ops.js';
|
|
67
|
-
// Edition (RFC-053)
|
|
68
|
-
export * from './edition.js';
|
|
69
|
-
// License
|
|
70
|
-
export { LicensePayloadSchema, LicenseFileSchema, EnterpriseLicenseSchema, PrivateLicenseSchema, } from './license.js';
|
|
71
|
-
// Feedback
|
|
72
|
-
export { FeedbackTypeSchema, FeedbackStatusSchema, DeviceInfoSchema, MachineSnapshotSchema, CreateFeedbackSchema, UpdateFeedbackSchema, RunModeSchema, RunModesSchema, BugFieldsSchema, SettingsSnapshotSchema, } from './feedback.js';
|
|
73
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
"use strict";export{SessionTextEventSchema,SessionServiceEventSchema,SessionToolCallStartEventSchema,SessionToolCallEndEventSchema,SessionFileEventSchema,SessionTurnStartEventSchema,SessionTurnEndEventSchema,SessionTurnEndStatusSchema,TurnUsageSchema,SessionStartEventSchema,SessionStopEventSchema,SessionEventSchema,SessionPermissionResolvedEventSchema,PermissionActionSchema,SessionImageEventSchema,ImageAttachmentSchema,SessionContextUsageEventSchema,SessionCompactBoundaryEventSchema,emptyContextUsageSnapshot}from"./events.js";export{QuestionOptionSchema,SessionQuestionEventSchema,SessionPermissionRequestEventSchema,SessionAnswerEventSchema,AnswerQuestionParamsSchema,ApprovePermissionParamsSchema,DenyPermissionParamsSchema,PermissionModeSchema}from"./interactionEvents.js";export{SessionRoleSchema,SessionEnvelopeSchema,createEnvelope}from"./envelope.js";export{NotificationEventTypeSchema,DispatchNotificationParamsSchema}from"./notification.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,AgentEnvConfigSetSchema,AgentSettingsSchema,SetAgentSettingsSchema,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{SessionCreatePayloadSchema,UpdateMetadataPayloadSchema,UpdateStatePayloadSchema,ContextUsageUpdatePayloadSchema,SessionAlivePayloadSchema,GetSessionRuntimeStatusPayloadSchema,SessionDeletePayloadSchema,SessionEndPayloadSchema,RenameSessionPayloadSchema,MessagePayloadSchema,BatchMessagePayloadSchema,GetMessagesPayloadSchema,SessionStatusPayloadSchema,MachineRegisterPayloadSchema,RegisterHistorySessionsPayloadSchema,HistorySessionEntrySchema,INBOUND_SESSION_STATUSES}from"./inboundEvents.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,TaskTriggerTypeSchema,TaskResultSchema,TaskStatsSchema,TaskExecutionBarSchema,TaskCardStatsSchema,CreateScheduledTaskSchema,UpdateScheduledTaskSchema,ScheduledTaskSummarySchema,TaskExecutionSchema,TriggerCallSchema,TriggerExecutionSchema,RegenerateTokenResponseSchema,CRON_RE}from"./scheduledTasks.js";export{TASK_RESULT_PREFIX,serializeTaskResult,parseTaskResultPayload,extractTaskResultFromText}from"./taskResult.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{SourceMetadataSchema}from"./sourceMetadata.js";export{OpsRpcMessageSchema,OpsMethodSchema,OpsRpcTypeSchema,DockerImageRefSchema,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";
|
|
@@ -9,13 +9,13 @@ import { z } from 'zod';
|
|
|
9
9
|
export declare const QuestionOptionSchema: z.ZodObject<{
|
|
10
10
|
label: z.ZodString;
|
|
11
11
|
description: z.ZodDefault<z.ZodString>;
|
|
12
|
-
}, "
|
|
13
|
-
label:
|
|
14
|
-
description:
|
|
15
|
-
}, {
|
|
16
|
-
label:
|
|
17
|
-
description
|
|
18
|
-
}
|
|
12
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
13
|
+
label: z.ZodString;
|
|
14
|
+
description: z.ZodDefault<z.ZodString>;
|
|
15
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
16
|
+
label: z.ZodString;
|
|
17
|
+
description: z.ZodDefault<z.ZodString>;
|
|
18
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
19
19
|
export type QuestionOption = z.infer<typeof QuestionOptionSchema>;
|
|
20
20
|
/** Agent asks the user a question. */
|
|
21
21
|
export declare const SessionQuestionEventSchema: z.ZodObject<{
|
|
@@ -29,38 +29,56 @@ export declare const SessionQuestionEventSchema: z.ZodObject<{
|
|
|
29
29
|
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
30
30
|
label: z.ZodString;
|
|
31
31
|
description: z.ZodDefault<z.ZodString>;
|
|
32
|
-
}, "
|
|
33
|
-
label:
|
|
34
|
-
description:
|
|
35
|
-
}, {
|
|
36
|
-
label:
|
|
37
|
-
description
|
|
38
|
-
}
|
|
32
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
33
|
+
label: z.ZodString;
|
|
34
|
+
description: z.ZodDefault<z.ZodString>;
|
|
35
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
36
|
+
label: z.ZodString;
|
|
37
|
+
description: z.ZodDefault<z.ZodString>;
|
|
38
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
39
39
|
/** Whether multiple options can be selected. */
|
|
40
40
|
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
-
}, "
|
|
42
|
-
t: "question"
|
|
43
|
-
requestId:
|
|
44
|
-
text:
|
|
45
|
-
questionType: "free-text"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}, {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
41
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
42
|
+
t: z.ZodLiteral<"question">;
|
|
43
|
+
requestId: z.ZodString;
|
|
44
|
+
text: z.ZodString;
|
|
45
|
+
questionType: z.ZodDefault<z.ZodEnum<["free-text", "yes-no", "single-select", "multi-select"]>>;
|
|
46
|
+
/** Header/category chip for structured questions. */
|
|
47
|
+
header: z.ZodOptional<z.ZodString>;
|
|
48
|
+
/** Options for single-select / multi-select questions. */
|
|
49
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
50
|
+
label: z.ZodString;
|
|
51
|
+
description: z.ZodDefault<z.ZodString>;
|
|
52
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
53
|
+
label: z.ZodString;
|
|
54
|
+
description: z.ZodDefault<z.ZodString>;
|
|
55
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
56
|
+
label: z.ZodString;
|
|
57
|
+
description: z.ZodDefault<z.ZodString>;
|
|
58
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
59
|
+
/** Whether multiple options can be selected. */
|
|
60
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
62
|
+
t: z.ZodLiteral<"question">;
|
|
63
|
+
requestId: z.ZodString;
|
|
64
|
+
text: z.ZodString;
|
|
65
|
+
questionType: z.ZodDefault<z.ZodEnum<["free-text", "yes-no", "single-select", "multi-select"]>>;
|
|
66
|
+
/** Header/category chip for structured questions. */
|
|
67
|
+
header: z.ZodOptional<z.ZodString>;
|
|
68
|
+
/** Options for single-select / multi-select questions. */
|
|
69
|
+
options: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
70
|
+
label: z.ZodString;
|
|
71
|
+
description: z.ZodDefault<z.ZodString>;
|
|
72
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
73
|
+
label: z.ZodString;
|
|
74
|
+
description: z.ZodDefault<z.ZodString>;
|
|
75
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
76
|
+
label: z.ZodString;
|
|
77
|
+
description: z.ZodDefault<z.ZodString>;
|
|
78
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
79
|
+
/** Whether multiple options can be selected. */
|
|
80
|
+
multiSelect: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
64
82
|
/** Agent requests tool execution approval. */
|
|
65
83
|
export declare const SessionPermissionRequestEventSchema: z.ZodObject<{
|
|
66
84
|
t: z.ZodLiteral<"permission-request">;
|
|
@@ -69,35 +87,35 @@ export declare const SessionPermissionRequestEventSchema: z.ZodObject<{
|
|
|
69
87
|
toolCallId: z.ZodString;
|
|
70
88
|
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
71
89
|
description: z.ZodDefault<z.ZodString>;
|
|
72
|
-
}, "
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}, {
|
|
80
|
-
t: "permission-request"
|
|
81
|
-
requestId:
|
|
82
|
-
toolName:
|
|
83
|
-
toolCallId:
|
|
84
|
-
args:
|
|
85
|
-
description
|
|
86
|
-
}
|
|
90
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
91
|
+
t: z.ZodLiteral<"permission-request">;
|
|
92
|
+
requestId: z.ZodString;
|
|
93
|
+
toolName: z.ZodString;
|
|
94
|
+
toolCallId: z.ZodString;
|
|
95
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
96
|
+
description: z.ZodDefault<z.ZodString>;
|
|
97
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
98
|
+
t: z.ZodLiteral<"permission-request">;
|
|
99
|
+
requestId: z.ZodString;
|
|
100
|
+
toolName: z.ZodString;
|
|
101
|
+
toolCallId: z.ZodString;
|
|
102
|
+
args: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
103
|
+
description: z.ZodDefault<z.ZodString>;
|
|
104
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
87
105
|
/** User's answer to a question or acknowledgement. */
|
|
88
106
|
export declare const SessionAnswerEventSchema: z.ZodObject<{
|
|
89
107
|
t: z.ZodLiteral<"answer">;
|
|
90
108
|
requestId: z.ZodString;
|
|
91
109
|
text: z.ZodString;
|
|
92
|
-
}, "
|
|
93
|
-
t: "answer"
|
|
94
|
-
requestId:
|
|
95
|
-
text:
|
|
96
|
-
}, {
|
|
97
|
-
t: "answer"
|
|
98
|
-
requestId:
|
|
99
|
-
text:
|
|
100
|
-
}
|
|
110
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
111
|
+
t: z.ZodLiteral<"answer">;
|
|
112
|
+
requestId: z.ZodString;
|
|
113
|
+
text: z.ZodString;
|
|
114
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
115
|
+
t: z.ZodLiteral<"answer">;
|
|
116
|
+
requestId: z.ZodString;
|
|
117
|
+
text: z.ZodString;
|
|
118
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
101
119
|
/** How a permission was resolved — persisted in envelope stream for history replay. */
|
|
102
120
|
export declare const PermissionActionSchema: z.ZodEnum<["approve", "approve-all-edits", "approve-tool", "deny"]>;
|
|
103
121
|
/** Records the user's decision on a permission request (sent immediately after resolution). */
|
|
@@ -109,19 +127,23 @@ export declare const SessionPermissionResolvedEventSchema: z.ZodObject<{
|
|
|
109
127
|
reason: z.ZodOptional<z.ZodString>;
|
|
110
128
|
/** Optional tool whitelist entries (e.g. ['Bash(git:)']). Used for display. */
|
|
111
129
|
allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
112
|
-
}, "
|
|
113
|
-
t: "permission-resolved"
|
|
114
|
-
requestId:
|
|
115
|
-
action: "approve"
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
130
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
131
|
+
t: z.ZodLiteral<"permission-resolved">;
|
|
132
|
+
requestId: z.ZodString;
|
|
133
|
+
action: z.ZodEnum<["approve", "approve-all-edits", "approve-tool", "deny"]>;
|
|
134
|
+
/** Optional feedback from user explaining why permission was denied. */
|
|
135
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
136
|
+
/** Optional tool whitelist entries (e.g. ['Bash(git:)']). Used for display. */
|
|
137
|
+
allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
138
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
139
|
+
t: z.ZodLiteral<"permission-resolved">;
|
|
140
|
+
requestId: z.ZodString;
|
|
141
|
+
action: z.ZodEnum<["approve", "approve-all-edits", "approve-tool", "deny"]>;
|
|
142
|
+
/** Optional feedback from user explaining why permission was denied. */
|
|
143
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
144
|
+
/** Optional tool whitelist entries (e.g. ['Bash(git:)']). Used for display. */
|
|
145
|
+
allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
146
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
125
147
|
export type SessionQuestionEvent = z.infer<typeof SessionQuestionEventSchema>;
|
|
126
148
|
export type SessionPermissionRequestEvent = z.infer<typeof SessionPermissionRequestEventSchema>;
|
|
127
149
|
export type SessionAnswerEvent = z.infer<typeof SessionAnswerEventSchema>;
|
|
@@ -133,18 +155,22 @@ export declare const ImageAttachmentSchema: z.ZodObject<{
|
|
|
133
155
|
data: z.ZodString;
|
|
134
156
|
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
135
157
|
mediaType: z.ZodString;
|
|
136
|
-
}, "
|
|
137
|
-
data
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
158
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
159
|
+
/** Base64-encoded image data (no data URI prefix). */
|
|
160
|
+
data: z.ZodString;
|
|
161
|
+
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
162
|
+
mediaType: z.ZodString;
|
|
163
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
164
|
+
/** Base64-encoded image data (no data URI prefix). */
|
|
165
|
+
data: z.ZodString;
|
|
166
|
+
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
167
|
+
mediaType: z.ZodString;
|
|
168
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
143
169
|
export type ImageAttachment = z.infer<typeof ImageAttachmentSchema>;
|
|
144
170
|
/** Params for answering a free-text question. */
|
|
145
171
|
export declare const AnswerQuestionParamsSchema: z.ZodObject<{
|
|
146
172
|
sessionId: z.ZodString;
|
|
147
|
-
requestId: z.ZodString
|
|
173
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
148
174
|
text: z.ZodString;
|
|
149
175
|
/** Optional image attachments (max 5, each ≤200KB base64 after compression). */
|
|
150
176
|
images: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
@@ -152,32 +178,44 @@ export declare const AnswerQuestionParamsSchema: z.ZodObject<{
|
|
|
152
178
|
data: z.ZodString;
|
|
153
179
|
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
154
180
|
mediaType: z.ZodString;
|
|
155
|
-
}, "
|
|
156
|
-
data
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
181
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
182
|
+
/** Base64-encoded image data (no data URI prefix). */
|
|
183
|
+
data: z.ZodString;
|
|
184
|
+
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
185
|
+
mediaType: z.ZodString;
|
|
186
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
187
|
+
/** Base64-encoded image data (no data URI prefix). */
|
|
188
|
+
data: z.ZodString;
|
|
189
|
+
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
190
|
+
mediaType: z.ZodString;
|
|
191
|
+
}, z.ZodTypeAny, "passthrough">>, "many">>;
|
|
192
|
+
/** Optional metadata payload (e.g. queue auto-consume context). */
|
|
193
|
+
meta: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
194
|
+
}, "strict", z.ZodTypeAny, {
|
|
164
195
|
text: string;
|
|
165
196
|
sessionId: string;
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
197
|
+
requestId?: string | undefined;
|
|
198
|
+
images?: z.objectOutputType<{
|
|
199
|
+
/** Base64-encoded image data (no data URI prefix). */
|
|
200
|
+
data: z.ZodString;
|
|
201
|
+
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
202
|
+
mediaType: z.ZodString;
|
|
203
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
204
|
+
meta?: Record<string, unknown> | undefined;
|
|
170
205
|
}, {
|
|
171
|
-
requestId: string;
|
|
172
206
|
text: string;
|
|
173
207
|
sessionId: string;
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
208
|
+
requestId?: string | undefined;
|
|
209
|
+
images?: z.objectInputType<{
|
|
210
|
+
/** Base64-encoded image data (no data URI prefix). */
|
|
211
|
+
data: z.ZodString;
|
|
212
|
+
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
213
|
+
mediaType: z.ZodString;
|
|
214
|
+
}, z.ZodTypeAny, "passthrough">[] | undefined;
|
|
215
|
+
meta?: Record<string, unknown> | undefined;
|
|
178
216
|
}>;
|
|
179
217
|
/** Permission mode for Claude sessions. */
|
|
180
|
-
export declare const PermissionModeSchema: z.ZodEnum<["default", "acceptEdits", "auto", "autoEdit", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo", "suggest", "auto-edit", "full-auto"]>;
|
|
218
|
+
export declare const PermissionModeSchema: z.ZodEnum<["default", "acceptEdits", "auto", "autoEdit", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo", "suggest", "auto-edit", "full-auto", "never", "untrusted", "on-failure", "on-request", "build"]>;
|
|
181
219
|
export type PermissionModeValue = z.infer<typeof PermissionModeSchema>;
|
|
182
220
|
/** Params for approving a tool permission request. */
|
|
183
221
|
export declare const ApprovePermissionParamsSchema: z.ZodObject<{
|
|
@@ -185,21 +223,30 @@ export declare const ApprovePermissionParamsSchema: z.ZodObject<{
|
|
|
185
223
|
requestId: z.ZodString;
|
|
186
224
|
toolCallId: z.ZodString;
|
|
187
225
|
/** Optional mode change (e.g. 'acceptEdits' for "allow all edits this session"). */
|
|
188
|
-
mode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "auto", "autoEdit", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo", "suggest", "auto-edit", "full-auto"]>>;
|
|
226
|
+
mode: z.ZodOptional<z.ZodEnum<["default", "acceptEdits", "auto", "autoEdit", "bypassPermissions", "plan", "read-only", "safe-yolo", "yolo", "suggest", "auto-edit", "full-auto", "never", "untrusted", "on-failure", "on-request", "build"]>>;
|
|
189
227
|
/** Optional tool whitelist (e.g. ['Bash(git:)'] for "don't ask again"). */
|
|
190
228
|
allowTools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
191
|
-
|
|
229
|
+
/** Auto-approve all edit tools for the rest of this session — independent
|
|
230
|
+
* flag, does NOT change permissionMode. Stored in session metadata. */
|
|
231
|
+
autoApproveEdits: z.ZodOptional<z.ZodBoolean>;
|
|
232
|
+
/** Sent by web PWA — daemon reads to update permission rules. */
|
|
233
|
+
inputOverrides: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
234
|
+
}, "strict", z.ZodTypeAny, {
|
|
192
235
|
requestId: string;
|
|
193
236
|
toolCallId: string;
|
|
194
237
|
sessionId: string;
|
|
195
238
|
allowTools?: string[] | undefined;
|
|
196
|
-
mode?: "default" | "acceptEdits" | "auto" | "plan" | "bypassPermissions" | "autoEdit" | "read-only" | "safe-yolo" | "yolo" | "suggest" | "auto-edit" | "full-auto" | undefined;
|
|
239
|
+
mode?: "never" | "default" | "acceptEdits" | "auto" | "plan" | "bypassPermissions" | "autoEdit" | "read-only" | "safe-yolo" | "yolo" | "suggest" | "auto-edit" | "full-auto" | "untrusted" | "on-failure" | "on-request" | "build" | undefined;
|
|
240
|
+
autoApproveEdits?: boolean | undefined;
|
|
241
|
+
inputOverrides?: Record<string, unknown> | undefined;
|
|
197
242
|
}, {
|
|
198
243
|
requestId: string;
|
|
199
244
|
toolCallId: string;
|
|
200
245
|
sessionId: string;
|
|
201
246
|
allowTools?: string[] | undefined;
|
|
202
|
-
mode?: "default" | "acceptEdits" | "auto" | "plan" | "bypassPermissions" | "autoEdit" | "read-only" | "safe-yolo" | "yolo" | "suggest" | "auto-edit" | "full-auto" | undefined;
|
|
247
|
+
mode?: "never" | "default" | "acceptEdits" | "auto" | "plan" | "bypassPermissions" | "autoEdit" | "read-only" | "safe-yolo" | "yolo" | "suggest" | "auto-edit" | "full-auto" | "untrusted" | "on-failure" | "on-request" | "build" | undefined;
|
|
248
|
+
autoApproveEdits?: boolean | undefined;
|
|
249
|
+
inputOverrides?: Record<string, unknown> | undefined;
|
|
203
250
|
}>;
|
|
204
251
|
/** Params for denying a tool permission request. */
|
|
205
252
|
export declare const DenyPermissionParamsSchema: z.ZodObject<{
|
|
@@ -208,7 +255,7 @@ export declare const DenyPermissionParamsSchema: z.ZodObject<{
|
|
|
208
255
|
toolCallId: z.ZodString;
|
|
209
256
|
/** Optional feedback from user explaining why permission was denied. */
|
|
210
257
|
reason: z.ZodOptional<z.ZodString>;
|
|
211
|
-
}, "
|
|
258
|
+
}, "strict", z.ZodTypeAny, {
|
|
212
259
|
requestId: string;
|
|
213
260
|
toolCallId: string;
|
|
214
261
|
sessionId: string;
|
|
@@ -1,111 +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
|
-
/** Optional tool whitelist entries (e.g. ['Bash(git:)']). Used for display. */
|
|
59
|
-
allowTools: z.array(z.string()).optional(),
|
|
60
|
-
});
|
|
61
|
-
// ── Image Attachment ──
|
|
62
|
-
/** A single image attachment (base64-encoded, frontend-compressed). */
|
|
63
|
-
export const ImageAttachmentSchema = z.object({
|
|
64
|
-
/** Base64-encoded image data (no data URI prefix). */
|
|
65
|
-
data: z.string(),
|
|
66
|
-
/** MIME type: image/jpeg, image/png, image/gif, image/webp. */
|
|
67
|
-
mediaType: z.string(),
|
|
68
|
-
});
|
|
69
|
-
// ── RPC Params ──
|
|
70
|
-
/** Params for answering a free-text question. */
|
|
71
|
-
export const AnswerQuestionParamsSchema = z.object({
|
|
72
|
-
sessionId: z.string(),
|
|
73
|
-
requestId: z.string(),
|
|
74
|
-
text: z.string(),
|
|
75
|
-
/** Optional image attachments (max 5, each ≤200KB base64 after compression). */
|
|
76
|
-
images: z.array(ImageAttachmentSchema).max(5).optional(),
|
|
77
|
-
});
|
|
78
|
-
/** Permission mode for Claude sessions. */
|
|
79
|
-
export const PermissionModeSchema = z.enum([
|
|
80
|
-
'default',
|
|
81
|
-
'acceptEdits',
|
|
82
|
-
'auto',
|
|
83
|
-
'autoEdit',
|
|
84
|
-
'bypassPermissions',
|
|
85
|
-
'plan',
|
|
86
|
-
'read-only',
|
|
87
|
-
'safe-yolo',
|
|
88
|
-
'yolo',
|
|
89
|
-
'suggest',
|
|
90
|
-
'auto-edit',
|
|
91
|
-
'full-auto',
|
|
92
|
-
]);
|
|
93
|
-
/** Params for approving a tool permission request. */
|
|
94
|
-
export const ApprovePermissionParamsSchema = z.object({
|
|
95
|
-
sessionId: z.string(),
|
|
96
|
-
requestId: z.string(),
|
|
97
|
-
toolCallId: z.string(),
|
|
98
|
-
/** Optional mode change (e.g. 'acceptEdits' for "allow all edits this session"). */
|
|
99
|
-
mode: PermissionModeSchema.optional(),
|
|
100
|
-
/** Optional tool whitelist (e.g. ['Bash(git:)'] for "don't ask again"). */
|
|
101
|
-
allowTools: z.array(z.string()).optional(),
|
|
102
|
-
});
|
|
103
|
-
/** Params for denying a tool permission request. */
|
|
104
|
-
export const DenyPermissionParamsSchema = z.object({
|
|
105
|
-
sessionId: z.string(),
|
|
106
|
-
requestId: z.string(),
|
|
107
|
-
toolCallId: z.string(),
|
|
108
|
-
/** Optional feedback from user explaining why permission was denied. */
|
|
109
|
-
reason: z.string().optional(),
|
|
110
|
-
});
|
|
111
|
-
//# sourceMappingURL=interactionEvents.js.map
|
|
1
|
+
"use strict";import{z as t}from"zod";export const QuestionOptionSchema=t.object({label:t.string(),description:t.string().default("")}).passthrough(),SessionQuestionEventSchema=t.object({t:t.literal("question"),requestId:t.string(),text:t.string(),questionType:t.enum(["free-text","yes-no","single-select","multi-select"]).default("free-text"),header:t.string().optional(),options:t.array(QuestionOptionSchema).optional(),multiSelect:t.boolean().optional()}).passthrough(),SessionPermissionRequestEventSchema=t.object({t:t.literal("permission-request"),requestId:t.string(),toolName:t.string(),toolCallId:t.string(),args:t.record(t.unknown()),description:t.string().default("")}).passthrough(),SessionAnswerEventSchema=t.object({t:t.literal("answer"),requestId:t.string(),text:t.string()}).passthrough(),PermissionActionSchema=t.enum(["approve","approve-all-edits","approve-tool","deny"]),SessionPermissionResolvedEventSchema=t.object({t:t.literal("permission-resolved"),requestId:t.string(),action:PermissionActionSchema,reason:t.string().optional(),allowTools:t.array(t.string()).optional()}).passthrough(),ImageAttachmentSchema=t.object({data:t.string(),mediaType:t.string()}).passthrough(),AnswerQuestionParamsSchema=t.object({sessionId:t.string(),requestId:t.string().optional(),text:t.string(),images:t.array(ImageAttachmentSchema).max(5).optional(),meta:t.record(t.unknown()).optional()}).strict(),PermissionModeSchema=t.enum(["default","acceptEdits","auto","autoEdit","bypassPermissions","plan","read-only","safe-yolo","yolo","suggest","auto-edit","full-auto","never","untrusted","on-failure","on-request","build"]),ApprovePermissionParamsSchema=t.object({sessionId:t.string(),requestId:t.string(),toolCallId:t.string(),mode:PermissionModeSchema.optional(),allowTools:t.array(t.string()).optional(),autoApproveEdits:t.boolean().optional(),inputOverrides:t.record(t.unknown()).optional()}).strict(),DenyPermissionParamsSchema=t.object({sessionId:t.string(),requestId:t.string(),toolCallId:t.string(),reason:t.string().optional()}).strict();
|