ethagent 3.3.4 → 4.0.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/.claude-plugin/marketplace.json +11 -0
- package/.claude-plugin/plugin.json +35 -0
- package/LICENSE +1 -1
- package/README.md +64 -104
- package/commands/ethagent.md +40 -0
- package/package.json +16 -16
- package/src/app/keybindings/KeybindingProvider.tsx +1 -6
- package/src/app/keybindings/types.ts +1 -6
- package/src/cli/ResetConfirmView.tsx +54 -53
- package/src/cli/demo.ts +86 -0
- package/src/cli/hookIo.ts +45 -0
- package/src/cli/main.tsx +94 -123
- package/src/cli/memoryGuard.ts +49 -0
- package/src/cli/reset.ts +28 -70
- package/src/cli/sessionStart.ts +33 -0
- package/src/cli/status.ts +46 -0
- package/src/cli/sync.ts +167 -0
- package/src/cli/syncAdapters/claude-code.ts +86 -0
- package/src/cli/syncAdapters/codex.ts +66 -0
- package/src/cli/syncAdapters/index.ts +45 -0
- package/src/cli/syncAdapters/managedBlock.ts +175 -0
- package/src/cli/syncAdapters/shared.ts +63 -0
- package/src/identity/continuity/envelopeParse.ts +20 -1
- package/src/identity/continuity/publicSkills.ts +3 -1
- package/src/identity/continuity/skills/publicSkillsSync.ts +2 -1
- package/src/identity/continuity/skills/scaffold.ts +5 -2
- package/src/identity/continuity/snapshots.ts +12 -5
- package/src/identity/continuity/storage/defaults.ts +20 -19
- package/src/identity/continuity/storage/status.ts +1 -1
- package/src/identity/ens/ensLookup/constants.ts +1 -1
- package/src/identity/manager/IdentityManager.tsx +33 -0
- package/src/identity/{hub → manager}/OperationalRoutes.tsx +37 -18
- package/src/identity/{hub → manager}/Routes.tsx +48 -34
- package/src/identity/{hub → manager}/continuity/ContinuityDashboardScreen.tsx +9 -19
- package/src/identity/{hub → manager}/continuity/RebackupStorageScreen.tsx +3 -3
- package/src/identity/manager/continuity/RecoveryConfirmScreen.tsx +102 -0
- package/src/identity/{hub → manager}/continuity/SavePromptScreen.tsx +2 -3
- package/src/identity/{hub → manager}/continuity/completion.ts +1 -1
- package/src/identity/{hub → manager}/continuity/effects.ts +1 -1
- package/src/identity/{hub → manager}/continuity/skills/DeleteSkillConfirmScreen.tsx +2 -2
- package/src/identity/{hub → manager}/continuity/skills/NewSkillScreen.tsx +0 -5
- package/src/identity/{hub → manager}/continuity/skills/NewSkillVisibilityScreen.tsx +4 -4
- package/src/identity/{hub → manager}/continuity/skills/SkillActionsScreen.tsx +6 -22
- package/src/identity/{hub → manager}/continuity/skills/SkillsTreeScreen.tsx +5 -17
- package/src/identity/{hub → manager}/continuity/snapshot.ts +1 -1
- package/src/identity/{hub → manager}/continuity/vault.ts +1 -1
- package/src/identity/{hub → manager}/create/CreateFlow.tsx +59 -32
- package/src/identity/{hub → manager}/create/effects.ts +19 -10
- package/src/identity/manager/create/importScan.ts +122 -0
- package/src/identity/{hub → manager}/custody/CustodyEditFlow.tsx +17 -61
- package/src/identity/{hub → manager}/custody/actions.ts +1 -15
- package/src/identity/{hub → manager}/custody/routes.tsx +20 -40
- package/src/identity/{hub → manager}/custody/transactions.ts +1 -0
- package/src/identity/{hub → manager}/custody/types.ts +1 -2
- package/src/identity/{hub → manager}/custody/useCustodyEffects.ts +1 -1
- package/src/identity/{hub → manager}/ens/EnsEditAdvancedScreens.tsx +2 -2
- package/src/identity/{hub → manager}/ens/EnsEditMaintenanceScreens.tsx +12 -23
- package/src/identity/{hub → manager}/ens/EnsEditReviewScreens.tsx +18 -42
- package/src/identity/{hub → manager}/ens/EnsEditRunners.tsx +1 -1
- package/src/identity/{hub → manager}/ens/EnsEditShared.tsx +0 -2
- package/src/identity/{hub → manager}/ens/EnsEditSimpleScreens.tsx +10 -19
- package/src/identity/{hub → manager}/ens/EnsFlow.tsx +133 -41
- package/src/identity/{hub → manager}/ens/EnsOperatorWalletsScreen.tsx +14 -19
- package/src/identity/{hub → manager}/ens/editCopy.ts +1 -14
- package/src/identity/{hub → manager}/profile/EditProfileFlow.tsx +99 -66
- package/src/identity/{hub → manager}/profile/effects.ts +1 -3
- package/src/identity/{hub → manager}/profile/operatorSave.ts +1 -1
- package/src/identity/{hub → manager}/profile/state.ts +1 -1
- package/src/identity/{hub/identityHubReducer.ts → manager/reducer.ts} +25 -26
- package/src/identity/{hub → manager}/restore/RestoreFlow.tsx +16 -24
- package/src/identity/{hub → manager}/restore/apply.ts +1 -1
- package/src/identity/{hub → manager}/restore/auth.ts +1 -1
- package/src/identity/{hub → manager}/restore/discover.ts +1 -1
- package/src/identity/{hub → manager}/restore/fetch.ts +1 -1
- package/src/identity/{hub → manager}/restore/restoreAdmin.ts +1 -1
- package/src/identity/{hub → manager}/restore/useRestoreEffects.ts +2 -9
- package/src/identity/{hub → manager}/settings/StorageCredentialScreen.tsx +10 -25
- package/src/identity/{hub → manager}/shared/components/DetailsScreen.tsx +5 -7
- package/src/identity/{hub → manager}/shared/components/ErrorScreen.tsx +6 -10
- package/src/identity/{hub → manager}/shared/components/FlowTimeline.tsx +4 -3
- package/src/identity/{hub → manager}/shared/components/IdentitySummary.tsx +19 -59
- package/src/identity/manager/shared/components/LazyMenu.tsx +147 -0
- package/src/identity/manager/shared/components/MenuScreen.tsx +220 -0
- package/src/identity/manager/shared/components/OperationCompleteScreen.tsx +28 -0
- package/src/identity/{hub → manager}/shared/components/UnlinkedIdentityScreen.tsx +9 -10
- package/src/identity/{hub → manager}/shared/components/WalletApprovalScreen.tsx +1 -2
- package/src/identity/manager/shared/components/Wordmark.tsx +54 -0
- package/src/identity/{hub → manager}/shared/components/menuFlagsFromReconciliation.ts +39 -15
- package/src/identity/{hub → manager}/shared/effects/profilePrep.ts +1 -1
- package/src/identity/manager/shared/effects/types.ts +30 -0
- package/src/identity/{hub → manager}/shared/model/copy.ts +0 -4
- package/src/identity/{hub → manager}/shared/model/errors.ts +32 -3
- package/src/identity/{hub → manager}/shared/model/network.ts +2 -2
- package/src/identity/{hub → manager}/shared/reconciliation/agentReconciliation/hook.ts +5 -0
- package/src/identity/{hub → manager}/shared/reconciliation/agentReconciliation/run.ts +1 -1
- package/src/identity/{hub/shared/reconciliation/useAgentReconciliation.ts → manager/shared/reconciliation/index.ts} +6 -0
- package/src/identity/{hub → manager}/shared/utils.ts +6 -10
- package/src/identity/{hub → manager}/transfer/TokenTransferFlow.tsx +3 -3
- package/src/identity/{hub → manager}/transfer/TokenTransferScreens.tsx +4 -10
- package/src/identity/{hub → manager}/transfer/effects.ts +1 -1
- package/src/identity/{hub → manager}/types.ts +5 -6
- package/src/identity/{hub/useIdentityHubContinuity.ts → manager/useContinuity.ts} +59 -27
- package/src/identity/{hub/useIdentityHubController.ts → manager/useController.ts} +38 -35
- package/src/identity/{hub/useIdentityHubSideEffects.ts → manager/useSideEffects.ts} +40 -4
- package/src/identity/registry/erc8004/discovery.ts +3 -17
- package/src/identity/registry/erc8004/utils.ts +1 -1
- package/src/identity/storage/ipfs.ts +21 -1
- package/src/identity/wallet/browserWallet/html.ts +10 -2
- package/src/identity/wallet/browserWallet/http.ts +18 -0
- package/src/identity/wallet/browserWallet/requestServer.ts +5 -1
- package/src/identity/wallet/browserWallet/requests.ts +10 -28
- package/src/identity/wallet/browserWallet/session.ts +26 -33
- package/src/identity/wallet/browserWallet/validation.ts +14 -0
- package/src/identity/wallet/browserWallet/walletPageSource.ts +22 -40
- package/src/identity/wallet/page/boot.ts +43 -0
- package/src/identity/wallet/page/config.ts +59 -0
- package/src/identity/wallet/page/constants.ts +12 -0
- package/src/identity/wallet/page/copy.ts +47 -68
- package/src/identity/wallet/page/css.ts +638 -0
- package/src/identity/wallet/page/{errorView.ts → errors.ts} +5 -14
- package/src/identity/wallet/page/{controller.ts → flow.ts} +4 -71
- package/src/identity/wallet/page/markup.ts +44 -34
- package/src/identity/wallet/page/{walletProvider.ts → provider.ts} +0 -3
- package/src/identity/wallet/page/resize.ts +95 -0
- package/src/identity/wallet/page/state.ts +135 -8
- package/src/identity/wallet/page/timeline.ts +161 -0
- package/src/identity/wallet/page/view.ts +22 -302
- package/src/storage/config.ts +30 -80
- package/src/storage/reset.ts +31 -0
- package/src/storage/secrets.ts +1 -16
- package/src/ui/Select.tsx +27 -5
- package/src/ui/Spinner.tsx +16 -15
- package/src/ui/Surface.tsx +21 -17
- package/src/ui/TextArea.tsx +173 -0
- package/src/ui/TextInput.tsx +31 -133
- package/src/ui/theme.ts +22 -13
- package/src/utils/clipboard.ts +0 -140
- package/src/app/FirstRun.tsx +0 -577
- package/src/app/FirstRunTimeline.tsx +0 -51
- package/src/app/firstRunConfig.ts +0 -26
- package/src/app/hooks/useCancelRequest.ts +0 -22
- package/src/app/hooks/useDoublePress.ts +0 -46
- package/src/app/hooks/useExitOnCtrlC.ts +0 -36
- package/src/auth/openaiOAuth/credentials.ts +0 -47
- package/src/auth/openaiOAuth/crypto.ts +0 -23
- package/src/auth/openaiOAuth/index.ts +0 -238
- package/src/auth/openaiOAuth/landingPage.ts +0 -116
- package/src/auth/openaiOAuth/listener.ts +0 -151
- package/src/auth/openaiOAuth/refresh.ts +0 -70
- package/src/auth/openaiOAuth/shared.ts +0 -115
- package/src/chat/ChatBottomPane.tsx +0 -296
- package/src/chat/ChatScreen.tsx +0 -1685
- package/src/chat/ConversationStack.tsx +0 -56
- package/src/chat/MessageList.tsx +0 -638
- package/src/chat/SessionStatus.tsx +0 -53
- package/src/chat/chatEnvironment.ts +0 -16
- package/src/chat/chatScreenUtils.ts +0 -194
- package/src/chat/chatSessionState.ts +0 -146
- package/src/chat/chatTurnContext.ts +0 -50
- package/src/chat/chatTurnOrchestrator.ts +0 -603
- package/src/chat/chatTurnRows.ts +0 -64
- package/src/chat/commands.ts +0 -494
- package/src/chat/continuityEditReview.ts +0 -42
- package/src/chat/display/DiffView.tsx +0 -193
- package/src/chat/display/SyntaxText.tsx +0 -192
- package/src/chat/display/toolCallDisplay.ts +0 -103
- package/src/chat/display/toolResultDisplay.ts +0 -19
- package/src/chat/input/ChatInput.tsx +0 -625
- package/src/chat/input/chatInputHelpers.ts +0 -62
- package/src/chat/input/chatInputState.ts +0 -247
- package/src/chat/input/chatPaste.ts +0 -49
- package/src/chat/input/imageRefs.ts +0 -30
- package/src/chat/input/inputRendering.tsx +0 -93
- package/src/chat/input/textCursor.ts +0 -212
- package/src/chat/messageMarkdown.ts +0 -220
- package/src/chat/messageRows.ts +0 -43
- package/src/chat/planImplementation.ts +0 -62
- package/src/chat/slashCommandHandlers.ts +0 -122
- package/src/chat/slashCommandViews.ts +0 -120
- package/src/chat/transcript/TranscriptView.tsx +0 -184
- package/src/chat/transcript/transcriptViewport.ts +0 -295
- package/src/chat/views/ContextLimitView.tsx +0 -95
- package/src/chat/views/ContinuityEditReviewView.tsx +0 -50
- package/src/chat/views/CopyPicker.tsx +0 -50
- package/src/chat/views/PermissionPrompt.tsx +0 -156
- package/src/chat/views/PermissionsView.tsx +0 -165
- package/src/chat/views/PlanApprovalView.tsx +0 -91
- package/src/chat/views/ResumeView.tsx +0 -273
- package/src/chat/views/RewindView.tsx +0 -412
- package/src/cli/preview.tsx +0 -14
- package/src/cli/updateNotice.ts +0 -54
- package/src/identity/continuity/privateEdit/apply.ts +0 -170
- package/src/identity/continuity/privateEdit/diff.ts +0 -6
- package/src/identity/continuity/privateEdit/files.ts +0 -23
- package/src/identity/continuity/privateEdit/types.ts +0 -28
- package/src/identity/continuity/privateEdit.ts +0 -46
- package/src/identity/hub/IdentityHub.tsx +0 -14
- package/src/identity/hub/continuity/RecoveryConfirmScreen.tsx +0 -104
- package/src/identity/hub/ens/effects.ts +0 -218
- package/src/identity/hub/shared/components/MenuScreen.tsx +0 -241
- package/src/identity/hub/shared/effects/types.ts +0 -53
- package/src/identity/hub/shared/reconciliation/index.ts +0 -14
- package/src/identity/wallet/page/grainient.ts +0 -278
- package/src/identity/wallet/page/html.ts +0 -28
- package/src/identity/wallet/page/styles/base.ts +0 -260
- package/src/identity/wallet/page/styles/components.ts +0 -262
- package/src/identity/wallet/page/styles/index.ts +0 -5
- package/src/identity/wallet/page/styles/responsive.ts +0 -247
- package/src/identity/wallet/page.tsx +0 -38
- package/src/mcp/approvals.ts +0 -113
- package/src/mcp/config.ts +0 -235
- package/src/mcp/manager.ts +0 -482
- package/src/mcp/managerHelpers.ts +0 -70
- package/src/mcp/names.ts +0 -19
- package/src/mcp/output.ts +0 -96
- package/src/models/ModelPicker.tsx +0 -1009
- package/src/models/catalog.ts +0 -327
- package/src/models/huggingface.ts +0 -712
- package/src/models/huggingfaceStorage.ts +0 -136
- package/src/models/llamacpp.ts +0 -848
- package/src/models/llamacppCommands.ts +0 -44
- package/src/models/llamacppConfig.ts +0 -34
- package/src/models/llamacppDiscovery.ts +0 -176
- package/src/models/llamacppOutput.ts +0 -65
- package/src/models/llamacppPreflight.ts +0 -158
- package/src/models/modelDisplay.ts +0 -180
- package/src/models/modelPickerCatalogFlow.ts +0 -56
- package/src/models/modelPickerCredentials.ts +0 -166
- package/src/models/modelPickerData.ts +0 -41
- package/src/models/modelPickerDisplay.tsx +0 -132
- package/src/models/modelPickerHfFlow.ts +0 -192
- package/src/models/modelPickerLocalRunnerFlow.ts +0 -115
- package/src/models/modelPickerOptions.ts +0 -457
- package/src/models/modelPickerTypes.ts +0 -69
- package/src/models/modelPickerUninstallFlow.ts +0 -48
- package/src/models/modelPickerViewHelpers.ts +0 -174
- package/src/models/modelRecommendation.ts +0 -139
- package/src/models/providerDisplay.ts +0 -16
- package/src/models/runtimeDetection.ts +0 -81
- package/src/models/uncensoredCatalog.ts +0 -86
- package/src/providers/anthropic.ts +0 -290
- package/src/providers/contracts.ts +0 -71
- package/src/providers/errors.ts +0 -80
- package/src/providers/gemini.ts +0 -391
- package/src/providers/openai-chat.ts +0 -474
- package/src/providers/openai-responses-format.ts +0 -177
- package/src/providers/openai-responses.ts +0 -306
- package/src/providers/openaiChatWire.ts +0 -124
- package/src/providers/registry.ts +0 -120
- package/src/providers/retry.ts +0 -58
- package/src/providers/sse.ts +0 -93
- package/src/runtime/compaction.ts +0 -395
- package/src/runtime/cwd.ts +0 -43
- package/src/runtime/providerTurn.ts +0 -38
- package/src/runtime/sessionMode.ts +0 -55
- package/src/runtime/systemPrompt.ts +0 -213
- package/src/runtime/textToolParser.ts +0 -161
- package/src/runtime/toolClaimGuards.ts +0 -143
- package/src/runtime/toolExecution.ts +0 -304
- package/src/runtime/toolIntent.ts +0 -143
- package/src/runtime/turn.ts +0 -369
- package/src/runtime/turnNudges.ts +0 -223
- package/src/runtime/turnTypes.ts +0 -86
- package/src/storage/factoryReset.ts +0 -127
- package/src/storage/history.ts +0 -58
- package/src/storage/permissions.ts +0 -76
- package/src/storage/rewind.ts +0 -266
- package/src/storage/sessionExport.ts +0 -49
- package/src/storage/sessions.ts +0 -495
- package/src/tools/bashSafety.ts +0 -186
- package/src/tools/bashTool.ts +0 -140
- package/src/tools/changeDirectoryTool.ts +0 -213
- package/src/tools/contracts.ts +0 -192
- package/src/tools/deleteFileTool.ts +0 -116
- package/src/tools/editTool.ts +0 -165
- package/src/tools/editUtils.ts +0 -170
- package/src/tools/fileDiff.ts +0 -261
- package/src/tools/listDirectoryTool.ts +0 -55
- package/src/tools/listSkillFilesTool.ts +0 -77
- package/src/tools/listSkillsTool.ts +0 -68
- package/src/tools/mcpResourceTools.ts +0 -95
- package/src/tools/permissionRules.ts +0 -85
- package/src/tools/privateContinuityEditTool.ts +0 -187
- package/src/tools/privateContinuityReadTool.ts +0 -106
- package/src/tools/readSkillTool.ts +0 -107
- package/src/tools/readTool.ts +0 -85
- package/src/tools/registry.ts +0 -103
- package/src/tools/writeFileTool.ts +0 -167
- package/src/ui/BrandSplash.tsx +0 -133
- package/src/ui/terminalTitle.ts +0 -30
- package/src/utils/images.ts +0 -140
- package/src/utils/markdownSegments.ts +0 -51
- package/src/utils/messages.ts +0 -37
- package/src/utils/withRetry.ts +0 -324
- /package/src/identity/{hub → manager}/continuity/state.ts +0 -0
- /package/src/identity/{hub → manager}/custody/helpers.ts +0 -0
- /package/src/identity/{hub → manager}/custody/preflight.ts +0 -0
- /package/src/identity/{hub → manager}/custody/state.ts +0 -0
- /package/src/identity/{hub → manager}/custody/useCustodyFlow.tsx +0 -0
- /package/src/identity/{hub → manager}/ens/EnsEditFlow.tsx +0 -0
- /package/src/identity/{hub → manager}/ens/advancedEnsValidation.ts +0 -0
- /package/src/identity/{hub → manager}/ens/state.ts +0 -0
- /package/src/identity/{hub → manager}/ens/transactions.ts +0 -0
- /package/src/identity/{hub → manager}/ens/types.ts +0 -0
- /package/src/identity/{hub → manager}/profile/identity.ts +0 -0
- /package/src/identity/{hub → manager}/restore/envelopes.ts +0 -0
- /package/src/identity/{hub → manager}/restore/helpers.ts +0 -0
- /package/src/identity/{hub → manager}/restore/recovery.ts +0 -0
- /package/src/identity/{hub → manager}/restore/resolve.ts +0 -0
- /package/src/identity/{hub → manager}/shared/components/BusyScreen.tsx +0 -0
- /package/src/identity/{hub → manager}/shared/components/NetworkScreen.tsx +0 -0
- /package/src/identity/{hub → manager}/shared/components/PinataJwtInput.tsx +0 -0
- /package/src/identity/{hub → manager}/shared/effects/receipts.ts +0 -0
- /package/src/identity/{hub → manager}/shared/effects/sync.ts +0 -0
- /package/src/identity/{hub → manager}/shared/model/format.ts +0 -0
- /package/src/identity/{hub → manager}/shared/operatorWallets.ts +0 -0
- /package/src/identity/{hub → manager}/shared/reconciliation/agentReconciliation/ownership.ts +0 -0
- /package/src/identity/{hub → manager}/shared/reconciliation/agentReconciliation/types.ts +0 -0
- /package/src/identity/{hub → manager}/shared/reconciliation/walletSetup.ts +0 -0
- /package/src/identity/{hub → manager}/shared/txGuard.ts +0 -0
- /package/src/identity/{hub → manager}/transfer/progress.ts +0 -0
- /package/src/identity/{hub → manager}/transfer/state.ts +0 -0
|
@@ -38,8 +38,8 @@ export const PrivateContinuityScreen: React.FC<CommonProps & {
|
|
|
38
38
|
onOpenMemory,
|
|
39
39
|
onBack,
|
|
40
40
|
}) => (
|
|
41
|
-
<Surface title="Soul & Memory" subtitle={notice ??
|
|
42
|
-
<IdentitySummary identity={identity} config={config} workingStatus={workingStatus}
|
|
41
|
+
<Surface title="Soul & Memory" subtitle={notice ?? (!ready ? 'Run Refetch Latest to recover files.' : 'Persona and memory files.')} footer={footer}>
|
|
42
|
+
<IdentitySummary identity={identity} config={config} workingStatus={workingStatus} compact />
|
|
43
43
|
{editorOpened && (
|
|
44
44
|
<Box marginTop={1}>
|
|
45
45
|
<Text color={theme.accentPeriwinkle}>Save with ctrl+s in your editor</Text>
|
|
@@ -48,11 +48,9 @@ export const PrivateContinuityScreen: React.FC<CommonProps & {
|
|
|
48
48
|
<Box marginTop={1}>
|
|
49
49
|
<Select<PrivateAction>
|
|
50
50
|
options={[
|
|
51
|
-
{ value: 'soul',
|
|
52
|
-
{ value: '
|
|
53
|
-
{ value: '
|
|
54
|
-
{ value: 'back', role: 'section', label: 'Navigation' },
|
|
55
|
-
{ value: 'back', label: 'Back', hint: 'Return to Identity Hub menu', role: 'utility' },
|
|
51
|
+
{ value: 'soul', label: 'Edit Soul', disabled: !ready },
|
|
52
|
+
{ value: 'memory', label: 'Edit Memory', disabled: !ready },
|
|
53
|
+
{ value: 'back', label: 'Back', role: 'utility' },
|
|
56
54
|
]}
|
|
57
55
|
hintLayout="inline"
|
|
58
56
|
onSubmit={choice => {
|
|
@@ -70,8 +68,8 @@ export const PublicProfileScreen: React.FC<CommonProps & {
|
|
|
70
68
|
onEditProfile: () => void
|
|
71
69
|
}> = ({ identity, config, workingStatus, notice, editorOpened, footer, onEditProfile, onBack }) => {
|
|
72
70
|
return (
|
|
73
|
-
<Surface title="Public Profile" subtitle={notice ?? '
|
|
74
|
-
<IdentitySummary identity={identity} config={config} workingStatus={workingStatus}
|
|
71
|
+
<Surface title="Public Profile" subtitle={notice ?? 'Name, description, and icon.'} footer={footer}>
|
|
72
|
+
<IdentitySummary identity={identity} config={config} workingStatus={workingStatus} compact />
|
|
75
73
|
{editorOpened && (
|
|
76
74
|
<Box marginTop={1}>
|
|
77
75
|
<Text color={theme.accentPeriwinkle}>Save with ctrl+s in your editor</Text>
|
|
@@ -80,10 +78,8 @@ export const PublicProfileScreen: React.FC<CommonProps & {
|
|
|
80
78
|
<Box marginTop={1}>
|
|
81
79
|
<Select<PublicAction>
|
|
82
80
|
options={[
|
|
83
|
-
{ value: 'edit',
|
|
84
|
-
{ value: '
|
|
85
|
-
{ value: 'back', role: 'section', label: 'Navigation' },
|
|
86
|
-
{ value: 'back', label: 'Back', hint: 'Return to Identity Hub menu', role: 'utility' },
|
|
81
|
+
{ value: 'edit', label: 'Edit Profile' },
|
|
82
|
+
{ value: 'back', label: 'Back', role: 'utility' },
|
|
87
83
|
]}
|
|
88
84
|
hintLayout="inline"
|
|
89
85
|
onSubmit={choice => {
|
|
@@ -96,9 +92,3 @@ export const PublicProfileScreen: React.FC<CommonProps & {
|
|
|
96
92
|
</Surface>
|
|
97
93
|
)
|
|
98
94
|
}
|
|
99
|
-
|
|
100
|
-
function privateSubtitle(ready: boolean): string {
|
|
101
|
-
return ready
|
|
102
|
-
? 'Edit the durable persona and memory files for this identity.'
|
|
103
|
-
: 'Use "Refetch Latest Snapshot" from the Identity Hub menu to recover files.'
|
|
104
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { PinataJwtInput } from '../shared/components/PinataJwtInput.js'
|
|
3
|
-
import type { Step } from '../
|
|
3
|
+
import type { Step } from '../reducer.js'
|
|
4
4
|
|
|
5
5
|
interface RebackupStorageScreenProps {
|
|
6
6
|
step: Extract<Step, { kind: 'rebackup-storage' | 'public-profile-storage' }>
|
|
@@ -18,8 +18,8 @@ export const RebackupStorageScreen: React.FC<RebackupStorageScreenProps> = ({ st
|
|
|
18
18
|
inputKey="rebackup-storage"
|
|
19
19
|
title={title}
|
|
20
20
|
subtitle={step.error ?? subtitle ?? (publicOnly
|
|
21
|
-
? 'Save a Pinata JWT
|
|
22
|
-
: 'Save a Pinata JWT
|
|
21
|
+
? 'Save a Pinata JWT to pin the public profile to IPFS.'
|
|
22
|
+
: 'Save a Pinata JWT to pin encrypted state to IPFS.')}
|
|
23
23
|
footer={footer}
|
|
24
24
|
onSubmit={onSubmit}
|
|
25
25
|
onCancel={onCancel}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React from 'react'
|
|
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 { localChangeStatusView, type LocalChangeStatusView } from './state.js'
|
|
7
|
+
|
|
8
|
+
import type { ContinuityWorkingTreeStatus } from '../../continuity/storage.js'
|
|
9
|
+
|
|
10
|
+
type RecoveryConfirmMode = 'publish' | 'refetch' | 'restore'
|
|
11
|
+
|
|
12
|
+
interface RecoveryConfirmScreenProps {
|
|
13
|
+
mode: RecoveryConfirmMode
|
|
14
|
+
workingStatus?: ContinuityWorkingTreeStatus | null
|
|
15
|
+
pendingPublish?: boolean
|
|
16
|
+
footer: React.ReactNode
|
|
17
|
+
onConfirm: () => void
|
|
18
|
+
onBack: () => void
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const RecoveryConfirmScreen: React.FC<RecoveryConfirmScreenProps> = ({ mode, workingStatus, pendingPublish, footer, onConfirm, onBack }) => {
|
|
22
|
+
const isPublish = mode === 'publish'
|
|
23
|
+
const isRestore = mode === 'restore'
|
|
24
|
+
const title = isPublish
|
|
25
|
+
? 'Save Snapshot?'
|
|
26
|
+
: isRestore
|
|
27
|
+
? 'Overwrite Local Changes?'
|
|
28
|
+
: 'Refetch Latest From Onchain?'
|
|
29
|
+
const subtitle = isPublish
|
|
30
|
+
? 'Saves SOUL.md, MEMORY.md, skills, and profile changes.'
|
|
31
|
+
: isRestore
|
|
32
|
+
? 'This restore targets the active agent and overwrites local continuity files.'
|
|
33
|
+
: 'This overwrites local files with the onchain version.'
|
|
34
|
+
|
|
35
|
+
const localChangeStatus = localChangeStatusView(workingStatus)
|
|
36
|
+
const body = isPublish
|
|
37
|
+
? <SaveSnapshotStatusLine status={localChangeStatus} />
|
|
38
|
+
: localChangeStatus.hasLocalChanges
|
|
39
|
+
? <OverwriteStatusLine status={localChangeStatus} pendingPublish={pendingPublish} />
|
|
40
|
+
: pendingPublish
|
|
41
|
+
? <Text color={theme.accentError} bold>Local snapshot is ahead of onchain; unsaved edits are discarded.</Text>
|
|
42
|
+
: null
|
|
43
|
+
const confirmLabel = isPublish
|
|
44
|
+
? 'Save Snapshot Now'
|
|
45
|
+
: localChangeStatus.hasLocalChanges
|
|
46
|
+
? 'Overwrite Local Changes'
|
|
47
|
+
: isRestore
|
|
48
|
+
? 'Restore'
|
|
49
|
+
: 'Refetch'
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<Surface title={title} subtitle={subtitle} footer={footer} tone="primary">
|
|
53
|
+
{body ? <Box flexDirection="column">{body}</Box> : null}
|
|
54
|
+
<Box marginTop={1}>
|
|
55
|
+
<Select<'confirm' | 'back'>
|
|
56
|
+
options={[
|
|
57
|
+
{ value: 'confirm', label: confirmLabel },
|
|
58
|
+
{ value: 'back', label: 'Back', role: 'utility' },
|
|
59
|
+
]}
|
|
60
|
+
hintLayout="inline"
|
|
61
|
+
onSubmit={choice => {
|
|
62
|
+
if (choice === 'confirm') return onConfirm()
|
|
63
|
+
return onBack()
|
|
64
|
+
}}
|
|
65
|
+
onCancel={onBack}
|
|
66
|
+
/>
|
|
67
|
+
</Box>
|
|
68
|
+
</Surface>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const OverwriteStatusLine: React.FC<{ status: LocalChangeStatusView; pendingPublish?: boolean }> = ({ status, pendingPublish }) => (
|
|
73
|
+
<Box flexDirection="column">
|
|
74
|
+
<Text>
|
|
75
|
+
<Text color={theme.textSubtle}>Unsaved local changes detected: </Text>
|
|
76
|
+
<Text color={theme.accentError} bold>{status.files.length > 0 ? status.files.join(', ') : 'local files differ from saved snapshot'}</Text>
|
|
77
|
+
</Text>
|
|
78
|
+
<Text color={theme.accentError}>
|
|
79
|
+
Continuing replaces those files with the restored snapshot.
|
|
80
|
+
</Text>
|
|
81
|
+
{pendingPublish ? (
|
|
82
|
+
<Text color={theme.accentError}>Local snapshot is also ahead of onchain.</Text>
|
|
83
|
+
) : null}
|
|
84
|
+
</Box>
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
const SaveSnapshotStatusLine: React.FC<{ status: LocalChangeStatusView }> = ({ status }) => {
|
|
88
|
+
if (status.hasLocalChanges) {
|
|
89
|
+
return (
|
|
90
|
+
<Text>
|
|
91
|
+
<Text color={theme.textSubtle}>Local changes detected: </Text>
|
|
92
|
+
<Text color={theme.accentError} bold>{status.files.length > 0 ? status.files.join(', ') : 'local files differ from saved snapshot'}</Text>
|
|
93
|
+
</Text>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (!status.detail) return null
|
|
98
|
+
|
|
99
|
+
const color = status.tone === 'ok' || status.tone === 'warn' ? theme.accentPeriwinkle : theme.dim
|
|
100
|
+
const label = status.detail === 'None detected' ? 'No local changes detected.' : status.detail
|
|
101
|
+
return <Text color={color}>{label}</Text>
|
|
102
|
+
}
|
|
@@ -21,7 +21,6 @@ export const SavePromptScreen: React.FC<SavePromptScreenProps> = ({ workingStatu
|
|
|
21
21
|
return (
|
|
22
22
|
<Surface
|
|
23
23
|
title="Save your identity changes?"
|
|
24
|
-
subtitle="Unsaved local edits since the last snapshot."
|
|
25
24
|
footer={footer}
|
|
26
25
|
tone="primary"
|
|
27
26
|
>
|
|
@@ -35,8 +34,8 @@ export const SavePromptScreen: React.FC<SavePromptScreenProps> = ({ workingStatu
|
|
|
35
34
|
<Box marginTop={1}>
|
|
36
35
|
<Select<SavePromptAction>
|
|
37
36
|
options={[
|
|
38
|
-
{ value: 'save-now', label: 'Save now', hint: 'Sign
|
|
39
|
-
{ value: 'later', label: 'Not now', hint: 'Ask again
|
|
37
|
+
{ value: 'save-now', label: 'Save now', hint: 'Sign and save snapshot' },
|
|
38
|
+
{ value: 'later', label: 'Not now', hint: 'Ask again next launch', role: 'utility' },
|
|
40
39
|
]}
|
|
41
40
|
hintLayout="inline"
|
|
42
41
|
onSubmit={onSelect}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EthagentIdentity } from '../../../storage/config.js'
|
|
2
2
|
import type { WalletPurpose } from '../../wallet/browserWallet.js'
|
|
3
|
-
import type { ProfileUpdates } from '../
|
|
3
|
+
import type { ProfileUpdates } from '../reducer.js'
|
|
4
4
|
import { snapshotSaveWalletRole } from './snapshot.js'
|
|
5
5
|
|
|
6
6
|
export function rebackupWalletPurpose(
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
encodeRotateAgentURI,
|
|
41
41
|
isAgentInVault,
|
|
42
42
|
} from '../../registry/vault.js'
|
|
43
|
-
import type { Step, ProfileUpdates } from '../
|
|
43
|
+
import type { Step, ProfileUpdates } from '../reducer.js'
|
|
44
44
|
import { acquireTxGuard, releaseTxGuard } from '../shared/txGuard.js'
|
|
45
45
|
import type { EffectCallbacks } from '../shared/effects/types.js'
|
|
46
46
|
import { awaitConfirmedReceipt } from '../shared/effects/receipts.js'
|
|
@@ -78,8 +78,8 @@ export const DeleteSkillConfirmScreen: React.FC<DeleteSkillConfirmScreenProps> =
|
|
|
78
78
|
<Box marginTop={1}>
|
|
79
79
|
<Select<ConfirmChoice>
|
|
80
80
|
options={[
|
|
81
|
-
{ value: 'delete', label: 'Yes, delete', hint: skillMissing ? '
|
|
82
|
-
{ value: 'cancel', label: 'No, back',
|
|
81
|
+
{ value: 'delete', label: 'Yes, delete', hint: skillMissing ? 'Already missing on disk' : 'Permanent on next snapshot', bold: true, disabled: skillMissing },
|
|
82
|
+
{ value: 'cancel', label: 'No, back', role: 'utility' },
|
|
83
83
|
]}
|
|
84
84
|
hintLayout="inline"
|
|
85
85
|
initialIndex={1}
|
|
@@ -33,11 +33,6 @@ export const NewSkillScreen: React.FC<NewSkillScreenProps> = ({
|
|
|
33
33
|
}}
|
|
34
34
|
onCancel={onCancel}
|
|
35
35
|
/>
|
|
36
|
-
<Box marginTop={1}>
|
|
37
|
-
<Text color={theme.dim}>
|
|
38
|
-
Saved as skills/<folder>/SKILL.md. Add supporting files later by dropping them into the same folder.
|
|
39
|
-
</Text>
|
|
40
|
-
</Box>
|
|
41
36
|
{error && (
|
|
42
37
|
<Box marginTop={1}>
|
|
43
38
|
<Text color={theme.accentError}>{error}</Text>
|
|
@@ -22,7 +22,7 @@ export const NewSkillVisibilityScreen: React.FC<NewSkillVisibilityScreenProps> =
|
|
|
22
22
|
}) => (
|
|
23
23
|
<Surface
|
|
24
24
|
title={`Visibility · ${name}`}
|
|
25
|
-
subtitle="Public is the default.
|
|
25
|
+
subtitle="Public is the default."
|
|
26
26
|
footer={footer}
|
|
27
27
|
>
|
|
28
28
|
{error && (
|
|
@@ -33,10 +33,10 @@ export const NewSkillVisibilityScreen: React.FC<NewSkillVisibilityScreenProps> =
|
|
|
33
33
|
<Box marginTop={1}>
|
|
34
34
|
<Select<SkillVisibility | 'back'>
|
|
35
35
|
options={[
|
|
36
|
-
{ value: 'private', label: 'Private', hint: '
|
|
37
|
-
{ value: 'public', label: 'Public', hint: '
|
|
36
|
+
{ value: 'private', label: 'Private', hint: 'Not in the Agent Card' },
|
|
37
|
+
{ value: 'public', label: 'Public', hint: 'Listed in the Agent Card' },
|
|
38
38
|
{ value: 'back', role: 'section', label: 'Navigation' },
|
|
39
|
-
{ value: 'back', label: 'Back',
|
|
39
|
+
{ value: 'back', label: 'Back', role: 'utility' },
|
|
40
40
|
]}
|
|
41
41
|
hintLayout="inline"
|
|
42
42
|
initialIndex={1}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react'
|
|
2
|
-
import { Box
|
|
2
|
+
import { Box } from 'ink'
|
|
3
3
|
import { Surface } from '../../../../ui/Surface.js'
|
|
4
4
|
import { Select, type SelectOption } from '../../../../ui/Select.js'
|
|
5
5
|
import { theme } from '../../../../ui/theme.js'
|
|
@@ -60,48 +60,32 @@ export const SkillActionsScreen: React.FC<SkillActionsScreenProps> = ({
|
|
|
60
60
|
|
|
61
61
|
const displayName = entry?.displayName ?? entry?.name ?? skillName
|
|
62
62
|
const visibility = entry?.visibility
|
|
63
|
-
const subtitle = notice ??
|
|
63
|
+
const subtitle = notice ?? formatLeafMeta(visibility, supportingCount)
|
|
64
64
|
|
|
65
65
|
const options: Array<SelectOption<SkillAction>> = []
|
|
66
66
|
const noop: SkillAction = { kind: 'noop' }
|
|
67
67
|
|
|
68
|
-
options.push({ value: noop, role: 'section', label: 'Open' })
|
|
69
68
|
options.push({
|
|
70
69
|
value: { kind: 'open' },
|
|
71
70
|
label: 'Open SKILL.md',
|
|
72
|
-
hint: 'View or edit this skill',
|
|
73
71
|
})
|
|
74
72
|
|
|
75
73
|
options.push({ value: noop, role: 'section', label: 'Visibility' })
|
|
76
74
|
options.push(visibilityOption('private', visibility))
|
|
77
75
|
options.push(visibilityOption('public', visibility))
|
|
78
76
|
|
|
79
|
-
options.push({ value: noop, role: 'section', label: 'Manage' })
|
|
80
77
|
options.push({
|
|
81
78
|
value: { kind: 'delete' },
|
|
82
79
|
label: 'Delete',
|
|
83
|
-
hint: 'Remove this skill folder and its supporting files',
|
|
84
80
|
})
|
|
85
|
-
options.push({ value: noop, role: 'section', label: 'Return' })
|
|
86
81
|
options.push({
|
|
87
82
|
value: { kind: 'back' },
|
|
88
83
|
label: 'Back',
|
|
89
|
-
hint: 'Return to Skills',
|
|
90
84
|
role: 'utility',
|
|
91
85
|
})
|
|
92
86
|
|
|
93
|
-
const leafMeta = formatLeafMeta(visibility, supportingCount)
|
|
94
|
-
|
|
95
87
|
return (
|
|
96
|
-
<Surface title={
|
|
97
|
-
<Box flexDirection="column" marginTop={1}>
|
|
98
|
-
<Text color={theme.dim}>skills/</Text>
|
|
99
|
-
<Text>
|
|
100
|
-
<Text color={theme.dim}>└── </Text>
|
|
101
|
-
<Text color={theme.accentPeriwinkle} bold>{`${skillName}/SKILL.md`}</Text>
|
|
102
|
-
{leafMeta ? <Text color={theme.dim}>{` ${leafMeta}`}</Text> : null}
|
|
103
|
-
</Text>
|
|
104
|
-
</Box>
|
|
88
|
+
<Surface title={displayName} subtitle={subtitle || undefined} footer={footer}>
|
|
105
89
|
<Box marginTop={1}>
|
|
106
90
|
<Select<SkillAction>
|
|
107
91
|
options={options}
|
|
@@ -129,7 +113,7 @@ function formatLeafMeta(visibility: SkillVisibility | undefined, supportingCount
|
|
|
129
113
|
|
|
130
114
|
function visibilityOption(level: SkillVisibility, current?: SkillVisibility): SelectOption<SkillAction> {
|
|
131
115
|
const isCurrent = current === level
|
|
132
|
-
const hint = visibilityHint(level)
|
|
116
|
+
const hint = visibilityHint(level)
|
|
133
117
|
const base: SelectOption<SkillAction> = {
|
|
134
118
|
value: { kind: 'set-visibility', visibility: level },
|
|
135
119
|
label: `Set ${capitalize(level)}`,
|
|
@@ -140,8 +124,8 @@ function visibilityOption(level: SkillVisibility, current?: SkillVisibility): Se
|
|
|
140
124
|
}
|
|
141
125
|
|
|
142
126
|
function visibilityHint(level: SkillVisibility): string {
|
|
143
|
-
if (level === 'private') return '
|
|
144
|
-
return '
|
|
127
|
+
if (level === 'private') return 'Not in the Agent Card'
|
|
128
|
+
return 'Listed in the Agent Card'
|
|
145
129
|
}
|
|
146
130
|
|
|
147
131
|
function capitalize(value: string): string {
|
|
@@ -73,7 +73,7 @@ export const SkillsTreeScreen: React.FC<SkillsTreeScreenProps> = ({
|
|
|
73
73
|
}
|
|
74
74
|
}, [identity, editorOpened])
|
|
75
75
|
|
|
76
|
-
const subtitle = notice ?? '
|
|
76
|
+
const subtitle = notice ?? 'Public and private skills.'
|
|
77
77
|
const isLoading = tree === null
|
|
78
78
|
const skills = tree?.skills ?? []
|
|
79
79
|
const supportingCounts = tree?.supportingCounts ?? {}
|
|
@@ -129,47 +129,35 @@ function buildOptions(
|
|
|
129
129
|
indent: 0,
|
|
130
130
|
})
|
|
131
131
|
} else if (!hasAny) {
|
|
132
|
-
rows.push({ value: noopValue, role: '
|
|
133
|
-
rows.push({ value: noopValue, role: 'notice', label: 'skills/', labelColor: theme.dim, indent: 3 })
|
|
134
|
-
rows.push({ value: noopValue, role: 'notice', label: '└── <skill>/', labelColor: theme.dim, indent: 3 })
|
|
135
|
-
rows.push({ value: noopValue, role: 'notice', label: ' └── SKILL.md', labelColor: theme.dim, indent: 3 })
|
|
132
|
+
rows.push({ value: noopValue, role: 'notice', label: 'No skills yet.', labelColor: theme.dim })
|
|
136
133
|
} else {
|
|
137
134
|
rows.push({ value: noopValue, role: 'section', label: 'Catalog' })
|
|
138
|
-
rows.push({ value: noopValue, role: 'notice', label: 'skills/', labelColor: theme.dim, indent: 3 })
|
|
139
135
|
const sorted = [...entries].sort((a, b) => a.name.localeCompare(b.name))
|
|
140
|
-
for (
|
|
141
|
-
const skill = sorted[i]
|
|
136
|
+
for (const skill of sorted) {
|
|
142
137
|
if (!skill) continue
|
|
143
|
-
const isLast = i === sorted.length - 1
|
|
144
|
-
const branch = isLast ? '└── ' : '├── '
|
|
145
138
|
const supportCount = supportingCounts[skill.name] ?? 0
|
|
146
139
|
const meta = [capitalize(skill.visibility)]
|
|
147
140
|
if (supportCount > 0) meta.push(`${supportCount + 1} files`)
|
|
148
|
-
meta.push('enter for actions')
|
|
149
141
|
rows.push({
|
|
150
142
|
value: { kind: 'skill', relativePath: skill.relativePath },
|
|
151
|
-
label:
|
|
143
|
+
label: skill.name,
|
|
152
144
|
hint: meta.join(' · '),
|
|
153
|
-
indent: 3,
|
|
154
145
|
})
|
|
155
146
|
}
|
|
147
|
+
rows.push({ value: noopValue, role: 'section', label: '' })
|
|
156
148
|
}
|
|
157
149
|
|
|
158
|
-
rows.push({ value: noopValue, role: 'section', label: 'Manage' })
|
|
159
150
|
rows.push({
|
|
160
151
|
value: { kind: 'new' },
|
|
161
152
|
label: 'New Skill',
|
|
162
|
-
hint: 'Scaffold a new skill folder with SKILL.md',
|
|
163
153
|
})
|
|
164
154
|
rows.push({
|
|
165
155
|
value: { kind: 'open-folder' },
|
|
166
156
|
label: 'Open Skills Folder',
|
|
167
|
-
hint: 'Reveal skills/ in your file manager',
|
|
168
157
|
})
|
|
169
158
|
rows.push({
|
|
170
159
|
value: { kind: 'back' },
|
|
171
160
|
label: 'Back',
|
|
172
|
-
hint: 'Return to Identity Hub menu',
|
|
173
161
|
role: 'utility',
|
|
174
162
|
})
|
|
175
163
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getAddress, isAddress, type Address } from 'viem'
|
|
2
2
|
import type { EthagentIdentity } from '../../../storage/config.js'
|
|
3
|
-
import type { ProfileUpdates } from '../
|
|
3
|
+
import type { ProfileUpdates } from '../reducer.js'
|
|
4
4
|
import {
|
|
5
5
|
createWalletContinuitySnapshotEnvelope,
|
|
6
6
|
createWalletRestoreAccessKey,
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
requestBrowserWalletSignatureAndTransaction,
|
|
33
33
|
type WalletPurpose,
|
|
34
34
|
} from '../../wallet/browserWallet.js'
|
|
35
|
-
import type { Step } from '../
|
|
35
|
+
import type { Step } from '../reducer.js'
|
|
36
36
|
import type { EffectCallbacks } from '../shared/effects/types.js'
|
|
37
37
|
import { awaitConfirmedReceipt } from '../shared/effects/receipts.js'
|
|
38
38
|
import {
|
|
@@ -3,11 +3,12 @@ import { Box, Text } from 'ink'
|
|
|
3
3
|
import { Surface } from '../../../ui/Surface.js'
|
|
4
4
|
import { Select } from '../../../ui/Select.js'
|
|
5
5
|
import { TextInput } from '../../../ui/TextInput.js'
|
|
6
|
+
import { TextArea } from '../../../ui/TextArea.js'
|
|
6
7
|
import { theme } from '../../../ui/theme.js'
|
|
7
8
|
import { normalizeErc8004RegistryConfig } from '../../registry/erc8004.js'
|
|
8
9
|
import { networkLabel } from '../shared/model/network.js'
|
|
9
|
-
import type { Step } from '../
|
|
10
|
-
import { createStepNumber, CREATE_STEP_LABELS } from '../
|
|
10
|
+
import type { Step } from '../reducer.js'
|
|
11
|
+
import { createStepNumber, CREATE_STEP_LABELS } from '../reducer.js'
|
|
11
12
|
import { WalletApprovalScreen } from '../shared/components/WalletApprovalScreen.js'
|
|
12
13
|
import { BusyScreen } from '../shared/components/BusyScreen.js'
|
|
13
14
|
import { FlowTimeline } from '../shared/components/FlowTimeline.js'
|
|
@@ -21,6 +22,7 @@ type CreateFlowProps = {
|
|
|
21
22
|
| 'create-name'
|
|
22
23
|
| 'create-description'
|
|
23
24
|
| 'create-custody'
|
|
25
|
+
| 'create-import'
|
|
24
26
|
| 'create-preflight'
|
|
25
27
|
| 'create-registry'
|
|
26
28
|
| 'create-signing'
|
|
@@ -57,20 +59,10 @@ export const CreateFlow: React.FC<CreateFlowProps> = ({
|
|
|
57
59
|
if (step.kind === 'replace-confirm') {
|
|
58
60
|
return (
|
|
59
61
|
<Surface title="Create a New Agent?" footer="enter selects · esc back">
|
|
60
|
-
<Box flexDirection="column" marginBottom={1}>
|
|
61
|
-
<Text color={theme.dim}>
|
|
62
|
-
Your current agent stays in your wallet and remains loadable.
|
|
63
|
-
</Text>
|
|
64
|
-
<Text color={theme.dim}>
|
|
65
|
-
This mints a new agent to this wallet and uses it on this machine.
|
|
66
|
-
</Text>
|
|
67
|
-
</Box>
|
|
68
62
|
<Select<'replace' | 'back'>
|
|
69
63
|
options={[
|
|
70
|
-
{ value: 'back',
|
|
71
|
-
{ value: '
|
|
72
|
-
{ value: 'replace', role: 'section', label: 'New Identity' },
|
|
73
|
-
{ value: 'replace', label: 'Mint and Use New Agent', hint: 'Create separate token and make it active' },
|
|
64
|
+
{ value: 'back', label: 'Keep Current Agent', role: 'utility' },
|
|
65
|
+
{ value: 'replace', label: 'Mint and Use New Agent' },
|
|
74
66
|
]}
|
|
75
67
|
hintLayout="inline"
|
|
76
68
|
onSubmit={choice => {
|
|
@@ -101,14 +93,11 @@ export const CreateFlow: React.FC<CreateFlowProps> = ({
|
|
|
101
93
|
|
|
102
94
|
if (step.kind === 'create-description') {
|
|
103
95
|
return (
|
|
104
|
-
<Surface title="Describe Your Agent" subtitle={indicator}
|
|
105
|
-
<
|
|
106
|
-
<TextInput
|
|
96
|
+
<Surface title="Describe Your Agent" subtitle={indicator}>
|
|
97
|
+
<TextArea
|
|
107
98
|
key="agent-description"
|
|
108
99
|
initialValue={step.description ?? ''}
|
|
109
|
-
placeholder="description"
|
|
110
|
-
allowEmpty
|
|
111
|
-
multiline
|
|
100
|
+
placeholder="optional description"
|
|
112
101
|
onSubmit={description => onDescriptionSubmit(step.name, description.trim())}
|
|
113
102
|
onCancel={onBack}
|
|
114
103
|
/>
|
|
@@ -119,16 +108,10 @@ export const CreateFlow: React.FC<CreateFlowProps> = ({
|
|
|
119
108
|
if (step.kind === 'create-custody') {
|
|
120
109
|
return (
|
|
121
110
|
<Surface title="Pick Custody Mode" subtitle={indicator} footer="enter continues · esc back">
|
|
122
|
-
<Box flexDirection="column" marginBottom={1}>
|
|
123
|
-
<Text color={theme.dim}>Custody decides who controls the ERC-8004 token and who can rotate the URI pointer.</Text>
|
|
124
|
-
<Text color={theme.dim}>You can switch later from Identity Hub.</Text>
|
|
125
|
-
</Box>
|
|
126
111
|
<Select<'simple' | 'advanced'>
|
|
127
112
|
options={[
|
|
128
|
-
{ value: 'simple',
|
|
129
|
-
{ value: '
|
|
130
|
-
{ value: 'advanced', role: 'section', label: 'Advanced' },
|
|
131
|
-
{ value: 'advanced', label: 'Advanced', hint: 'Vault holds the token; owner wallet controls vault, operator wallets get URI-rotation permission' },
|
|
113
|
+
{ value: 'simple', label: 'Simple (recommended)', hint: 'One wallet signs' },
|
|
114
|
+
{ value: 'advanced', label: 'Advanced', hint: 'Operators rotate URI' },
|
|
132
115
|
]}
|
|
133
116
|
hintLayout="inline"
|
|
134
117
|
onSubmit={onCustodySubmit}
|
|
@@ -138,12 +121,56 @@ export const CreateFlow: React.FC<CreateFlowProps> = ({
|
|
|
138
121
|
)
|
|
139
122
|
}
|
|
140
123
|
|
|
124
|
+
if (step.kind === 'create-import') {
|
|
125
|
+
if (!step.candidates) {
|
|
126
|
+
return (
|
|
127
|
+
<BusyScreen
|
|
128
|
+
title="Checking Existing Notes"
|
|
129
|
+
subtitle={indicator}
|
|
130
|
+
label="scanning for notes to import..."
|
|
131
|
+
onCancel={onBack}
|
|
132
|
+
/>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
135
|
+
const candidates = step.candidates
|
|
136
|
+
const summary = candidates
|
|
137
|
+
.map(candidate => `${candidate.source} (${candidate.contentLines} lines)`)
|
|
138
|
+
.join(', ')
|
|
139
|
+
const toPreflight = (importNotes?: typeof candidates) => onSetStep({
|
|
140
|
+
kind: 'create-preflight',
|
|
141
|
+
name: step.name,
|
|
142
|
+
description: step.description,
|
|
143
|
+
...(step.network ? { network: step.network } : {}),
|
|
144
|
+
custodyMode: step.custodyMode,
|
|
145
|
+
...(importNotes && importNotes.length ? { importNotes } : {}),
|
|
146
|
+
})
|
|
147
|
+
return (
|
|
148
|
+
<Surface title="Import Existing Notes?" subtitle={indicator} footer="enter selects · esc back">
|
|
149
|
+
<Box flexDirection="column">
|
|
150
|
+
<Text color={theme.textSubtle}>Found local notes not yet captured by any agent: {summary}.</Text>
|
|
151
|
+
<Text color={theme.textSubtle}>Import folds them into this agent's MEMORY.md and the first encrypted snapshot.</Text>
|
|
152
|
+
</Box>
|
|
153
|
+
<Box marginTop={1}>
|
|
154
|
+
<Select<'import' | 'skip'>
|
|
155
|
+
options={[
|
|
156
|
+
{ value: 'import', label: 'Import Into New Agent', hint: 'Adds them to MEMORY.md' },
|
|
157
|
+
{ value: 'skip', label: 'Start Fresh', hint: 'Use blank scaffolding', role: 'utility' },
|
|
158
|
+
]}
|
|
159
|
+
hintLayout="inline"
|
|
160
|
+
onSubmit={choice => toPreflight(choice === 'import' ? candidates : undefined)}
|
|
161
|
+
onCancel={onBack}
|
|
162
|
+
/>
|
|
163
|
+
</Box>
|
|
164
|
+
</Surface>
|
|
165
|
+
)
|
|
166
|
+
}
|
|
167
|
+
|
|
141
168
|
if (step.kind === 'create-preflight') {
|
|
142
169
|
return (
|
|
143
170
|
<BusyScreen
|
|
144
171
|
title="Getting Ready"
|
|
145
172
|
subtitle={indicator}
|
|
146
|
-
label="checking
|
|
173
|
+
label="checking storage..."
|
|
147
174
|
onCancel={onBack}
|
|
148
175
|
/>
|
|
149
176
|
)
|
|
@@ -182,11 +209,11 @@ export const CreateFlow: React.FC<CreateFlowProps> = ({
|
|
|
182
209
|
title={isAdvanced ? 'Connect Owner Wallet' : 'Sign in Wallet'}
|
|
183
210
|
subtitle={
|
|
184
211
|
isAdvanced
|
|
185
|
-
? '
|
|
186
|
-
: '
|
|
212
|
+
? 'Owner wallet controls the Vault. Operators configured after minting.'
|
|
213
|
+
: 'Signs backup and submits mint transaction.'
|
|
187
214
|
}
|
|
188
215
|
walletSession={walletSession}
|
|
189
|
-
label={isAdvanced ? 'waiting for owner wallet...' : 'waiting for wallet
|
|
216
|
+
label={isAdvanced ? 'waiting for owner wallet to mint...' : 'waiting for wallet to mint...'}
|
|
190
217
|
onCancel={onBack}
|
|
191
218
|
/>
|
|
192
219
|
)
|