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.
- package/README.md +11 -0
- package/package.json +2 -1
- package/src/app/FirstRun.tsx +3 -7
- package/src/app/FirstRunTimeline.tsx +1 -1
- package/src/chat/ChatBottomPane.tsx +29 -11
- package/src/chat/ChatScreen.tsx +169 -38
- 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 +5 -2
- package/src/chat/chatTurnOrchestrator.ts +7 -9
- package/src/chat/commands.ts +26 -26
- 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} +61 -25
- package/src/chat/input/imageRefs.ts +30 -0
- 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} +50 -41
- package/src/chat/views/RewindView.tsx +410 -0
- package/src/identity/continuity/privateEdit/diff.ts +2 -78
- package/src/identity/hub/OperationalRoutes.tsx +21 -21
- 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} +17 -17
- 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 +9 -9
- package/src/identity/hub/{flows/custody/custodyFlowActions.ts → custody/actions.ts} +6 -6
- 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} +5 -5
- 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/{flows/ens → ens}/EnsEditAdvancedScreens.tsx +13 -13
- package/src/identity/hub/{flows/ens → ens}/EnsEditFlow.tsx +7 -7
- package/src/identity/hub/{flows/ens → ens}/EnsEditMaintenanceScreens.tsx +10 -10
- package/src/identity/hub/{flows/ens → ens}/EnsEditReviewScreens.tsx +12 -12
- package/src/identity/hub/{flows/ens → ens}/EnsEditRunners.tsx +5 -5
- package/src/identity/hub/{flows/ens → ens}/EnsEditShared.tsx +10 -10
- package/src/identity/hub/{flows/ens → ens}/EnsEditSimpleScreens.tsx +14 -14
- package/src/identity/hub/{flows/ens/IdentityHubEnsFlow.tsx → ens/EnsFlow.tsx} +12 -12
- package/src/identity/hub/{flows/ens/OperatorWalletsScreen.tsx → ens/EnsOperatorWalletsScreen.tsx} +17 -17
- package/src/identity/hub/{advancedEnsValidation.ts → ens/advancedEnsValidation.ts} +2 -2
- package/src/identity/hub/{flows/ens/ensEditCopy.ts → ens/editCopy.ts} +3 -3
- 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 +239 -239
- package/src/identity/hub/{flows/ens/ensEditTypes.ts → ens/types.ts} +7 -7
- package/src/identity/hub/identityHubReducer.ts +3 -3
- package/src/identity/hub/{flows/profile → profile}/EditProfileFlow.tsx +11 -11
- package/src/identity/hub/{effects/publicProfile/runPublicProfileSave.ts → profile/effects.ts} +18 -18
- package/src/identity/hub/{model → profile}/identity.ts +3 -3
- package/src/identity/hub/{effects/profile/profileState.ts → profile/state.ts} +181 -181
- package/src/identity/hub/{flows/restore → restore}/RestoreFlow.tsx +16 -16
- 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/{effects → restore}/restoreAdmin.ts +1 -1
- 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 +8 -8
- package/src/identity/hub/{components → shared/components}/MenuScreen.tsx +7 -7
- 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 +1 -1
- 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 +4 -4
- 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 -1
- package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/ownership.ts +2 -2
- package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/run.ts +6 -6
- 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/models/ModelPicker.tsx +143 -9
- package/src/models/catalog.ts +2 -1
- package/src/models/huggingface.ts +180 -2
- package/src/models/llamacpp.ts +110 -15
- package/src/models/llamacppPreflight.ts +30 -11
- package/src/models/modelPickerOptions.ts +16 -15
- package/src/models/providerDisplay.ts +16 -0
- package/src/providers/anthropic.ts +36 -5
- package/src/providers/contracts.ts +9 -1
- package/src/providers/errors.ts +6 -4
- package/src/providers/gemini.ts +29 -3
- package/src/providers/openai-chat.ts +83 -3
- package/src/providers/openai-responses-format.ts +29 -8
- package/src/providers/openai-responses.ts +22 -7
- package/src/providers/registry.ts +1 -0
- package/src/runtime/sessionMode.ts +1 -1
- package/src/runtime/systemPrompt.ts +3 -1
- package/src/runtime/toolExecution.ts +9 -6
- package/src/runtime/turn.ts +29 -0
- package/src/storage/config.ts +1 -0
- package/src/storage/rewind.ts +20 -0
- package/src/storage/sessions.ts +16 -3
- 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 +5 -1
- package/src/tools/writeFileTool.ts +8 -3
- package/src/ui/Spinner.tsx +39 -5
- package/src/ui/TextInput.tsx +2 -2
- package/src/ui/theme.ts +19 -0
- package/src/utils/clipboard.ts +10 -7
- package/src/utils/images.ts +140 -0
- package/src/utils/messages.ts +2 -0
- package/src/chat/RewindView.tsx +0 -386
- package/src/chat/toolResultDisplay.ts +0 -8
- package/src/identity/hub/effects/index.ts +0 -73
- 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/token-transfer/index.ts +0 -6
- /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}/agentReconciliation/types.ts +0 -0
- /package/src/identity/hub/{reconciliation → shared/reconciliation}/index.ts +0 -0
- /package/src/identity/hub/{reconciliation → shared/reconciliation}/useAgentReconciliation.ts +0 -0
- /package/src/identity/hub/{reconciliation → shared/reconciliation}/walletSetup.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
|
@@ -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 { PinataJwtInput } from '
|
|
7
|
-
import type { Step } from '
|
|
3
|
+
import { Surface } from '../../../ui/Surface.js'
|
|
4
|
+
import { Select } from '../../../ui/Select.js'
|
|
5
|
+
import { theme } from '../../../ui/theme.js'
|
|
6
|
+
import { PinataJwtInput } from '../shared/components/PinataJwtInput.js'
|
|
7
|
+
import type { Step } from '../identityHubReducer.js'
|
|
8
8
|
|
|
9
9
|
type StorageCredentialAction = 'edit' | 'forget' | 'back'
|
|
10
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { Spinner } from '
|
|
5
|
-
import { theme } from '
|
|
6
|
-
import { useAppInput } from '
|
|
3
|
+
import { Surface } from '../../../../ui/Surface.js'
|
|
4
|
+
import { Spinner } from '../../../../ui/Spinner.js'
|
|
5
|
+
import { theme } from '../../../../ui/theme.js'
|
|
6
|
+
import { useAppInput } from '../../../../app/input/AppInputProvider.js'
|
|
7
7
|
|
|
8
8
|
type BusyScreenProps = {
|
|
9
9
|
title: string
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Box, Text } from 'ink'
|
|
3
|
-
import { theme } from '
|
|
4
|
-
import { Surface } from '
|
|
5
|
-
import { Select, type SelectOption } from '
|
|
6
|
-
import type { EthagentConfig, EthagentIdentity } from '
|
|
3
|
+
import { theme } from '../../../../ui/theme.js'
|
|
4
|
+
import { Surface } from '../../../../ui/Surface.js'
|
|
5
|
+
import { Select, type SelectOption } from '../../../../ui/Select.js'
|
|
6
|
+
import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
|
|
7
7
|
import { copyableIdentityFields, identityValuesCopyHint } from '../model/copy.js'
|
|
8
8
|
import { IdentitySummary } from './IdentitySummary.js'
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { Select } from '
|
|
5
|
-
import { theme } from '
|
|
3
|
+
import { Surface } from '../../../../ui/Surface.js'
|
|
4
|
+
import { Select } from '../../../../ui/Select.js'
|
|
5
|
+
import { theme } from '../../../../ui/theme.js'
|
|
6
6
|
import type { IdentityHubErrorView } from '../model/errors.js'
|
|
7
|
-
import type { Step } from '
|
|
7
|
+
import type { Step } from '../../identityHubReducer.js'
|
|
8
8
|
|
|
9
9
|
type ErrorScreenProps = {
|
|
10
10
|
error: IdentityHubErrorView
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Box, Text } from 'ink'
|
|
3
|
-
import { theme } from '
|
|
4
|
-
import type { EthagentConfig, EthagentIdentity } from '
|
|
3
|
+
import { theme } from '../../../../ui/theme.js'
|
|
4
|
+
import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
|
|
5
5
|
import {
|
|
6
6
|
displayCustodyMode,
|
|
7
7
|
identityOwnerAddress,
|
|
8
8
|
readCustodyMode,
|
|
9
9
|
readIdentityStateString,
|
|
10
|
-
} from '
|
|
10
|
+
} from '../../custody/state.js'
|
|
11
11
|
import {
|
|
12
12
|
hasPendingPublish,
|
|
13
13
|
localChangeStatusView,
|
|
14
14
|
type LocalChangeStatusView,
|
|
15
|
-
} from '
|
|
16
|
-
import { ensValidationReasonText, selectEnsStatus } from '
|
|
15
|
+
} from '../../continuity/state.js'
|
|
16
|
+
import { ensValidationReasonText, selectEnsStatus } from '../../ens/state.js'
|
|
17
17
|
import { shortAddress } from '../model/format.js'
|
|
18
|
-
import { identitySummaryRows, lastBackupLabel } from '
|
|
19
|
-
import { transferSnapshotView, type TransferSnapshotView } from '
|
|
18
|
+
import { identitySummaryRows, lastBackupLabel } from '../../profile/identity.js'
|
|
19
|
+
import { transferSnapshotView, type TransferSnapshotView } from '../../transfer/state.js'
|
|
20
20
|
|
|
21
|
-
import type { ContinuityWorkingTreeStatus } from '
|
|
21
|
+
import type { ContinuityWorkingTreeStatus } from '../../../continuity/storage.js'
|
|
22
22
|
|
|
23
23
|
interface IdentitySummaryProps {
|
|
24
24
|
identity?: EthagentIdentity
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Box, Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { Select, type SelectOption } from '
|
|
5
|
-
import { theme } from '
|
|
6
|
-
import type { EthagentConfig, EthagentIdentity } from '
|
|
7
|
-
import type { ContinuityWorkingTreeStatus } from '
|
|
8
|
-
import { identityPerspective, readCustodyMode } from '
|
|
3
|
+
import { Surface } from '../../../../ui/Surface.js'
|
|
4
|
+
import { Select, type SelectOption } from '../../../../ui/Select.js'
|
|
5
|
+
import { theme } from '../../../../ui/theme.js'
|
|
6
|
+
import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
|
|
7
|
+
import type { ContinuityWorkingTreeStatus } from '../../../continuity/storage.js'
|
|
8
|
+
import { identityPerspective, readCustodyMode } from '../../custody/state.js'
|
|
9
9
|
import { identityValuesCopyHint } from '../model/copy.js'
|
|
10
|
-
import { transferSnapshotView } from '
|
|
10
|
+
import { transferSnapshotView } from '../../transfer/state.js'
|
|
11
11
|
import { IdentitySummary } from './IdentitySummary.js'
|
|
12
12
|
import type { AgentReconciliation } from '../reconciliation/index.js'
|
|
13
13
|
import { menuFlagsFromReconciliation } from './menuFlagsFromReconciliation.js'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Surface } from '
|
|
3
|
-
import { Select, type SelectOption } from '
|
|
4
|
-
import type { SelectableNetwork } from '
|
|
5
|
-
import { SELECTABLE_NETWORKS } from '
|
|
2
|
+
import { Surface } from '../../../../ui/Surface.js'
|
|
3
|
+
import { Select, type SelectOption } from '../../../../ui/Select.js'
|
|
4
|
+
import type { SelectableNetwork } from '../../../../storage/config.js'
|
|
5
|
+
import { SELECTABLE_NETWORKS } from '../../../../storage/config.js'
|
|
6
6
|
import { networkLabel, networkSubtitle } from '../model/network.js'
|
|
7
7
|
|
|
8
8
|
type NetworkScreenProps = {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { TextInput } from '
|
|
5
|
-
import { theme } from '
|
|
6
|
-
import { extractPinataJwt } from '
|
|
3
|
+
import { Surface } from '../../../../ui/Surface.js'
|
|
4
|
+
import { TextInput } from '../../../../ui/TextInput.js'
|
|
5
|
+
import { theme } from '../../../../ui/theme.js'
|
|
6
|
+
import { extractPinataJwt } from '../../../storage/ipfs.js'
|
|
7
7
|
|
|
8
8
|
const PINATA_API_KEYS_URL = 'https://app.pinata.cloud/developers/api-keys'
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Box, Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { Select } from '
|
|
5
|
-
import { theme } from '
|
|
6
|
-
import { transferSnapshotView } from '
|
|
7
|
-
import type { EthagentIdentity } from '
|
|
3
|
+
import { Surface } from '../../../../ui/Surface.js'
|
|
4
|
+
import { Select } from '../../../../ui/Select.js'
|
|
5
|
+
import { theme } from '../../../../ui/theme.js'
|
|
6
|
+
import { transferSnapshotView } from '../../transfer/state.js'
|
|
7
|
+
import type { EthagentIdentity } from '../../../../storage/config.js'
|
|
8
8
|
|
|
9
9
|
type UnlinkedIdentityScreenProps = {
|
|
10
10
|
identity?: EthagentIdentity
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Box, Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { Spinner } from '
|
|
5
|
-
import { theme } from '
|
|
6
|
-
import { useAppInput } from '
|
|
7
|
-
import { openExternalUrl } from '
|
|
8
|
-
import type { BrowserWalletReady } from '
|
|
3
|
+
import { Surface } from '../../../../ui/Surface.js'
|
|
4
|
+
import { Spinner } from '../../../../ui/Spinner.js'
|
|
5
|
+
import { theme } from '../../../../ui/theme.js'
|
|
6
|
+
import { useAppInput } from '../../../../app/input/AppInputProvider.js'
|
|
7
|
+
import { openExternalUrl } from '../../../../utils/openExternal.js'
|
|
8
|
+
import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
|
|
9
9
|
|
|
10
10
|
type WalletApprovalScreenProps = {
|
|
11
11
|
title: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Hex, PublicClient } from 'viem'
|
|
2
|
-
import type { PendingTxKind } from '
|
|
3
|
-
import { clearPendingTx, recordPendingTx } from '
|
|
2
|
+
import type { PendingTxKind } from '../../../../storage/config.js'
|
|
3
|
+
import { clearPendingTx, recordPendingTx } from '../../../../storage/config.js'
|
|
4
4
|
|
|
5
5
|
export async function awaitConfirmedReceipt(
|
|
6
6
|
client: Pick<PublicClient, 'waitForTransactionReceipt'>,
|
|
@@ -13,13 +13,13 @@ import { sendBrowserWalletTransaction } from '../../../wallet/browserWallet.js'
|
|
|
13
13
|
import {
|
|
14
14
|
computeApprovalDiff,
|
|
15
15
|
type ApprovalDiff,
|
|
16
|
-
} from '
|
|
17
|
-
import { normalizeApprovedOperatorWallets } from '
|
|
16
|
+
} from '../reconciliation/index.js'
|
|
17
|
+
import { normalizeApprovedOperatorWallets } from '../operatorWallets.js'
|
|
18
18
|
import { readOwnerAddressField } from '../../../identityCompat.js'
|
|
19
19
|
import { localContinuitySnapshotContentHashes } from '../../../continuity/storage.js'
|
|
20
20
|
import { updatePublishedContinuitySnapshotContentHashes } from '../../../continuity/snapshots.js'
|
|
21
|
-
import type { EffectCallbacks } from '
|
|
22
|
-
import { awaitConfirmedReceipt } from '
|
|
21
|
+
import type { EffectCallbacks } from './types.js'
|
|
22
|
+
import { awaitConfirmedReceipt } from './receipts.js'
|
|
23
23
|
|
|
24
24
|
export function resolverSyncWarningMessage(err: unknown): string {
|
|
25
25
|
return err instanceof Error ? err.message : String(err)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Address } from 'viem'
|
|
2
|
-
import type { EthagentIdentity } from '
|
|
3
|
-
import type { BrowserWalletReady } from '
|
|
4
|
-
import type { Step } from '
|
|
2
|
+
import type { EthagentIdentity } from '../../../../storage/config.js'
|
|
3
|
+
import type { BrowserWalletReady } from '../../../wallet/browserWallet.js'
|
|
4
|
+
import type { Step } from '../../identityHubReducer.js'
|
|
5
5
|
|
|
6
6
|
export type IdentityCompletionSource = 'create' | 'restore' | 'update'
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EthagentConfig, EthagentIdentity } from '
|
|
2
|
-
import { readCustodyMode, readIdentityStateString } from '
|
|
1
|
+
import type { EthagentConfig, EthagentIdentity } from '../../../../storage/config.js'
|
|
2
|
+
import { readCustodyMode, readIdentityStateString } from '../../custody/state.js'
|
|
3
3
|
|
|
4
4
|
type CopyableField = {
|
|
5
5
|
label: string
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { ZodError } from 'zod'
|
|
2
|
-
import { RegisterAgentPreflightError } from '
|
|
3
|
-
import { AgentStateOwnerMismatchError } from '
|
|
2
|
+
import { RegisterAgentPreflightError } from '../../../registry/erc8004.js'
|
|
3
|
+
import { AgentStateOwnerMismatchError } from '../../../crypto/backupEnvelope.js'
|
|
4
4
|
import {
|
|
5
5
|
ContinuitySnapshotOwnerMismatchError,
|
|
6
6
|
ContinuityTransferSnapshotTargetMismatchError,
|
|
7
|
-
} from '
|
|
7
|
+
} from '../../../continuity/envelope.js'
|
|
8
8
|
import {
|
|
9
9
|
VaultBytecodeMismatchError,
|
|
10
10
|
formatVaultBytecodeMismatchDetail,
|
|
11
|
-
} from '
|
|
12
|
-
import { BrowserWalletError } from '
|
|
11
|
+
} from '../../../registry/vault.js'
|
|
12
|
+
import { BrowserWalletError } from '../../../wallet/browserWallet.js'
|
|
13
13
|
import { TxGuardBusyError } from '../txGuard.js'
|
|
14
14
|
import { shortAddress } from './format.js'
|
|
15
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { EthagentConfig, EthagentIdentity, SelectableNetwork } from '
|
|
2
|
-
import { supportedErc8004ChainForId } from '
|
|
3
|
-
import { resolveSelectedNetwork } from '
|
|
1
|
+
import type { EthagentConfig, EthagentIdentity, SelectableNetwork } from '../../../../storage/config.js'
|
|
2
|
+
import { supportedErc8004ChainForId } from '../../../registry/erc8004.js'
|
|
3
|
+
import { resolveSelectedNetwork } from '../../../registry/registryConfig.js'
|
|
4
4
|
|
|
5
5
|
const NETWORK_LABELS: Record<SelectableNetwork, string> = {
|
|
6
6
|
mainnet: 'ethereum mainnet',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getAddress, isAddress, type Address } from 'viem'
|
|
2
|
-
import type { WalletContinuityRestoreAccessKey } from '
|
|
2
|
+
import type { WalletContinuityRestoreAccessKey } from '../../continuity/envelope.js'
|
|
3
3
|
|
|
4
4
|
export type ApprovedOperatorWalletRecord = {
|
|
5
5
|
address: Address
|
package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/hook.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
|
-
import type { EthagentConfig } from '
|
|
2
|
+
import type { EthagentConfig } from '../../../../../storage/config.js'
|
|
3
3
|
import { emptyReconciliation, runReconciliation } from './run.js'
|
|
4
4
|
import type { AgentReconciliation } from './types.js'
|
|
5
5
|
|
package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/ownership.ts
RENAMED
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
createErc8004PublicClient,
|
|
4
4
|
validateErc8004TokenOwner,
|
|
5
5
|
type Erc8004RegistryConfig,
|
|
6
|
-
} from '
|
|
7
|
-
import type { EthagentIdentity } from '
|
|
6
|
+
} from '../../../../registry/erc8004.js'
|
|
7
|
+
import type { EthagentIdentity } from '../../../../../storage/config.js'
|
|
8
8
|
|
|
9
9
|
export type OwnershipRole = 'token-holder' | 'vault-level-owner'
|
|
10
10
|
|
package/src/identity/hub/{reconciliation → shared/reconciliation}/agentReconciliation/run.ts
RENAMED
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
erc8004ConfigForSupportedChain,
|
|
5
5
|
validateErc8004TokenOwner,
|
|
6
6
|
type Erc8004RegistryConfig,
|
|
7
|
-
} from '
|
|
8
|
-
import { isAgentInVault, resolveConfiguredVaultAddress } from '
|
|
9
|
-
import type { EthagentConfig, EthagentIdentity } from '
|
|
10
|
-
import { readVaultAddressField } from '
|
|
11
|
-
import { readCustodyMode } from '
|
|
12
|
-
import { continuityWorkingTreeStatus, type ContinuityWorkingTreeStatus } from '
|
|
7
|
+
} from '../../../../registry/erc8004.js'
|
|
8
|
+
import { isAgentInVault, resolveConfiguredVaultAddress } from '../../../../registry/vault.js'
|
|
9
|
+
import type { EthagentConfig, EthagentIdentity } from '../../../../../storage/config.js'
|
|
10
|
+
import { readVaultAddressField } from '../../../../identityCompat.js'
|
|
11
|
+
import { readCustodyMode } from '../../../custody/state.js'
|
|
12
|
+
import { continuityWorkingTreeStatus, type ContinuityWorkingTreeStatus } from '../../../../continuity/storage.js'
|
|
13
13
|
import type { AgentReconciliation } from './types.js'
|
|
14
14
|
|
|
15
15
|
export function emptyReconciliation(): AgentReconciliation {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { EthagentConfig, EthagentIdentity } from '
|
|
2
|
-
import { supportedErc8004ChainForId } from '
|
|
3
|
-
import { snapshotSaveRequiresOwnerSigner } from '
|
|
4
|
-
import type { IdentityHubInitialAction } from '
|
|
5
|
-
import type { ProfileUpdates, Step } from '
|
|
1
|
+
import type { EthagentConfig, EthagentIdentity } from '../../../storage/config.js'
|
|
2
|
+
import { supportedErc8004ChainForId } from '../../registry/erc8004.js'
|
|
3
|
+
import { snapshotSaveRequiresOwnerSigner } from '../continuity/snapshot.js'
|
|
4
|
+
import type { IdentityHubInitialAction } from '../types.js'
|
|
5
|
+
import type { ProfileUpdates, Step } from '../identityHubReducer.js'
|
|
6
6
|
|
|
7
7
|
const MIN_BUSY_ERROR_MS = 2000
|
|
8
8
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import type { BrowserWalletReady } from '
|
|
3
|
-
import { supportedErc8004ChainForId } from '
|
|
2
|
+
import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
|
|
3
|
+
import { supportedErc8004ChainForId } from '../../registry/erc8004.js'
|
|
4
4
|
import {
|
|
5
5
|
runTokenTransferStorageSubmit,
|
|
6
6
|
runTokenTransferTargetSubmit,
|
|
7
|
-
} from '
|
|
7
|
+
} from './effects.js'
|
|
8
8
|
import type {
|
|
9
9
|
EffectCallbacks,
|
|
10
10
|
TokenTransferProgress,
|
|
11
|
-
} from '
|
|
12
|
-
import type { Step } from '
|
|
13
|
-
import { BusyScreen } from '
|
|
11
|
+
} from '../shared/effects/types.js'
|
|
12
|
+
import type { Step } from '../identityHubReducer.js'
|
|
13
|
+
import { BusyScreen } from '../shared/components/BusyScreen.js'
|
|
14
14
|
import { RebackupStorageScreen } from '../continuity/RebackupStorageScreen.js'
|
|
15
15
|
import {
|
|
16
16
|
TokenTransferReadyScreen,
|
|
@@ -27,7 +27,7 @@ type TokenTransferStep = Extract<Step, {
|
|
|
27
27
|
| 'token-transfer-ready'
|
|
28
28
|
}>
|
|
29
29
|
|
|
30
|
-
type
|
|
30
|
+
type TokenTransferFlowProps = {
|
|
31
31
|
step: TokenTransferStep
|
|
32
32
|
callbacks: EffectCallbacks
|
|
33
33
|
footer: React.ReactNode
|
|
@@ -45,7 +45,7 @@ export function isTokenTransferStep(step: Step): step is TokenTransferStep {
|
|
|
45
45
|
|| step.kind === 'token-transfer-ready'
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
export const
|
|
48
|
+
export const TokenTransferFlow: React.FC<TokenTransferFlowProps> = ({
|
|
49
49
|
step,
|
|
50
50
|
callbacks,
|
|
51
51
|
footer,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { Box, Text } from 'ink'
|
|
3
|
-
import { Surface } from '
|
|
4
|
-
import { Select } from '
|
|
5
|
-
import { Spinner } from '
|
|
6
|
-
import { TextInput } from '
|
|
7
|
-
import { theme } from '
|
|
8
|
-
import { useAppInput } from '
|
|
9
|
-
import { openExternalUrl } from '
|
|
10
|
-
import type { EthagentIdentity } from '
|
|
11
|
-
import type { BrowserWalletReady } from '
|
|
12
|
-
import type { TokenTransferProgress } from '
|
|
13
|
-
import { readCustodyMode } from '
|
|
14
|
-
import { shortAddress, shortCid } from '
|
|
15
|
-
import { FlowTimeline } from '
|
|
16
|
-
import { OPEN_BROWSER_HINT } from '
|
|
3
|
+
import { Surface } from '../../../ui/Surface.js'
|
|
4
|
+
import { Select } from '../../../ui/Select.js'
|
|
5
|
+
import { Spinner } from '../../../ui/Spinner.js'
|
|
6
|
+
import { TextInput } from '../../../ui/TextInput.js'
|
|
7
|
+
import { theme } from '../../../ui/theme.js'
|
|
8
|
+
import { useAppInput } from '../../../app/input/AppInputProvider.js'
|
|
9
|
+
import { openExternalUrl } from '../../../utils/openExternal.js'
|
|
10
|
+
import type { EthagentIdentity } from '../../../storage/config.js'
|
|
11
|
+
import type { BrowserWalletReady } from '../../wallet/browserWallet.js'
|
|
12
|
+
import type { TokenTransferProgress } from '../shared/effects/types.js'
|
|
13
|
+
import { readCustodyMode } from '../custody/state.js'
|
|
14
|
+
import { shortAddress, shortCid } from '../shared/model/format.js'
|
|
15
|
+
import { FlowTimeline } from '../shared/components/FlowTimeline.js'
|
|
16
|
+
import { OPEN_BROWSER_HINT } from '../shared/components/WalletApprovalScreen.js'
|
|
17
17
|
|
|
18
18
|
const TRANSFER_STEPS = ['Choose Receiver', 'Sender Signs', 'Receiver Signs', 'Sender Updates URI', 'Transfer Token']
|
|
19
19
|
const APPROVAL_GUARDRAIL = 'No approve(), setApprovalForAll(), transferFrom(), or token approval is requested.'
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import { getAddress, isAddress, type Address, type Hex } from 'viem'
|
|
2
|
-
import type { EthagentIdentity } from '
|
|
2
|
+
import type { EthagentIdentity } from '../../../storage/config.js'
|
|
3
3
|
import {
|
|
4
4
|
createTransferContinuitySnapshotChallenge,
|
|
5
5
|
createTransferContinuitySnapshotEnvelope,
|
|
6
6
|
serializeContinuitySnapshotEnvelope,
|
|
7
7
|
transferSnapshotMetadataFromEnvelope,
|
|
8
|
-
} from '
|
|
8
|
+
} from '../../continuity/envelope.js'
|
|
9
9
|
import {
|
|
10
10
|
continuityAgentSnapshot,
|
|
11
11
|
continuityVaultStatus,
|
|
12
12
|
readContinuityFiles,
|
|
13
13
|
readPublicSkillsFile,
|
|
14
14
|
writePublicSkillsFile,
|
|
15
|
-
} from '
|
|
15
|
+
} from '../../continuity/storage.js'
|
|
16
16
|
import {
|
|
17
17
|
createAgentCard,
|
|
18
18
|
defaultPublicSkillsProfile,
|
|
19
19
|
serializeAgentCard,
|
|
20
|
-
} from '
|
|
21
|
-
import { recordPublishedContinuitySnapshot } from '
|
|
22
|
-
import { addToIpfs, DEFAULT_IPFS_API_URL, isPinataUploadUrl } from '
|
|
20
|
+
} from '../../continuity/publicSkills.js'
|
|
21
|
+
import { recordPublishedContinuitySnapshot } from '../../continuity/snapshots.js'
|
|
22
|
+
import { addToIpfs, DEFAULT_IPFS_API_URL, isPinataUploadUrl } from '../../storage/ipfs.js'
|
|
23
23
|
import {
|
|
24
24
|
createErc8004PublicClient,
|
|
25
25
|
encodeSetAgentUri,
|
|
26
26
|
preflightSetAgentUri,
|
|
27
27
|
withEthagentPointers,
|
|
28
|
-
} from '
|
|
29
|
-
import { resolveValidatedPinataJwt, savePinataJwt } from '
|
|
30
|
-
import { openBrowserWalletSession } from '
|
|
31
|
-
import { resolveEnsAddress } from '
|
|
32
|
-
import type { Step } from '
|
|
33
|
-
import type { EffectCallbacks } from '../types.js'
|
|
34
|
-
import { awaitConfirmedReceipt } from '../receipts.js'
|
|
28
|
+
} from '../../registry/erc8004.js'
|
|
29
|
+
import { resolveValidatedPinataJwt, savePinataJwt } from '../../storage/pinataJwt.js'
|
|
30
|
+
import { openBrowserWalletSession } from '../../wallet/browserWallet.js'
|
|
31
|
+
import { resolveEnsAddress } from '../../ens/ensLookup.js'
|
|
32
|
+
import type { Step } from '../identityHubReducer.js'
|
|
33
|
+
import type { EffectCallbacks } from '../shared/effects/types.js'
|
|
34
|
+
import { awaitConfirmedReceipt } from '../shared/effects/receipts.js'
|
|
35
35
|
import {
|
|
36
36
|
assertVerifiedPin,
|
|
37
37
|
deriveAgentName,
|
|
38
|
-
} from '../shared/profilePrep.js'
|
|
39
|
-
import { operatorsPointerFromState } from '../
|
|
38
|
+
} from '../shared/effects/profilePrep.js'
|
|
39
|
+
import { operatorsPointerFromState } from '../continuity/snapshot.js'
|
|
40
40
|
import { tokenTransferProgressForPhase } from './progress.js'
|
|
41
|
-
import { assertTokenNotInVault } from '../
|
|
41
|
+
import { assertTokenNotInVault } from '../custody/preflight.js'
|
|
42
42
|
|
|
43
43
|
type BackupMetadata = NonNullable<EthagentIdentity['backup']>
|
|
44
44
|
type PublicSkillsMetadata = NonNullable<EthagentIdentity['publicSkills']>
|
|
@@ -11,35 +11,35 @@ import {
|
|
|
11
11
|
import {
|
|
12
12
|
assertTokenNotInVault,
|
|
13
13
|
TokenInVaultError,
|
|
14
|
-
} from './
|
|
14
|
+
} from './custody/preflight.js'
|
|
15
15
|
import {
|
|
16
16
|
runPublicProfilePreflight,
|
|
17
|
-
} from './effects
|
|
17
|
+
} from './profile/effects.js'
|
|
18
18
|
import {
|
|
19
19
|
runRebackupPreflight,
|
|
20
|
-
} from './effects
|
|
20
|
+
} from './continuity/effects.js'
|
|
21
21
|
import type {
|
|
22
22
|
EffectCallbacks,
|
|
23
23
|
IdentityCompletionSource,
|
|
24
24
|
RestoreProgress,
|
|
25
25
|
TokenTransferProgress,
|
|
26
|
-
} from './effects/types.js'
|
|
27
|
-
import { resolveVaultAddress } from './
|
|
28
|
-
import { useCustodyFlow } from './
|
|
29
|
-
import { identityHubErrorView } from './model/errors.js'
|
|
30
|
-
import { readCustodyMode } from './
|
|
31
|
-
import { selectEnsStatus } from './
|
|
26
|
+
} from './shared/effects/types.js'
|
|
27
|
+
import { resolveVaultAddress } from './custody/transactions.js'
|
|
28
|
+
import { useCustodyFlow } from './custody/useCustodyFlow.js'
|
|
29
|
+
import { identityHubErrorView } from './shared/model/errors.js'
|
|
30
|
+
import { readCustodyMode } from './custody/state.js'
|
|
31
|
+
import { selectEnsStatus } from './ens/state.js'
|
|
32
32
|
import { identityHubReducer, type ProfileUpdates, type Step } from './identityHubReducer.js'
|
|
33
33
|
import type { IdentityHubProps } from './types.js'
|
|
34
34
|
import {
|
|
35
35
|
capitalizeFeedbackMessage,
|
|
36
36
|
initialStepForAction,
|
|
37
37
|
isWalletCancelled,
|
|
38
|
-
} from './utils.js'
|
|
38
|
+
} from './shared/utils.js'
|
|
39
39
|
import {
|
|
40
40
|
preflightTokenOwnership,
|
|
41
41
|
useAgentReconciliation,
|
|
42
|
-
} from './reconciliation/index.js'
|
|
42
|
+
} from './shared/reconciliation/index.js'
|
|
43
43
|
import { useIdentityHubContinuity } from './useIdentityHubContinuity.js'
|
|
44
44
|
import { useIdentityHubSideEffects } from './useIdentityHubSideEffects.js'
|
|
45
45
|
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { useEffect } from 'react'
|
|
2
2
|
import type { EthagentConfig } from '../../storage/config.js'
|
|
3
3
|
import { setTokenIdentity } from '../../storage/identity.js'
|
|
4
|
-
import { isRegistrationPreflightError, pinataErrorText } from './model/errors.js'
|
|
4
|
+
import { isRegistrationPreflightError, pinataErrorText } from './shared/model/errors.js'
|
|
5
5
|
import type { ProfileUpdates, Step } from './identityHubReducer.js'
|
|
6
6
|
import {
|
|
7
7
|
runCreatePreflight,
|
|
8
8
|
runCreateSigning,
|
|
9
|
-
} from './effects
|
|
9
|
+
} from './create/effects.js'
|
|
10
10
|
import {
|
|
11
11
|
runRebackupSigning,
|
|
12
|
-
} from './effects
|
|
12
|
+
} from './continuity/effects.js'
|
|
13
13
|
import {
|
|
14
14
|
runPublicProfileSigning,
|
|
15
|
-
} from './effects
|
|
15
|
+
} from './profile/effects.js'
|
|
16
16
|
import {
|
|
17
17
|
runTokenTransferSigning,
|
|
18
|
-
} from './
|
|
18
|
+
} from './transfer/effects.js'
|
|
19
19
|
import {
|
|
20
20
|
runEnsSetupRecordsTransaction,
|
|
21
21
|
runEnsSetupRegistryTransaction,
|
|
22
22
|
runUpdateEnsRecords,
|
|
23
|
-
} from './
|
|
23
|
+
} from './ens/index.js'
|
|
24
24
|
import {
|
|
25
25
|
runRecoveryRefetch,
|
|
26
|
-
} from './
|
|
27
|
-
import type { EffectCallbacks } from './effects/types.js'
|
|
28
|
-
import {
|
|
26
|
+
} from './restore/index.js'
|
|
27
|
+
import type { EffectCallbacks } from './shared/effects/types.js'
|
|
28
|
+
import { useRestoreEffects } from './restore/useRestoreEffects.js'
|
|
29
29
|
import {
|
|
30
30
|
isStorageError,
|
|
31
31
|
isWalletCancelled,
|
|
32
32
|
waitForMinimumBusyTime,
|
|
33
|
-
} from './utils.js'
|
|
33
|
+
} from './shared/utils.js'
|
|
34
34
|
|
|
35
35
|
type TriggerRebackup = (
|
|
36
36
|
backStep: Step,
|
|
@@ -104,7 +104,7 @@ export function useIdentityHubSideEffects({
|
|
|
104
104
|
return () => { cancelled = true }
|
|
105
105
|
}, [step])
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
useRestoreEffects({ step, config, callbacks, handleStepError })
|
|
108
108
|
|
|
109
109
|
useEffect(() => {
|
|
110
110
|
if (step.kind !== 'rebackup-signing') return
|