arc402-cli 0.7.4 → 0.8.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/MIGRATION-SPEC.md +108 -0
- package/dist/abis.js +14 -17
- package/dist/abis.js.map +1 -1
- package/dist/bundler.d.ts +1 -1
- package/dist/bundler.d.ts.map +1 -1
- package/dist/bundler.js +27 -61
- package/dist/bundler.js.map +1 -1
- package/dist/client.d.ts +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -9
- package/dist/client.js.map +1 -1
- package/dist/coinbase-smart-wallet.js +1 -4
- package/dist/coinbase-smart-wallet.js.map +1 -1
- package/dist/commands/accept.js +25 -28
- package/dist/commands/accept.js.map +1 -1
- package/dist/commands/agent-handshake.js +15 -18
- package/dist/commands/agent-handshake.js.map +1 -1
- package/dist/commands/agent.js +98 -104
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/agreements.js +62 -98
- package/dist/commands/agreements.js.map +1 -1
- package/dist/commands/arbitrator.js +45 -81
- package/dist/commands/arbitrator.js.map +1 -1
- package/dist/commands/arena-handshake.js +27 -30
- package/dist/commands/arena-handshake.js.map +1 -1
- package/dist/commands/arena.js +12 -18
- package/dist/commands/arena.js.map +1 -1
- package/dist/commands/backup.js +30 -36
- package/dist/commands/backup.js.map +1 -1
- package/dist/commands/cancel.js +15 -18
- package/dist/commands/cancel.js.map +1 -1
- package/dist/commands/channel.js +45 -81
- package/dist/commands/channel.js.map +1 -1
- package/dist/commands/coldstart.js +31 -34
- package/dist/commands/coldstart.js.map +1 -1
- package/dist/commands/config.js +23 -29
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/contract-interaction.js +12 -15
- package/dist/commands/contract-interaction.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +98 -135
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/deliver.js +37 -76
- package/dist/commands/deliver.js.map +1 -1
- package/dist/commands/discover.js +24 -27
- package/dist/commands/discover.js.map +1 -1
- package/dist/commands/dispute.js +104 -110
- package/dist/commands/dispute.js.map +1 -1
- package/dist/commands/doctor.js +16 -55
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/endpoint.js +56 -95
- package/dist/commands/endpoint.js.map +1 -1
- package/dist/commands/feed.js +11 -18
- package/dist/commands/feed.js.map +1 -1
- package/dist/commands/hire.js +37 -40
- package/dist/commands/hire.js.map +1 -1
- package/dist/commands/migrate.js +30 -33
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/negotiate.d.ts.map +1 -1
- package/dist/commands/negotiate.js +34 -36
- package/dist/commands/negotiate.js.map +1 -1
- package/dist/commands/openshell.js +68 -104
- package/dist/commands/openshell.js.map +1 -1
- package/dist/commands/owner.js +17 -20
- package/dist/commands/owner.js.map +1 -1
- package/dist/commands/policy.js +41 -43
- package/dist/commands/policy.js.map +1 -1
- package/dist/commands/relay.d.ts.map +1 -1
- package/dist/commands/relay.js +18 -51
- package/dist/commands/relay.js.map +1 -1
- package/dist/commands/remediate.js +20 -23
- package/dist/commands/remediate.js.map +1 -1
- package/dist/commands/reputation.js +25 -27
- package/dist/commands/reputation.js.map +1 -1
- package/dist/commands/setup.js +65 -104
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/trust.js +17 -20
- package/dist/commands/trust.js.map +1 -1
- package/dist/commands/verify.js +18 -21
- package/dist/commands/verify.js.map +1 -1
- package/dist/commands/wallet.js +619 -625
- package/dist/commands/wallet.js.map +1 -1
- package/dist/commands/watch.js +33 -36
- package/dist/commands/watch.js.map +1 -1
- package/dist/commands/watchtower.js +37 -73
- package/dist/commands/watchtower.js.map +1 -1
- package/dist/commands/workroom.d.ts.map +1 -1
- package/dist/commands/workroom.js +138 -171
- package/dist/commands/workroom.js.map +1 -1
- package/dist/config.js +21 -65
- package/dist/config.js.map +1 -1
- package/dist/daemon/config.d.ts.map +1 -1
- package/dist/daemon/config.js +16 -53
- package/dist/daemon/config.js.map +1 -1
- package/dist/daemon/hire-listener.d.ts +3 -3
- package/dist/daemon/hire-listener.d.ts.map +1 -1
- package/dist/daemon/hire-listener.js +13 -47
- package/dist/daemon/hire-listener.js.map +1 -1
- package/dist/daemon/index.d.ts +1 -1
- package/dist/daemon/index.d.ts.map +1 -1
- package/dist/daemon/index.js +50 -88
- package/dist/daemon/index.js.map +1 -1
- package/dist/daemon/job-lifecycle.d.ts +1 -1
- package/dist/daemon/job-lifecycle.d.ts.map +1 -1
- package/dist/daemon/job-lifecycle.js +11 -51
- package/dist/daemon/job-lifecycle.js.map +1 -1
- package/dist/daemon/notify.d.ts +1 -1
- package/dist/daemon/notify.d.ts.map +1 -1
- package/dist/daemon/notify.js +19 -53
- package/dist/daemon/notify.js.map +1 -1
- package/dist/daemon/token-metering.js +8 -47
- package/dist/daemon/token-metering.js.map +1 -1
- package/dist/daemon/userops.d.ts +2 -2
- package/dist/daemon/userops.d.ts.map +1 -1
- package/dist/daemon/userops.js +23 -27
- package/dist/daemon/userops.js.map +1 -1
- package/dist/daemon/wallet-monitor.d.ts +1 -1
- package/dist/daemon/wallet-monitor.d.ts.map +1 -1
- package/dist/daemon/wallet-monitor.js +8 -12
- package/dist/daemon/wallet-monitor.js.map +1 -1
- package/dist/drain-v4.js +26 -64
- package/dist/drain-v4.js.map +1 -1
- package/dist/endpoint-config.js +20 -63
- package/dist/endpoint-config.js.map +1 -1
- package/dist/endpoint-notify.js +9 -48
- package/dist/endpoint-notify.js.map +1 -1
- package/dist/index.js +16 -50
- package/dist/index.js.map +1 -1
- package/dist/openshell-runtime.d.ts.map +1 -1
- package/dist/openshell-runtime.js +38 -82
- package/dist/openshell-runtime.js.map +1 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +77 -83
- package/dist/program.js.map +1 -1
- package/dist/repl.js +25 -31
- package/dist/repl.js.map +1 -1
- package/dist/signing.js +3 -6
- package/dist/signing.js.map +1 -1
- package/dist/telegram-notify.js +3 -40
- package/dist/telegram-notify.js.map +1 -1
- package/dist/tui/App.d.ts.map +1 -1
- package/dist/tui/App.js +44 -50
- package/dist/tui/App.js.map +1 -1
- package/dist/tui/Footer.js +4 -7
- package/dist/tui/Footer.js.map +1 -1
- package/dist/tui/Header.js +7 -13
- package/dist/tui/Header.js.map +1 -1
- package/dist/tui/InputLine.js +17 -23
- package/dist/tui/InputLine.js.map +1 -1
- package/dist/tui/Viewport.js +5 -8
- package/dist/tui/Viewport.js.map +1 -1
- package/dist/tui/WalletConnectPairing.d.ts +23 -0
- package/dist/tui/WalletConnectPairing.d.ts.map +1 -0
- package/dist/tui/WalletConnectPairing.js +75 -0
- package/dist/tui/WalletConnectPairing.js.map +1 -0
- package/dist/tui/index.d.ts.map +1 -1
- package/dist/tui/index.js +14 -21
- package/dist/tui/index.js.map +1 -1
- package/dist/tui/useChat.js +13 -19
- package/dist/tui/useChat.js.map +1 -1
- package/dist/tui/useCommand.js +12 -18
- package/dist/tui/useCommand.js.map +1 -1
- package/dist/tui/useScroll.js +9 -12
- package/dist/tui/useScroll.js.map +1 -1
- package/dist/ui/banner.js +12 -19
- package/dist/ui/banner.js.map +1 -1
- package/dist/ui/colors.js +13 -19
- package/dist/ui/colors.js.map +1 -1
- package/dist/ui/format.js +6 -14
- package/dist/ui/format.js.map +1 -1
- package/dist/ui/spinner.js +6 -12
- package/dist/ui/spinner.js.map +1 -1
- package/dist/ui/tree.js +3 -6
- package/dist/ui/tree.js.map +1 -1
- package/dist/utils/format.js +27 -41
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/hash.js +4 -42
- package/dist/utils/hash.js.map +1 -1
- package/dist/utils/time.js +2 -6
- package/dist/utils/time.js.map +1 -1
- package/dist/wallet-router.d.ts +1 -1
- package/dist/wallet-router.d.ts.map +1 -1
- package/dist/wallet-router.js +12 -19
- package/dist/wallet-router.js.map +1 -1
- package/dist/walletconnect-session.d.ts +1 -1
- package/dist/walletconnect-session.d.ts.map +1 -1
- package/dist/walletconnect-session.js +6 -11
- package/dist/walletconnect-session.js.map +1 -1
- package/dist/walletconnect.d.ts +6 -1
- package/dist/walletconnect.d.ts.map +1 -1
- package/dist/walletconnect.js +32 -35
- package/dist/walletconnect.js.map +1 -1
- package/package.json +7 -6
- package/src/bundler.ts +1 -1
- package/src/client.ts +1 -1
- package/src/commands/accept.ts +7 -7
- package/src/commands/agent-handshake.ts +4 -4
- package/src/commands/agent.ts +9 -9
- package/src/commands/agreements.ts +8 -8
- package/src/commands/arbitrator.ts +5 -5
- package/src/commands/arena-handshake.ts +6 -6
- package/src/commands/arena.ts +2 -2
- package/src/commands/backup.ts +1 -1
- package/src/commands/cancel.ts +6 -6
- package/src/commands/channel.ts +6 -6
- package/src/commands/coldstart.ts +5 -5
- package/src/commands/config.ts +2 -2
- package/src/commands/contract-interaction.ts +2 -2
- package/src/commands/daemon.ts +14 -11
- package/src/commands/deliver.ts +9 -9
- package/src/commands/discover.ts +5 -5
- package/src/commands/dispute.ts +7 -7
- package/src/commands/doctor.ts +2 -2
- package/src/commands/endpoint.ts +6 -6
- package/src/commands/feed.ts +1 -1
- package/src/commands/hire.ts +10 -10
- package/src/commands/migrate.ts +7 -7
- package/src/commands/negotiate.ts +6 -5
- package/src/commands/openshell.ts +4 -4
- package/src/commands/owner.ts +5 -5
- package/src/commands/policy.ts +5 -5
- package/src/commands/relay.ts +5 -1
- package/src/commands/remediate.ts +5 -5
- package/src/commands/reputation.ts +6 -6
- package/src/commands/setup.ts +1 -1
- package/src/commands/trust.ts +6 -6
- package/src/commands/verify.ts +6 -6
- package/src/commands/wallet.ts +15 -15
- package/src/commands/watch.ts +3 -3
- package/src/commands/watchtower.ts +6 -6
- package/src/commands/workroom.ts +14 -10
- package/src/daemon/config.ts +2 -1
- package/src/daemon/hire-listener.ts +3 -3
- package/src/daemon/index.ts +10 -9
- package/src/daemon/job-lifecycle.ts +1 -1
- package/src/daemon/notify.ts +4 -4
- package/src/daemon/userops.ts +4 -4
- package/src/daemon/wallet-monitor.ts +2 -2
- package/src/endpoint-notify.ts +1 -1
- package/src/index.ts +8 -7
- package/src/openshell-runtime.ts +5 -1
- package/src/program.ts +36 -36
- package/src/repl.ts +3 -3
- package/src/tui/App.tsx +15 -10
- package/src/tui/Header.tsx +1 -1
- package/src/tui/InputLine.tsx +1 -1
- package/src/tui/WalletConnectPairing.tsx +131 -0
- package/src/tui/index.tsx +7 -8
- package/src/tui/useChat.ts +1 -1
- package/src/tui/useCommand.ts +4 -4
- package/src/ui/banner.ts +2 -2
- package/src/ui/tree.ts +1 -1
- package/src/wallet-router.ts +2 -2
- package/src/walletconnect-session.ts +1 -1
- package/src/walletconnect.ts +20 -5
- package/tsconfig.json +16 -7
package/src/commands/owner.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { DisputeArbitrationClient } from "@arc402/sdk";
|
|
3
|
-
import { loadConfig } from "../config";
|
|
4
|
-
import { requireSigner } from "../client";
|
|
5
|
-
import { c } from '../ui/colors';
|
|
6
|
-
import { startSpinner } from '../ui/spinner';
|
|
7
|
-
import { formatAddress } from '../ui/format';
|
|
3
|
+
import { loadConfig } from "../config.js";
|
|
4
|
+
import { requireSigner } from "../client.js";
|
|
5
|
+
import { c } from '../ui/colors.js';
|
|
6
|
+
import { startSpinner } from '../ui/spinner.js';
|
|
7
|
+
import { formatAddress } from '../ui/format.js';
|
|
8
8
|
|
|
9
9
|
export function registerOwnerCommands(program: Command): void {
|
|
10
10
|
const owner = program.command("owner").description("Protocol ownership management (DisputeArbitration two-step transfer)");
|
package/src/commands/policy.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ethers } from "ethers";
|
|
3
|
-
import { loadConfig } from "../config";
|
|
4
|
-
import { getClient, requireSigner } from "../client";
|
|
5
|
-
import { c } from '../ui/colors';
|
|
6
|
-
import { startSpinner } from '../ui/spinner';
|
|
7
|
-
import { formatAddress } from '../ui/format';
|
|
3
|
+
import { loadConfig } from "../config.js";
|
|
4
|
+
import { getClient, requireSigner } from "../client.js";
|
|
5
|
+
import { c } from '../ui/colors.js';
|
|
6
|
+
import { startSpinner } from '../ui/spinner.js';
|
|
7
|
+
import { formatAddress } from '../ui/format.js';
|
|
8
8
|
|
|
9
9
|
const POLICY_ENGINE_EXTENDED_ABI = [
|
|
10
10
|
"function addToBlocklist(address wallet, address provider) external",
|
package/src/commands/relay.ts
CHANGED
|
@@ -5,7 +5,11 @@ import * as os from "os";
|
|
|
5
5
|
import * as http from "http";
|
|
6
6
|
import * as https from "https";
|
|
7
7
|
import { spawn } from "child_process";
|
|
8
|
-
import { c } from '../ui/colors';
|
|
8
|
+
import { c } from '../ui/colors.js';
|
|
9
|
+
|
|
10
|
+
import { fileURLToPath } from "node:url";
|
|
11
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
9
13
|
|
|
10
14
|
const PID_FILE = path.join(os.homedir(), ".arc402", "relay.pid");
|
|
11
15
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ProviderResponseType, ServiceAgreementClient } from "@arc402/sdk";
|
|
3
|
-
import { loadConfig } from "../config";
|
|
4
|
-
import { getClient, requireSigner } from "../client";
|
|
5
|
-
import { hashFile, hashString } from "../utils/hash";
|
|
6
|
-
import { c } from '../ui/colors';
|
|
7
|
-
import { startSpinner } from '../ui/spinner';
|
|
3
|
+
import { loadConfig } from "../config.js";
|
|
4
|
+
import { getClient, requireSigner } from "../client.js";
|
|
5
|
+
import { hashFile, hashString } from "../utils/hash.js";
|
|
6
|
+
import { c } from '../ui/colors.js';
|
|
7
|
+
import { startSpinner } from '../ui/spinner.js';
|
|
8
8
|
|
|
9
9
|
export function registerRemediateCommands(program: Command): void {
|
|
10
10
|
const remediate = program.command("remediate").description("Negotiated remediation before formal dispute");
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ReputationOracleClient, ReputationSignalType } from "@arc402/sdk";
|
|
3
3
|
import { ethers } from "ethers";
|
|
4
|
-
import { loadConfig } from "../config";
|
|
5
|
-
import { getClient, requireSigner } from "../client";
|
|
6
|
-
import { c } from '../ui/colors';
|
|
7
|
-
import { startSpinner } from '../ui/spinner';
|
|
8
|
-
import { renderTree } from '../ui/tree';
|
|
9
|
-
import { formatAddress } from '../ui/format';
|
|
4
|
+
import { loadConfig } from "../config.js";
|
|
5
|
+
import { getClient, requireSigner } from "../client.js";
|
|
6
|
+
import { c } from '../ui/colors.js';
|
|
7
|
+
import { startSpinner } from '../ui/spinner.js';
|
|
8
|
+
import { renderTree } from '../ui/tree.js';
|
|
9
|
+
import { formatAddress } from '../ui/format.js';
|
|
10
10
|
|
|
11
11
|
const reputation = new Command("reputation").description("Network-wide reputation signals");
|
|
12
12
|
|
package/src/commands/setup.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as net from "net";
|
|
|
3
3
|
import { execSync, spawn } from "child_process";
|
|
4
4
|
import chalk from "chalk";
|
|
5
5
|
import prompts from "prompts";
|
|
6
|
-
import { configExists, loadConfig, getSubdomainApi } from "../config";
|
|
6
|
+
import { configExists, loadConfig, getSubdomainApi } from "../config.js";
|
|
7
7
|
|
|
8
8
|
const DAEMON_PORT = 4402;
|
|
9
9
|
|
package/src/commands/trust.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ReputationOracleClient, SponsorshipAttestationClient, TrustClient } from "@arc402/sdk";
|
|
3
|
-
import { loadConfig } from "../config";
|
|
4
|
-
import { getClient } from "../client";
|
|
5
|
-
import { getTrustTier, identityTierLabel } from "../utils/format";
|
|
6
|
-
import { c } from '../ui/colors';
|
|
7
|
-
import { renderTree } from '../ui/tree';
|
|
8
|
-
import { formatAddress } from '../ui/format';
|
|
3
|
+
import { loadConfig } from "../config.js";
|
|
4
|
+
import { getClient } from "../client.js";
|
|
5
|
+
import { getTrustTier, identityTierLabel } from "../utils/format.js";
|
|
6
|
+
import { c } from '../ui/colors.js';
|
|
7
|
+
import { renderTree } from '../ui/tree.js';
|
|
8
|
+
import { formatAddress } from '../ui/format.js';
|
|
9
9
|
|
|
10
10
|
export function registerTrustCommand(program: Command): void {
|
|
11
11
|
program.command("trust <address>").description("Look up trust plus secondary sponsorship/reputation signals for an address").option("--json").action(async (address, opts) => {
|
package/src/commands/verify.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ServiceAgreementClient } from "@arc402/sdk";
|
|
3
3
|
import { ethers } from "ethers";
|
|
4
|
-
import { loadConfig } from "../config";
|
|
5
|
-
import { getClient, requireSigner } from "../client";
|
|
6
|
-
import { printSenderInfo, executeContractWriteViaWallet } from "../wallet-router";
|
|
7
|
-
import { SERVICE_AGREEMENT_ABI } from "../abis";
|
|
8
|
-
import { c } from '../ui/colors';
|
|
9
|
-
import { startSpinner } from '../ui/spinner';
|
|
4
|
+
import { loadConfig } from "../config.js";
|
|
5
|
+
import { getClient, requireSigner } from "../client.js";
|
|
6
|
+
import { printSenderInfo, executeContractWriteViaWallet } from "../wallet-router.js";
|
|
7
|
+
import { SERVICE_AGREEMENT_ABI } from "../abis.js";
|
|
8
|
+
import { c } from '../ui/colors.js';
|
|
9
|
+
import { startSpinner } from '../ui/spinner.js';
|
|
10
10
|
|
|
11
11
|
// Agreement status values from the contract
|
|
12
12
|
const AGREEMENT_STATUS_NAMES: Record<number, string> = {
|
package/src/commands/wallet.ts
CHANGED
|
@@ -6,21 +6,21 @@ import fs from "fs";
|
|
|
6
6
|
import path from "path";
|
|
7
7
|
import os from "os";
|
|
8
8
|
import { spawnSync } from "child_process";
|
|
9
|
-
import { Arc402Config, getConfigPath, getUsdcAddress, loadConfig, NETWORK_DEFAULTS, saveConfig } from "../config";
|
|
10
|
-
import { getClient, requireSigner } from "../client";
|
|
11
|
-
import { getTrustTier } from "../utils/format";
|
|
12
|
-
import { AGENT_REGISTRY_ABI, ARC402_WALLET_EXECUTE_ABI, ARC402_WALLET_GUARDIAN_ABI, ARC402_WALLET_MACHINE_KEY_ABI, ARC402_WALLET_OWNER_ABI, ARC402_WALLET_PASSKEY_ABI, ARC402_WALLET_PROTOCOL_ABI, ARC402_WALLET_REGISTRY_ABI, POLICY_ENGINE_GOVERNANCE_ABI, POLICY_ENGINE_LIMITS_ABI, TRUST_REGISTRY_ABI, WALLET_FACTORY_ABI } from "../abis";
|
|
13
|
-
import { warnIfPublicRpc } from "../config";
|
|
14
|
-
import { connectPhoneWallet, sendTransactionWithSession, requestPhoneWalletSignature } from "../walletconnect";
|
|
15
|
-
import { BundlerClient, buildSponsoredUserOp, PaymasterClient, DEFAULT_ENTRY_POINT } from "../bundler";
|
|
16
|
-
import { clearWCSession } from "../walletconnect-session";
|
|
17
|
-
import { handleWalletError } from "../wallet-router";
|
|
18
|
-
import { requestCoinbaseSmartWalletSignature } from "../coinbase-smart-wallet";
|
|
19
|
-
import { sendTelegramMessage } from "../telegram-notify";
|
|
20
|
-
import { renderTree } from "../ui/tree";
|
|
21
|
-
import { startSpinner } from "../ui/spinner";
|
|
22
|
-
import { c } from "../ui/colors";
|
|
23
|
-
import { formatAddress } from "../ui/format";
|
|
9
|
+
import { Arc402Config, getConfigPath, getUsdcAddress, loadConfig, NETWORK_DEFAULTS, saveConfig } from "../config.js";
|
|
10
|
+
import { getClient, requireSigner } from "../client.js";
|
|
11
|
+
import { getTrustTier } from "../utils/format.js";
|
|
12
|
+
import { AGENT_REGISTRY_ABI, ARC402_WALLET_EXECUTE_ABI, ARC402_WALLET_GUARDIAN_ABI, ARC402_WALLET_MACHINE_KEY_ABI, ARC402_WALLET_OWNER_ABI, ARC402_WALLET_PASSKEY_ABI, ARC402_WALLET_PROTOCOL_ABI, ARC402_WALLET_REGISTRY_ABI, POLICY_ENGINE_GOVERNANCE_ABI, POLICY_ENGINE_LIMITS_ABI, TRUST_REGISTRY_ABI, WALLET_FACTORY_ABI } from "../abis.js";
|
|
13
|
+
import { warnIfPublicRpc } from "../config.js";
|
|
14
|
+
import { connectPhoneWallet, sendTransactionWithSession, requestPhoneWalletSignature } from "../walletconnect.js";
|
|
15
|
+
import { BundlerClient, buildSponsoredUserOp, PaymasterClient, DEFAULT_ENTRY_POINT } from "../bundler.js";
|
|
16
|
+
import { clearWCSession } from "../walletconnect-session.js";
|
|
17
|
+
import { handleWalletError } from "../wallet-router.js";
|
|
18
|
+
import { requestCoinbaseSmartWalletSignature } from "../coinbase-smart-wallet.js";
|
|
19
|
+
import { sendTelegramMessage } from "../telegram-notify.js";
|
|
20
|
+
import { renderTree } from "../ui/tree.js";
|
|
21
|
+
import { startSpinner } from "../ui/spinner.js";
|
|
22
|
+
import { c } from "../ui/colors.js";
|
|
23
|
+
import { formatAddress } from "../ui/format.js";
|
|
24
24
|
|
|
25
25
|
const POLICY_ENGINE_DEFAULT = "0x44102e70c2A366632d98Fe40d892a2501fC7fFF2";
|
|
26
26
|
const GUARDIAN_KEY_PATH = path.join(os.homedir(), ".arc402", "guardian.key");
|
package/src/commands/watch.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ethers } from "ethers";
|
|
3
|
-
import { loadConfig } from "../config";
|
|
4
|
-
import { getClient } from "../client";
|
|
5
|
-
import { c } from "../ui/colors";
|
|
3
|
+
import { loadConfig } from "../config.js";
|
|
4
|
+
import { getClient } from "../client.js";
|
|
5
|
+
import { c } from "../ui/colors.js";
|
|
6
6
|
|
|
7
7
|
// ─── Minimal ABIs for event watching ─────────────────────────────────────────
|
|
8
8
|
|
|
@@ -2,13 +2,13 @@ import { Command } from "commander";
|
|
|
2
2
|
import * as fs from "fs";
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
import * as os from "os";
|
|
5
|
-
import { loadConfig } from "../config";
|
|
6
|
-
import { requireSigner, getClient } from "../client";
|
|
5
|
+
import { loadConfig } from "../config.js";
|
|
6
|
+
import { requireSigner, getClient } from "../client.js";
|
|
7
7
|
import { WatchtowerClient, ChannelClient } from "@arc402/sdk";
|
|
8
|
-
import { c } from '../ui/colors';
|
|
9
|
-
import { startSpinner } from '../ui/spinner';
|
|
10
|
-
import { renderTree } from '../ui/tree';
|
|
11
|
-
import { formatAddress } from '../ui/format';
|
|
8
|
+
import { c } from '../ui/colors.js';
|
|
9
|
+
import { startSpinner } from '../ui/spinner.js';
|
|
10
|
+
import { renderTree } from '../ui/tree.js';
|
|
11
|
+
import { formatAddress } from '../ui/format.js';
|
|
12
12
|
|
|
13
13
|
const CHANNEL_STATES_DIR = path.join(os.homedir(), ".arc402", "channel-states");
|
|
14
14
|
|
package/src/commands/workroom.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
+
import * as crypto from "node:crypto";
|
|
2
3
|
import * as fs from "fs";
|
|
3
4
|
import * as path from "path";
|
|
4
5
|
import * as os from "os";
|
|
@@ -7,12 +8,16 @@ import { spawnSync, execSync } from "child_process";
|
|
|
7
8
|
import {
|
|
8
9
|
ARC402_DIR,
|
|
9
10
|
runCmd,
|
|
10
|
-
} from "../openshell-runtime";
|
|
11
|
-
import { DAEMON_LOG, DAEMON_TOML } from "../daemon/config";
|
|
12
|
-
import { c } from "../ui/colors";
|
|
13
|
-
import { startSpinner } from "../ui/spinner";
|
|
14
|
-
import { renderTree } from "../ui/tree";
|
|
15
|
-
import { formatAddress } from "../ui/format";
|
|
11
|
+
} from "../openshell-runtime.js";
|
|
12
|
+
import { DAEMON_LOG, DAEMON_TOML, loadDaemonConfig } from "../daemon/config.js";
|
|
13
|
+
import { c } from "../ui/colors.js";
|
|
14
|
+
import { startSpinner } from "../ui/spinner.js";
|
|
15
|
+
import { renderTree } from "../ui/tree.js";
|
|
16
|
+
import { formatAddress } from "../ui/format.js";
|
|
17
|
+
|
|
18
|
+
import { fileURLToPath } from "node:url";
|
|
19
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
20
|
+
const __dirname = path.dirname(__filename);
|
|
16
21
|
|
|
17
22
|
// ─── Daemon lifecycle notify ──────────────────────────────────────────────────
|
|
18
23
|
|
|
@@ -27,7 +32,6 @@ function notifyDaemonWorkroomStatus(
|
|
|
27
32
|
let daemonPort = port;
|
|
28
33
|
if (fs.existsSync(DAEMON_TOML)) {
|
|
29
34
|
try {
|
|
30
|
-
const { loadDaemonConfig } = require("../daemon/config") as typeof import("../daemon/config");
|
|
31
35
|
const cfg = loadDaemonConfig();
|
|
32
36
|
daemonPort = cfg.relay?.listen_port ?? port;
|
|
33
37
|
} catch { /* use default */ }
|
|
@@ -101,7 +105,7 @@ function buildImage(): boolean {
|
|
|
101
105
|
function getPolicyHash(): string {
|
|
102
106
|
if (!fs.existsSync(POLICY_FILE)) return "(no policy file)";
|
|
103
107
|
const content = fs.readFileSync(POLICY_FILE, "utf-8");
|
|
104
|
-
|
|
108
|
+
// crypto imported at top level
|
|
105
109
|
return "0x" + crypto.createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
106
110
|
}
|
|
107
111
|
|
|
@@ -131,7 +135,7 @@ export function registerWorkroomCommands(program: Command): void {
|
|
|
131
135
|
if (!fs.existsSync(POLICY_FILE)) {
|
|
132
136
|
console.log(c.dim("No policy file found. Generating default..."));
|
|
133
137
|
// Import and call the existing policy generator
|
|
134
|
-
const { registerOpenShellCommands } =
|
|
138
|
+
const { registerOpenShellCommands } = await import("./openshell.js");
|
|
135
139
|
console.log(c.dim(`Policy file will be generated at: ${POLICY_FILE}`));
|
|
136
140
|
console.log(c.dim("Run 'arc402 workroom policy preset core-launch' after init to apply defaults."));
|
|
137
141
|
} else {
|
|
@@ -797,7 +801,7 @@ No learnings yet. Complete your first hired task to start accumulating expertise
|
|
|
797
801
|
.command("token-usage [agreementId]")
|
|
798
802
|
.description("Show token usage for a specific agreement or across all jobs.")
|
|
799
803
|
.action(async (agreementId) => {
|
|
800
|
-
const { readUsageReport, formatUsageReport } =
|
|
804
|
+
const { readUsageReport, formatUsageReport } = await import("../daemon/token-metering.js");
|
|
801
805
|
|
|
802
806
|
if (agreementId) {
|
|
803
807
|
const usage = readUsageReport(agreementId);
|
package/src/daemon/config.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import * as fs from "fs";
|
|
7
7
|
import * as path from "path";
|
|
8
8
|
import * as os from "os";
|
|
9
|
+
import { ethers } from "ethers";
|
|
9
10
|
import { parse as parseToml } from "smol-toml";
|
|
10
11
|
|
|
11
12
|
export const DAEMON_DIR = path.join(os.homedir(), ".arc402");
|
|
@@ -249,7 +250,7 @@ export function loadMachineKey(config: DaemonConfig): { privateKey: string; addr
|
|
|
249
250
|
throw new Error(`Machine key not found. Set environment variable: ${envVarName}`);
|
|
250
251
|
}
|
|
251
252
|
|
|
252
|
-
|
|
253
|
+
// ethers imported at top level
|
|
253
254
|
let address: string;
|
|
254
255
|
try {
|
|
255
256
|
const w = new ethers.Wallet(privateKey);
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
import * as http from "http";
|
|
6
6
|
import * as https from "https";
|
|
7
7
|
import { ethers } from "ethers";
|
|
8
|
-
import type { DaemonConfig } from "./config";
|
|
9
|
-
import type { DaemonDB } from "./index";
|
|
10
|
-
import type { Notifier } from "./notify";
|
|
8
|
+
import type { DaemonConfig } from "./config.js";
|
|
9
|
+
import type { DaemonDB } from "./index.js";
|
|
10
|
+
import type { Notifier } from "./notify.js";
|
|
11
11
|
|
|
12
12
|
export interface HireProposal {
|
|
13
13
|
messageId: string;
|
package/src/daemon/index.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* Signals: SIGTERM → graceful shutdown.
|
|
9
9
|
*/
|
|
10
10
|
import * as fs from "fs";
|
|
11
|
+
import * as os from "os";
|
|
11
12
|
import * as path from "path";
|
|
12
13
|
import * as net from "net";
|
|
13
14
|
import * as http from "http";
|
|
@@ -25,12 +26,12 @@ import {
|
|
|
25
26
|
DAEMON_DB,
|
|
26
27
|
DAEMON_SOCK,
|
|
27
28
|
type DaemonConfig,
|
|
28
|
-
} from "./config";
|
|
29
|
-
import { verifyWallet, getWalletBalance } from "./wallet-monitor";
|
|
30
|
-
import { buildNotifier } from "./notify";
|
|
31
|
-
import { HireListener } from "./hire-listener";
|
|
32
|
-
import { UserOpsManager, buildAcceptCalldata } from "./userops";
|
|
33
|
-
import { generateReceipt, extractLearnings, createJobDirectory, cleanJobDirectory } from "./job-lifecycle";
|
|
29
|
+
} from "./config.js";
|
|
30
|
+
import { verifyWallet, getWalletBalance } from "./wallet-monitor.js";
|
|
31
|
+
import { buildNotifier } from "./notify.js";
|
|
32
|
+
import { HireListener } from "./hire-listener.js";
|
|
33
|
+
import { UserOpsManager, buildAcceptCalldata } from "./userops.js";
|
|
34
|
+
import { generateReceipt, extractLearnings, createJobDirectory, cleanJobDirectory } from "./job-lifecycle.js";
|
|
34
35
|
|
|
35
36
|
// ─── State DB ─────────────────────────────────────────────────────────────────
|
|
36
37
|
|
|
@@ -432,7 +433,7 @@ function formatUptime(seconds: number): string {
|
|
|
432
433
|
// ─── Daemon main ──────────────────────────────────────────────────────────────
|
|
433
434
|
|
|
434
435
|
// Extend config with serviceAgreementAddress (loaded from CLI config if available)
|
|
435
|
-
declare module "./config" {
|
|
436
|
+
declare module "./config.js" {
|
|
436
437
|
interface DaemonConfig {
|
|
437
438
|
serviceAgreementAddress?: string;
|
|
438
439
|
}
|
|
@@ -448,7 +449,7 @@ export async function runDaemon(foreground = false): Promise<void> {
|
|
|
448
449
|
let config: DaemonConfig;
|
|
449
450
|
try {
|
|
450
451
|
config = loadDaemonConfig();
|
|
451
|
-
log({ event: "config_loaded", path:
|
|
452
|
+
log({ event: "config_loaded", path: path.join(os.homedir(), ".arc402", "daemon.toml") });
|
|
452
453
|
} catch (err) {
|
|
453
454
|
process.stderr.write(`Config error: ${err}\n`);
|
|
454
455
|
process.exit(1);
|
|
@@ -763,7 +764,7 @@ export async function runDaemon(foreground = false): Promise<void> {
|
|
|
763
764
|
}
|
|
764
765
|
|
|
765
766
|
// Policy check
|
|
766
|
-
const { evaluatePolicy } = await import("./hire-listener");
|
|
767
|
+
const { evaluatePolicy } = await import("./hire-listener.js");
|
|
767
768
|
const activeCount = db.countActiveHireRequests();
|
|
768
769
|
const policyResult = evaluatePolicy(proposal, config, activeCount);
|
|
769
770
|
|
|
@@ -13,7 +13,7 @@ import * as fs from "fs";
|
|
|
13
13
|
import * as path from "path";
|
|
14
14
|
import * as os from "os";
|
|
15
15
|
import * as crypto from "crypto";
|
|
16
|
-
import { readUsageReport, type AggregatedTokenUsage } from "./token-metering";
|
|
16
|
+
import { readUsageReport, type AggregatedTokenUsage } from "./token-metering.js";
|
|
17
17
|
|
|
18
18
|
const ARC402_DIR = path.join(os.homedir(), ".arc402");
|
|
19
19
|
const RECEIPTS_DIR = path.join(ARC402_DIR, "receipts");
|
package/src/daemon/notify.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import * as https from "https";
|
|
6
6
|
import * as http from "http";
|
|
7
|
-
import type { DaemonConfig } from "./config";
|
|
7
|
+
import type { DaemonConfig } from "./config.js";
|
|
8
8
|
|
|
9
9
|
export type NotifyEvent =
|
|
10
10
|
| "hire_request"
|
|
@@ -133,11 +133,11 @@ export class EmailChannel implements NotificationChannel {
|
|
|
133
133
|
async send(title: string, body: string): Promise<void> {
|
|
134
134
|
// nodemailer is an optional runtime dependency — load via require to skip
|
|
135
135
|
// compile-time module resolution. Throws a clear message if not installed.
|
|
136
|
-
// eslint-disable-next-line @typescript-eslint/no-
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
137
137
|
let nodemailer: any;
|
|
138
138
|
try {
|
|
139
|
-
//
|
|
140
|
-
nodemailer =
|
|
139
|
+
// @ts-expect-error nodemailer is an optional dependency
|
|
140
|
+
nodemailer = await import("nodemailer");
|
|
141
141
|
} catch {
|
|
142
142
|
throw new Error("nodemailer is not installed. Run: npm install nodemailer");
|
|
143
143
|
}
|
package/src/daemon/userops.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* Wraps protocol calls (accept, fulfill) into ERC-4337 UserOperations.
|
|
4
4
|
*/
|
|
5
5
|
import { ethers } from "ethers";
|
|
6
|
-
import { BundlerClient } from "../bundler";
|
|
7
|
-
import type { UserOperation } from "../bundler";
|
|
8
|
-
import type { DaemonConfig } from "./config";
|
|
9
|
-
import { ARC402_WALLET_EXECUTE_ABI } from "../abis";
|
|
6
|
+
import { BundlerClient } from "../bundler.js";
|
|
7
|
+
import type { UserOperation } from "../bundler.js";
|
|
8
|
+
import type { DaemonConfig } from "./config.js";
|
|
9
|
+
import { ARC402_WALLET_EXECUTE_ABI } from "../abis.js";
|
|
10
10
|
|
|
11
11
|
// ServiceAgreement calldata encoders
|
|
12
12
|
const SA_IFACE = new ethers.Interface([
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
* Steps 4 and 5 of the daemon startup sequence (Spec 32 §3).
|
|
4
4
|
*/
|
|
5
5
|
import { ethers } from "ethers";
|
|
6
|
-
import type { DaemonConfig } from "./config";
|
|
6
|
+
import type { DaemonConfig } from "./config.js";
|
|
7
7
|
import {
|
|
8
8
|
ARC402_WALLET_GUARDIAN_ABI,
|
|
9
9
|
ARC402_WALLET_MACHINE_KEY_ABI,
|
|
10
|
-
} from "../abis";
|
|
10
|
+
} from "../abis.js";
|
|
11
11
|
|
|
12
12
|
export interface WalletStatus {
|
|
13
13
|
contractAddress: string;
|
package/src/endpoint-notify.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* and POSTs lifecycle events after onchain transactions.
|
|
5
5
|
*/
|
|
6
6
|
import { ethers } from "ethers";
|
|
7
|
-
import { AGENT_REGISTRY_ABI } from "./abis";
|
|
7
|
+
import { AGENT_REGISTRY_ABI } from "./abis.js";
|
|
8
8
|
import * as dns from "dns/promises";
|
|
9
9
|
|
|
10
10
|
export const DEFAULT_REGISTRY_ADDRESS = "0xD5c2851B00090c92Ba7F4723FB548bb30C9B6865";
|
package/src/index.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import { createProgram } from "./program.js";
|
|
4
|
+
import { startREPL } from "./repl.js";
|
|
5
|
+
import { configExists, loadConfig, saveConfig } from "./config.js";
|
|
5
6
|
|
|
6
7
|
// ── Upgrade safety check ────────────────────────────────────────────────────
|
|
7
|
-
|
|
8
|
-
const currentVersion: string = (
|
|
8
|
+
const _require = createRequire(import.meta.url);
|
|
9
|
+
const currentVersion: string = (_require("../package.json") as { version: string }).version;
|
|
9
10
|
|
|
10
11
|
function checkUpgrade(): void {
|
|
11
12
|
if (!configExists()) return;
|
|
@@ -52,10 +53,10 @@ if (printMode) {
|
|
|
52
53
|
console.error(e instanceof Error ? e.message : String(e));
|
|
53
54
|
process.exit(1);
|
|
54
55
|
});
|
|
55
|
-
} else if (process.stdout.isTTY && !hasSubcommand && process.argv.length <= 2) {
|
|
56
|
+
} else if (process.stdout.isTTY && !hasSubcommand && process.argv.length <= 2 && !process.env.ARC402_NO_TUI) {
|
|
56
57
|
// TTY with no subcommand — launch Ink TUI
|
|
57
58
|
checkUpgrade();
|
|
58
|
-
void import("./tui/index").then(({ launchTUI }) => launchTUI()).catch((e: unknown) => {
|
|
59
|
+
void import("./tui/index.js").then(({ launchTUI }) => launchTUI()).catch((e: unknown) => {
|
|
59
60
|
console.error("TUI failed to start:", e instanceof Error ? e.message : String(e));
|
|
60
61
|
// Fallback to REPL
|
|
61
62
|
void startREPL();
|
package/src/openshell-runtime.ts
CHANGED
|
@@ -3,7 +3,11 @@ import * as os from "os";
|
|
|
3
3
|
import * as path from "path";
|
|
4
4
|
import { spawnSync } from "child_process";
|
|
5
5
|
import { parse as parseToml } from "smol-toml";
|
|
6
|
-
import { loadConfig } from "./config";
|
|
6
|
+
import { loadConfig } from "./config.js";
|
|
7
|
+
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
7
11
|
|
|
8
12
|
export const ARC402_DIR = path.join(os.homedir(), ".arc402");
|
|
9
13
|
export const OPENSHELL_TOML = path.join(ARC402_DIR, "openshell.toml");
|
package/src/program.ts
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
1
2
|
import { Command } from "commander";
|
|
2
|
-
import { registerAcceptCommand } from "./commands/accept";
|
|
3
|
-
import { registerAgentCommands } from "./commands/agent";
|
|
4
|
-
import { registerAgreementsCommands } from "./commands/agreements";
|
|
5
|
-
import { registerArbitratorCommand } from "./commands/arbitrator";
|
|
6
|
-
import { registerCancelCommand } from "./commands/cancel";
|
|
7
|
-
import { registerChannelCommands } from "./commands/channel";
|
|
8
|
-
import { registerConfigCommands } from "./commands/config";
|
|
9
|
-
import { registerDeliverCommand } from "./commands/deliver";
|
|
10
|
-
import { registerDiscoverCommand } from "./commands/discover";
|
|
11
|
-
import { registerEndpointCommands } from "./commands/endpoint";
|
|
12
|
-
import { registerDisputeCommand } from "./commands/dispute";
|
|
13
|
-
import { registerHireCommand } from "./commands/hire";
|
|
14
|
-
import { registerHandshakeCommand } from "./commands/agent-handshake";
|
|
15
|
-
import { registerNegotiateCommands } from "./commands/negotiate";
|
|
16
|
-
import { registerRelayCommands } from "./commands/relay";
|
|
17
|
-
import { registerRemediateCommands } from "./commands/remediate";
|
|
18
|
-
import { registerDaemonCommands } from "./commands/daemon";
|
|
19
|
-
import { registerOpenShellCommands } from "./commands/openshell";
|
|
20
|
-
import { registerWorkroomCommands } from "./commands/workroom";
|
|
21
|
-
import { registerArenaHandshakeCommands } from "./commands/arena-handshake";
|
|
22
|
-
import { registerTrustCommand } from "./commands/trust";
|
|
23
|
-
import { registerWalletCommands } from "./commands/wallet";
|
|
24
|
-
import { registerOwnerCommands } from "./commands/owner";
|
|
25
|
-
import { registerSetupCommands } from "./commands/setup";
|
|
26
|
-
import { registerVerifyCommand } from "./commands/verify";
|
|
27
|
-
import { registerContractInteractionCommands } from "./commands/contract-interaction";
|
|
28
|
-
import { registerWatchtowerCommands } from "./commands/watchtower";
|
|
29
|
-
import { registerColdStartCommands } from "./commands/coldstart";
|
|
30
|
-
import { registerDoctorCommand } from "./commands/doctor";
|
|
31
|
-
import { registerMigrateCommands } from "./commands/migrate";
|
|
32
|
-
import { registerFeedCommand } from "./commands/feed";
|
|
33
|
-
import { registerArenaCommands } from "./commands/arena";
|
|
34
|
-
import { registerWatchCommand } from "./commands/watch";
|
|
35
|
-
import { registerBackupCommand } from "./commands/backup";
|
|
3
|
+
import { registerAcceptCommand } from "./commands/accept.js";
|
|
4
|
+
import { registerAgentCommands } from "./commands/agent.js";
|
|
5
|
+
import { registerAgreementsCommands } from "./commands/agreements.js";
|
|
6
|
+
import { registerArbitratorCommand } from "./commands/arbitrator.js";
|
|
7
|
+
import { registerCancelCommand } from "./commands/cancel.js";
|
|
8
|
+
import { registerChannelCommands } from "./commands/channel.js";
|
|
9
|
+
import { registerConfigCommands } from "./commands/config.js";
|
|
10
|
+
import { registerDeliverCommand } from "./commands/deliver.js";
|
|
11
|
+
import { registerDiscoverCommand } from "./commands/discover.js";
|
|
12
|
+
import { registerEndpointCommands } from "./commands/endpoint.js";
|
|
13
|
+
import { registerDisputeCommand } from "./commands/dispute.js";
|
|
14
|
+
import { registerHireCommand } from "./commands/hire.js";
|
|
15
|
+
import { registerHandshakeCommand } from "./commands/agent-handshake.js";
|
|
16
|
+
import { registerNegotiateCommands } from "./commands/negotiate.js";
|
|
17
|
+
import { registerRelayCommands } from "./commands/relay.js";
|
|
18
|
+
import { registerRemediateCommands } from "./commands/remediate.js";
|
|
19
|
+
import { registerDaemonCommands } from "./commands/daemon.js";
|
|
20
|
+
import { registerOpenShellCommands } from "./commands/openshell.js";
|
|
21
|
+
import { registerWorkroomCommands } from "./commands/workroom.js";
|
|
22
|
+
import { registerArenaHandshakeCommands } from "./commands/arena-handshake.js";
|
|
23
|
+
import { registerTrustCommand } from "./commands/trust.js";
|
|
24
|
+
import { registerWalletCommands } from "./commands/wallet.js";
|
|
25
|
+
import { registerOwnerCommands } from "./commands/owner.js";
|
|
26
|
+
import { registerSetupCommands } from "./commands/setup.js";
|
|
27
|
+
import { registerVerifyCommand } from "./commands/verify.js";
|
|
28
|
+
import { registerContractInteractionCommands } from "./commands/contract-interaction.js";
|
|
29
|
+
import { registerWatchtowerCommands } from "./commands/watchtower.js";
|
|
30
|
+
import { registerColdStartCommands } from "./commands/coldstart.js";
|
|
31
|
+
import { registerDoctorCommand } from "./commands/doctor.js";
|
|
32
|
+
import { registerMigrateCommands } from "./commands/migrate.js";
|
|
33
|
+
import { registerFeedCommand } from "./commands/feed.js";
|
|
34
|
+
import { registerArenaCommands } from "./commands/arena.js";
|
|
35
|
+
import { registerWatchCommand } from "./commands/watch.js";
|
|
36
|
+
import { registerBackupCommand } from "./commands/backup.js";
|
|
36
37
|
import reputation from "./commands/reputation.js";
|
|
37
38
|
import policy from "./commands/policy.js";
|
|
38
39
|
|
|
@@ -43,8 +44,7 @@ export function createProgram(): Command {
|
|
|
43
44
|
.description(
|
|
44
45
|
"ARC-402 CLI aligned to canonical-capability discovery → negotiate → hire → remediate → dispute workflow"
|
|
45
46
|
)
|
|
46
|
-
|
|
47
|
-
.version((require("../package.json") as { version: string }).version);
|
|
47
|
+
.version((createRequire(import.meta.url)("../package.json") as { version: string }).version);
|
|
48
48
|
|
|
49
49
|
registerConfigCommands(program);
|
|
50
50
|
registerHandshakeCommand(program);
|
package/src/repl.ts
CHANGED
|
@@ -3,9 +3,9 @@ import fs from "fs";
|
|
|
3
3
|
import path from "path";
|
|
4
4
|
import os from "os";
|
|
5
5
|
import readline from "readline";
|
|
6
|
-
import { createProgram } from "./program";
|
|
7
|
-
import { getBannerLines, BannerConfig } from "./ui/banner";
|
|
8
|
-
import { c } from "./ui/colors";
|
|
6
|
+
import { createProgram } from "./program.js";
|
|
7
|
+
import { getBannerLines, BannerConfig } from "./ui/banner.js";
|
|
8
|
+
import { c } from "./ui/colors.js";
|
|
9
9
|
|
|
10
10
|
// ─── Config helpers ────────────────────────────────────────────────────────────
|
|
11
11
|
|
package/src/tui/App.tsx
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import React, { useState, useCallback, useEffect } from "react";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
2
3
|
import { Box, Text, useApp } from "ink";
|
|
3
|
-
import { Header } from "./Header";
|
|
4
|
-
import { Viewport } from "./Viewport";
|
|
5
|
-
import { Footer } from "./Footer";
|
|
6
|
-
import { InputLine } from "./InputLine";
|
|
7
|
-
import { useCommand } from "./useCommand";
|
|
8
|
-
import { useChat } from "./useChat";
|
|
9
|
-
import { useScroll } from "./useScroll";
|
|
10
|
-
import { createProgram } from "../program";
|
|
4
|
+
import { Header } from "./Header.js";
|
|
5
|
+
import { Viewport } from "./Viewport.js";
|
|
6
|
+
import { Footer } from "./Footer.js";
|
|
7
|
+
import { InputLine } from "./InputLine.js";
|
|
8
|
+
import { useCommand } from "./useCommand.js";
|
|
9
|
+
import { useChat } from "./useChat.js";
|
|
10
|
+
import { useScroll } from "./useScroll.js";
|
|
11
|
+
import { createProgram } from "../program.js";
|
|
11
12
|
import chalk from "chalk";
|
|
12
13
|
|
|
13
|
-
|
|
14
|
-
const pkg = require("../../package.json") as { version: string };
|
|
14
|
+
const pkg = createRequire(import.meta.url)("../../package.json") as { version: string };
|
|
15
15
|
|
|
16
16
|
const BUILTIN_CMDS = ["help", "exit", "quit", "clear", "status"];
|
|
17
17
|
|
|
@@ -205,6 +205,11 @@ export function App({ version, network, wallet, balance }: AppProps) {
|
|
|
205
205
|
isAutoScroll={isAutoScroll}
|
|
206
206
|
/>
|
|
207
207
|
|
|
208
|
+
{/* Bottom separator */}
|
|
209
|
+
<Box>
|
|
210
|
+
<Text dimColor>{"─".repeat(60)}</Text>
|
|
211
|
+
</Box>
|
|
212
|
+
|
|
208
213
|
{/* FOOTER — fixed, input pinned */}
|
|
209
214
|
<Footer>
|
|
210
215
|
<InputLine onSubmit={handleCommand} isDisabled={isDisabled} />
|