actoviq-agent-sdk 0.4.21 → 0.4.22
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-zh.md +50 -113
- package/README.md +51 -164
- package/assets/hadamard-icon.ico +0 -0
- package/assets/hadamard-icon.png +0 -0
- package/bin/hadamard-gui.js +31 -12
- package/dist/src/codeIntel/codeIntelligenceService.d.ts +16 -0
- package/dist/src/codeIntel/codeIntelligenceService.d.ts.map +1 -1
- package/dist/src/codeIntel/codeIntelligenceService.js +87 -2
- package/dist/src/codeIntel/codeIntelligenceService.js.map +1 -1
- package/dist/src/codeIntel/codeIntelligenceTools.d.ts.map +1 -1
- package/dist/src/codeIntel/codeIntelligenceTools.js +6 -0
- package/dist/src/codeIntel/codeIntelligenceTools.js.map +1 -1
- package/dist/src/codeIntel/index.d.ts +1 -0
- package/dist/src/codeIntel/index.d.ts.map +1 -1
- package/dist/src/codeIntel/index.js +1 -0
- package/dist/src/codeIntel/index.js.map +1 -1
- package/dist/src/codeIntel/languageServerPresets.d.ts +13 -0
- package/dist/src/codeIntel/languageServerPresets.d.ts.map +1 -0
- package/dist/src/codeIntel/languageServerPresets.js +51 -0
- package/dist/src/codeIntel/languageServerPresets.js.map +1 -0
- package/dist/src/codeIntel/languageServerRegistry.d.ts +1 -0
- package/dist/src/codeIntel/languageServerRegistry.d.ts.map +1 -1
- package/dist/src/codeIntel/languageServerRegistry.js +2 -2
- package/dist/src/codeIntel/languageServerRegistry.js.map +1 -1
- package/dist/src/config/resolveRuntimeConfig.d.ts.map +1 -1
- package/dist/src/config/resolveRuntimeConfig.js +5 -0
- package/dist/src/config/resolveRuntimeConfig.js.map +1 -1
- package/dist/src/extensions/builtInExtensions.d.ts +61 -0
- package/dist/src/extensions/builtInExtensions.d.ts.map +1 -0
- package/dist/src/extensions/builtInExtensions.js +218 -0
- package/dist/src/extensions/builtInExtensions.js.map +1 -0
- package/dist/src/extensions/filterOutputPolicy.d.ts +21 -0
- package/dist/src/extensions/filterOutputPolicy.d.ts.map +1 -0
- package/dist/src/extensions/filterOutputPolicy.js +121 -0
- package/dist/src/extensions/filterOutputPolicy.js.map +1 -0
- package/dist/src/extensions/securityPolicy.d.ts +27 -0
- package/dist/src/extensions/securityPolicy.d.ts.map +1 -0
- package/dist/src/extensions/securityPolicy.js +238 -0
- package/dist/src/extensions/securityPolicy.js.map +1 -0
- package/dist/src/extensions/sessionCostTracker.d.ts +63 -0
- package/dist/src/extensions/sessionCostTracker.d.ts.map +1 -0
- package/dist/src/extensions/sessionCostTracker.js +213 -0
- package/dist/src/extensions/sessionCostTracker.js.map +1 -0
- package/dist/src/extensions/taskNotifications.d.ts +31 -0
- package/dist/src/extensions/taskNotifications.d.ts.map +1 -0
- package/dist/src/extensions/taskNotifications.js +50 -0
- package/dist/src/extensions/taskNotifications.js.map +1 -0
- package/dist/src/extensions/usageBar.d.ts +35 -0
- package/dist/src/extensions/usageBar.d.ts.map +1 -0
- package/dist/src/extensions/usageBar.js +67 -0
- package/dist/src/extensions/usageBar.js.map +1 -0
- package/dist/src/gui/contextRailStore.d.ts +13 -0
- package/dist/src/gui/contextRailStore.d.ts.map +1 -1
- package/dist/src/gui/contextRailStore.js +16 -0
- package/dist/src/gui/contextRailStore.js.map +1 -1
- package/dist/src/gui/electronMain.js +45 -5
- package/dist/src/gui/electronMain.js.map +1 -1
- package/dist/src/gui/guiDesignClientScript.d.ts.map +1 -1
- package/dist/src/gui/guiDesignClientScript.js +31 -0
- package/dist/src/gui/guiDesignClientScript.js.map +1 -1
- package/dist/src/gui/guiUsageRoutingAssets.d.ts +7 -0
- package/dist/src/gui/guiUsageRoutingAssets.d.ts.map +1 -0
- package/dist/src/gui/guiUsageRoutingAssets.js +509 -0
- package/dist/src/gui/guiUsageRoutingAssets.js.map +1 -0
- package/dist/src/gui/guiUsageRoutingHttpController.d.ts +11 -0
- package/dist/src/gui/guiUsageRoutingHttpController.d.ts.map +1 -0
- package/dist/src/gui/guiUsageRoutingHttpController.js +125 -0
- package/dist/src/gui/guiUsageRoutingHttpController.js.map +1 -0
- package/dist/src/gui/guiUsageRoutingRuntime.d.ts +36 -0
- package/dist/src/gui/guiUsageRoutingRuntime.d.ts.map +1 -0
- package/dist/src/gui/guiUsageRoutingRuntime.js +98 -0
- package/dist/src/gui/guiUsageRoutingRuntime.js.map +1 -0
- package/dist/src/gui/hadamardGui.d.ts +5 -0
- package/dist/src/gui/hadamardGui.d.ts.map +1 -1
- package/dist/src/gui/hadamardGui.js +159 -16
- package/dist/src/gui/hadamardGui.js.map +1 -1
- package/dist/src/gui/hadamardGuiAssets.d.ts.map +1 -1
- package/dist/src/gui/hadamardGuiAssets.js +297 -41
- package/dist/src/gui/hadamardGuiAssets.js.map +1 -1
- package/dist/src/index.d.ts +32 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +16 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/keyway/electronSecretStore.d.ts +37 -0
- package/dist/src/keyway/electronSecretStore.d.ts.map +1 -0
- package/dist/src/keyway/electronSecretStore.js +105 -0
- package/dist/src/keyway/electronSecretStore.js.map +1 -0
- package/dist/src/keyway/embeddedKeyway.d.ts +34 -0
- package/dist/src/keyway/embeddedKeyway.d.ts.map +1 -0
- package/dist/src/keyway/embeddedKeyway.js +81 -0
- package/dist/src/keyway/embeddedKeyway.js.map +1 -0
- package/dist/src/keyway/keywayLoopbackGateway.d.ts +30 -0
- package/dist/src/keyway/keywayLoopbackGateway.d.ts.map +1 -0
- package/dist/src/keyway/keywayLoopbackGateway.js +71 -0
- package/dist/src/keyway/keywayLoopbackGateway.js.map +1 -0
- package/dist/src/keyway/keywayMigrationService.d.ts +44 -0
- package/dist/src/keyway/keywayMigrationService.d.ts.map +1 -0
- package/dist/src/keyway/keywayMigrationService.js +219 -0
- package/dist/src/keyway/keywayMigrationService.js.map +1 -0
- package/dist/src/keyway/keywayModelApi.d.ts +24 -0
- package/dist/src/keyway/keywayModelApi.d.ts.map +1 -0
- package/dist/src/keyway/keywayModelApi.js +106 -0
- package/dist/src/keyway/keywayModelApi.js.map +1 -0
- package/dist/src/keyway/keywayPorts.d.ts +189 -0
- package/dist/src/keyway/keywayPorts.d.ts.map +1 -0
- package/dist/src/keyway/keywayPorts.js +2 -0
- package/dist/src/keyway/keywayPorts.js.map +1 -0
- package/dist/src/keyway/keywayProviderExecutor.d.ts +30 -0
- package/dist/src/keyway/keywayProviderExecutor.d.ts.map +1 -0
- package/dist/src/keyway/keywayProviderExecutor.js +257 -0
- package/dist/src/keyway/keywayProviderExecutor.js.map +1 -0
- package/dist/src/keyway/routingComposition.d.ts +18 -0
- package/dist/src/keyway/routingComposition.d.ts.map +1 -0
- package/dist/src/keyway/routingComposition.js +19 -0
- package/dist/src/keyway/routingComposition.js.map +1 -0
- package/dist/src/keyway/usageRoutingAdminService.d.ts +86 -0
- package/dist/src/keyway/usageRoutingAdminService.d.ts.map +1 -0
- package/dist/src/keyway/usageRoutingAdminService.js +384 -0
- package/dist/src/keyway/usageRoutingAdminService.js.map +1 -0
- package/dist/src/nativeCli/crushManagedClient.d.ts +84 -0
- package/dist/src/nativeCli/crushManagedClient.d.ts.map +1 -0
- package/dist/src/nativeCli/crushManagedClient.js +978 -0
- package/dist/src/nativeCli/crushManagedClient.js.map +1 -0
- package/dist/src/nativeCli/crushNativeCliClient.d.ts +19 -0
- package/dist/src/nativeCli/crushNativeCliClient.d.ts.map +1 -0
- package/dist/src/nativeCli/crushNativeCliClient.js +243 -0
- package/dist/src/nativeCli/crushNativeCliClient.js.map +1 -0
- package/dist/src/nativeCli/keywayNativeCliAdapter.d.ts +31 -0
- package/dist/src/nativeCli/keywayNativeCliAdapter.d.ts.map +1 -0
- package/dist/src/nativeCli/keywayNativeCliAdapter.js +35 -0
- package/dist/src/nativeCli/keywayNativeCliAdapter.js.map +1 -0
- package/dist/src/nativeCli/nativeCliAuth.d.ts +24 -0
- package/dist/src/nativeCli/nativeCliAuth.d.ts.map +1 -0
- package/dist/src/nativeCli/nativeCliAuth.js +327 -0
- package/dist/src/nativeCli/nativeCliAuth.js.map +1 -0
- package/dist/src/nativeCli/nativeCliClient.d.ts +16 -0
- package/dist/src/nativeCli/nativeCliClient.d.ts.map +1 -0
- package/dist/src/nativeCli/nativeCliClient.js +575 -0
- package/dist/src/nativeCli/nativeCliClient.js.map +1 -0
- package/dist/src/nativeCli/nativeCliCodewhaleProtocol.d.ts +18 -0
- package/dist/src/nativeCli/nativeCliCodewhaleProtocol.d.ts.map +1 -0
- package/dist/src/nativeCli/nativeCliCodewhaleProtocol.js +376 -0
- package/dist/src/nativeCli/nativeCliCodewhaleProtocol.js.map +1 -0
- package/dist/src/nativeCli/nativeCliContracts.d.ts +22 -0
- package/dist/src/nativeCli/nativeCliContracts.d.ts.map +1 -0
- package/dist/src/nativeCli/nativeCliContracts.js +2 -0
- package/dist/src/nativeCli/nativeCliContracts.js.map +1 -0
- package/dist/src/nativeCli/nativeCliCursorProtocol.d.ts +7 -0
- package/dist/src/nativeCli/nativeCliCursorProtocol.d.ts.map +1 -0
- package/dist/src/nativeCli/nativeCliCursorProtocol.js +210 -0
- package/dist/src/nativeCli/nativeCliCursorProtocol.js.map +1 -0
- package/dist/src/nativeCli/nativeCliEnvironment.d.ts +3 -0
- package/dist/src/nativeCli/nativeCliEnvironment.d.ts.map +1 -0
- package/dist/src/nativeCli/nativeCliEnvironment.js +17 -0
- package/dist/src/nativeCli/nativeCliEnvironment.js.map +1 -0
- package/dist/src/nativeCli/nativeCliExecResolver.d.ts +26 -0
- package/dist/src/nativeCli/nativeCliExecResolver.d.ts.map +1 -0
- package/dist/src/nativeCli/nativeCliExecResolver.js +152 -0
- package/dist/src/nativeCli/nativeCliExecResolver.js.map +1 -0
- package/dist/src/nativeCli/nativeCliPiProtocol.d.ts +15 -0
- package/dist/src/nativeCli/nativeCliPiProtocol.d.ts.map +1 -0
- package/dist/src/nativeCli/nativeCliPiProtocol.js +329 -0
- package/dist/src/nativeCli/nativeCliPiProtocol.js.map +1 -0
- package/dist/src/nativeCli/nativeCliProcessTree.d.ts +3 -0
- package/dist/src/nativeCli/nativeCliProcessTree.d.ts.map +1 -0
- package/dist/src/nativeCli/nativeCliProcessTree.js +104 -0
- package/dist/src/nativeCli/nativeCliProcessTree.js.map +1 -0
- package/dist/src/nativeCli/reasonixAcpSession.d.ts +35 -0
- package/dist/src/nativeCli/reasonixAcpSession.d.ts.map +1 -0
- package/dist/src/nativeCli/reasonixAcpSession.js +472 -0
- package/dist/src/nativeCli/reasonixAcpSession.js.map +1 -0
- package/dist/src/nativeCli/reasonixManagedClient.d.ts +56 -0
- package/dist/src/nativeCli/reasonixManagedClient.d.ts.map +1 -0
- package/dist/src/nativeCli/reasonixManagedClient.js +293 -0
- package/dist/src/nativeCli/reasonixManagedClient.js.map +1 -0
- package/dist/src/nativeCli/reasonixNativeCliClient.d.ts +20 -0
- package/dist/src/nativeCli/reasonixNativeCliClient.d.ts.map +1 -0
- package/dist/src/nativeCli/reasonixNativeCliClient.js +317 -0
- package/dist/src/nativeCli/reasonixNativeCliClient.js.map +1 -0
- package/dist/src/parity/bridgeExecResolver.d.ts +2 -25
- package/dist/src/parity/bridgeExecResolver.d.ts.map +1 -1
- package/dist/src/parity/bridgeExecResolver.js +2 -151
- package/dist/src/parity/bridgeExecResolver.js.map +1 -1
- package/dist/src/parity/bridgeProcessTree.d.ts +2 -2
- package/dist/src/parity/bridgeProcessTree.d.ts.map +1 -1
- package/dist/src/parity/bridgeProcessTree.js +2 -82
- package/dist/src/parity/bridgeProcessTree.js.map +1 -1
- package/dist/src/parity/crushManagedClient.d.ts +2 -83
- package/dist/src/parity/crushManagedClient.d.ts.map +1 -1
- package/dist/src/parity/crushManagedClient.js +2 -977
- package/dist/src/parity/crushManagedClient.js.map +1 -1
- package/dist/src/parity/externalCliAuth.d.ts +2 -22
- package/dist/src/parity/externalCliAuth.d.ts.map +1 -1
- package/dist/src/parity/externalCliAuth.js +2 -295
- package/dist/src/parity/externalCliAuth.js.map +1 -1
- package/dist/src/parity/hadamardBridgeSdk.d.ts.map +1 -1
- package/dist/src/parity/hadamardBridgeSdk.js +14 -1
- package/dist/src/parity/hadamardBridgeSdk.js.map +1 -1
- package/dist/src/parity/nativeCliBridgeAdapter.d.ts +6 -0
- package/dist/src/parity/nativeCliBridgeAdapter.d.ts.map +1 -0
- package/dist/src/parity/nativeCliBridgeAdapter.js +38 -0
- package/dist/src/parity/nativeCliBridgeAdapter.js.map +1 -0
- package/dist/src/parity/reasonixAcpSession.d.ts +2 -34
- package/dist/src/parity/reasonixAcpSession.d.ts.map +1 -1
- package/dist/src/parity/reasonixAcpSession.js +2 -471
- package/dist/src/parity/reasonixAcpSession.js.map +1 -1
- package/dist/src/parity/reasonixManagedClient.d.ts +2 -55
- package/dist/src/parity/reasonixManagedClient.d.ts.map +1 -1
- package/dist/src/parity/reasonixManagedClient.js +2 -292
- package/dist/src/parity/reasonixManagedClient.js.map +1 -1
- package/dist/src/provider/openai-client.js +2 -2
- package/dist/src/provider/openai-client.js.map +1 -1
- package/dist/src/provider/openai-model-api.d.ts.map +1 -1
- package/dist/src/provider/openai-model-api.js +5 -1
- package/dist/src/provider/openai-model-api.js.map +1 -1
- package/dist/src/runtime/agentClient.d.ts +14 -1
- package/dist/src/runtime/agentClient.d.ts.map +1 -1
- package/dist/src/runtime/agentClient.js +60 -6
- package/dist/src/runtime/agentClient.js.map +1 -1
- package/dist/src/runtime/toolPolicyPipeline.d.ts +32 -1
- package/dist/src/runtime/toolPolicyPipeline.d.ts.map +1 -1
- package/dist/src/runtime/toolPolicyPipeline.js +43 -3
- package/dist/src/runtime/toolPolicyPipeline.js.map +1 -1
- package/dist/src/tui/hadamardTuiController.d.ts.map +1 -1
- package/dist/src/tui/hadamardTuiController.js +62 -8
- package/dist/src/tui/hadamardTuiController.js.map +1 -1
- package/dist/src/tui/tuiBasicCommandHandler.d.ts +4 -0
- package/dist/src/tui/tuiBasicCommandHandler.d.ts.map +1 -1
- package/dist/src/tui/tuiBasicCommandHandler.js +23 -2
- package/dist/src/tui/tuiBasicCommandHandler.js.map +1 -1
- package/dist/src/tui/tuiCatalogCommandHandler.d.ts +2 -0
- package/dist/src/tui/tuiCatalogCommandHandler.d.ts.map +1 -1
- package/dist/src/tui/tuiCatalogCommandHandler.js +10 -1
- package/dist/src/tui/tuiCatalogCommandHandler.js.map +1 -1
- package/dist/src/tui/tuiUsageRoutingRuntime.d.ts +22 -0
- package/dist/src/tui/tuiUsageRoutingRuntime.d.ts.map +1 -0
- package/dist/src/tui/tuiUsageRoutingRuntime.js +81 -0
- package/dist/src/tui/tuiUsageRoutingRuntime.js.map +1 -0
- package/dist/src/types.d.ts +16 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/src/ui/commandSurface.d.ts.map +1 -1
- package/dist/src/ui/commandSurface.js +45 -1
- package/dist/src/ui/commandSurface.js.map +1 -1
- package/dist/src/ui/extensionsCommandView.d.ts +18 -0
- package/dist/src/ui/extensionsCommandView.d.ts.map +1 -0
- package/dist/src/ui/extensionsCommandView.js +82 -0
- package/dist/src/ui/extensionsCommandView.js.map +1 -0
- package/dist/src/ui/lspCommandView.d.ts +17 -0
- package/dist/src/ui/lspCommandView.d.ts.map +1 -0
- package/dist/src/ui/lspCommandView.js +25 -0
- package/dist/src/ui/lspCommandView.js.map +1 -0
- package/dist/src/ui/usageRoutingCommand.d.ts +13 -0
- package/dist/src/ui/usageRoutingCommand.d.ts.map +1 -0
- package/dist/src/ui/usageRoutingCommand.js +224 -0
- package/dist/src/ui/usageRoutingCommand.js.map +1 -0
- package/dist/src/usage/budgetService.d.ts +28 -0
- package/dist/src/usage/budgetService.d.ts.map +1 -0
- package/dist/src/usage/budgetService.js +50 -0
- package/dist/src/usage/budgetService.js.map +1 -0
- package/dist/src/usage/contracts.d.ts +149 -0
- package/dist/src/usage/contracts.d.ts.map +1 -0
- package/dist/src/usage/contracts.js +2 -0
- package/dist/src/usage/contracts.js.map +1 -0
- package/dist/src/usage/index.d.ts +7 -0
- package/dist/src/usage/index.d.ts.map +1 -0
- package/dist/src/usage/index.js +4 -0
- package/dist/src/usage/index.js.map +1 -0
- package/dist/src/usage/usageLedger.d.ts +19 -0
- package/dist/src/usage/usageLedger.d.ts.map +1 -0
- package/dist/src/usage/usageLedger.js +389 -0
- package/dist/src/usage/usageLedger.js.map +1 -0
- package/dist/src/usage/usageQueryService.d.ts +12 -0
- package/dist/src/usage/usageQueryService.d.ts.map +1 -0
- package/dist/src/usage/usageQueryService.js +29 -0
- package/dist/src/usage/usageQueryService.js.map +1 -0
- package/package.json +14 -2
- package/scripts/prepare-gui-launcher.mjs +62 -0
package/README-zh.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Hadamard Agent
|
|
1
|
+
# Hadamard:让 Agent 像工程团队一样协作
|
|
2
2
|
|
|
3
3
|
[](https://github.com/DeconBear/hadamard/actions/workflows/ci.yml)
|
|
4
4
|
[](https://github.com/DeconBear/hadamard/actions/workflows/publish-npm.yml)
|
|
@@ -7,159 +7,96 @@
|
|
|
7
7
|
|
|
8
8
|
[English](./README.md) | [中文](./README-zh.md)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
如今的 LLM harness 越来越强,但在真实的工程与科研任务上仍难以管理——交付软件、跑 AI4S 流程、训练神经网络与调参实验。上下文溢出、工具调用失控、运行偏离预期,而单个 agent 闭环永远缺少第二意见。
|
|
11
11
|
|
|
12
|
-
**Hadamard
|
|
13
|
-
|
|
14
|
-
> **包名说明:** npm 发布名仍为 [`actoviq-agent-sdk`](https://www.npmjs.com/package/actoviq-agent-sdk)。产品、仓库、CLI 与配置路径统一为 **Hadamard**(`hadamard-*`、`~/.hadamard`、`.hadamard/`)。
|
|
15
|
-
|
|
16
|
-
> **说明:** 桌面端 **Agent graph** 编排 UI(可视化团队 / 图编辑器)**仍在持续迭代与优化中**,交互与行为可能变化。生产工作流请优先使用 `/team`、已保存的 team 定义,以及 SDK 的 `createTeam()` / graph runtime。详见 `CHANGELOG.md`。
|
|
12
|
+
**Hadamard** 的目标是让 Agent 的工程与科研变得可控:引入不同 provider 的多个 agent 相互交流,并行调查、评审与分派,把问题考虑得更加周全。同一套 TypeScript runtime 提供工具、skills、持久会话、记忆与 MCP,并能通过 bridge 把已安装的 agent CLI(Claude Code、Codex、Cursor、Pi、CodeWhale、Reasonix、Crush)作为子进程管理;终端 UI 与桌面 GUI 也构建在这套 runtime 之上。
|
|
17
13
|
|
|
18
14
|
受 Claude Code、Codex、Deepagents 等项目启发。Hadamard 保持独立,拥有自己的公开 API 与文档。
|
|
19
15
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- **Model Team** — `panel-analysis`(并行调查 + 收敛)和 `reviewer`(只报告可验证问题的审计者)。runtime-owned 成员池、流式 `TeamEvent`、成员 provider 配置,以及继承的权限/重试边界。
|
|
29
|
-
- **Model Router / Leader-Dispatch** — 每轮由 leader 分派到最佳 specialist(任意模型/提供商),执行者自身也可召集 team。Profile 位于 `~/.hadamard/routers/`。
|
|
30
|
-
- **Dynamic Workflows** — 显式信任等级的 JS 编排:trusted 兼容执行、隔离 local-process,或由 host 提供的远程/container 强 sandbox;local process 不宣传为对抗性多租户沙箱。
|
|
31
|
-
- **Bridge(命名运行时配置)** — 可选 `Direct API` 做 provider/API 级复用,也可选 `External CLI` 直接启动已安装的 Claude Code、Codex、Pi、CodeWhale、Reasonix 或 Crush,继承各 CLI 的原生登录和配置、流式显示规范化后的工具与回答事件、终止后台任务,并浏览/恢复受支持的原生会话。单独填写的 key 只注入子进程,不写入 CLI 的凭据库;Pi、CodeWhale、Reasonix 与 Crush 会使用按配置隔离的持久会话目录,因此 key 模式重启后仍可读取历史,同时不会读取原生登录凭据。
|
|
32
|
-
- **桌面 GUI (`hadamard-gui`)** — Electron 聊天 UI:流式 transcript、对话历史、命令面板、设置、每工具权限提示。安全增强。全局 **Assistant** FAB(Global/Project 作用域)。可视化 **Agent graph** 编排 UI 仍在迭代中,暂勿当作稳定产品面。
|
|
33
|
-
- **TUI (`hadamard-tui`)** — 终端 UI,25+ 斜杠命令,Claude Code 风格 UX:`/team`、`/bridge`、`/plan`、`/hooks`、`/mcp`、`/review`、`/context`、`/cost`、`/doctor` 等。实时状态旋转器、滚动 transcript、todo 面板、项目/用户级权限对话框、子命令自动补全。
|
|
34
|
-
- **计划模式 + hooks** — `EnterPlanMode`/`ExitPlanMode` 工具 + 计划文件;`settings.json` 中的 `PreToolUse`/`PostToolUse`/`SessionStart` hooks。
|
|
35
|
-
- **Worktree 工具** — `EnterWorktree`/`ExitWorktree`,栈式 cwd,`.worktreeinclude`,PR checkout。
|
|
36
|
-
- **TavilySearch** — AI 优化网络搜索,纯 TypeScript。
|
|
37
|
-
- **Standard Benchmark** — 自包含框架,DeepSeek judge,HTML dashboard,4-agent 对比。
|
|
38
|
-
|
|
39
|
-
## 1.0 SDK 架构
|
|
40
|
-
|
|
41
|
-
- `core`:不可变 `AgentSpec`、canonical items、structured output、guardrail、usage 与 run error。
|
|
42
|
-
- `providers`:统一 `ModelProvider` contract,以及 capability-checked OpenAI Responses、OpenAI Chat-compatible、Anthropic adapter。
|
|
43
|
-
- `runtime`:单一 `AgentRuntime`、lazy `RuntimeServices`、固定阶段 middleware、tool/policy、有界 stream、checkpoint、interruption/resume。
|
|
44
|
-
- `node`:tenant-scoped SQLite session/checkpoint/memory/artifact store 与 backup-first JSON v1 migration。
|
|
45
|
-
- `events` / `surfaces`:版本化、可 trace 的 `RunEvent`,以及统一 CLI/TUI/GUI/Bridge 语义和 redaction。
|
|
46
|
-
- `orchestration` / `workflow` / `profiles`:agent-as-tool、handoff、durable spawn、graph/preset、workflow trust 与六类 profile。
|
|
47
|
-
- `compat`:0.x root façade 与迁移 adapter,在整个 1.x 保留。
|
|
48
|
-
|
|
49
|
-
## 路线图 — 迈向 agent team
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/gui-home.png" alt="Hadamard 桌面 GUI——项目总览" width="49%">
|
|
18
|
+
<img src="https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/gui-chat.png" alt="Hadamard 桌面 GUI——模型对话" width="49%">
|
|
19
|
+
</p>
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/tui-home.png" alt="Hadamard TUI——终端启动界面" width="90%">
|
|
22
|
+
</p>
|
|
23
|
+
<p align="center"><em>桌面 GUI(上:项目总览与对话界面)和终端 UI(下)。</em></p>
|
|
50
24
|
|
|
51
|
-
|
|
52
|
-
- **持久 team 记忆** — team 级上下文,跨会话和成员变更保留。
|
|
53
|
-
- **跨运行时会话延续** — 恢复 bridge 运行时会话时保留精确位置。
|
|
54
|
-
- **Model team IDE** — 可视化团队构建器、成员角色编辑器、团队健康仪表板。
|
|
25
|
+
> **包名说明:** npm 发布名为 [`actoviq-agent-sdk`](https://www.npmjs.com/package/actoviq-agent-sdk)。产品、仓库、CLI 与配置路径统一为 **Hadamard**(`hadamard-*`、`~/.hadamard`、`.hadamard/`)。
|
|
55
26
|
|
|
56
27
|
## 安装
|
|
57
28
|
|
|
58
|
-
要求 Node.js 22.13+ 或 Node.js 24。
|
|
59
|
-
因此不属于默认 Runtime 支持范围。
|
|
29
|
+
要求 Node.js 22.13+ 或 Node.js 24。
|
|
60
30
|
|
|
61
31
|
```bash
|
|
62
32
|
npm install actoviq-agent-sdk zod
|
|
63
33
|
```
|
|
64
34
|
|
|
65
|
-
|
|
35
|
+
上面的 `npm install` 面向 SDK 用法(`import 'actoviq-agent-sdk'`),命令行需通过 `npx` 调用(如 `npx hadamard-tui`)。若想让 `hadamard-tui` / `hadamard-gui` / `hadamard` / `actoviq` 直接出现在 PATH 上,请改用全局安装:
|
|
66
36
|
|
|
67
|
-
```
|
|
68
|
-
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g actoviq-agent-sdk
|
|
69
39
|
```
|
|
70
40
|
|
|
71
|
-
|
|
41
|
+
将提供商配置放在 `~/.hadamard/settings.json` —— 任意 Anthropic 兼容或 OpenAI 兼容的提供商均可。
|
|
42
|
+
|
|
43
|
+
## 快速开始
|
|
72
44
|
|
|
73
|
-
|
|
45
|
+
### SDK
|
|
74
46
|
|
|
75
47
|
```ts
|
|
76
|
-
import
|
|
77
|
-
import { ModelRegistry, OpenAIResponsesProvider } from 'actoviq-agent-sdk/providers';
|
|
78
|
-
import { AgentRuntime } from 'actoviq-agent-sdk/runtime';
|
|
79
|
-
|
|
80
|
-
const runtime = new AgentRuntime({
|
|
81
|
-
models: new ModelRegistry([
|
|
82
|
-
new OpenAIResponsesProvider({ apiKey: process.env.OPENAI_API_KEY }),
|
|
83
|
-
]),
|
|
84
|
-
});
|
|
85
|
-
const agent: AgentSpec = {
|
|
86
|
-
id: 'concise-chat',
|
|
87
|
-
name: 'Concise chat',
|
|
88
|
-
instructions: '请用一句话回答。',
|
|
89
|
-
model: 'openai-responses:gpt-4.1-mini',
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
try {
|
|
93
|
-
const result = await runtime.run(agent, '什么是 CAS?');
|
|
94
|
-
console.log(result.output, result.usage.totalTokens);
|
|
95
|
-
} finally {
|
|
96
|
-
await runtime.close();
|
|
97
|
-
}
|
|
98
|
-
```
|
|
48
|
+
import { createAgentSdk, loadDefaultHadamardSettings } from 'actoviq-agent-sdk';
|
|
99
49
|
|
|
100
|
-
|
|
50
|
+
await loadDefaultHadamardSettings(); // 读取 ~/.hadamard/settings.json
|
|
51
|
+
const sdk = await createAgentSdk();
|
|
101
52
|
|
|
102
|
-
|
|
53
|
+
const result = await sdk.run('什么是 CAS?');
|
|
54
|
+
console.log(result.text);
|
|
103
55
|
|
|
104
|
-
|
|
105
|
-
npm run example:hadamard-quickstart
|
|
106
|
-
npm run example:hadamard-agent-helpers
|
|
107
|
-
npm run example:profiles
|
|
56
|
+
await sdk.close();
|
|
108
57
|
```
|
|
109
58
|
|
|
110
|
-
|
|
59
|
+
在仓库内可用 `npm run example:hadamard-quickstart` 运行同样的示例。
|
|
111
60
|
|
|
112
|
-
|
|
61
|
+
### 终端 UI(`hadamard-tui`)
|
|
113
62
|
|
|
114
63
|
```bash
|
|
115
|
-
npx hadamard-tui [工作目录]
|
|
116
|
-
|
|
117
|
-
# 选项
|
|
118
|
-
# --config <路径> 加载指定的 Hadamard 设置 JSON 文件
|
|
119
|
-
# --permission-mode <模式> default | acceptEdits | plan | bypassPermissions (默认)
|
|
120
|
-
# --model <模型> 覆盖已配置的模型
|
|
121
|
-
# --resume <会话ID> 恢复已存储的 Hadamard SDK 会话
|
|
122
|
-
# --continue 继续最近更新的会话
|
|
64
|
+
npx hadamard-tui [工作目录]
|
|
123
65
|
```
|
|
124
66
|
|
|
125
|
-
|
|
67
|
+
输入消息并回车,即可在 Claude Code 风格的终端 REPL 中与 agent 对话。输入 `/` 打开斜杠命令菜单(`/team`、`/bridge`、`/plan`、`/mcp`、`/doctor`……)。常用参数:`--model`、`--permission-mode`、`--resume <会话ID>`、`--continue`。
|
|
126
68
|
|
|
127
|
-
|
|
69
|
+
### 桌面 GUI(`hadamard-gui`)
|
|
128
70
|
|
|
129
71
|
```bash
|
|
130
|
-
npx hadamard-gui [工作目录]
|
|
72
|
+
npx hadamard-gui [工作目录]
|
|
131
73
|
```
|
|
132
74
|
|
|
133
|
-
|
|
134
|
-
- **Agent graph 编排 UI**(GUI **Agent** 区域的可视化团队/图编辑器)**仍在持续迭代和优化中**,请勿当作已定稿产品面;稳定工作流请用已保存 team + `/team` / SDK API。
|
|
135
|
-
- Settings → Models & routing 可创建 Agent Profile,将 bridge config 与模型绑定。`/issues start <id> [agent-profile]` 会先让 Project Manager 生成任务书,再创建关联会话;执行 agent 通过 `IssueReport` 汇报待审或阻塞状态。
|
|
136
|
-
- Issue 与会话可双向跳转。Issue 默认保存在 `<data-root>/projects/<workspace-key>/issues.json`,也可切换到受保护的工作区文件 `.hadamard/issues.json`。
|
|
137
|
-
- Settings → General 可将完整数据根目录迁移到空目录:复制并校验数据、写入 bootstrap 指针、重建 SDK/session store,并保留旧目录供手动清理。
|
|
75
|
+
打开 Electron 聊天窗口(仅绑定 localhost 服务)—— 发送一条消息即可开始第一次对话。可视化 Agent graph 编辑器仍在迭代中;生产工作流请优先使用已保存的 team 与 `/team`。
|
|
138
76
|
|
|
139
|
-
|
|
77
|
+
## 演示
|
|
140
78
|
|
|
141
|
-
|
|
79
|
+
50 秒走一遍桌面 GUI:打开会话视图、新建对话、发送问题,观看流式回复、思考指示器与代码渲染。([高清 MP4](https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/gui-demo.mp4))
|
|
142
80
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
- **`CLAUDE.md` 在此仓库中默认 git-ignore**。
|
|
81
|
+
<p align="center">
|
|
82
|
+
<img src="https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/gui-demo.gif" alt="Hadamard 桌面 GUI 演示——从新建对话到流式回复与代码块" width="90%">
|
|
83
|
+
</p>
|
|
147
84
|
|
|
148
|
-
##
|
|
85
|
+
## 文档
|
|
149
86
|
|
|
150
|
-
-
|
|
151
|
-
- 中文教程:[docs/zh/README.md](./docs/zh/README.md)
|
|
152
|
-
-
|
|
87
|
+
- 文档站:https://deconbear.github.io/hadamard/
|
|
88
|
+
- 英文教程:[docs/en/README.md](./docs/en/README.md) · 中文教程:[docs/zh/README.md](./docs/zh/README.md)
|
|
89
|
+
- External CLI bridge 指南(provider 参数、凭证、`HADAMARD_<PROVIDER>_PATH`):[docs/en/05-bridge-runtime.md](./docs/en/05-bridge-runtime.md)
|
|
90
|
+
- 示例:[hadamard-quickstart.ts](./examples/hadamard-quickstart.ts)、[hadamard-workflow.ts](./examples/hadamard-workflow.ts)、[hadamard-agent-helpers.ts](./examples/hadamard-agent-helpers.ts)
|
|
91
|
+
- 安全政策:[SECURITY.md](./SECURITY.md)
|
|
153
92
|
|
|
154
|
-
|
|
155
|
-
- [examples/hadamard-quickstart.ts](./examples/hadamard-quickstart.ts)
|
|
156
|
-
- [examples/hadamard-workflow.ts](./examples/hadamard-workflow.ts)
|
|
157
|
-
- [examples/hadamard-agent-helpers.ts](./examples/hadamard-agent-helpers.ts)
|
|
158
|
-
- [examples/profiles/all-profiles.ts](./examples/profiles/all-profiles.ts)
|
|
93
|
+
## 开发
|
|
159
94
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
95
|
+
```bash
|
|
96
|
+
npm run typecheck # TypeScript 检查
|
|
97
|
+
npm test # Vitest 测试
|
|
98
|
+
npm run build # 清理 + 编译
|
|
99
|
+
```
|
|
163
100
|
|
|
164
101
|
## 参与贡献
|
|
165
102
|
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Hadamard
|
|
1
|
+
# Hadamard: Agents as an Engineering Team
|
|
2
2
|
|
|
3
3
|
[](https://github.com/DeconBear/hadamard/actions/workflows/ci.yml)
|
|
4
4
|
[](https://github.com/DeconBear/hadamard/actions/workflows/publish-npm.yml)
|
|
@@ -7,209 +7,96 @@
|
|
|
7
7
|
|
|
8
8
|
[English](./README.md) | [Chinese](./README-zh.md)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
LLM harnesses are powerful but hard to manage on real engineering and research work — shipping software, running AI-for-Science (AI4S) pipelines, training neural networks and steering experiments. Contexts overflow, tool calls sprawl, runs drift from the plan, and a single agent loop never gets a second opinion.
|
|
11
11
|
|
|
12
|
-
**Hadamard**
|
|
12
|
+
**Hadamard** exists to make agent engineering and research controllable. Multiple agents on different providers talk to each other — investigating, reviewing, and dispatching in parallel — so problems get considered more thoroughly. One TypeScript runtime provides tools, skills, durable sessions, memory, and MCP, plus a bridge that manages installed agent CLIs (Claude Code, Codex, Cursor, Pi, CodeWhale, Reasonix, Crush) as child processes; the same runtime ships with a terminal UI and a desktop GUI.
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Inspired by Claude Code, Codex, Deepagents, and the broader agent ecosystem. Hadamard remains independent with its own public API and documentation.
|
|
15
15
|
|
|
16
|
-
>
|
|
16
|
+
<p align="center">
|
|
17
|
+
<img src="https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/gui-home.png" alt="Hadamard desktop GUI — projects overview" width="49%">
|
|
18
|
+
<img src="https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/gui-chat.png" alt="Hadamard desktop GUI — chat with a model" width="49%">
|
|
19
|
+
</p>
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/tui-home.png" alt="Hadamard TUI — terminal startup screen" width="90%">
|
|
22
|
+
</p>
|
|
23
|
+
<p align="center"><em>The desktop GUI (top: projects overview and a chat session) and the terminal UI (bottom).</em></p>
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
## Vision
|
|
21
|
-
|
|
22
|
-
- **Multi-agent**: subagent delegation (Task tool), panel-analysis teams, reviewer-auditor pairs, dynamic workflows — agents collaborating, not just a single loop.
|
|
23
|
-
- **Multi-runtime state management**: bridge configs have two explicit modes. `Direct API` calls Anthropic/OpenAI-compatible providers in-process; `External CLI` manages installed Claude Code, Codex, Pi, CodeWhale, Reasonix, or Crush runtimes as child processes and preserves native session identities when the CLI protocol exposes them.
|
|
24
|
-
- **Model team collaboration**: leaders dispatch to specialists (`/model router`), panel members investigate in parallel with structured convergence, reviewers report only verifiable issues — teams as first-class tools the agent invokes.
|
|
25
|
-
|
|
26
|
-
## Highlights
|
|
27
|
-
|
|
28
|
-
- **Model Team** — `panel-analysis` (parallel investigation + convergence) and `reviewer` (verifiable-issues-only auditor). Runtime-owned member pooling, streamed `TeamEvent`s, per-member provider config, and inherited permission/retry boundaries.
|
|
29
|
-
- **Model Router / Leader-Dispatch** — a leader classifies each turn and dispatches it to the best specialist route (any model/provider), runs normally, and the executor may itself convene a team. Profiles in `~/.hadamard/routers/`.
|
|
30
|
-
- **Dynamic Workflows** — JS script-based orchestration with explicit trust levels: trusted compatibility execution, isolated local-process execution, or a host-supplied remote/container sandbox for adversarial inputs.
|
|
31
|
-
- **Bridge (named runtime configs)** — choose `Direct API` for provider-level reuse, or `External CLI` to launch installed Claude Code, Codex, Pi, CodeWhale, Reasonix, or Crush; reuse each CLI's native login/config, stream normalized tool and assistant events, stop background work, and browse/resume supported native conversations. An explicit key override is injected only into the child and is not written to the CLI's credential store; Pi, CodeWhale, Reasonix, and Crush keep isolated per-config session profiles so that key-mode history survives restarts without reading the native login store.
|
|
32
|
-
- **Desktop GUI (`hadamard-gui`)** — Electron chat UI: streamed transcript, conversation history, command palette, settings, per-tool permission prompts. Security-hardened. Global **Assistant** FAB (Global/Project scope). The visual **Agent graph** orchestration UI is shipping in-progress and continues to be iterated (not a stable product surface yet).
|
|
33
|
-
- **TUI (`hadamard-tui`)** — Terminal UI with 25+ slash commands, Claude Code-style UX: `/team`, `/bridge`, `/plan`, `/hooks`, `/mcp`, `/review`, `/context`, `/cost`, `/doctor`, and more. Live status spinner, scrollback transcript, todo panel, permission dialogs with project/user scope, sub-command autocomplete.
|
|
34
|
-
- **Plan mode + hooks** — `EnterPlanMode`/`ExitPlanMode` tools with plan file; typed command, prompt, or HTTPS lifecycle hooks for session, turn, model, tool, permission, compact, stop, and worktree events. The GUI edits them directly; legacy `PreToolUse`/`PostToolUse`/`SessionStart` shell hooks remain compatible.
|
|
35
|
-
- **Worktree Tools** — `EnterWorktree`/`ExitWorktree` with stack-based cwd, `.worktreeinclude`, PR checkout.
|
|
36
|
-
- **TavilySearch** — AI-optimized web search, pure TypeScript.
|
|
37
|
-
- **Standard Benchmark** — Self-contained framework with DeepSeek judge, HTML dashboard, 4-agent comparison.
|
|
38
|
-
|
|
39
|
-
## 1.0 SDK architecture
|
|
40
|
-
|
|
41
|
-
- `core`: immutable `AgentSpec`, canonical input/output items, structured output, guardrails, usage, and run errors.
|
|
42
|
-
- `providers`: capability-checked OpenAI Responses, OpenAI Chat-compatible, and Anthropic adapters behind one `ModelProvider` contract.
|
|
43
|
-
- `runtime`: one `AgentRuntime`, lazy `RuntimeServices`, fixed-stage middleware, tools/policy, bounded streams, checkpoints, interruption, and resume.
|
|
44
|
-
- `node`: tenant-scoped SQLite session/checkpoint/memory/artifact stores and backup-first JSON v1 migration.
|
|
45
|
-
- `events` and `surfaces`: versioned traceable `RunEvent`s plus shared CLI/TUI/GUI/Bridge semantics and redaction.
|
|
46
|
-
- `orchestration`, `workflow`, and `profiles`: agent-as-tool, handoff, durable spawn, graphs/presets, explicit workflow trust, and six composable agent profiles.
|
|
47
|
-
- `compat`: the 0.x root façade and migration adapters, retained throughout the 1.x line.
|
|
48
|
-
|
|
49
|
-
## Roadmap — toward agent teams
|
|
50
|
-
|
|
51
|
-
- **Swarm coordination** — mailbox-based inter-agent communication, task queues, shared knowledge graph.
|
|
52
|
-
- **Persistent team memory** — team-scoped context that survives across sessions and member changes.
|
|
53
|
-
- **Cross-runtime session continuity** — resume a bridge runtime's session exactly where you left it, regardless of which config was active.
|
|
54
|
-
- **Model team IDE** — visual team builder, member role editor, team health dashboard.
|
|
25
|
+
> **Package name:** the published npm package is [`actoviq-agent-sdk`](https://www.npmjs.com/package/actoviq-agent-sdk). Product, repo, CLI, and config paths use **Hadamard** (`hadamard-*`, `~/.hadamard`, `.hadamard/`).
|
|
55
26
|
|
|
56
27
|
## Install
|
|
57
28
|
|
|
58
|
-
Node.js 22.13+ or Node.js 24 is required.
|
|
59
|
-
`node:sqlite` only behind a process flag and is therefore outside the default
|
|
60
|
-
runtime support contract.
|
|
29
|
+
Node.js 22.13+ or Node.js 24 is required.
|
|
61
30
|
|
|
62
31
|
```bash
|
|
63
32
|
npm install actoviq-agent-sdk zod
|
|
64
33
|
```
|
|
65
34
|
|
|
66
|
-
|
|
35
|
+
The `npm install` above is for SDK usage (import from `'actoviq-agent-sdk'`); the CLIs are then available through `npx` (for example `npx hadamard-tui`). To run `hadamard-tui` / `hadamard-gui` / `hadamard` / `actoviq` directly on your PATH, install globally instead:
|
|
67
36
|
|
|
68
|
-
```
|
|
69
|
-
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g actoviq-agent-sdk
|
|
70
39
|
```
|
|
71
40
|
|
|
72
|
-
|
|
41
|
+
Put your provider settings at `~/.hadamard/settings.json` — any Anthropic-compatible or OpenAI-compatible provider works.
|
|
73
42
|
|
|
74
|
-
## Quick Start
|
|
43
|
+
## Quick Start
|
|
75
44
|
|
|
76
|
-
|
|
77
|
-
import type { AgentSpec } from 'actoviq-agent-sdk/core';
|
|
78
|
-
import { ModelRegistry, OpenAIResponsesProvider } from 'actoviq-agent-sdk/providers';
|
|
79
|
-
import { AgentRuntime } from 'actoviq-agent-sdk/runtime';
|
|
80
|
-
|
|
81
|
-
const runtime = new AgentRuntime({
|
|
82
|
-
models: new ModelRegistry([
|
|
83
|
-
new OpenAIResponsesProvider({ apiKey: process.env.OPENAI_API_KEY }),
|
|
84
|
-
]),
|
|
85
|
-
});
|
|
86
|
-
const agent: AgentSpec = {
|
|
87
|
-
id: 'concise-chat',
|
|
88
|
-
name: 'Concise chat',
|
|
89
|
-
instructions: 'Answer in one short sentence.',
|
|
90
|
-
model: 'openai-responses:gpt-4.1-mini',
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
try {
|
|
94
|
-
const result = await runtime.run(agent, 'What is compare-and-swap?');
|
|
95
|
-
console.log(result.output, result.usage.totalTokens);
|
|
96
|
-
} finally {
|
|
97
|
-
await runtime.close();
|
|
98
|
-
}
|
|
99
|
-
```
|
|
45
|
+
### SDK
|
|
100
46
|
|
|
101
|
-
|
|
47
|
+
```ts
|
|
48
|
+
import { createAgentSdk, loadDefaultHadamardSettings } from 'actoviq-agent-sdk';
|
|
102
49
|
|
|
103
|
-
|
|
50
|
+
await loadDefaultHadamardSettings(); // reads ~/.hadamard/settings.json
|
|
51
|
+
const sdk = await createAgentSdk();
|
|
104
52
|
|
|
105
|
-
|
|
53
|
+
const result = await sdk.run('What is compare-and-swap?');
|
|
54
|
+
console.log(result.text);
|
|
106
55
|
|
|
107
|
-
|
|
108
|
-
npm run example:hadamard-quickstart
|
|
109
|
-
npm run example:hadamard-agent-helpers
|
|
110
|
-
npm run example:profiles
|
|
56
|
+
await sdk.close();
|
|
111
57
|
```
|
|
112
58
|
|
|
113
|
-
|
|
59
|
+
Run the same example from the repository with `npm run example:hadamard-quickstart`.
|
|
114
60
|
|
|
115
|
-
`hadamard-tui`
|
|
61
|
+
### Terminal UI (`hadamard-tui`)
|
|
116
62
|
|
|
117
63
|
```bash
|
|
118
|
-
npx hadamard-tui [work-dir]
|
|
119
|
-
|
|
120
|
-
# Options
|
|
121
|
-
# --config <path> Load a specific Hadamard settings JSON file
|
|
122
|
-
# --permission-mode <mode> default | acceptEdits | plan | bypassPermissions (default)
|
|
123
|
-
# --model <model> Override the configured model
|
|
124
|
-
# --resume <session-id> Resume a stored Hadamard SDK session
|
|
125
|
-
# --continue Continue the most recently updated session
|
|
64
|
+
npx hadamard-tui [work-dir]
|
|
126
65
|
```
|
|
127
66
|
|
|
128
|
-
|
|
67
|
+
Type a message and press Enter — you are chatting with the agent in a Claude Code-style terminal REPL. `/` opens the slash-command menu (`/team`, `/bridge`, `/plan`, `/mcp`, `/doctor`, …). Common flags: `--model`, `--permission-mode`, `--resume <session-id>`, `--continue`.
|
|
129
68
|
|
|
130
|
-
|
|
131
|
-
- **Live status line** — spinner, elapsed time, tool count, and the active tool while the agent works, over an always-visible mode line (model · permission · effort · team · bridge · context%) that shows context usage as a percentage of the window and turns yellow then red as it fills.
|
|
132
|
-
- **Claude-style prompt bar** — type `\` then `Enter` (or `Ctrl+J`) for a newline; `↑`/`↓` walk input history; the caret renders inline.
|
|
133
|
-
- **Slash-command menu** — type `/` to open a filtered menu (`↑↓` select, `Tab` complete, `Enter` run). `/resume` opens a searchable project-session picker.
|
|
134
|
-
- **`@` file completion** — type `@` to open a git-aware workspace file picker filtered by the partial path; subsequence fuzzy matching.
|
|
135
|
-
- **Team / workflow / worktree pickers** — `/team` activates a saved Model Team; `/workflows` runs a saved dynamic workflow; `/worktree` enters, exits, or lists git worktrees.
|
|
136
|
-
- **Permission presets + per-tool scope** — `/permissions` switches between read-only/workspace/full/plan presets; always-allow rules persist with project or user scope.
|
|
137
|
-
- **Mid-run steering** — keep typing while the agent works and press `Enter`: the message is queued and injected into the very next model request (shown as `⧗ queued`).
|
|
138
|
-
- **Plan mode + hooks** — `/plan` enters plan mode (`EnterPlanMode`/`ExitPlanMode` tools, plan file); typed lifecycle hooks are configured in the GUI or `settings.json`, while `/hooks` continues to list compatible legacy shell hooks.
|
|
139
|
-
- **Bridge configs** — `/bridge config` manages named API or External CLI profiles for all six managed CLIs. `/bridge status`, `/bridge background`, `/bridge runs`, `/bridge stop`, `/bridge history`, and `/bridge resume` expose the same runtime lifecycle in the TUI and GUI; native history/resume remains subject to each installed CLI's protocol/version support.
|
|
140
|
-
- **Diagnostics + inspection** — `/doctor` checks config health; `/context` inspects the context window; `/cost`/`/usage` track token + spend (per-config breakdown); `/review` reviews the git diff; `/stats` shows session stats.
|
|
141
|
-
- **Context management built in** — the Hadamard SDK auto-compacts long sessions mid-run (full summary compact) and reactively recovers when a provider rejects an oversized prompt; notices surface as ∿ context compacted. History stays **append-only** between turns so automatic prefix caches (e.g. DeepSeek Context Caching) stay hot; Anthropic hosts still get explicit cache_control breakpoints. Oversized tool outputs are artifacted at write time rather than rewriting earlier messages.
|
|
142
|
-
- **MCP management** — `/mcp add`/`/mcp remove` manage stdio + remote HTTP MCP servers, persisted to `~/.hadamard/mcp.json`.
|
|
143
|
-
- **Image attachments** — `@<path>.png` tokens expand into image content blocks (in-process, read as base64).
|
|
144
|
-
|
|
145
|
-
The TUI uses the Hadamard SDK runtime defaults (Hadamard settings from `~/.hadamard/settings.json`, core tools, `bypassPermissions`, uncapped tool iterations) and runs against any Anthropic-compatible or OpenAI-compatible provider. `hadamard-tui` is the only interactive terminal agent entry point; the former `hadamard-react` and `hadamard-interactive-agent` entry points were retired after their capabilities were consolidated here.
|
|
146
|
-
|
|
147
|
-
By default, Hadamard SDK sessions are scoped to the current workspace under `~/.hadamard/projects/<workspace-key>`. Explicit `sessionDirectory` settings still take precedence.
|
|
148
|
-
|
|
149
|
-
Model tiers are provider-neutral aliases. Configure them with `HADAMARD_DEFAULT_MIN_MODEL`, `HADAMARD_DEFAULT_MEDIUM_MODEL`, and `HADAMARD_DEFAULT_MAX_MODEL`, then use `min`, `medium`, or `max` anywhere a model can be selected.
|
|
150
|
-
|
|
151
|
-
## Desktop GUI (`hadamard-gui`)
|
|
152
|
-
|
|
153
|
-
A local Electron desktop chat UI for the Hadamard SDK.
|
|
69
|
+
### Desktop GUI (`hadamard-gui`)
|
|
154
70
|
|
|
155
71
|
```bash
|
|
156
|
-
npx hadamard-gui [work-dir]
|
|
157
|
-
|
|
158
|
-
# Options
|
|
159
|
-
# --port <port> Internal port to bind (default: 4174, auto-fallback if busy)
|
|
160
|
-
# --config <path> Load a specific Hadamard settings JSON file
|
|
161
|
-
# --permission-mode <mode> default | acceptEdits | plan | bypassPermissions (default)
|
|
162
|
-
# --model <model> Override the configured model
|
|
163
|
-
# --resume <session-id> Resume a stored session
|
|
164
|
-
# --continue Resume the most recent stored session
|
|
72
|
+
npx hadamard-gui [work-dir]
|
|
165
73
|
```
|
|
166
74
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
- **Streamed transcript** with markdown rendering and copyable code blocks, plus live tool-call cards
|
|
170
|
-
- **Conversation history on resume** — opening or switching a chat replays its stored messages
|
|
171
|
-
- **Shared slash commands**, settings (provider / model / keys / appearance), workspace switching, and empty-chat cleanup
|
|
172
|
-
- **Per-tool permission prompts** (queued so concurrent requests don't collide) and a token-usage readout
|
|
173
|
-
- **Project Documents + Issues** — each Project detail page has `Document` and `Issues` tabs. Issues use the guarded `backlog → todo → in_progress → in_review/blocked → done` lifecycle, support priorities, labels, acceptance criteria, comments, and links back to their worker sessions.
|
|
174
|
-
- **Agent graph orchestration UI** — visual team/graph editor lives in the GUI **Agent** region; **it is still being iterated and optimized** and should not be treated as a finished product surface. Prefer saved teams + `/team` / SDK APIs for stable workflows.
|
|
175
|
-
- **Agent Workflow + Automation** — the Agent region edits validated sequential, branch, and parallel Workflow trees. New Automation tasks select those saved Workflows; historical dynamic-script tasks remain compatible without being reinterpreted.
|
|
176
|
-
- **Custom shortcuts + desktop screenshots** — Settings remaps supported actions, including a cross-platform screenshot action available to the user and agent runtime.
|
|
177
|
-
- **Lifecycle hook editor** — Settings manages typed session, turn, model, tool, permission, compact, stop, and worktree hooks while retaining legacy hook compatibility.
|
|
178
|
-
- **Agent Profiles for issue dispatch** — Settings → Models & routing can bind a named profile to a saved bridge config and model. `/issues start <id> [agent-profile]` asks the Project Manager for a worker brief, starts a linked session without changing the globally active runtime, and requires the worker to report through `IssueReport`.
|
|
179
|
-
- **Movable data root** — Settings → General can copy the complete Hadamard data root to an empty directory, validate it, write the bootstrap pointer, rebuild the SDK/session store, and retain the previous directory for manual cleanup.
|
|
75
|
+
Opens an Electron chat window backed by a localhost-only server — send a message to start your first conversation. The visual Agent graph editor is still iterating; prefer saved teams and `/team` for production workflows.
|
|
180
76
|
|
|
181
|
-
|
|
77
|
+
## Demo
|
|
182
78
|
|
|
183
|
-
|
|
79
|
+
A 50-second walkthrough of the desktop GUI: open the Chats view, start a new conversation, ask a question, and watch the streamed reply with the thinking indicator and code rendering. ([Full-resolution MP4](https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/gui-demo.mp4))
|
|
184
80
|
|
|
185
|
-
>
|
|
186
|
-
>
|
|
187
|
-
>
|
|
81
|
+
<p align="center">
|
|
82
|
+
<img src="https://raw.githubusercontent.com/DeconBear/hadamard/main/docs/assets/screenshots/gui-demo.gif" alt="Hadamard desktop GUI demo — a chat from New chat to a streamed reply with a code block" width="90%">
|
|
83
|
+
</p>
|
|
188
84
|
|
|
189
|
-
##
|
|
85
|
+
## Documentation
|
|
190
86
|
|
|
191
|
-
-
|
|
192
|
-
-
|
|
193
|
-
-
|
|
194
|
-
-
|
|
87
|
+
- Docs site: https://deconbear.github.io/hadamard/
|
|
88
|
+
- English tutorial: [docs/en/README.md](./docs/en/README.md) · Chinese tutorial: [docs/zh/README.md](./docs/zh/README.md)
|
|
89
|
+
- External CLI bridge guide (provider flags, credentials, `HADAMARD_<PROVIDER>_PATH`): [docs/en/05-bridge-runtime.md](./docs/en/05-bridge-runtime.md)
|
|
90
|
+
- Examples: [hadamard-quickstart.ts](./examples/hadamard-quickstart.ts), [hadamard-workflow.ts](./examples/hadamard-workflow.ts), [hadamard-agent-helpers.ts](./examples/hadamard-agent-helpers.ts)
|
|
91
|
+
- Security policy: [SECURITY.md](./SECURITY.md)
|
|
195
92
|
|
|
196
|
-
##
|
|
93
|
+
## Development
|
|
197
94
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
Start with these examples:
|
|
204
|
-
|
|
205
|
-
- [examples/hadamard-quickstart.ts](./examples/hadamard-quickstart.ts)
|
|
206
|
-
- [examples/hadamard-workflow.ts](./examples/hadamard-workflow.ts)
|
|
207
|
-
- [examples/hadamard-agent-helpers.ts](./examples/hadamard-agent-helpers.ts)
|
|
208
|
-
- [examples/profiles/all-profiles.ts](./examples/profiles/all-profiles.ts)
|
|
209
|
-
|
|
210
|
-
Architecture and operations:
|
|
211
|
-
|
|
212
|
-
- [Security policy](./SECURITY.md)
|
|
95
|
+
```bash
|
|
96
|
+
npm run typecheck # TypeScript checks
|
|
97
|
+
npm test # Vitest suite
|
|
98
|
+
npm run build # clean + compile
|
|
99
|
+
```
|
|
213
100
|
|
|
214
101
|
## Contributing
|
|
215
102
|
|
package/assets/hadamard-icon.ico
CHANGED
|
Binary file
|
package/assets/hadamard-icon.png
CHANGED
|
Binary file
|
package/bin/hadamard-gui.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { createHash } from 'node:crypto';
|
|
3
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
4
|
import { dirname, join } from 'node:path';
|
|
4
5
|
import { spawn, spawnSync } from 'node:child_process';
|
|
5
6
|
import { createRequire } from 'node:module';
|
|
@@ -9,21 +10,36 @@ const require = createRequire(import.meta.url);
|
|
|
9
10
|
const rootDir = fileURLToPath(new URL('..', import.meta.url));
|
|
10
11
|
const main = fileURLToPath(new URL('../dist/src/gui/electronMain.js', import.meta.url));
|
|
11
12
|
const prepareLauncher = fileURLToPath(new URL('../scripts/prepare-gui-launcher.mjs', import.meta.url));
|
|
13
|
+
const iconIco = fileURLToPath(new URL('../assets/hadamard-icon.ico', import.meta.url));
|
|
14
|
+
|
|
15
|
+
function resolveDevelopmentIdentity() {
|
|
16
|
+
if (!existsSync(iconIco)) {
|
|
17
|
+
return {
|
|
18
|
+
launcherName: 'Hadamard.exe',
|
|
19
|
+
appUserModelId: 'com.hadamard.desktop.dev',
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
const iconFingerprint = createHash('sha256').update(readFileSync(iconIco)).digest('hex').slice(0, 12);
|
|
23
|
+
return {
|
|
24
|
+
launcherName: `Hadamard-${iconFingerprint}.exe`,
|
|
25
|
+
appUserModelId: `com.hadamard.desktop.dev.${iconFingerprint}`,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const developmentIdentity = resolveDevelopmentIdentity();
|
|
12
30
|
|
|
13
31
|
function resolveElectronExecutable() {
|
|
14
32
|
const electronExe = require('electron');
|
|
15
33
|
if (process.platform === 'win32') {
|
|
16
|
-
const brandedLauncher = join(dirname(electronExe),
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
);
|
|
26
|
-
}
|
|
34
|
+
const brandedLauncher = join(dirname(electronExe), developmentIdentity.launcherName);
|
|
35
|
+
const prep = spawnSync(process.execPath, [prepareLauncher], {
|
|
36
|
+
stdio: 'ignore',
|
|
37
|
+
windowsHide: true,
|
|
38
|
+
});
|
|
39
|
+
if (prep.status !== 0) {
|
|
40
|
+
process.stderr.write(
|
|
41
|
+
'Hadamard: branded launcher could not be refreshed; taskbar may show a stale or Electron icon.\n',
|
|
42
|
+
);
|
|
27
43
|
}
|
|
28
44
|
if (existsSync(brandedLauncher)) return brandedLauncher;
|
|
29
45
|
}
|
|
@@ -38,6 +54,9 @@ const child = spawn(electron, [main, ...process.argv.slice(2)], {
|
|
|
38
54
|
env: {
|
|
39
55
|
...process.env,
|
|
40
56
|
HADAMARD_GUI_ROOT: rootDir,
|
|
57
|
+
HADAMARD_GUI_DEVELOPMENT: '1',
|
|
58
|
+
HADAMARD_GUI_APP_USER_MODEL_ID: developmentIdentity.appUserModelId,
|
|
59
|
+
HADAMARD_GUI_NODE: process.execPath,
|
|
41
60
|
},
|
|
42
61
|
windowsHide: windowsGuiLaunch,
|
|
43
62
|
detached: windowsGuiLaunch,
|
|
@@ -5,6 +5,14 @@ export interface CodeIntelligenceServiceOptions {
|
|
|
5
5
|
registry: LanguageServerRegistry;
|
|
6
6
|
timeoutMs?: number;
|
|
7
7
|
}
|
|
8
|
+
/** Snapshot of one language server for the /lsp status command. */
|
|
9
|
+
export interface LanguageServerStatus {
|
|
10
|
+
id: string;
|
|
11
|
+
languages: string[];
|
|
12
|
+
available: boolean;
|
|
13
|
+
reason?: string;
|
|
14
|
+
running: boolean;
|
|
15
|
+
}
|
|
8
16
|
export declare class CodeIntelligenceService {
|
|
9
17
|
private readonly options;
|
|
10
18
|
private readonly workDir;
|
|
@@ -14,10 +22,18 @@ export declare class CodeIntelligenceService {
|
|
|
14
22
|
workspaceSymbols(query: string): Promise<WorkspaceSymbol[]>;
|
|
15
23
|
definition(filePath: string, line: number, character: number): Promise<CodeLocation[]>;
|
|
16
24
|
references(filePath: string, line: number, character: number): Promise<CodeLocation[]>;
|
|
25
|
+
hover(filePath: string, line: number, character: number): Promise<string>;
|
|
17
26
|
diagnostics(filePath?: string): Promise<CodeDiagnostic[]>;
|
|
27
|
+
/**
|
|
28
|
+
* Registry capabilities plus live server state for the /lsp command. Running
|
|
29
|
+
* is reported conservatively (a server entry exists once spawned); a hung
|
|
30
|
+
* initialize handshake must not block this status call.
|
|
31
|
+
*/
|
|
32
|
+
serverStatus(): Promise<LanguageServerStatus[]>;
|
|
18
33
|
close(): Promise<void>;
|
|
19
34
|
private locationRequest;
|
|
20
35
|
private openDocument;
|
|
36
|
+
private syncDocument;
|
|
21
37
|
private assertWorkspacePath;
|
|
22
38
|
private allAvailableServers;
|
|
23
39
|
private server;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codeIntelligenceService.d.ts","sourceRoot":"","sources":["../../../src/codeIntel/codeIntelligenceService.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EAEZ,eAAe,EAChB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"codeIntelligenceService.d.ts","sourceRoot":"","sources":["../../../src/codeIntel/codeIntelligenceService.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,KAAK,EACV,cAAc,EACd,YAAY,EAEZ,eAAe,EAChB,MAAM,YAAY,CAAC;AAgBpB,MAAM,WAAW,8BAA8B;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,sBAAsB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,mEAAmE;AACnE,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,uBAAuB;IAKtB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAC1D,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAuC;gBAE3C,OAAO,EAAE,8BAA8B;IAI9D,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IAW3D,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAItF,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAMtF,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYzE,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAQ/D;;;;OAIG;IACG,YAAY,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAW/C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAgBd,eAAe;YAoBf,YAAY;YA0BZ,YAAY;YAoBZ,mBAAmB;YA0BnB,mBAAmB;YAUnB,MAAM;IAmCpB,OAAO,CAAC,kBAAkB;CAiB3B"}
|