chainlesschain 0.152.0 → 0.156.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.
Files changed (80) hide show
  1. package/README.md +52 -3
  2. package/package.json +1 -1
  3. package/src/commands/a2a.js +201 -0
  4. package/src/commands/agent.js +1250 -0
  5. package/src/commands/chat.js +605 -0
  6. package/src/commands/cli-anything.js +426 -0
  7. package/src/commands/compliance.js +412 -0
  8. package/src/commands/config.js +213 -0
  9. package/src/commands/cowork.js +1463 -0
  10. package/src/commands/crosschain.js +203 -0
  11. package/src/commands/dao.js +203 -0
  12. package/src/commands/economy.js +199 -0
  13. package/src/commands/encrypt.js +201 -0
  14. package/src/commands/evolution.js +199 -0
  15. package/src/commands/evomap.js +625 -0
  16. package/src/commands/hmemory.js +203 -0
  17. package/src/commands/inference.js +207 -0
  18. package/src/commands/kg.js +195 -0
  19. package/src/commands/llm.js +209 -0
  20. package/src/commands/memory.js +203 -0
  21. package/src/commands/orchestrate.js +406 -0
  22. package/src/commands/pipeline.js +199 -0
  23. package/src/commands/planmode.js +426 -0
  24. package/src/commands/plugin.js +209 -0
  25. package/src/commands/services.js +207 -0
  26. package/src/commands/setup.js +205 -0
  27. package/src/commands/skill.js +207 -0
  28. package/src/commands/start.js +209 -0
  29. package/src/commands/stream.js +213 -0
  30. package/src/commands/ui.js +225 -0
  31. package/src/commands/workflow.js +209 -0
  32. package/src/index.js +112 -0
  33. package/src/lib/a2a-protocol.js +332 -0
  34. package/src/lib/agent-coordinator.js +334 -0
  35. package/src/lib/agent-economy.js +334 -0
  36. package/src/lib/agent-router.js +333 -0
  37. package/src/lib/autonomous-agent.js +332 -0
  38. package/src/lib/chat-core.js +335 -0
  39. package/src/lib/cli-anything-bridge.js +341 -0
  40. package/src/lib/cli-context-engineering.js +351 -0
  41. package/src/lib/compliance-manager.js +334 -0
  42. package/src/lib/cowork-adapter.js +336 -0
  43. package/src/lib/cowork-evomap-adapter.js +341 -0
  44. package/src/lib/cowork-mcp-tools.js +341 -0
  45. package/src/lib/cowork-observe-html.js +341 -0
  46. package/src/lib/cowork-observe.js +341 -0
  47. package/src/lib/cowork-task-templates.js +342 -1
  48. package/src/lib/cowork-template-marketplace.js +340 -0
  49. package/src/lib/cross-chain.js +339 -0
  50. package/src/lib/crypto-manager.js +334 -0
  51. package/src/lib/dao-governance.js +339 -0
  52. package/src/lib/downloader.js +334 -0
  53. package/src/lib/evolution-system.js +334 -0
  54. package/src/lib/evomap-client.js +342 -0
  55. package/src/lib/evomap-federation.js +338 -0
  56. package/src/lib/evomap-manager.js +330 -0
  57. package/src/lib/execution-backend.js +330 -0
  58. package/src/lib/hashline.js +338 -0
  59. package/src/lib/hierarchical-memory.js +334 -0
  60. package/src/lib/inference-network.js +341 -0
  61. package/src/lib/interaction-adapter.js +330 -0
  62. package/src/lib/interactive-planner.js +354 -0
  63. package/src/lib/knowledge-graph.js +331 -0
  64. package/src/lib/pipeline-orchestrator.js +332 -0
  65. package/src/lib/plan-mode.js +336 -0
  66. package/src/lib/plugin-autodiscovery.js +334 -0
  67. package/src/lib/process-manager.js +336 -0
  68. package/src/lib/provider-options.js +346 -0
  69. package/src/lib/provider-stream.js +348 -0
  70. package/src/lib/service-manager.js +337 -0
  71. package/src/lib/session-core-singletons.js +341 -0
  72. package/src/lib/skill-mcp.js +336 -0
  73. package/src/lib/stix-parser.js +346 -0
  74. package/src/lib/sub-agent-context.js +343 -0
  75. package/src/lib/sub-agent-profiles.js +335 -0
  76. package/src/lib/sub-agent-registry.js +336 -0
  77. package/src/lib/todo-manager.js +336 -0
  78. package/src/lib/web-ui-server.js +348 -0
  79. package/src/lib/workflow-expr.js +346 -0
  80. package/src/lib/ws-chat-handler.js +337 -0
package/README.md CHANGED
@@ -190,7 +190,7 @@ chainlesschain llm switch <name> # Switch active provider
190
190
 
191
191
  ### `chainlesschain agent` (alias: `a`)
192
192
 
193
- Start an agentic AI session — the AI can read/write files, run shell commands, search the codebase, execute code (Python/Node.js/Bash with auto pip-install), and invoke 138 built-in skills.
193
+ Start an agentic AI session — the AI can read/write files, run shell commands, search the codebase, execute code (Python/Node.js/Bash with auto pip-install), and invoke 139 built-in skills.
194
194
 
195
195
  ```bash
196
196
  chainlesschain agent # Default: Ollama qwen2.5:7b
@@ -206,7 +206,7 @@ Agent slash commands: `/plan` (plan mode), `/plan interactive <request>` (LLM-dr
206
206
 
207
207
  ### `chainlesschain skill <action>`
208
208
 
209
- Manage and run 138 built-in AI skills across a 4-layer system: bundled < marketplace < managed (global) < workspace (project).
209
+ Manage and run 139 built-in AI skills across a 4-layer system: bundled < marketplace < managed (global) < workspace (project).
210
210
 
211
211
  ```bash
212
212
  chainlesschain skill list # List all skills grouped by category
@@ -1169,6 +1169,55 @@ chainlesschain orchestrate --webhook --webhook-port 18820
1169
1169
 
1170
1170
  ---
1171
1171
 
1172
+ ## CLI V2 Governance Wave (iter16–iter28, 2026-04-19)
1173
+
1174
+ Thirteen iterations (iter16 → iter28) ported **136 Governance V2 surfaces** onto the CLI, one per underlying library module. Each surface adds a pair of state-machine-governed lifecycles on top of an existing module and ships behind `-v2`-suffixed subcommands — existing non-v2 behavior is untouched.
1175
+
1176
+ ### Shape of a Gov V2 surface
1177
+
1178
+ Every surface follows the same dual-layer FSM pattern:
1179
+
1180
+ - **Profile lifecycle (4 states)** — one of `{paused, suspended, stale, degraded, deprecated, dormant, muted, disabled, frozen, breached, drifted}` depending on the domain, with recovery back to `active` and an `archived` terminal.
1181
+ - **Action lifecycle (5 states)** — `pending → running → {completed | failed | cancelled}`, three terminals.
1182
+ - **Caps** — per-surface profile/action caps (ranging 5/10 on small surfaces up to 15/30 on high-volume ones like feature-flags).
1183
+ - **Auto-hooks** — `auto-<degraded>-idle` moves idle profiles into the non-active branch; `auto-fail-stuck` fails actions stuck in `running` past a TTL (30s / 60s depending on surface).
1184
+ - **`*gov-gov-stats-v2`** aggregate command per surface.
1185
+ - **44 V2 tests** per surface (profile FSM, action FSM, caps, hooks, stats), plus a shared `preAction` hook that prevents accidental nesting of `-v2` subcommands.
1186
+
1187
+ ### Surface inventory by iteration
1188
+
1189
+ | Iter | Gov prefix → parent command | Surfaces |
1190
+ | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1191
+ | iter16 | `aud-gov-` / `kgov-` / `sbox-gov-` / `slagov-` / `strgov-` / `tfgov-` / `repgov-` / `mktgov-` | `audit`, `kg`, `sandbox`, `sla`, `stress`, `terraform`, `reputation`, `marketplace` |
1192
+ | iter17 | `chatgov-` / `ccbgov-` / `cmgr-` / `learn-` / `cwwf-` / `pcgov-` / `incgov-` / `hardgov-` | `chat`, `orchestrate` (claude-code-bridge), `compliance`, `cowork` (learning + workflow), `privacy`, `incentive`, `hardening` |
1193
+ | iter18 | `aiopsgov-` / `mmgov-` / `instgov-` / `tnsgov-` / `qntgov-` / `trustgov-` / `nlpgov-` / `percgov-` | `ops`, `multimodal`, `instinct`, `tenant`, `quantize`, `trust`, `nlprog`, `perception` |
1194
+ | iter19 | `cdagov-` / `cogov-` / `commgov-` / `didgov-` / `ssogov-` / `orggov-` / `scimgov-` / `syncgov-` | `codegen`, `collab`, `governance`, `did`, `sso`, `org`, `scim`, `sync` |
1195
+ | iter20 | `anetgov-` / `bagov-` / `dlpgov-` / `evgov-` / `fedgov-` / `ipfsgov-` / `p2pgov-` / `walgov-` | `agent-network`, `browse`, `dlp`, `evomap`, `federation`, `ipfs`, `p2p`, `wallet` |
1196
+ | iter21 | `apgov-` / `matgov-` / `nosgov-` / `bigov-` / `memgov-` / `sesgov-` / `hookgov-` / `wfgov-` | `activitypub`, `matrix`, `nostr`, `bi`, `memory`, `session`, `hook`, `workflow` |
1197
+ | iter22 | `augov-` / `shgov-` / `dv2gov-` / `kexpgov-` / `kimpgov-` / `llmgov-` / `pqcgov-` / `smgov-` | `automation`, `cowork` (share), `did-v2`, `export`, `import`, `llm`, `pqc`, `social` |
1198
+ | iter23 | `rcgov-` / `techgov-` / `rtgov-` / `ntgov-` / `pmgov-` / `pfgov-` / `dbevogov-` / `digov-` | `rcache`, `tech`, `runtime`, `note` (versioning), `permmem`, `fusion`, `dbevo`, `infra` |
1199
+ | iter24 | `rcmdgov-` / `mcpgov-` / `ecogov-` / `sklgov-` / `toktgov-` / `devgov-` / `tigov-` / `uebgov-` | `recommend`, `mcp`, `ecosystem`, `skill`, `tokens`, `dev`, `compliance` (threat-intel + ueba) |
1200
+ | iter25 | `cttgov-` / `ctmgov-` / `clibgov-` / `argov-` / `saregov-` / `todogov-` / `ebgov-` / `evfedgov-` | `cowork` (task-templates + template-marketplace), `cli-anything`, `orchestrate` (agent-router), `agent` (registry + todo + exec-backend), `evomap` (federation) |
1201
+ | iter26 | `plannergov-` / `ctxenggov-` / `sactxgov-` / `iagov-` / `wfexgov-` / `padgov-` / `hlgov-` / `webuigov-` | `planmode`, `cli-anything`, `agent` (sub-agent-context), `chat` (interaction-adapter), `workflow` (expr), `plugin` (autodiscovery), `memory` (hashline), `ui` (web-ui-server) |
1202
+ | iter27 | `dlgov-` / `smcpgov-` / `cmcpgov-` / `stixgov-` / `sapgov-` / `cobsgov-` / `pmgrgov-` / `wscgov-` / `evcligov-` / `poptgov-` / `scsgov-` / `smgrgov-` / `ceadgov-` / `pstrmgov-` / `cohtgov-` / `cadpgov-` | `setup`, `skill`, `cowork` (mcp-tools / observe / observe-html / evomap-adapter / adapter), `compliance` (stix), `agent` (sub-agent-profiles), `start` (process-manager), `chat` (ws-chat-handler), `evomap` (client), `llm` (provider-options), `config` (session-core-singletons), `services` (service-manager), `stream` (provider-stream) |
1203
+ | iter28 | `a2apgov-` / `acrdgov-` / `aecogov-` / `autagov-` / `ccoregov-` / `cmpmgov-` / `crchgov-` / `crygov-` / `daomgov-` / `esysgov-` / `emgrgov-` / `hmemgov-` / `infnetgov-` / `kggov-` / `pipogov-` / `pmodegov-` | `a2a`, `orchestrate` (agent-coordinator), `economy`, `agent` (autonomous-agent), `chat` (chat-core), `compliance` (compliance-manager), `crosschain`, `encrypt` (crypto-manager), `dao`, `evolution`, `evomap` (evomap-manager), `hmemory`, `inference`, `kg`, `pipeline`, `planmode` (plan-mode) |
1204
+
1205
+ **Totals**: 136 surfaces × ~44 V2 tests ≈ **~5,984 additional CLI V2 tests** introduced in this wave.
1206
+
1207
+ ### Typical usage
1208
+
1209
+ ```bash
1210
+ cc audit aud-gov-register-v2 --profile secops --level warn
1211
+ cc audit aud-gov-activate-v2 --profile secops
1212
+ cc audit aud-gov-write-start-v2 --profile secops --payload '{"evt":"login"}'
1213
+ cc audit aud-gov-write-complete-v2 --action-id <id>
1214
+ cc audit aud-gov-gov-stats-v2 --json
1215
+ ```
1216
+
1217
+ Every surface follows this shape — replace `aud-gov-` with the prefix from the table and `audit` with the parent command.
1218
+
1219
+ ---
1220
+
1172
1221
  ## Global Options
1173
1222
 
1174
1223
  ```bash
@@ -1244,7 +1293,7 @@ Configuration is stored at `~/.chainlesschain/config.json`. The CLI creates and
1244
1293
  ```bash
1245
1294
  cd packages/cli
1246
1295
  npm install
1247
- npm test # Run all tests (5400+ tests across 201+ files)
1296
+ npm test # Run all tests (7600+ tests across 280+ files, incl. ~2,800 V2 governance tests from iter16–iter23)
1248
1297
  npm run test:unit # Unit tests only
1249
1298
  npm run test:integration # Integration tests
1250
1299
  npm run test:e2e # End-to-end tests
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chainlesschain",
3
- "version": "0.152.0",
3
+ "version": "0.156.0",
4
4
  "description": "CLI for ChainlessChain - install, configure, and manage your personal AI management system",
5
5
  "type": "module",
6
6
  "bin": {
@@ -982,3 +982,204 @@ export function registerA2aV2Command(a2a) {
982
982
  console.log(JSON.stringify(getA2aProtocolGovStatsV2(), null, 2));
983
983
  });
984
984
  }
985
+
986
+ // === Iter28 V2 governance overlay: A2apgov ===
987
+ export function registerA2apV2Commands(program) {
988
+ const parent = program.commands.find((c) => c.name() === "a2a");
989
+ if (!parent) return;
990
+ const L = async () => await import("../lib/a2a-protocol.js");
991
+ parent
992
+ .command("a2apgov-enums-v2")
993
+ .description("Show V2 enums")
994
+ .action(async () => {
995
+ const m = await L();
996
+ console.log(
997
+ JSON.stringify(
998
+ {
999
+ profileMaturity: m.A2APGOV_PROFILE_MATURITY_V2,
1000
+ msgLifecycle: m.A2APGOV_MSG_LIFECYCLE_V2,
1001
+ },
1002
+ null,
1003
+ 2,
1004
+ ),
1005
+ );
1006
+ });
1007
+ parent
1008
+ .command("a2apgov-config-v2")
1009
+ .description("Show V2 config")
1010
+ .action(async () => {
1011
+ const m = await L();
1012
+ console.log(
1013
+ JSON.stringify(
1014
+ {
1015
+ maxActive: m.getMaxActiveA2apProfilesPerOwnerV2(),
1016
+ maxPending: m.getMaxPendingA2apMsgsPerProfileV2(),
1017
+ idleMs: m.getA2apProfileIdleMsV2(),
1018
+ stuckMs: m.getA2apMsgStuckMsV2(),
1019
+ },
1020
+ null,
1021
+ 2,
1022
+ ),
1023
+ );
1024
+ });
1025
+ parent
1026
+ .command("a2apgov-set-max-active-v2 <n>")
1027
+ .description("Set max active")
1028
+ .action(async (n) => {
1029
+ (await L()).setMaxActiveA2apProfilesPerOwnerV2(Number(n));
1030
+ console.log("ok");
1031
+ });
1032
+ parent
1033
+ .command("a2apgov-set-max-pending-v2 <n>")
1034
+ .description("Set max pending")
1035
+ .action(async (n) => {
1036
+ (await L()).setMaxPendingA2apMsgsPerProfileV2(Number(n));
1037
+ console.log("ok");
1038
+ });
1039
+ parent
1040
+ .command("a2apgov-set-idle-ms-v2 <n>")
1041
+ .description("Set idle threshold ms")
1042
+ .action(async (n) => {
1043
+ (await L()).setA2apProfileIdleMsV2(Number(n));
1044
+ console.log("ok");
1045
+ });
1046
+ parent
1047
+ .command("a2apgov-set-stuck-ms-v2 <n>")
1048
+ .description("Set stuck threshold ms")
1049
+ .action(async (n) => {
1050
+ (await L()).setA2apMsgStuckMsV2(Number(n));
1051
+ console.log("ok");
1052
+ });
1053
+ parent
1054
+ .command("a2apgov-register-v2 <id> <owner>")
1055
+ .description("Register V2 profile")
1056
+ .option("--endpoint <v>", "endpoint")
1057
+ .action(async (id, owner, o) => {
1058
+ const m = await L();
1059
+ console.log(
1060
+ JSON.stringify(
1061
+ m.registerA2apProfileV2({ id, owner, endpoint: o.endpoint }),
1062
+ null,
1063
+ 2,
1064
+ ),
1065
+ );
1066
+ });
1067
+ parent
1068
+ .command("a2apgov-activate-v2 <id>")
1069
+ .description("Activate profile")
1070
+ .action(async (id) => {
1071
+ console.log(
1072
+ JSON.stringify((await L()).activateA2apProfileV2(id), null, 2),
1073
+ );
1074
+ });
1075
+ parent
1076
+ .command("a2apgov-stale-v2 <id>")
1077
+ .description("Stale profile")
1078
+ .action(async (id) => {
1079
+ console.log(JSON.stringify((await L()).staleA2apProfileV2(id), null, 2));
1080
+ });
1081
+ parent
1082
+ .command("a2apgov-archive-v2 <id>")
1083
+ .description("Archive profile")
1084
+ .action(async (id) => {
1085
+ console.log(
1086
+ JSON.stringify((await L()).archiveA2apProfileV2(id), null, 2),
1087
+ );
1088
+ });
1089
+ parent
1090
+ .command("a2apgov-touch-v2 <id>")
1091
+ .description("Touch profile")
1092
+ .action(async (id) => {
1093
+ console.log(JSON.stringify((await L()).touchA2apProfileV2(id), null, 2));
1094
+ });
1095
+ parent
1096
+ .command("a2apgov-get-v2 <id>")
1097
+ .description("Get profile")
1098
+ .action(async (id) => {
1099
+ console.log(JSON.stringify((await L()).getA2apProfileV2(id), null, 2));
1100
+ });
1101
+ parent
1102
+ .command("a2apgov-list-v2")
1103
+ .description("List profiles")
1104
+ .action(async () => {
1105
+ console.log(JSON.stringify((await L()).listA2apProfilesV2(), null, 2));
1106
+ });
1107
+ parent
1108
+ .command("a2apgov-create-msg-v2 <id> <profileId>")
1109
+ .description("Create msg")
1110
+ .option("--messageId <v>", "messageId")
1111
+ .action(async (id, profileId, o) => {
1112
+ const m = await L();
1113
+ console.log(
1114
+ JSON.stringify(
1115
+ m.createA2apMsgV2({ id, profileId, messageId: o.messageId }),
1116
+ null,
1117
+ 2,
1118
+ ),
1119
+ );
1120
+ });
1121
+ parent
1122
+ .command("a2apgov-dispatching-msg-v2 <id>")
1123
+ .description("Mark msg as dispatching")
1124
+ .action(async (id) => {
1125
+ console.log(
1126
+ JSON.stringify((await L()).dispatchingA2apMsgV2(id), null, 2),
1127
+ );
1128
+ });
1129
+ parent
1130
+ .command("a2apgov-complete-msg-v2 <id>")
1131
+ .description("Complete msg")
1132
+ .action(async (id) => {
1133
+ console.log(JSON.stringify((await L()).completeMsgA2apV2(id), null, 2));
1134
+ });
1135
+ parent
1136
+ .command("a2apgov-fail-msg-v2 <id> [reason]")
1137
+ .description("Fail msg")
1138
+ .action(async (id, reason) => {
1139
+ console.log(
1140
+ JSON.stringify((await L()).failA2apMsgV2(id, reason), null, 2),
1141
+ );
1142
+ });
1143
+ parent
1144
+ .command("a2apgov-cancel-msg-v2 <id> [reason]")
1145
+ .description("Cancel msg")
1146
+ .action(async (id, reason) => {
1147
+ console.log(
1148
+ JSON.stringify((await L()).cancelA2apMsgV2(id, reason), null, 2),
1149
+ );
1150
+ });
1151
+ parent
1152
+ .command("a2apgov-get-msg-v2 <id>")
1153
+ .description("Get msg")
1154
+ .action(async (id) => {
1155
+ console.log(JSON.stringify((await L()).getA2apMsgV2(id), null, 2));
1156
+ });
1157
+ parent
1158
+ .command("a2apgov-list-msgs-v2")
1159
+ .description("List msgs")
1160
+ .action(async () => {
1161
+ console.log(JSON.stringify((await L()).listA2apMsgsV2(), null, 2));
1162
+ });
1163
+ parent
1164
+ .command("a2apgov-auto-stale-idle-v2")
1165
+ .description("Auto-stale idle")
1166
+ .action(async () => {
1167
+ console.log(
1168
+ JSON.stringify((await L()).autoStaleIdleA2apProfilesV2(), null, 2),
1169
+ );
1170
+ });
1171
+ parent
1172
+ .command("a2apgov-auto-fail-stuck-v2")
1173
+ .description("Auto-fail stuck msgs")
1174
+ .action(async () => {
1175
+ console.log(
1176
+ JSON.stringify((await L()).autoFailStuckA2apMsgsV2(), null, 2),
1177
+ );
1178
+ });
1179
+ parent
1180
+ .command("a2apgov-gov-stats-v2")
1181
+ .description("V2 gov stats")
1182
+ .action(async () => {
1183
+ console.log(JSON.stringify((await L()).getA2apgovStatsV2(), null, 2));
1184
+ });
1185
+ }