ethagent 2.2.0 → 2.4.0

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 (168) hide show
  1. package/README.md +11 -0
  2. package/package.json +2 -1
  3. package/src/app/FirstRun.tsx +3 -7
  4. package/src/app/FirstRunTimeline.tsx +1 -1
  5. package/src/chat/ChatBottomPane.tsx +29 -11
  6. package/src/chat/ChatScreen.tsx +169 -38
  7. package/src/chat/ConversationStack.tsx +1 -1
  8. package/src/chat/MessageList.tsx +185 -72
  9. package/src/chat/SessionStatus.tsx +3 -1
  10. package/src/chat/chatScreenUtils.ts +11 -15
  11. package/src/chat/chatSessionState.ts +5 -2
  12. package/src/chat/chatTurnOrchestrator.ts +7 -9
  13. package/src/chat/commands.ts +26 -26
  14. package/src/chat/display/DiffView.tsx +193 -0
  15. package/src/chat/display/SyntaxText.tsx +192 -0
  16. package/src/chat/display/toolCallDisplay.ts +103 -0
  17. package/src/chat/display/toolResultDisplay.ts +19 -0
  18. package/src/chat/{ChatInput.tsx → input/ChatInput.tsx} +61 -25
  19. package/src/chat/input/imageRefs.ts +30 -0
  20. package/src/chat/{TranscriptView.tsx → transcript/TranscriptView.tsx} +24 -50
  21. package/src/chat/{transcriptViewport.ts → transcript/transcriptViewport.ts} +12 -30
  22. package/src/chat/{ContextLimitView.tsx → views/ContextLimitView.tsx} +3 -3
  23. package/src/chat/{ContinuityEditReviewView.tsx → views/ContinuityEditReviewView.tsx} +11 -3
  24. package/src/chat/{CopyPicker.tsx → views/CopyPicker.tsx} +4 -5
  25. package/src/chat/{PermissionPrompt.tsx → views/PermissionPrompt.tsx} +16 -17
  26. package/src/chat/{PermissionsView.tsx → views/PermissionsView.tsx} +6 -6
  27. package/src/chat/{PlanApprovalView.tsx → views/PlanApprovalView.tsx} +4 -4
  28. package/src/chat/{ResumeView.tsx → views/ResumeView.tsx} +50 -41
  29. package/src/chat/views/RewindView.tsx +410 -0
  30. package/src/identity/continuity/privateEdit/diff.ts +2 -78
  31. package/src/identity/hub/OperationalRoutes.tsx +21 -21
  32. package/src/identity/hub/Routes.tsx +13 -13
  33. package/src/identity/hub/{flows/continuity → continuity}/ContinuityDashboardScreen.tsx +9 -9
  34. package/src/identity/hub/{flows/continuity → continuity}/RebackupStorageScreen.tsx +2 -2
  35. package/src/identity/hub/{flows/continuity → continuity}/RecoveryConfirmScreen.tsx +5 -5
  36. package/src/identity/hub/{flows/continuity → continuity}/SavePromptScreen.tsx +5 -5
  37. package/src/identity/hub/{effects/rebackup/runRebackup.ts → continuity/effects.ts} +17 -17
  38. package/src/identity/hub/{effects/rebackup → continuity}/index.ts +1 -1
  39. package/src/identity/hub/{effects/shared → continuity}/snapshot.ts +8 -8
  40. package/src/identity/hub/{effects/rebackup → continuity}/vault.ts +15 -15
  41. package/src/identity/hub/{flows/create → create}/CreateFlow.tsx +13 -13
  42. package/src/identity/hub/{effects/create.ts → create/effects.ts} +4 -4
  43. package/src/identity/hub/{flows/custody → custody}/CustodyEditFlow.tsx +9 -9
  44. package/src/identity/hub/{flows/custody/custodyFlowActions.ts → custody/actions.ts} +6 -6
  45. package/src/identity/hub/{flows/custody/custodyFlowHelpers.ts → custody/helpers.ts} +4 -4
  46. package/src/identity/hub/{effects/vault → custody}/preflight.ts +5 -5
  47. package/src/identity/hub/{flows/custody/custodyFlowRoutes.tsx → custody/routes.tsx} +8 -8
  48. package/src/identity/hub/{flows/custody/custodyEffects.ts → custody/transactions.ts} +9 -9
  49. package/src/identity/hub/{flows/custody/custodyFlowTypes.ts → custody/types.ts} +5 -5
  50. package/src/identity/hub/{flows/custody/custodyFlowEffects.ts → custody/useCustodyEffects.ts} +7 -7
  51. package/src/identity/hub/{flows/custody → custody}/useCustodyFlow.tsx +5 -5
  52. package/src/identity/hub/{flows/ens → ens}/EnsEditAdvancedScreens.tsx +13 -13
  53. package/src/identity/hub/{flows/ens → ens}/EnsEditFlow.tsx +7 -7
  54. package/src/identity/hub/{flows/ens → ens}/EnsEditMaintenanceScreens.tsx +10 -10
  55. package/src/identity/hub/{flows/ens → ens}/EnsEditReviewScreens.tsx +12 -12
  56. package/src/identity/hub/{flows/ens → ens}/EnsEditRunners.tsx +5 -5
  57. package/src/identity/hub/{flows/ens → ens}/EnsEditShared.tsx +10 -10
  58. package/src/identity/hub/{flows/ens → ens}/EnsEditSimpleScreens.tsx +14 -14
  59. package/src/identity/hub/{flows/ens/IdentityHubEnsFlow.tsx → ens/EnsFlow.tsx} +12 -12
  60. package/src/identity/hub/{flows/ens/OperatorWalletsScreen.tsx → ens/EnsOperatorWalletsScreen.tsx} +17 -17
  61. package/src/identity/hub/{advancedEnsValidation.ts → ens/advancedEnsValidation.ts} +2 -2
  62. package/src/identity/hub/{flows/ens/ensEditCopy.ts → ens/editCopy.ts} +3 -3
  63. package/src/identity/hub/{effects/ens/flows.ts → ens/effects.ts} +7 -7
  64. package/src/identity/hub/{effects/ens → ens}/index.ts +1 -1
  65. package/src/identity/hub/{model/ens.ts → ens/state.ts} +1 -1
  66. package/src/identity/hub/{effects/ens → ens}/transactions.ts +239 -239
  67. package/src/identity/hub/{flows/ens/ensEditTypes.ts → ens/types.ts} +7 -7
  68. package/src/identity/hub/identityHubReducer.ts +3 -3
  69. package/src/identity/hub/{flows/profile → profile}/EditProfileFlow.tsx +11 -11
  70. package/src/identity/hub/{effects/publicProfile/runPublicProfileSave.ts → profile/effects.ts} +18 -18
  71. package/src/identity/hub/{model → profile}/identity.ts +3 -3
  72. package/src/identity/hub/{effects/profile/profileState.ts → profile/state.ts} +181 -181
  73. package/src/identity/hub/{flows/restore → restore}/RestoreFlow.tsx +16 -16
  74. package/src/identity/hub/{effects/restore → restore}/apply.ts +10 -10
  75. package/src/identity/hub/{effects/restore → restore}/auth.ts +7 -7
  76. package/src/identity/hub/{effects/restore → restore}/discover.ts +6 -6
  77. package/src/identity/hub/{effects/restore → restore}/envelopes.ts +2 -2
  78. package/src/identity/hub/{effects/restore → restore}/fetch.ts +3 -3
  79. package/src/identity/hub/{effects/restore/shared.ts → restore/helpers.ts} +6 -6
  80. package/src/identity/hub/{effects/restore → restore}/recovery.ts +10 -10
  81. package/src/identity/hub/{effects/restore → restore}/resolve.ts +4 -4
  82. package/src/identity/hub/{effects → restore}/restoreAdmin.ts +1 -1
  83. package/src/identity/hub/{flows/restore/useRestoreFlowEffects.ts → restore/useRestoreEffects.ts} +5 -5
  84. package/src/identity/hub/{flows/settings → settings}/StorageCredentialScreen.tsx +5 -5
  85. package/src/identity/hub/{components → shared/components}/BusyScreen.tsx +4 -4
  86. package/src/identity/hub/{components → shared/components}/DetailsScreen.tsx +4 -4
  87. package/src/identity/hub/{components → shared/components}/ErrorScreen.tsx +4 -4
  88. package/src/identity/hub/{components → shared/components}/FlowTimeline.tsx +1 -1
  89. package/src/identity/hub/{components → shared/components}/IdentitySummary.tsx +8 -8
  90. package/src/identity/hub/{components → shared/components}/MenuScreen.tsx +7 -7
  91. package/src/identity/hub/{components → shared/components}/NetworkScreen.tsx +4 -4
  92. package/src/identity/hub/{components → shared/components}/PinataJwtInput.tsx +4 -4
  93. package/src/identity/hub/{components → shared/components}/UnlinkedIdentityScreen.tsx +5 -5
  94. package/src/identity/hub/{components → shared/components}/WalletApprovalScreen.tsx +6 -6
  95. package/src/identity/hub/{components → shared/components}/menuFlagsFromReconciliation.ts +1 -1
  96. package/src/identity/hub/{effects/shared → shared/effects}/profilePrep.ts +1 -1
  97. package/src/identity/hub/{effects → shared/effects}/receipts.ts +2 -2
  98. package/src/identity/hub/{effects/shared → shared/effects}/sync.ts +4 -4
  99. package/src/identity/hub/{effects → shared/effects}/types.ts +3 -3
  100. package/src/identity/hub/{model → shared/model}/copy.ts +2 -2
  101. package/src/identity/hub/{model → shared/model}/errors.ts +5 -5
  102. package/src/identity/hub/{model → shared/model}/network.ts +3 -3
  103. package/src/identity/hub/{operatorWallets.ts → shared/operatorWallets.ts} +1 -1
  104. package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/hook.ts +1 -1
  105. package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/ownership.ts +2 -2
  106. package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/run.ts +6 -6
  107. package/src/identity/hub/{utils.ts → shared/utils.ts} +5 -5
  108. package/src/identity/hub/{flows/token-transfer/IdentityHubTokenTransferFlow.tsx → transfer/TokenTransferFlow.tsx} +8 -8
  109. package/src/identity/hub/{flows/token-transfer → transfer}/TokenTransferScreens.tsx +14 -14
  110. package/src/identity/hub/{effects/token-transfer/runTokenTransfer.ts → transfer/effects.ts} +16 -16
  111. package/src/identity/hub/{effects/token-transfer → transfer}/progress.ts +1 -1
  112. package/src/identity/hub/useIdentityHubController.ts +11 -11
  113. package/src/identity/hub/useIdentityHubSideEffects.ts +11 -11
  114. package/src/models/ModelPicker.tsx +143 -9
  115. package/src/models/catalog.ts +2 -1
  116. package/src/models/huggingface.ts +180 -2
  117. package/src/models/llamacpp.ts +110 -15
  118. package/src/models/llamacppPreflight.ts +30 -11
  119. package/src/models/modelPickerOptions.ts +16 -15
  120. package/src/models/providerDisplay.ts +16 -0
  121. package/src/providers/anthropic.ts +36 -5
  122. package/src/providers/contracts.ts +9 -1
  123. package/src/providers/errors.ts +6 -4
  124. package/src/providers/gemini.ts +29 -3
  125. package/src/providers/openai-chat.ts +83 -3
  126. package/src/providers/openai-responses-format.ts +29 -8
  127. package/src/providers/openai-responses.ts +22 -7
  128. package/src/providers/registry.ts +1 -0
  129. package/src/runtime/sessionMode.ts +1 -1
  130. package/src/runtime/systemPrompt.ts +3 -1
  131. package/src/runtime/toolExecution.ts +9 -6
  132. package/src/runtime/turn.ts +29 -0
  133. package/src/storage/config.ts +1 -0
  134. package/src/storage/rewind.ts +20 -0
  135. package/src/storage/sessions.ts +16 -3
  136. package/src/tools/bashSafety.ts +7 -3
  137. package/src/tools/bashTool.ts +1 -1
  138. package/src/tools/contracts.ts +3 -0
  139. package/src/tools/deleteFileTool.ts +8 -3
  140. package/src/tools/editTool.ts +10 -5
  141. package/src/tools/fileDiff.ts +261 -0
  142. package/src/tools/privateContinuityEditTool.ts +5 -1
  143. package/src/tools/writeFileTool.ts +8 -3
  144. package/src/ui/Spinner.tsx +39 -5
  145. package/src/ui/TextInput.tsx +2 -2
  146. package/src/ui/theme.ts +19 -0
  147. package/src/utils/clipboard.ts +10 -7
  148. package/src/utils/images.ts +140 -0
  149. package/src/utils/messages.ts +2 -0
  150. package/src/chat/RewindView.tsx +0 -386
  151. package/src/chat/toolResultDisplay.ts +0 -8
  152. package/src/identity/hub/effects/index.ts +0 -73
  153. package/src/identity/hub/effects/publicProfile/index.ts +0 -5
  154. package/src/identity/hub/effects/restore/restoreEffects.ts +0 -22
  155. package/src/identity/hub/effects/token-transfer/index.ts +0 -6
  156. /package/src/chat/{chatInputState.ts → input/chatInputState.ts} +0 -0
  157. /package/src/chat/{chatPaste.ts → input/chatPaste.ts} +0 -0
  158. /package/src/chat/{textCursor.ts → input/textCursor.ts} +0 -0
  159. /package/src/identity/hub/{model/continuity.ts → continuity/state.ts} +0 -0
  160. /package/src/identity/hub/{model/custody.ts → custody/state.ts} +0 -0
  161. /package/src/identity/hub/{effects/restore → restore}/index.ts +0 -0
  162. /package/src/identity/hub/{model → shared/model}/format.ts +0 -0
  163. /package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/types.ts +0 -0
  164. /package/src/identity/hub/{reconciliation → shared/reconciliation}/index.ts +0 -0
  165. /package/src/identity/hub/{reconciliation → shared/reconciliation}/useAgentReconciliation.ts +0 -0
  166. /package/src/identity/hub/{reconciliation → shared/reconciliation}/walletSetup.ts +0 -0
  167. /package/src/identity/hub/{txGuard.ts → shared/txGuard.ts} +0 -0
  168. /package/src/identity/hub/{model/transfer.ts → transfer/state.ts} +0 -0
@@ -1,33 +1,33 @@
1
1
  import React from 'react'
2
- import { hasPendingPublish } from './model/continuity.js'
2
+ import { hasPendingPublish } from './continuity/state.js'
3
3
  import type { ProfileUpdates } from './identityHubReducer.js'
4
4
  import { clearPinataJwt, savePinataJwt } from '../storage/pinataJwt.js'
5
5
  import {
6
6
  runRebackupStorageSubmit,
7
- } from './effects/rebackup/runRebackup.js'
7
+ } from './continuity/effects.js'
8
8
  import {
9
9
  runPublicProfileStorageSubmit,
10
- } from './effects/publicProfile/runPublicProfileSave.js'
11
- import { resolveVaultAddress } from './flows/custody/custodyEffects.js'
12
- import { WalletApprovalScreen } from './components/WalletApprovalScreen.js'
13
- import { RebackupStorageScreen } from './flows/continuity/RebackupStorageScreen.js'
14
- import { BusyScreen } from './components/BusyScreen.js'
15
- import { StorageCredentialScreen } from './flows/settings/StorageCredentialScreen.js'
10
+ } from './profile/effects.js'
11
+ import { resolveVaultAddress } from './custody/transactions.js'
12
+ import { WalletApprovalScreen } from './shared/components/WalletApprovalScreen.js'
13
+ import { RebackupStorageScreen } from './continuity/RebackupStorageScreen.js'
14
+ import { BusyScreen } from './shared/components/BusyScreen.js'
15
+ import { StorageCredentialScreen } from './settings/StorageCredentialScreen.js'
16
16
  import {
17
17
  PrivateContinuityScreen,
18
18
  PublicProfileScreen,
19
- } from './flows/continuity/ContinuityDashboardScreen.js'
20
- import { RecoveryConfirmScreen } from './flows/continuity/RecoveryConfirmScreen.js'
21
- import { SavePromptScreen } from './flows/continuity/SavePromptScreen.js'
22
- import { ErrorScreen } from './components/ErrorScreen.js'
23
- import { UnlinkedIdentityScreen } from './components/UnlinkedIdentityScreen.js'
24
- import { invalidateOwnershipCache } from './reconciliation/index.js'
19
+ } from './continuity/ContinuityDashboardScreen.js'
20
+ import { RecoveryConfirmScreen } from './continuity/RecoveryConfirmScreen.js'
21
+ import { SavePromptScreen } from './continuity/SavePromptScreen.js'
22
+ import { ErrorScreen } from './shared/components/ErrorScreen.js'
23
+ import { UnlinkedIdentityScreen } from './shared/components/UnlinkedIdentityScreen.js'
24
+ import { invalidateOwnershipCache } from './shared/reconciliation/index.js'
25
25
  import {
26
- IdentityHubEnsFlow,
27
- isIdentityHubEnsStep,
28
- } from './flows/ens/IdentityHubEnsFlow.js'
29
- import { CustodyEditFlow, isCustodyEditStep } from './flows/custody/CustodyEditFlow.js'
30
- import { rebackupWalletApprovalView } from './utils.js'
26
+ EnsFlow,
27
+ isEnsStep,
28
+ } from './ens/EnsFlow.js'
29
+ import { CustodyEditFlow, isCustodyEditStep } from './custody/CustodyEditFlow.js'
30
+ import { rebackupWalletApprovalView } from './shared/utils.js'
31
31
  import type { IdentityHubController } from './useIdentityHubController.js'
32
32
 
33
33
  type IdentityHubOperationalRoutesProps = {
@@ -195,9 +195,9 @@ export const IdentityHubOperationalRoutes: React.FC<IdentityHubOperationalRoutes
195
195
  )
196
196
  }
197
197
 
198
- if (isIdentityHubEnsStep(step)) {
198
+ if (isEnsStep(step)) {
199
199
  return (
200
- <IdentityHubEnsFlow
200
+ <EnsFlow
201
201
  step={step}
202
202
  walletSession={walletSession}
203
203
  reconciliation={reconciliation}
@@ -8,33 +8,33 @@ import type { SelectableNetwork } from '../../storage/config.js'
8
8
  import { copyToClipboard } from '../../utils/clipboard.js'
9
9
  import { DEFAULT_IPFS_API_URL } from '../storage/ipfs.js'
10
10
  import { chainIdForNetwork, erc8004ConfigForSupportedChain } from '../registry/erc8004.js'
11
- import { shortAddress } from './model/format.js'
11
+ import { shortAddress } from './shared/model/format.js'
12
12
  import {
13
13
  canRestoreCandidate,
14
14
  resolveAgentEnsToCandidate,
15
15
  resolveAgentTokenIdToCandidate,
16
- } from './effects/restore/index.js'
16
+ } from './restore/index.js'
17
17
  import {
18
18
  runRegistrySubmit,
19
19
  runStorageSubmit,
20
- } from './effects/create.js'
20
+ } from './create/effects.js'
21
21
  import {
22
22
  runRestoreRegistrySubmit,
23
- } from './effects/restoreAdmin.js'
24
- import { MenuScreen } from './components/MenuScreen.js'
25
- import { CreateFlow } from './flows/create/CreateFlow.js'
26
- import { RestoreFlow } from './flows/restore/RestoreFlow.js'
27
- import { NetworkScreen } from './components/NetworkScreen.js'
28
- import { DetailsScreen } from './components/DetailsScreen.js'
23
+ } from './restore/restoreAdmin.js'
24
+ import { MenuScreen } from './shared/components/MenuScreen.js'
25
+ import { CreateFlow } from './create/CreateFlow.js'
26
+ import { RestoreFlow } from './restore/RestoreFlow.js'
27
+ import { NetworkScreen } from './shared/components/NetworkScreen.js'
28
+ import { DetailsScreen } from './shared/components/DetailsScreen.js'
29
29
  import {
30
- IdentityHubTokenTransferFlow,
30
+ TokenTransferFlow,
31
31
  isTokenTransferStep,
32
- } from './flows/token-transfer/IdentityHubTokenTransferFlow.js'
32
+ } from './transfer/TokenTransferFlow.js'
33
33
  import {
34
34
  chainLabel,
35
35
  isCreateStep,
36
36
  isRestoreStep,
37
- } from './utils.js'
37
+ } from './shared/utils.js'
38
38
  import { IdentityHubOperationalRoutes } from './OperationalRoutes.js'
39
39
  import type { IdentityHubController } from './useIdentityHubController.js'
40
40
 
@@ -345,7 +345,7 @@ export const IdentityHubRoutes: React.FC<{ controller: IdentityHubController }>
345
345
 
346
346
  if (isTokenTransferStep(step)) {
347
347
  return (
348
- <IdentityHubTokenTransferFlow
348
+ <TokenTransferFlow
349
349
  step={step}
350
350
  callbacks={callbacks}
351
351
  footer={footer}
@@ -1,14 +1,14 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
- import { Surface } from '../../../../ui/Surface.js'
4
- import { Select } from '../../../../ui/Select.js'
5
- import { theme } from '../../../../ui/theme.js'
6
- import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
7
- import type { ContinuityWorkingTreeStatus } from '../../../continuity/storage.js'
8
- import { IdentitySummary } from '../../components/IdentitySummary.js'
9
- import { changedContinuitySnapshotFiles } from '../../model/continuity.js'
10
- import { readIdentityStateString } from '../../model/custody.js'
11
- import { shortCid } from '../../model/format.js'
3
+ import { Surface } from '../../../ui/Surface.js'
4
+ import { Select } from '../../../ui/Select.js'
5
+ import { theme } from '../../../ui/theme.js'
6
+ import type { EthagentConfig, EthagentIdentity } from '../../../storage/config.js'
7
+ import type { ContinuityWorkingTreeStatus } from '../../continuity/storage.js'
8
+ import { IdentitySummary } from '../shared/components/IdentitySummary.js'
9
+ import { changedContinuitySnapshotFiles } from './state.js'
10
+ import { readIdentityStateString } from '../custody/state.js'
11
+ import { shortCid } from '../shared/model/format.js'
12
12
 
13
13
  type PrivateAction = 'soul' | 'memory' | 'skills' | 'export-backup' | 'back'
14
14
  type PublicAction = 'edit' | 'back'
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
- import { PinataJwtInput } from '../../components/PinataJwtInput.js'
3
- import type { Step } from '../../identityHubReducer.js'
2
+ import { PinataJwtInput } from '../shared/components/PinataJwtInput.js'
3
+ import type { Step } from '../identityHubReducer.js'
4
4
 
5
5
  interface RebackupStorageScreenProps {
6
6
  step: Extract<Step, { kind: 'rebackup-storage' | 'public-profile-storage' }>
@@ -1,11 +1,11 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
- import { Surface } from '../../../../ui/Surface.js'
4
- import { Select } from '../../../../ui/Select.js'
5
- import { theme } from '../../../../ui/theme.js'
6
- import { localChangeStatusView, type LocalChangeStatusView } from '../../model/continuity.js'
3
+ import { Surface } from '../../../ui/Surface.js'
4
+ import { Select } from '../../../ui/Select.js'
5
+ import { theme } from '../../../ui/theme.js'
6
+ import { localChangeStatusView, type LocalChangeStatusView } from './state.js'
7
7
 
8
- import type { ContinuityWorkingTreeStatus } from '../../../continuity/storage.js'
8
+ import type { ContinuityWorkingTreeStatus } from '../../continuity/storage.js'
9
9
 
10
10
  type RecoveryConfirmMode = 'publish' | 'refetch'
11
11
 
@@ -1,10 +1,10 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
- import { Surface } from '../../../../ui/Surface.js'
4
- import { Select } from '../../../../ui/Select.js'
5
- import { theme } from '../../../../ui/theme.js'
6
- import type { ContinuityWorkingTreeStatus } from '../../../continuity/storage.js'
7
- import { changedContinuitySnapshotFiles } from '../../model/continuity.js'
3
+ import { Surface } from '../../../ui/Surface.js'
4
+ import { Select } from '../../../ui/Select.js'
5
+ import { theme } from '../../../ui/theme.js'
6
+ import type { ContinuityWorkingTreeStatus } from '../../continuity/storage.js'
7
+ import { changedContinuitySnapshotFiles } from './state.js'
8
8
 
9
9
  type SavePromptAction = 'save-now' | 'later'
10
10
 
@@ -1,6 +1,6 @@
1
1
  import { getAddress, type Address } from 'viem'
2
2
  import type { Hex } from 'viem'
3
- import type { EthagentIdentity } from '../../../../storage/config.js'
3
+ import type { EthagentIdentity } from '../../../storage/config.js'
4
4
  import {
5
5
  continuityVaultStatus,
6
6
  prepareSyncedIdentityMarkdownScaffold,
@@ -8,47 +8,47 @@ import {
8
8
  readPublicSkillsFile,
9
9
  writeIdentityMarkdownScaffold,
10
10
  type IdentityMarkdownScaffold,
11
- } from '../../../continuity/storage.js'
11
+ } from '../../continuity/storage.js'
12
12
  import {
13
13
  createWalletRestoreAccessChallenge,
14
14
  serializeContinuitySnapshotEnvelope,
15
15
  type WalletChallengePurpose,
16
- } from '../../../continuity/envelope.js'
16
+ } from '../../continuity/envelope.js'
17
17
  import {
18
18
  createAgentCard,
19
19
  defaultPublicSkillsProfile,
20
20
  serializeAgentCard,
21
- } from '../../../continuity/publicSkills.js'
22
- import { recordPublishedContinuitySnapshot } from '../../../continuity/snapshots.js'
23
- import { addToIpfs, DEFAULT_IPFS_API_URL, isPinataUploadUrl } from '../../../storage/ipfs.js'
21
+ } from '../../continuity/publicSkills.js'
22
+ import { recordPublishedContinuitySnapshot } from '../../continuity/snapshots.js'
23
+ import { addToIpfs, DEFAULT_IPFS_API_URL, isPinataUploadUrl } from '../../storage/ipfs.js'
24
24
  import {
25
25
  createErc8004PublicClient,
26
26
  encodeSetAgentUri,
27
27
  preflightSetAgentUri,
28
28
  withEthagentPointers,
29
29
  type Erc8004RegistryConfig,
30
- } from '../../../registry/erc8004.js'
31
- import { resolveValidatedPinataJwt, savePinataJwt } from '../../../storage/pinataJwt.js'
30
+ } from '../../registry/erc8004.js'
31
+ import { resolveValidatedPinataJwt, savePinataJwt } from '../../storage/pinataJwt.js'
32
32
  import {
33
33
  requestBrowserWalletSignatureAndTransaction,
34
34
  type BrowserWalletSession,
35
35
  type BrowserWalletSignature,
36
36
  type WalletPurpose,
37
- } from '../../../wallet/browserWallet.js'
37
+ } from '../../wallet/browserWallet.js'
38
38
  import {
39
39
  encodeRotateAgentURI,
40
40
  isAgentInVault,
41
- } from '../../../registry/vault.js'
42
- import type { Step, ProfileUpdates } from '../../identityHubReducer.js'
43
- import { acquireTxGuard, releaseTxGuard } from '../../txGuard.js'
44
- import type { EffectCallbacks } from '../types.js'
45
- import { awaitConfirmedReceipt } from '../receipts.js'
41
+ } from '../../registry/vault.js'
42
+ import type { Step, ProfileUpdates } from '../identityHubReducer.js'
43
+ import { acquireTxGuard, releaseTxGuard } from '../shared/txGuard.js'
44
+ import type { EffectCallbacks } from '../shared/effects/types.js'
45
+ import { awaitConfirmedReceipt } from '../shared/effects/receipts.js'
46
46
  import {
47
47
  assertVerifiedPin,
48
48
  deriveAgentName,
49
49
  prepareProfileStateForSave,
50
50
  readEnsOkFromState,
51
- } from '../shared/profilePrep.js'
51
+ } from '../shared/effects/profilePrep.js'
52
52
  import {
53
53
  assertSnapshotSaveSignerAuthorized,
54
54
  createContinuityEnvelopeForSave,
@@ -58,13 +58,13 @@ import {
58
58
  resolveProfileUpdatesEpoch,
59
59
  snapshotSaveWalletRole,
60
60
  walletRestoreAccessContext,
61
- } from '../shared/snapshot.js'
61
+ } from './snapshot.js'
62
62
  import {
63
63
  appendResolverSyncWarning,
64
64
  markCurrentContinuityFilesPublished,
65
65
  resolverSyncWarningMessage,
66
66
  syncVaultOperatorsAfterOwnerSave,
67
- } from '../shared/sync.js'
67
+ } from '../shared/effects/sync.js'
68
68
  import { runOperatorWalletRebackup } from './vault.js'
69
69
 
70
70
  type BackupMetadata = NonNullable<EthagentIdentity['backup']>
@@ -4,4 +4,4 @@ export {
4
4
  runRebackupSigning,
5
5
  runRebackupSigningInSession,
6
6
  runRebackupStorageSubmit,
7
- } from './runRebackup.js'
7
+ } from './effects.js'
@@ -1,24 +1,24 @@
1
1
  import { getAddress, isAddress, type Address } from 'viem'
2
- import type { EthagentIdentity } from '../../../../storage/config.js'
3
- import type { ProfileUpdates } from '../../identityHubReducer.js'
2
+ import type { EthagentIdentity } from '../../../storage/config.js'
3
+ import type { ProfileUpdates } from '../identityHubReducer.js'
4
4
  import {
5
5
  createWalletContinuitySnapshotEnvelope,
6
6
  createWalletRestoreAccessKey,
7
7
  type ContinuitySnapshotEnvelope,
8
8
  type WalletChallengePurpose,
9
9
  type WalletContinuityRestoreAccessKey,
10
- } from '../../../continuity/envelope.js'
10
+ } from '../../continuity/envelope.js'
11
11
  import {
12
12
  continuityAgentSnapshot,
13
13
  defaultContinuityFiles,
14
- } from '../../../continuity/storage.js'
15
- import type { Erc8004RegistryConfig, EthagentOperatorsPointer } from '../../../registry/erc8004.js'
16
- import { readOwnerAddressField } from '../../../identityCompat.js'
17
- import { readCustodyMode } from '../../model/custody.js'
14
+ } from '../../continuity/storage.js'
15
+ import type { Erc8004RegistryConfig, EthagentOperatorsPointer } from '../../registry/erc8004.js'
16
+ import { readOwnerAddressField } from '../../identityCompat.js'
17
+ import { readCustodyMode } from '../custody/state.js'
18
18
  import {
19
19
  assertActiveOperatorIsApproved,
20
20
  normalizeApprovedOperatorWallets,
21
- } from '../../operatorWallets.js'
21
+ } from '../shared/operatorWallets.js'
22
22
 
23
23
  export type WalletRestoreAccessContext = {
24
24
  token: { chainId: number; identityRegistryAddress: Address; agentId: string }
@@ -1,44 +1,44 @@
1
1
  import { getAddress, type Address, type Hex } from 'viem'
2
- import type { EthagentIdentity } from '../../../../storage/config.js'
2
+ import type { EthagentIdentity } from '../../../storage/config.js'
3
3
  import {
4
4
  prepareSyncedIdentityMarkdownScaffold,
5
5
  readContinuityFiles,
6
6
  readPublicSkillsFile,
7
7
  writeIdentityMarkdownScaffold,
8
8
  type IdentityMarkdownScaffold,
9
- } from '../../../continuity/storage.js'
9
+ } from '../../continuity/storage.js'
10
10
  import {
11
11
  createWalletRestoreAccessChallenge,
12
12
  serializeContinuitySnapshotEnvelope,
13
13
  type WalletChallengePurpose,
14
- } from '../../../continuity/envelope.js'
14
+ } from '../../continuity/envelope.js'
15
15
  import {
16
16
  createAgentCard,
17
17
  defaultPublicSkillsProfile,
18
18
  serializeAgentCard,
19
- } from '../../../continuity/publicSkills.js'
20
- import { recordPublishedContinuitySnapshot } from '../../../continuity/snapshots.js'
21
- import { addToIpfs, DEFAULT_IPFS_API_URL } from '../../../storage/ipfs.js'
19
+ } from '../../continuity/publicSkills.js'
20
+ import { recordPublishedContinuitySnapshot } from '../../continuity/snapshots.js'
21
+ import { addToIpfs, DEFAULT_IPFS_API_URL } from '../../storage/ipfs.js'
22
22
  import {
23
23
  createErc8004PublicClient,
24
24
  withEthagentPointers,
25
- } from '../../../registry/erc8004.js'
25
+ } from '../../registry/erc8004.js'
26
26
  import {
27
27
  VAULT_ABI,
28
28
  encodeRotateAgentURI,
29
- } from '../../../registry/vault.js'
29
+ } from '../../registry/vault.js'
30
30
  import {
31
31
  requestBrowserWalletSignature,
32
32
  requestBrowserWalletSignatureAndTransaction,
33
33
  type WalletPurpose,
34
- } from '../../../wallet/browserWallet.js'
35
- import type { Step } from '../../identityHubReducer.js'
36
- import type { EffectCallbacks } from '../types.js'
37
- import { awaitConfirmedReceipt } from '../receipts.js'
34
+ } from '../../wallet/browserWallet.js'
35
+ import type { Step } from '../identityHubReducer.js'
36
+ import type { EffectCallbacks } from '../shared/effects/types.js'
37
+ import { awaitConfirmedReceipt } from '../shared/effects/receipts.js'
38
38
  import {
39
39
  assertVerifiedPin,
40
40
  prepareProfileStateForSave,
41
- } from '../shared/profilePrep.js'
41
+ } from '../shared/effects/profilePrep.js'
42
42
  import {
43
43
  assertSnapshotSaveSignerAuthorized,
44
44
  createContinuityEnvelopeForSave,
@@ -48,8 +48,8 @@ import {
48
48
  ownerAddressForSnapshotSave,
49
49
  type WalletRestoreAccessContext,
50
50
  walletRestoreAccessContext,
51
- } from '../shared/snapshot.js'
52
- import { markCurrentContinuityFilesPublished } from '../shared/sync.js'
51
+ } from './snapshot.js'
52
+ import { markCurrentContinuityFilesPublished } from '../shared/effects/sync.js'
53
53
 
54
54
  type BackupMetadata = NonNullable<EthagentIdentity['backup']>
55
55
  type PublicSkillsMetadata = NonNullable<EthagentIdentity['publicSkills']>
@@ -1,18 +1,18 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
- import { Surface } from '../../../../ui/Surface.js'
4
- import { Select } from '../../../../ui/Select.js'
5
- import { TextInput } from '../../../../ui/TextInput.js'
6
- import { theme } from '../../../../ui/theme.js'
7
- import { normalizeErc8004RegistryConfig } from '../../../registry/erc8004.js'
8
- import { networkLabel } from '../../model/network.js'
9
- import type { Step } from '../../identityHubReducer.js'
10
- import { createStepNumber, CREATE_STEP_LABELS } from '../../identityHubReducer.js'
11
- import { WalletApprovalScreen } from '../../components/WalletApprovalScreen.js'
12
- import { BusyScreen } from '../../components/BusyScreen.js'
13
- import { FlowTimeline } from '../../components/FlowTimeline.js'
14
- import { PinataJwtInput } from '../../components/PinataJwtInput.js'
15
- import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
3
+ import { Surface } from '../../../ui/Surface.js'
4
+ import { Select } from '../../../ui/Select.js'
5
+ import { TextInput } from '../../../ui/TextInput.js'
6
+ import { theme } from '../../../ui/theme.js'
7
+ import { normalizeErc8004RegistryConfig } from '../../registry/erc8004.js'
8
+ import { networkLabel } from '../shared/model/network.js'
9
+ import type { Step } from '../identityHubReducer.js'
10
+ import { createStepNumber, CREATE_STEP_LABELS } from '../identityHubReducer.js'
11
+ import { WalletApprovalScreen } from '../shared/components/WalletApprovalScreen.js'
12
+ import { BusyScreen } from '../shared/components/BusyScreen.js'
13
+ import { FlowTimeline } from '../shared/components/FlowTimeline.js'
14
+ import { PinataJwtInput } from '../shared/components/PinataJwtInput.js'
15
+ import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
16
16
 
17
17
  type CreateFlowProps = {
18
18
  step: Extract<Step, {
@@ -36,11 +36,11 @@ import { setOwnerAddressField } from '../../identityCompat.js'
36
36
  import {
37
37
  requestBrowserWalletSignatureAndTransaction,
38
38
  } from '../../wallet/browserWallet.js'
39
- import { initialAgentState, PREFLIGHT_AGENT_URI } from '../model/identity.js'
39
+ import { initialAgentState, PREFLIGHT_AGENT_URI } from '../profile/identity.js'
40
40
  import type { Step } from '../identityHubReducer.js'
41
- import type { EffectCallbacks } from './types.js'
42
- import { awaitConfirmedReceipt } from './receipts.js'
43
- import { assertVerifiedPin } from './shared/profilePrep.js'
41
+ import type { EffectCallbacks } from '../shared/effects/types.js'
42
+ import { awaitConfirmedReceipt } from '../shared/effects/receipts.js'
43
+ import { assertVerifiedPin } from '../shared/effects/profilePrep.js'
44
44
 
45
45
  type BackupMetadata = NonNullable<EthagentIdentity['backup']>
46
46
  type PublicSkillsMetadata = NonNullable<EthagentIdentity['publicSkills']>
@@ -1,22 +1,22 @@
1
1
  import React from 'react'
2
2
  import type { Address } from 'viem'
3
3
  import { Box, Text } from 'ink'
4
- import { Surface } from '../../../../ui/Surface.js'
5
- import { Select } from '../../../../ui/Select.js'
6
- import { theme } from '../../../../ui/theme.js'
7
- import type { ProfileUpdates, Step } from '../../identityHubReducer.js'
4
+ import { Surface } from '../../../ui/Surface.js'
5
+ import { Select } from '../../../ui/Select.js'
6
+ import { theme } from '../../../ui/theme.js'
7
+ import type { ProfileUpdates, Step } from '../identityHubReducer.js'
8
8
  import {
9
9
  displayCustodyMode,
10
10
  identityOwnerAddress,
11
11
  readCustodyMode,
12
12
  readIdentityStateString,
13
- } from '../../model/custody.js'
14
- import { ensValidationReasonText, selectEnsStatus } from '../../model/ens.js'
15
- import { shortAddress } from '../../model/format.js'
16
- import { lastBackupLabel } from '../../model/identity.js'
13
+ } from './state.js'
14
+ import { ensValidationReasonText, selectEnsStatus } from '../ens/state.js'
15
+ import { shortAddress } from '../shared/model/format.js'
16
+ import { lastBackupLabel } from '../profile/identity.js'
17
17
  import {
18
18
  type AgentReconciliation,
19
- } from '../../reconciliation/index.js'
19
+ } from '../shared/reconciliation/index.js'
20
20
 
21
21
  const footerHint = (hint: string) => <Text color={theme.dim}>{hint}</Text>
22
22
 
@@ -1,11 +1,11 @@
1
1
  import type { Address } from 'viem'
2
- import { createErc8004PublicClient } from '../../../registry/erc8004.js'
3
- import { discoverPriorVaultFromTokenOwner, isAgentInVault } from '../../../registry/vault.js'
4
- import type { ProfileUpdates, Step } from '../../identityHubReducer.js'
2
+ import { createErc8004PublicClient } from '../../registry/erc8004.js'
3
+ import { discoverPriorVaultFromTokenOwner, isAgentInVault } from '../../registry/vault.js'
4
+ import type { ProfileUpdates, Step } from '../identityHubReducer.js'
5
5
  import { isCustodyEditStep } from './CustodyEditFlow.js'
6
- import { resolveVaultAddress } from './custodyEffects.js'
7
- import type { CustodyFlowDeps } from './custodyFlowTypes.js'
8
- import { humanOwnerAddress } from './custodyFlowHelpers.js'
6
+ import { resolveVaultAddress } from './transactions.js'
7
+ import type { CustodyFlowDeps } from './types.js'
8
+ import { humanOwnerAddress } from './helpers.js'
9
9
 
10
10
  export function createCustodyFlowActions({
11
11
  config,
@@ -1,7 +1,7 @@
1
- import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
2
- import { buildSeedConfigForIdentity } from '../../../../storage/config.js'
3
- import { readOwnerAddressField } from '../../../identityCompat.js'
4
- import { supportedErc8004ChainForId, type Erc8004RegistryConfig } from '../../../registry/erc8004.js'
1
+ import type { EthagentConfig, EthagentIdentity } from '../../../storage/config.js'
2
+ import { buildSeedConfigForIdentity } from '../../../storage/config.js'
3
+ import { readOwnerAddressField } from '../../identityCompat.js'
4
+ import { supportedErc8004ChainForId, type Erc8004RegistryConfig } from '../../registry/erc8004.js'
5
5
 
6
6
  export function chainLabel(chainId: number): string {
7
7
  return supportedErc8004ChainForId(chainId)?.name ?? `chain ${chainId}`
@@ -1,9 +1,9 @@
1
1
  import { getAddress, type Address, type PublicClient } from 'viem'
2
- import type { EthagentIdentity } from '../../../../storage/config.js'
3
- import { readVaultAddressField } from '../../../identityCompat.js'
4
- import { createErc8004PublicClient, type Erc8004RegistryConfig } from '../../../registry/erc8004.js'
5
- import { isAgentInVault, resolveConfiguredVaultAddress } from '../../../registry/vault.js'
6
- import { readCustodyMode } from '../../model/custody.js'
2
+ import type { EthagentIdentity } from '../../../storage/config.js'
3
+ import { readVaultAddressField } from '../../identityCompat.js'
4
+ import { createErc8004PublicClient, type Erc8004RegistryConfig } from '../../registry/erc8004.js'
5
+ import { isAgentInVault, resolveConfiguredVaultAddress } from '../../registry/vault.js'
6
+ import { readCustodyMode } from './state.js'
7
7
 
8
8
  export class VaultUnavailableError extends Error {
9
9
  constructor(chainId: number) {
@@ -1,13 +1,13 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
- import { Surface } from '../../../../ui/Surface.js'
4
- import { Select } from '../../../../ui/Select.js'
5
- import { theme } from '../../../../ui/theme.js'
6
- import { WalletApprovalScreen } from '../../components/WalletApprovalScreen.js'
7
- import { shortAddress } from '../../model/format.js'
8
- import type { Step } from '../../identityHubReducer.js'
9
- import type { CustodyFlowDeps } from './custodyFlowTypes.js'
10
- import { chainLabel, humanOwnerAddress } from './custodyFlowHelpers.js'
3
+ import { Surface } from '../../../ui/Surface.js'
4
+ import { Select } from '../../../ui/Select.js'
5
+ import { theme } from '../../../ui/theme.js'
6
+ import { WalletApprovalScreen } from '../shared/components/WalletApprovalScreen.js'
7
+ import { shortAddress } from '../shared/model/format.js'
8
+ import type { Step } from '../identityHubReducer.js'
9
+ import type { CustodyFlowDeps } from './types.js'
10
+ import { chainLabel, humanOwnerAddress } from './helpers.js'
11
11
 
12
12
  const Row: React.FC<{ label: string; value: string }> = ({ label, value }) => (
13
13
  <Text>
@@ -8,18 +8,18 @@ import {
8
8
  VAULT_ABI,
9
9
  VAULT_DEPLOY_BYTECODE,
10
10
  assertVaultBytecode,
11
- } from '../../../registry/vault.js'
11
+ } from '../../registry/vault.js'
12
12
  import {
13
13
  createErc8004PublicClient,
14
14
  type Erc8004RegistryConfig,
15
- } from '../../../registry/erc8004.js'
16
- import type { EthagentIdentity } from '../../../../storage/config.js'
17
- import { readVaultAddressField, readOwnerAddressField } from '../../../identityCompat.js'
18
- import { prepareTransactionGasFee, sendBrowserWalletTransaction } from '../../../wallet/browserWallet.js'
19
- import { acquireTxGuard, releaseTxGuard, type TxGuardKind } from '../../txGuard.js'
20
- import { awaitConfirmedReceipt } from '../../effects/receipts.js'
21
- import type { EffectCallbacks } from '../../effects/types.js'
22
- import { readCustodyMode } from '../../model/custody.js'
15
+ } from '../../registry/erc8004.js'
16
+ import type { EthagentIdentity } from '../../../storage/config.js'
17
+ import { readVaultAddressField, readOwnerAddressField } from '../../identityCompat.js'
18
+ import { prepareTransactionGasFee, sendBrowserWalletTransaction } from '../../wallet/browserWallet.js'
19
+ import { acquireTxGuard, releaseTxGuard, type TxGuardKind } from '../shared/txGuard.js'
20
+ import { awaitConfirmedReceipt } from '../shared/effects/receipts.js'
21
+ import type { EffectCallbacks } from '../shared/effects/types.js'
22
+ import { readCustodyMode } from './state.js'
23
23
 
24
24
  export function resolveVaultAddress(
25
25
  identity: EthagentIdentity,
@@ -1,10 +1,10 @@
1
1
  import type React from 'react'
2
2
  import type { Address } from 'viem'
3
- import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
4
- import type { Erc8004RegistryConfig } from '../../../registry/erc8004.js'
5
- import type { EffectCallbacks } from '../../effects/types.js'
6
- import type { ProfileUpdates, Step } from '../../identityHubReducer.js'
7
- import type { WalletApprovalScreen } from '../../components/WalletApprovalScreen.js'
3
+ import type { EthagentConfig, EthagentIdentity } from '../../../storage/config.js'
4
+ import type { Erc8004RegistryConfig } from '../../registry/erc8004.js'
5
+ import type { EffectCallbacks } from '../shared/effects/types.js'
6
+ import type { ProfileUpdates, Step } from '../identityHubReducer.js'
7
+ import type { WalletApprovalScreen } from '../shared/components/WalletApprovalScreen.js'
8
8
 
9
9
  export type GuardOwnership = (
10
10
  identity: EthagentIdentity,
@@ -1,16 +1,16 @@
1
1
  import { useEffect } from 'react'
2
- import { createErc8004PublicClient } from '../../../registry/erc8004.js'
3
- import { confirmAgentInVault } from '../../../registry/vault.js'
4
- import { invalidateOwnershipCache } from '../../reconciliation/index.js'
5
- import type { ProfileUpdates } from '../../identityHubReducer.js'
6
- import type { CustodyFlowDeps } from './custodyFlowTypes.js'
7
- import { humanOwnerAddress } from './custodyFlowHelpers.js'
2
+ import { createErc8004PublicClient } from '../../registry/erc8004.js'
3
+ import { confirmAgentInVault } from '../../registry/vault.js'
4
+ import { invalidateOwnershipCache } from '../shared/reconciliation/index.js'
5
+ import type { ProfileUpdates } from '../identityHubReducer.js'
6
+ import type { CustodyFlowDeps } from './types.js'
7
+ import { humanOwnerAddress } from './helpers.js'
8
8
  import {
9
9
  runVaultDeployTransaction,
10
10
  runVaultDepositTransaction,
11
11
  runVaultUnwrapTransaction,
12
12
  runVaultWithdrawTransaction,
13
- } from './custodyEffects.js'
13
+ } from './transactions.js'
14
14
 
15
15
  export function useCustodyTransactionEffects({
16
16
  step,