@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 CHANGED
@@ -1040,152 +1040,6 @@ const terminalExitPayloadSchema = z__namespace.object({
1040
1040
  exitCode: z__namespace.number()
1041
1041
  });
1042
1042
 
1043
- const SUGGESTION_TYPES = ["suggested_goal", "suggested_task", "suggested_skill", "suggested_decision"];
1044
- const SUGGESTION_STATUSES = ["open", "processing", "accepted", "suspended", "dismissed", "expired"];
1045
- const SUGGESTION_BUCKETS = ["next_step", "needs_decision", "needs_human_input"];
1046
- const SUGGESTION_ACCEPT_SOURCES = ["human", "system_auto"];
1047
- const SUPERVISOR_MODES = ["disabled", "suggest", "semi-auto", "auto"];
1048
- const WorldAutonomyPolicySchema = z.z.object({
1049
- level: z.z.enum(SUPERVISOR_MODES),
1050
- maxAutoAcceptsPerDay: z.z.number().int().positive().nullable(),
1051
- maxConcurrentAutoTasks: z.z.number().int().positive().nullable(),
1052
- autoAcceptTypes: z.z.array(z.z.string())
1053
- });
1054
- const SUGGESTION_ACCEPT_AUDIT_RULES = [
1055
- "safe_suggested_task_auto_accept",
1056
- "retryable_failed_task_auto_accept",
1057
- "blocked_goal_supplement_auto_accept",
1058
- "precedent_auto_resolve",
1059
- "goal_replan_auto_accept"
1060
- ];
1061
- const SuggestionAcceptAuditSchema = z.z.object({
1062
- rule: z.z.enum(SUGGESTION_ACCEPT_AUDIT_RULES),
1063
- checks: z.z.array(z.z.string()).min(1)
1064
- });
1065
- const SUGGESTION_AUTO_ACCEPT_STATUSES = ["skipped", "failed"];
1066
- const SUGGESTION_AUTO_ACCEPT_REASON_CODES = [
1067
- "quota_exhausted",
1068
- "already_acted",
1069
- "accept_failed",
1070
- "concurrency_exceeded",
1071
- "mode_disabled"
1072
- ];
1073
- const SUGGESTION_AUTO_ACCEPT_FAILURE_DETAILS = [
1074
- "dispatch_failed",
1075
- "payload_invalid",
1076
- "auto_accept_failed"
1077
- ];
1078
- const EVIDENCE_KINDS = ["goal", "task", "decision", "message", "narrative"];
1079
- const SuggestionEvidenceSchema = z.z.object({
1080
- kind: z.z.enum(EVIDENCE_KINDS),
1081
- id: z.z.string().optional(),
1082
- label: z.z.string()
1083
- });
1084
- const SuggestionGoalPayloadSchema = z.z.object({
1085
- title: z.z.string(),
1086
- detail: z.z.string().optional(),
1087
- priority: z.z.string().optional()
1088
- });
1089
- const SuggestionTaskPayloadSchema = z.z.object({
1090
- title: z.z.string(),
1091
- prompt: z.z.string(),
1092
- roleType: z.z.string().optional(),
1093
- goalId: z.z.string().optional(),
1094
- priority: z.z.string().optional()
1095
- });
1096
- const SuggestionSkillPayloadSchema = z.z.object({
1097
- title: z.z.string(),
1098
- content: z.z.string(),
1099
- sourceTaskId: z.z.string().optional()
1100
- });
1101
- const SuggestionDecisionPayloadSchema = z.z.object({
1102
- question: z.z.string(),
1103
- context: z.z.string().optional(),
1104
- goalId: z.z.string().optional(),
1105
- existingDecisionId: z.z.string().optional(),
1106
- options: z.z.array(z.z.object({
1107
- id: z.z.string(),
1108
- description: z.z.string(),
1109
- pros: z.z.string().optional(),
1110
- cons: z.z.string().optional()
1111
- })).min(2).max(10),
1112
- precedentKey: z.z.string().optional()
1113
- });
1114
- function getSuggestionPayloadSchema(type) {
1115
- if (type === "suggested_goal") {
1116
- return z.z.object({ goal: SuggestionGoalPayloadSchema });
1117
- }
1118
- if (type === "suggested_task") {
1119
- return z.z.object({ task: SuggestionTaskPayloadSchema });
1120
- }
1121
- if (type === "suggested_skill") {
1122
- return z.z.object({ skill: SuggestionSkillPayloadSchema });
1123
- }
1124
- return z.z.object({ decision: SuggestionDecisionPayloadSchema });
1125
- }
1126
- const SuggestionPayloadSchema = z.z.union([
1127
- z.z.object({ goal: SuggestionGoalPayloadSchema }),
1128
- z.z.object({ task: SuggestionTaskPayloadSchema }),
1129
- z.z.object({ skill: SuggestionSkillPayloadSchema }),
1130
- z.z.object({ decision: SuggestionDecisionPayloadSchema })
1131
- ]);
1132
- const AcceptBodySchema = z.z.object({
1133
- machineId: z.z.string().optional(),
1134
- priorityOverride: z.z.string().optional(),
1135
- roleOverride: z.z.string().optional()
1136
- });
1137
- const WorldSuggestionUpdatedSchema = z.z.object({
1138
- type: z.z.literal("world-suggestion-updated"),
1139
- projectId: z.z.string(),
1140
- suggestionId: z.z.string(),
1141
- status: z.z.enum(SUGGESTION_STATUSES)
1142
- });
1143
- const AutonomyStatsRecentActionSchema = z.z.object({
1144
- suggestionId: z.z.string(),
1145
- title: z.z.string(),
1146
- type: z.z.enum(SUGGESTION_TYPES),
1147
- acceptedAt: z.z.number(),
1148
- rule: z.z.string()
1149
- });
1150
- const AutonomyStatsSchema = z.z.object({
1151
- mode: z.z.enum(SUPERVISOR_MODES),
1152
- todayAutoAccepted: z.z.number().int(),
1153
- todayQuota: z.z.number().int().nullable(),
1154
- concurrentAutoTasks: z.z.number().int(),
1155
- maxConcurrent: z.z.number().int().nullable(),
1156
- recentAutoActions: z.z.array(AutonomyStatsRecentActionSchema)
1157
- });
1158
-
1159
- const AGENT_MSG_TYPES = [
1160
- "request",
1161
- "report",
1162
- "conflict",
1163
- "law_suggestion",
1164
- "dependency_blocked",
1165
- "handoff",
1166
- "review_request",
1167
- "decision_request"
1168
- ];
1169
- const AgentMsgTypeSchema = z__namespace.enum(AGENT_MSG_TYPES);
1170
- const AGENT_MSG_STATUSES = ["unread", "read", "resolved"];
1171
- const AGENT_MSG_PRIORITIES = ["urgent", "normal", "low"];
1172
- const AgentMessageSummarySchema = z__namespace.object({
1173
- id: z__namespace.string(),
1174
- projectId: z__namespace.string(),
1175
- fromRole: z__namespace.string(),
1176
- toRole: z__namespace.string().nullable(),
1177
- msgType: AgentMsgTypeSchema,
1178
- content: z__namespace.string(),
1179
- status: z__namespace.enum(AGENT_MSG_STATUSES),
1180
- sessionId: z__namespace.string().nullable(),
1181
- decisionId: z__namespace.string().nullable(),
1182
- relatedGoalId: z__namespace.string().nullable(),
1183
- relatedTaskId: z__namespace.string().nullable(),
1184
- priority: z__namespace.enum(AGENT_MSG_PRIORITIES),
1185
- createdAt: z__namespace.number(),
1186
- updatedAt: z__namespace.number()
1187
- });
1188
-
1189
1043
  const CODEX_APP_SERVER_BACKEND = "codex-app-server";
1190
1044
  const CODEX_MCP_LEGACY_BACKEND = "codex-mcp-legacy";
1191
1045
  const CodexBackendModeSchema = z__namespace.enum([
@@ -1849,6 +1703,25 @@ const sessionSummaryStateSchema = z__namespace.object({
1849
1703
  impactScope: z__namespace.array(z__namespace.string()).optional(),
1850
1704
  updatedAt: z__namespace.number()
1851
1705
  });
1706
+ const sessionSummaryRefreshActiveRequestSchema = z__namespace.object({
1707
+ requestId: z__namespace.string().min(1),
1708
+ requestedAt: z__namespace.number(),
1709
+ requester: z__namespace.enum(["happy-agent", "app", "system"]),
1710
+ command: z__namespace.literal("summary-refresh"),
1711
+ requireSummary: z__namespace.boolean()
1712
+ });
1713
+ const sessionSummaryRefreshRecentEntrySchema = z__namespace.object({
1714
+ requestId: z__namespace.string().min(1),
1715
+ status: z__namespace.enum(["applied", "superseded"]),
1716
+ resolvedAt: z__namespace.number(),
1717
+ summaryUpdatedAt: z__namespace.number().optional(),
1718
+ supersededByRequestId: z__namespace.string().min(1).optional()
1719
+ });
1720
+ const sessionSummaryRefreshStateSchema = z__namespace.object({
1721
+ protocolVersion: z__namespace.literal(1),
1722
+ active: sessionSummaryRefreshActiveRequestSchema.optional(),
1723
+ recent: z__namespace.array(sessionSummaryRefreshRecentEntrySchema).optional()
1724
+ });
1852
1725
 
1853
1726
  const HAPPY_MCP_TOOL_NAMES = [
1854
1727
  "change_title",
@@ -1921,7 +1794,10 @@ const HAPPY_MCP_TOOL_SPECS = {
1921
1794
  currentFocus: z.z.string().optional().describe("Brief description of the active task or phase"),
1922
1795
  keyDecisions: z.z.array(z.z.string()).optional().describe("Important choices already made this session"),
1923
1796
  openQuestions: z.z.array(z.z.string()).optional().describe("Unresolved questions or pending decisions"),
1924
- impactScope: z.z.array(z.z.string()).optional().describe("Modules/files/areas affected by this session's work")
1797
+ impactScope: z.z.array(z.z.string()).optional().describe("Modules/files/areas affected by this session's work"),
1798
+ requestId: z.z.string().optional().describe(
1799
+ "Optional request identifier that runtimes may record in sessionSummaryRefresh recent history for request-level confirmation"
1800
+ )
1925
1801
  },
1926
1802
  hideSuccessfulCall: false,
1927
1803
  autoApproveByDefault: true,
@@ -2079,15 +1955,9 @@ const CodexMetadataSchema = z__namespace.object({
2079
1955
  mcpServers: z__namespace.array(CodexMcpServerSummarySchema).optional()
2080
1956
  });
2081
1957
 
2082
- exports.AGENT_MSG_PRIORITIES = AGENT_MSG_PRIORITIES;
2083
- exports.AGENT_MSG_STATUSES = AGENT_MSG_STATUSES;
2084
- exports.AGENT_MSG_TYPES = AGENT_MSG_TYPES;
2085
1958
  exports.AIBackendProfileSchema = AIBackendProfileSchema;
2086
- exports.AcceptBodySchema = AcceptBodySchema;
2087
1959
  exports.AgentLoopSummarySchema = AgentLoopSummarySchema;
2088
1960
  exports.AgentMessageSchema = AgentMessageSchema;
2089
- exports.AgentMessageSummarySchema = AgentMessageSummarySchema;
2090
- exports.AgentMsgTypeSchema = AgentMsgTypeSchema;
2091
1961
  exports.AnthropicConfigSchema = AnthropicConfigSchema;
2092
1962
  exports.ApiMessageSchema = ApiMessageSchema;
2093
1963
  exports.ApiUpdateMachineStateSchema = ApiUpdateMachineStateSchema;
@@ -2104,8 +1974,6 @@ exports.AutomationJobStatusSchema = AutomationJobStatusSchema;
2104
1974
  exports.AutomationJobSummarySchema = AutomationJobSummarySchema;
2105
1975
  exports.AutomationPrioritySchema = AutomationPrioritySchema;
2106
1976
  exports.AutomationStateSchema = AutomationStateSchema;
2107
- exports.AutonomyStatsRecentActionSchema = AutonomyStatsRecentActionSchema;
2108
- exports.AutonomyStatsSchema = AutonomyStatsSchema;
2109
1977
  exports.AzureOpenAIConfigSchema = AzureOpenAIConfigSchema;
2110
1978
  exports.BUILT_IN_AI_BACKEND_PROFILE_IDS = BUILT_IN_AI_BACKEND_PROFILE_IDS;
2111
1979
  exports.BootstrapProfileSummarySchema = BootstrapProfileSummarySchema;
@@ -2140,7 +2008,6 @@ exports.CrossProjectSearchResultSchema = CrossProjectSearchResultSchema;
2140
2008
  exports.CustomModelSchema = CustomModelSchema;
2141
2009
  exports.DaemonStateSchema = DaemonStateSchema;
2142
2010
  exports.DefaultPermissionModeSchema = DefaultPermissionModeSchema;
2143
- exports.EVIDENCE_KINDS = EVIDENCE_KINDS;
2144
2011
  exports.EnvironmentVariableSchema = EnvironmentVariableSchema;
2145
2012
  exports.HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES = HAPPY_MCP_AUTO_APPROVE_TOOL_NAMES;
2146
2013
  exports.HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES = HAPPY_MCP_SILENT_SUCCESS_TOOL_NAMES;
@@ -2174,15 +2041,6 @@ exports.RESOLVED_RUNTIME_PROFILE_SCHEMA_VERSION = RESOLVED_RUNTIME_PROFILE_SCHEM
2174
2041
  exports.ResolvedRuntimeProfileSchema = ResolvedRuntimeProfileSchema;
2175
2042
  exports.RuntimeProfileSourceSchema = RuntimeProfileSourceSchema;
2176
2043
  exports.RuntimeProfileTrustSchema = RuntimeProfileTrustSchema;
2177
- exports.SUGGESTION_ACCEPT_AUDIT_RULES = SUGGESTION_ACCEPT_AUDIT_RULES;
2178
- exports.SUGGESTION_ACCEPT_SOURCES = SUGGESTION_ACCEPT_SOURCES;
2179
- exports.SUGGESTION_AUTO_ACCEPT_FAILURE_DETAILS = SUGGESTION_AUTO_ACCEPT_FAILURE_DETAILS;
2180
- exports.SUGGESTION_AUTO_ACCEPT_REASON_CODES = SUGGESTION_AUTO_ACCEPT_REASON_CODES;
2181
- exports.SUGGESTION_AUTO_ACCEPT_STATUSES = SUGGESTION_AUTO_ACCEPT_STATUSES;
2182
- exports.SUGGESTION_BUCKETS = SUGGESTION_BUCKETS;
2183
- exports.SUGGESTION_STATUSES = SUGGESTION_STATUSES;
2184
- exports.SUGGESTION_TYPES = SUGGESTION_TYPES;
2185
- exports.SUPERVISOR_MODES = SUPERVISOR_MODES;
2186
2044
  exports.SessionEventCreatedSchema = SessionEventCreatedSchema;
2187
2045
  exports.SessionEventReportSchema = SessionEventReportSchema;
2188
2046
  exports.SessionEventSummarySchema = SessionEventSummarySchema;
@@ -2192,13 +2050,6 @@ exports.SessionMessageSchema = SessionMessageSchema;
2192
2050
  exports.SessionProtocolMessageSchema = SessionProtocolMessageSchema;
2193
2051
  exports.SkillContentSchema = SkillContentSchema;
2194
2052
  exports.SkillSummarySchema = SkillSummarySchema;
2195
- exports.SuggestionAcceptAuditSchema = SuggestionAcceptAuditSchema;
2196
- exports.SuggestionDecisionPayloadSchema = SuggestionDecisionPayloadSchema;
2197
- exports.SuggestionEvidenceSchema = SuggestionEvidenceSchema;
2198
- exports.SuggestionGoalPayloadSchema = SuggestionGoalPayloadSchema;
2199
- exports.SuggestionPayloadSchema = SuggestionPayloadSchema;
2200
- exports.SuggestionSkillPayloadSchema = SuggestionSkillPayloadSchema;
2201
- exports.SuggestionTaskPayloadSchema = SuggestionTaskPayloadSchema;
2202
2053
  exports.TailscaleInfoSchema = TailscaleInfoSchema;
2203
2054
  exports.TailscaleServeEntrySchema = TailscaleServeEntrySchema;
2204
2055
  exports.TaskOutcomeSchema = TaskOutcomeSchema;
@@ -2229,8 +2080,6 @@ exports.VersionedNullableEncryptedValueSchema = VersionedNullableEncryptedValueS
2229
2080
  exports.VoiceTokenAllowedSchema = VoiceTokenAllowedSchema;
2230
2081
  exports.VoiceTokenDeniedSchema = VoiceTokenDeniedSchema;
2231
2082
  exports.VoiceTokenResponseSchema = VoiceTokenResponseSchema;
2232
- exports.WorldAutonomyPolicySchema = WorldAutonomyPolicySchema;
2233
- exports.WorldSuggestionUpdatedSchema = WorldSuggestionUpdatedSchema;
2234
2083
  exports.createEnvelope = createEnvelope;
2235
2084
  exports.createResolvedRuntimeProfile = createResolvedRuntimeProfile;
2236
2085
  exports.getBuiltInAIBackendProfile = getBuiltInAIBackendProfile;
@@ -2238,7 +2087,6 @@ exports.getHappyMcpToolAction = getHappyMcpToolAction;
2238
2087
  exports.getHappyMcpToolAliases = getHappyMcpToolAliases;
2239
2088
  exports.getHappyMcpToolTitle = getHappyMcpToolTitle;
2240
2089
  exports.getProfileEnvironmentVariables = getProfileEnvironmentVariables;
2241
- exports.getSuggestionPayloadSchema = getSuggestionPayloadSchema;
2242
2090
  exports.isCodexAppServerBackend = isCodexAppServerBackend;
2243
2091
  exports.isCodexLegacyBackend = isCodexLegacyBackend;
2244
2092
  exports.isHappyMcpToolAlias = isHappyMcpToolAlias;
@@ -2266,6 +2114,9 @@ exports.sessionServiceMessageEventSchema = sessionServiceMessageEventSchema;
2266
2114
  exports.sessionStartEventSchema = sessionStartEventSchema;
2267
2115
  exports.sessionStateChangedEventSchema = sessionStateChangedEventSchema;
2268
2116
  exports.sessionStopEventSchema = sessionStopEventSchema;
2117
+ exports.sessionSummaryRefreshActiveRequestSchema = sessionSummaryRefreshActiveRequestSchema;
2118
+ exports.sessionSummaryRefreshRecentEntrySchema = sessionSummaryRefreshRecentEntrySchema;
2119
+ exports.sessionSummaryRefreshStateSchema = sessionSummaryRefreshStateSchema;
2269
2120
  exports.sessionSummaryStateSchema = sessionSummaryStateSchema;
2270
2121
  exports.sessionTaskEndEventSchema = sessionTaskEndEventSchema;
2271
2122
  exports.sessionTaskLogEventSchema = sessionTaskLogEventSchema;