ethagent 2.1.1 → 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.
- package/package.json +2 -1
- package/src/app/FirstRun.tsx +1 -7
- package/src/app/FirstRunTimeline.tsx +1 -1
- package/src/auth/openaiOAuth/credentials.ts +47 -0
- package/src/auth/openaiOAuth/crypto.ts +23 -0
- package/src/auth/openaiOAuth/index.ts +238 -0
- package/src/auth/openaiOAuth/landingPage.ts +125 -0
- package/src/auth/openaiOAuth/listener.ts +151 -0
- package/src/auth/openaiOAuth/refresh.ts +70 -0
- package/src/auth/openaiOAuth/shared.ts +115 -0
- package/src/chat/ChatBottomPane.tsx +20 -11
- package/src/chat/ChatScreen.tsx +160 -35
- package/src/chat/ConversationStack.tsx +1 -1
- package/src/chat/MessageList.tsx +185 -72
- package/src/chat/SessionStatus.tsx +3 -1
- package/src/chat/chatScreenUtils.ts +11 -15
- package/src/chat/chatSessionState.ts +3 -2
- package/src/chat/chatTurnOrchestrator.ts +1 -7
- package/src/chat/commands.ts +28 -27
- package/src/chat/display/DiffView.tsx +193 -0
- package/src/chat/display/SyntaxText.tsx +192 -0
- package/src/chat/display/toolCallDisplay.ts +103 -0
- package/src/chat/display/toolResultDisplay.ts +19 -0
- package/src/chat/{ChatInput.tsx → input/ChatInput.tsx} +36 -23
- package/src/chat/{TranscriptView.tsx → transcript/TranscriptView.tsx} +24 -50
- package/src/chat/{transcriptViewport.ts → transcript/transcriptViewport.ts} +12 -30
- package/src/chat/{ContextLimitView.tsx → views/ContextLimitView.tsx} +3 -3
- package/src/chat/{ContinuityEditReviewView.tsx → views/ContinuityEditReviewView.tsx} +11 -3
- package/src/chat/{CopyPicker.tsx → views/CopyPicker.tsx} +4 -5
- package/src/chat/{PermissionPrompt.tsx → views/PermissionPrompt.tsx} +16 -17
- package/src/chat/{PermissionsView.tsx → views/PermissionsView.tsx} +6 -6
- package/src/chat/{PlanApprovalView.tsx → views/PlanApprovalView.tsx} +4 -4
- package/src/chat/{ResumeView.tsx → views/ResumeView.tsx} +35 -35
- package/src/chat/views/RewindView.tsx +410 -0
- package/src/identity/continuity/privateEdit/diff.ts +2 -78
- package/src/identity/ens/agentRecords.ts +5 -19
- package/src/identity/ens/ensAutomation/setup.ts +0 -1
- package/src/identity/ens/ensAutomation/types.ts +0 -1
- package/src/identity/hub/OperationalRoutes.tsx +23 -32
- package/src/identity/hub/Routes.tsx +13 -13
- package/src/identity/hub/{flows/continuity → continuity}/ContinuityDashboardScreen.tsx +9 -9
- package/src/identity/hub/{flows/continuity → continuity}/RebackupStorageScreen.tsx +2 -2
- package/src/identity/hub/{flows/continuity → continuity}/RecoveryConfirmScreen.tsx +5 -5
- package/src/identity/hub/{flows/continuity → continuity}/SavePromptScreen.tsx +5 -5
- package/src/identity/hub/{effects/rebackup/runRebackup.ts → continuity/effects.ts} +19 -19
- package/src/identity/hub/{effects/rebackup → continuity}/index.ts +1 -1
- package/src/identity/hub/{effects/shared → continuity}/snapshot.ts +8 -8
- package/src/identity/hub/{effects/rebackup → continuity}/vault.ts +15 -15
- package/src/identity/hub/{flows/create → create}/CreateFlow.tsx +13 -13
- package/src/identity/hub/{effects/create.ts → create/effects.ts} +4 -4
- package/src/identity/hub/{flows/custody → custody}/CustodyEditFlow.tsx +10 -48
- package/src/identity/hub/{flows/custody/custodyFlowActions.ts → custody/actions.ts} +11 -9
- package/src/identity/hub/{flows/custody/custodyFlowHelpers.ts → custody/helpers.ts} +4 -4
- package/src/identity/hub/{effects/vault → custody}/preflight.ts +5 -5
- package/src/identity/hub/{flows/custody/custodyFlowRoutes.tsx → custody/routes.tsx} +8 -8
- package/src/identity/hub/{flows/custody/custodyEffects.ts → custody/transactions.ts} +9 -9
- package/src/identity/hub/{flows/custody/custodyFlowTypes.ts → custody/types.ts} +6 -6
- package/src/identity/hub/{flows/custody/custodyFlowEffects.ts → custody/useCustodyEffects.ts} +7 -7
- package/src/identity/hub/{flows/custody → custody}/useCustodyFlow.tsx +5 -5
- package/src/identity/hub/ens/EnsEditAdvancedScreens.tsx +241 -0
- package/src/identity/hub/{flows/ens → ens}/EnsEditFlow.tsx +27 -82
- package/src/identity/hub/{flows/ens → ens}/EnsEditMaintenanceScreens.tsx +25 -65
- package/src/identity/hub/{flows/ens → ens}/EnsEditReviewScreens.tsx +12 -30
- package/src/identity/hub/ens/EnsEditRunners.tsx +62 -0
- package/src/identity/hub/{flows/ens → ens}/EnsEditShared.tsx +15 -14
- package/src/identity/hub/{flows/ens → ens}/EnsEditSimpleScreens.tsx +68 -217
- package/src/identity/hub/{flows/ens/IdentityHubEnsFlow.tsx → ens/EnsFlow.tsx} +18 -11
- package/src/identity/hub/{flows/ens/OperatorWalletsScreen.tsx → ens/EnsOperatorWalletsScreen.tsx} +17 -48
- package/src/identity/hub/{advancedEnsValidation.ts → ens/advancedEnsValidation.ts} +2 -2
- package/src/identity/hub/{flows/ens/ensEditCopy.ts → ens/editCopy.ts} +4 -4
- package/src/identity/hub/{effects/ens/flows.ts → ens/effects.ts} +7 -7
- package/src/identity/hub/{effects/ens → ens}/index.ts +1 -1
- package/src/identity/hub/{model/ens.ts → ens/state.ts} +1 -1
- package/src/identity/hub/{effects/ens → ens}/transactions.ts +232 -232
- package/src/identity/hub/{flows/ens/ensEditTypes.ts → ens/types.ts} +12 -26
- package/src/identity/hub/identityHubReducer.ts +3 -3
- package/src/identity/hub/{flows/profile → profile}/EditProfileFlow.tsx +17 -10
- package/src/identity/hub/{effects/publicProfile/runPublicProfileSave.ts → profile/effects.ts} +55 -177
- package/src/identity/hub/{model → profile}/identity.ts +3 -3
- package/src/identity/hub/{effects/profile/profileState.ts → profile/state.ts} +181 -173
- package/src/identity/hub/{flows/restore → restore}/RestoreFlow.tsx +21 -21
- package/src/identity/hub/{effects/restore → restore}/apply.ts +10 -10
- package/src/identity/hub/{effects/restore → restore}/auth.ts +7 -7
- package/src/identity/hub/{effects/restore → restore}/discover.ts +6 -6
- package/src/identity/hub/{effects/restore → restore}/envelopes.ts +2 -2
- package/src/identity/hub/{effects/restore → restore}/fetch.ts +3 -3
- package/src/identity/hub/{effects/restore/shared.ts → restore/helpers.ts} +6 -6
- package/src/identity/hub/{effects/restore → restore}/recovery.ts +10 -10
- package/src/identity/hub/{effects/restore → restore}/resolve.ts +4 -4
- package/src/identity/hub/restore/restoreAdmin.ts +34 -0
- package/src/identity/hub/{flows/restore/useRestoreFlowEffects.ts → restore/useRestoreEffects.ts} +5 -5
- package/src/identity/hub/{flows/settings → settings}/StorageCredentialScreen.tsx +5 -5
- package/src/identity/hub/{components → shared/components}/BusyScreen.tsx +4 -4
- package/src/identity/hub/{components → shared/components}/DetailsScreen.tsx +4 -4
- package/src/identity/hub/{components → shared/components}/ErrorScreen.tsx +4 -4
- package/src/identity/hub/{components → shared/components}/FlowTimeline.tsx +1 -1
- package/src/identity/hub/{components → shared/components}/IdentitySummary.tsx +16 -11
- package/src/identity/hub/{components → shared/components}/MenuScreen.tsx +8 -9
- package/src/identity/hub/{components → shared/components}/NetworkScreen.tsx +4 -4
- package/src/identity/hub/{components → shared/components}/PinataJwtInput.tsx +4 -4
- package/src/identity/hub/{components → shared/components}/UnlinkedIdentityScreen.tsx +5 -5
- package/src/identity/hub/{components → shared/components}/WalletApprovalScreen.tsx +6 -6
- package/src/identity/hub/{components → shared/components}/menuFlagsFromReconciliation.ts +2 -4
- package/src/identity/hub/{effects/shared → shared/effects}/profilePrep.ts +1 -1
- package/src/identity/hub/{effects → shared/effects}/receipts.ts +2 -2
- package/src/identity/hub/{effects/shared → shared/effects}/sync.ts +6 -47
- package/src/identity/hub/{effects → shared/effects}/types.ts +3 -3
- package/src/identity/hub/{model → shared/model}/copy.ts +2 -2
- package/src/identity/hub/{model → shared/model}/errors.ts +5 -5
- package/src/identity/hub/{model → shared/model}/network.ts +3 -3
- package/src/identity/hub/{operatorWallets.ts → shared/operatorWallets.ts} +1 -1
- package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/hook.ts +1 -2
- package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/ownership.ts +2 -2
- package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/run.ts +7 -40
- package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/types.ts +0 -4
- package/src/identity/hub/{reconciliation → shared/reconciliation}/index.ts +0 -7
- package/src/identity/hub/shared/reconciliation/walletSetup.ts +27 -0
- package/src/identity/hub/{utils.ts → shared/utils.ts} +5 -5
- package/src/identity/hub/{flows/token-transfer/IdentityHubTokenTransferFlow.tsx → transfer/TokenTransferFlow.tsx} +8 -8
- package/src/identity/hub/{flows/token-transfer → transfer}/TokenTransferScreens.tsx +14 -14
- package/src/identity/hub/{effects/token-transfer/runTokenTransfer.ts → transfer/effects.ts} +16 -16
- package/src/identity/hub/{effects/token-transfer → transfer}/progress.ts +1 -1
- package/src/identity/hub/useIdentityHubController.ts +11 -11
- package/src/identity/hub/useIdentityHubSideEffects.ts +11 -11
- package/src/identity/wallet/browserWallet/types.ts +0 -5
- package/src/identity/wallet/page/copy.ts +1 -31
- package/src/identity/wallet/walletPurposeCompat.ts +0 -2
- package/src/models/ModelPicker.tsx +248 -8
- package/src/models/catalog.ts +29 -1
- package/src/models/modelPickerOptions.ts +12 -10
- package/src/models/providerDisplay.ts +16 -0
- package/src/providers/errors.ts +6 -4
- package/src/providers/openai-chat.ts +2 -1
- package/src/providers/openai-responses-format.ts +156 -0
- package/src/providers/openai-responses.ts +276 -0
- package/src/providers/registry.ts +85 -8
- package/src/runtime/sessionMode.ts +1 -1
- package/src/runtime/systemPrompt.ts +4 -2
- package/src/runtime/toolExecution.ts +9 -6
- package/src/runtime/turn.ts +29 -1
- package/src/storage/rewind.ts +20 -0
- package/src/storage/secrets.ts +4 -1
- package/src/storage/sessions.ts +2 -1
- package/src/tools/bashSafety.ts +7 -3
- package/src/tools/bashTool.ts +1 -1
- package/src/tools/contracts.ts +3 -0
- package/src/tools/deleteFileTool.ts +8 -3
- package/src/tools/editTool.ts +10 -5
- package/src/tools/fileDiff.ts +261 -0
- package/src/tools/privateContinuityEditTool.ts +11 -1
- package/src/tools/writeFileTool.ts +8 -3
- package/src/ui/Spinner.tsx +25 -3
- package/src/ui/TextInput.tsx +2 -2
- package/src/ui/theme.ts +17 -0
- package/src/utils/clipboard.ts +10 -7
- package/src/utils/openExternal.ts +20 -10
- package/src/chat/RewindView.tsx +0 -386
- package/src/chat/toolResultDisplay.ts +0 -8
- package/src/identity/ens/ensRegistration.ts +0 -199
- package/src/identity/hub/effects/index.ts +0 -74
- package/src/identity/hub/effects/publicProfile/index.ts +0 -5
- package/src/identity/hub/effects/restore/restoreEffects.ts +0 -22
- package/src/identity/hub/effects/restoreAdmin.ts +0 -93
- package/src/identity/hub/effects/token-transfer/index.ts +0 -6
- package/src/identity/hub/flows/ens/EnsEditAdvancedScreens.tsx +0 -336
- package/src/identity/hub/flows/ens/EnsEditRunners.tsx +0 -198
- package/src/identity/hub/reconciliation/walletSetup.ts +0 -220
- /package/src/chat/{chatInputState.ts → input/chatInputState.ts} +0 -0
- /package/src/chat/{chatPaste.ts → input/chatPaste.ts} +0 -0
- /package/src/chat/{textCursor.ts → input/textCursor.ts} +0 -0
- /package/src/identity/hub/{model/continuity.ts → continuity/state.ts} +0 -0
- /package/src/identity/hub/{model/custody.ts → custody/state.ts} +0 -0
- /package/src/identity/hub/{effects/restore → restore}/index.ts +0 -0
- /package/src/identity/hub/{model → shared/model}/format.ts +0 -0
- /package/src/identity/hub/{reconciliation → shared/reconciliation}/useAgentReconciliation.ts +0 -0
- /package/src/identity/hub/{txGuard.ts → shared/txGuard.ts} +0 -0
- /package/src/identity/hub/{model/transfer.ts → transfer/state.ts} +0 -0
|
@@ -8,33 +8,33 @@ import type { SelectableNetwork } from '../../storage/config.js'
|
|
|
8
8
|
import { copyToClipboard } from '../../utils/clipboard.js'
|
|
9
9
|
import { DEFAULT_IPFS_API_URL } from '../storage/ipfs.js'
|
|
10
10
|
import { chainIdForNetwork, erc8004ConfigForSupportedChain } from '../registry/erc8004.js'
|
|
11
|
-
import { shortAddress } from './model/format.js'
|
|
11
|
+
import { shortAddress } from './shared/model/format.js'
|
|
12
12
|
import {
|
|
13
13
|
canRestoreCandidate,
|
|
14
14
|
resolveAgentEnsToCandidate,
|
|
15
15
|
resolveAgentTokenIdToCandidate,
|
|
16
|
-
} from './
|
|
16
|
+
} from './restore/index.js'
|
|
17
17
|
import {
|
|
18
18
|
runRegistrySubmit,
|
|
19
19
|
runStorageSubmit,
|
|
20
|
-
} from './effects
|
|
20
|
+
} from './create/effects.js'
|
|
21
21
|
import {
|
|
22
22
|
runRestoreRegistrySubmit,
|
|
23
|
-
} from './
|
|
24
|
-
import { MenuScreen } from './components/MenuScreen.js'
|
|
25
|
-
import { CreateFlow } from './
|
|
26
|
-
import { RestoreFlow } from './
|
|
27
|
-
import { NetworkScreen } from './components/NetworkScreen.js'
|
|
28
|
-
import { DetailsScreen } from './components/DetailsScreen.js'
|
|
23
|
+
} from './restore/restoreAdmin.js'
|
|
24
|
+
import { MenuScreen } from './shared/components/MenuScreen.js'
|
|
25
|
+
import { CreateFlow } from './create/CreateFlow.js'
|
|
26
|
+
import { RestoreFlow } from './restore/RestoreFlow.js'
|
|
27
|
+
import { NetworkScreen } from './shared/components/NetworkScreen.js'
|
|
28
|
+
import { DetailsScreen } from './shared/components/DetailsScreen.js'
|
|
29
29
|
import {
|
|
30
|
-
|
|
30
|
+
TokenTransferFlow,
|
|
31
31
|
isTokenTransferStep,
|
|
32
|
-
} from './
|
|
32
|
+
} from './transfer/TokenTransferFlow.js'
|
|
33
33
|
import {
|
|
34
34
|
chainLabel,
|
|
35
35
|
isCreateStep,
|
|
36
36
|
isRestoreStep,
|
|
37
|
-
} from './utils.js'
|
|
37
|
+
} from './shared/utils.js'
|
|
38
38
|
import { IdentityHubOperationalRoutes } from './OperationalRoutes.js'
|
|
39
39
|
import type { IdentityHubController } from './useIdentityHubController.js'
|
|
40
40
|
|
|
@@ -345,7 +345,7 @@ export const IdentityHubRoutes: React.FC<{ controller: IdentityHubController }>
|
|
|
345
345
|
|
|
346
346
|
if (isTokenTransferStep(step)) {
|
|
347
347
|
return (
|
|
348
|
-
<
|
|
348
|
+
<TokenTransferFlow
|
|
349
349
|
step={step}
|
|
350
350
|
callbacks={callbacks}
|
|
351
351
|
footer={footer}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Box, Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { Select } from '
|
|
5
|
-
import { theme } from '
|
|
6
|
-
import type { EthagentConfig, EthagentIdentity } from '
|
|
7
|
-
import type { ContinuityWorkingTreeStatus } from '
|
|
8
|
-
import { IdentitySummary } from '
|
|
9
|
-
import { changedContinuitySnapshotFiles } from '
|
|
10
|
-
import { readIdentityStateString } from '
|
|
11
|
-
import { shortCid } from '
|
|
3
|
+
import { Surface } from '../../../ui/Surface.js'
|
|
4
|
+
import { Select } from '../../../ui/Select.js'
|
|
5
|
+
import { theme } from '../../../ui/theme.js'
|
|
6
|
+
import type { EthagentConfig, EthagentIdentity } from '../../../storage/config.js'
|
|
7
|
+
import type { ContinuityWorkingTreeStatus } from '../../continuity/storage.js'
|
|
8
|
+
import { IdentitySummary } from '../shared/components/IdentitySummary.js'
|
|
9
|
+
import { changedContinuitySnapshotFiles } from './state.js'
|
|
10
|
+
import { readIdentityStateString } from '../custody/state.js'
|
|
11
|
+
import { shortCid } from '../shared/model/format.js'
|
|
12
12
|
|
|
13
13
|
type PrivateAction = 'soul' | 'memory' | 'skills' | 'export-backup' | 'back'
|
|
14
14
|
type PublicAction = 'edit' | 'back'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { PinataJwtInput } from '
|
|
3
|
-
import type { Step } from '
|
|
2
|
+
import { PinataJwtInput } from '../shared/components/PinataJwtInput.js'
|
|
3
|
+
import type { Step } from '../identityHubReducer.js'
|
|
4
4
|
|
|
5
5
|
interface RebackupStorageScreenProps {
|
|
6
6
|
step: Extract<Step, { kind: 'rebackup-storage' | 'public-profile-storage' }>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Box, Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { Select } from '
|
|
5
|
-
import { theme } from '
|
|
6
|
-
import { localChangeStatusView, type LocalChangeStatusView } from '
|
|
3
|
+
import { Surface } from '../../../ui/Surface.js'
|
|
4
|
+
import { Select } from '../../../ui/Select.js'
|
|
5
|
+
import { theme } from '../../../ui/theme.js'
|
|
6
|
+
import { localChangeStatusView, type LocalChangeStatusView } from './state.js'
|
|
7
7
|
|
|
8
|
-
import type { ContinuityWorkingTreeStatus } from '
|
|
8
|
+
import type { ContinuityWorkingTreeStatus } from '../../continuity/storage.js'
|
|
9
9
|
|
|
10
10
|
type RecoveryConfirmMode = 'publish' | 'refetch'
|
|
11
11
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Box, Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { Select } from '
|
|
5
|
-
import { theme } from '
|
|
6
|
-
import type { ContinuityWorkingTreeStatus } from '
|
|
7
|
-
import { changedContinuitySnapshotFiles } from '
|
|
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 '
|
|
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 '
|
|
11
|
+
} from '../../continuity/storage.js'
|
|
12
12
|
import {
|
|
13
13
|
createWalletRestoreAccessChallenge,
|
|
14
14
|
serializeContinuitySnapshotEnvelope,
|
|
15
15
|
type WalletChallengePurpose,
|
|
16
|
-
} from '
|
|
16
|
+
} from '../../continuity/envelope.js'
|
|
17
17
|
import {
|
|
18
18
|
createAgentCard,
|
|
19
19
|
defaultPublicSkillsProfile,
|
|
20
20
|
serializeAgentCard,
|
|
21
|
-
} from '
|
|
22
|
-
import { recordPublishedContinuitySnapshot } from '
|
|
23
|
-
import { addToIpfs, DEFAULT_IPFS_API_URL, isPinataUploadUrl } from '
|
|
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 '
|
|
31
|
-
import { resolveValidatedPinataJwt, savePinataJwt } from '
|
|
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 '
|
|
37
|
+
} from '../../wallet/browserWallet.js'
|
|
38
38
|
import {
|
|
39
39
|
encodeRotateAgentURI,
|
|
40
40
|
isAgentInVault,
|
|
41
|
-
} from '
|
|
42
|
-
import type { Step, ProfileUpdates } from '
|
|
43
|
-
import { acquireTxGuard, releaseTxGuard } from '
|
|
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 '
|
|
61
|
+
} from './snapshot.js'
|
|
62
62
|
import {
|
|
63
63
|
appendResolverSyncWarning,
|
|
64
64
|
markCurrentContinuityFilesPublished,
|
|
65
65
|
resolverSyncWarningMessage,
|
|
66
|
-
|
|
67
|
-
} from '../shared/sync.js'
|
|
66
|
+
syncVaultOperatorsAfterOwnerSave,
|
|
67
|
+
} from '../shared/effects/sync.js'
|
|
68
68
|
import { runOperatorWalletRebackup } from './vault.js'
|
|
69
69
|
|
|
70
70
|
type BackupMetadata = NonNullable<EthagentIdentity['backup']>
|
|
@@ -360,7 +360,7 @@ async function runRebackupSigningInner(
|
|
|
360
360
|
}
|
|
361
361
|
await recordPublishedContinuitySnapshot({ identity: nextIdentity, label: 'published encrypted snapshot' }).catch(() => null)
|
|
362
362
|
await markCurrentContinuityFilesPublished(nextIdentity).catch(() => null)
|
|
363
|
-
const resolverSyncWarning = await
|
|
363
|
+
const resolverSyncWarning = await syncVaultOperatorsAfterOwnerSave({
|
|
364
364
|
beforeIdentity: step.identity,
|
|
365
365
|
afterIdentity: nextIdentity,
|
|
366
366
|
registry: step.registry,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { getAddress, isAddress, type Address } from 'viem'
|
|
2
|
-
import type { EthagentIdentity } from '
|
|
3
|
-
import type { ProfileUpdates } from '
|
|
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 '
|
|
10
|
+
} from '../../continuity/envelope.js'
|
|
11
11
|
import {
|
|
12
12
|
continuityAgentSnapshot,
|
|
13
13
|
defaultContinuityFiles,
|
|
14
|
-
} from '
|
|
15
|
-
import type { Erc8004RegistryConfig, EthagentOperatorsPointer } from '
|
|
16
|
-
import { readOwnerAddressField } from '
|
|
17
|
-
import { readCustodyMode } from '
|
|
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 '
|
|
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 '
|
|
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 '
|
|
9
|
+
} from '../../continuity/storage.js'
|
|
10
10
|
import {
|
|
11
11
|
createWalletRestoreAccessChallenge,
|
|
12
12
|
serializeContinuitySnapshotEnvelope,
|
|
13
13
|
type WalletChallengePurpose,
|
|
14
|
-
} from '
|
|
14
|
+
} from '../../continuity/envelope.js'
|
|
15
15
|
import {
|
|
16
16
|
createAgentCard,
|
|
17
17
|
defaultPublicSkillsProfile,
|
|
18
18
|
serializeAgentCard,
|
|
19
|
-
} from '
|
|
20
|
-
import { recordPublishedContinuitySnapshot } from '
|
|
21
|
-
import { addToIpfs, DEFAULT_IPFS_API_URL } from '
|
|
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 '
|
|
25
|
+
} from '../../registry/erc8004.js'
|
|
26
26
|
import {
|
|
27
27
|
VAULT_ABI,
|
|
28
28
|
encodeRotateAgentURI,
|
|
29
|
-
} from '
|
|
29
|
+
} from '../../registry/vault.js'
|
|
30
30
|
import {
|
|
31
31
|
requestBrowserWalletSignature,
|
|
32
32
|
requestBrowserWalletSignatureAndTransaction,
|
|
33
33
|
type WalletPurpose,
|
|
34
|
-
} from '
|
|
35
|
-
import type { Step } from '
|
|
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 '
|
|
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 '
|
|
4
|
-
import { Select } from '
|
|
5
|
-
import { TextInput } from '
|
|
6
|
-
import { theme } from '
|
|
7
|
-
import { normalizeErc8004RegistryConfig } from '
|
|
8
|
-
import { networkLabel } from '
|
|
9
|
-
import type { Step } from '
|
|
10
|
-
import { createStepNumber, CREATE_STEP_LABELS } from '
|
|
11
|
-
import { WalletApprovalScreen } from '
|
|
12
|
-
import { BusyScreen } from '
|
|
13
|
-
import { FlowTimeline } from '
|
|
14
|
-
import { PinataJwtInput } from '
|
|
15
|
-
import type { BrowserWalletReady } from '
|
|
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 '../
|
|
39
|
+
import { initialAgentState, PREFLIGHT_AGENT_URI } from '../profile/identity.js'
|
|
40
40
|
import type { Step } from '../identityHubReducer.js'
|
|
41
|
-
import type { EffectCallbacks } from '
|
|
42
|
-
import { awaitConfirmedReceipt } from '
|
|
43
|
-
import { assertVerifiedPin } from '
|
|
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,26 +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 '
|
|
5
|
-
import { Select } from '
|
|
6
|
-
import { theme } from '
|
|
7
|
-
import type { ProfileUpdates, Step } from '
|
|
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 '
|
|
14
|
-
import { ensValidationReasonText, selectEnsStatus } from '
|
|
15
|
-
import { shortAddress } from '
|
|
16
|
-
import { lastBackupLabel } from '
|
|
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
|
-
describeFixPlanItem,
|
|
19
|
-
fixPlanRequiresOwnerWallet,
|
|
20
|
-
reconcileWalletSetup,
|
|
21
18
|
type AgentReconciliation,
|
|
22
|
-
|
|
23
|
-
} from '../../reconciliation/index.js'
|
|
19
|
+
} from '../shared/reconciliation/index.js'
|
|
24
20
|
|
|
25
21
|
const footerHint = (hint: string) => <Text color={theme.dim}>{hint}</Text>
|
|
26
22
|
|
|
@@ -37,7 +33,6 @@ interface CustodyEditFlowProps {
|
|
|
37
33
|
onReturnToVault: (returnTo: Step, vaultAddress: Address) => void
|
|
38
34
|
onResumeAdvanced: (returnTo: Step) => void
|
|
39
35
|
onManageOperatorWallets: () => void
|
|
40
|
-
onFixRecords: (plan: RecordsFixPlan) => void
|
|
41
36
|
onPrepareTransfer: () => void
|
|
42
37
|
onBack: () => void
|
|
43
38
|
}
|
|
@@ -59,7 +54,6 @@ export const CustodyEditFlow: React.FC<CustodyEditFlowProps> = ({
|
|
|
59
54
|
onReturnToVault,
|
|
60
55
|
onResumeAdvanced,
|
|
61
56
|
onManageOperatorWallets,
|
|
62
|
-
onFixRecords,
|
|
63
57
|
onPrepareTransfer,
|
|
64
58
|
onBack,
|
|
65
59
|
}) => {
|
|
@@ -77,19 +71,8 @@ export const CustodyEditFlow: React.FC<CustodyEditFlowProps> = ({
|
|
|
77
71
|
const tokenLabel = identity.agentId ? `Token #${identity.agentId}` : 'Token #unknown'
|
|
78
72
|
const tokenOwner = identity.ownerAddress ?? identity.address
|
|
79
73
|
|
|
80
|
-
const [fixPlan, setFixPlan] = React.useState<RecordsFixPlan | null>(null)
|
|
81
|
-
React.useEffect(() => {
|
|
82
|
-
if (step.kind !== 'custody-model') return
|
|
83
|
-
if (custodyMode !== 'advanced') return
|
|
84
|
-
let cancelled = false
|
|
85
|
-
reconcileWalletSetup({ identity, registry })
|
|
86
|
-
.then(plan => { if (!cancelled) setFixPlan(plan) })
|
|
87
|
-
.catch(() => { if (!cancelled) setFixPlan(null) })
|
|
88
|
-
return () => { cancelled = true }
|
|
89
|
-
}, [identity, registry, step.kind, custodyMode])
|
|
90
|
-
|
|
91
74
|
if (step.kind === 'custody-model') {
|
|
92
|
-
type Action = 'switch-advanced' | 'switch-simple' | 'resume-advanced' | 'cancel-advanced' | 'withdraw-token' | 'return-to-vault' | 'manage-operator-wallets' | '
|
|
75
|
+
type Action = 'switch-advanced' | 'switch-simple' | 'resume-advanced' | 'cancel-advanced' | 'withdraw-token' | 'return-to-vault' | 'manage-operator-wallets' | 'back'
|
|
93
76
|
const onChainCustody = reconciliation?.custody
|
|
94
77
|
const midFlow = onChainCustody === 'mid-flow-uri-pending'
|
|
95
78
|
const isAdvanced = onChainCustody === 'advanced' || midFlow || custodyMode === 'advanced'
|
|
@@ -149,15 +132,6 @@ export const CustodyEditFlow: React.FC<CustodyEditFlowProps> = ({
|
|
|
149
132
|
hint: 'Add or revoke wallets that can publish updates onchain.',
|
|
150
133
|
})
|
|
151
134
|
}
|
|
152
|
-
const hasFixablePlan = fixPlan !== null && fixPlanRequiresOwnerWallet(fixPlan)
|
|
153
|
-
if (hasFixablePlan) {
|
|
154
|
-
options.push({ value: 'fix-records', role: 'section', label: 'Records Out Of Sync' })
|
|
155
|
-
options.push({
|
|
156
|
-
value: 'fix-records',
|
|
157
|
-
label: 'Fix Records (Owner Wallet)',
|
|
158
|
-
hint: 'Sync ENS resolver approvals with the operator wallet list.',
|
|
159
|
-
})
|
|
160
|
-
}
|
|
161
135
|
options.push({ value: 'back', role: 'section', label: 'Navigation' })
|
|
162
136
|
options.push({ value: 'back', label: 'Back', hint: 'Return to Identity Hub', role: 'utility' })
|
|
163
137
|
const notice = step.kind === 'custody-model' ? step.notice : undefined
|
|
@@ -201,14 +175,6 @@ export const CustodyEditFlow: React.FC<CustodyEditFlowProps> = ({
|
|
|
201
175
|
return <Row label="Last Saved" value={lastBackup} muted={lastBackup === 'never'} />
|
|
202
176
|
})()}
|
|
203
177
|
</Box>
|
|
204
|
-
{fixPlan && fixPlan.items.length > 0 ? (
|
|
205
|
-
<Box marginTop={1} flexDirection="column">
|
|
206
|
-
<Text color={theme.accentPeriwinkle} bold>Records out of sync:</Text>
|
|
207
|
-
{fixPlan.items.map((item, idx) => (
|
|
208
|
-
<Text key={idx} color={theme.dim}>· {describeFixPlanItem(item)}</Text>
|
|
209
|
-
))}
|
|
210
|
-
</Box>
|
|
211
|
-
) : null}
|
|
212
178
|
<Box marginTop={1}>
|
|
213
179
|
<Select<Action>
|
|
214
180
|
options={options}
|
|
@@ -226,10 +192,6 @@ export const CustodyEditFlow: React.FC<CustodyEditFlowProps> = ({
|
|
|
226
192
|
onSetStep({ kind: 'custody-simple-confirm', identity, registry, returnTo })
|
|
227
193
|
return
|
|
228
194
|
}
|
|
229
|
-
if (choice === 'fix-records') {
|
|
230
|
-
if (fixPlan) onFixRecords(fixPlan)
|
|
231
|
-
return
|
|
232
|
-
}
|
|
233
195
|
if (choice === 'switch-advanced') {
|
|
234
196
|
onSetStep({ kind: 'custody-advanced-confirm', identity, registry, returnTo })
|
|
235
197
|
return
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { Address } from 'viem'
|
|
2
|
-
import { createErc8004PublicClient } from '
|
|
3
|
-
import { discoverPriorVaultFromTokenOwner, isAgentInVault } from '
|
|
4
|
-
import type { ProfileUpdates, Step } from '
|
|
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 './
|
|
7
|
-
import type { CustodyFlowDeps } from './
|
|
8
|
-
import { humanOwnerAddress } from './
|
|
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,
|
|
@@ -16,7 +16,7 @@ export function createCustodyFlowActions({
|
|
|
16
16
|
}: CustodyFlowDeps): {
|
|
17
17
|
beginVaultDeposit: (currentStep: Step, returnTo: Step, profileUpdates: ProfileUpdates) => void
|
|
18
18
|
beginVaultUnwrap: (currentStep: Step, returnTo: Step, profileUpdates: ProfileUpdates) => void
|
|
19
|
-
beginWithdrawToken: (currentStep: Step, returnTo: Step) => void
|
|
19
|
+
beginWithdrawToken: (currentStep: Step, returnTo: Step, returnContext?: 'ens' | 'simple-exit') => void
|
|
20
20
|
beginReturnToVault: (currentStep: Step, returnTo: Step, vaultAddress: Address) => void
|
|
21
21
|
} {
|
|
22
22
|
const beginVaultDeposit = (currentStep: Step, returnTo: Step, profileUpdates: ProfileUpdates): void => {
|
|
@@ -122,8 +122,8 @@ export function createCustodyFlowActions({
|
|
|
122
122
|
})()
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
const beginWithdrawToken = (currentStep: Step, returnTo: Step): void => {
|
|
126
|
-
if (!isCustodyEditStep(currentStep)) return
|
|
125
|
+
const beginWithdrawToken = (currentStep: Step, returnTo: Step, returnContext?: 'ens' | 'simple-exit'): void => {
|
|
126
|
+
if (!isCustodyEditStep(currentStep) && currentStep.kind !== 'edit-profile-ens') return
|
|
127
127
|
const vaultAddress = resolveVaultAddress(currentStep.identity, config?.erc8004?.operatorVaults)
|
|
128
128
|
if (!vaultAddress) {
|
|
129
129
|
handleStepError(
|
|
@@ -147,6 +147,7 @@ export function createCustodyFlowActions({
|
|
|
147
147
|
registry: currentStep.registry,
|
|
148
148
|
vaultAddress,
|
|
149
149
|
returnTo,
|
|
150
|
+
...(returnContext ? { returnContext } : {}),
|
|
150
151
|
})
|
|
151
152
|
;(async () => {
|
|
152
153
|
const client = createErc8004PublicClient(currentStep.registry)
|
|
@@ -172,6 +173,7 @@ export function createCustodyFlowActions({
|
|
|
172
173
|
vaultAddress,
|
|
173
174
|
agentId: activeAgentId,
|
|
174
175
|
returnTo,
|
|
176
|
+
...(returnContext ? { returnContext } : {}),
|
|
175
177
|
})
|
|
176
178
|
return
|
|
177
179
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { EthagentConfig, EthagentIdentity } from '
|
|
2
|
-
import { buildSeedConfigForIdentity } from '
|
|
3
|
-
import { readOwnerAddressField } from '
|
|
4
|
-
import { supportedErc8004ChainForId, type Erc8004RegistryConfig } from '
|
|
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 '
|
|
3
|
-
import { readVaultAddressField } from '
|
|
4
|
-
import { createErc8004PublicClient, type Erc8004RegistryConfig } from '
|
|
5
|
-
import { isAgentInVault, resolveConfiguredVaultAddress } from '
|
|
6
|
-
import { readCustodyMode } from '
|
|
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 '
|
|
4
|
-
import { Select } from '
|
|
5
|
-
import { theme } from '
|
|
6
|
-
import { WalletApprovalScreen } from '
|
|
7
|
-
import { shortAddress } from '
|
|
8
|
-
import type { Step } from '
|
|
9
|
-
import type { CustodyFlowDeps } from './
|
|
10
|
-
import { chainLabel, humanOwnerAddress } from './
|
|
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 '
|
|
11
|
+
} from '../../registry/vault.js'
|
|
12
12
|
import {
|
|
13
13
|
createErc8004PublicClient,
|
|
14
14
|
type Erc8004RegistryConfig,
|
|
15
|
-
} from '
|
|
16
|
-
import type { EthagentIdentity } from '
|
|
17
|
-
import { readVaultAddressField, readOwnerAddressField } from '
|
|
18
|
-
import { prepareTransactionGasFee, sendBrowserWalletTransaction } from '
|
|
19
|
-
import { acquireTxGuard, releaseTxGuard, type TxGuardKind } from '
|
|
20
|
-
import { awaitConfirmedReceipt } from '
|
|
21
|
-
import type { EffectCallbacks } from '
|
|
22
|
-
import { readCustodyMode } from '
|
|
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,
|