@kmmao/happy-wire 0.12.0 → 0.13.1
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/index.cjs +26 -175
- package/dist/index.d.cts +110 -422
- package/dist/index.d.mts +110 -422
- package/dist/index.mjs +24 -148
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1020,152 +1020,6 @@ const terminalExitPayloadSchema = z.object({
|
|
|
1020
1020
|
exitCode: z.number()
|
|
1021
1021
|
});
|
|
1022
1022
|
|
|
1023
|
-
const SUGGESTION_TYPES = ["suggested_goal", "suggested_task", "suggested_skill", "suggested_decision"];
|
|
1024
|
-
const SUGGESTION_STATUSES = ["open", "processing", "accepted", "suspended", "dismissed", "expired"];
|
|
1025
|
-
const SUGGESTION_BUCKETS = ["next_step", "needs_decision", "needs_human_input"];
|
|
1026
|
-
const SUGGESTION_ACCEPT_SOURCES = ["human", "system_auto"];
|
|
1027
|
-
const SUPERVISOR_MODES = ["disabled", "suggest", "semi-auto", "auto"];
|
|
1028
|
-
const WorldAutonomyPolicySchema = z$1.object({
|
|
1029
|
-
level: z$1.enum(SUPERVISOR_MODES),
|
|
1030
|
-
maxAutoAcceptsPerDay: z$1.number().int().positive().nullable(),
|
|
1031
|
-
maxConcurrentAutoTasks: z$1.number().int().positive().nullable(),
|
|
1032
|
-
autoAcceptTypes: z$1.array(z$1.string())
|
|
1033
|
-
});
|
|
1034
|
-
const SUGGESTION_ACCEPT_AUDIT_RULES = [
|
|
1035
|
-
"safe_suggested_task_auto_accept",
|
|
1036
|
-
"retryable_failed_task_auto_accept",
|
|
1037
|
-
"blocked_goal_supplement_auto_accept",
|
|
1038
|
-
"precedent_auto_resolve",
|
|
1039
|
-
"goal_replan_auto_accept"
|
|
1040
|
-
];
|
|
1041
|
-
const SuggestionAcceptAuditSchema = z$1.object({
|
|
1042
|
-
rule: z$1.enum(SUGGESTION_ACCEPT_AUDIT_RULES),
|
|
1043
|
-
checks: z$1.array(z$1.string()).min(1)
|
|
1044
|
-
});
|
|
1045
|
-
const SUGGESTION_AUTO_ACCEPT_STATUSES = ["skipped", "failed"];
|
|
1046
|
-
const SUGGESTION_AUTO_ACCEPT_REASON_CODES = [
|
|
1047
|
-
"quota_exhausted",
|
|
1048
|
-
"already_acted",
|
|
1049
|
-
"accept_failed",
|
|
1050
|
-
"concurrency_exceeded",
|
|
1051
|
-
"mode_disabled"
|
|
1052
|
-
];
|
|
1053
|
-
const SUGGESTION_AUTO_ACCEPT_FAILURE_DETAILS = [
|
|
1054
|
-
"dispatch_failed",
|
|
1055
|
-
"payload_invalid",
|
|
1056
|
-
"auto_accept_failed"
|
|
1057
|
-
];
|
|
1058
|
-
const EVIDENCE_KINDS = ["goal", "task", "decision", "message", "narrative"];
|
|
1059
|
-
const SuggestionEvidenceSchema = z$1.object({
|
|
1060
|
-
kind: z$1.enum(EVIDENCE_KINDS),
|
|
1061
|
-
id: z$1.string().optional(),
|
|
1062
|
-
label: z$1.string()
|
|
1063
|
-
});
|
|
1064
|
-
const SuggestionGoalPayloadSchema = z$1.object({
|
|
1065
|
-
title: z$1.string(),
|
|
1066
|
-
detail: z$1.string().optional(),
|
|
1067
|
-
priority: z$1.string().optional()
|
|
1068
|
-
});
|
|
1069
|
-
const SuggestionTaskPayloadSchema = z$1.object({
|
|
1070
|
-
title: z$1.string(),
|
|
1071
|
-
prompt: z$1.string(),
|
|
1072
|
-
roleType: z$1.string().optional(),
|
|
1073
|
-
goalId: z$1.string().optional(),
|
|
1074
|
-
priority: z$1.string().optional()
|
|
1075
|
-
});
|
|
1076
|
-
const SuggestionSkillPayloadSchema = z$1.object({
|
|
1077
|
-
title: z$1.string(),
|
|
1078
|
-
content: z$1.string(),
|
|
1079
|
-
sourceTaskId: z$1.string().optional()
|
|
1080
|
-
});
|
|
1081
|
-
const SuggestionDecisionPayloadSchema = z$1.object({
|
|
1082
|
-
question: z$1.string(),
|
|
1083
|
-
context: z$1.string().optional(),
|
|
1084
|
-
goalId: z$1.string().optional(),
|
|
1085
|
-
existingDecisionId: z$1.string().optional(),
|
|
1086
|
-
options: z$1.array(z$1.object({
|
|
1087
|
-
id: z$1.string(),
|
|
1088
|
-
description: z$1.string(),
|
|
1089
|
-
pros: z$1.string().optional(),
|
|
1090
|
-
cons: z$1.string().optional()
|
|
1091
|
-
})).min(2).max(10),
|
|
1092
|
-
precedentKey: z$1.string().optional()
|
|
1093
|
-
});
|
|
1094
|
-
function getSuggestionPayloadSchema(type) {
|
|
1095
|
-
if (type === "suggested_goal") {
|
|
1096
|
-
return z$1.object({ goal: SuggestionGoalPayloadSchema });
|
|
1097
|
-
}
|
|
1098
|
-
if (type === "suggested_task") {
|
|
1099
|
-
return z$1.object({ task: SuggestionTaskPayloadSchema });
|
|
1100
|
-
}
|
|
1101
|
-
if (type === "suggested_skill") {
|
|
1102
|
-
return z$1.object({ skill: SuggestionSkillPayloadSchema });
|
|
1103
|
-
}
|
|
1104
|
-
return z$1.object({ decision: SuggestionDecisionPayloadSchema });
|
|
1105
|
-
}
|
|
1106
|
-
const SuggestionPayloadSchema = z$1.union([
|
|
1107
|
-
z$1.object({ goal: SuggestionGoalPayloadSchema }),
|
|
1108
|
-
z$1.object({ task: SuggestionTaskPayloadSchema }),
|
|
1109
|
-
z$1.object({ skill: SuggestionSkillPayloadSchema }),
|
|
1110
|
-
z$1.object({ decision: SuggestionDecisionPayloadSchema })
|
|
1111
|
-
]);
|
|
1112
|
-
const AcceptBodySchema = z$1.object({
|
|
1113
|
-
machineId: z$1.string().optional(),
|
|
1114
|
-
priorityOverride: z$1.string().optional(),
|
|
1115
|
-
roleOverride: z$1.string().optional()
|
|
1116
|
-
});
|
|
1117
|
-
const WorldSuggestionUpdatedSchema = z$1.object({
|
|
1118
|
-
type: z$1.literal("world-suggestion-updated"),
|
|
1119
|
-
projectId: z$1.string(),
|
|
1120
|
-
suggestionId: z$1.string(),
|
|
1121
|
-
status: z$1.enum(SUGGESTION_STATUSES)
|
|
1122
|
-
});
|
|
1123
|
-
const AutonomyStatsRecentActionSchema = z$1.object({
|
|
1124
|
-
suggestionId: z$1.string(),
|
|
1125
|
-
title: z$1.string(),
|
|
1126
|
-
type: z$1.enum(SUGGESTION_TYPES),
|
|
1127
|
-
acceptedAt: z$1.number(),
|
|
1128
|
-
rule: z$1.string()
|
|
1129
|
-
});
|
|
1130
|
-
const AutonomyStatsSchema = z$1.object({
|
|
1131
|
-
mode: z$1.enum(SUPERVISOR_MODES),
|
|
1132
|
-
todayAutoAccepted: z$1.number().int(),
|
|
1133
|
-
todayQuota: z$1.number().int().nullable(),
|
|
1134
|
-
concurrentAutoTasks: z$1.number().int(),
|
|
1135
|
-
maxConcurrent: z$1.number().int().nullable(),
|
|
1136
|
-
recentAutoActions: z$1.array(AutonomyStatsRecentActionSchema)
|
|
1137
|
-
});
|
|
1138
|
-
|
|
1139
|
-
const AGENT_MSG_TYPES = [
|
|
1140
|
-
"request",
|
|
1141
|
-
"report",
|
|
1142
|
-
"conflict",
|
|
1143
|
-
"law_suggestion",
|
|
1144
|
-
"dependency_blocked",
|
|
1145
|
-
"handoff",
|
|
1146
|
-
"review_request",
|
|
1147
|
-
"decision_request"
|
|
1148
|
-
];
|
|
1149
|
-
const AgentMsgTypeSchema = z.enum(AGENT_MSG_TYPES);
|
|
1150
|
-
const AGENT_MSG_STATUSES = ["unread", "read", "resolved"];
|
|
1151
|
-
const AGENT_MSG_PRIORITIES = ["urgent", "normal", "low"];
|
|
1152
|
-
const AgentMessageSummarySchema = z.object({
|
|
1153
|
-
id: z.string(),
|
|
1154
|
-
projectId: z.string(),
|
|
1155
|
-
fromRole: z.string(),
|
|
1156
|
-
toRole: z.string().nullable(),
|
|
1157
|
-
msgType: AgentMsgTypeSchema,
|
|
1158
|
-
content: z.string(),
|
|
1159
|
-
status: z.enum(AGENT_MSG_STATUSES),
|
|
1160
|
-
sessionId: z.string().nullable(),
|
|
1161
|
-
decisionId: z.string().nullable(),
|
|
1162
|
-
relatedGoalId: z.string().nullable(),
|
|
1163
|
-
relatedTaskId: z.string().nullable(),
|
|
1164
|
-
priority: z.enum(AGENT_MSG_PRIORITIES),
|
|
1165
|
-
createdAt: z.number(),
|
|
1166
|
-
updatedAt: z.number()
|
|
1167
|
-
});
|
|
1168
|
-
|
|
1169
1023
|
const CODEX_APP_SERVER_BACKEND = "codex-app-server";
|
|
1170
1024
|
const CODEX_MCP_LEGACY_BACKEND = "codex-mcp-legacy";
|
|
1171
1025
|
const CodexBackendModeSchema = z.enum([
|
|
@@ -1829,6 +1683,25 @@ const sessionSummaryStateSchema = z.object({
|
|
|
1829
1683
|
impactScope: z.array(z.string()).optional(),
|
|
1830
1684
|
updatedAt: z.number()
|
|
1831
1685
|
});
|
|
1686
|
+
const sessionSummaryRefreshActiveRequestSchema = z.object({
|
|
1687
|
+
requestId: z.string().min(1),
|
|
1688
|
+
requestedAt: z.number(),
|
|
1689
|
+
requester: z.enum(["happy-agent", "app", "system"]),
|
|
1690
|
+
command: z.literal("summary-refresh"),
|
|
1691
|
+
requireSummary: z.boolean()
|
|
1692
|
+
});
|
|
1693
|
+
const sessionSummaryRefreshRecentEntrySchema = z.object({
|
|
1694
|
+
requestId: z.string().min(1),
|
|
1695
|
+
status: z.enum(["applied", "superseded"]),
|
|
1696
|
+
resolvedAt: z.number(),
|
|
1697
|
+
summaryUpdatedAt: z.number().optional(),
|
|
1698
|
+
supersededByRequestId: z.string().min(1).optional()
|
|
1699
|
+
});
|
|
1700
|
+
const sessionSummaryRefreshStateSchema = z.object({
|
|
1701
|
+
protocolVersion: z.literal(1),
|
|
1702
|
+
active: sessionSummaryRefreshActiveRequestSchema.optional(),
|
|
1703
|
+
recent: z.array(sessionSummaryRefreshRecentEntrySchema).optional()
|
|
1704
|
+
});
|
|
1832
1705
|
|
|
1833
1706
|
const HAPPY_MCP_TOOL_NAMES = [
|
|
1834
1707
|
"change_title",
|
|
@@ -1901,7 +1774,10 @@ const HAPPY_MCP_TOOL_SPECS = {
|
|
|
1901
1774
|
currentFocus: z$1.string().optional().describe("Brief description of the active task or phase"),
|
|
1902
1775
|
keyDecisions: z$1.array(z$1.string()).optional().describe("Important choices already made this session"),
|
|
1903
1776
|
openQuestions: z$1.array(z$1.string()).optional().describe("Unresolved questions or pending decisions"),
|
|
1904
|
-
impactScope: z$1.array(z$1.string()).optional().describe("Modules/files/areas affected by this session's work")
|
|
1777
|
+
impactScope: z$1.array(z$1.string()).optional().describe("Modules/files/areas affected by this session's work"),
|
|
1778
|
+
requestId: z$1.string().optional().describe(
|
|
1779
|
+
"Optional request identifier that runtimes may record in sessionSummaryRefresh recent history for request-level confirmation"
|
|
1780
|
+
)
|
|
1905
1781
|
},
|
|
1906
1782
|
hideSuccessfulCall: false,
|
|
1907
1783
|
autoApproveByDefault: true,
|
|
@@ -2059,4 +1935,4 @@ const CodexMetadataSchema = z.object({
|
|
|
2059
1935
|
mcpServers: z.array(CodexMcpServerSummarySchema).optional()
|
|
2060
1936
|
});
|
|
2061
1937
|
|
|
2062
|
-
export {
|
|
1938
|
+
export { AIBackendProfileSchema, AgentLoopSummarySchema, AgentMessageSchema, AnthropicConfigSchema, ApiMessageSchema, ApiUpdateMachineStateSchema, ApiUpdateNewMessageSchema, ApiUpdateSessionStateSchema, AutoDreamProfileSummarySchema, AutomationAuditEventSummarySchema, AutomationAuditStatsSchema, AutomationCountsSchema, AutomationGuardianSummarySchema, AutomationGuardianUsageSummarySchema, AutomationJobKindSchema, AutomationJobStatusSchema, AutomationJobSummarySchema, AutomationPrioritySchema, AutomationStateSchema, AzureOpenAIConfigSchema, BUILT_IN_AI_BACKEND_PROFILE_IDS, BootstrapProfileSummarySchema, BriefMessageSchema, BuiltInAIBackendProfileIdSchema, CODEX_APP_SERVER_BACKEND, CODEX_MCP_LEGACY_BACKEND, CODEX_REQUESTED_BACKEND_ALIASES, CliInstallInfoSchema, CliInstallSourceSchema, CodexAccountSchema, CodexAgentSummarySchema, CodexBackendModeSchema, CodexConfigModeSchema, CodexConfigSchema, CodexExperimentalFeatureSchema, CodexMcpServerSummarySchema, CodexMetadataSchema, CodexPromptSummarySchema, CodexRateLimitsSchema, CodexRequestedBackendSchema, CodexResolvedBackendSchema, CodexRuntimeConfigSchema, CodexSkillSummarySchema, CoreUpdateBodySchema, CoreUpdateContainerSchema, CreateKnowledgeEntryBodySchema, CreateSkillBodySchema, CreateTaskBodySchema, CrossProjectSearchResponseSchema, CrossProjectSearchResultSchema, CustomModelSchema, DaemonStateSchema, DefaultPermissionModeSchema, EnvironmentVariableSchema, HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES, HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES, HAPPY_MCP_TOOL_NAMES, HAPPY_MCP_TOOL_SPECS, InboxCategorySchema, InboxItemSummarySchema, InboxNewItemSchema, InboxSeveritySchema, InboxUnreadCountSchema, KnowledgeActionSchema, KnowledgeChainEntrySchema, KnowledgeChainRelationSchema, KnowledgeChainResponseSchema, KnowledgeConfidenceSchema, KnowledgeContributorTypeSchema, KnowledgeEntryTypeSchema, KnowledgeInjectionModeSchema, KnowledgeInjectionRequestSchema, KnowledgeInjectionResponseSchema, KnowledgeStatusSchema, LegacyMessageContentSchema, MachineMetadataSchema, MessageContentSchema, MessageMetaSchema, OpenAIConfigSchema, ProfileCompatibilitySchema, ProjectProfileSchema, QueryKnowledgeParamsSchema, RESOLVED_RUNTIME_PROFILE_SCHEMA_VERSION, ResolvedRuntimeProfileSchema, RuntimeProfileSourceSchema, RuntimeProfileTrustSchema, SessionEventCreatedSchema, SessionEventReportSchema, SessionEventSummarySchema, SessionEventTypeSchema, SessionMessageContentSchema, SessionMessageSchema, SessionProtocolMessageSchema, SkillContentSchema, SkillSummarySchema, TailscaleInfoSchema, TailscaleServeEntrySchema, TaskOutcomeSchema, TaskPrioritySchema, TaskStatusChangedSchema, TaskStatusReportSchema, TaskStatusSchema, TaskSummarySchema, TaskTriggerDataSchema, TaskTriggerTypeSchema, TmuxConfigSchema, TogetherAIConfigSchema, TunnelEntrySchema, TunnelProviderInfoSchema, TunnelStateSchema, TurnKnowledgeExtractionSchema, UpdateBodySchema, UpdateKnowledgeEntryBodySchema, UpdateMachineBodySchema, UpdateNewMessageBodySchema, UpdateSchema, UpdateSessionBodySchema, UpdateSkillBodySchema, UserMessageSchema, VersionedEncryptedValueSchema, VersionedMachineEncryptedValueSchema, VersionedNullableEncryptedValueSchema, VoiceTokenAllowedSchema, VoiceTokenDeniedSchema, VoiceTokenResponseSchema, createEnvelope, createResolvedRuntimeProfile, getBuiltInAIBackendProfile, getHappyMcpToolAction, getHappyMcpToolAliases, getHappyMcpToolTitle, getProfileEnvironmentVariables, isCodexAppServerBackend, isCodexLegacyBackend, isHappyMcpToolAlias, isHappyMcpToolName, isTrustedRuntimeProfile, normalizeHappyMcpToolName, normalizeResolvedRuntimeProfile, resolveCodexResolvedBackend, resolveCodexResumableThreadId, resolveRequestedCodexBackend, sessionContextUsageCategorySchema, sessionContextUsageEventSchema, sessionEnvelopeSchema, sessionEventSchema, sessionFileEventSchema, sessionModelUsageSchema, sessionNeedsContinueEventSchema, sessionProgressListSchema, sessionProgressStateSchema, sessionProgressTodoSchema, sessionProgressTodoStatusSchema, sessionPromptSuggestionEventSchema, sessionRoleSchema, sessionServiceMessageEventSchema, sessionStartEventSchema, sessionStateChangedEventSchema, sessionStopEventSchema, sessionSummaryRefreshActiveRequestSchema, sessionSummaryRefreshRecentEntrySchema, sessionSummaryRefreshStateSchema, sessionSummaryStateSchema, sessionTaskEndEventSchema, sessionTaskLogEventSchema, sessionTaskProgressEventSchema, sessionTaskStartEventSchema, sessionTextDeltaEventSchema, sessionTextEventSchema, sessionToolCallEndEventSchema, sessionToolCallStartEventSchema, sessionToolProgressEventSchema, sessionTurnEndEventSchema, sessionTurnEndStatusSchema, sessionTurnStartEventSchema, sessionUsageUpdateEventSchema, shouldAutoApproveHappyMcpReason, shouldAutoApproveHappyMcpToolName, shouldHideSuccessfulHappyMcpTool, terminalCloseRequestSchema, terminalExitPayloadSchema, terminalInputPayloadSchema, terminalOutputPayloadSchema, terminalResizeRequestSchema, terminalSpawnRequestSchema, terminalSpawnResponseSchema, validateProfileForAgent };
|