ethagent 2.2.0 → 2.3.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 (154) hide show
  1. package/package.json +2 -1
  2. package/src/app/FirstRun.tsx +1 -7
  3. package/src/app/FirstRunTimeline.tsx +1 -1
  4. package/src/chat/ChatBottomPane.tsx +20 -11
  5. package/src/chat/ChatScreen.tsx +160 -35
  6. package/src/chat/ConversationStack.tsx +1 -1
  7. package/src/chat/MessageList.tsx +185 -72
  8. package/src/chat/SessionStatus.tsx +3 -1
  9. package/src/chat/chatScreenUtils.ts +11 -15
  10. package/src/chat/chatSessionState.ts +1 -1
  11. package/src/chat/chatTurnOrchestrator.ts +1 -7
  12. package/src/chat/commands.ts +26 -26
  13. package/src/chat/display/DiffView.tsx +193 -0
  14. package/src/chat/display/SyntaxText.tsx +192 -0
  15. package/src/chat/display/toolCallDisplay.ts +103 -0
  16. package/src/chat/display/toolResultDisplay.ts +19 -0
  17. package/src/chat/{ChatInput.tsx → input/ChatInput.tsx} +36 -23
  18. package/src/chat/{TranscriptView.tsx → transcript/TranscriptView.tsx} +24 -50
  19. package/src/chat/{transcriptViewport.ts → transcript/transcriptViewport.ts} +12 -30
  20. package/src/chat/{ContextLimitView.tsx → views/ContextLimitView.tsx} +3 -3
  21. package/src/chat/{ContinuityEditReviewView.tsx → views/ContinuityEditReviewView.tsx} +11 -3
  22. package/src/chat/{CopyPicker.tsx → views/CopyPicker.tsx} +4 -5
  23. package/src/chat/{PermissionPrompt.tsx → views/PermissionPrompt.tsx} +16 -17
  24. package/src/chat/{PermissionsView.tsx → views/PermissionsView.tsx} +6 -6
  25. package/src/chat/{PlanApprovalView.tsx → views/PlanApprovalView.tsx} +4 -4
  26. package/src/chat/{ResumeView.tsx → views/ResumeView.tsx} +35 -35
  27. package/src/chat/views/RewindView.tsx +410 -0
  28. package/src/identity/continuity/privateEdit/diff.ts +2 -78
  29. package/src/identity/hub/OperationalRoutes.tsx +21 -21
  30. package/src/identity/hub/Routes.tsx +13 -13
  31. package/src/identity/hub/{flows/continuity → continuity}/ContinuityDashboardScreen.tsx +9 -9
  32. package/src/identity/hub/{flows/continuity → continuity}/RebackupStorageScreen.tsx +2 -2
  33. package/src/identity/hub/{flows/continuity → continuity}/RecoveryConfirmScreen.tsx +5 -5
  34. package/src/identity/hub/{flows/continuity → continuity}/SavePromptScreen.tsx +5 -5
  35. package/src/identity/hub/{effects/rebackup/runRebackup.ts → continuity/effects.ts} +17 -17
  36. package/src/identity/hub/{effects/rebackup → continuity}/index.ts +1 -1
  37. package/src/identity/hub/{effects/shared → continuity}/snapshot.ts +8 -8
  38. package/src/identity/hub/{effects/rebackup → continuity}/vault.ts +15 -15
  39. package/src/identity/hub/{flows/create → create}/CreateFlow.tsx +13 -13
  40. package/src/identity/hub/{effects/create.ts → create/effects.ts} +4 -4
  41. package/src/identity/hub/{flows/custody → custody}/CustodyEditFlow.tsx +9 -9
  42. package/src/identity/hub/{flows/custody/custodyFlowActions.ts → custody/actions.ts} +6 -6
  43. package/src/identity/hub/{flows/custody/custodyFlowHelpers.ts → custody/helpers.ts} +4 -4
  44. package/src/identity/hub/{effects/vault → custody}/preflight.ts +5 -5
  45. package/src/identity/hub/{flows/custody/custodyFlowRoutes.tsx → custody/routes.tsx} +8 -8
  46. package/src/identity/hub/{flows/custody/custodyEffects.ts → custody/transactions.ts} +9 -9
  47. package/src/identity/hub/{flows/custody/custodyFlowTypes.ts → custody/types.ts} +5 -5
  48. package/src/identity/hub/{flows/custody/custodyFlowEffects.ts → custody/useCustodyEffects.ts} +7 -7
  49. package/src/identity/hub/{flows/custody → custody}/useCustodyFlow.tsx +5 -5
  50. package/src/identity/hub/{flows/ens → ens}/EnsEditAdvancedScreens.tsx +13 -13
  51. package/src/identity/hub/{flows/ens → ens}/EnsEditFlow.tsx +7 -7
  52. package/src/identity/hub/{flows/ens → ens}/EnsEditMaintenanceScreens.tsx +10 -10
  53. package/src/identity/hub/{flows/ens → ens}/EnsEditReviewScreens.tsx +12 -12
  54. package/src/identity/hub/{flows/ens → ens}/EnsEditRunners.tsx +5 -5
  55. package/src/identity/hub/{flows/ens → ens}/EnsEditShared.tsx +10 -10
  56. package/src/identity/hub/{flows/ens → ens}/EnsEditSimpleScreens.tsx +14 -14
  57. package/src/identity/hub/{flows/ens/IdentityHubEnsFlow.tsx → ens/EnsFlow.tsx} +12 -12
  58. package/src/identity/hub/{flows/ens/OperatorWalletsScreen.tsx → ens/EnsOperatorWalletsScreen.tsx} +17 -17
  59. package/src/identity/hub/{advancedEnsValidation.ts → ens/advancedEnsValidation.ts} +2 -2
  60. package/src/identity/hub/{flows/ens/ensEditCopy.ts → ens/editCopy.ts} +3 -3
  61. package/src/identity/hub/{effects/ens/flows.ts → ens/effects.ts} +7 -7
  62. package/src/identity/hub/{effects/ens → ens}/index.ts +1 -1
  63. package/src/identity/hub/{model/ens.ts → ens/state.ts} +1 -1
  64. package/src/identity/hub/{effects/ens → ens}/transactions.ts +239 -239
  65. package/src/identity/hub/{flows/ens/ensEditTypes.ts → ens/types.ts} +7 -7
  66. package/src/identity/hub/identityHubReducer.ts +3 -3
  67. package/src/identity/hub/{flows/profile → profile}/EditProfileFlow.tsx +11 -11
  68. package/src/identity/hub/{effects/publicProfile/runPublicProfileSave.ts → profile/effects.ts} +18 -18
  69. package/src/identity/hub/{model → profile}/identity.ts +3 -3
  70. package/src/identity/hub/{effects/profile/profileState.ts → profile/state.ts} +181 -181
  71. package/src/identity/hub/{flows/restore → restore}/RestoreFlow.tsx +16 -16
  72. package/src/identity/hub/{effects/restore → restore}/apply.ts +10 -10
  73. package/src/identity/hub/{effects/restore → restore}/auth.ts +7 -7
  74. package/src/identity/hub/{effects/restore → restore}/discover.ts +6 -6
  75. package/src/identity/hub/{effects/restore → restore}/envelopes.ts +2 -2
  76. package/src/identity/hub/{effects/restore → restore}/fetch.ts +3 -3
  77. package/src/identity/hub/{effects/restore/shared.ts → restore/helpers.ts} +6 -6
  78. package/src/identity/hub/{effects/restore → restore}/recovery.ts +10 -10
  79. package/src/identity/hub/{effects/restore → restore}/resolve.ts +4 -4
  80. package/src/identity/hub/{effects → restore}/restoreAdmin.ts +1 -1
  81. package/src/identity/hub/{flows/restore/useRestoreFlowEffects.ts → restore/useRestoreEffects.ts} +5 -5
  82. package/src/identity/hub/{flows/settings → settings}/StorageCredentialScreen.tsx +5 -5
  83. package/src/identity/hub/{components → shared/components}/BusyScreen.tsx +4 -4
  84. package/src/identity/hub/{components → shared/components}/DetailsScreen.tsx +4 -4
  85. package/src/identity/hub/{components → shared/components}/ErrorScreen.tsx +4 -4
  86. package/src/identity/hub/{components → shared/components}/FlowTimeline.tsx +1 -1
  87. package/src/identity/hub/{components → shared/components}/IdentitySummary.tsx +8 -8
  88. package/src/identity/hub/{components → shared/components}/MenuScreen.tsx +7 -7
  89. package/src/identity/hub/{components → shared/components}/NetworkScreen.tsx +4 -4
  90. package/src/identity/hub/{components → shared/components}/PinataJwtInput.tsx +4 -4
  91. package/src/identity/hub/{components → shared/components}/UnlinkedIdentityScreen.tsx +5 -5
  92. package/src/identity/hub/{components → shared/components}/WalletApprovalScreen.tsx +6 -6
  93. package/src/identity/hub/{components → shared/components}/menuFlagsFromReconciliation.ts +1 -1
  94. package/src/identity/hub/{effects/shared → shared/effects}/profilePrep.ts +1 -1
  95. package/src/identity/hub/{effects → shared/effects}/receipts.ts +2 -2
  96. package/src/identity/hub/{effects/shared → shared/effects}/sync.ts +4 -4
  97. package/src/identity/hub/{effects → shared/effects}/types.ts +3 -3
  98. package/src/identity/hub/{model → shared/model}/copy.ts +2 -2
  99. package/src/identity/hub/{model → shared/model}/errors.ts +5 -5
  100. package/src/identity/hub/{model → shared/model}/network.ts +3 -3
  101. package/src/identity/hub/{operatorWallets.ts → shared/operatorWallets.ts} +1 -1
  102. package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/hook.ts +1 -1
  103. package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/ownership.ts +2 -2
  104. package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/run.ts +6 -6
  105. package/src/identity/hub/{utils.ts → shared/utils.ts} +5 -5
  106. package/src/identity/hub/{flows/token-transfer/IdentityHubTokenTransferFlow.tsx → transfer/TokenTransferFlow.tsx} +8 -8
  107. package/src/identity/hub/{flows/token-transfer → transfer}/TokenTransferScreens.tsx +14 -14
  108. package/src/identity/hub/{effects/token-transfer/runTokenTransfer.ts → transfer/effects.ts} +16 -16
  109. package/src/identity/hub/{effects/token-transfer → transfer}/progress.ts +1 -1
  110. package/src/identity/hub/useIdentityHubController.ts +11 -11
  111. package/src/identity/hub/useIdentityHubSideEffects.ts +11 -11
  112. package/src/models/ModelPicker.tsx +5 -3
  113. package/src/models/catalog.ts +2 -1
  114. package/src/models/modelPickerOptions.ts +2 -14
  115. package/src/models/providerDisplay.ts +16 -0
  116. package/src/providers/errors.ts +6 -4
  117. package/src/providers/openai-chat.ts +2 -1
  118. package/src/runtime/sessionMode.ts +1 -1
  119. package/src/runtime/systemPrompt.ts +3 -1
  120. package/src/runtime/toolExecution.ts +9 -6
  121. package/src/runtime/turn.ts +29 -0
  122. package/src/storage/rewind.ts +20 -0
  123. package/src/storage/sessions.ts +2 -1
  124. package/src/tools/bashSafety.ts +7 -3
  125. package/src/tools/bashTool.ts +1 -1
  126. package/src/tools/contracts.ts +3 -0
  127. package/src/tools/deleteFileTool.ts +8 -3
  128. package/src/tools/editTool.ts +10 -5
  129. package/src/tools/fileDiff.ts +261 -0
  130. package/src/tools/privateContinuityEditTool.ts +5 -1
  131. package/src/tools/writeFileTool.ts +8 -3
  132. package/src/ui/Spinner.tsx +25 -3
  133. package/src/ui/TextInput.tsx +2 -2
  134. package/src/ui/theme.ts +17 -0
  135. package/src/utils/clipboard.ts +10 -7
  136. package/src/chat/RewindView.tsx +0 -386
  137. package/src/chat/toolResultDisplay.ts +0 -8
  138. package/src/identity/hub/effects/index.ts +0 -73
  139. package/src/identity/hub/effects/publicProfile/index.ts +0 -5
  140. package/src/identity/hub/effects/restore/restoreEffects.ts +0 -22
  141. package/src/identity/hub/effects/token-transfer/index.ts +0 -6
  142. /package/src/chat/{chatInputState.ts → input/chatInputState.ts} +0 -0
  143. /package/src/chat/{chatPaste.ts → input/chatPaste.ts} +0 -0
  144. /package/src/chat/{textCursor.ts → input/textCursor.ts} +0 -0
  145. /package/src/identity/hub/{model/continuity.ts → continuity/state.ts} +0 -0
  146. /package/src/identity/hub/{model/custody.ts → custody/state.ts} +0 -0
  147. /package/src/identity/hub/{effects/restore → restore}/index.ts +0 -0
  148. /package/src/identity/hub/{model → shared/model}/format.ts +0 -0
  149. /package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/types.ts +0 -0
  150. /package/src/identity/hub/{reconciliation → shared/reconciliation}/index.ts +0 -0
  151. /package/src/identity/hub/{reconciliation → shared/reconciliation}/useAgentReconciliation.ts +0 -0
  152. /package/src/identity/hub/{reconciliation → shared/reconciliation}/walletSetup.ts +0 -0
  153. /package/src/identity/hub/{txGuard.ts → shared/txGuard.ts} +0 -0
  154. /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 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,
@@ -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