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,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 { PinataJwtInput } from '../../components/PinataJwtInput.js'
7
- import type { Step } from '../../identityHubReducer.js'
3
+ import { Surface } from '../../../ui/Surface.js'
4
+ import { Select } from '../../../ui/Select.js'
5
+ import { theme } from '../../../ui/theme.js'
6
+ import { PinataJwtInput } from '../shared/components/PinataJwtInput.js'
7
+ import type { Step } from '../identityHubReducer.js'
8
8
 
9
9
  type StorageCredentialAction = 'edit' | 'forget' | 'back'
10
10
 
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
2
  import { Text } from 'ink'
3
- import { Surface } from '../../../ui/Surface.js'
4
- import { Spinner } from '../../../ui/Spinner.js'
5
- import { theme } from '../../../ui/theme.js'
6
- import { useAppInput } from '../../../app/input/AppInputProvider.js'
3
+ import { Surface } from '../../../../ui/Surface.js'
4
+ import { Spinner } from '../../../../ui/Spinner.js'
5
+ import { theme } from '../../../../ui/theme.js'
6
+ import { useAppInput } from '../../../../app/input/AppInputProvider.js'
7
7
 
8
8
  type BusyScreenProps = {
9
9
  title: string
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
- import { theme } from '../../../ui/theme.js'
4
- import { Surface } from '../../../ui/Surface.js'
5
- import { Select, type SelectOption } from '../../../ui/Select.js'
6
- import type { EthagentConfig, EthagentIdentity } from '../../../storage/config.js'
3
+ import { theme } from '../../../../ui/theme.js'
4
+ import { Surface } from '../../../../ui/Surface.js'
5
+ import { Select, type SelectOption } from '../../../../ui/Select.js'
6
+ import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
7
7
  import { copyableIdentityFields, identityValuesCopyHint } from '../model/copy.js'
8
8
  import { IdentitySummary } from './IdentitySummary.js'
9
9
 
@@ -1,10 +1,10 @@
1
1
  import React from 'react'
2
2
  import { Text } from 'ink'
3
- import { Surface } from '../../../ui/Surface.js'
4
- import { Select } from '../../../ui/Select.js'
5
- import { theme } from '../../../ui/theme.js'
3
+ import { Surface } from '../../../../ui/Surface.js'
4
+ import { Select } from '../../../../ui/Select.js'
5
+ import { theme } from '../../../../ui/theme.js'
6
6
  import type { IdentityHubErrorView } from '../model/errors.js'
7
- import type { Step } from '../identityHubReducer.js'
7
+ import type { Step } from '../../identityHubReducer.js'
8
8
 
9
9
  type ErrorScreenProps = {
10
10
  error: IdentityHubErrorView
@@ -1,6 +1,6 @@
1
1
  import React from 'react'
2
2
  import { Text } from 'ink'
3
- import { theme } from '../../../ui/theme.js'
3
+ import { theme } from '../../../../ui/theme.js'
4
4
 
5
5
  type FlowTimelineProps = {
6
6
  steps: string[]
@@ -1,24 +1,24 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
- import { theme } from '../../../ui/theme.js'
4
- import type { EthagentConfig, EthagentIdentity } from '../../../storage/config.js'
3
+ import { theme } from '../../../../ui/theme.js'
4
+ import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
5
5
  import {
6
6
  displayCustodyMode,
7
7
  identityOwnerAddress,
8
8
  readCustodyMode,
9
9
  readIdentityStateString,
10
- } from '../model/custody.js'
10
+ } from '../../custody/state.js'
11
11
  import {
12
12
  hasPendingPublish,
13
13
  localChangeStatusView,
14
14
  type LocalChangeStatusView,
15
- } from '../model/continuity.js'
16
- import { ensValidationReasonText, selectEnsStatus } from '../model/ens.js'
15
+ } from '../../continuity/state.js'
16
+ import { ensValidationReasonText, selectEnsStatus } from '../../ens/state.js'
17
17
  import { shortAddress } from '../model/format.js'
18
- import { identitySummaryRows, lastBackupLabel } from '../model/identity.js'
19
- import { transferSnapshotView, type TransferSnapshotView } from '../model/transfer.js'
18
+ import { identitySummaryRows, lastBackupLabel } from '../../profile/identity.js'
19
+ import { transferSnapshotView, type TransferSnapshotView } from '../../transfer/state.js'
20
20
 
21
- import type { ContinuityWorkingTreeStatus } from '../../continuity/storage.js'
21
+ import type { ContinuityWorkingTreeStatus } from '../../../continuity/storage.js'
22
22
 
23
23
  interface IdentitySummaryProps {
24
24
  identity?: EthagentIdentity
@@ -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, type SelectOption } 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 { identityPerspective, readCustodyMode } from '../model/custody.js'
3
+ import { Surface } from '../../../../ui/Surface.js'
4
+ import { Select, type SelectOption } 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 { identityPerspective, readCustodyMode } from '../../custody/state.js'
9
9
  import { identityValuesCopyHint } from '../model/copy.js'
10
- import { transferSnapshotView } from '../model/transfer.js'
10
+ import { transferSnapshotView } from '../../transfer/state.js'
11
11
  import { IdentitySummary } from './IdentitySummary.js'
12
12
  import type { AgentReconciliation } from '../reconciliation/index.js'
13
13
  import { menuFlagsFromReconciliation } from './menuFlagsFromReconciliation.js'
@@ -1,8 +1,8 @@
1
1
  import React from 'react'
2
- import { Surface } from '../../../ui/Surface.js'
3
- import { Select, type SelectOption } from '../../../ui/Select.js'
4
- import type { SelectableNetwork } from '../../../storage/config.js'
5
- import { SELECTABLE_NETWORKS } from '../../../storage/config.js'
2
+ import { Surface } from '../../../../ui/Surface.js'
3
+ import { Select, type SelectOption } from '../../../../ui/Select.js'
4
+ import type { SelectableNetwork } from '../../../../storage/config.js'
5
+ import { SELECTABLE_NETWORKS } from '../../../../storage/config.js'
6
6
  import { networkLabel, networkSubtitle } from '../model/network.js'
7
7
 
8
8
  type NetworkScreenProps = {
@@ -1,9 +1,9 @@
1
1
  import React from 'react'
2
2
  import { Text } from 'ink'
3
- import { Surface } from '../../../ui/Surface.js'
4
- import { TextInput } from '../../../ui/TextInput.js'
5
- import { theme } from '../../../ui/theme.js'
6
- import { extractPinataJwt } from '../../storage/ipfs.js'
3
+ import { Surface } from '../../../../ui/Surface.js'
4
+ import { TextInput } from '../../../../ui/TextInput.js'
5
+ import { theme } from '../../../../ui/theme.js'
6
+ import { extractPinataJwt } from '../../../storage/ipfs.js'
7
7
 
8
8
  const PINATA_API_KEYS_URL = 'https://app.pinata.cloud/developers/api-keys'
9
9
 
@@ -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 { transferSnapshotView } from '../model/transfer.js'
7
- import type { EthagentIdentity } from '../../../storage/config.js'
3
+ import { Surface } from '../../../../ui/Surface.js'
4
+ import { Select } from '../../../../ui/Select.js'
5
+ import { theme } from '../../../../ui/theme.js'
6
+ import { transferSnapshotView } from '../../transfer/state.js'
7
+ import type { EthagentIdentity } from '../../../../storage/config.js'
8
8
 
9
9
  type UnlinkedIdentityScreenProps = {
10
10
  identity?: EthagentIdentity
@@ -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 { Spinner } from '../../../ui/Spinner.js'
5
- import { theme } from '../../../ui/theme.js'
6
- import { useAppInput } from '../../../app/input/AppInputProvider.js'
7
- import { openExternalUrl } from '../../../utils/openExternal.js'
8
- import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
3
+ import { Surface } from '../../../../ui/Surface.js'
4
+ import { Spinner } from '../../../../ui/Spinner.js'
5
+ import { theme } from '../../../../ui/theme.js'
6
+ import { useAppInput } from '../../../../app/input/AppInputProvider.js'
7
+ import { openExternalUrl } from '../../../../utils/openExternal.js'
8
+ import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
9
9
 
10
10
  type WalletApprovalScreenProps = {
11
11
  title: string
@@ -1,5 +1,5 @@
1
1
  import type { AgentReconciliation } from '../reconciliation/index.js'
2
- import type { IdentityPerspective } from '../model/custody.js'
2
+ import type { IdentityPerspective } from '../../custody/state.js'
3
3
 
4
4
  type MenuFlags = {
5
5
  prepareTransferDisabled: boolean
@@ -11,7 +11,7 @@ import {
11
11
  applyEnsValidationState,
12
12
  applyOperatorProfileState,
13
13
  validateEnsForProfileUpdate,
14
- } from '../profile/profileState.js'
14
+ } from '../../profile/state.js'
15
15
 
16
16
  type PreparedProfileState = {
17
17
  state: Record<string, unknown>
@@ -1,6 +1,6 @@
1
1
  import type { Hex, PublicClient } from 'viem'
2
- import type { PendingTxKind } from '../../../storage/config.js'
3
- import { clearPendingTx, recordPendingTx } from '../../../storage/config.js'
2
+ import type { PendingTxKind } from '../../../../storage/config.js'
3
+ import { clearPendingTx, recordPendingTx } from '../../../../storage/config.js'
4
4
 
5
5
  export async function awaitConfirmedReceipt(
6
6
  client: Pick<PublicClient, 'waitForTransactionReceipt'>,
@@ -13,13 +13,13 @@ import { sendBrowserWalletTransaction } from '../../../wallet/browserWallet.js'
13
13
  import {
14
14
  computeApprovalDiff,
15
15
  type ApprovalDiff,
16
- } from '../../reconciliation/index.js'
17
- import { normalizeApprovedOperatorWallets } from '../../operatorWallets.js'
16
+ } from '../reconciliation/index.js'
17
+ import { normalizeApprovedOperatorWallets } from '../operatorWallets.js'
18
18
  import { readOwnerAddressField } from '../../../identityCompat.js'
19
19
  import { localContinuitySnapshotContentHashes } from '../../../continuity/storage.js'
20
20
  import { updatePublishedContinuitySnapshotContentHashes } from '../../../continuity/snapshots.js'
21
- import type { EffectCallbacks } from '../types.js'
22
- import { awaitConfirmedReceipt } from '../receipts.js'
21
+ import type { EffectCallbacks } from './types.js'
22
+ import { awaitConfirmedReceipt } from './receipts.js'
23
23
 
24
24
  export function resolverSyncWarningMessage(err: unknown): string {
25
25
  return err instanceof Error ? err.message : String(err)
@@ -1,7 +1,7 @@
1
1
  import type { Address } from 'viem'
2
- import type { EthagentIdentity } from '../../../storage/config.js'
3
- import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
4
- import type { Step } from '../identityHubReducer.js'
2
+ import type { EthagentIdentity } from '../../../../storage/config.js'
3
+ import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
4
+ import type { Step } from '../../identityHubReducer.js'
5
5
 
6
6
  export type IdentityCompletionSource = 'create' | 'restore' | 'update'
7
7
 
@@ -1,5 +1,5 @@
1
- import type { EthagentConfig, EthagentIdentity } from '../../../storage/config.js'
2
- import { readCustodyMode, readIdentityStateString } from './custody.js'
1
+ import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
2
+ import { readCustodyMode, readIdentityStateString } from '../../custody/state.js'
3
3
 
4
4
  type CopyableField = {
5
5
  label: string
@@ -1,15 +1,15 @@
1
1
  import { ZodError } from 'zod'
2
- import { RegisterAgentPreflightError } from '../../registry/erc8004.js'
3
- import { AgentStateOwnerMismatchError } from '../../crypto/backupEnvelope.js'
2
+ import { RegisterAgentPreflightError } from '../../../registry/erc8004.js'
3
+ import { AgentStateOwnerMismatchError } from '../../../crypto/backupEnvelope.js'
4
4
  import {
5
5
  ContinuitySnapshotOwnerMismatchError,
6
6
  ContinuityTransferSnapshotTargetMismatchError,
7
- } from '../../continuity/envelope.js'
7
+ } from '../../../continuity/envelope.js'
8
8
  import {
9
9
  VaultBytecodeMismatchError,
10
10
  formatVaultBytecodeMismatchDetail,
11
- } from '../../registry/vault.js'
12
- import { BrowserWalletError } from '../../wallet/browserWallet.js'
11
+ } from '../../../registry/vault.js'
12
+ import { BrowserWalletError } from '../../../wallet/browserWallet.js'
13
13
  import { TxGuardBusyError } from '../txGuard.js'
14
14
  import { shortAddress } from './format.js'
15
15
 
@@ -1,6 +1,6 @@
1
- import type { EthagentConfig, EthagentIdentity, SelectableNetwork } from '../../../storage/config.js'
2
- import { supportedErc8004ChainForId } from '../../registry/erc8004.js'
3
- import { resolveSelectedNetwork } from '../../registry/registryConfig.js'
1
+ import type { EthagentConfig, EthagentIdentity, SelectableNetwork } from '../../../../storage/config.js'
2
+ import { supportedErc8004ChainForId } from '../../../registry/erc8004.js'
3
+ import { resolveSelectedNetwork } from '../../../registry/registryConfig.js'
4
4
 
5
5
  const NETWORK_LABELS: Record<SelectableNetwork, string> = {
6
6
  mainnet: 'ethereum mainnet',
@@ -1,5 +1,5 @@
1
1
  import { getAddress, isAddress, type Address } from 'viem'
2
- import type { WalletContinuityRestoreAccessKey } from '../continuity/envelope.js'
2
+ import type { WalletContinuityRestoreAccessKey } from '../../continuity/envelope.js'
3
3
 
4
4
  export type ApprovedOperatorWalletRecord = {
5
5
  address: Address
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useState } from 'react'
2
- import type { EthagentConfig } from '../../../../storage/config.js'
2
+ import type { EthagentConfig } from '../../../../../storage/config.js'
3
3
  import { emptyReconciliation, runReconciliation } from './run.js'
4
4
  import type { AgentReconciliation } from './types.js'
5
5
 
@@ -3,8 +3,8 @@ import {
3
3
  createErc8004PublicClient,
4
4
  validateErc8004TokenOwner,
5
5
  type Erc8004RegistryConfig,
6
- } from '../../../registry/erc8004.js'
7
- import type { EthagentIdentity } from '../../../../storage/config.js'
6
+ } from '../../../../registry/erc8004.js'
7
+ import type { EthagentIdentity } from '../../../../../storage/config.js'
8
8
 
9
9
  export type OwnershipRole = 'token-holder' | 'vault-level-owner'
10
10
 
@@ -4,12 +4,12 @@ import {
4
4
  erc8004ConfigForSupportedChain,
5
5
  validateErc8004TokenOwner,
6
6
  type Erc8004RegistryConfig,
7
- } from '../../../registry/erc8004.js'
8
- import { isAgentInVault, resolveConfiguredVaultAddress } from '../../../registry/vault.js'
9
- import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
10
- import { readVaultAddressField } from '../../../identityCompat.js'
11
- import { readCustodyMode } from '../../model/custody.js'
12
- import { continuityWorkingTreeStatus, type ContinuityWorkingTreeStatus } from '../../../continuity/storage.js'
7
+ } from '../../../../registry/erc8004.js'
8
+ import { isAgentInVault, resolveConfiguredVaultAddress } from '../../../../registry/vault.js'
9
+ import type { EthagentConfig, EthagentIdentity } from '../../../../../storage/config.js'
10
+ import { readVaultAddressField } from '../../../../identityCompat.js'
11
+ import { readCustodyMode } from '../../../custody/state.js'
12
+ import { continuityWorkingTreeStatus, type ContinuityWorkingTreeStatus } from '../../../../continuity/storage.js'
13
13
  import type { AgentReconciliation } from './types.js'
14
14
 
15
15
  export function emptyReconciliation(): AgentReconciliation {
@@ -1,8 +1,8 @@
1
- import type { EthagentConfig, EthagentIdentity } from '../../storage/config.js'
2
- import { supportedErc8004ChainForId } from '../registry/erc8004.js'
3
- import { snapshotSaveRequiresOwnerSigner } from './effects/shared/snapshot.js'
4
- import type { IdentityHubInitialAction } from './types.js'
5
- import type { ProfileUpdates, Step } from './identityHubReducer.js'
1
+ import type { EthagentConfig, EthagentIdentity } from '../../../storage/config.js'
2
+ import { supportedErc8004ChainForId } from '../../registry/erc8004.js'
3
+ import { snapshotSaveRequiresOwnerSigner } from '../continuity/snapshot.js'
4
+ import type { IdentityHubInitialAction } from '../types.js'
5
+ import type { ProfileUpdates, Step } from '../identityHubReducer.js'
6
6
 
7
7
  const MIN_BUSY_ERROR_MS = 2000
8
8
 
@@ -1,16 +1,16 @@
1
1
  import React from 'react'
2
- import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
3
- import { supportedErc8004ChainForId } from '../../../registry/erc8004.js'
2
+ import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
3
+ import { supportedErc8004ChainForId } from '../../registry/erc8004.js'
4
4
  import {
5
5
  runTokenTransferStorageSubmit,
6
6
  runTokenTransferTargetSubmit,
7
- } from '../../effects/token-transfer/runTokenTransfer.js'
7
+ } from './effects.js'
8
8
  import type {
9
9
  EffectCallbacks,
10
10
  TokenTransferProgress,
11
- } from '../../effects/types.js'
12
- import type { Step } from '../../identityHubReducer.js'
13
- import { BusyScreen } from '../../components/BusyScreen.js'
11
+ } from '../shared/effects/types.js'
12
+ import type { Step } from '../identityHubReducer.js'
13
+ import { BusyScreen } from '../shared/components/BusyScreen.js'
14
14
  import { RebackupStorageScreen } from '../continuity/RebackupStorageScreen.js'
15
15
  import {
16
16
  TokenTransferReadyScreen,
@@ -27,7 +27,7 @@ type TokenTransferStep = Extract<Step, {
27
27
  | 'token-transfer-ready'
28
28
  }>
29
29
 
30
- type IdentityHubTokenTransferFlowProps = {
30
+ type TokenTransferFlowProps = {
31
31
  step: TokenTransferStep
32
32
  callbacks: EffectCallbacks
33
33
  footer: React.ReactNode
@@ -45,7 +45,7 @@ export function isTokenTransferStep(step: Step): step is TokenTransferStep {
45
45
  || step.kind === 'token-transfer-ready'
46
46
  }
47
47
 
48
- export const IdentityHubTokenTransferFlow: React.FC<IdentityHubTokenTransferFlowProps> = ({
48
+ export const TokenTransferFlow: React.FC<TokenTransferFlowProps> = ({
49
49
  step,
50
50
  callbacks,
51
51
  footer,
@@ -1,19 +1,19 @@
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 { Spinner } from '../../../../ui/Spinner.js'
6
- import { TextInput } from '../../../../ui/TextInput.js'
7
- import { theme } from '../../../../ui/theme.js'
8
- import { useAppInput } from '../../../../app/input/AppInputProvider.js'
9
- import { openExternalUrl } from '../../../../utils/openExternal.js'
10
- import type { EthagentIdentity } from '../../../../storage/config.js'
11
- import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
12
- import type { TokenTransferProgress } from '../../effects/types.js'
13
- import { readCustodyMode } from '../../model/custody.js'
14
- import { shortAddress, shortCid } from '../../model/format.js'
15
- import { FlowTimeline } from '../../components/FlowTimeline.js'
16
- import { OPEN_BROWSER_HINT } from '../../components/WalletApprovalScreen.js'
3
+ import { Surface } from '../../../ui/Surface.js'
4
+ import { Select } from '../../../ui/Select.js'
5
+ import { Spinner } from '../../../ui/Spinner.js'
6
+ import { TextInput } from '../../../ui/TextInput.js'
7
+ import { theme } from '../../../ui/theme.js'
8
+ import { useAppInput } from '../../../app/input/AppInputProvider.js'
9
+ import { openExternalUrl } from '../../../utils/openExternal.js'
10
+ import type { EthagentIdentity } from '../../../storage/config.js'
11
+ import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
12
+ import type { TokenTransferProgress } from '../shared/effects/types.js'
13
+ import { readCustodyMode } from '../custody/state.js'
14
+ import { shortAddress, shortCid } from '../shared/model/format.js'
15
+ import { FlowTimeline } from '../shared/components/FlowTimeline.js'
16
+ import { OPEN_BROWSER_HINT } from '../shared/components/WalletApprovalScreen.js'
17
17
 
18
18
  const TRANSFER_STEPS = ['Choose Receiver', 'Sender Signs', 'Receiver Signs', 'Sender Updates URI', 'Transfer Token']
19
19
  const APPROVAL_GUARDRAIL = 'No approve(), setApprovalForAll(), transferFrom(), or token approval is requested.'
@@ -1,44 +1,44 @@
1
1
  import { getAddress, isAddress, 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
  createTransferContinuitySnapshotChallenge,
5
5
  createTransferContinuitySnapshotEnvelope,
6
6
  serializeContinuitySnapshotEnvelope,
7
7
  transferSnapshotMetadataFromEnvelope,
8
- } from '../../../continuity/envelope.js'
8
+ } from '../../continuity/envelope.js'
9
9
  import {
10
10
  continuityAgentSnapshot,
11
11
  continuityVaultStatus,
12
12
  readContinuityFiles,
13
13
  readPublicSkillsFile,
14
14
  writePublicSkillsFile,
15
- } from '../../../continuity/storage.js'
15
+ } from '../../continuity/storage.js'
16
16
  import {
17
17
  createAgentCard,
18
18
  defaultPublicSkillsProfile,
19
19
  serializeAgentCard,
20
- } from '../../../continuity/publicSkills.js'
21
- import { recordPublishedContinuitySnapshot } from '../../../continuity/snapshots.js'
22
- import { addToIpfs, DEFAULT_IPFS_API_URL, isPinataUploadUrl } from '../../../storage/ipfs.js'
20
+ } from '../../continuity/publicSkills.js'
21
+ import { recordPublishedContinuitySnapshot } from '../../continuity/snapshots.js'
22
+ import { addToIpfs, DEFAULT_IPFS_API_URL, isPinataUploadUrl } from '../../storage/ipfs.js'
23
23
  import {
24
24
  createErc8004PublicClient,
25
25
  encodeSetAgentUri,
26
26
  preflightSetAgentUri,
27
27
  withEthagentPointers,
28
- } from '../../../registry/erc8004.js'
29
- import { resolveValidatedPinataJwt, savePinataJwt } from '../../../storage/pinataJwt.js'
30
- import { openBrowserWalletSession } from '../../../wallet/browserWallet.js'
31
- import { resolveEnsAddress } from '../../../ens/ensLookup.js'
32
- import type { Step } from '../../identityHubReducer.js'
33
- import type { EffectCallbacks } from '../types.js'
34
- import { awaitConfirmedReceipt } from '../receipts.js'
28
+ } from '../../registry/erc8004.js'
29
+ import { resolveValidatedPinataJwt, savePinataJwt } from '../../storage/pinataJwt.js'
30
+ import { openBrowserWalletSession } from '../../wallet/browserWallet.js'
31
+ import { resolveEnsAddress } from '../../ens/ensLookup.js'
32
+ import type { Step } from '../identityHubReducer.js'
33
+ import type { EffectCallbacks } from '../shared/effects/types.js'
34
+ import { awaitConfirmedReceipt } from '../shared/effects/receipts.js'
35
35
  import {
36
36
  assertVerifiedPin,
37
37
  deriveAgentName,
38
- } from '../shared/profilePrep.js'
39
- import { operatorsPointerFromState } from '../shared/snapshot.js'
38
+ } from '../shared/effects/profilePrep.js'
39
+ import { operatorsPointerFromState } from '../continuity/snapshot.js'
40
40
  import { tokenTransferProgressForPhase } from './progress.js'
41
- import { assertTokenNotInVault } from '../vault/preflight.js'
41
+ import { assertTokenNotInVault } from '../custody/preflight.js'
42
42
 
43
43
  type BackupMetadata = NonNullable<EthagentIdentity['backup']>
44
44
  type PublicSkillsMetadata = NonNullable<EthagentIdentity['publicSkills']>
@@ -1,5 +1,5 @@
1
1
  import { getAddress } from 'viem'
2
- import type { TokenTransferProgress } from '../types.js'
2
+ import type { TokenTransferProgress } from '../shared/effects/types.js'
3
3
 
4
4
  export function tokenTransferProgressForPhase(
5
5
  phase: TokenTransferProgress['phase'],
@@ -11,35 +11,35 @@ import {
11
11
  import {
12
12
  assertTokenNotInVault,
13
13
  TokenInVaultError,
14
- } from './effects/vault/preflight.js'
14
+ } from './custody/preflight.js'
15
15
  import {
16
16
  runPublicProfilePreflight,
17
- } from './effects/publicProfile/runPublicProfileSave.js'
17
+ } from './profile/effects.js'
18
18
  import {
19
19
  runRebackupPreflight,
20
- } from './effects/rebackup/runRebackup.js'
20
+ } from './continuity/effects.js'
21
21
  import type {
22
22
  EffectCallbacks,
23
23
  IdentityCompletionSource,
24
24
  RestoreProgress,
25
25
  TokenTransferProgress,
26
- } from './effects/types.js'
27
- import { resolveVaultAddress } from './flows/custody/custodyEffects.js'
28
- import { useCustodyFlow } from './flows/custody/useCustodyFlow.js'
29
- import { identityHubErrorView } from './model/errors.js'
30
- import { readCustodyMode } from './model/custody.js'
31
- import { selectEnsStatus } from './model/ens.js'
26
+ } from './shared/effects/types.js'
27
+ import { resolveVaultAddress } from './custody/transactions.js'
28
+ import { useCustodyFlow } from './custody/useCustodyFlow.js'
29
+ import { identityHubErrorView } from './shared/model/errors.js'
30
+ import { readCustodyMode } from './custody/state.js'
31
+ import { selectEnsStatus } from './ens/state.js'
32
32
  import { identityHubReducer, type ProfileUpdates, type Step } from './identityHubReducer.js'
33
33
  import type { IdentityHubProps } from './types.js'
34
34
  import {
35
35
  capitalizeFeedbackMessage,
36
36
  initialStepForAction,
37
37
  isWalletCancelled,
38
- } from './utils.js'
38
+ } from './shared/utils.js'
39
39
  import {
40
40
  preflightTokenOwnership,
41
41
  useAgentReconciliation,
42
- } from './reconciliation/index.js'
42
+ } from './shared/reconciliation/index.js'
43
43
  import { useIdentityHubContinuity } from './useIdentityHubContinuity.js'
44
44
  import { useIdentityHubSideEffects } from './useIdentityHubSideEffects.js'
45
45
 
@@ -1,36 +1,36 @@
1
1
  import { useEffect } from 'react'
2
2
  import type { EthagentConfig } from '../../storage/config.js'
3
3
  import { setTokenIdentity } from '../../storage/identity.js'
4
- import { isRegistrationPreflightError, pinataErrorText } from './model/errors.js'
4
+ import { isRegistrationPreflightError, pinataErrorText } from './shared/model/errors.js'
5
5
  import type { ProfileUpdates, Step } from './identityHubReducer.js'
6
6
  import {
7
7
  runCreatePreflight,
8
8
  runCreateSigning,
9
- } from './effects/create.js'
9
+ } from './create/effects.js'
10
10
  import {
11
11
  runRebackupSigning,
12
- } from './effects/rebackup/runRebackup.js'
12
+ } from './continuity/effects.js'
13
13
  import {
14
14
  runPublicProfileSigning,
15
- } from './effects/publicProfile/runPublicProfileSave.js'
15
+ } from './profile/effects.js'
16
16
  import {
17
17
  runTokenTransferSigning,
18
- } from './effects/token-transfer/runTokenTransfer.js'
18
+ } from './transfer/effects.js'
19
19
  import {
20
20
  runEnsSetupRecordsTransaction,
21
21
  runEnsSetupRegistryTransaction,
22
22
  runUpdateEnsRecords,
23
- } from './effects/ens/index.js'
23
+ } from './ens/index.js'
24
24
  import {
25
25
  runRecoveryRefetch,
26
- } from './effects/restore/index.js'
27
- import type { EffectCallbacks } from './effects/types.js'
28
- import { useRestoreFlowEffects } from './flows/restore/useRestoreFlowEffects.js'
26
+ } from './restore/index.js'
27
+ import type { EffectCallbacks } from './shared/effects/types.js'
28
+ import { useRestoreEffects } from './restore/useRestoreEffects.js'
29
29
  import {
30
30
  isStorageError,
31
31
  isWalletCancelled,
32
32
  waitForMinimumBusyTime,
33
- } from './utils.js'
33
+ } from './shared/utils.js'
34
34
 
35
35
  type TriggerRebackup = (
36
36
  backStep: Step,
@@ -104,7 +104,7 @@ export function useIdentityHubSideEffects({
104
104
  return () => { cancelled = true }
105
105
  }, [step])
106
106
 
107
- useRestoreFlowEffects({ step, config, callbacks, handleStepError })
107
+ useRestoreEffects({ step, config, callbacks, handleStepError })
108
108
 
109
109
  useEffect(() => {
110
110
  if (step.kind !== 'rebackup-signing') return