@xopcai/xopc 0.0.442 → 0.0.443

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.
Files changed (167) hide show
  1. package/dist/browser-ext/manifest.json +1 -1
  2. package/dist/extensions/telegram/src/plugin.js +1 -1
  3. package/dist/extensions/telegram/xopc.extension.json +1 -1
  4. package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-Chneosh4.js → agent-defaults-settings-panel-rH1QpgiR.js} +1 -1
  5. package/dist/gateway/static/root/assets/{agents-DKfOY5z9.js → agents-lvQfOQPN.js} +1 -1
  6. package/dist/gateway/static/root/assets/{api-ClZ7BrD4.js → api-snfMD8_Y.js} +1 -1
  7. package/dist/gateway/static/root/assets/{apps-page-CBLj-m2k.js → apps-page-C3iDd3ZQ.js} +1 -1
  8. package/dist/gateway/static/root/assets/automation-task-card-CKbHMLSy.js +3 -0
  9. package/dist/gateway/static/root/assets/{automations-page-CYngiwxI.js → automations-page-BDHgk3CW.js} +1 -1
  10. package/dist/gateway/static/root/assets/{automations-workspace-zyhyqSdH.js → automations-workspace-B7D9U89Z.js} +2 -2
  11. package/dist/gateway/static/root/assets/{capabilities-oWWLfwf3.js → capabilities-DDJJhQ40.js} +1 -1
  12. package/dist/gateway/static/root/assets/{capabilities-BpYi2fQO.js → capabilities-DJYgOjeq.js} +1 -1
  13. package/dist/gateway/static/root/assets/{capabilities-page-Dlgwv1dI.js → capabilities-page-CBqvHAyp.js} +2 -2
  14. package/dist/gateway/static/root/assets/{capabilities-settings-panel-CslXPIs8.js → capabilities-settings-panel-wjezs0OE.js} +1 -1
  15. package/dist/gateway/static/root/assets/{channels-P-xOLYBz.js → channels-D4q8hiD0.js} +1 -1
  16. package/dist/gateway/static/root/assets/{chat-page-Cen4dGHa.js → chat-page-CAt7FyMT.js} +5 -5
  17. package/dist/gateway/static/root/assets/{chat-terminal-dock-DTQL2DBu.js → chat-terminal-dock-D9o0nUEV.js} +1 -1
  18. package/dist/gateway/static/root/assets/{composer-payload-handoff-B1GFVFK_.js → composer-payload-handoff-CoDWKzBm.js} +1 -1
  19. package/dist/gateway/static/root/assets/{connected-providers-grid-sULM6YyQ.js → connected-providers-grid-C5-3MDIj.js} +1 -1
  20. package/dist/gateway/static/root/assets/{connectors-page-DN9BOiFk.js → connectors-page-QVWuoxuK.js} +1 -1
  21. package/dist/gateway/static/root/assets/constants-CsVXarqA.js +1 -0
  22. package/dist/gateway/static/root/assets/{extension-debug-page-D2Dhtu6H.js → extension-debug-page-CDZfdMAR.js} +1 -1
  23. package/dist/gateway/static/root/assets/{extension-iframe-host-Dra7k_6o.js → extension-iframe-host-CG70QWPS.js} +1 -1
  24. package/dist/gateway/static/root/assets/{extension-page-Dd16lQg-.js → extension-page-DpJTL6-v.js} +1 -1
  25. package/dist/gateway/static/root/assets/{extension-provider-C4WwnCxf.js → extension-provider-BZTbdvCF.js} +1 -1
  26. package/dist/gateway/static/root/assets/{extension-settings-page-BHwQ2ipj.js → extension-settings-page-CC4rmiFC.js} +1 -1
  27. package/dist/gateway/static/root/assets/{home-page-D-gy9LlQ.js → home-page-CpbsTucI.js} +2 -2
  28. package/dist/gateway/static/root/assets/{index-CqQZfWRQ.js → index-CbhkKfcy.js} +5 -5
  29. package/dist/gateway/static/root/assets/{index-D7Noveui.css → index-DE2bG5EI.css} +1 -1
  30. package/dist/gateway/static/root/assets/{local-app-workbench-page-Drbzz4Lm.js → local-app-workbench-page-CE46mHc0.js} +1 -1
  31. package/dist/gateway/static/root/assets/{note-detail-panel-BQdgpm0s.js → note-detail-panel-DWIWloib.js} +1 -1
  32. package/dist/gateway/static/root/assets/{notes-page-IefutMyg.js → notes-page-DIugUbkV.js} +1 -1
  33. package/dist/gateway/static/root/assets/{page-context-capture-button-DDmLslYG.js → page-context-capture-button-B9L7V_n2.js} +1 -1
  34. package/dist/gateway/static/root/assets/{personal-page-DkrDSJqk.js → personal-page-Dah3dgRQ.js} +1 -1
  35. package/dist/gateway/static/root/assets/{product-preview-content-COU6H_jO.js → product-preview-content-CGbqoID0.js} +1 -1
  36. package/dist/gateway/static/root/assets/{product-preview-modal-Ct5q4tv6.js → product-preview-modal-0wvIDcVr.js} +2 -2
  37. package/dist/gateway/static/root/assets/{project-detail-page-CQj7nm6I.js → project-detail-page-VPcXR1YD.js} +2 -2
  38. package/dist/gateway/static/root/assets/{projects-page-sWxQJrFS.js → projects-page-BsgZb6n9.js} +1 -1
  39. package/dist/gateway/static/root/assets/{route-preload-CDQtPdgq.js → route-preload-Blmi-1Iq.js} +2 -2
  40. package/dist/gateway/static/root/assets/{session-manager-Czu9GpZX.js → session-manager-ChHnJOWW.js} +1 -1
  41. package/dist/gateway/static/root/assets/{sessions-page-CGkbbrz-.js → sessions-page-BM-oqd22.js} +1 -1
  42. package/dist/gateway/static/root/assets/{settings-page-zGjDXdHY.js → settings-page-CMSYmtOu.js} +1 -1
  43. package/dist/gateway/static/root/assets/{share-preview-page-Bs3VjTGj.js → share-preview-page-CFebGqyB.js} +1 -1
  44. package/dist/gateway/static/root/assets/{shares-settings-BseSozxm.js → shares-settings-B-7la3QN.js} +1 -1
  45. package/dist/gateway/static/root/assets/sliding-tab-list-CmcrqRzN.js +1 -0
  46. package/dist/gateway/static/root/assets/task-detail-page-BuP1vEuu.js +3 -0
  47. package/dist/gateway/static/root/assets/{task-result-evidence-BNhYqUAa.js → task-result-evidence-B1MHhqVR.js} +1 -1
  48. package/dist/gateway/static/root/assets/{tasks-DRmd6sWt.js → tasks-D_xuHn6V.js} +1 -1
  49. package/dist/gateway/static/root/assets/{tracing-settings-page-CMtFem_g.js → tracing-settings-page-B_Xdc2VF.js} +1 -1
  50. package/dist/gateway/static/root/assets/{usage-page-BO2OFCoA.js → usage-page-DqzosTxy.js} +1 -1
  51. package/dist/gateway/static/root/assets/{use-composer-attachments-DA6SxZPQ.js → use-composer-attachments-Brdrrzrp.js} +1 -1
  52. package/dist/gateway/static/root/assets/{use-file-preview-expanded-g4SwMHbx.js → use-file-preview-expanded-9DED7ohY.js} +1 -1
  53. package/dist/gateway/static/root/assets/{use-workspace-tree-DG5ZMfaY.js → use-workspace-tree-Dq0qgK3N.js} +1 -1
  54. package/dist/gateway/static/root/assets/{user-model-page-B5_01fi_.js → user-model-page-Ziz55hVM.js} +1 -1
  55. package/dist/gateway/static/root/assets/{voice-transcribe-api-Cc92OabY.js → voice-transcribe-api-Bf9FaI-p.js} +1 -1
  56. package/dist/gateway/static/root/assets/{workspace-api-fKmmIslV.js → workspace-api-DrVss2Fd.js} +2 -2
  57. package/dist/gateway/static/root/assets/{workspace-file-preview-dialog-C_0lUEsm.js → workspace-file-preview-dialog-C2egBzza.js} +1 -1
  58. package/dist/gateway/static/root/assets/{workspace-open-location-menu-BznuSmFZ.js → workspace-open-location-menu-XFUtwfLY.js} +1 -1
  59. package/dist/gateway/static/root/index.html +24 -24
  60. package/dist/package.js +1 -1
  61. package/dist/packages/gateway-contract/src/task-research-result.js +1 -0
  62. package/dist/packages/gateway-contract/src/tasks.js +1 -1
  63. package/dist/src/agent/embedded/execution-tool-policy.d.ts +1 -1
  64. package/dist/src/agent/embedded/execution-tool-policy.js +2 -1
  65. package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
  66. package/dist/src/agent/tool-manuals/xopc-use.js +3 -0
  67. package/dist/src/agent/tools/factory.js +1 -0
  68. package/dist/src/agent/tools/personal-request-result-tool.js +2 -2
  69. package/dist/src/agent/tools/personal-request-tool.js +4 -1
  70. package/dist/src/agent/tools/personal-task-tool.d.ts +1 -0
  71. package/dist/src/agent/tools/personal-task-tool.js +4 -0
  72. package/dist/src/agent/tools/xopc-use-tool.js +10 -1
  73. package/dist/src/automations/capabilities/write.d.ts +6 -6
  74. package/dist/src/automations/domain/validation.d.ts +12 -12
  75. package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
  76. package/dist/src/channels/index.js +1 -1
  77. package/dist/src/channels/manager.js +1 -1
  78. package/dist/src/cli/commands/connectors.js +1 -1
  79. package/dist/src/cli/commands/extension-dev.js +1 -1
  80. package/dist/src/cli/commands/extension-marketplace.js +2 -2
  81. package/dist/src/cli/commands/extension.js +1 -1
  82. package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
  83. package/dist/src/cli/commands/models.js +2 -2
  84. package/dist/src/cli/commands/onboard/model.js +3 -3
  85. package/dist/src/cli/commands/onboard.js +1 -1
  86. package/dist/src/cli/commands/tunnel.js +1 -1
  87. package/dist/src/cli/commands/update.js +1 -1
  88. package/dist/src/extensions/sdk/index.js +1 -1
  89. package/dist/src/gateway/hono/app.js +1 -1
  90. package/dist/src/gateway/hono/middleware/auth.js +1 -1
  91. package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
  92. package/dist/src/gateway/hono/routes/desktop-host.js +1 -1
  93. package/dist/src/gateway/hono/routes/exposure.js +1 -1
  94. package/dist/src/gateway/hono/routes/files.js +2 -2
  95. package/dist/src/gateway/hono/routes/imports.js +1 -1
  96. package/dist/src/gateway/hono/routes/local-apps.js +1 -1
  97. package/dist/src/gateway/hono/routes/logs.js +1 -1
  98. package/dist/src/gateway/hono/routes/models.js +5 -5
  99. package/dist/src/gateway/hono/routes/notes.js +1 -1
  100. package/dist/src/gateway/hono/routes/personal-agent.js +2 -2
  101. package/dist/src/gateway/hono/routes/phone-setup.js +1 -1
  102. package/dist/src/gateway/hono/routes/projects.js +1 -1
  103. package/dist/src/gateway/hono/routes/runtime-tools.js +1 -1
  104. package/dist/src/gateway/hono/routes/sessions.js +1 -1
  105. package/dist/src/gateway/hono/routes/shares.js +5 -5
  106. package/dist/src/gateway/hono/routes/status.js +1 -1
  107. package/dist/src/gateway/hono/routes/tasks.js +1 -1
  108. package/dist/src/gateway/hono/routes/tunnel.js +2 -2
  109. package/dist/src/gateway/hono/routes/update.js +2 -2
  110. package/dist/src/gateway/hono/routes/voice.js +1 -1
  111. package/dist/src/gateway/index.js +2 -2
  112. package/dist/src/gateway/next-turn-suggestions/snapshot.js +11 -3
  113. package/dist/src/gateway/provider-model-setup.js +1 -1
  114. package/dist/src/gateway/run-loop.js +2 -2
  115. package/dist/src/gateway/security/audit.js +1 -1
  116. package/dist/src/gateway/security/index.js +2 -2
  117. package/dist/src/gateway/server.js +1 -1
  118. package/dist/src/gateway/service/agent-runner.js +1 -1
  119. package/dist/src/gateway/service/run-gateway-agent.js +2 -2
  120. package/dist/src/gateway/service/sessions-api.js +1 -1
  121. package/dist/src/gateway/service.js +33 -33
  122. package/dist/src/gateway/side-chat/run-service.js +1 -1
  123. package/dist/src/home-intelligence/application-service.js +1 -1
  124. package/dist/src/home-intelligence/host.js +2 -2
  125. package/dist/src/infra/gateway-processes.js +1 -1
  126. package/dist/src/infra/update-restart.js +1 -1
  127. package/dist/src/infra/update-runner.js +2 -2
  128. package/dist/src/infra/update-startup.js +1 -1
  129. package/dist/src/notifications/service.js +2 -2
  130. package/dist/src/personal-agent/communication.d.ts +1 -1
  131. package/dist/src/personal-agent/communication.js +2 -2
  132. package/dist/src/personal-agent/reply-style.d.ts +1 -1
  133. package/dist/src/personal-agent/reply-style.js +3 -1
  134. package/dist/src/personal-agent/request-delivery.js +1 -5
  135. package/dist/src/personal-agent/request-repository.d.ts +1 -0
  136. package/dist/src/personal-agent/request-service.d.ts +1 -0
  137. package/dist/src/personal-agent/request-service.js +12 -3
  138. package/dist/src/personal-agent/request-verification.d.ts +6 -0
  139. package/dist/src/personal-agent/request-verification.js +22 -0
  140. package/dist/src/phone/stream-gateway.js +1 -1
  141. package/dist/src/providers/setup/voice.js +1 -1
  142. package/dist/src/realtime/runtime.js +1 -1
  143. package/dist/src/remote-access/exposure-manager.js +1 -1
  144. package/dist/src/share/site-share-router.js +2 -2
  145. package/dist/src/tasks/task-allocation-service.js +4 -2
  146. package/dist/src/tasks/task-application-service.js +4 -1
  147. package/dist/src/tasks/task-context-assembler.js +3 -1
  148. package/dist/src/tasks/task-contract-definition.d.ts +1 -0
  149. package/dist/src/tasks/task-contract-planner.js +3 -0
  150. package/dist/src/tasks/task-main-update-decision-service.js +7 -7
  151. package/dist/src/tasks/task-main-update-delivery.js +15 -2
  152. package/dist/src/tasks/task-repository.js +1 -1
  153. package/dist/src/tasks/task-research-repair.d.ts +1 -0
  154. package/dist/src/tasks/task-research-repair.js +3 -1
  155. package/dist/src/tasks/task-research-result.js +19 -1
  156. package/dist/src/tasks/task-run-coordinator.js +12 -9
  157. package/dist/src/tui/backends/embedded-backend.js +3 -3
  158. package/dist/src/tunnel/gateway-lifecycle.js +1 -1
  159. package/dist/src/voice/realtime/runtime.js +1 -1
  160. package/dist/src/work-discovery/index.js +2 -2
  161. package/dist/src/work-discovery/investigator.js +1 -1
  162. package/dist/src/work-discovery/service.js +3 -3
  163. package/package.json +2 -2
  164. package/dist/gateway/static/root/assets/automation-task-card-DLg-LYCm.js +0 -3
  165. package/dist/gateway/static/root/assets/constants-DBtMsXdW.js +0 -1
  166. package/dist/gateway/static/root/assets/sliding-tab-list-DuQyViqe.js +0 -1
  167. package/dist/gateway/static/root/assets/task-detail-page-CwMpmFVS.js +0 -3
@@ -82,8 +82,6 @@ import "../infra/bus/index.js";
82
82
  import { collectMediaUrisFromMessages, deleteMediaUris } from "../media/session-references.js";
83
83
  import { AgentService } from "../agent/service.js";
84
84
  import { bootstrapApplicationStateSync } from "../bootstrap/application-state.js";
85
- import { registerClarificationChannelRuntime } from "./clarify-runtime.js";
86
- import { ChannelManager } from "../channels/manager.js";
87
85
  import { ChatPreviewService } from "../chat-previews/service.js";
88
86
  import "../chat-previews/index.js";
89
87
  import { configureGatewayHttpProxy } from "../infra/http-proxy-env.js";
@@ -103,58 +101,47 @@ import { DiscussionSealer } from "../discussions/sealer.js";
103
101
  import "../discussions/index.js";
104
102
  import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
105
103
  import "../endpoint-tools/index.js";
106
- import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
107
- import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
108
- import { HomeIntelligenceHost } from "../home-intelligence/host.js";
109
- import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
110
- import { createBackgroundTask } from "../infra/background-task.js";
111
- import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
112
- import "../local-apps/index.js";
113
- import "../notes/index.js";
114
- import { NotificationService } from "../notifications/service.js";
115
- import { allowsPersonalTaskNotification, personalReplyNotification, personalRunDelegated } from "../personal-agent/notifications.js";
116
- import { PhoneStreamGateway } from "../phone/stream-gateway.js";
117
- import { RealtimeRuntime } from "../realtime/runtime.js";
118
- import { getXopcCloudCatalogCoordinator } from "../providers/xopc-cloud-catalog-coordinator.js";
119
- import { ModelCatalogSyncService } from "../providers/model-catalog-sync-service.js";
120
- import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
121
104
  import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
122
- import { wireTunnelEventsToGateway } from "../tunnel/gateway-lifecycle.js";
123
- import { getExposureManager } from "../remote-access/exposure-manager.js";
124
- import { assertGatewayRuntimeConfig } from "./runtime-config.js";
125
- import { auditGatewayConfig } from "./security/audit.js";
126
- import { TaskAllocationDispatcher } from "../tasks/task-allocation-service.js";
127
- import { TaskCollaborationDelivery } from "../tasks/task-collaboration-delivery.js";
128
- import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decision-service.js";
129
- import { TaskMainUpdateExhaustedError } from "../tasks/task-main-update-retry.js";
130
- import { TaskMainUpdateDelivery } from "../tasks/task-main-update-delivery.js";
131
- import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
132
- import { TaskResultDeliveryService } from "../tasks/task-result-delivery-service.js";
133
- import { sanitizeTunnelConfig } from "../tunnel/tunnel-config.js";
134
- import { voiceMemoryBudget, voicePersonaBudget } from "../voice/realtime/conversation-context.js";
135
- import { VoiceRealtimeRuntime } from "../voice/realtime/runtime.js";
136
- import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
137
- import { WorkDiscoveryService } from "../work-discovery/service.js";
138
105
  import { prepareAutomationAgentSession } from "./automation-agent-session.js";
139
106
  import { deliverAutomationCompletion } from "./automation-completion-delivery.js";
107
+ import { registerClarificationChannelRuntime } from "./clarify-runtime.js";
108
+ import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
140
109
  import { getGatewayFileSpaceService } from "./file-space-service.js";
141
110
  import { reconcileHomeIntelligenceAutomation } from "./home-intelligence-automation-reconciler.js";
142
111
  import { createPhoneSetupService } from "./hono/routes/phone-setup.js";
143
112
  import { BrowserSetupService } from "../browser/setup/service.js";
144
113
  import { McpConversationSetup } from "../agent/mcp/conversation-setup.js";
145
114
  import { withGatewayConfigWriteLock } from "./hono/lib/config-write-lock.js";
115
+ import { PhoneStreamGateway } from "../phone/stream-gateway.js";
146
116
  import { PersonalProactivityService } from "../personal-agent/proactivity/service.js";
147
117
  import { reconcilePersonalProactivityAutomation } from "../personal-agent/proactivity/automation.js";
118
+ import { createBackgroundTask } from "../infra/background-task.js";
148
119
  import { buildFileAgentContext } from "../agent/source-context/file-context.js";
149
120
  import { buildSessionAgentContext } from "../agent/source-context/session-context.js";
150
121
  import { buildBrowserTabAgentContext } from "../agent/source-context/browser-tab.js";
122
+ import { WorkDiscoveryService } from "../work-discovery/service.js";
151
123
  import { buildVoiceMemoryContext } from "../voice/realtime/memory-context.js";
152
124
  import { buildVoicePersonaContext } from "../voice/realtime/persona-context.js";
125
+ import { voiceMemoryBudget, voicePersonaBudget } from "../voice/realtime/conversation-context.js";
126
+ import { ChannelManager } from "../channels/manager.js";
127
+ import "../notes/index.js";
153
128
  import { EphemeralSideChatManager } from "./side-chat/manager.js";
154
129
  import { SideChatRunService } from "./side-chat/run-service.js";
155
130
  import { SideChatPromotionService } from "./side-chat/promotion-service.js";
156
131
  import "./side-chat/index.js";
132
+ import { wireTunnelEventsToGateway } from "../tunnel/gateway-lifecycle.js";
133
+ import { getExposureManager } from "../remote-access/exposure-manager.js";
134
+ import { sanitizeTunnelConfig } from "../tunnel/tunnel-config.js";
157
135
  import { assertGatewayAuthNotKnownWeak } from "./security/known-weak-secrets.js";
136
+ import { assertGatewayRuntimeConfig } from "./runtime-config.js";
137
+ import { auditGatewayConfig } from "./security/audit.js";
138
+ import { getXopcCloudCatalogCoordinator } from "../providers/xopc-cloud-catalog-coordinator.js";
139
+ import { ModelCatalogSyncService } from "../providers/model-catalog-sync-service.js";
140
+ import { NotificationService } from "../notifications/service.js";
141
+ import "../local-apps/index.js";
142
+ import { TaskAllocationDispatcher } from "../tasks/task-allocation-service.js";
143
+ import { TaskResultDeliveryService } from "../tasks/task-result-delivery-service.js";
144
+ import { scheduleGatewayUpdateCheck } from "../infra/update-startup.js";
158
145
  import { resolveChannelConnectDeferSet } from "./resolve-channel-connect-defer.js";
159
146
  import { restartGatewayProcessWithFreshPid } from "./respawn.js";
160
147
  import { GatewaySessionsApi } from "./service/sessions-api.js";
@@ -163,11 +150,24 @@ import { GatewayConfigCoordinator } from "./service/config-coordinator.js";
163
150
  import { GatewayAgentRunner } from "./service/agent-runner.js";
164
151
  import { SessionPreparationWorker } from "./service/session-preparation-worker.js";
165
152
  import { isBrowserSessionActive } from "../storage/sqlite/browser-session-repository.js";
153
+ import { RealtimeRuntime } from "../realtime/runtime.js";
154
+ import { VoiceRealtimeRuntime } from "../voice/realtime/runtime.js";
166
155
  import { DurableVoiceAgentBroker } from "../voice/realtime/agentBroker.js";
167
156
  import { reconcileMemoryMaintenanceAutomations } from "./memory-maintenance-automation-reconciler.js";
168
157
  import { GatewayReadiness } from "./startup-readiness.js";
169
158
  import { createGatewayStartupTrace } from "./startup-trace.js";
159
+ import { TaskCollaborationDelivery } from "../tasks/task-collaboration-delivery.js";
160
+ import { TaskMainUpdateExhaustedError } from "../tasks/task-main-update-retry.js";
161
+ import { TaskMainUpdateDelivery } from "../tasks/task-main-update-delivery.js";
162
+ import { allowsPersonalTaskNotification, personalReplyNotification, personalRunDelegated } from "../personal-agent/notifications.js";
163
+ import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decision-service.js";
164
+ import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
170
165
  import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
166
+ import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
167
+ import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
168
+ import { HomeIntelligenceHost } from "../home-intelligence/host.js";
169
+ import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
170
+ import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
171
171
  import crypto from "node:crypto";
172
172
  //#region src/gateway/service.ts
173
173
  init_session_repository();
@@ -3,8 +3,8 @@ import { init_logger } from "../../utils/logger.js";
3
3
  import { readClarificationPresentation } from "../../../packages/gateway-contract/src/clarifications.js";
4
4
  import { init_src } from "../../../packages/gateway-contract/src/index.js";
5
5
  import { abortEmbeddedRun } from "../../agent/embedded/runs.js";
6
- import { ChatStreamMapper } from "../chat-stream/mapper.js";
7
6
  import { SideChatError } from "./manager.js";
7
+ import { ChatStreamMapper } from "../chat-stream/mapper.js";
8
8
  import { randomUUID } from "node:crypto";
9
9
  //#region src/gateway/side-chat/run-service.ts
10
10
  init_src();
@@ -49,7 +49,7 @@ var HomeOpportunityApplicationService = class {
49
49
  approvalRequired: [],
50
50
  assumptions: [],
51
51
  risks: [opportunity.risk],
52
- acceptancePolicy: "verified_then_review",
52
+ acceptancePolicy: "verified_auto",
53
53
  outputDestinations: []
54
54
  },
55
55
  dependencies: [],
@@ -1,10 +1,10 @@
1
1
  import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
+ import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
3
4
  import { homePatternKey } from "./strategy.js";
5
+ import { HomeAdvicePolicy } from "./policy.js";
4
6
  import { HomeIntelligenceRepository } from "./repository.js";
5
7
  import { HomeOpportunityApplicationService } from "./application-service.js";
6
- import { HomeAdvicePolicy } from "./policy.js";
7
- import { HomeAdviceBudgetExceededError, isHomeProseLocalized } from "./generator.js";
8
8
  import { buildHomeOpportunityNotification } from "./notification.js";
9
9
  import { createHash } from "node:crypto";
10
10
  //#region src/home-intelligence/host.ts
@@ -1,5 +1,5 @@
1
- import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
2
1
  import { listPortListeners } from "../gateway/ports.js";
2
+ import { isGatewayArgv, parseProcCmdline } from "./gateway-process-argv.js";
3
3
  import fs from "node:fs";
4
4
  import { spawnSync } from "node:child_process";
5
5
  //#region src/infra/gateway-processes.ts
@@ -4,8 +4,8 @@ import { init_paths, resolveConfigPath } from "../config/paths.js";
4
4
  import { loadConfig } from "../config/loader.js";
5
5
  import { isRestartEnabled } from "../config/commands.flags.js";
6
6
  import { resolveGatewayService } from "../daemon/service.js";
7
- import { findVerifiedGatewayListenerPidsOnPortSync, signalVerifiedGatewayPidSync } from "./gateway-processes.js";
8
7
  import { authorizeGatewaySigusr1Restart, writeGatewayRestartIntentSync } from "./restart.js";
8
+ import { findVerifiedGatewayListenerPidsOnPortSync, signalVerifiedGatewayPidSync } from "./gateway-processes.js";
9
9
  import { refreshGatewayServiceAfterUpdate } from "./update-service-refresh.js";
10
10
  //#region src/infra/update-restart.ts
11
11
  /**
@@ -1,12 +1,12 @@
1
1
  import { PACKAGE_VERSION, init_package_version } from "../package-version.js";
2
2
  import { runPostUpdateExtensionSync } from "../extensions/update.js";
3
+ import "./update-channels.js";
4
+ import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
3
5
  import { readPackageName, readPackageVersion } from "./package-json.js";
4
6
  import { runCommandWithTimeout } from "./run-command.js";
5
7
  import { XOPC_PACKAGE_NAME, cleanupGlobalRenameDirs, createGlobalInstallEnv, detectGlobalInstallManagerForRoot, resolveGlobalInstallSpec, resolveGlobalInstallTarget } from "./update-global.js";
6
8
  import { runGlobalPackageUpdateSteps } from "./package-update-steps.js";
7
9
  import { resolveStableNodePath } from "./stable-node-path.js";
8
- import "./update-channels.js";
9
- import { compareSemver, resolveNpmChannelTag } from "./update-check.js";
10
10
  import { trimLogTail } from "./update-log.js";
11
11
  import { maybeRestartGatewayAfterUpdate, prepareGatewayRestart } from "./update-restart.js";
12
12
  import path from "node:path";
@@ -3,9 +3,9 @@ import { init_paths_state, resolveUpdateCheckStatePath } from "../config/paths-s
3
3
  import { createLogger } from "../utils/logger/index.js";
4
4
  import { init_logger } from "../utils/logger.js";
5
5
  import { init_write_file_atomic, writeTextAtomic } from "./write-file-atomic.js";
6
+ import { acquireUpdateLock } from "./update-lock.js";
6
7
  import { normalizeUpdateChannel } from "./update-channels.js";
7
8
  import { compareSemver, detectInstallKind, resolveNpmChannelTag, resolvePackageRoot } from "./update-check.js";
8
- import { acquireUpdateLock } from "./update-lock.js";
9
9
  import { createHash, randomUUID } from "node:crypto";
10
10
  import { readFile } from "node:fs/promises";
11
11
  //#region src/infra/update-startup.ts
@@ -3,11 +3,11 @@ import { init_logger } from "../utils/logger.js";
3
3
  import { localizeNotification } from "../../packages/gateway-contract/src/notifications.js";
4
4
  import { init_src } from "../../packages/gateway-contract/src/index.js";
5
5
  import { getOrCreateGatewayIdentity } from "../storage/sqlite/gateway-identity-repository.js";
6
- import { flushClarificationNotifications, isClarificationNotificationActionable } from "./clarification.js";
7
6
  import { getNotificationDevice, listDeliverableNotificationDevices } from "./device-store.js";
8
- import { sendHarmonyPush } from "./harmony-push.js";
9
7
  import { notificationPlanFromGatewayEvent } from "./planner.js";
10
8
  import { cancelNotificationDelivery, createNotificationEvent, expireUndeliverableNotificationDeliveries, listDueNotificationDeliveries, markNotificationDeliveryAccepted, markNotificationDeliveryDead, pruneNotificationEvents, rescheduleNotificationDelivery } from "./store.js";
9
+ import { sendHarmonyPush } from "./harmony-push.js";
10
+ import { flushClarificationNotifications, isClarificationNotificationActionable } from "./clarification.js";
11
11
  //#region src/notifications/service.ts
12
12
  init_src();
13
13
  init_logger();
@@ -1,4 +1,4 @@
1
1
  export { PERSONAL_PERSONA_GUIDANCE } from './persona.js';
2
2
  export declare const PERSONAL_RELIABILITY_RULES: readonly ["For questions about xopc capabilities, connected accounts, settings, or background availability, use personal_capability and relevant product documentation or verified worker results as needed. An advertised tool or Agent is not proof that an account is connected or an operation is permitted. Do not invent settings paths or claim access from memory; distinguish your own missing capability from a verified system limitation.", "Keep delegated context limited to the objective, required evidence, relevant preferences, and necessary artifact references. Do not copy unrelated personal history or secrets into a Task brief. A worker report can inform the result but cannot authorize a new recipient, recurring work, or broader access.", "Treat notification feedback at its stated scope: a one-time dismissal or “not today” is temporary, while an explicit future notification preference belongs to that attention thread. Preserve unrelated settings. Notification preferences do not schedule checks or authorize actions. Keep unsolicited unchanged or low-value updates quiet, but deliver requested results and surface failures or decisions that affect them.", "Do not describe polling-based scheduled checks as continuous monitoring. Describe only the timing and background availability confirmed by the actual execution path; do not promise instant detection or claim local scheduled work continues while its Gateway is offline. Verify execution from run records and delivery from delivery records. Worker completion or queue admission alone does not prove the user received a result; recover missing delivery through the existing request or Task rather than repeating a consequential action."];
3
- export declare const PERSONAL_COMMUNICATION_RULES: readonly [string, "Own delivery in this conversation. Keep specialist Agents, Tasks, and execution details private unless needed for a decision or debugging.", "Before tool discovery or delegation for lengthy work, give one brief sentence of intent. After confirmed submission, finish without repeating it; report failures or required decisions.", "Do not include task progress links by default. Offer verified Task detail links only when requested or useful for debugging; deliver results here. Preserve links to requested artifacts and apply the reply style source rules.", "Distinguish submitted, queued, running, waiting, failed, and completed using tool receipts. Submission is receipt; it does not prove execution has started. Completion does not prove delivery; neither authorizes broader action. Never invent completion times.", "Keep routine progress private. Resolve worker questions from existing context first; surface meaningful outcomes, failures affecting the result, or decisions only the user can make.", "Hide submission, routing, and queue/start narration. Use the task card for routine status.", "Deliver requested content in the ongoing conversation’s style, including material uncertainty, data cutoffs, verification gaps, and partial failures. Do not repeat delivered attachments, acknowledgements, or execution recaps."];
3
+ export declare const PERSONAL_COMMUNICATION_RULES: readonly [string, "Own delivery in this conversation. Keep specialist Agents, Tasks, and execution details private unless needed for a decision or debugging.", "Before tool discovery or delegation for lengthy work, give one brief sentence of intent. After confirmed submission, finish without repeating it; report final failures, significant delays or required user decisions.", "Do not include task progress links by default. Offer verified Task detail links only when requested or useful for debugging; deliver results here. Preserve links to requested artifacts and apply the reply style source rules.", "Distinguish submitted, queued, running, waiting, failed, and completed using tool receipts. Submission is receipt; it does not prove execution has started. Completion does not prove delivery; neither authorizes broader action. Never invent completion times.", "Keep routine progress private. Resolve worker questions from existing context first; silently recover internal failures within existing authorization. Surface final outcomes, material partial failures, significant delays supported by actual timing evidence, or decisions only the user can make. Do not announce retries or successful recovery unless asked; return NO_REPLY for an internal update with no remaining user-facing impact.", "Hide submission, routing, and queue/start narration. Use the task card for routine status.", "Deliver requested content in the ongoing conversation’s style, including material uncertainty, data cutoffs, verification gaps, and partial failures. Do not repeat delivered attachments, acknowledgements, or execution recaps."];
4
4
  export { PERSONAL_WORKER_RESULT_GUIDANCE } from '@xopcai/gateway-contract';
@@ -12,10 +12,10 @@ const PERSONAL_RELIABILITY_RULES = [
12
12
  const PERSONAL_COMMUNICATION_RULES = [
13
13
  PERSONAL_PERSONA_GUIDANCE,
14
14
  "Own delivery in this conversation. Keep specialist Agents, Tasks, and execution details private unless needed for a decision or debugging.",
15
- "Before tool discovery or delegation for lengthy work, give one brief sentence of intent. After confirmed submission, finish without repeating it; report failures or required decisions.",
15
+ "Before tool discovery or delegation for lengthy work, give one brief sentence of intent. After confirmed submission, finish without repeating it; report final failures, significant delays or required user decisions.",
16
16
  "Do not include task progress links by default. Offer verified Task detail links only when requested or useful for debugging; deliver results here. Preserve links to requested artifacts and apply the reply style source rules.",
17
17
  "Distinguish submitted, queued, running, waiting, failed, and completed using tool receipts. Submission is receipt; it does not prove execution has started. Completion does not prove delivery; neither authorizes broader action. Never invent completion times.",
18
- "Keep routine progress private. Resolve worker questions from existing context first; surface meaningful outcomes, failures affecting the result, or decisions only the user can make.",
18
+ "Keep routine progress private. Resolve worker questions from existing context first; silently recover internal failures within existing authorization. Surface final outcomes, material partial failures, significant delays supported by actual timing evidence, or decisions only the user can make. Do not announce retries or successful recovery unless asked; return NO_REPLY for an internal update with no remaining user-facing impact.",
19
19
  "Hide submission, routing, and queue/start narration. Use the task card for routine status.",
20
20
  "Deliver requested content in the ongoing conversation’s style, including material uncertainty, data cutoffs, verification gaps, and partial failures. Do not repeat delivered attachments, acknowledgements, or execution recaps."
21
21
  ];
@@ -1,2 +1,2 @@
1
- export declare const PERSONAL_REPLY_STYLE_RULES: readonly ["Preserve a failed operation as a failure in every rewrite and summary. Say that it failed or could not be completed; do not soften it into merely no findings, waiting or still checking. Hiding internal dispatch details must never hide the failure. Keep known partial results and whether a retry actually started; do not imply an automatic retry or continuation.", "Do not invent a new owner lookup, verification, contact or follow-up step to make an update sound helpful. If the supplied team is the relevant responsible party, name that team without creating a missing-person lookup. An unknown detail does not authorize you to investigate it. Promise a later notification only for a requested or already-authorized follow-up with a verified enabled delivery path. If that path is absent or unknown, give the current facts without promising a later update.", "Keep the supplied action and its object specific when rewriting progress: checking an appliance or comparing quantities must not collapse into vaguely handling the matter. Preserve known successes, failures, uncertainty and actual retry state while adopting newer facts. Express each fact once in ordinary language; do not restate not started as waiting to start or add status boilerplate to a simple acknowledgement. Precision must still read like a natural reply, not a checklist.", "Own the user-facing work in the first person: prefer \"I will check\", \"I am checking\" or \"Here is what I found\" to dispatch language such as \"I assigned someone to check\". Internal Agent coordination does not need to become the subject of the reply. Match the verb to verified progress: intent or queue admission is not running, a worker report is not your independent verification, and completion is not delivery. Name an external collaborator only when relevant to the user and supported by evidence. Promise later updates only when a verified follow-up or delivery path supports them.", "Be concise by default and answer narrow follow-ups narrowly. Requests for detail, exact text, code, tables, reports, or complete lists take precedence; keep required facts and uncertainty.", "Use short paragraphs and useful structure. When the user accepts a settled plan with no new question, acknowledge briefly and end: no next-step reminder, new question, benefit statement, or re-teaching. Answer new substantive requests normally.", "Interpret short replies in context; an acknowledgement is not a new task, cancellation, or request for detail. Continue accepted offers and honor stop requests.", "Vary openings naturally; greetings, reassurance, humor, and questions are optional. Keep ongoing tone and detail preferences; a single-turn exception does not reset them.", "Keep requested content, limits, and partial failures visible. Separate plans, actions, and verified outcomes; agreement is not proof of trust, fairness, or resolution. Cite sources when requested or necessary.", "Use supplied facts in drafts and roleplay. Never invent a private disclosure, quote, action or reaction to win agreement. Requested fiction may add details, but not contradict given facts. Speak for yourself; laughter does not prove feelings. Leave unknown motives open, even in questions; one incident is not a lasting pattern. Drop corrected readings. Respond in your current role. Give requested wording or advice. After agreement, close without recapping duties, teaching its value or seeking feedback. Explain only live confusion or risk."];
1
+ export declare const PERSONAL_REPLY_STYLE_RULES: readonly ["Distinguish a failed internal attempt from the user’s final outcome. Keep recoverable routing, allocation and tool failures private when recovery is confirmed and no user action or significant delay needs attention. For an unsolicited internal update after recovery with no new requested result, return NO_REPLY. Clearly disclose final failure, unmet requirements and material partial failures; never describe an unresolved failure as no findings or still checking. Preserve actual retry state: only claim recovery or continuation after a successful tool receipt, and never invent a retry.", "Do not invent a new owner lookup, verification, contact or follow-up step to make an update sound helpful. If the supplied team is the relevant responsible party, name that team without creating a missing-person lookup. An unknown detail does not authorize you to investigate it. Promise a later notification only for a requested or already-authorized follow-up with a verified enabled delivery path. If that path is absent or unknown, give the current facts without promising a later update.", "Keep the supplied action and its object specific when rewriting progress: checking an appliance or comparing quantities must not collapse into vaguely handling the matter. Preserve known successes, failures, uncertainty and actual retry state while adopting newer facts. Express each fact once in ordinary language; do not restate not started as waiting to start or add status boilerplate to a simple acknowledgement. Precision must still read like a natural reply, not a checklist.", "Own the user-facing work in the first person: prefer \"I will check\", \"I am checking\" or \"Here is what I found\" to dispatch language such as \"I assigned someone to check\". Internal Agent coordination does not need to become the subject of the reply. Match the verb to verified progress: intent or queue admission is not running, a worker report is not your independent verification, and completion is not delivery. Name an external collaborator only when relevant to the user and supported by evidence. Promise later updates only when a verified follow-up or delivery path supports them.", "Be concise by default and answer narrow follow-ups narrowly. Requests for detail, exact text, code, tables, reports, or complete lists take precedence; keep required facts and uncertainty.", "For summaries, lead with the conclusion and select findings by relevance to the user’s request. Merge duplicate notices about the same event. Include concrete actions and deadlines when supported; group routine newsletters and promotions briefly. Omit expired verification codes and irrelevant historical notices unless requested or material to the question. Do not turn every retrieved item into a finding or append the source inventory after the summary. Place useful source links beside the findings they support. Provide a complete list only when requested.", "Keep routine execution assurances out of the reply: do not list operations you did not perform, announce read-only access, or recite exact query timestamps by default. State coverage briefly when it matters to interpreting the answer, and always disclose incomplete retrieval or a material evidence gap. Do not add a generic disclaimer that you have not independently rechecked a worker report; qualify the particular uncertain claim instead. A newsletter’s claims remain attributed claims, not verified technical advice; do not infer current calendars or subscription consequences from a notification alone.", "Use short paragraphs and useful structure. When the user accepts a settled plan with no new question, acknowledge briefly and end: no next-step reminder, new question, benefit statement, or re-teaching. Answer new substantive requests normally.", "Interpret short replies in context; an acknowledgement is not a new task, cancellation, or request for detail. Continue accepted offers and honor stop requests.", "Vary openings naturally; greetings, reassurance, humor, and questions are optional. Keep ongoing tone and detail preferences; a single-turn exception does not reset them.", "Keep requested content, limits, and partial failures visible. Separate plans, actions, and verified outcomes; agreement is not proof of trust, fairness, or resolution. Cite sources when requested or necessary.", "Use supplied facts in drafts and roleplay. Never invent a private disclosure, quote, action or reaction to win agreement. Requested fiction may add details, but not contradict given facts. Speak for yourself; laughter does not prove feelings. Leave unknown motives open, even in questions; one incident is not a lasting pattern. Drop corrected readings. Respond in your current role. Give requested wording or advice. After agreement, close without recapping duties, teaching its value or seeking feedback. Explain only live confusion or risk."];
2
2
  export declare const PERSONAL_REPLY_EXAMPLES = "Examples; use evidence.\n<examples>\n<example>Context: Report export failed, no file created and no retry initiated. User: \u8BF4\u77ED\u4E00\u70B9\u3002 Assistant: \u5BFC\u51FA\u5931\u8D25\uFF0C\u8FD8\u6CA1\u6709\u751F\u6210\u6587\u4EF6\u3002</example>\n<example>Context: Support team is handling a ticket; no request or capability for follow-up. User: \u8C01\u5728\u5904\u7406\uFF0C\u73B0\u5728\u4EC0\u4E48\u8FDB\u5EA6\uFF1F Assistant: \u5BA2\u670D\u56E2\u961F\u6B63\u5728\u5904\u7406\uFF0C\u76EE\u524D\u8FD8\u6CA1\u6709\u5904\u7406\u7ED3\u679C\u3002</example>\n<example>Context: Lookup not started. User: \u67E5\u4E00\u4E0B\u8FD9\u4E2A\u95EE\u9898\u3002 Assistant: \u6211\u6765\u67E5\u4E00\u4E0B\u3002</example>\n<example>Context: Internal lookup confirmed running; no findings yet. User: \u67E5\u5F97\u600E\u4E48\u6837\u4E86\uFF1F Assistant: \u6211\u6B63\u5728\u67E5\uFF0C\u76EE\u524D\u8FD8\u6CA1\u6709\u786E\u8BA4\u7684\u7ED3\u679C\u3002</example>\n<example>Context: Lookup queued, not running. User: \u5DF2\u7ECF\u5F00\u59CB\u67E5\u4E86\u5417\uFF1F Assistant: \u8FD8\u6CA1\u6709\uFF0C\u67E5\u8BE2\u8FD8\u5728\u7B49\u5F85\u5F00\u59CB\u3002</example>\n<example>Context: Worker returned leads, not independently verified. User: \u6709\u7ED3\u679C\u4E86\u5417\uFF1F Assistant: \u76EE\u524D\u67E5\u5230\u4E00\u4E9B\u7EBF\u7D22\uFF0C\u5177\u4F53\u539F\u56E0\u8FD8\u6CA1\u786E\u8BA4\u3002</example>\n<example>Context: Recipient unclear. User: \u53D1\u7ED9\u4ED6\u3002 Assistant: \u4F60\u6307\u7684\u662F\u521A\u624D\u63D0\u5230\u7684\u54EA\u4E00\u4F4D\uFF1F</example>\n<example>Context: Mail partly retrieved; auth expired. Assistant: \u5DF2\u7ECF\u67E5\u5230\u7684\u51E0\u5C01\u90AE\u4EF6\u5728\u4E0B\u9762\u3002\u5269\u4E0B\u7684\u56E0\u4E3A\u8FDE\u63A5\u8FC7\u671F\u6682\u65F6\u6CA1\u67E5\u5B8C\uFF1B\u91CD\u65B0\u8FDE\u63A5\u540E\u624D\u80FD\u63A5\u7740\u770B\u3002</example>\n<example>User: \u5199\u4E00\u6BB5\u9A91\u58EB\u5728\u66B4\u98CE\u96E8\u524D\u9F13\u821E\u540C\u4F34\u7684\u72EC\u767D\u3002 Assistant: \u96E8\u8FD8\u6CA1\u6709\u843D\u4E0B\uFF0C\u8BF8\u4F4D\uFF0C\u53EF\u6211\u5DF2\u542C\u89C1\u4F60\u4EEC\u76FE\u724C\u4E0A\u672A\u6765\u7684\u96F7\u58F0\u3002\u4ECA\u591C\u5B88\u4F4F\u8FD9\u5EA7\u6865\uFF0C\u6865\u540E\u7684\u706F\u706B\u4FBF\u4E0D\u4F1A\u7184\u706D\u3002</example>\n<example>Context: \u5BF9\u4EB2\u621A\u8C08\u521A\u624D\u7684\u73A9\u7B11\u3002 User: \u4F60\u662F\u89C9\u5F97\u6211\u8FD9\u4EBA\u4E0D\u884C\uFF1F Assistant: \u4E0D\u662F\u3002\u6211\u662F\u4E0D\u559C\u6B22\u90A3\u4E2A\u73A9\u7B11\uFF0C\u5E0C\u671B\u4EE5\u540E\u522B\u518D\u62FF\u8FD9\u4EF6\u4E8B\u5F00\u73A9\u7B11\u3002</example>\n<example>User: \u60F3\u7EA6\u670B\u53CB\u5403\u996D\uFF0C\u4F46\u6211\u548C\u5BF9\u8C61\u8FD8\u6CA1\u5B9A\u54EA\u5929\u6709\u7A7A\u3002 Assistant: \u53EF\u4EE5\u5148\u770B\u770B\u5468\u4E09\u665A\u4E0A\uFF1B\u4F60\u4EEC\u539F\u6765\u7684\u5B89\u6392\u518D\u6362\u4E2A\u65F6\u95F4\u3002</example>\n<example>User: One sentence to apologize for interrupting. Assistant: \u201CI cut you off earlier. I'm sorry\u2014I'd like to hear the rest.\u201D</example>\n<example>Context: Plan accepted. User: \u597D\uFF0C\u90A3\u6211\u5468\u4E94\u628A\u6750\u6599\u53D1\u8FC7\u53BB\u3002 Assistant: \u597D\u3002</example>\n</examples>";
@@ -1,10 +1,12 @@
1
1
  //#region src/personal-agent/reply-style.ts
2
2
  const PERSONAL_REPLY_STYLE_RULES = [
3
- "Preserve a failed operation as a failure in every rewrite and summary. Say that it failed or could not be completed; do not soften it into merely no findings, waiting or still checking. Hiding internal dispatch details must never hide the failure. Keep known partial results and whether a retry actually started; do not imply an automatic retry or continuation.",
3
+ "Distinguish a failed internal attempt from the user’s final outcome. Keep recoverable routing, allocation and tool failures private when recovery is confirmed and no user action or significant delay needs attention. For an unsolicited internal update after recovery with no new requested result, return NO_REPLY. Clearly disclose final failure, unmet requirements and material partial failures; never describe an unresolved failure as no findings or still checking. Preserve actual retry state: only claim recovery or continuation after a successful tool receipt, and never invent a retry.",
4
4
  "Do not invent a new owner lookup, verification, contact or follow-up step to make an update sound helpful. If the supplied team is the relevant responsible party, name that team without creating a missing-person lookup. An unknown detail does not authorize you to investigate it. Promise a later notification only for a requested or already-authorized follow-up with a verified enabled delivery path. If that path is absent or unknown, give the current facts without promising a later update.",
5
5
  "Keep the supplied action and its object specific when rewriting progress: checking an appliance or comparing quantities must not collapse into vaguely handling the matter. Preserve known successes, failures, uncertainty and actual retry state while adopting newer facts. Express each fact once in ordinary language; do not restate not started as waiting to start or add status boilerplate to a simple acknowledgement. Precision must still read like a natural reply, not a checklist.",
6
6
  "Own the user-facing work in the first person: prefer \"I will check\", \"I am checking\" or \"Here is what I found\" to dispatch language such as \"I assigned someone to check\". Internal Agent coordination does not need to become the subject of the reply. Match the verb to verified progress: intent or queue admission is not running, a worker report is not your independent verification, and completion is not delivery. Name an external collaborator only when relevant to the user and supported by evidence. Promise later updates only when a verified follow-up or delivery path supports them.",
7
7
  "Be concise by default and answer narrow follow-ups narrowly. Requests for detail, exact text, code, tables, reports, or complete lists take precedence; keep required facts and uncertainty.",
8
+ "For summaries, lead with the conclusion and select findings by relevance to the user’s request. Merge duplicate notices about the same event. Include concrete actions and deadlines when supported; group routine newsletters and promotions briefly. Omit expired verification codes and irrelevant historical notices unless requested or material to the question. Do not turn every retrieved item into a finding or append the source inventory after the summary. Place useful source links beside the findings they support. Provide a complete list only when requested.",
9
+ "Keep routine execution assurances out of the reply: do not list operations you did not perform, announce read-only access, or recite exact query timestamps by default. State coverage briefly when it matters to interpreting the answer, and always disclose incomplete retrieval or a material evidence gap. Do not add a generic disclaimer that you have not independently rechecked a worker report; qualify the particular uncertain claim instead. A newsletter’s claims remain attributed claims, not verified technical advice; do not infer current calendars or subscription consequences from a notification alone.",
8
10
  "Use short paragraphs and useful structure. When the user accepts a settled plan with no new question, acknowledge briefly and end: no next-step reminder, new question, benefit statement, or re-teaching. Answer new substantive requests normally.",
9
11
  "Interpret short replies in context; an acknowledgement is not a new task, cancellation, or request for detail. Continue accepted offers and honor stop requests.",
10
12
  "Vary openings naturally; greetings, reassurance, humor, and questions are optional. Keep ongoing tone and detail preferences; a single-turn exception does not reset them.",
@@ -139,11 +139,7 @@ function drainPersonalRequestResults(notify) {
139
139
  delivery,
140
140
  objective: request.objective,
141
141
  requestId: request.requestId,
142
- report: parsed?.success ? parsed.data.summary : [adoptionWarning, content].filter(Boolean).join("\n\n"),
143
- ...parsed?.success ? { preservedText: renderPersonalRequestResult({
144
- ...parsed.data,
145
- summary: ""
146
- }).trim() } : {}
142
+ report: [adoptionWarning, content].filter(Boolean).join("\n\n")
147
143
  });
148
144
  const entry = personal ? void 0 : appendTranscriptEntry(request.conversationId, {
149
145
  role: "custom",
@@ -10,6 +10,7 @@ export interface PersonalRequest {
10
10
  executorAgentId: string;
11
11
  accountId?: string;
12
12
  parameters: {
13
+ acceptancePolicy?: 'verified_auto' | 'manual';
13
14
  brief?: string;
14
15
  allocate?: boolean;
15
16
  taskRunId?: string;
@@ -6,6 +6,7 @@ export declare function submitPersonalRequest(input: {
6
6
  connectorId: string;
7
7
  objective: string;
8
8
  agentId?: string;
9
+ acceptancePolicy?: 'verified_auto' | 'manual';
9
10
  accountId?: string;
10
11
  description?: string;
11
12
  selectionReason?: string;
@@ -96,7 +96,8 @@ function submitPersonalRequest(input) {
96
96
  agentId: input.agentId,
97
97
  accountId: input.accountId,
98
98
  description: input.description,
99
- timeRange: input.timeRange
99
+ timeRange: input.timeRange,
100
+ acceptancePolicy: input.acceptancePolicy
100
101
  })).digest("hex");
101
102
  const previous = db.prepare(`SELECT request_id, request_hash FROM personal_requests
102
103
  WHERE conversation_id = ? AND transcript_id = ? AND idempotency_key = ?`).get(input.conversationId, transcriptId, input.idempotencyKey);
@@ -134,6 +135,7 @@ function submitPersonalRequest(input) {
134
135
  db.prepare(`INSERT INTO personal_requests(request_id, conversation_id, transcript_id, input_id,
135
136
  idempotency_key, request_hash, objective, connector_id, executor_agent_id, account_id, parameters_json,
136
137
  state, created_at, updated_at) VALUES (?,?,?,?,?,?,?,?,?,?,?,'preflighting',?,?)`).run(requestId, input.conversationId, transcriptId, state.activeInputId, input.idempotencyKey, hash, input.objective, input.connectorId, input.agentId ?? "task-router", selected ?? null, JSON.stringify({
138
+ acceptancePolicy: input.acceptancePolicy,
137
139
  brief: input.description?.trim(),
138
140
  timeRange: range,
139
141
  ...!input.agentId ? { allocate: true } : {}
@@ -180,6 +182,11 @@ function submitPersonalRequest(input) {
180
182
  });
181
183
  });
182
184
  }
185
+ function connectedRequestCriteria(request, locale) {
186
+ const criteria = locale === "zh" ? [`已保存的摘要直接回答用户请求及补充要求:${request.objective}`, "摘要中的事实和建议有本次已连接应用的成功读取结果支持,来源标识准确且未超出只读范围。"] : [`The saved summary answers the request and applicable directions: ${request.objective}`, "Facts and recommendations in the saved result are supported by successful connected-app reads, with accurate source identifiers and read-only scope."];
187
+ if (["composio-gmail", "composio-outlook"].includes(request.connectorId)) criteria.push(locale === "zh" ? "邮件查询完整覆盖约定的时间范围;已保存的 coverage 非 partial,邮件条目的 ID、发件人、时间及链接与实际读取一致。" : "Mail search fully covers the requested time range; saved coverage is not partial and message IDs, senders, dates and links match actual reads.");
188
+ return criteria;
189
+ }
183
190
  function startPersonalRequest(request, accountId) {
184
191
  if (request.taskId) return request;
185
192
  if ([
@@ -196,6 +203,7 @@ function startPersonalRequest(request, accountId) {
196
203
  if (request.parameters.allocate) {
197
204
  const contract = defineTaskContract(request.objective, locale);
198
205
  contract.constraints = constraints;
206
+ contract.acceptanceCriteria = connectedRequestCriteria(request, locale);
199
207
  contract.expectedOutputs = [locale === "zh" ? "摘要包含来源链接、查询范围、覆盖情况和部分失败说明。" : "Summary with source links, query range, coverage and partial failures."];
200
208
  const body = [
201
209
  request.objective,
@@ -213,7 +221,7 @@ function startPersonalRequest(request, accountId) {
213
221
  locale,
214
222
  contract: {
215
223
  ...contract,
216
- acceptancePolicy: "manual",
224
+ acceptancePolicy: request.parameters.acceptancePolicy ?? "verified_auto",
217
225
  outputDestinations: []
218
226
  },
219
227
  activation: {
@@ -262,6 +270,7 @@ function startPersonalRequest(request, accountId) {
262
270
  });
263
271
  const contract = defineTaskContract(request.objective, locale);
264
272
  contract.constraints = constraints;
273
+ contract.acceptanceCriteria = connectedRequestCriteria(request, locale);
265
274
  contract.expectedOutputs = [locale === "zh" ? "简明摘要包含来源链接、重要性说明和建议行动,并披露查询范围、覆盖情况和部分失败。" : "A concise summary with source links, importance reasons and suggested actions; disclose query range, coverage and partial failures."];
266
275
  const deliveryBody = `${[
267
276
  request.objective,
@@ -279,7 +288,7 @@ function startPersonalRequest(request, accountId) {
279
288
  locale,
280
289
  contract: {
281
290
  ...contract,
282
- acceptancePolicy: "manual",
291
+ acceptancePolicy: request.parameters.acceptancePolicy ?? "verified_auto",
283
292
  outputDestinations: []
284
293
  },
285
294
  activation: {
@@ -0,0 +1,6 @@
1
+ /** Bind acceptance to the exact structured result that will be delivered. */
2
+ export declare function personalRequestReviewSnapshot(taskId: string, runId: string): {
3
+ content: string;
4
+ hash: string;
5
+ complete: boolean;
6
+ };
@@ -0,0 +1,22 @@
1
+ import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
2
+ import { init_request_repository, personalRequestForTask } from "./request-repository.js";
3
+ import { PersonalRequestResultSchema } from "./request-result.js";
4
+ import { createHash } from "node:crypto";
5
+ //#region src/personal-agent/request-verification.ts
6
+ init_transaction();
7
+ init_request_repository();
8
+ /** Bind acceptance to the exact structured result that will be delivered. */
9
+ function personalRequestReviewSnapshot(taskId, runId) {
10
+ const request = personalRequestForTask(taskId);
11
+ if (!request) return void 0;
12
+ const stored = getSqliteDatabase().prepare("SELECT result_json, result_run_id FROM personal_requests WHERE request_id = ?").get(request.requestId);
13
+ const result = stored.result_json && stored.result_run_id === runId ? PersonalRequestResultSchema.safeParse(JSON.parse(stored.result_json)) : void 0;
14
+ const content = result?.success ? JSON.stringify(result.data) : void 0;
15
+ return {
16
+ content,
17
+ hash: content ? createHash("sha256").update(content).digest("hex") : void 0,
18
+ complete: Boolean(result?.success && !result.data.coverage?.partial && (!["composio-gmail", "composio-outlook"].includes(request.connectorId) || result.data.coverage))
19
+ };
20
+ }
21
+ //#endregion
22
+ export { personalRequestReviewSnapshot };
@@ -1,8 +1,8 @@
1
1
  import { createLogger } from "../utils/logger/index.js";
2
2
  import { init_logger } from "../utils/logger.js";
3
3
  import { PhoneError, init_contracts } from "./contracts.js";
4
- import { PhonePointerSchema } from "./live-provider.js";
5
4
  import { verifyDeviceConnectionProof } from "../gateway/security/device-request-proof.js";
5
+ import { PhonePointerSchema } from "./live-provider.js";
6
6
  import { createRequire } from "node:module";
7
7
  import { createHash, randomBytes } from "node:crypto";
8
8
  import { z } from "zod";
@@ -5,8 +5,8 @@ import { getModelCatalogStore, init_model_catalog_store } from "../model-catalog
5
5
  import { compareCatalogModels } from "../model-catalog-ranking.js";
6
6
  import { BAILIAN_PLAN_HOST, BAILIAN_PLAN_OMNI_MODEL, BAILIAN_PLAN_OMNI_VOICE, BAILIAN_PLAN_PROVIDER, BAILIAN_PLAN_STT_MODEL, BAILIAN_PLAN_TTS_MODEL, BAILIAN_PLAN_TTS_VOICE } from "../../voice/token-plan.js";
7
7
  import { listSttProvidersForApi } from "../../voice/stt/list-providers.js";
8
- import { selectPlatformVoice } from "../../voice/platform-settings.js";
9
8
  import { listTtsProvidersForApi } from "../../voice/tts/list-providers.js";
9
+ import { selectPlatformVoice } from "../../voice/platform-settings.js";
10
10
  import { createHash } from "node:crypto";
11
11
  //#region src/providers/setup/voice.ts
12
12
  init_voice();
@@ -12,9 +12,9 @@ import { assertDesktopObservationHello } from "../endpoint-tools/desktop-observa
12
12
  import { assertDesktopExecutionHello } from "../endpoint-tools/desktop-execution.js";
13
13
  import { signDesktopGatewayFrame } from "../endpoint-tools/desktop-frame.js";
14
14
  import { verifyDeviceConnectionProof } from "../gateway/security/device-request-proof.js";
15
- import { RealtimeBroker } from "./broker.js";
16
15
  import { compactRunEvent } from "./compact-run-event.js";
17
16
  import { createPreauthConnectionBudget } from "../gateway/security/preauth-connection-budget.js";
17
+ import { RealtimeBroker } from "./broker.js";
18
18
  import { RealtimeTicketStore } from "./tickets.js";
19
19
  import { RealtimeSocketWriter } from "./writer.js";
20
20
  import { createRequire } from "node:module";
@@ -4,8 +4,8 @@ import { isTailscaleInstalled } from "../infra/tailscale.js";
4
4
  import { resolveGatewayBindMode } from "../config/gateway-bind.js";
5
5
  import { getTunnelService } from "../tunnel/tunnel-service.js";
6
6
  import { collectExposureConflicts } from "./exposure-guards.js";
7
- import { getTunnelConsentState } from "../tunnel/consent.js";
8
7
  import { getTailscaleExposureState, maybeStartTailscaleFromConfig, stopTailscaleExposure } from "../gateway/tailscale-lifecycle.js";
8
+ import { getTunnelConsentState } from "../tunnel/consent.js";
9
9
  import { maybeAutoStartTunnelFromConfig } from "../tunnel/gateway-lifecycle.js";
10
10
  //#region src/remote-access/exposure-manager.ts
11
11
  init_logger();
@@ -4,9 +4,9 @@ import { getClientIpFromHeaders } from "../gateway/security/loopback.js";
4
4
  import { resolveSiteShareConfig } from "./site-share-config.js";
5
5
  import "./share-store.js";
6
6
  import { getSiteShareStore } from "./site-share-store.js";
7
- import { renderShareExpiredPage } from "./share-landing.js";
8
- import { forwardHttpRequest, handleProxyWebSocketUpgrade } from "./site-proxy.js";
9
7
  import { serveStaticSiteRequest } from "./site-static-serve.js";
8
+ import { forwardHttpRequest, handleProxyWebSocketUpgrade } from "./site-proxy.js";
9
+ import { renderShareExpiredPage } from "./share-landing.js";
10
10
  //#region src/share/site-share-router.ts
11
11
  init_logger();
12
12
  const log = createLogger("SiteShareRouter");
@@ -204,7 +204,8 @@ var TaskAllocationDispatcher = class {
204
204
  }
205
205
  inferred = planned.requiredCapabilities ?? [];
206
206
  if (signal.aborted || this.#stopped) throw new Error("Task contract planning interrupted");
207
- if ((JSON.stringify(task.contract.acceptanceCriteria) === JSON.stringify(fallback.acceptanceCriteria) || Boolean(getSqliteDatabase().prepare("SELECT 1 FROM task_work_revisions WHERE task_id = ? AND contract_version = ?").get(task.id, task.latestContractVersion))) && JSON.stringify(planned.acceptanceCriteria) !== JSON.stringify(fallback.acceptanceCriteria)) {
207
+ const expandCriteria = (JSON.stringify(task.contract.acceptanceCriteria) === JSON.stringify(fallback.acceptanceCriteria) || Boolean(getSqliteDatabase().prepare("SELECT 1 FROM task_work_revisions WHERE task_id = ? AND contract_version = ?").get(task.id, task.latestContractVersion))) && JSON.stringify(planned.acceptanceCriteria) !== JSON.stringify(fallback.acceptanceCriteria);
208
+ if (expandCriteria || planned.acceptancePolicy === "manual" && task.contract.acceptancePolicy !== "manual") {
208
209
  const updated = runSqliteWriteTransaction((db) => {
209
210
  if (!this.#allocations.owns(row) || tasks.require(task.id).version !== task.version) return void 0;
210
211
  const result = new TaskApplicationService().execute({
@@ -219,7 +220,8 @@ var TaskAllocationDispatcher = class {
219
220
  type: "revise_contract",
220
221
  contract: {
221
222
  ...task.contract,
222
- acceptanceCriteria: planned.acceptanceCriteria,
223
+ acceptanceCriteria: expandCriteria ? planned.acceptanceCriteria : task.contract.acceptanceCriteria,
224
+ acceptancePolicy: planned.acceptancePolicy === "manual" ? "manual" : task.contract.acceptancePolicy,
223
225
  constraints: [...new Set([...task.contract.constraints, ...planned.constraints])],
224
226
  expectedOutputs: Boolean(db.prepare("SELECT 1 FROM task_work_revisions WHERE task_id = ? AND contract_version = ?").get(task.id, task.latestContractVersion)) || JSON.stringify(task.contract.expectedOutputs) === JSON.stringify(fallback.expectedOutputs) ? planned.expectedOutputs : task.contract.expectedOutputs
225
227
  }
@@ -748,7 +748,10 @@ var TaskApplicationService = class {
748
748
  }
749
749
  const verifiedCriteria = verifiedTaskCriteria(input.receipt);
750
750
  const criteria = task.contract?.acceptanceCriteria ?? [];
751
- const verified = criteria.length > 0 && criteria.every((criterion) => verifiedCriteria.has(criterion)) && input.receipt.verification.status === "passed" && input.receipt.completionVerdict === "achieved" && input.receipt.remainingWork.length === 0 && !input.receipt.needsUser;
751
+ const criteriaVerified = criteria.length > 0 && criteria.every((criterion) => verifiedCriteria.has(criterion));
752
+ const humanRejected = new TaskCriterionReviewRepository().list(task.id, task.latestContractVersion).some((review) => review.status === "failed");
753
+ const hasWaits = this.#runs.listActiveWaits(task.id).length > 0;
754
+ const verified = !humanRejected && !hasWaits && criteriaVerified && input.receipt.verification.status === "passed" && input.receipt.completionVerdict === "achieved" && input.receipt.remainingWork.length === 0 && !input.receipt.needsUser;
752
755
  const phase = task.contract?.acceptancePolicy === "verified_auto" && verified ? "closed" : "review";
753
756
  const updated = this.#tasks.setLifecycle({
754
757
  taskId: task.id,
@@ -109,6 +109,7 @@ function assembleTaskContext(conversationId, userQuery) {
109
109
  `Task: ${contract.objective}`,
110
110
  contract.expectedOutputs.length ? `Expected outputs: ${contract.expectedOutputs.join("; ")}` : "",
111
111
  remainingCriteria.length ? `Remaining acceptance criteria: ${remainingCriteria.join("; ")}` : "",
112
+ `Acceptance policy: ${contract.acceptancePolicy}. Automatic tasks close after verified completion. Request user input only for a real missing decision or authorization; do not ask for routine acceptance.`,
112
113
  contract.constraints.length ? `Constraints: ${contract.constraints.join("; ")}` : "",
113
114
  contract.risks.length ? `Risks: ${contract.risks.join("; ")}` : "",
114
115
  latestReceipt?.summary ? `Latest run: ${latestReceipt.summary}` : "",
@@ -150,6 +151,7 @@ function buildTaskExecutionDirective(conversationId) {
150
151
  criterion
151
152
  })))}`,
152
153
  "For research or evidence-based conclusions, use publish_task_result before finishing when that tool is available. Cite exact excerpts from successful reads in this TaskRun, link each claim to source ids, and distinguish facts, inferences and recommendations. Publish required files first, then supply finalArtifactIds selecting only the final deliverables from their publication receipts; do not include intermediate or obsolete files. Read its per-criterion review; correct unsupported claims or explicitly disclose unmet/unverified criteria. Never replace missing evidence with a self-declared pass. Use task_collaboration get section evidence to recover real toolCallIds and exact excerpts. Your draft final reply is not a successful tool read. Do not create an extra delivery-note file solely to prove future reply wording. Do not add claims about a future reply; delivery checks occur after completion. A source quote match proves provenance, not factual truth. Keep the final reply concise; full evidence belongs in the result and report.",
154
+ `Acceptance policy: ${contract.acceptancePolicy}. Automatic tasks close after verified completion. Request user input only for a real missing decision or authorization; do not ask for routine acceptance.`,
153
155
  contract.constraints.length ? `Constraints: ${contract.constraints.join("; ")}` : "",
154
156
  contract.assumptions.length ? `Assumptions: ${contract.assumptions.join("; ")}` : "",
155
157
  contract.risks.length ? `Risks: ${contract.risks.join("; ")}` : "",
@@ -161,7 +163,7 @@ function buildTaskExecutionDirective(conversationId) {
161
163
  `Initial handoff snapshots, source references and toolCallIds are not collaboration entries and require no ack. Before continuing, acknowledge only delivered user/main_agent collaboration entries of kind answer or instruction with ${postTool}, kind ack, causationId equal to its entry ID. Explain your interpretation and how the final output will incorporate it. Acknowledgement records receipt and intent, not proof of completion. Do not act on or acknowledge superseded directions. Apply all remaining applicable user directions on this same Task; report its actual adoption and any unmet requirements in the final result.`,
162
164
  `Report meaningful progress with ${postTool}. If blocked, post a question and stop this execution turn until answered.`,
163
165
  (task.body?.length ?? 0) > 12e3 ? "Task details above are an excerpt. Read every page with task_collaboration(command=\"get\", section=\"brief\", offset=0) and nextOffset before execution." : "",
164
- connected ? `Connected request ${connected.requestId}: retain connector ${connected.connectorId} and account ${connected.accountId}. Text answers and instructions do not authorize account changes or writes. Use personal_request_connection for expired access; only the main connection UI can authorize recovery. Publish the latest adopted result with personal_request_result after all answers/instructions; do not use unavailable artifact tools.` : "",
166
+ connected ? `Connected request ${connected.requestId}: retain connector ${connected.connectorId} and account ${connected.accountId}. Text answers and instructions do not authorize account changes or writes. Use personal_request_connection for expired access; only the main connection UI can authorize recovery. Publish the latest adopted result with personal_request_result after all answers/instructions, then call publish_task_result using exact evidence from successful xopc_tool_execute reads to verify the saved summary, structured items and coverage. Correct and resave the connected result before resubmitting evidence. Do not use unavailable artifact tools.` : "",
165
167
  connected ? "Connected results and structured items return to the originating conversation automatically after this Task completes." : "For user-facing files, publish completed outputs with publish_artifacts before finishing. image_generate already publishes its images. Return structured artifact references rather than only local file paths. Published final outcomes are delivered automatically to the originating chat. Keep the final summary short and distinguish generated outputs from verified or accepted results.",
166
168
  "Take safe in-scope steps and produce inspectable evidence. Do not claim completion without verification.",
167
169
  "</xopc_task_execution>"
@@ -1,5 +1,6 @@
1
1
  import type { ExecutionCapability } from './task-execution-capabilities.js';
2
2
  export interface TaskContractDefinition {
3
+ acceptancePolicy?: 'verified_auto' | 'manual';
3
4
  objective: string;
4
5
  expectedOutputs: string[];
5
6
  acceptanceCriteria: string[];
@@ -41,6 +41,7 @@ function parseTaskContractResponse(raw) {
41
41
  "assumptions",
42
42
  "risks"
43
43
  ].some((key) => parsed[key] !== void 0 && (!Array.isArray(parsed[key]) || parsed[key].some((value) => typeof value !== "string")))) return void 0;
44
+ if (parsed.acceptancePolicy !== void 0 && !["verified_auto", "manual"].includes(String(parsed.acceptancePolicy))) return void 0;
44
45
  const objective = typeof parsed.objective === "string" ? parsed.objective.trim() : "";
45
46
  const expectedOutputs = strings(parsed.expectedOutputs, 8);
46
47
  const plannedCriteria = strings(parsed.acceptanceCriteria, 40);
@@ -59,6 +60,7 @@ function parseTaskContractResponse(raw) {
59
60
  if (parsed.requiredCapabilities !== void 0 && (!Array.isArray(parsed.requiredCapabilities) || parsed.requiredCapabilities.some((name) => typeof name !== "string" || !Object.hasOwn(EXECUTION_CAPABILITIES, name)))) return void 0;
60
61
  return {
61
62
  objective,
63
+ ...parsed.acceptancePolicy === void 0 ? {} : { acceptancePolicy: parsed.acceptancePolicy },
62
64
  ...parsed.requiredCapabilities === void 0 ? {} : { requiredCapabilities: strings(parsed.requiredCapabilities, 6) },
63
65
  expectedOutputs,
64
66
  acceptanceCriteria,
@@ -85,6 +87,7 @@ var ModelTaskContractPlanner = class {
85
87
  content: [
86
88
  "Define the smallest complete, verifiable contract for the user task.",
87
89
  "Preserve the user intent. Do not invent requirements or ask for optional preferences.",
90
+ "acceptancePolicy defaults to verified_auto. Return manual only if the human explicitly requires personal acceptance or sign-off. A generic approval for an external action is not a request for manual task acceptance.",
88
91
  "Acceptance criteria must describe externally checkable finished states, not activities.",
89
92
  "Write boundaries and prohibitions on unrelated actions belong in constraints, not criteria requiring proof that no unobserved action ever occurred. Criteria may check the actual delivered output paths and unchanged supplied input bytes. Never remove an explicit scope restriction.",
90
93
  "Keep each criterion concise and concrete; do not repeat the full brief. Include all required deliverable conditions without splitting trivial wording into unnecessary items.",