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
- import type { CustodyFlow, CustodyFlowDeps } from './custodyFlowTypes.js'
2
- import { createCustodyFlowActions } from './custodyFlowActions.js'
3
- import { useCustodyTransactionEffects } from './custodyFlowEffects.js'
1
+ import type { CustodyFlow, CustodyFlowDeps } from './types.js'
2
+ import { createCustodyFlowActions } from './actions.js'
3
+ import { useCustodyTransactionEffects } from './useCustodyEffects.js'
4
4
  import {
5
5
  renderCustodyStep,
6
6
  renderRebackupSubtitle,
7
- } from './custodyFlowRoutes.js'
7
+ } from './routes.js'
8
8
 
9
9
  export function useCustodyFlow(deps: CustodyFlowDeps): CustodyFlow {
10
10
  useCustodyTransactionEffects(deps)
@@ -22,4 +22,4 @@ export type {
22
22
  CustodyFlowDeps,
23
23
  GuardOwnership,
24
24
  TriggerRebackup,
25
- } from './custodyFlowTypes.js'
25
+ } from './types.js'
@@ -1,25 +1,25 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
3
  import { type Address } from 'viem'
4
- import { Surface } from '../../../../ui/Surface.js'
5
- import { Select } from '../../../../ui/Select.js'
6
- import { TextInput } from '../../../../ui/TextInput.js'
7
- import { Spinner } from '../../../../ui/Spinner.js'
8
- import { theme } from '../../../../ui/theme.js'
4
+ import { Surface } from '../../../ui/Surface.js'
5
+ import { Select } from '../../../ui/Select.js'
6
+ import { TextInput } from '../../../ui/TextInput.js'
7
+ import { Spinner } from '../../../ui/Spinner.js'
8
+ import { theme } from '../../../ui/theme.js'
9
9
  import {
10
10
  normalizeEthDomain,
11
11
  sanitizeSubdomainPrefix,
12
- } from '../../../ens/ensLookup.js'
13
- import { isRootEthName } from '../../../ens/ensAutomation.js'
14
- import type { Erc8004RegistryConfig } from '../../../registry/erc8004.js'
12
+ } from '../../ens/ensLookup.js'
13
+ import { isRootEthName } from '../../ens/ensAutomation.js'
14
+ import type { Erc8004RegistryConfig } from '../../registry/erc8004.js'
15
15
  import {
16
16
  type CustodyMode,
17
- } from '../../model/custody.js'
18
- import { shortAddress } from '../../model/format.js'
17
+ } from '../custody/state.js'
18
+ import { shortAddress } from '../shared/model/format.js'
19
19
  import {
20
20
  footerHint,
21
21
  } from './EnsEditShared.js'
22
- import { IdentitySummary } from '../../components/IdentitySummary.js'
22
+ import { IdentitySummary } from '../shared/components/IdentitySummary.js'
23
23
  import {
24
24
  EnsSetupBlockedScreen,
25
25
  EnsSetupReviewScreen,
@@ -28,8 +28,8 @@ import { EscCancel } from './EnsEditRunners.js'
28
28
  import type {
29
29
  EnsEditProps,
30
30
  EnsPhase,
31
- } from './ensEditTypes.js'
32
- import type { AgentReconciliation } from '../../reconciliation/index.js'
31
+ } from './types.js'
32
+ import type { AgentReconciliation } from '../shared/reconciliation/index.js'
33
33
 
34
34
  type AdvancedScreenProps = {
35
35
  phase: EnsPhase
@@ -1,34 +1,34 @@
1
1
  import React from 'react'
2
2
  import { getAddress, type Address } from 'viem'
3
- import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
3
+ import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
4
4
  import {
5
5
  AGENT_RECORD_READ_KEY_LIST,
6
6
  buildAgentEnsRecords,
7
7
  diffRecords,
8
8
  recordsFromTextMap,
9
- } from '../../../ens/agentRecords.js'
9
+ } from '../../ens/agentRecords.js'
10
10
  import {
11
11
  discoverOwnedEnsNameDetails,
12
12
  readEthagentTextRecords,
13
13
  sanitizeSubdomainPrefix,
14
14
  splitSubdomainName,
15
15
  validateAgentEnsLink,
16
- } from '../../../ens/ensLookup.js'
16
+ } from '../../ens/ensLookup.js'
17
17
  import {
18
18
  preflightDeleteSubdomain,
19
19
  preflightEnsRoot,
20
20
  preflightEnsSetup,
21
- } from '../../../ens/ensAutomation.js'
21
+ } from '../../ens/ensAutomation.js'
22
22
  import {
23
23
  readCustodyMode,
24
24
  readIdentityStateString,
25
- } from '../../model/custody.js'
25
+ } from '../custody/state.js'
26
26
  import {
27
27
  discoveryErrorMessage,
28
28
  emptyAgentEnsRecords,
29
29
  networkLabelForChainId,
30
30
  type EnsLinkOptions,
31
- } from './ensEditCopy.js'
31
+ } from './editCopy.js'
32
32
  import { rootErrorMessage } from './EnsEditShared.js'
33
33
  import { renderAdvancedEnsPhase } from './EnsEditAdvancedScreens.js'
34
34
  import { renderEnsMaintenancePhase } from './EnsEditMaintenanceScreens.js'
@@ -37,7 +37,7 @@ import type {
37
37
  DiscoveryState,
38
38
  EnsEditProps,
39
39
  EnsPhase,
40
- } from './ensEditTypes.js'
40
+ } from './types.js'
41
41
 
42
42
  export type { EnsLinkOptions }
43
43
 
@@ -1,25 +1,25 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
3
  import type { Address } from 'viem'
4
- import { Surface } from '../../../../ui/Surface.js'
5
- import { Select } from '../../../../ui/Select.js'
6
- import { Spinner } from '../../../../ui/Spinner.js'
7
- import { theme } from '../../../../ui/theme.js'
8
- import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
4
+ import { Surface } from '../../../ui/Surface.js'
5
+ import { Select } from '../../../ui/Select.js'
6
+ import { Spinner } from '../../../ui/Spinner.js'
7
+ import { theme } from '../../../ui/theme.js'
8
+ import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
9
9
  import {
10
10
  type CustodyMode,
11
- } from '../../model/custody.js'
12
- import { shortAddress } from '../../model/format.js'
11
+ } from '../custody/state.js'
12
+ import { shortAddress } from '../shared/model/format.js'
13
13
  import {
14
14
  emptyAgentEnsRecords,
15
15
  recordsHaveCurrentValues,
16
16
  unlinkEnsLinkOptions,
17
- } from './ensEditCopy.js'
17
+ } from './editCopy.js'
18
18
  import {
19
19
  EnsSetupRow,
20
20
  footerHint,
21
21
  } from './EnsEditShared.js'
22
- import { IdentitySummary } from '../../components/IdentitySummary.js'
22
+ import { IdentitySummary } from '../shared/components/IdentitySummary.js'
23
23
  import { UnlinkEnsReviewScreen } from './EnsEditReviewScreens.js'
24
24
  import {
25
25
  DeleteSubdomainTxRunner,
@@ -28,7 +28,7 @@ import {
28
28
  import type {
29
29
  EnsEditProps,
30
30
  EnsPhase,
31
- } from './ensEditTypes.js'
31
+ } from './types.js'
32
32
 
33
33
  type MaintenanceScreenProps = {
34
34
  phase: EnsPhase
@@ -1,38 +1,38 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
3
  import { getAddress, type Address } from 'viem'
4
- import { Surface } from '../../../../ui/Surface.js'
5
- import { Select, type SelectOption } from '../../../../ui/Select.js'
6
- import { theme } from '../../../../ui/theme.js'
4
+ import { Surface } from '../../../ui/Surface.js'
5
+ import { Select, type SelectOption } from '../../../ui/Select.js'
6
+ import { theme } from '../../../ui/theme.js'
7
7
  import {
8
8
  formatRecordValue,
9
9
  recordLabel,
10
10
  type AgentEnsRecords,
11
11
  type AgentRecordDiff,
12
- } from '../../../ens/agentRecords.js'
13
- import type { EnsValidation } from '../../../ens/ensLookup.js'
12
+ } from '../../ens/agentRecords.js'
13
+ import type { EnsValidation } from '../../ens/ensLookup.js'
14
14
  import type {
15
15
  EnsSetupBlockedPlan,
16
16
  EnsSetupPlan,
17
- } from '../../../ens/ensAutomation.js'
18
- import { createErc8004PublicClient, type Erc8004RegistryConfig } from '../../../registry/erc8004.js'
17
+ } from '../../ens/ensAutomation.js'
18
+ import { createErc8004PublicClient, type Erc8004RegistryConfig } from '../../registry/erc8004.js'
19
19
  import {
20
20
  displayCustodyMode,
21
21
  type CustodyMode,
22
- } from '../../model/custody.js'
23
- import { ensValidationReasonText } from '../../model/ens.js'
24
- import { shortAddress } from '../../model/format.js'
22
+ } from '../custody/state.js'
23
+ import { ensValidationReasonText } from './state.js'
24
+ import { shortAddress } from '../shared/model/format.js'
25
25
  import {
26
26
  manualReasonTitle,
27
27
  modeSwitchHeading,
28
28
  setupSwitchNotice,
29
- } from './ensEditCopy.js'
29
+ } from './editCopy.js'
30
30
  import {
31
31
  EnsSetupRow,
32
32
  footerHint,
33
33
  renderRecordValue,
34
34
  } from './EnsEditShared.js'
35
- import type { EnsIssueValidation } from './ensEditTypes.js'
35
+ import type { EnsIssueValidation } from './types.js'
36
36
 
37
37
  type SimpleEnsIssueScreenProps = {
38
38
  fullName: string
@@ -1,16 +1,16 @@
1
1
  import React from 'react'
2
2
  import type { Address } from 'viem'
3
3
  import { mainnet } from 'viem/chains'
4
- import { useAppInput } from '../../../../app/input/AppInputProvider.js'
4
+ import { useAppInput } from '../../../app/input/AppInputProvider.js'
5
5
  import {
6
6
  createMainnetClient,
7
- } from '../../../ens/ensLookup.js'
8
- import type { EnsSubdomainDeletePlan } from '../../../ens/ensAutomation.js'
7
+ } from '../../ens/ensLookup.js'
8
+ import type { EnsSubdomainDeletePlan } from '../../ens/ensAutomation.js'
9
9
  import {
10
10
  sendBrowserWalletTransaction,
11
11
  type BrowserWalletReady,
12
- } from '../../../wallet/browserWallet.js'
13
- import { WalletApprovalScreen } from '../../components/WalletApprovalScreen.js'
12
+ } from '../../wallet/browserWallet.js'
13
+ import { WalletApprovalScreen } from '../shared/components/WalletApprovalScreen.js'
14
14
 
15
15
  export const EscCancel: React.FC<{ onCancel: () => void }> = ({ onCancel }) => {
16
16
  useAppInput((_input, key) => {
@@ -1,26 +1,26 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
3
  import type { Address } from 'viem'
4
- import { Surface } from '../../../../ui/Surface.js'
5
- import { TextInput } from '../../../../ui/TextInput.js'
6
- import { theme } from '../../../../ui/theme.js'
4
+ import { Surface } from '../../../ui/Surface.js'
5
+ import { TextInput } from '../../../ui/TextInput.js'
6
+ import { theme } from '../../../ui/theme.js'
7
7
  import {
8
8
  formatRecordValue,
9
9
  type AgentEnsRecordState,
10
- } from '../../../ens/agentRecords.js'
10
+ } from '../../ens/agentRecords.js'
11
11
  import {
12
12
  isEthDomain,
13
13
  sanitizeSubdomainPrefix,
14
- } from '../../../ens/ensLookup.js'
14
+ } from '../../ens/ensLookup.js'
15
15
  import {
16
16
  displayCustodyMode,
17
17
  readIdentityStateString,
18
18
  type CustodyMode,
19
- } from '../../model/custody.js'
20
- import { ensValidationReasonText } from '../../model/ens.js'
21
- import { shortAddress } from '../../model/format.js'
22
- import { readValidationFromState } from './ensEditCopy.js'
23
- import type { EnsEditProps } from './ensEditTypes.js'
19
+ } from '../custody/state.js'
20
+ import { ensValidationReasonText } from './state.js'
21
+ import { shortAddress } from '../shared/model/format.js'
22
+ import { readValidationFromState } from './editCopy.js'
23
+ import type { EnsEditProps } from './types.js'
24
24
 
25
25
  export const footerHint = (hint: string) => <Text color={theme.dim}>{hint}</Text>
26
26
 
@@ -1,27 +1,27 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
3
  import { type Address } from 'viem'
4
- import { Surface } from '../../../../ui/Surface.js'
5
- import { Select, type SelectOption } from '../../../../ui/Select.js'
6
- import { Spinner } from '../../../../ui/Spinner.js'
7
- import { theme } from '../../../../ui/theme.js'
4
+ import { Surface } from '../../../ui/Surface.js'
5
+ import { Select, type SelectOption } from '../../../ui/Select.js'
6
+ import { Spinner } from '../../../ui/Spinner.js'
7
+ import { theme } from '../../../ui/theme.js'
8
8
  import {
9
9
  isEthDomain,
10
10
  normalizeEthDomain,
11
- } from '../../../ens/ensLookup.js'
12
- import { isRootEthName } from '../../../ens/ensAutomation.js'
13
- import type { Erc8004RegistryConfig } from '../../../registry/erc8004.js'
14
- import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
11
+ } from '../../ens/ensLookup.js'
12
+ import { isRootEthName } from '../../ens/ensAutomation.js'
13
+ import type { Erc8004RegistryConfig } from '../../registry/erc8004.js'
14
+ import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
15
15
  import {
16
16
  type CustodyMode,
17
- } from '../../model/custody.js'
18
- import { shortAddress } from '../../model/format.js'
17
+ } from '../custody/state.js'
18
+ import { shortAddress } from '../shared/model/format.js'
19
19
  import {
20
20
  recordsDiffHasChanges,
21
21
  type EnsLinkOptions,
22
- } from './ensEditCopy.js'
23
- import { openExternalUrl } from '../../../../utils/openExternal.js'
24
- import { TextInput } from '../../../../ui/TextInput.js'
22
+ } from './editCopy.js'
23
+ import { openExternalUrl } from '../../../utils/openExternal.js'
24
+ import { TextInput } from '../../../ui/TextInput.js'
25
25
  import {
26
26
  EnsStatusBanner,
27
27
  footerHint,
@@ -38,7 +38,7 @@ import type {
38
38
  DiscoveryState,
39
39
  EnsEditProps,
40
40
  EnsPhase,
41
- } from './ensEditTypes.js'
41
+ } from './types.js'
42
42
 
43
43
  const ENS_DOMAINS_URL = 'https://app.ens.domains'
44
44
 
@@ -1,14 +1,14 @@
1
1
  import React from 'react'
2
- import { openImageFilePicker } from '../../../profile/imagePicker.js'
3
- import { readOwnerAddressField } from '../../../identityCompat.js'
4
- import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
5
- import type { ProfileUpdates, Step } from '../../identityHubReducer.js'
6
- import { readCustodyMode } from '../../model/custody.js'
7
- import { OperatorWalletsScreen } from './OperatorWalletsScreen.js'
2
+ import { openImageFilePicker } from '../../profile/imagePicker.js'
3
+ import { readOwnerAddressField } from '../../identityCompat.js'
4
+ import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
5
+ import type { ProfileUpdates, Step } from '../identityHubReducer.js'
6
+ import { readCustodyMode } from '../custody/state.js'
7
+ import { OperatorWalletsScreen } from './EnsOperatorWalletsScreen.js'
8
8
  import { EDIT_PROFILE_STEPS, EditProfileFlow } from '../profile/EditProfileFlow.js'
9
- import { FlowTimeline } from '../../components/FlowTimeline.js'
10
- import { WalletApprovalScreen } from '../../components/WalletApprovalScreen.js'
11
- import type { AgentReconciliation } from '../../reconciliation/index.js'
9
+ import { FlowTimeline } from '../shared/components/FlowTimeline.js'
10
+ import { WalletApprovalScreen } from '../shared/components/WalletApprovalScreen.js'
11
+ import type { AgentReconciliation } from '../shared/reconciliation/index.js'
12
12
 
13
13
  type StepOf<K extends Step['kind']> = Extract<Step, { kind: K }>
14
14
 
@@ -25,7 +25,7 @@ type IdentityHubEnsStep = StepOf<
25
25
  | 'public-profile-signing'
26
26
  >
27
27
 
28
- type IdentityHubEnsFlowProps = {
28
+ type EnsFlowProps = {
29
29
  step: IdentityHubEnsStep
30
30
  walletSession: BrowserWalletReady | null
31
31
  reconciliation: AgentReconciliation
@@ -37,7 +37,7 @@ type IdentityHubEnsFlowProps = {
37
37
  onWithdrawTokenForEns: (step: Step) => void
38
38
  }
39
39
 
40
- export function isIdentityHubEnsStep(step: Step): step is IdentityHubEnsStep {
40
+ export function isEnsStep(step: Step): step is IdentityHubEnsStep {
41
41
  return step.kind === 'manage-ens-operators'
42
42
  || step.kind === 'edit-profile-name'
43
43
  || step.kind === 'edit-profile-description'
@@ -50,7 +50,7 @@ export function isIdentityHubEnsStep(step: Step): step is IdentityHubEnsStep {
50
50
  || step.kind === 'public-profile-signing'
51
51
  }
52
52
 
53
- export const IdentityHubEnsFlow: React.FC<IdentityHubEnsFlowProps> = ({
53
+ export const EnsFlow: React.FC<EnsFlowProps> = ({
54
54
  step,
55
55
  walletSession,
56
56
  reconciliation,
@@ -1,31 +1,31 @@
1
1
  import React from 'react'
2
2
  import { Box, Text } from 'ink'
3
3
  import { getAddress, isAddress, type Address } from 'viem'
4
- import { Surface } from '../../../../ui/Surface.js'
5
- import { Select, type SelectOption } from '../../../../ui/Select.js'
6
- import { Spinner } from '../../../../ui/Spinner.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 { readOwnerAddressField } from '../../../identityCompat.js'
12
- import type { Erc8004RegistryConfig } from '../../../registry/erc8004.js'
4
+ import { Surface } from '../../../ui/Surface.js'
5
+ import { Select, type SelectOption } from '../../../ui/Select.js'
6
+ import { Spinner } from '../../../ui/Spinner.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 { readOwnerAddressField } from '../../identityCompat.js'
12
+ import type { Erc8004RegistryConfig } from '../../registry/erc8004.js'
13
13
  import {
14
14
  createWalletRestoreAccessChallenge,
15
15
  createWalletRestoreAccessKey,
16
- } from '../../../continuity/envelope.js'
17
- import { requestBrowserWalletSignature, type BrowserWalletReady } from '../../../wallet/browserWallet.js'
18
- import { FlowTimeline } from '../../components/FlowTimeline.js'
19
- import { OPEN_BROWSER_HINT } from '../../components/WalletApprovalScreen.js'
20
- import { readCustodyMode } from '../../model/custody.js'
21
- import { shortAddress } from '../../model/format.js'
22
- import type { ProfileUpdates } from '../../identityHubReducer.js'
16
+ } from '../../continuity/envelope.js'
17
+ import { requestBrowserWalletSignature, type BrowserWalletReady } from '../../wallet/browserWallet.js'
18
+ import { FlowTimeline } from '../shared/components/FlowTimeline.js'
19
+ import { OPEN_BROWSER_HINT } from '../shared/components/WalletApprovalScreen.js'
20
+ import { readCustodyMode } from '../custody/state.js'
21
+ import { shortAddress } from '../shared/model/format.js'
22
+ import type { ProfileUpdates } from '../identityHubReducer.js'
23
23
  import {
24
24
  normalizeApprovedOperatorWallets,
25
25
  removeApprovedOperatorWallet,
26
26
  upsertApprovedOperatorWallet,
27
27
  type ApprovedOperatorWalletRecord,
28
- } from '../../operatorWallets.js'
28
+ } from '../shared/operatorWallets.js'
29
29
 
30
30
  type OperatorPhase =
31
31
  | { kind: 'main'; notice?: string; error?: string }
@@ -1,9 +1,9 @@
1
1
  import { getAddress, type Address, type PublicClient } from 'viem'
2
- import { validateAgentEnsLink, type DiscoverOptions, type EnsValidation } from '../ens/ensLookup.js'
2
+ import { validateAgentEnsLink, type DiscoverOptions, type EnsValidation } from '../../ens/ensLookup.js'
3
3
  import {
4
4
  validateErc8004TokenOwner,
5
5
  type Erc8004RegistryConfig,
6
- } from '../registry/erc8004.js'
6
+ } from '../../registry/erc8004.js'
7
7
 
8
8
  type TokenOwnerReadClient = Pick<PublicClient, 'readContract'>
9
9
 
@@ -1,7 +1,7 @@
1
1
  import { getAddress, type Address } from 'viem'
2
- import type { AgentEnsRecords, AgentRecordDiff } from '../../../ens/agentRecords.js'
3
- import type { EnsRegistryAction, EnsSetupBlockedPlan } from '../../../ens/ensAutomation.js'
4
- import type { CustodyMode } from '../../model/custody.js'
2
+ import type { AgentEnsRecords, AgentRecordDiff } from '../../ens/agentRecords.js'
3
+ import type { EnsRegistryAction, EnsSetupBlockedPlan } from '../../ens/ensAutomation.js'
4
+ import type { CustodyMode } from '../custody/state.js'
5
5
 
6
6
  export type EnsLinkOptions = {
7
7
  mode: 'simple' | 'advanced'
@@ -1,19 +1,19 @@
1
1
  import type { Address, PublicClient } from 'viem'
2
- import type { EthagentIdentity } from '../../../../storage/config.js'
3
- import type { AgentEnsRecordState, AgentEnsRecords } from '../../../ens/agentRecords.js'
4
- import type { Erc8004RegistryConfig } from '../../../registry/erc8004.js'
2
+ import type { EthagentIdentity } from '../../../storage/config.js'
3
+ import type { AgentEnsRecordState, AgentEnsRecords } from '../../ens/agentRecords.js'
4
+ import type { Erc8004RegistryConfig } from '../../registry/erc8004.js'
5
5
  import {
6
6
  openBrowserWalletSession,
7
7
  type WalletPurpose,
8
- } from '../../../wallet/browserWallet.js'
9
- import type { ProfileUpdates, Step } from '../../identityHubReducer.js'
10
- import type { EffectCallbacks, EnsClearProgress, EnsLinkProgress, EnsUpdateProgress } from '../types.js'
8
+ } from '../../wallet/browserWallet.js'
9
+ import type { ProfileUpdates, Step } from '../identityHubReducer.js'
10
+ import type { EffectCallbacks, EnsClearProgress, EnsLinkProgress, EnsUpdateProgress } from '../shared/effects/types.js'
11
11
  import {
12
12
  runEnsSetupRecordsTransaction,
13
13
  runEnsSetupRegistryTransaction,
14
14
  runUpdateEnsRecords,
15
15
  } from './transactions.js'
16
- import { runRebackupSigningInSession } from '../rebackup/runRebackup.js'
16
+ import { runRebackupSigningInSession } from '../continuity/effects.js'
17
17
 
18
18
  type EnsRecordsFlowArgs = {
19
19
  identity: EthagentIdentity
@@ -2,7 +2,7 @@ export {
2
2
  runEnsLinkFlow,
3
3
  runEnsUnlinkFlow,
4
4
  runEnsUpdateFlow,
5
- } from './flows.js'
5
+ } from './effects.js'
6
6
  export {
7
7
  ensRecordWritesForUpdate,
8
8
  runEnsSetupRecordsTransaction,
@@ -1,5 +1,5 @@
1
1
  import type { EthagentIdentity } from '../../../storage/config.js'
2
- import { readIdentityStateString } from './custody.js'
2
+ import { readIdentityStateString } from '../custody/state.js'
3
3
 
4
4
  export type EnsStatusView =
5
5
  | { kind: 'none' }