@happier-dev/stack 0.2.11 → 0.2.12-preview.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.
Files changed (227) hide show
  1. package/node_modules/@happier-dev/agents/dist/connectedServices/runtimeFallbackCapability.d.ts +1 -0
  2. package/node_modules/@happier-dev/agents/dist/connectedServices/runtimeFallbackCapability.d.ts.map +1 -1
  3. package/node_modules/@happier-dev/agents/dist/connectedServices/runtimeFallbackCapability.js +3 -0
  4. package/node_modules/@happier-dev/agents/dist/connectedServices/runtimeFallbackCapability.js.map +1 -1
  5. package/node_modules/@happier-dev/agents/dist/manifest.d.ts +1 -0
  6. package/node_modules/@happier-dev/agents/dist/manifest.d.ts.map +1 -1
  7. package/node_modules/@happier-dev/agents/dist/manifest.js +1 -0
  8. package/node_modules/@happier-dev/agents/dist/manifest.js.map +1 -1
  9. package/node_modules/@happier-dev/agents/dist/runtime/terminal/control.d.ts +1 -1
  10. package/node_modules/@happier-dev/agents/dist/runtime/terminal/control.d.ts.map +1 -1
  11. package/node_modules/@happier-dev/agents/dist/runtime/terminal/control.js +2 -0
  12. package/node_modules/@happier-dev/agents/dist/runtime/terminal/control.js.map +1 -1
  13. package/node_modules/@happier-dev/agents/dist/types.d.ts +1 -0
  14. package/node_modules/@happier-dev/agents/dist/types.d.ts.map +1 -1
  15. package/node_modules/@happier-dev/cli-common/dist/componentArtifacts/buildServerBinaryArtifactPayload.d.ts.map +1 -1
  16. package/node_modules/@happier-dev/cli-common/dist/componentArtifacts/buildServerBinaryArtifactPayload.js +5 -18
  17. package/node_modules/@happier-dev/cli-common/dist/componentArtifacts/buildServerBinaryArtifactPayload.js.map +1 -1
  18. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/copyRuntimePayloadTree.d.ts +1 -1
  19. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/copyRuntimePayloadTree.d.ts.map +1 -1
  20. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/copyRuntimePayloadTree.js +14 -6
  21. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/copyRuntimePayloadTree.js.map +1 -1
  22. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/index.d.ts +2 -1
  23. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/index.d.ts.map +1 -1
  24. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/index.js +2 -1
  25. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/index.js.map +1 -1
  26. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/selfHostServerEnv.d.ts.map +1 -1
  27. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/selfHostServerEnv.js +13 -19
  28. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/selfHostServerEnv.js.map +1 -1
  29. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/serverRuntimeArtifactLayout.d.ts +4 -0
  30. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/serverRuntimeArtifactLayout.d.ts.map +1 -1
  31. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/serverRuntimeArtifactLayout.js +20 -0
  32. package/node_modules/@happier-dev/cli-common/dist/firstPartyRuntime/serverRuntimeArtifactLayout.js.map +1 -1
  33. package/node_modules/@happier-dev/cli-common/dist/output/index.d.ts +1 -0
  34. package/node_modules/@happier-dev/cli-common/dist/output/index.d.ts.map +1 -1
  35. package/node_modules/@happier-dev/cli-common/dist/output/index.js +1 -0
  36. package/node_modules/@happier-dev/cli-common/dist/output/index.js.map +1 -1
  37. package/node_modules/@happier-dev/cli-common/dist/output/planet.d.ts +47 -0
  38. package/node_modules/@happier-dev/cli-common/dist/output/planet.d.ts.map +1 -0
  39. package/node_modules/@happier-dev/cli-common/dist/output/planet.js +183 -0
  40. package/node_modules/@happier-dev/cli-common/dist/output/planet.js.map +1 -0
  41. package/node_modules/@happier-dev/cli-common/dist/output/progress.d.ts +3 -1
  42. package/node_modules/@happier-dev/cli-common/dist/output/progress.d.ts.map +1 -1
  43. package/node_modules/@happier-dev/cli-common/dist/output/progress.js +131 -57
  44. package/node_modules/@happier-dev/cli-common/dist/output/progress.js.map +1 -1
  45. package/node_modules/@happier-dev/cli-common/dist/relayHost/relayHostEngine.d.ts.map +1 -1
  46. package/node_modules/@happier-dev/cli-common/dist/relayHost/relayHostEngine.js +41 -78
  47. package/node_modules/@happier-dev/cli-common/dist/relayHost/relayHostEngine.js.map +1 -1
  48. package/node_modules/@happier-dev/cli-common/dist/relayHost/remoteRelayRuntimeInstallCommand.d.ts +5 -0
  49. package/node_modules/@happier-dev/cli-common/dist/relayHost/remoteRelayRuntimeInstallCommand.d.ts.map +1 -1
  50. package/node_modules/@happier-dev/cli-common/dist/relayHost/remoteRelayRuntimeInstallCommand.js +12 -0
  51. package/node_modules/@happier-dev/cli-common/dist/relayHost/remoteRelayRuntimeInstallCommand.js.map +1 -1
  52. package/node_modules/@happier-dev/cli-common/dist/service/windows.d.ts.map +1 -1
  53. package/node_modules/@happier-dev/cli-common/dist/service/windows.js +30 -8
  54. package/node_modules/@happier-dev/cli-common/dist/service/windows.js.map +1 -1
  55. package/node_modules/@happier-dev/cli-common/node_modules/chalk/license +9 -0
  56. package/node_modules/@happier-dev/cli-common/node_modules/chalk/package.json +83 -0
  57. package/node_modules/@happier-dev/cli-common/node_modules/chalk/readme.md +297 -0
  58. package/node_modules/@happier-dev/cli-common/node_modules/chalk/source/index.d.ts +325 -0
  59. package/node_modules/@happier-dev/cli-common/node_modules/chalk/source/index.js +225 -0
  60. package/node_modules/@happier-dev/cli-common/node_modules/chalk/source/utilities.js +33 -0
  61. package/node_modules/@happier-dev/cli-common/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
  62. package/node_modules/@happier-dev/cli-common/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
  63. package/node_modules/@happier-dev/cli-common/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
  64. package/node_modules/@happier-dev/cli-common/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
  65. package/node_modules/@happier-dev/cli-common/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
  66. package/node_modules/@happier-dev/cli-common/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
  67. package/node_modules/@happier-dev/cli-common/package.json +3 -1
  68. package/node_modules/@happier-dev/protocol/dist/account/encryptionMigrate.d.ts +32 -8
  69. package/node_modules/@happier-dev/protocol/dist/account/encryptionMigrate.d.ts.map +1 -1
  70. package/node_modules/@happier-dev/protocol/dist/account/settings/accountSettings.d.ts +5 -0
  71. package/node_modules/@happier-dev/protocol/dist/account/settings/accountSettings.d.ts.map +1 -1
  72. package/node_modules/@happier-dev/protocol/dist/account/settings/accountSettings.js +3 -0
  73. package/node_modules/@happier-dev/protocol/dist/account/settings/accountSettings.js.map +1 -1
  74. package/node_modules/@happier-dev/protocol/dist/account/settings/notificationChannels.d.ts +6 -0
  75. package/node_modules/@happier-dev/protocol/dist/account/settings/notificationChannels.d.ts.map +1 -1
  76. package/node_modules/@happier-dev/protocol/dist/account/settings/notificationChannels.js +2 -0
  77. package/node_modules/@happier-dev/protocol/dist/account/settings/notificationChannels.js.map +1 -1
  78. package/node_modules/@happier-dev/protocol/dist/actions/actionExecutor.d.ts.map +1 -1
  79. package/node_modules/@happier-dev/protocol/dist/actions/actionExecutor.js +106 -9
  80. package/node_modules/@happier-dev/protocol/dist/actions/actionExecutor.js.map +1 -1
  81. package/node_modules/@happier-dev/protocol/dist/actions/actionSpecs.d.ts.map +1 -1
  82. package/node_modules/@happier-dev/protocol/dist/actions/actionSpecs.js +23 -9
  83. package/node_modules/@happier-dev/protocol/dist/actions/actionSpecs.js.map +1 -1
  84. package/node_modules/@happier-dev/protocol/dist/actions/permissionPrivilege.d.ts +1 -1
  85. package/node_modules/@happier-dev/protocol/dist/actions/permissionPrivilege.d.ts.map +1 -1
  86. package/node_modules/@happier-dev/protocol/dist/actions/permissionPrivilege.js +16 -4
  87. package/node_modules/@happier-dev/protocol/dist/actions/permissionPrivilege.js.map +1 -1
  88. package/node_modules/@happier-dev/protocol/dist/activity/agentRequestNotificationContent.d.ts +12 -0
  89. package/node_modules/@happier-dev/protocol/dist/activity/agentRequestNotificationContent.d.ts.map +1 -0
  90. package/node_modules/@happier-dev/protocol/dist/activity/agentRequestNotificationContent.js +68 -0
  91. package/node_modules/@happier-dev/protocol/dist/activity/agentRequestNotificationContent.js.map +1 -0
  92. package/node_modules/@happier-dev/protocol/dist/activity/agentRequestSummary.d.ts +8 -0
  93. package/node_modules/@happier-dev/protocol/dist/activity/agentRequestSummary.d.ts.map +1 -0
  94. package/node_modules/@happier-dev/protocol/dist/activity/agentRequestSummary.js +100 -0
  95. package/node_modules/@happier-dev/protocol/dist/activity/agentRequestSummary.js.map +1 -0
  96. package/node_modules/@happier-dev/protocol/dist/activity/parseJson.d.ts +2 -0
  97. package/node_modules/@happier-dev/protocol/dist/activity/parseJson.d.ts.map +1 -0
  98. package/node_modules/@happier-dev/protocol/dist/activity/parseJson.js +32 -0
  99. package/node_modules/@happier-dev/protocol/dist/activity/parseJson.js.map +1 -0
  100. package/node_modules/@happier-dev/protocol/dist/activity/shellCommand.d.ts +12 -0
  101. package/node_modules/@happier-dev/protocol/dist/activity/shellCommand.d.ts.map +1 -0
  102. package/node_modules/@happier-dev/protocol/dist/activity/shellCommand.js +120 -0
  103. package/node_modules/@happier-dev/protocol/dist/activity/shellCommand.js.map +1 -0
  104. package/node_modules/@happier-dev/protocol/dist/clientCompatibility/index.d.ts +1 -1
  105. package/node_modules/@happier-dev/protocol/dist/clientCompatibility/index.d.ts.map +1 -1
  106. package/node_modules/@happier-dev/protocol/dist/clientCompatibility/index.js +1 -1
  107. package/node_modules/@happier-dev/protocol/dist/clientCompatibility/index.js.map +1 -1
  108. package/node_modules/@happier-dev/protocol/dist/clientCompatibility/primitives.d.ts +2 -1
  109. package/node_modules/@happier-dev/protocol/dist/clientCompatibility/primitives.d.ts.map +1 -1
  110. package/node_modules/@happier-dev/protocol/dist/clientCompatibility/primitives.js +2 -1
  111. package/node_modules/@happier-dev/protocol/dist/clientCompatibility/primitives.js.map +1 -1
  112. package/node_modules/@happier-dev/protocol/dist/connect/accountSubscription.d.ts +36 -0
  113. package/node_modules/@happier-dev/protocol/dist/connect/accountSubscription.d.ts.map +1 -0
  114. package/node_modules/@happier-dev/protocol/dist/connect/accountSubscription.js +36 -0
  115. package/node_modules/@happier-dev/protocol/dist/connect/accountSubscription.js.map +1 -0
  116. package/node_modules/@happier-dev/protocol/dist/connect/accountUsage.d.ts +143 -0
  117. package/node_modules/@happier-dev/protocol/dist/connect/accountUsage.d.ts.map +1 -1
  118. package/node_modules/@happier-dev/protocol/dist/connect/accountUsage.js +46 -0
  119. package/node_modules/@happier-dev/protocol/dist/connect/accountUsage.js.map +1 -1
  120. package/node_modules/@happier-dev/protocol/dist/connect/connectedServiceSchemas.d.ts +40 -0
  121. package/node_modules/@happier-dev/protocol/dist/connect/connectedServiceSchemas.d.ts.map +1 -1
  122. package/node_modules/@happier-dev/protocol/dist/connect/connectedServiceSchemas.js +9 -0
  123. package/node_modules/@happier-dev/protocol/dist/connect/connectedServiceSchemas.js.map +1 -1
  124. package/node_modules/@happier-dev/protocol/dist/connect/recoveryCreditConsumeIdempotencyKey.d.ts +8 -0
  125. package/node_modules/@happier-dev/protocol/dist/connect/recoveryCreditConsumeIdempotencyKey.d.ts.map +1 -0
  126. package/node_modules/@happier-dev/protocol/dist/connect/recoveryCreditConsumeIdempotencyKey.js +22 -0
  127. package/node_modules/@happier-dev/protocol/dist/connect/recoveryCreditConsumeIdempotencyKey.js.map +1 -0
  128. package/node_modules/@happier-dev/protocol/dist/daemonExecutionRuns.d.ts +39 -0
  129. package/node_modules/@happier-dev/protocol/dist/daemonExecutionRuns.d.ts.map +1 -1
  130. package/node_modules/@happier-dev/protocol/dist/daemonExecutionRuns.js +4 -1
  131. package/node_modules/@happier-dev/protocol/dist/daemonExecutionRuns.js.map +1 -1
  132. package/node_modules/@happier-dev/protocol/dist/drafts/sessionDrafts.d.ts +80 -20
  133. package/node_modules/@happier-dev/protocol/dist/drafts/sessionDrafts.d.ts.map +1 -1
  134. package/node_modules/@happier-dev/protocol/dist/drafts/sessionDrafts.js +18 -1
  135. package/node_modules/@happier-dev/protocol/dist/drafts/sessionDrafts.js.map +1 -1
  136. package/node_modules/@happier-dev/protocol/dist/executionRunStartRequest.d.ts +25 -0
  137. package/node_modules/@happier-dev/protocol/dist/executionRunStartRequest.d.ts.map +1 -1
  138. package/node_modules/@happier-dev/protocol/dist/executionRunStartRequest.js +18 -0
  139. package/node_modules/@happier-dev/protocol/dist/executionRunStartRequest.js.map +1 -1
  140. package/node_modules/@happier-dev/protocol/dist/executionRuns.d.ts +51 -3
  141. package/node_modules/@happier-dev/protocol/dist/executionRuns.d.ts.map +1 -1
  142. package/node_modules/@happier-dev/protocol/dist/executionRuns.js +5 -2
  143. package/node_modules/@happier-dev/protocol/dist/executionRuns.js.map +1 -1
  144. package/node_modules/@happier-dev/protocol/dist/features/catalog.d.ts +12 -0
  145. package/node_modules/@happier-dev/protocol/dist/features/catalog.d.ts.map +1 -1
  146. package/node_modules/@happier-dev/protocol/dist/features/catalog.js +12 -0
  147. package/node_modules/@happier-dev/protocol/dist/features/catalog.js.map +1 -1
  148. package/node_modules/@happier-dev/protocol/dist/features/decision.d.ts +2 -0
  149. package/node_modules/@happier-dev/protocol/dist/features/decision.d.ts.map +1 -1
  150. package/node_modules/@happier-dev/protocol/dist/features/embeddedFeaturePolicies.generated.d.ts +1 -1
  151. package/node_modules/@happier-dev/protocol/dist/features/embeddedFeaturePolicies.generated.d.ts.map +1 -1
  152. package/node_modules/@happier-dev/protocol/dist/features/embeddedFeaturePolicies.generated.js +1 -1
  153. package/node_modules/@happier-dev/protocol/dist/features/embeddedFeaturePolicies.generated.js.map +1 -1
  154. package/node_modules/@happier-dev/protocol/dist/features/payload/featureGatesSchema.d.ts +6 -0
  155. package/node_modules/@happier-dev/protocol/dist/features/payload/featureGatesSchema.d.ts.map +1 -1
  156. package/node_modules/@happier-dev/protocol/dist/features/payload/featureGatesSchema.js +4 -0
  157. package/node_modules/@happier-dev/protocol/dist/features/payload/featureGatesSchema.js.map +1 -1
  158. package/node_modules/@happier-dev/protocol/dist/features/payload/featuresResponseSchema.d.ts +6 -0
  159. package/node_modules/@happier-dev/protocol/dist/features/payload/featuresResponseSchema.d.ts.map +1 -1
  160. package/node_modules/@happier-dev/protocol/dist/index.d.ts +11 -3
  161. package/node_modules/@happier-dev/protocol/dist/index.d.ts.map +1 -1
  162. package/node_modules/@happier-dev/protocol/dist/index.js +11 -3
  163. package/node_modules/@happier-dev/protocol/dist/index.js.map +1 -1
  164. package/node_modules/@happier-dev/protocol/dist/prompts/buildAppendSystemPromptBaseV1.js +1 -1
  165. package/node_modules/@happier-dev/protocol/dist/prompts/buildAppendSystemPromptBaseV1.js.map +1 -1
  166. package/node_modules/@happier-dev/protocol/dist/prompts/executionRunsGuidanceV1.d.ts.map +1 -1
  167. package/node_modules/@happier-dev/protocol/dist/prompts/executionRunsGuidanceV1.js +25 -35
  168. package/node_modules/@happier-dev/protocol/dist/prompts/executionRunsGuidanceV1.js.map +1 -1
  169. package/node_modules/@happier-dev/protocol/dist/scm.d.ts +6 -0
  170. package/node_modules/@happier-dev/protocol/dist/scm.d.ts.map +1 -1
  171. package/node_modules/@happier-dev/protocol/dist/scm.js +3 -0
  172. package/node_modules/@happier-dev/protocol/dist/scm.js.map +1 -1
  173. package/node_modules/@happier-dev/protocol/dist/scmRepositoryProvisioning.d.ts +6 -0
  174. package/node_modules/@happier-dev/protocol/dist/scmRepositoryProvisioning.d.ts.map +1 -1
  175. package/node_modules/@happier-dev/protocol/dist/sessionControl/contract.d.ts +164 -0
  176. package/node_modules/@happier-dev/protocol/dist/sessionControl/contract.d.ts.map +1 -1
  177. package/node_modules/@happier-dev/protocol/dist/sessionControl/contract.js +3 -0
  178. package/node_modules/@happier-dev/protocol/dist/sessionControl/contract.js.map +1 -1
  179. package/node_modules/@happier-dev/protocol/dist/sessionControl/pendingActivationAuthorizationV1.d.ts +32 -0
  180. package/node_modules/@happier-dev/protocol/dist/sessionControl/pendingActivationAuthorizationV1.d.ts.map +1 -0
  181. package/node_modules/@happier-dev/protocol/dist/sessionControl/pendingActivationAuthorizationV1.js +23 -0
  182. package/node_modules/@happier-dev/protocol/dist/sessionControl/pendingActivationAuthorizationV1.js.map +1 -0
  183. package/node_modules/@happier-dev/protocol/dist/sessionFolders/folderAssignments.d.ts +12 -0
  184. package/node_modules/@happier-dev/protocol/dist/sessionFolders/folderAssignments.d.ts.map +1 -1
  185. package/node_modules/@happier-dev/protocol/dist/sessionOrganization/constants.d.ts +1 -1
  186. package/node_modules/@happier-dev/protocol/dist/sessionOrganization/constants.d.ts.map +1 -1
  187. package/node_modules/@happier-dev/protocol/dist/sessionOrganization/constants.js +1 -1
  188. package/node_modules/@happier-dev/protocol/dist/sessionOrganization/constants.js.map +1 -1
  189. package/node_modules/@happier-dev/protocol/dist/sessionUserMessageRpc.d.ts +13 -0
  190. package/node_modules/@happier-dev/protocol/dist/sessionUserMessageRpc.d.ts.map +1 -1
  191. package/node_modules/@happier-dev/protocol/dist/sessionUserMessageRpc.js +2 -0
  192. package/node_modules/@happier-dev/protocol/dist/sessionUserMessageRpc.js.map +1 -1
  193. package/node_modules/@happier-dev/protocol/dist/sessionWorkState/sessionWorkStateRpc.d.ts +27 -1
  194. package/node_modules/@happier-dev/protocol/dist/sessionWorkState/sessionWorkStateRpc.d.ts.map +1 -1
  195. package/node_modules/@happier-dev/protocol/dist/sessionWorkState/sessionWorkStateRpc.js +0 -1
  196. package/node_modules/@happier-dev/protocol/dist/sessionWorkState/sessionWorkStateRpc.js.map +1 -1
  197. package/node_modules/@happier-dev/protocol/dist/spawnSession.d.ts +2 -1
  198. package/node_modules/@happier-dev/protocol/dist/spawnSession.d.ts.map +1 -1
  199. package/node_modules/@happier-dev/protocol/dist/spawnSession.js +2 -1
  200. package/node_modules/@happier-dev/protocol/dist/spawnSession.js.map +1 -1
  201. package/node_modules/@happier-dev/protocol/dist/structuredMessages/executionRunCompletionV1.d.ts +20 -0
  202. package/node_modules/@happier-dev/protocol/dist/structuredMessages/executionRunCompletionV1.d.ts.map +1 -0
  203. package/node_modules/@happier-dev/protocol/dist/structuredMessages/executionRunCompletionV1.js +21 -0
  204. package/node_modules/@happier-dev/protocol/dist/structuredMessages/executionRunCompletionV1.js.map +1 -0
  205. package/node_modules/@happier-dev/protocol/dist/updates.d.ts +35 -0
  206. package/node_modules/@happier-dev/protocol/dist/updates.d.ts.map +1 -1
  207. package/node_modules/@happier-dev/protocol/dist/updates.js +2 -0
  208. package/node_modules/@happier-dev/protocol/dist/updates.js.map +1 -1
  209. package/package.json +1 -1
  210. package/scripts/dev_cli_build_ownership.test.mjs +3 -1
  211. package/scripts/dev_external_server_flags.test.mjs +23 -5
  212. package/scripts/ghops.test.mjs +9 -3
  213. package/scripts/provision/linux-ubuntu-provision.sh +5 -0
  214. package/scripts/provision/linux-ubuntu-provision.test.mjs +3 -1
  215. package/scripts/self_host_launchd.real.integration.test.mjs +5 -3
  216. package/scripts/self_host_runtime.mjs +10 -9
  217. package/scripts/self_host_runtime.test.mjs +2 -2
  218. package/scripts/utils/dev/expo_dev.buildEnv.test.mjs +14 -0
  219. package/scripts/utils/dev/expo_dev.mjs +24 -1
  220. package/scripts/utils/dev_targets/mutagen_project.mjs +4 -1
  221. package/scripts/utils/dev_targets/mutagen_project.test.mjs +2 -1
  222. package/scripts/utils/dev_targets/remote_commands.mjs +5 -2
  223. package/scripts/utils/dev_targets/remote_commands.test.mjs +5 -2
  224. package/scripts/utils/dev_targets/supervisor.mjs +1 -0
  225. package/scripts/utils/dev_targets/supervisor.test.mjs +5 -0
  226. package/scripts/utils/server/apply_runtime_server_sqlite_env.test.mjs +2 -2
  227. package/scripts/utils/server/resolve_stack_server_port.test.mjs +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"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AAE,QAAQ,CAAC,OAAO;YAClC,UAAU,EAAE,MAAM,CAAC,IAAI;YACvB,aAAa,EAAE,MAAM,CAAC,OAAO;SAC9B,CAAC;IACJ,CAAC;IAED,OAAO;QACL,EAAE,EAAE,IAAI;QACR,aAAa,EAAE,MAAM,CAAC,IAAI;QAC1B,cAAc,EAAE,MAAM,CAAC,cAAc;QACrC,gBAAgB,EAAE,MAAM,CAAC,OAAO;QAChC,UAAU,EAAE,MAAM,CAAC,IAAI;QACvB,aAAa,EAAE,MAAM,CAAC,OAAO;KAC9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ export type RequestNotificationLabels = Readonly<{
2
+ command: string;
3
+ file: string;
4
+ selectOne: string;
5
+ selectMultiple: string;
6
+ customAnswer: string;
7
+ localMessages: string;
8
+ remoteMessages: string;
9
+ }>;
10
+ /** Human-readable request context shared by device, push, and webhook notifications. */
11
+ export declare function summarizeToolInputForNotification(toolName: string, toolInput: unknown, labels?: Partial<RequestNotificationLabels>): string | null;
12
+ //# sourceMappingURL=agentRequestNotificationContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentRequestNotificationContent.d.ts","sourceRoot":"","sources":["../../src/activity/agentRequestNotificationContent.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,yBAAyB,GAAG,QAAQ,CAAC;IAC/C,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC,CAAC;AAQH,wFAAwF;AACxF,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,GAAG,MAAM,GAAG,IAAI,CA4ClJ"}
@@ -0,0 +1,68 @@
1
+ import { isAskUserQuestionToolName, normalizeStructuredQuestionDescriptors } from '../tools/structuredQuestionAnswersV1.js';
2
+ import { extractFilePathLike } from './agentRequestSummary.js';
3
+ import { extractShellCommand } from './shellCommand.js';
4
+ import { maybeParseJson } from './parseJson.js';
5
+ function asRecord(value) {
6
+ return value && typeof value === 'object' && !Array.isArray(value) ? value : null;
7
+ }
8
+ function text(value) {
9
+ return typeof value === 'string' && value.trim() ? value.trim() : null;
10
+ }
11
+ const defaultLabels = {
12
+ command: 'Command', file: 'File', selectOne: 'Select one',
13
+ selectMultiple: 'Select multiple', customAnswer: 'Custom answer allowed',
14
+ localMessages: 'Local messages', remoteMessages: 'Remote messages',
15
+ };
16
+ /** Human-readable request context shared by device, push, and webhook notifications. */
17
+ export function summarizeToolInputForNotification(toolName, toolInput, labels) {
18
+ const display = { ...defaultLabels, ...labels };
19
+ const input = maybeParseJson(toolInput);
20
+ const record = asRecord(input);
21
+ if (isAskUserQuestionToolName(toolName)) {
22
+ const normalized = normalizeStructuredQuestionDescriptors(record?.questions);
23
+ if (!normalized.ok)
24
+ return null;
25
+ return normalized.questions.map((question) => [
26
+ question.header && question.header !== question.question ? question.header : null,
27
+ question.question ?? question.header,
28
+ question.options.length ? question.multiSelect ? display.selectMultiple : display.selectOne : null,
29
+ ...question.options.map((option) => `• ${option.label}${option.description ? ` — ${option.description}` : ''}`),
30
+ question.allowsFreeform ? display.customAnswer : null,
31
+ question.freeform?.description,
32
+ question.freeform?.placeholder,
33
+ ].filter(Boolean).join('\n')).join('\n\n');
34
+ }
35
+ const tool = toolName.trim().toLowerCase();
36
+ const actionDetails = [];
37
+ if (tool === 'exitplanmode' || tool === 'exit_plan_mode') {
38
+ actionDetails.push(text(record?.name), text(record?.overview), text(record?.plan));
39
+ }
40
+ else if (tool === 'acphistoryimport') {
41
+ actionDetails.push(text(record?.note));
42
+ if (typeof record?.localCount === 'number')
43
+ actionDetails.push(`${display.localMessages}: ${record.localCount}`);
44
+ if (typeof record?.remoteCount === 'number')
45
+ actionDetails.push(`${display.remoteMessages}: ${record.remoteCount}`);
46
+ }
47
+ else if (tool === 'webfetch' || tool === 'web_fetch') {
48
+ actionDetails.push(text(record?.url));
49
+ }
50
+ else if (tool === 'websearch' || tool === 'web_search') {
51
+ actionDetails.push(text(record?.query));
52
+ }
53
+ const permission = asRecord(record?.permission);
54
+ const command = extractShellCommand(input) ?? extractShellCommand({ command: record?.script });
55
+ const path = extractFilePathLike(input);
56
+ const details = [
57
+ ...actionDetails,
58
+ text(permission?.title) ?? text(record?.title),
59
+ command ? `${display.command}: ${command}` : null,
60
+ path ? `${display.file}: ${path}` : null,
61
+ text(permission?.description) ?? text(record?.description),
62
+ text(permission?.justification) ?? text(record?.justification),
63
+ text(permission?.reason) ?? text(record?.reason),
64
+ text(permission?.rationale) ?? text(record?.rationale),
65
+ ].filter((value) => value !== null);
66
+ return [...new Set(details)].join('\n') || null;
67
+ }
68
+ //# sourceMappingURL=agentRequestNotificationContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentRequestNotificationContent.js","sourceRoot":"","sources":["../../src/activity/agentRequestNotificationContent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,sCAAsC,EAAE,MAAM,yCAAyC,CAAC;AAC5H,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAgC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/G,CAAC;AAED,SAAS,IAAI,CAAC,KAAc;IAC1B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAA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M,EAAE,SAAS,CAAC;KACvD,CAAC,MAAM,CAAC,CAAC,KAAK,EAAmB,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC;AAClD,CAAC"}
@@ -0,0 +1,8 @@
1
+ type FormatPermissionRequestSummaryParams = {
2
+ toolName: string;
3
+ toolInput: unknown;
4
+ };
5
+ export declare function extractFilePathLike(input: unknown): string | null;
6
+ export declare function formatPermissionRequestSummary(params: FormatPermissionRequestSummaryParams): string;
7
+ export {};
8
+ //# sourceMappingURL=agentRequestSummary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentRequestSummary.d.ts","sourceRoot":"","sources":["../../src/activity/agentRequestSummary.ts"],"names":[],"mappings":"AAEA,KAAK,oCAAoC,GAAG;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;CACtB,CAAC;AAgCF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAyCjE;AAED,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,oCAAoC,GAAG,MAAM,CAmCnG"}
@@ -0,0 +1,100 @@
1
+ import { extractShellCommand } from './shellCommand.js';
2
+ function normalizeToolLabel(toolName) {
3
+ const raw = toolName.trim();
4
+ if (!raw)
5
+ return 'tool operation';
6
+ const lower = raw.toLowerCase();
7
+ if (lower === 'unknown' || lower === 'unknown tool' || lower === 'other') {
8
+ return 'tool operation';
9
+ }
10
+ return raw;
11
+ }
12
+ function asRecord(value) {
13
+ if (!value || typeof value !== 'object' || Array.isArray(value))
14
+ return null;
15
+ return value;
16
+ }
17
+ function firstString(value) {
18
+ return typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;
19
+ }
20
+ function extractFirstPath(locations) {
21
+ if (!Array.isArray(locations) || locations.length === 0)
22
+ return null;
23
+ const first = asRecord(locations[0]);
24
+ if (!first)
25
+ return null;
26
+ return (firstString(first.path) ??
27
+ firstString(first.filePath) ??
28
+ null);
29
+ }
30
+ export function extractFilePathLike(input) {
31
+ const obj = asRecord(input);
32
+ if (!obj)
33
+ return null;
34
+ // Common ACP-style format: { locations: [{ path }] }
35
+ const locPath = extractFirstPath(obj.locations);
36
+ if (locPath)
37
+ return locPath;
38
+ // Gemini ACP-style nested format: { toolCall: { content: [{ path }] } }
39
+ const toolCall = asRecord(obj.toolCall);
40
+ const toolCallLocPath = extractFirstPath(toolCall?.locations);
41
+ if (toolCallLocPath)
42
+ return toolCallLocPath;
43
+ const contentArr = toolCall && Array.isArray(toolCall.content) ? toolCall.content : null;
44
+ if (contentArr && contentArr.length > 0) {
45
+ const first = asRecord(contentArr[0]);
46
+ const nestedPath = firstString(first?.path);
47
+ if (nestedPath)
48
+ return nestedPath;
49
+ }
50
+ // Gemini ACP-style array format: { input: [{ path }] }
51
+ const inputArr = Array.isArray(obj.input) ? obj.input : null;
52
+ if (inputArr && inputArr.length > 0) {
53
+ const first = asRecord(inputArr[0]);
54
+ const nestedPath = firstString(first?.path);
55
+ if (nestedPath)
56
+ return nestedPath;
57
+ }
58
+ // ACP diff-style format: { items: [{ path }] }
59
+ const itemPath = extractFirstPath(obj.items);
60
+ if (itemPath)
61
+ return itemPath;
62
+ return (firstString(obj.filePath) ??
63
+ firstString(obj.file_path) ??
64
+ firstString(obj.path) ??
65
+ firstString(obj.filepath) ??
66
+ firstString(obj.file) ??
67
+ firstString(obj.filename) ??
68
+ firstString(obj.fileName) ??
69
+ null);
70
+ }
71
+ export function formatPermissionRequestSummary(params) {
72
+ const rawToolName = params.toolName || 'unknown';
73
+ const toolName = normalizeToolLabel(rawToolName);
74
+ const lower = toolName.toLowerCase();
75
+ const obj = asRecord(params.toolInput);
76
+ const permissionTitle = (() => {
77
+ const permission = asRecord(obj?.permission);
78
+ return (firstString(permission?.title) ??
79
+ firstString(obj?.title) ??
80
+ null);
81
+ })();
82
+ if (permissionTitle) {
83
+ return permissionTitle;
84
+ }
85
+ const command = extractShellCommand(params.toolInput);
86
+ if (command && (lower === 'bash' || lower === 'execute' || lower === 'shell')) {
87
+ return `Run: ${command}`;
88
+ }
89
+ const filePath = extractFilePathLike(params.toolInput);
90
+ if (filePath && (lower === 'read' || lower === 'write' || lower === 'edit' || lower === 'multiedit')) {
91
+ const verb = lower === 'read' ? 'Read' : lower === 'write' ? 'Write' : 'Edit';
92
+ return `${verb}: ${filePath}`;
93
+ }
94
+ const hasAnyKeys = obj ? Object.keys(obj).length > 0 : false;
95
+ if (!hasAnyKeys) {
96
+ return `Permission required: ${toolName} (details unavailable)`;
97
+ }
98
+ return `Permission required: ${toolName}`;
99
+ }
100
+ //# sourceMappingURL=agentRequestSummary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentRequestSummary.js","sourceRoot":"","sources":["../../src/activity/agentRequestSummary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAOxD,SAAS,kBAAkB,CAAC,QAAgB;IACxC,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,CAAC,GAAG;QAAE,OAAO,gBAAgB,CAAC;IAClC,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IAChC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,cAAc,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;QACvE,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC5B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7E,OAAO,KAAgC,CAAC;AAC5C,CAAC;AAED,SAAS,WAAW,C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I,CAAC,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC7D,IAAI,CAAC,UAAU,EAAE,CAAC;QACd,OAAO,wBAAwB,QAAQ,wBAAwB,CAAC;IACpE,CAAC;IAED,OAAO,wBAAwB,QAAQ,EAAE,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function maybeParseJson(value: unknown): unknown;
2
+ //# sourceMappingURL=parseJson.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseJson.d.ts","sourceRoot":"","sources":["../../src/activity/parseJson.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAuBtD"}
@@ -0,0 +1,32 @@
1
+ export function maybeParseJson(value) {
2
+ if (typeof value !== 'string')
3
+ return value;
4
+ const trimmed = value.trim();
5
+ if (!trimmed)
6
+ return value;
7
+ const first = trimmed[0];
8
+ if (first !== '{' && first !== '[' && first !== '"')
9
+ return value;
10
+ try {
11
+ const parsed = JSON.parse(trimmed);
12
+ if (typeof parsed === 'string') {
13
+ const nested = parsed.trim();
14
+ if (!nested)
15
+ return value;
16
+ const nestedFirst = nested[0];
17
+ if (nestedFirst !== '{' && nestedFirst !== '[')
18
+ return value;
19
+ try {
20
+ return JSON.parse(nested);
21
+ }
22
+ catch {
23
+ return value;
24
+ }
25
+ }
26
+ return parsed;
27
+ }
28
+ catch {
29
+ return value;
30
+ }
31
+ }
32
+ //# sourceMappingURL=parseJson.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseJson.js","sourceRoot":"","sources":["../../src/activity/parseJson.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,cAAc,CAAC,KAAc;IACzC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7B,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACzB,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,KAAK,CAAC;IAClE,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAY,CAAC;QAC9C,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;YAC7B,IAAI,CAAC,MAAM;gBAAE,OAAO,KAAK,CAAC;YAC1B,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;YAC9B,IAAI,WAAW,KAAK,GAAG,IAAI,WAAW,KAAK,GAAG;gBAAE,OAAO,KAAK,CAAC;YAC7D,IAAI,CAAC;gBACD,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAY,CAAC;YACzC,CAAC;YAAC,MAAM,CAAC;gBACL,OAAO,KAAK,CAAC;YACjB,CAAC;QACL,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,KAAK,CAAC;IACjB,CAAC;AACL,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Strip a UX-noise prelude that some agent runtimes prepend to shell commands.
3
+ *
4
+ * In Claude Code, Bash tool calls are often prefixed with an `unset ...;` segment to scrub
5
+ * auth-related env vars before executing the actual command.
6
+ *
7
+ * This helper is display-oriented: it preserves the *raw* command in tool input (details view),
8
+ * but returns a clearer "effective command" for titles/subtitles and terminal previews.
9
+ */
10
+ export declare function stripShellCommandPreludeForDisplay(command: string): string;
11
+ export declare function extractShellCommand(input: unknown): string | null;
12
+ //# sourceMappingURL=shellCommand.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellCommand.d.ts","sourceRoot":"","sources":["../../src/activity/shellCommand.ts"],"names":[],"mappings":"AA4BA;;;;;;;;GAQG;AACH,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAQ1E;AAYD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CA2EjE"}
@@ -0,0 +1,120 @@
1
+ import { maybeParseJson } from './parseJson.js';
2
+ function asRecord(value) {
3
+ if (!value || typeof value !== 'object' || Array.isArray(value))
4
+ return null;
5
+ return value;
6
+ }
7
+ function stripLeadingEnvAssignments(input) {
8
+ const parts = input.trim().split(/\s+/);
9
+ let i = 0;
10
+ while (i < parts.length && /^[A-Za-z_][A-Za-z0-9_]*=/.test(parts[i])) {
11
+ i++;
12
+ }
13
+ return parts.slice(i).join(' ');
14
+ }
15
+ function stripLeadingUnsetPrelude(input) {
16
+ const trimmed = input.trimStart();
17
+ if (!trimmed.startsWith('unset '))
18
+ return input;
19
+ // Only strip a simple "unset VAR VAR2; <cmd>" prelude. If there is no semicolon,
20
+ // or if it looks like a real unset invocation (flags/assignments), keep it.
21
+ const match = trimmed.match(/^unset(?:\s+[A-Za-z_][A-Za-z0-9_]*)+\s*;\s*/);
22
+ if (!match)
23
+ return input;
24
+ return trimmed.slice(match[0].length);
25
+ }
26
+ /**
27
+ * Strip a UX-noise prelude that some agent runtimes prepend to shell commands.
28
+ *
29
+ * In Claude Code, Bash tool calls are often prefixed with an `unset ...;` segment to scrub
30
+ * auth-related env vars before executing the actual command.
31
+ *
32
+ * This helper is display-oriented: it preserves the *raw* command in tool input (details view),
33
+ * but returns a clearer "effective command" for titles/subtitles and terminal previews.
34
+ */
35
+ export function stripShellCommandPreludeForDisplay(command) {
36
+ let out = command.trim();
37
+ for (let i = 0; i < 5; i++) {
38
+ const next = stripLeadingUnsetPrelude(stripLeadingEnvAssignments(out)).trim();
39
+ if (next === out)
40
+ break;
41
+ out = next;
42
+ }
43
+ return out;
44
+ }
45
+ function extractCommandArrayLike(value) {
46
+ if (!Array.isArray(value))
47
+ return null;
48
+ const parts = [];
49
+ for (const item of value) {
50
+ if (typeof item !== 'string')
51
+ return null;
52
+ parts.push(item);
53
+ }
54
+ return parts;
55
+ }
56
+ export function extractShellCommand(input) {
57
+ const parsed = maybeParseJson(input);
58
+ // Sometimes we get raw argv arrays directly (e.g. ['echo', 'hi']).
59
+ const rawArgvArray = extractCommandArrayLike(parsed);
60
+ if (rawArgvArray && rawArgvArray.length > 0) {
61
+ // Remove shell wrapper prefix if present (bash/zsh with -lc flag)
62
+ if (rawArgvArray.length >= 3
63
+ && (rawArgvArray[0] === 'bash'
64
+ || rawArgvArray[0] === '/bin/bash'
65
+ || rawArgvArray[0] === 'zsh'
66
+ || rawArgvArray[0] === '/bin/zsh')
67
+ && rawArgvArray[1] === '-lc'
68
+ && typeof rawArgvArray[2] === 'string') {
69
+ return rawArgvArray[2];
70
+ }
71
+ return rawArgvArray.join(' ');
72
+ }
73
+ const obj = asRecord(parsed);
74
+ if (!obj)
75
+ return null;
76
+ // Common: { command: string }
77
+ const command = obj.command;
78
+ if (typeof command === 'string' && command.trim().length > 0) {
79
+ return command.trim();
80
+ }
81
+ // Common: { command: string[] }
82
+ const cmdArray = extractCommandArrayLike(command);
83
+ if (cmdArray && cmdArray.length > 0) {
84
+ // Remove shell wrapper prefix if present (bash/zsh with -lc flag)
85
+ if (cmdArray.length >= 3
86
+ && (cmdArray[0] === 'bash' || cmdArray[0] === '/bin/bash' || cmdArray[0] === 'zsh' || cmdArray[0] === '/bin/zsh')
87
+ && cmdArray[1] === '-lc'
88
+ && typeof cmdArray[2] === 'string') {
89
+ return cmdArray[2];
90
+ }
91
+ return cmdArray.join(' ');
92
+ }
93
+ // Common: { cmd: string | string[] }
94
+ const cmd = obj.cmd;
95
+ if (typeof cmd === 'string' && cmd.trim().length > 0) {
96
+ return cmd.trim();
97
+ }
98
+ const cmdArray2 = extractCommandArrayLike(cmd);
99
+ if (cmdArray2 && cmdArray2.length > 0) {
100
+ return extractShellCommand({ command: cmdArray2 });
101
+ }
102
+ // Common: { argv: string[] }
103
+ const argvArray = extractCommandArrayLike(obj.argv);
104
+ if (argvArray && argvArray.length > 0) {
105
+ return extractShellCommand({ command: argvArray });
106
+ }
107
+ // Our ACP parser wraps raw arrays as { items: [...] }
108
+ const itemsArray = extractCommandArrayLike(obj.items);
109
+ if (itemsArray && itemsArray.length > 0) {
110
+ return extractShellCommand({ command: itemsArray });
111
+ }
112
+ // Nested: { toolCall: { rawInput: { command } } }
113
+ const toolCall = asRecord(obj.toolCall);
114
+ const rawInput = toolCall ? asRecord(toolCall.rawInput) : null;
115
+ if (rawInput) {
116
+ return extractShellCommand(rawInput);
117
+ }
118
+ return null;
119
+ }
120
+ //# sourceMappingURL=shellCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shellCommand.js","sourceRoot":"","sources":["../../src/activity/shellCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAIhD,SAAS,QAAQ,CAAC,KAAc;IAC5B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7E,OAAO,KAAsB,CAAC;AAClC,CAAC;AAED,SAAS,0BAA0B,CAAC,KAAa;IAC7C,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,OAAO,CAAC,GAAG,KAAK,CAAC,MAAM,IAAI,0BAA0B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACnE,CAAC,EAAE,CAAC;IACR,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAa;IA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AG,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC/D,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { CURRENT_PENDING_INPUT_PROTOCOL_VERSION, PENDING_INPUT_PROTOCOL_VERSION_V1, SESSION_SYNC_PROTOCOL_VERSION_RUNTIME_ACTIVITY, ClientAppVersionSchema, ClientKindSchema, ClientReleaseChannelSchema, SafeHttpsUrlSchema, type ClientKind, } from './primitives.js';
1
+ export { CURRENT_PENDING_INPUT_PROTOCOL_VERSION, PENDING_INPUT_PROTOCOL_VERSION_V1, PENDING_INPUT_PROTOCOL_VERSION_V2, SESSION_SYNC_PROTOCOL_VERSION_RUNTIME_ACTIVITY, ClientAppVersionSchema, ClientKindSchema, ClientReleaseChannelSchema, SafeHttpsUrlSchema, type ClientKind, } from './primitives.js';
2
2
  export { CLIENT_UPGRADE_REQUIRED_ERROR_CODE, CLIENT_UPGRADE_REQUIRED_HTTP_STATUS, ClientUpgradeRequiredRequirementV1Schema, ClientUpgradeRequiredV1Schema, type ClientUpgradeRequiredV1, } from './upgradeRequiredV1.js';
3
3
  export { VERSION_ENDPOINT_PATH, ClientVersionCheckRequestV1Schema, ClientVersionCheckResponseV1Schema, type ClientVersionCheckRequestV1, type ClientVersionCheckResponseV1, } from './versionEndpointV1.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clientCompatibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,iCAAiC,EACjC,8CAA8C,EAC9C,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,EAClB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kCAAkC,EAClC,mCAAmC,EACnC,wCAAwC,EACxC,6BAA6B,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,iCAAiC,EACjC,kCAAkC,EAClC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,GAClC,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/clientCompatibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,iCAAiC,EACjC,iCAAiC,EACjC,8CAA8C,EAC9C,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,EAClB,KAAK,UAAU,GAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kCAAkC,EAClC,mCAAmC,EACnC,wCAAwC,EACxC,6BAA6B,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,iCAAiC,EACjC,kCAAkC,EAClC,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,GAClC,MAAM,wBAAwB,CAAC"}
@@ -1,4 +1,4 @@
1
- export { CURRENT_PENDING_INPUT_PROTOCOL_VERSION, PENDING_INPUT_PROTOCOL_VERSION_V1, SESSION_SYNC_PROTOCOL_VERSION_RUNTIME_ACTIVITY, ClientAppVersionSchema, ClientKindSchema, ClientReleaseChannelSchema, SafeHttpsUrlSchema, } from './primitives.js';
1
+ export { CURRENT_PENDING_INPUT_PROTOCOL_VERSION, PENDING_INPUT_PROTOCOL_VERSION_V1, PENDING_INPUT_PROTOCOL_VERSION_V2, SESSION_SYNC_PROTOCOL_VERSION_RUNTIME_ACTIVITY, ClientAppVersionSchema, ClientKindSchema, ClientReleaseChannelSchema, SafeHttpsUrlSchema, } from './primitives.js';
2
2
  export { CLIENT_UPGRADE_REQUIRED_ERROR_CODE, CLIENT_UPGRADE_REQUIRED_HTTP_STATUS, ClientUpgradeRequiredRequirementV1Schema, ClientUpgradeRequiredV1Schema, } from './upgradeRequiredV1.js';
3
3
  export { VERSION_ENDPOINT_PATH, ClientVersionCheckRequestV1Schema, ClientVersionCheckResponseV1Schema, } from './versionEndpointV1.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clientCompatibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,iCAAiC,EACjC,8CAA8C,EAC9C,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,GAEnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kCAAkC,EAClC,mCAAmC,EACnC,wCAAwC,EACxC,6BAA6B,GAE9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,iCAAiC,EACjC,kCAAkC,GAGnC,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/clientCompatibility/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sCAAsC,EACtC,iCAAiC,EACjC,iCAAiC,EACjC,8CAA8C,EAC9C,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,kBAAkB,GAEnB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kCAAkC,EAClC,mCAAmC,EACnC,wCAAwC,EACxC,6BAA6B,GAE9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,qBAAqB,EACrB,iCAAiC,EACjC,kCAAkC,GAGnC,MAAM,wBAAwB,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  export declare const SESSION_SYNC_PROTOCOL_VERSION_RUNTIME_ACTIVITY: 2;
3
3
  export declare const PENDING_INPUT_PROTOCOL_VERSION_V1: 1;
4
- export declare const CURRENT_PENDING_INPUT_PROTOCOL_VERSION: 1;
4
+ export declare const PENDING_INPUT_PROTOCOL_VERSION_V2: 2;
5
+ export declare const CURRENT_PENDING_INPUT_PROTOCOL_VERSION: 2;
5
6
  export declare const ClientKindSchema: z.ZodEnum<{
6
7
  cli: "cli";
7
8
  daemon: "daemon";
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/clientCompatibility/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,8CAA8C,EAAG,CAAU,CAAC;AACzE,eAAO,MAAM,iCAAiC,EAAG,CAAU,CAAC;AAC5D,eAAO,MAAM,sCAAsC,GAAoC,CAAC;AAExF,eAAO,MAAM,gBAAgB;;;;;;;;EAQ3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,sBAAsB,aAIM,CAAC;AAE1C,eAAO,MAAM,0BAA0B,aAIP,CAAC;AAEjC,eAAO,MAAM,kBAAkB,aAkBE,CAAC"}
1
+ {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../src/clientCompatibility/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,8CAA8C,EAAG,CAAU,CAAC;AACzE,eAAO,MAAM,iCAAiC,EAAG,CAAU,CAAC;AAC5D,eAAO,MAAM,iCAAiC,EAAG,CAAU,CAAC;AAC5D,eAAO,MAAM,sCAAsC,GAAoC,CAAC;AAExF,eAAO,MAAM,gBAAgB;;;;;;;;EAQ3B,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,eAAO,MAAM,sBAAsB,aAIM,CAAC;AAE1C,eAAO,MAAM,0BAA0B,aAIP,CAAC;AAEjC,eAAO,MAAM,kBAAkB,aAkBE,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { z } from 'zod';
2
2
  export const SESSION_SYNC_PROTOCOL_VERSION_RUNTIME_ACTIVITY = 2;
3
3
  export const PENDING_INPUT_PROTOCOL_VERSION_V1 = 1;
4
- export const CURRENT_PENDING_INPUT_PROTOCOL_VERSION = PENDING_INPUT_PROTOCOL_VERSION_V1;
4
+ export const PENDING_INPUT_PROTOCOL_VERSION_V2 = 2;
5
+ export const CURRENT_PENDING_INPUT_PROTOCOL_VERSION = PENDING_INPUT_PROTOCOL_VERSION_V2;
5
6
  export const ClientKindSchema = z.enum([
6
7
  'ui-web',
7
8
  'ui-ios',
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../src/clientCompatibility/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,8CAA8C,GAAG,CAAU,CAAC;AACzE,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAU,CAAC;AAC5D,MAAM,CAAC,MAAM,sCAAsC,GAAG,iCAAiC,CAAC;AAExF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,QAAQ;IACR,QAAQ;IACR,YAAY;IACZ,YAAY;IACZ,KAAK;IACL,QAAQ;IACR,gBAAgB;CACjB,CAAC,CAAC;AAIH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CAAC,+BAA+B,CAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CAAC,sBAAsB,CAAC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;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CAAC,+BAA+B,CAAC,CAAC;AAE1C,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAEjC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC;KAChC,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,KAAK,CAAC;KACV,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;IAChB,2EAA2E;IAC3E,wEAAwE;IACxE,sEAAsE;IACtE,IAAI,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;QAC9B,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ;eAC9B,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC;eAC1B,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;eAC5B,MAAM,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC;IACpC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,EAAE,2BAA2B,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ export declare const PROVIDER_ACCOUNT_SUBSCRIPTION_ACCEPT = "application/json; happier-account-subscription=1";
3
+ export declare const SealedProviderAccountSubscriptionV1Schema: z.ZodObject<{
4
+ ciphertext: z.ZodString;
5
+ observedAtMs: z.ZodNumber;
6
+ }, z.core.$strict>;
7
+ export declare const ProviderAccountSubscriptionV1Schema: z.ZodObject<{
8
+ status: z.ZodEnum<{
9
+ none: "none";
10
+ subscribed: "subscribed";
11
+ unavailable: "unavailable";
12
+ }>;
13
+ renewal: z.ZodEnum<{
14
+ off: "off";
15
+ on: "on";
16
+ unknown: "unknown";
17
+ }>;
18
+ observedAtMs: z.ZodNumber;
19
+ staleAfterMs: z.ZodNumber;
20
+ currentPeriodStartAtMs: z.ZodOptional<z.ZodNumber>;
21
+ currentPeriodEndAtMs: z.ZodOptional<z.ZodNumber>;
22
+ lastRefreshError: z.ZodOptional<z.ZodObject<{
23
+ observedAtMs: z.ZodNumber;
24
+ code: z.ZodEnum<{
25
+ auth_failure: "auth_failure";
26
+ malformed: "malformed";
27
+ missing_auth: "missing_auth";
28
+ network: "network";
29
+ provider_backoff: "provider_backoff";
30
+ }>;
31
+ status: z.ZodOptional<z.ZodNumber>;
32
+ }, z.core.$strict>>;
33
+ }, z.core.$strict>;
34
+ export type ProviderAccountSubscriptionV1 = z.infer<typeof ProviderAccountSubscriptionV1Schema>;
35
+ export declare function mergeProviderAccountSubscription(previous: ProviderAccountSubscriptionV1 | undefined, incoming: ProviderAccountSubscriptionV1 | undefined): ProviderAccountSubscriptionV1 | undefined;
36
+ //# sourceMappingURL=accountSubscription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accountSubscription.d.ts","sourceRoot":"","sources":["../../src/connect/accountSubscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,oCAAoC,qDAAqD,CAAC;AAEvG,eAAO,MAAM,yCAAyC;;;kBAG3C,CAAC;AAEZ,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;kBAYrC,CAAC;AAEZ,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mCAAmC,CAAC,CAAC;AAEhG,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,6BAA6B,GAAG,SAAS,EACnD,QAAQ,EAAE,6BAA6B,GAAG,SAAS,GAClD,6BAA6B,GAAG,SAAS,CAY3C"}
@@ -0,0 +1,36 @@
1
+ import { z } from 'zod';
2
+ export const PROVIDER_ACCOUNT_SUBSCRIPTION_ACCEPT = 'application/json; happier-account-subscription=1';
3
+ export const SealedProviderAccountSubscriptionV1Schema = z.object({
4
+ ciphertext: z.string().min(1),
5
+ observedAtMs: z.number().int().nonnegative(),
6
+ }).strict();
7
+ export const ProviderAccountSubscriptionV1Schema = z.object({
8
+ status: z.enum(['subscribed', 'none', 'unavailable']),
9
+ renewal: z.enum(['on', 'off', 'unknown']),
10
+ observedAtMs: z.number().int().nonnegative(),
11
+ staleAfterMs: z.number().int().positive(),
12
+ currentPeriodStartAtMs: z.number().int().nonnegative().optional(),
13
+ currentPeriodEndAtMs: z.number().int().nonnegative().optional(),
14
+ lastRefreshError: z.object({
15
+ observedAtMs: z.number().int().nonnegative(),
16
+ code: z.enum(['network', 'malformed', 'provider_backoff', 'auth_failure', 'missing_auth']),
17
+ status: z.number().int().min(100).max(599).optional(),
18
+ }).strict().optional(),
19
+ }).strict();
20
+ export function mergeProviderAccountSubscription(previous, incoming) {
21
+ if (!incoming)
22
+ return previous;
23
+ if (!previous)
24
+ return incoming;
25
+ const previousCheckedAt = Math.max(previous.observedAtMs, previous.lastRefreshError?.observedAtMs ?? 0);
26
+ const incomingCheckedAt = Math.max(incoming.observedAtMs, incoming.lastRefreshError?.observedAtMs ?? 0);
27
+ if (incomingCheckedAt < previousCheckedAt)
28
+ return previous;
29
+ if (incoming.status === 'unavailable' && previous.status !== 'unavailable') {
30
+ return incoming.lastRefreshError
31
+ ? { ...previous, lastRefreshError: incoming.lastRefreshError }
32
+ : previous;
33
+ }
34
+ return incoming;
35
+ }
36
+ //# sourceMappingURL=accountSubscription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accountSubscription.js","sourceRoot":"","sources":["../../src/connect/accountSubscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAA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