chainlesschain 0.143.0 → 0.152.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/package.json +1 -1
- package/src/commands/a2a.js +196 -28
- package/src/commands/activitypub.js +364 -27
- package/src/commands/agent-network.js +217 -0
- package/src/commands/agent.js +587 -103
- package/src/commands/audit.js +206 -0
- package/src/commands/automation.js +201 -0
- package/src/commands/bi.js +355 -27
- package/src/commands/bm25.js +111 -27
- package/src/commands/browse.js +403 -29
- package/src/commands/ccron.js +128 -28
- package/src/commands/chat.js +207 -0
- package/src/commands/codegen.js +207 -0
- package/src/commands/collab.js +211 -0
- package/src/commands/compliance.js +824 -34
- package/src/commands/compt.js +127 -29
- package/src/commands/consol.js +8 -2
- package/src/commands/cowork.js +783 -34
- package/src/commands/crosschain.js +182 -28
- package/src/commands/dao.js +182 -28
- package/src/commands/dbevo.js +227 -0
- package/src/commands/dev.js +207 -0
- package/src/commands/did-v2.js +217 -0
- package/src/commands/did.js +221 -0
- package/src/commands/dlp.js +385 -27
- package/src/commands/economy.js +205 -50
- package/src/commands/evolution.js +203 -50
- package/src/commands/evomap.js +387 -27
- package/src/commands/export.js +213 -0
- package/src/commands/federation.js +209 -0
- package/src/commands/fflag.js +74 -22
- package/src/commands/fusion.js +205 -0
- package/src/commands/git.js +177 -37
- package/src/commands/governance.js +209 -0
- package/src/commands/hardening.js +209 -0
- package/src/commands/hmemory.js +204 -50
- package/src/commands/hook.js +209 -0
- package/src/commands/import.js +209 -0
- package/src/commands/incentive.js +209 -0
- package/src/commands/inference.js +170 -34
- package/src/commands/infra.js +203 -0
- package/src/commands/instinct.js +209 -0
- package/src/commands/ipfs.js +207 -0
- package/src/commands/itbudget.js +149 -33
- package/src/commands/kg.js +206 -0
- package/src/commands/llm.js +217 -0
- package/src/commands/lowcode.js +195 -38
- package/src/commands/marketplace.js +206 -0
- package/src/commands/matrix.js +386 -27
- package/src/commands/mcp.js +217 -0
- package/src/commands/mcpscaf.js +145 -33
- package/src/commands/meminj.js +145 -33
- package/src/commands/memory.js +209 -0
- package/src/commands/multimodal.js +203 -0
- package/src/commands/nlprog.js +225 -0
- package/src/commands/nostr.js +387 -27
- package/src/commands/note.js +205 -0
- package/src/commands/ops.js +219 -0
- package/src/commands/orchestrate.js +217 -0
- package/src/commands/orchgov.js +144 -33
- package/src/commands/org.js +209 -0
- package/src/commands/p2p.js +209 -0
- package/src/commands/pdfp.js +109 -27
- package/src/commands/perception.js +209 -0
- package/src/commands/perf.js +169 -32
- package/src/commands/perm.js +144 -33
- package/src/commands/permmem.js +203 -0
- package/src/commands/pipeline.js +207 -52
- package/src/commands/planmode.js +141 -32
- package/src/commands/plugin-ecosystem.js +209 -0
- package/src/commands/pqc.js +213 -0
- package/src/commands/privacy.js +203 -0
- package/src/commands/promcomp.js +111 -27
- package/src/commands/quantization.js +207 -0
- package/src/commands/rcache.js +205 -0
- package/src/commands/recommend.js +410 -34
- package/src/commands/reputation.js +208 -0
- package/src/commands/runtime.js +205 -0
- package/src/commands/sandbox.js +206 -0
- package/src/commands/scim.js +209 -0
- package/src/commands/seshhook.js +145 -33
- package/src/commands/seshsearch.js +141 -33
- package/src/commands/seshtail.js +144 -33
- package/src/commands/seshu.js +152 -33
- package/src/commands/session.js +209 -0
- package/src/commands/sganal.js +123 -29
- package/src/commands/siem.js +201 -34
- package/src/commands/skill.js +207 -0
- package/src/commands/sla.js +212 -0
- package/src/commands/slotfill.js +146 -33
- package/src/commands/social.js +358 -32
- package/src/commands/sso.js +209 -0
- package/src/commands/stress.js +206 -0
- package/src/commands/svccont.js +145 -33
- package/src/commands/sync.js +209 -0
- package/src/commands/tech.js +209 -0
- package/src/commands/tenant.js +217 -0
- package/src/commands/terraform.js +206 -0
- package/src/commands/tms.js +171 -33
- package/src/commands/tokens.js +209 -0
- package/src/commands/topiccls.js +146 -33
- package/src/commands/trust.js +217 -0
- package/src/commands/uprof.js +141 -32
- package/src/commands/vcheck.js +122 -28
- package/src/commands/wallet.js +209 -0
- package/src/commands/webfetch.js +141 -32
- package/src/commands/workflow.js +203 -0
- package/src/commands/zkp.js +184 -28
- package/src/index.js +180 -0
- package/src/lib/a2a-protocol.js +319 -51
- package/src/lib/activitypub-bridge.js +622 -50
- package/src/lib/agent-economy.js +304 -51
- package/src/lib/agent-network.js +341 -0
- package/src/lib/aiops.js +346 -0
- package/src/lib/app-builder.js +279 -46
- package/src/lib/audit-logger.js +321 -0
- package/src/lib/automation-engine.js +335 -0
- package/src/lib/autonomous-agent.js +284 -48
- package/src/lib/autonomous-developer.js +332 -0
- package/src/lib/bi-engine.js +616 -49
- package/src/lib/bm25-search.js +301 -49
- package/src/lib/browser-automation.js +630 -49
- package/src/lib/chat-core.js +336 -0
- package/src/lib/claude-code-bridge.js +341 -0
- package/src/lib/code-agent.js +339 -0
- package/src/lib/collaboration-governance.js +334 -0
- package/src/lib/community-governance.js +346 -0
- package/src/lib/compliance-framework-reporter.js +305 -51
- package/src/lib/compliance-manager.js +330 -0
- package/src/lib/compression-telemetry.js +301 -49
- package/src/lib/content-recommendation.js +351 -0
- package/src/lib/content-recommender.js +317 -52
- package/src/lib/cowork-cron.js +298 -49
- package/src/lib/cowork-learning.js +333 -0
- package/src/lib/cowork-share.js +338 -0
- package/src/lib/cowork-task-runner.js +308 -51
- package/src/lib/cowork-workflow.js +327 -0
- package/src/lib/cross-chain.js +311 -51
- package/src/lib/dao-governance.js +280 -46
- package/src/lib/dbevo.js +351 -0
- package/src/lib/decentral-infra.js +330 -0
- package/src/lib/did-manager.js +341 -0
- package/src/lib/did-v2-manager.js +341 -0
- package/src/lib/dlp-engine.js +626 -49
- package/src/lib/evolution-system.js +278 -47
- package/src/lib/evomap-governance.js +334 -0
- package/src/lib/evomap-manager.js +280 -46
- package/src/lib/execution-backend.js +294 -48
- package/src/lib/feature-flags.js +294 -49
- package/src/lib/federation-hardening.js +340 -0
- package/src/lib/git-integration.js +285 -47
- package/src/lib/hardening-manager.js +341 -0
- package/src/lib/hierarchical-memory.js +284 -48
- package/src/lib/hook-manager.js +341 -0
- package/src/lib/inference-network.js +308 -51
- package/src/lib/instinct-manager.js +346 -0
- package/src/lib/ipfs-storage.js +334 -0
- package/src/lib/iteration-budget.js +302 -50
- package/src/lib/knowledge-exporter.js +341 -0
- package/src/lib/knowledge-graph.js +333 -0
- package/src/lib/knowledge-importer.js +341 -0
- package/src/lib/llm-providers.js +346 -0
- package/src/lib/matrix-bridge.js +620 -47
- package/src/lib/mcp-registry.js +346 -0
- package/src/lib/mcp-scaffold.js +318 -54
- package/src/lib/memory-injection.js +288 -49
- package/src/lib/memory-manager.js +336 -0
- package/src/lib/multimodal.js +330 -0
- package/src/lib/nl-programming.js +341 -0
- package/src/lib/nostr-bridge.js +622 -49
- package/src/lib/note-versioning.js +339 -0
- package/src/lib/orchestrator.js +293 -48
- package/src/lib/org-manager.js +336 -0
- package/src/lib/p2p-manager.js +341 -0
- package/src/lib/pdf-parser.js +298 -49
- package/src/lib/perception.js +346 -0
- package/src/lib/perf-tuning.js +309 -50
- package/src/lib/permanent-memory.js +327 -0
- package/src/lib/permission-engine.js +287 -49
- package/src/lib/pipeline-orchestrator.js +289 -49
- package/src/lib/plan-mode.js +298 -51
- package/src/lib/plugin-ecosystem.js +346 -0
- package/src/lib/pqc-manager.js +346 -0
- package/src/lib/privacy-computing.js +335 -0
- package/src/lib/protocol-fusion.js +338 -0
- package/src/lib/quantization.js +337 -0
- package/src/lib/reputation-optimizer.js +340 -0
- package/src/lib/response-cache.js +333 -0
- package/src/lib/sandbox-v2.js +327 -0
- package/src/lib/scim-manager.js +346 -0
- package/src/lib/service-container.js +313 -52
- package/src/lib/session-consolidator.js +296 -49
- package/src/lib/session-hooks.js +312 -53
- package/src/lib/session-manager.js +334 -0
- package/src/lib/session-search.js +304 -51
- package/src/lib/session-tail.js +288 -49
- package/src/lib/session-usage.js +298 -52
- package/src/lib/siem-exporter.js +298 -51
- package/src/lib/skill-loader.js +334 -0
- package/src/lib/skill-marketplace.js +345 -0
- package/src/lib/sla-manager.js +341 -0
- package/src/lib/slot-filler.js +303 -51
- package/src/lib/social-graph-analytics.js +295 -49
- package/src/lib/social-graph.js +272 -49
- package/src/lib/social-manager.js +330 -0
- package/src/lib/sso-manager.js +340 -0
- package/src/lib/stress-tester.js +342 -0
- package/src/lib/sub-agent-registry.js +302 -53
- package/src/lib/sync-manager.js +336 -0
- package/src/lib/task-model-selector.js +302 -50
- package/src/lib/tech-learning-engine.js +341 -0
- package/src/lib/tenant-saas.js +341 -0
- package/src/lib/terraform-manager.js +333 -0
- package/src/lib/threat-intel.js +330 -0
- package/src/lib/todo-manager.js +281 -47
- package/src/lib/token-incentive.js +341 -0
- package/src/lib/token-tracker.js +336 -0
- package/src/lib/topic-classifier.js +297 -49
- package/src/lib/trust-security.js +343 -0
- package/src/lib/ueba.js +340 -0
- package/src/lib/universal-runtime.js +330 -0
- package/src/lib/user-profile.js +294 -50
- package/src/lib/version-checker.js +304 -50
- package/src/lib/wallet-manager.js +336 -0
- package/src/lib/web-fetch.js +292 -51
- package/src/lib/workflow-engine.js +330 -0
- package/src/lib/zkp-engine.js +286 -49
package/package.json
CHANGED
package/src/commands/a2a.js
CHANGED
|
@@ -754,7 +754,6 @@ export function registerA2aCommand(program) {
|
|
|
754
754
|
registerA2aV2Command(a2a);
|
|
755
755
|
}
|
|
756
756
|
|
|
757
|
-
|
|
758
757
|
import {
|
|
759
758
|
A2A_AGENT_MATURITY_V2,
|
|
760
759
|
A2A_MESSAGE_LIFECYCLE_V2,
|
|
@@ -786,31 +785,200 @@ import {
|
|
|
786
785
|
} from "../lib/a2a-protocol.js";
|
|
787
786
|
|
|
788
787
|
export function registerA2aV2Command(a2a) {
|
|
789
|
-
a2a
|
|
790
|
-
|
|
791
|
-
.
|
|
792
|
-
.action((
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
788
|
+
a2a
|
|
789
|
+
.command("enums-v2")
|
|
790
|
+
.description("Show V2 governance enums")
|
|
791
|
+
.action(() => {
|
|
792
|
+
console.log(
|
|
793
|
+
JSON.stringify(
|
|
794
|
+
{ A2A_AGENT_MATURITY_V2, A2A_MESSAGE_LIFECYCLE_V2 },
|
|
795
|
+
null,
|
|
796
|
+
2,
|
|
797
|
+
),
|
|
798
|
+
);
|
|
799
|
+
});
|
|
800
|
+
a2a
|
|
801
|
+
.command("register-agent-v2")
|
|
802
|
+
.description("Register an a2a agent profile (pending)")
|
|
803
|
+
.requiredOption("--id <id>")
|
|
804
|
+
.requiredOption("--owner <owner>")
|
|
805
|
+
.option("--capabilities <csv>")
|
|
806
|
+
.action((o) => {
|
|
807
|
+
const caps = o.capabilities
|
|
808
|
+
? o.capabilities
|
|
809
|
+
.split(",")
|
|
810
|
+
.map((s) => s.trim())
|
|
811
|
+
.filter(Boolean)
|
|
812
|
+
: [];
|
|
813
|
+
console.log(
|
|
814
|
+
JSON.stringify(
|
|
815
|
+
registerA2aAgentV2({ id: o.id, owner: o.owner, capabilities: caps }),
|
|
816
|
+
null,
|
|
817
|
+
2,
|
|
818
|
+
),
|
|
819
|
+
);
|
|
820
|
+
});
|
|
821
|
+
a2a
|
|
822
|
+
.command("activate-agent-v2 <id>")
|
|
823
|
+
.description("Activate agent")
|
|
824
|
+
.action((id) => {
|
|
825
|
+
console.log(JSON.stringify(activateA2aAgentV2(id), null, 2));
|
|
826
|
+
});
|
|
827
|
+
a2a
|
|
828
|
+
.command("suspend-agent-v2 <id>")
|
|
829
|
+
.description("Suspend agent")
|
|
830
|
+
.action((id) => {
|
|
831
|
+
console.log(JSON.stringify(suspendA2aAgentV2(id), null, 2));
|
|
832
|
+
});
|
|
833
|
+
a2a
|
|
834
|
+
.command("retire-agent-v2 <id>")
|
|
835
|
+
.description("Retire agent (terminal)")
|
|
836
|
+
.action((id) => {
|
|
837
|
+
console.log(JSON.stringify(retireA2aAgentV2(id), null, 2));
|
|
838
|
+
});
|
|
839
|
+
a2a
|
|
840
|
+
.command("touch-agent-v2 <id>")
|
|
841
|
+
.description("Refresh lastTouchedAt")
|
|
842
|
+
.action((id) => {
|
|
843
|
+
console.log(JSON.stringify(touchA2aAgentV2(id), null, 2));
|
|
844
|
+
});
|
|
845
|
+
a2a
|
|
846
|
+
.command("get-agent-v2 <id>")
|
|
847
|
+
.description("Get agent")
|
|
848
|
+
.action((id) => {
|
|
849
|
+
console.log(JSON.stringify(getA2aAgentV2(id), null, 2));
|
|
850
|
+
});
|
|
851
|
+
a2a
|
|
852
|
+
.command("list-agents-v2")
|
|
853
|
+
.description("List agents")
|
|
854
|
+
.action(() => {
|
|
855
|
+
console.log(JSON.stringify(listA2aAgentsV2(), null, 2));
|
|
856
|
+
});
|
|
857
|
+
a2a
|
|
858
|
+
.command("create-message-v2")
|
|
859
|
+
.description("Create an a2a message (queued)")
|
|
860
|
+
.requiredOption("--id <id>")
|
|
861
|
+
.requiredOption("--agent-id <agentId>")
|
|
862
|
+
.option("--peer-id <peerId>")
|
|
863
|
+
.option("--payload <payload>")
|
|
864
|
+
.action((o) => {
|
|
865
|
+
console.log(
|
|
866
|
+
JSON.stringify(
|
|
867
|
+
createA2aMessageV2({
|
|
868
|
+
id: o.id,
|
|
869
|
+
agentId: o.agentId,
|
|
870
|
+
peerId: o.peerId,
|
|
871
|
+
payload: o.payload,
|
|
872
|
+
}),
|
|
873
|
+
null,
|
|
874
|
+
2,
|
|
875
|
+
),
|
|
876
|
+
);
|
|
877
|
+
});
|
|
878
|
+
a2a
|
|
879
|
+
.command("start-message-v2 <id>")
|
|
880
|
+
.description("Transition message to sending")
|
|
881
|
+
.action((id) => {
|
|
882
|
+
console.log(JSON.stringify(startA2aMessageV2(id), null, 2));
|
|
883
|
+
});
|
|
884
|
+
a2a
|
|
885
|
+
.command("deliver-message-v2 <id>")
|
|
886
|
+
.description("Transition message to delivered")
|
|
887
|
+
.action((id) => {
|
|
888
|
+
console.log(JSON.stringify(deliverA2aMessageV2(id), null, 2));
|
|
889
|
+
});
|
|
890
|
+
a2a
|
|
891
|
+
.command("fail-message-v2 <id>")
|
|
892
|
+
.description("Fail message")
|
|
893
|
+
.option("--reason <r>")
|
|
894
|
+
.action((id, o) => {
|
|
895
|
+
console.log(JSON.stringify(failA2aMessageV2(id, o.reason), null, 2));
|
|
896
|
+
});
|
|
897
|
+
a2a
|
|
898
|
+
.command("cancel-message-v2 <id>")
|
|
899
|
+
.description("Cancel message")
|
|
900
|
+
.option("--reason <r>")
|
|
901
|
+
.action((id, o) => {
|
|
902
|
+
console.log(JSON.stringify(cancelA2aMessageV2(id, o.reason), null, 2));
|
|
903
|
+
});
|
|
904
|
+
a2a
|
|
905
|
+
.command("get-message-v2 <id>")
|
|
906
|
+
.description("Get message")
|
|
907
|
+
.action((id) => {
|
|
908
|
+
console.log(JSON.stringify(getA2aMessageV2(id), null, 2));
|
|
909
|
+
});
|
|
910
|
+
a2a
|
|
911
|
+
.command("list-messages-v2")
|
|
912
|
+
.description("List messages")
|
|
913
|
+
.action(() => {
|
|
914
|
+
console.log(JSON.stringify(listA2aMessagesV2(), null, 2));
|
|
915
|
+
});
|
|
916
|
+
a2a
|
|
917
|
+
.command("set-max-active-agents-v2 <n>")
|
|
918
|
+
.description("Set per-owner active cap")
|
|
919
|
+
.action((n) => {
|
|
920
|
+
setMaxActiveA2aAgentsPerOwnerV2(Number(n));
|
|
921
|
+
console.log(
|
|
922
|
+
JSON.stringify(
|
|
923
|
+
{ maxActiveA2aAgentsPerOwner: getMaxActiveA2aAgentsPerOwnerV2() },
|
|
924
|
+
null,
|
|
925
|
+
2,
|
|
926
|
+
),
|
|
927
|
+
);
|
|
928
|
+
});
|
|
929
|
+
a2a
|
|
930
|
+
.command("set-max-pending-messages-v2 <n>")
|
|
931
|
+
.description("Set per-agent pending cap")
|
|
932
|
+
.action((n) => {
|
|
933
|
+
setMaxPendingA2aMessagesPerAgentV2(Number(n));
|
|
934
|
+
console.log(
|
|
935
|
+
JSON.stringify(
|
|
936
|
+
{
|
|
937
|
+
maxPendingA2aMessagesPerAgent: getMaxPendingA2aMessagesPerAgentV2(),
|
|
938
|
+
},
|
|
939
|
+
null,
|
|
940
|
+
2,
|
|
941
|
+
),
|
|
942
|
+
);
|
|
943
|
+
});
|
|
944
|
+
a2a
|
|
945
|
+
.command("set-agent-idle-ms-v2 <n>")
|
|
946
|
+
.description("Set idle threshold")
|
|
947
|
+
.action((n) => {
|
|
948
|
+
setA2aAgentIdleMsV2(Number(n));
|
|
949
|
+
console.log(
|
|
950
|
+
JSON.stringify({ a2aAgentIdleMs: getA2aAgentIdleMsV2() }, null, 2),
|
|
951
|
+
);
|
|
952
|
+
});
|
|
953
|
+
a2a
|
|
954
|
+
.command("set-message-stuck-ms-v2 <n>")
|
|
955
|
+
.description("Set stuck threshold")
|
|
956
|
+
.action((n) => {
|
|
957
|
+
setA2aMessageStuckMsV2(Number(n));
|
|
958
|
+
console.log(
|
|
959
|
+
JSON.stringify(
|
|
960
|
+
{ a2aMessageStuckMs: getA2aMessageStuckMsV2() },
|
|
961
|
+
null,
|
|
962
|
+
2,
|
|
963
|
+
),
|
|
964
|
+
);
|
|
965
|
+
});
|
|
966
|
+
a2a
|
|
967
|
+
.command("auto-suspend-idle-agents-v2")
|
|
968
|
+
.description("Auto-suspend idle agents")
|
|
969
|
+
.action(() => {
|
|
970
|
+
console.log(JSON.stringify(autoSuspendIdleA2aAgentsV2(), null, 2));
|
|
971
|
+
});
|
|
972
|
+
a2a
|
|
973
|
+
.command("auto-fail-stuck-messages-v2")
|
|
974
|
+
.description("Auto-fail stuck sending messages")
|
|
975
|
+
.action(() => {
|
|
976
|
+
console.log(JSON.stringify(autoFailStuckA2aMessagesV2(), null, 2));
|
|
977
|
+
});
|
|
978
|
+
a2a
|
|
979
|
+
.command("gov-stats-v2")
|
|
980
|
+
.description("V2 governance aggregate stats")
|
|
981
|
+
.action(() => {
|
|
982
|
+
console.log(JSON.stringify(getA2aProtocolGovStatsV2(), null, 2));
|
|
983
|
+
});
|
|
815
984
|
}
|
|
816
|
-
|
|
@@ -533,7 +533,6 @@ export function registerActivityPubCommand(program) {
|
|
|
533
533
|
registerActivityPubV2Command(ap);
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
-
|
|
537
536
|
import {
|
|
538
537
|
AP_ACTOR_MATURITY_V2,
|
|
539
538
|
AP_ACTIVITY_LIFECYCLE_V2,
|
|
@@ -565,30 +564,368 @@ import {
|
|
|
565
564
|
} from "../lib/activitypub-bridge.js";
|
|
566
565
|
|
|
567
566
|
export function registerActivityPubV2Command(ap) {
|
|
568
|
-
ap.command("enums-v2")
|
|
569
|
-
|
|
570
|
-
.
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
.
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
ap.command("
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
ap.command("
|
|
593
|
-
|
|
567
|
+
ap.command("enums-v2")
|
|
568
|
+
.description("Show V2 enums")
|
|
569
|
+
.action(() => {
|
|
570
|
+
console.log(
|
|
571
|
+
JSON.stringify(
|
|
572
|
+
{ AP_ACTOR_MATURITY_V2, AP_ACTIVITY_LIFECYCLE_V2 },
|
|
573
|
+
null,
|
|
574
|
+
2,
|
|
575
|
+
),
|
|
576
|
+
);
|
|
577
|
+
});
|
|
578
|
+
ap.command("register-actor-v2")
|
|
579
|
+
.description("Register an AP actor profile (pending)")
|
|
580
|
+
.requiredOption("--id <id>")
|
|
581
|
+
.requiredOption("--owner <owner>")
|
|
582
|
+
.option("--handle <handle>")
|
|
583
|
+
.action((o) => {
|
|
584
|
+
console.log(JSON.stringify(registerApActorV2(o), null, 2));
|
|
585
|
+
});
|
|
586
|
+
ap.command("activate-actor-v2 <id>")
|
|
587
|
+
.description("Activate actor")
|
|
588
|
+
.action((id) => {
|
|
589
|
+
console.log(JSON.stringify(activateApActorV2(id), null, 2));
|
|
590
|
+
});
|
|
591
|
+
ap.command("suspend-actor-v2 <id>")
|
|
592
|
+
.description("Suspend actor")
|
|
593
|
+
.action((id) => {
|
|
594
|
+
console.log(JSON.stringify(suspendApActorV2(id), null, 2));
|
|
595
|
+
});
|
|
596
|
+
ap.command("deactivate-actor-v2 <id>")
|
|
597
|
+
.description("Deactivate actor (terminal)")
|
|
598
|
+
.action((id) => {
|
|
599
|
+
console.log(JSON.stringify(deactivateApActorV2(id), null, 2));
|
|
600
|
+
});
|
|
601
|
+
ap.command("touch-actor-v2 <id>")
|
|
602
|
+
.description("Refresh lastTouchedAt")
|
|
603
|
+
.action((id) => {
|
|
604
|
+
console.log(JSON.stringify(touchApActorV2(id), null, 2));
|
|
605
|
+
});
|
|
606
|
+
ap.command("get-actor-v2 <id>")
|
|
607
|
+
.description("Get actor")
|
|
608
|
+
.action((id) => {
|
|
609
|
+
console.log(JSON.stringify(getApActorV2(id), null, 2));
|
|
610
|
+
});
|
|
611
|
+
ap.command("list-actors-v2")
|
|
612
|
+
.description("List actors")
|
|
613
|
+
.action(() => {
|
|
614
|
+
console.log(JSON.stringify(listApActorsV2(), null, 2));
|
|
615
|
+
});
|
|
616
|
+
ap.command("create-activity-v2")
|
|
617
|
+
.description("Create an AP activity (queued)")
|
|
618
|
+
.requiredOption("--id <id>")
|
|
619
|
+
.requiredOption("--actor-id <actorId>")
|
|
620
|
+
.option("--kind <kind>")
|
|
621
|
+
.action((o) => {
|
|
622
|
+
console.log(
|
|
623
|
+
JSON.stringify(
|
|
624
|
+
createApActivityV2({ id: o.id, actorId: o.actorId, kind: o.kind }),
|
|
625
|
+
null,
|
|
626
|
+
2,
|
|
627
|
+
),
|
|
628
|
+
);
|
|
629
|
+
});
|
|
630
|
+
ap.command("start-activity-v2 <id>")
|
|
631
|
+
.description("Transition activity to delivering")
|
|
632
|
+
.action((id) => {
|
|
633
|
+
console.log(JSON.stringify(startApActivityV2(id), null, 2));
|
|
634
|
+
});
|
|
635
|
+
ap.command("deliver-activity-v2 <id>")
|
|
636
|
+
.description("Transition activity to delivered")
|
|
637
|
+
.action((id) => {
|
|
638
|
+
console.log(JSON.stringify(deliverApActivityV2(id), null, 2));
|
|
639
|
+
});
|
|
640
|
+
ap.command("fail-activity-v2 <id>")
|
|
641
|
+
.description("Fail activity")
|
|
642
|
+
.option("--reason <r>")
|
|
643
|
+
.action((id, o) => {
|
|
644
|
+
console.log(JSON.stringify(failApActivityV2(id, o.reason), null, 2));
|
|
645
|
+
});
|
|
646
|
+
ap.command("cancel-activity-v2 <id>")
|
|
647
|
+
.description("Cancel activity")
|
|
648
|
+
.option("--reason <r>")
|
|
649
|
+
.action((id, o) => {
|
|
650
|
+
console.log(JSON.stringify(cancelApActivityV2(id, o.reason), null, 2));
|
|
651
|
+
});
|
|
652
|
+
ap.command("get-activity-v2 <id>")
|
|
653
|
+
.description("Get activity")
|
|
654
|
+
.action((id) => {
|
|
655
|
+
console.log(JSON.stringify(getApActivityV2(id), null, 2));
|
|
656
|
+
});
|
|
657
|
+
ap.command("list-activities-v2")
|
|
658
|
+
.description("List activities")
|
|
659
|
+
.action(() => {
|
|
660
|
+
console.log(JSON.stringify(listApActivitiesV2(), null, 2));
|
|
661
|
+
});
|
|
662
|
+
ap.command("set-max-active-actors-v2 <n>")
|
|
663
|
+
.description("Set per-owner active cap")
|
|
664
|
+
.action((n) => {
|
|
665
|
+
setMaxActiveApActorsPerOwnerV2(Number(n));
|
|
666
|
+
console.log(
|
|
667
|
+
JSON.stringify(
|
|
668
|
+
{ maxActiveApActorsPerOwner: getMaxActiveApActorsPerOwnerV2() },
|
|
669
|
+
null,
|
|
670
|
+
2,
|
|
671
|
+
),
|
|
672
|
+
);
|
|
673
|
+
});
|
|
674
|
+
ap.command("set-max-pending-activities-v2 <n>")
|
|
675
|
+
.description("Set per-actor pending cap")
|
|
676
|
+
.action((n) => {
|
|
677
|
+
setMaxPendingApActivitiesPerActorV2(Number(n));
|
|
678
|
+
console.log(
|
|
679
|
+
JSON.stringify(
|
|
680
|
+
{
|
|
681
|
+
maxPendingApActivitiesPerActor:
|
|
682
|
+
getMaxPendingApActivitiesPerActorV2(),
|
|
683
|
+
},
|
|
684
|
+
null,
|
|
685
|
+
2,
|
|
686
|
+
),
|
|
687
|
+
);
|
|
688
|
+
});
|
|
689
|
+
ap.command("set-actor-idle-ms-v2 <n>")
|
|
690
|
+
.description("Set idle threshold")
|
|
691
|
+
.action((n) => {
|
|
692
|
+
setApActorIdleMsV2(Number(n));
|
|
693
|
+
console.log(
|
|
694
|
+
JSON.stringify({ apActorIdleMs: getApActorIdleMsV2() }, null, 2),
|
|
695
|
+
);
|
|
696
|
+
});
|
|
697
|
+
ap.command("set-activity-stuck-ms-v2 <n>")
|
|
698
|
+
.description("Set stuck threshold")
|
|
699
|
+
.action((n) => {
|
|
700
|
+
setApActivityStuckMsV2(Number(n));
|
|
701
|
+
console.log(
|
|
702
|
+
JSON.stringify(
|
|
703
|
+
{ apActivityStuckMs: getApActivityStuckMsV2() },
|
|
704
|
+
null,
|
|
705
|
+
2,
|
|
706
|
+
),
|
|
707
|
+
);
|
|
708
|
+
});
|
|
709
|
+
ap.command("auto-suspend-idle-actors-v2")
|
|
710
|
+
.description("Auto-suspend idle actors")
|
|
711
|
+
.action(() => {
|
|
712
|
+
console.log(JSON.stringify(autoSuspendIdleApActorsV2(), null, 2));
|
|
713
|
+
});
|
|
714
|
+
ap.command("auto-fail-stuck-activities-v2")
|
|
715
|
+
.description("Auto-fail stuck delivering activities")
|
|
716
|
+
.action(() => {
|
|
717
|
+
console.log(JSON.stringify(autoFailStuckApActivitiesV2(), null, 2));
|
|
718
|
+
});
|
|
719
|
+
ap.command("gov-stats-v2")
|
|
720
|
+
.description("V2 governance aggregate stats")
|
|
721
|
+
.action(() => {
|
|
722
|
+
console.log(JSON.stringify(getActivityPubBridgeStatsV2(), null, 2));
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// === Iter21 V2 governance overlay ===
|
|
727
|
+
export function registerApgovV2Commands(program) {
|
|
728
|
+
const parent = program.commands.find((c) => c.name() === "activitypub");
|
|
729
|
+
if (!parent) return;
|
|
730
|
+
const L = async () => await import("../lib/activitypub-bridge.js");
|
|
731
|
+
parent
|
|
732
|
+
.command("apgov-enums-v2")
|
|
733
|
+
.description("Show V2 enums")
|
|
734
|
+
.action(async () => {
|
|
735
|
+
const m = await L();
|
|
736
|
+
console.log(
|
|
737
|
+
JSON.stringify(
|
|
738
|
+
{
|
|
739
|
+
profileMaturity: m.APGOV_PROFILE_MATURITY_V2,
|
|
740
|
+
deliveryLifecycle: m.APGOV_DELIVERY_LIFECYCLE_V2,
|
|
741
|
+
},
|
|
742
|
+
null,
|
|
743
|
+
2,
|
|
744
|
+
),
|
|
745
|
+
);
|
|
746
|
+
});
|
|
747
|
+
parent
|
|
748
|
+
.command("apgov-config-v2")
|
|
749
|
+
.description("Show V2 config")
|
|
750
|
+
.action(async () => {
|
|
751
|
+
const m = await L();
|
|
752
|
+
console.log(
|
|
753
|
+
JSON.stringify(
|
|
754
|
+
{
|
|
755
|
+
maxActive: m.getMaxActiveApgovProfilesPerOwnerV2(),
|
|
756
|
+
maxPending: m.getMaxPendingApgovDeliverysPerProfileV2(),
|
|
757
|
+
idleMs: m.getApgovProfileIdleMsV2(),
|
|
758
|
+
stuckMs: m.getApgovDeliveryStuckMsV2(),
|
|
759
|
+
},
|
|
760
|
+
null,
|
|
761
|
+
2,
|
|
762
|
+
),
|
|
763
|
+
);
|
|
764
|
+
});
|
|
765
|
+
parent
|
|
766
|
+
.command("apgov-set-max-active-v2 <n>")
|
|
767
|
+
.description("Set max active")
|
|
768
|
+
.action(async (n) => {
|
|
769
|
+
(await L()).setMaxActiveApgovProfilesPerOwnerV2(Number(n));
|
|
770
|
+
console.log("ok");
|
|
771
|
+
});
|
|
772
|
+
parent
|
|
773
|
+
.command("apgov-set-max-pending-v2 <n>")
|
|
774
|
+
.description("Set max pending")
|
|
775
|
+
.action(async (n) => {
|
|
776
|
+
(await L()).setMaxPendingApgovDeliverysPerProfileV2(Number(n));
|
|
777
|
+
console.log("ok");
|
|
778
|
+
});
|
|
779
|
+
parent
|
|
780
|
+
.command("apgov-set-idle-ms-v2 <n>")
|
|
781
|
+
.description("Set idle threshold ms")
|
|
782
|
+
.action(async (n) => {
|
|
783
|
+
(await L()).setApgovProfileIdleMsV2(Number(n));
|
|
784
|
+
console.log("ok");
|
|
785
|
+
});
|
|
786
|
+
parent
|
|
787
|
+
.command("apgov-set-stuck-ms-v2 <n>")
|
|
788
|
+
.description("Set stuck threshold ms")
|
|
789
|
+
.action(async (n) => {
|
|
790
|
+
(await L()).setApgovDeliveryStuckMsV2(Number(n));
|
|
791
|
+
console.log("ok");
|
|
792
|
+
});
|
|
793
|
+
parent
|
|
794
|
+
.command("apgov-register-v2 <id> <owner>")
|
|
795
|
+
.description("Register V2 profile")
|
|
796
|
+
.option("--actor <v>", "actor")
|
|
797
|
+
.action(async (id, owner, o) => {
|
|
798
|
+
const m = await L();
|
|
799
|
+
console.log(
|
|
800
|
+
JSON.stringify(
|
|
801
|
+
m.registerApgovProfileV2({ id, owner, actor: o.actor }),
|
|
802
|
+
null,
|
|
803
|
+
2,
|
|
804
|
+
),
|
|
805
|
+
);
|
|
806
|
+
});
|
|
807
|
+
parent
|
|
808
|
+
.command("apgov-activate-v2 <id>")
|
|
809
|
+
.description("Activate profile")
|
|
810
|
+
.action(async (id) => {
|
|
811
|
+
console.log(
|
|
812
|
+
JSON.stringify((await L()).activateApgovProfileV2(id), null, 2),
|
|
813
|
+
);
|
|
814
|
+
});
|
|
815
|
+
parent
|
|
816
|
+
.command("apgov-suspend-v2 <id>")
|
|
817
|
+
.description("Suspend profile")
|
|
818
|
+
.action(async (id) => {
|
|
819
|
+
console.log(
|
|
820
|
+
JSON.stringify((await L()).suspendApgovProfileV2(id), null, 2),
|
|
821
|
+
);
|
|
822
|
+
});
|
|
823
|
+
parent
|
|
824
|
+
.command("apgov-archive-v2 <id>")
|
|
825
|
+
.description("Archive profile")
|
|
826
|
+
.action(async (id) => {
|
|
827
|
+
console.log(
|
|
828
|
+
JSON.stringify((await L()).archiveApgovProfileV2(id), null, 2),
|
|
829
|
+
);
|
|
830
|
+
});
|
|
831
|
+
parent
|
|
832
|
+
.command("apgov-touch-v2 <id>")
|
|
833
|
+
.description("Touch profile")
|
|
834
|
+
.action(async (id) => {
|
|
835
|
+
console.log(JSON.stringify((await L()).touchApgovProfileV2(id), null, 2));
|
|
836
|
+
});
|
|
837
|
+
parent
|
|
838
|
+
.command("apgov-get-v2 <id>")
|
|
839
|
+
.description("Get profile")
|
|
840
|
+
.action(async (id) => {
|
|
841
|
+
console.log(JSON.stringify((await L()).getApgovProfileV2(id), null, 2));
|
|
842
|
+
});
|
|
843
|
+
parent
|
|
844
|
+
.command("apgov-list-v2")
|
|
845
|
+
.description("List profiles")
|
|
846
|
+
.action(async () => {
|
|
847
|
+
console.log(JSON.stringify((await L()).listApgovProfilesV2(), null, 2));
|
|
848
|
+
});
|
|
849
|
+
parent
|
|
850
|
+
.command("apgov-create-delivery-v2 <id> <profileId>")
|
|
851
|
+
.description("Create delivery")
|
|
852
|
+
.option("--inbox <v>", "inbox")
|
|
853
|
+
.action(async (id, profileId, o) => {
|
|
854
|
+
const m = await L();
|
|
855
|
+
console.log(
|
|
856
|
+
JSON.stringify(
|
|
857
|
+
m.createApgovDeliveryV2({ id, profileId, inbox: o.inbox }),
|
|
858
|
+
null,
|
|
859
|
+
2,
|
|
860
|
+
),
|
|
861
|
+
);
|
|
862
|
+
});
|
|
863
|
+
parent
|
|
864
|
+
.command("apgov-delivering-delivery-v2 <id>")
|
|
865
|
+
.description("Mark delivery as delivering")
|
|
866
|
+
.action(async (id) => {
|
|
867
|
+
console.log(
|
|
868
|
+
JSON.stringify((await L()).deliveringApgovDeliveryV2(id), null, 2),
|
|
869
|
+
);
|
|
870
|
+
});
|
|
871
|
+
parent
|
|
872
|
+
.command("apgov-complete-delivery-v2 <id>")
|
|
873
|
+
.description("Complete delivery")
|
|
874
|
+
.action(async (id) => {
|
|
875
|
+
console.log(
|
|
876
|
+
JSON.stringify((await L()).completeDeliveryApgovV2(id), null, 2),
|
|
877
|
+
);
|
|
878
|
+
});
|
|
879
|
+
parent
|
|
880
|
+
.command("apgov-fail-delivery-v2 <id> [reason]")
|
|
881
|
+
.description("Fail delivery")
|
|
882
|
+
.action(async (id, reason) => {
|
|
883
|
+
console.log(
|
|
884
|
+
JSON.stringify((await L()).failApgovDeliveryV2(id, reason), null, 2),
|
|
885
|
+
);
|
|
886
|
+
});
|
|
887
|
+
parent
|
|
888
|
+
.command("apgov-cancel-delivery-v2 <id> [reason]")
|
|
889
|
+
.description("Cancel delivery")
|
|
890
|
+
.action(async (id, reason) => {
|
|
891
|
+
console.log(
|
|
892
|
+
JSON.stringify((await L()).cancelApgovDeliveryV2(id, reason), null, 2),
|
|
893
|
+
);
|
|
894
|
+
});
|
|
895
|
+
parent
|
|
896
|
+
.command("apgov-get-delivery-v2 <id>")
|
|
897
|
+
.description("Get delivery")
|
|
898
|
+
.action(async (id) => {
|
|
899
|
+
console.log(JSON.stringify((await L()).getApgovDeliveryV2(id), null, 2));
|
|
900
|
+
});
|
|
901
|
+
parent
|
|
902
|
+
.command("apgov-list-deliverys-v2")
|
|
903
|
+
.description("List deliverys")
|
|
904
|
+
.action(async () => {
|
|
905
|
+
console.log(JSON.stringify((await L()).listApgovDeliverysV2(), null, 2));
|
|
906
|
+
});
|
|
907
|
+
parent
|
|
908
|
+
.command("apgov-auto-suspend-idle-v2")
|
|
909
|
+
.description("Auto-suspend idle")
|
|
910
|
+
.action(async () => {
|
|
911
|
+
console.log(
|
|
912
|
+
JSON.stringify((await L()).autoSuspendIdleApgovProfilesV2(), null, 2),
|
|
913
|
+
);
|
|
914
|
+
});
|
|
915
|
+
parent
|
|
916
|
+
.command("apgov-auto-fail-stuck-v2")
|
|
917
|
+
.description("Auto-fail stuck deliverys")
|
|
918
|
+
.action(async () => {
|
|
919
|
+
console.log(
|
|
920
|
+
JSON.stringify((await L()).autoFailStuckApgovDeliverysV2(), null, 2),
|
|
921
|
+
);
|
|
922
|
+
});
|
|
923
|
+
parent
|
|
924
|
+
.command("apgov-gov-stats-v2")
|
|
925
|
+
.description("V2 gov stats")
|
|
926
|
+
.action(async () => {
|
|
927
|
+
console.log(
|
|
928
|
+
JSON.stringify((await L()).getActivityPubBridgeGovStatsV2(), null, 2),
|
|
929
|
+
);
|
|
930
|
+
});
|
|
594
931
|
}
|