claude-code-swarm 0.3.2 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CLAUDE.md +4 -0
- package/README.md +65 -0
- package/package.json +4 -4
- package/src/__tests__/config.test.mjs +128 -0
- package/src/__tests__/index.test.mjs +2 -0
- package/src/__tests__/paths.test.mjs +13 -0
- package/src/config.mjs +46 -16
- package/src/index.mjs +3 -1
- package/src/map-connection.mjs +3 -3
- package/src/paths.mjs +5 -0
- package/src/sidecar-client.mjs +2 -2
- package/references/multi-agent-protocol/.sudocode/issues.jsonl +0 -120
- package/references/multi-agent-protocol/.sudocode/specs.jsonl +0 -15
- package/references/multi-agent-protocol/LICENSE +0 -21
- package/references/multi-agent-protocol/README.md +0 -113
- package/references/multi-agent-protocol/docs/00-design-specification.md +0 -496
- package/references/multi-agent-protocol/docs/01-open-questions.md +0 -1050
- package/references/multi-agent-protocol/docs/02-wire-protocol.md +0 -296
- package/references/multi-agent-protocol/docs/03-streaming-semantics.md +0 -252
- package/references/multi-agent-protocol/docs/04-error-handling.md +0 -231
- package/references/multi-agent-protocol/docs/05-connection-model.md +0 -244
- package/references/multi-agent-protocol/docs/06-visibility-permissions.md +0 -243
- package/references/multi-agent-protocol/docs/07-federation.md +0 -335
- package/references/multi-agent-protocol/docs/08-macro-agent-migration.md +0 -253
- package/references/multi-agent-protocol/docs/09-authentication.md +0 -748
- package/references/multi-agent-protocol/docs/10-environment-awareness.md +0 -242
- package/references/multi-agent-protocol/docs/10-mail-protocol.md +0 -553
- package/references/multi-agent-protocol/docs/11-anp-inspired-improvements.md +0 -1079
- package/references/multi-agent-protocol/docs/11-trajectory-protocol.md +0 -292
- package/references/multi-agent-protocol/docs/12-anp-implementation-plan.md +0 -641
- package/references/multi-agent-protocol/docs/agent-iam-integration.md +0 -877
- package/references/multi-agent-protocol/docs/agentic-mesh-integration-draft.md +0 -459
- package/references/multi-agent-protocol/docs/git-transport-draft.md +0 -251
- package/references/multi-agent-protocol/docs-site/Gemfile +0 -22
- package/references/multi-agent-protocol/docs-site/README.md +0 -82
- package/references/multi-agent-protocol/docs-site/_config.yml +0 -91
- package/references/multi-agent-protocol/docs-site/_includes/head_custom.html +0 -20
- package/references/multi-agent-protocol/docs-site/_sass/color_schemes/map.scss +0 -42
- package/references/multi-agent-protocol/docs-site/_sass/custom/custom.scss +0 -34
- package/references/multi-agent-protocol/docs-site/examples/full-integration.md +0 -510
- package/references/multi-agent-protocol/docs-site/examples/index.md +0 -138
- package/references/multi-agent-protocol/docs-site/examples/simple-chat.md +0 -282
- package/references/multi-agent-protocol/docs-site/examples/task-queue.md +0 -399
- package/references/multi-agent-protocol/docs-site/getting-started/index.md +0 -98
- package/references/multi-agent-protocol/docs-site/getting-started/installation.md +0 -219
- package/references/multi-agent-protocol/docs-site/getting-started/overview.md +0 -172
- package/references/multi-agent-protocol/docs-site/getting-started/quickstart.md +0 -237
- package/references/multi-agent-protocol/docs-site/index.md +0 -136
- package/references/multi-agent-protocol/docs-site/protocol/authentication.md +0 -391
- package/references/multi-agent-protocol/docs-site/protocol/connection-model.md +0 -376
- package/references/multi-agent-protocol/docs-site/protocol/design.md +0 -284
- package/references/multi-agent-protocol/docs-site/protocol/error-handling.md +0 -312
- package/references/multi-agent-protocol/docs-site/protocol/federation.md +0 -449
- package/references/multi-agent-protocol/docs-site/protocol/index.md +0 -129
- package/references/multi-agent-protocol/docs-site/protocol/permissions.md +0 -398
- package/references/multi-agent-protocol/docs-site/protocol/streaming.md +0 -353
- package/references/multi-agent-protocol/docs-site/protocol/wire-protocol.md +0 -369
- package/references/multi-agent-protocol/docs-site/sdk/api/agent.md +0 -357
- package/references/multi-agent-protocol/docs-site/sdk/api/client.md +0 -380
- package/references/multi-agent-protocol/docs-site/sdk/api/index.md +0 -62
- package/references/multi-agent-protocol/docs-site/sdk/api/server.md +0 -453
- package/references/multi-agent-protocol/docs-site/sdk/api/types.md +0 -468
- package/references/multi-agent-protocol/docs-site/sdk/guides/agent.md +0 -375
- package/references/multi-agent-protocol/docs-site/sdk/guides/authentication.md +0 -405
- package/references/multi-agent-protocol/docs-site/sdk/guides/client.md +0 -352
- package/references/multi-agent-protocol/docs-site/sdk/guides/index.md +0 -89
- package/references/multi-agent-protocol/docs-site/sdk/guides/server.md +0 -360
- package/references/multi-agent-protocol/docs-site/sdk/guides/testing.md +0 -446
- package/references/multi-agent-protocol/docs-site/sdk/guides/transports.md +0 -363
- package/references/multi-agent-protocol/docs-site/sdk/index.md +0 -206
- package/references/multi-agent-protocol/package-lock.json +0 -4230
- package/references/multi-agent-protocol/package.json +0 -56
- package/references/multi-agent-protocol/schema/meta.json +0 -584
- package/references/multi-agent-protocol/schema/schema.json +0 -3067
- package/references/openhive/.claude/settings.json +0 -6
- package/references/openhive/.dockerignore +0 -54
- package/references/openhive/.github/workflows/docker.yml +0 -52
- package/references/openhive/.sudocode/issues.jsonl +0 -24
- package/references/openhive/.sudocode/specs.jsonl +0 -4
- package/references/openhive/CLAUDE.md +0 -88
- package/references/openhive/Dockerfile +0 -105
- package/references/openhive/README.md +0 -745
- package/references/openhive/bin/openhive.js +0 -6
- package/references/openhive/cloudbuild.yaml +0 -80
- package/references/openhive/deploy/cloud-run.sh +0 -106
- package/references/openhive/deploy/openhive.env.example +0 -80
- package/references/openhive/deploy/openhive.service +0 -91
- package/references/openhive/docker-compose.yml +0 -67
- package/references/openhive/docker-entrypoint.sh +0 -117
- package/references/openhive/docs/API_MIGRATION.md +0 -176
- package/references/openhive/docs/DEPLOYMENT.md +0 -847
- package/references/openhive/docs/DESIGN_v1.md +0 -489
- package/references/openhive/docs/DESIGN_v2.md +0 -564
- package/references/openhive/docs/HEADSCALE_HOSTING_SPEC.md +0 -513
- package/references/openhive/docs/HIVE_SYNC_DESIGN.md +0 -2362
- package/references/openhive/docs/HIVE_SYNC_IMPLEMENTATION_PLAN.md +0 -1169
- package/references/openhive/docs/HOSTING.md +0 -601
- package/references/openhive/docs/IMPLEMENTATION_PLAN.md +0 -428
- package/references/openhive/docs/LOCAL_SETUP.md +0 -506
- package/references/openhive/docs/MACRO_AGENT_ATLAS_EXTENSION.md +0 -351
- package/references/openhive/docs/MEMORY_BANK_SYNC_SPEC.md +0 -909
- package/references/openhive/docs/PLAN_v1.md +0 -471
- package/references/openhive/docs/PLAN_v2.md +0 -623
- package/references/openhive/docs/WEBSOCKET.md +0 -267
- package/references/openhive/docs/openswarm-bootstrap-token-spec.md +0 -240
- package/references/openhive/ecosystem.config.cjs +0 -76
- package/references/openhive/fly.toml +0 -63
- package/references/openhive/package-lock.json +0 -17640
- package/references/openhive/package.json +0 -128
- package/references/openhive/packages/openhive-types/package-lock.json +0 -1473
- package/references/openhive/packages/openhive-types/package.json +0 -42
- package/references/openhive/packages/openhive-types/src/index.ts +0 -36
- package/references/openhive/packages/openhive-types/src/map-coordination.ts +0 -92
- package/references/openhive/packages/openhive-types/src/map-session-sync.ts +0 -50
- package/references/openhive/packages/openhive-types/src/map-sync.ts +0 -68
- package/references/openhive/packages/openhive-types/tsconfig.json +0 -15
- package/references/openhive/packages/openhive-types/tsconfig.tsbuildinfo +0 -1
- package/references/openhive/packages/openhive-types/tsup.config.ts +0 -12
- package/references/openhive/railway.json +0 -13
- package/references/openhive/railway.toml +0 -24
- package/references/openhive/render.yaml +0 -51
- package/references/openhive/src/__tests__/auth.test.ts +0 -148
- package/references/openhive/src/__tests__/bridge/credentials.test.ts +0 -65
- package/references/openhive/src/__tests__/bridge/dal.test.ts +0 -279
- package/references/openhive/src/__tests__/bridge/inbound.test.ts +0 -349
- package/references/openhive/src/__tests__/bridge/manager.test.ts +0 -419
- package/references/openhive/src/__tests__/bridge/mentions.test.ts +0 -83
- package/references/openhive/src/__tests__/bridge/outbound.test.ts +0 -209
- package/references/openhive/src/__tests__/bridge/slack-adapter.test.ts +0 -276
- package/references/openhive/src/__tests__/cli.test.ts +0 -342
- package/references/openhive/src/__tests__/config.test.ts +0 -205
- package/references/openhive/src/__tests__/coordination/coordination.test.ts +0 -1072
- package/references/openhive/src/__tests__/coordination/cross-instance.test.ts +0 -540
- package/references/openhive/src/__tests__/coordination/e2e.test.ts +0 -780
- package/references/openhive/src/__tests__/data-dir.test.ts +0 -332
- package/references/openhive/src/__tests__/db.test.ts +0 -258
- package/references/openhive/src/__tests__/discovery.test.ts +0 -288
- package/references/openhive/src/__tests__/events/dal.test.ts +0 -371
- package/references/openhive/src/__tests__/events/dispatch.test.ts +0 -202
- package/references/openhive/src/__tests__/events/e2e.test.ts +0 -528
- package/references/openhive/src/__tests__/events/normalizers.test.ts +0 -263
- package/references/openhive/src/__tests__/events/router.test.ts +0 -314
- package/references/openhive/src/__tests__/events/routes.test.ts +0 -407
- package/references/openhive/src/__tests__/follows.test.ts +0 -328
- package/references/openhive/src/__tests__/helpers/test-dirs.ts +0 -44
- package/references/openhive/src/__tests__/ingest-keys.test.ts +0 -925
- package/references/openhive/src/__tests__/map/sync-client-content.test.ts +0 -288
- package/references/openhive/src/__tests__/map/sync-client.test.ts +0 -500
- package/references/openhive/src/__tests__/map/sync-listener.test.ts +0 -504
- package/references/openhive/src/__tests__/middleware/hostname-guard.test.ts +0 -73
- package/references/openhive/src/__tests__/migrations.test.ts +0 -260
- package/references/openhive/src/__tests__/opentasks/client.test.ts +0 -497
- package/references/openhive/src/__tests__/opentasks/discovery.test.ts +0 -283
- package/references/openhive/src/__tests__/opentasks/e2e.test.ts +0 -767
- package/references/openhive/src/__tests__/routes/agents.test.ts +0 -417
- package/references/openhive/src/__tests__/routes/opentasks-content.test.ts +0 -493
- package/references/openhive/src/__tests__/routes/resource-content.test.ts +0 -1741
- package/references/openhive/src/__tests__/sessions/adapters.test.ts +0 -524
- package/references/openhive/src/__tests__/sessions/routes.test.ts +0 -1053
- package/references/openhive/src/__tests__/sessions/storage.test.ts +0 -545
- package/references/openhive/src/__tests__/sessions/trajectory-checkpoints.test.ts +0 -349
- package/references/openhive/src/__tests__/sessions/trajectory-routes.test.ts +0 -290
- package/references/openhive/src/__tests__/swarm/config.test.ts +0 -125
- package/references/openhive/src/__tests__/swarm/credentials.test.ts +0 -254
- package/references/openhive/src/__tests__/swarm/dal.test.ts +0 -290
- package/references/openhive/src/__tests__/swarm/e2e.test.ts +0 -827
- package/references/openhive/src/__tests__/swarm/fixtures/exit-immediately.js +0 -3
- package/references/openhive/src/__tests__/swarm/fixtures/map-server.js +0 -147
- package/references/openhive/src/__tests__/swarm/fixtures/sleep-server.js +0 -52
- package/references/openhive/src/__tests__/swarm/local-provider.test.ts +0 -279
- package/references/openhive/src/__tests__/swarm/manager.test.ts +0 -305
- package/references/openhive/src/__tests__/swarm/routes.test.ts +0 -396
- package/references/openhive/src/__tests__/swarm/workspace.test.ts +0 -257
- package/references/openhive/src/__tests__/swarmhub/client.test.ts +0 -324
- package/references/openhive/src/__tests__/swarmhub/config.test.ts +0 -213
- package/references/openhive/src/__tests__/swarmhub/connector.test.ts +0 -581
- package/references/openhive/src/__tests__/swarmhub/routes.test.ts +0 -639
- package/references/openhive/src/__tests__/swarmhub/slack-client.test.ts +0 -164
- package/references/openhive/src/__tests__/swarmhub/slack-connector.test.ts +0 -164
- package/references/openhive/src/__tests__/swarmhub/slack-routes.test.ts +0 -373
- package/references/openhive/src/__tests__/swarmhub/webhook-handler.test.ts +0 -295
- package/references/openhive/src/__tests__/sync/resource-sync.test.ts +0 -1418
- package/references/openhive/src/__tests__/sync/sync.test.ts +0 -800
- package/references/openhive/src/api/index.ts +0 -65
- package/references/openhive/src/api/middleware/auth.ts +0 -227
- package/references/openhive/src/api/middleware/hostname-guard.ts +0 -38
- package/references/openhive/src/api/routes/admin.ts +0 -366
- package/references/openhive/src/api/routes/agents.ts +0 -223
- package/references/openhive/src/api/routes/auth.ts +0 -164
- package/references/openhive/src/api/routes/bridges.ts +0 -384
- package/references/openhive/src/api/routes/comments.ts +0 -294
- package/references/openhive/src/api/routes/coordination.ts +0 -312
- package/references/openhive/src/api/routes/events.ts +0 -158
- package/references/openhive/src/api/routes/federation.ts +0 -367
- package/references/openhive/src/api/routes/feed.ts +0 -212
- package/references/openhive/src/api/routes/hives.ts +0 -264
- package/references/openhive/src/api/routes/map.ts +0 -674
- package/references/openhive/src/api/routes/memory-banks.ts +0 -971
- package/references/openhive/src/api/routes/posts.ts +0 -342
- package/references/openhive/src/api/routes/resource-content.ts +0 -727
- package/references/openhive/src/api/routes/resources.ts +0 -1013
- package/references/openhive/src/api/routes/search.ts +0 -45
- package/references/openhive/src/api/routes/sessions.ts +0 -1187
- package/references/openhive/src/api/routes/swarm-hosting.ts +0 -313
- package/references/openhive/src/api/routes/sync-protocol.ts +0 -168
- package/references/openhive/src/api/routes/sync.ts +0 -279
- package/references/openhive/src/api/routes/uploads.ts +0 -174
- package/references/openhive/src/api/routes/webhooks.ts +0 -603
- package/references/openhive/src/api/schemas/agents.ts +0 -26
- package/references/openhive/src/api/schemas/comments.ts +0 -22
- package/references/openhive/src/api/schemas/hives.ts +0 -33
- package/references/openhive/src/api/schemas/posts.ts +0 -37
- package/references/openhive/src/api/schemas/sync.ts +0 -56
- package/references/openhive/src/auth/index.ts +0 -2
- package/references/openhive/src/auth/jwks.ts +0 -58
- package/references/openhive/src/bridge/adapters/slack.ts +0 -306
- package/references/openhive/src/bridge/credentials.ts +0 -72
- package/references/openhive/src/bridge/inbound.ts +0 -288
- package/references/openhive/src/bridge/index.ts +0 -42
- package/references/openhive/src/bridge/manager.ts +0 -425
- package/references/openhive/src/bridge/mentions.ts +0 -42
- package/references/openhive/src/bridge/outbound.ts +0 -103
- package/references/openhive/src/bridge/schema.ts +0 -82
- package/references/openhive/src/bridge/types.ts +0 -238
- package/references/openhive/src/cli/network.ts +0 -480
- package/references/openhive/src/cli.ts +0 -620
- package/references/openhive/src/config.ts +0 -611
- package/references/openhive/src/coordination/index.ts +0 -43
- package/references/openhive/src/coordination/listener.ts +0 -92
- package/references/openhive/src/coordination/schema.ts +0 -79
- package/references/openhive/src/coordination/service.ts +0 -233
- package/references/openhive/src/coordination/types.ts +0 -177
- package/references/openhive/src/data-dir.ts +0 -105
- package/references/openhive/src/db/adapters/index.ts +0 -21
- package/references/openhive/src/db/adapters/postgres.ts +0 -310
- package/references/openhive/src/db/adapters/sqlite.ts +0 -56
- package/references/openhive/src/db/adapters/types.ts +0 -65
- package/references/openhive/src/db/dal/agents.ts +0 -430
- package/references/openhive/src/db/dal/bridge.ts +0 -336
- package/references/openhive/src/db/dal/comments.ts +0 -213
- package/references/openhive/src/db/dal/coordination.ts +0 -361
- package/references/openhive/src/db/dal/events.ts +0 -381
- package/references/openhive/src/db/dal/follows.ts +0 -96
- package/references/openhive/src/db/dal/hives.ts +0 -198
- package/references/openhive/src/db/dal/ingest-keys.ts +0 -176
- package/references/openhive/src/db/dal/instances.ts +0 -196
- package/references/openhive/src/db/dal/invites.ts +0 -123
- package/references/openhive/src/db/dal/map.ts +0 -750
- package/references/openhive/src/db/dal/posts.ts +0 -274
- package/references/openhive/src/db/dal/remote-agents.ts +0 -56
- package/references/openhive/src/db/dal/search.ts +0 -238
- package/references/openhive/src/db/dal/sync-events.ts +0 -160
- package/references/openhive/src/db/dal/sync-groups.ts +0 -100
- package/references/openhive/src/db/dal/sync-peer-configs.ts +0 -216
- package/references/openhive/src/db/dal/sync-peers.ts +0 -145
- package/references/openhive/src/db/dal/syncable-resources.ts +0 -888
- package/references/openhive/src/db/dal/trajectory-checkpoints.ts +0 -291
- package/references/openhive/src/db/dal/uploads.ts +0 -124
- package/references/openhive/src/db/dal/votes.ts +0 -124
- package/references/openhive/src/db/index.ts +0 -293
- package/references/openhive/src/db/providers/index.ts +0 -75
- package/references/openhive/src/db/providers/postgres.ts +0 -529
- package/references/openhive/src/db/providers/sqlite.ts +0 -1383
- package/references/openhive/src/db/providers/turso.ts +0 -1360
- package/references/openhive/src/db/providers/types.ts +0 -516
- package/references/openhive/src/db/schema.ts +0 -641
- package/references/openhive/src/discovery/index.ts +0 -403
- package/references/openhive/src/events/dispatch.ts +0 -106
- package/references/openhive/src/events/index.ts +0 -17
- package/references/openhive/src/events/normalizers/github.ts +0 -133
- package/references/openhive/src/events/normalizers/index.ts +0 -62
- package/references/openhive/src/events/normalizers/slack.ts +0 -50
- package/references/openhive/src/events/router.ts +0 -156
- package/references/openhive/src/events/schema.ts +0 -66
- package/references/openhive/src/events/types.ts +0 -130
- package/references/openhive/src/federation/index.ts +0 -1
- package/references/openhive/src/federation/service.ts +0 -776
- package/references/openhive/src/headscale/client.ts +0 -256
- package/references/openhive/src/headscale/config.ts +0 -212
- package/references/openhive/src/headscale/index.ts +0 -23
- package/references/openhive/src/headscale/manager.ts +0 -249
- package/references/openhive/src/headscale/sync.ts +0 -272
- package/references/openhive/src/headscale/types.ts +0 -231
- package/references/openhive/src/index.ts +0 -225
- package/references/openhive/src/map/client-entry.ts +0 -26
- package/references/openhive/src/map/index.ts +0 -76
- package/references/openhive/src/map/schema.ts +0 -119
- package/references/openhive/src/map/service.ts +0 -323
- package/references/openhive/src/map/sync-client.ts +0 -696
- package/references/openhive/src/map/sync-listener.ts +0 -409
- package/references/openhive/src/map/types.ts +0 -290
- package/references/openhive/src/network/factory.ts +0 -118
- package/references/openhive/src/network/headscale-provider.ts +0 -437
- package/references/openhive/src/network/index.ts +0 -43
- package/references/openhive/src/network/tailscale-client.ts +0 -289
- package/references/openhive/src/network/tailscale-provider.ts +0 -287
- package/references/openhive/src/network/types.ts +0 -178
- package/references/openhive/src/opentasks-client/client.ts +0 -374
- package/references/openhive/src/opentasks-client/index.ts +0 -7
- package/references/openhive/src/realtime/index.ts +0 -282
- package/references/openhive/src/server.ts +0 -1069
- package/references/openhive/src/services/email.ts +0 -177
- package/references/openhive/src/services/sitemap.ts +0 -135
- package/references/openhive/src/sessions/adapters/claude.ts +0 -466
- package/references/openhive/src/sessions/adapters/codex.ts +0 -265
- package/references/openhive/src/sessions/adapters/index.ts +0 -263
- package/references/openhive/src/sessions/adapters/raw.ts +0 -144
- package/references/openhive/src/sessions/adapters/types.ts +0 -83
- package/references/openhive/src/sessions/index.ts +0 -50
- package/references/openhive/src/sessions/storage/adapters/gcs.ts +0 -277
- package/references/openhive/src/sessions/storage/adapters/local.ts +0 -240
- package/references/openhive/src/sessions/storage/adapters/s3.ts +0 -321
- package/references/openhive/src/sessions/storage/index.ts +0 -231
- package/references/openhive/src/sessions/storage/types.ts +0 -189
- package/references/openhive/src/sessions/types.ts +0 -415
- package/references/openhive/src/shared/types/index.ts +0 -45
- package/references/openhive/src/shared/types/map-coordination.ts +0 -92
- package/references/openhive/src/shared/types/map-session-sync.ts +0 -170
- package/references/openhive/src/shared/types/map-sync.ts +0 -68
- package/references/openhive/src/skill.ts +0 -203
- package/references/openhive/src/storage/adapters/local.ts +0 -169
- package/references/openhive/src/storage/adapters/s3.ts +0 -195
- package/references/openhive/src/storage/index.ts +0 -64
- package/references/openhive/src/storage/types.ts +0 -69
- package/references/openhive/src/swarm/credentials.ts +0 -98
- package/references/openhive/src/swarm/dal.ts +0 -206
- package/references/openhive/src/swarm/index.ts +0 -28
- package/references/openhive/src/swarm/manager.ts +0 -917
- package/references/openhive/src/swarm/providers/local.ts +0 -338
- package/references/openhive/src/swarm/providers/sandboxed-local.ts +0 -478
- package/references/openhive/src/swarm/providers/workspace.ts +0 -52
- package/references/openhive/src/swarm/schema.ts +0 -43
- package/references/openhive/src/swarm/types.ts +0 -333
- package/references/openhive/src/swarmhub/client.ts +0 -279
- package/references/openhive/src/swarmhub/connector.ts +0 -463
- package/references/openhive/src/swarmhub/index.ts +0 -43
- package/references/openhive/src/swarmhub/routes.ts +0 -296
- package/references/openhive/src/swarmhub/types.ts +0 -213
- package/references/openhive/src/swarmhub/webhook-handler.ts +0 -126
- package/references/openhive/src/sync/compaction.ts +0 -193
- package/references/openhive/src/sync/coordination-hooks.ts +0 -154
- package/references/openhive/src/sync/crypto.ts +0 -79
- package/references/openhive/src/sync/gossip.ts +0 -136
- package/references/openhive/src/sync/hooks.ts +0 -202
- package/references/openhive/src/sync/materializer-repo.ts +0 -256
- package/references/openhive/src/sync/materializer.ts +0 -682
- package/references/openhive/src/sync/middleware.ts +0 -140
- package/references/openhive/src/sync/peer-resolver.ts +0 -157
- package/references/openhive/src/sync/resource-hooks.ts +0 -161
- package/references/openhive/src/sync/schema.ts +0 -158
- package/references/openhive/src/sync/service.ts +0 -990
- package/references/openhive/src/sync/types.ts +0 -369
- package/references/openhive/src/terminal/index.ts +0 -4
- package/references/openhive/src/terminal/pty-manager.ts +0 -337
- package/references/openhive/src/terminal/resolve-tui.ts +0 -44
- package/references/openhive/src/terminal/terminal-ws.ts +0 -251
- package/references/openhive/src/types.ts +0 -442
- package/references/openhive/src/utils/git-remote.ts +0 -329
- package/references/openhive/src/web/App.tsx +0 -77
- package/references/openhive/src/web/__tests__/components/dashboard/RecentActivity.test.tsx +0 -77
- package/references/openhive/src/web/__tests__/components/dashboard/StatsOverview.test.tsx +0 -62
- package/references/openhive/src/web/__tests__/components/dashboard/SwarmStatusSummary.test.tsx +0 -122
- package/references/openhive/src/web/__tests__/components/dashboard/SyncResourcesStatus.test.tsx +0 -104
- package/references/openhive/src/web/__tests__/components/layout/Sidebar.test.tsx +0 -110
- package/references/openhive/src/web/__tests__/components/swarm/StatusBadges.test.tsx +0 -65
- package/references/openhive/src/web/__tests__/components/terminal/query-responses.test.ts +0 -143
- package/references/openhive/src/web/__tests__/components/terminal/terminal-mouse.test.ts +0 -509
- package/references/openhive/src/web/__tests__/hooks/useEventsApi.test.ts +0 -378
- package/references/openhive/src/web/__tests__/pages/Dashboard.test.tsx +0 -57
- package/references/openhive/src/web/__tests__/pages/Events.test.tsx +0 -886
- package/references/openhive/src/web/__tests__/pages/Explore.test.tsx +0 -63
- package/references/openhive/src/web/__tests__/routing.test.tsx +0 -79
- package/references/openhive/src/web/__tests__/setup.ts +0 -37
- package/references/openhive/src/web/__tests__/stores/dashboard.test.ts +0 -49
- package/references/openhive/src/web/components/common/AgentBadge.tsx +0 -58
- package/references/openhive/src/web/components/common/Avatar.tsx +0 -78
- package/references/openhive/src/web/components/common/ErrorBoundary.tsx +0 -76
- package/references/openhive/src/web/components/common/Highlight.tsx +0 -79
- package/references/openhive/src/web/components/common/ImageUpload.tsx +0 -209
- package/references/openhive/src/web/components/common/LoadingSpinner.tsx +0 -37
- package/references/openhive/src/web/components/common/Logo.tsx +0 -21
- package/references/openhive/src/web/components/common/Markdown.tsx +0 -53
- package/references/openhive/src/web/components/common/ProtectedRoute.tsx +0 -18
- package/references/openhive/src/web/components/common/ThemeToggle.tsx +0 -38
- package/references/openhive/src/web/components/common/TimeAgo.tsx +0 -17
- package/references/openhive/src/web/components/common/Toast.tsx +0 -70
- package/references/openhive/src/web/components/common/VoteButtons.tsx +0 -100
- package/references/openhive/src/web/components/dashboard/RecentActivity.tsx +0 -100
- package/references/openhive/src/web/components/dashboard/StatsOverview.tsx +0 -40
- package/references/openhive/src/web/components/dashboard/SwarmStatusSummary.tsx +0 -89
- package/references/openhive/src/web/components/dashboard/SyncResourcesStatus.tsx +0 -81
- package/references/openhive/src/web/components/feed/FeedControls.tsx +0 -38
- package/references/openhive/src/web/components/feed/NewPostsIndicator.tsx +0 -75
- package/references/openhive/src/web/components/feed/PostCard.tsx +0 -129
- package/references/openhive/src/web/components/feed/PostList.tsx +0 -83
- package/references/openhive/src/web/components/layout/Footer.tsx +0 -5
- package/references/openhive/src/web/components/layout/Layout.tsx +0 -29
- package/references/openhive/src/web/components/layout/Sidebar.tsx +0 -348
- package/references/openhive/src/web/components/post/CommentForm.tsx +0 -59
- package/references/openhive/src/web/components/post/CommentTree.tsx +0 -145
- package/references/openhive/src/web/components/resources/MemoryBrowser.tsx +0 -208
- package/references/openhive/src/web/components/resources/OpenTasksSummary.tsx +0 -138
- package/references/openhive/src/web/components/resources/SkillBrowser.tsx +0 -284
- package/references/openhive/src/web/components/swarm/StatusBadges.tsx +0 -56
- package/references/openhive/src/web/components/terminal/TerminalPanel.tsx +0 -485
- package/references/openhive/src/web/components/terminal/index.ts +0 -2
- package/references/openhive/src/web/components/terminal/query-responses.ts +0 -70
- package/references/openhive/src/web/components/terminal/terminal-mouse.ts +0 -222
- package/references/openhive/src/web/hooks/useApi.ts +0 -740
- package/references/openhive/src/web/hooks/useDocumentTitle.ts +0 -49
- package/references/openhive/src/web/hooks/useInfiniteScroll.ts +0 -58
- package/references/openhive/src/web/hooks/useRealtimeUpdates.ts +0 -154
- package/references/openhive/src/web/hooks/useWebSocket.ts +0 -225
- package/references/openhive/src/web/index.html +0 -73
- package/references/openhive/src/web/lib/api.ts +0 -518
- package/references/openhive/src/web/main.tsx +0 -32
- package/references/openhive/src/web/pages/About.tsx +0 -131
- package/references/openhive/src/web/pages/Agent.tsx +0 -130
- package/references/openhive/src/web/pages/Agents.tsx +0 -69
- package/references/openhive/src/web/pages/AuthCallback.tsx +0 -75
- package/references/openhive/src/web/pages/Dashboard.tsx +0 -41
- package/references/openhive/src/web/pages/Events.tsx +0 -1025
- package/references/openhive/src/web/pages/Explore.tsx +0 -43
- package/references/openhive/src/web/pages/Hive.tsx +0 -134
- package/references/openhive/src/web/pages/Hives.tsx +0 -64
- package/references/openhive/src/web/pages/Home.tsx +0 -43
- package/references/openhive/src/web/pages/Login.tsx +0 -122
- package/references/openhive/src/web/pages/Post.tsx +0 -216
- package/references/openhive/src/web/pages/ResourceDetail.tsx +0 -426
- package/references/openhive/src/web/pages/Resources.tsx +0 -276
- package/references/openhive/src/web/pages/Search.tsx +0 -234
- package/references/openhive/src/web/pages/SessionDetail.tsx +0 -703
- package/references/openhive/src/web/pages/Sessions.tsx +0 -129
- package/references/openhive/src/web/pages/Settings.tsx +0 -826
- package/references/openhive/src/web/pages/SwarmCraft.tsx +0 -16
- package/references/openhive/src/web/pages/Swarms.tsx +0 -981
- package/references/openhive/src/web/pages/Terminal.tsx +0 -69
- package/references/openhive/src/web/postcss.config.js +0 -5
- package/references/openhive/src/web/public/favicon.svg +0 -11
- package/references/openhive/src/web/public/manifest.json +0 -21
- package/references/openhive/src/web/stores/auth.ts +0 -207
- package/references/openhive/src/web/stores/dashboard.ts +0 -23
- package/references/openhive/src/web/stores/realtime.ts +0 -90
- package/references/openhive/src/web/stores/theme.ts +0 -70
- package/references/openhive/src/web/stores/toast.ts +0 -63
- package/references/openhive/src/web/styles/globals.css +0 -503
- package/references/openhive/src/web/sw.ts +0 -228
- package/references/openhive/src/web/utils/serviceWorker.ts +0 -86
- package/references/openhive/src/web/vite.config.ts +0 -81
- package/references/openhive/tsconfig.json +0 -32
- package/references/openhive/tsup.config.ts +0 -17
- package/references/openhive/vitest.config.ts +0 -30
- package/references/openhive/vitest.web.config.ts +0 -20
- package/references/opentasks/.claude/settings.json +0 -6
- package/references/opentasks/.claude-plugin/plugin.json +0 -20
- package/references/opentasks/.lintstagedrc.json +0 -4
- package/references/opentasks/.prettierignore +0 -4
- package/references/opentasks/.prettierrc.json +0 -11
- package/references/opentasks/.sudocode/issues.jsonl +0 -89
- package/references/opentasks/.sudocode/specs.jsonl +0 -24
- package/references/opentasks/README.md +0 -401
- package/references/opentasks/docs/ARCHITECTURE.md +0 -841
- package/references/opentasks/docs/DESIGN.md +0 -689
- package/references/opentasks/docs/INTERFACE.md +0 -670
- package/references/opentasks/docs/PERSISTENCE.md +0 -1638
- package/references/opentasks/docs/PROVIDERS.md +0 -1412
- package/references/opentasks/docs/SCHEMA.md +0 -815
- package/references/opentasks/docs/TESTING.md +0 -1081
- package/references/opentasks/eslint.config.js +0 -58
- package/references/opentasks/package-lock.json +0 -4348
- package/references/opentasks/package.json +0 -81
- package/references/opentasks/skills/opentasks/SKILL.md +0 -139
- package/references/opentasks/skills/opentasks/dependency-management.md +0 -119
- package/references/opentasks/skills/opentasks/feedback-and-review.md +0 -100
- package/references/opentasks/skills/opentasks/linking-external-data.md +0 -103
- package/references/opentasks/skills/opentasks/spec-to-implementation.md +0 -98
- package/references/opentasks/src/__tests__/cli-tools.test.ts +0 -800
- package/references/opentasks/src/__tests__/cli.test.ts +0 -97
- package/references/opentasks/src/__tests__/p1-p3-gaps.test.ts +0 -635
- package/references/opentasks/src/cli.ts +0 -929
- package/references/opentasks/src/client/__tests__/client-crud.test.ts +0 -546
- package/references/opentasks/src/client/__tests__/client.test.ts +0 -658
- package/references/opentasks/src/client/__tests__/socket-discovery.test.ts +0 -122
- package/references/opentasks/src/client/client.ts +0 -560
- package/references/opentasks/src/client/index.ts +0 -32
- package/references/opentasks/src/config/__tests__/defaults.test.ts +0 -66
- package/references/opentasks/src/config/__tests__/env.test.ts +0 -155
- package/references/opentasks/src/config/__tests__/index.test.ts +0 -148
- package/references/opentasks/src/config/__tests__/loader.test.ts +0 -173
- package/references/opentasks/src/config/__tests__/merge.test.ts +0 -121
- package/references/opentasks/src/config/__tests__/schema.test.ts +0 -446
- package/references/opentasks/src/config/defaults.ts +0 -18
- package/references/opentasks/src/config/env.ts +0 -170
- package/references/opentasks/src/config/errors.ts +0 -33
- package/references/opentasks/src/config/index.ts +0 -63
- package/references/opentasks/src/config/loader.ts +0 -90
- package/references/opentasks/src/config/merge.ts +0 -64
- package/references/opentasks/src/config/schema.ts +0 -767
- package/references/opentasks/src/core/__tests__/conditional-redirects.test.ts +0 -116
- package/references/opentasks/src/core/__tests__/connections.test.ts +0 -194
- package/references/opentasks/src/core/__tests__/hash.test.ts +0 -161
- package/references/opentasks/src/core/__tests__/id.test.ts +0 -175
- package/references/opentasks/src/core/__tests__/init.test.ts +0 -115
- package/references/opentasks/src/core/__tests__/location.test.ts +0 -94
- package/references/opentasks/src/core/__tests__/merge-driver.test.ts +0 -300
- package/references/opentasks/src/core/__tests__/redirects.test.ts +0 -169
- package/references/opentasks/src/core/__tests__/resolve-location-target.test.ts +0 -468
- package/references/opentasks/src/core/__tests__/uri.test.ts +0 -228
- package/references/opentasks/src/core/__tests__/worktree.test.ts +0 -160
- package/references/opentasks/src/core/conditional-redirects.ts +0 -100
- package/references/opentasks/src/core/connections.ts +0 -217
- package/references/opentasks/src/core/discover.ts +0 -195
- package/references/opentasks/src/core/hash.ts +0 -74
- package/references/opentasks/src/core/id.ts +0 -174
- package/references/opentasks/src/core/index.ts +0 -108
- package/references/opentasks/src/core/init.ts +0 -66
- package/references/opentasks/src/core/location.ts +0 -139
- package/references/opentasks/src/core/merge-driver.ts +0 -280
- package/references/opentasks/src/core/redirects.ts +0 -182
- package/references/opentasks/src/core/uri.ts +0 -270
- package/references/opentasks/src/core/worktree.ts +0 -504
- package/references/opentasks/src/daemon/__tests__/e2e-live-agent.test.ts +0 -344
- package/references/opentasks/src/daemon/__tests__/e2e-session-pipeline.test.ts +0 -447
- package/references/opentasks/src/daemon/__tests__/e2e-watch.test.ts +0 -279
- package/references/opentasks/src/daemon/__tests__/entire-linker.test.ts +0 -1074
- package/references/opentasks/src/daemon/__tests__/entire-watcher.test.ts +0 -659
- package/references/opentasks/src/daemon/__tests__/flush.test.ts +0 -306
- package/references/opentasks/src/daemon/__tests__/integration.test.ts +0 -338
- package/references/opentasks/src/daemon/__tests__/ipc.test.ts +0 -406
- package/references/opentasks/src/daemon/__tests__/lifecycle.test.ts +0 -378
- package/references/opentasks/src/daemon/__tests__/lock.test.ts +0 -240
- package/references/opentasks/src/daemon/__tests__/methods/graph.test.ts +0 -372
- package/references/opentasks/src/daemon/__tests__/methods/provider.test.ts +0 -238
- package/references/opentasks/src/daemon/__tests__/methods/tools.test.ts +0 -690
- package/references/opentasks/src/daemon/__tests__/multi-location.test.ts +0 -945
- package/references/opentasks/src/daemon/__tests__/registry.test.ts +0 -268
- package/references/opentasks/src/daemon/__tests__/watcher.test.ts +0 -329
- package/references/opentasks/src/daemon/entire-linker.ts +0 -615
- package/references/opentasks/src/daemon/entire-watcher.ts +0 -415
- package/references/opentasks/src/daemon/factory.ts +0 -133
- package/references/opentasks/src/daemon/flush.ts +0 -168
- package/references/opentasks/src/daemon/index.ts +0 -120
- package/references/opentasks/src/daemon/ipc.ts +0 -491
- package/references/opentasks/src/daemon/lifecycle.ts +0 -1106
- package/references/opentasks/src/daemon/location-state.ts +0 -481
- package/references/opentasks/src/daemon/lock.ts +0 -168
- package/references/opentasks/src/daemon/methods/__tests__/graph.test.ts +0 -359
- package/references/opentasks/src/daemon/methods/__tests__/provider.test.ts +0 -227
- package/references/opentasks/src/daemon/methods/__tests__/tools.test.ts +0 -360
- package/references/opentasks/src/daemon/methods/__tests__/watch.test.ts +0 -656
- package/references/opentasks/src/daemon/methods/archive.ts +0 -193
- package/references/opentasks/src/daemon/methods/graph.ts +0 -274
- package/references/opentasks/src/daemon/methods/lifecycle.ts +0 -112
- package/references/opentasks/src/daemon/methods/location.ts +0 -118
- package/references/opentasks/src/daemon/methods/provider.ts +0 -159
- package/references/opentasks/src/daemon/methods/tools.ts +0 -221
- package/references/opentasks/src/daemon/methods/watch.ts +0 -206
- package/references/opentasks/src/daemon/registry.ts +0 -244
- package/references/opentasks/src/daemon/types.ts +0 -163
- package/references/opentasks/src/daemon/watcher.ts +0 -248
- package/references/opentasks/src/entire/__tests__/agent-registry.test.ts +0 -127
- package/references/opentasks/src/entire/__tests__/claude-generator.test.ts +0 -49
- package/references/opentasks/src/entire/__tests__/commit-msg.test.ts +0 -89
- package/references/opentasks/src/entire/__tests__/cursor-agent.test.ts +0 -224
- package/references/opentasks/src/entire/__tests__/flush-sentinel.test.ts +0 -93
- package/references/opentasks/src/entire/__tests__/gemini-agent.test.ts +0 -375
- package/references/opentasks/src/entire/__tests__/git-hooks.test.ts +0 -85
- package/references/opentasks/src/entire/__tests__/hook-managers.test.ts +0 -128
- package/references/opentasks/src/entire/__tests__/opencode-agent.test.ts +0 -329
- package/references/opentasks/src/entire/__tests__/redaction.test.ts +0 -143
- package/references/opentasks/src/entire/__tests__/session-store.test.ts +0 -83
- package/references/opentasks/src/entire/__tests__/summarize.test.ts +0 -346
- package/references/opentasks/src/entire/__tests__/transcript-timestamp.test.ts +0 -127
- package/references/opentasks/src/entire/__tests__/types.test.ts +0 -112
- package/references/opentasks/src/entire/__tests__/utils.test.ts +0 -296
- package/references/opentasks/src/entire/__tests__/validation.test.ts +0 -103
- package/references/opentasks/src/entire/__tests__/worktree.test.ts +0 -66
- package/references/opentasks/src/entire/agent/registry.ts +0 -143
- package/references/opentasks/src/entire/agent/session-types.ts +0 -117
- package/references/opentasks/src/entire/agent/types.ts +0 -217
- package/references/opentasks/src/entire/commands/clean.ts +0 -134
- package/references/opentasks/src/entire/commands/disable.ts +0 -85
- package/references/opentasks/src/entire/commands/doctor.ts +0 -152
- package/references/opentasks/src/entire/commands/enable.ts +0 -149
- package/references/opentasks/src/entire/commands/explain.ts +0 -271
- package/references/opentasks/src/entire/commands/reset.ts +0 -105
- package/references/opentasks/src/entire/commands/resume.ts +0 -194
- package/references/opentasks/src/entire/commands/rewind.ts +0 -204
- package/references/opentasks/src/entire/commands/status.ts +0 -150
- package/references/opentasks/src/entire/config.ts +0 -153
- package/references/opentasks/src/entire/git-operations.ts +0 -485
- package/references/opentasks/src/entire/hooks/git-hooks.ts +0 -171
- package/references/opentasks/src/entire/hooks/lifecycle.ts +0 -224
- package/references/opentasks/src/entire/index.ts +0 -644
- package/references/opentasks/src/entire/security/redaction.ts +0 -263
- package/references/opentasks/src/entire/session/state-machine.ts +0 -463
- package/references/opentasks/src/entire/store/checkpoint-store.ts +0 -489
- package/references/opentasks/src/entire/store/native-store.ts +0 -178
- package/references/opentasks/src/entire/store/provider-types.ts +0 -99
- package/references/opentasks/src/entire/store/session-store.ts +0 -233
- package/references/opentasks/src/entire/strategy/attribution.ts +0 -300
- package/references/opentasks/src/entire/strategy/common.ts +0 -222
- package/references/opentasks/src/entire/strategy/content-overlap.ts +0 -242
- package/references/opentasks/src/entire/strategy/manual-commit.ts +0 -1008
- package/references/opentasks/src/entire/strategy/types.ts +0 -285
- package/references/opentasks/src/entire/summarize/claude-generator.ts +0 -119
- package/references/opentasks/src/entire/summarize/summarize.ts +0 -432
- package/references/opentasks/src/entire/types.ts +0 -408
- package/references/opentasks/src/entire/utils/chunk-files.ts +0 -49
- package/references/opentasks/src/entire/utils/commit-message.ts +0 -65
- package/references/opentasks/src/entire/utils/detect-agent.ts +0 -36
- package/references/opentasks/src/entire/utils/hook-managers.ts +0 -118
- package/references/opentasks/src/entire/utils/ide-tags.ts +0 -32
- package/references/opentasks/src/entire/utils/paths.ts +0 -59
- package/references/opentasks/src/entire/utils/preview-rewind.ts +0 -86
- package/references/opentasks/src/entire/utils/rewind-conflict.ts +0 -121
- package/references/opentasks/src/entire/utils/shadow-branch.ts +0 -113
- package/references/opentasks/src/entire/utils/string-utils.ts +0 -46
- package/references/opentasks/src/entire/utils/todo-extract.ts +0 -193
- package/references/opentasks/src/entire/utils/trailers.ts +0 -190
- package/references/opentasks/src/entire/utils/transcript-parse.ts +0 -177
- package/references/opentasks/src/entire/utils/transcript-timestamp.ts +0 -61
- package/references/opentasks/src/entire/utils/tree-ops.ts +0 -227
- package/references/opentasks/src/entire/utils/tty.ts +0 -72
- package/references/opentasks/src/entire/utils/validation.ts +0 -67
- package/references/opentasks/src/entire/utils/worktree.ts +0 -58
- package/references/opentasks/src/graph/EdgeTypeRegistry.ts +0 -330
- package/references/opentasks/src/graph/FederatedGraph.ts +0 -796
- package/references/opentasks/src/graph/GraphologyAdapter.ts +0 -374
- package/references/opentasks/src/graph/HydratingFederatedGraph.ts +0 -533
- package/references/opentasks/src/graph/__tests__/EdgeTypeRegistry.test.ts +0 -263
- package/references/opentasks/src/graph/__tests__/FederatedGraph.test.ts +0 -821
- package/references/opentasks/src/graph/__tests__/GraphologyAdapter.test.ts +0 -408
- package/references/opentasks/src/graph/__tests__/HydratingFederatedGraph.test.ts +0 -735
- package/references/opentasks/src/graph/__tests__/debounce.test.ts +0 -276
- package/references/opentasks/src/graph/__tests__/e2e-store-roundtrip.test.ts +0 -349
- package/references/opentasks/src/graph/__tests__/edge-cases.test.ts +0 -595
- package/references/opentasks/src/graph/__tests__/expansion.test.ts +0 -304
- package/references/opentasks/src/graph/__tests__/git-graph-syncer.test.ts +0 -572
- package/references/opentasks/src/graph/__tests__/provider-store.test.ts +0 -1091
- package/references/opentasks/src/graph/__tests__/query.test.ts +0 -991
- package/references/opentasks/src/graph/__tests__/store.test.ts +0 -998
- package/references/opentasks/src/graph/__tests__/sync.test.ts +0 -178
- package/references/opentasks/src/graph/__tests__/validation.test.ts +0 -657
- package/references/opentasks/src/graph/coordination.ts +0 -454
- package/references/opentasks/src/graph/debounce.ts +0 -154
- package/references/opentasks/src/graph/expansion.ts +0 -364
- package/references/opentasks/src/graph/git-graph-syncer.ts +0 -321
- package/references/opentasks/src/graph/history.ts +0 -438
- package/references/opentasks/src/graph/index.ts +0 -145
- package/references/opentasks/src/graph/provider-store.ts +0 -1077
- package/references/opentasks/src/graph/query.ts +0 -651
- package/references/opentasks/src/graph/store.ts +0 -861
- package/references/opentasks/src/graph/sync.ts +0 -116
- package/references/opentasks/src/graph/types.ts +0 -420
- package/references/opentasks/src/graph/validation.ts +0 -520
- package/references/opentasks/src/index.ts +0 -270
- package/references/opentasks/src/materialization/CLAUDE.md +0 -88
- package/references/opentasks/src/materialization/README.md +0 -187
- package/references/opentasks/src/materialization/__tests__/archive-methods.test.ts +0 -194
- package/references/opentasks/src/materialization/__tests__/archiver.test.ts +0 -528
- package/references/opentasks/src/materialization/__tests__/config.test.ts +0 -123
- package/references/opentasks/src/materialization/__tests__/git-remote-store.test.ts +0 -533
- package/references/opentasks/src/materialization/__tests__/graph-id.test.ts +0 -82
- package/references/opentasks/src/materialization/__tests__/http-remote-store.test.ts +0 -263
- package/references/opentasks/src/materialization/__tests__/materialize-before-archive.test.ts +0 -246
- package/references/opentasks/src/materialization/__tests__/remote-store-factory.test.ts +0 -152
- package/references/opentasks/src/materialization/__tests__/snapshot.test.ts +0 -209
- package/references/opentasks/src/materialization/archiver.ts +0 -318
- package/references/opentasks/src/materialization/git-archive-store.ts +0 -568
- package/references/opentasks/src/materialization/git-remote-store.ts +0 -551
- package/references/opentasks/src/materialization/graph-id.ts +0 -173
- package/references/opentasks/src/materialization/http-remote-store.ts +0 -190
- package/references/opentasks/src/materialization/index.ts +0 -62
- package/references/opentasks/src/materialization/remote-store-factory.ts +0 -55
- package/references/opentasks/src/materialization/snapshot.ts +0 -230
- package/references/opentasks/src/materialization/types.ts +0 -410
- package/references/opentasks/src/providers/__tests__/beads.test.ts +0 -752
- package/references/opentasks/src/providers/__tests__/claude-tasks.test.ts +0 -485
- package/references/opentasks/src/providers/__tests__/entire-e2e.test.ts +0 -692
- package/references/opentasks/src/providers/__tests__/entire-sessionlog-e2e.test.ts +0 -1113
- package/references/opentasks/src/providers/__tests__/entire.test.ts +0 -1016
- package/references/opentasks/src/providers/__tests__/from-config.test.ts +0 -183
- package/references/opentasks/src/providers/__tests__/global.test.ts +0 -515
- package/references/opentasks/src/providers/__tests__/materialization.test.ts +0 -567
- package/references/opentasks/src/providers/__tests__/native.test.ts +0 -693
- package/references/opentasks/src/providers/__tests__/registry.test.ts +0 -232
- package/references/opentasks/src/providers/beads.ts +0 -1155
- package/references/opentasks/src/providers/claude-tasks.ts +0 -402
- package/references/opentasks/src/providers/entire.ts +0 -608
- package/references/opentasks/src/providers/from-config.ts +0 -210
- package/references/opentasks/src/providers/global.ts +0 -460
- package/references/opentasks/src/providers/index.ts +0 -147
- package/references/opentasks/src/providers/location.ts +0 -237
- package/references/opentasks/src/providers/materialization.ts +0 -346
- package/references/opentasks/src/providers/native.ts +0 -725
- package/references/opentasks/src/providers/registry.ts +0 -114
- package/references/opentasks/src/providers/sudocode.ts +0 -1292
- package/references/opentasks/src/providers/sync.ts +0 -485
- package/references/opentasks/src/providers/traits/RelationshipQueryable.ts +0 -169
- package/references/opentasks/src/providers/traits/TaskManageable.ts +0 -211
- package/references/opentasks/src/providers/traits/Watchable.ts +0 -260
- package/references/opentasks/src/providers/traits/__tests__/RelationshipQueryable.test.ts +0 -217
- package/references/opentasks/src/providers/traits/__tests__/TaskManageable.test.ts +0 -241
- package/references/opentasks/src/providers/traits/index.ts +0 -42
- package/references/opentasks/src/providers/types.ts +0 -439
- package/references/opentasks/src/schema/__tests__/validation.test.ts +0 -283
- package/references/opentasks/src/schema/base.ts +0 -88
- package/references/opentasks/src/schema/edges.ts +0 -78
- package/references/opentasks/src/schema/index.ts +0 -37
- package/references/opentasks/src/schema/nodes.ts +0 -119
- package/references/opentasks/src/schema/storage.ts +0 -130
- package/references/opentasks/src/schema/validation.ts +0 -209
- package/references/opentasks/src/storage/__tests__/atomic-write.test.ts +0 -227
- package/references/opentasks/src/storage/__tests__/file-lock.test.ts +0 -120
- package/references/opentasks/src/storage/__tests__/jsonl.test.ts +0 -267
- package/references/opentasks/src/storage/__tests__/locked-writer.test.ts +0 -134
- package/references/opentasks/src/storage/__tests__/sqlite.test.ts +0 -572
- package/references/opentasks/src/storage/atomic-write.ts +0 -86
- package/references/opentasks/src/storage/file-lock.ts +0 -215
- package/references/opentasks/src/storage/index.ts +0 -24
- package/references/opentasks/src/storage/interface.ts +0 -289
- package/references/opentasks/src/storage/jsonl.ts +0 -264
- package/references/opentasks/src/storage/locked-writer.ts +0 -140
- package/references/opentasks/src/storage/sqlite-schema.ts +0 -177
- package/references/opentasks/src/storage/sqlite.ts +0 -791
- package/references/opentasks/src/tools/__tests__/annotate.test.ts +0 -381
- package/references/opentasks/src/tools/__tests__/link.test.ts +0 -299
- package/references/opentasks/src/tools/__tests__/query.test.ts +0 -350
- package/references/opentasks/src/tools/__tests__/task.test.ts +0 -218
- package/references/opentasks/src/tools/annotate.ts +0 -277
- package/references/opentasks/src/tools/index.ts +0 -57
- package/references/opentasks/src/tools/link.ts +0 -163
- package/references/opentasks/src/tools/query.ts +0 -468
- package/references/opentasks/src/tools/task.ts +0 -213
- package/references/opentasks/src/tools/types.ts +0 -451
- package/references/opentasks/src/tracking/__tests__/claude-tool-categorizer.test.ts +0 -223
- package/references/opentasks/src/tracking/__tests__/transcript-extractor.test.ts +0 -262
- package/references/opentasks/src/tracking/claude-tool-categorizer.ts +0 -155
- package/references/opentasks/src/tracking/index.ts +0 -32
- package/references/opentasks/src/tracking/skill-tracker.ts +0 -322
- package/references/opentasks/src/tracking/transcript-extractor.ts +0 -225
- package/references/opentasks/tests/e2e/helpers/assertions.ts +0 -211
- package/references/opentasks/tests/e2e/helpers/beads-helpers.ts +0 -487
- package/references/opentasks/tests/e2e/helpers/fixtures.ts +0 -236
- package/references/opentasks/tests/e2e/helpers/index.ts +0 -122
- package/references/opentasks/tests/e2e/helpers/sudocode-helpers.ts +0 -341
- package/references/opentasks/tests/e2e/helpers/system-setup.ts +0 -504
- package/references/opentasks/tests/e2e/helpers/test-agent.ts +0 -504
- package/references/opentasks/tests/e2e/infrastructure.e2e.test.ts +0 -521
- package/references/opentasks/tests/e2e/skill-tracking.e2e.test.ts +0 -625
- package/references/opentasks/tests/e2e/workflows/feedback-loop.e2e.test.ts +0 -279
- package/references/opentasks/tests/e2e/workflows/multi-agent.e2e.test.ts +0 -304
- package/references/opentasks/tests/e2e/workflows/provider-sync/background-sync.e2e.test.ts +0 -292
- package/references/opentasks/tests/e2e/workflows/provider-sync/beads-provider-compat.e2e.test.ts +0 -249
- package/references/opentasks/tests/e2e/workflows/provider-sync/cross-provider-edges.e2e.test.ts +0 -407
- package/references/opentasks/tests/e2e/workflows/provider-sync/federated-ready.e2e.test.ts +0 -504
- package/references/opentasks/tests/e2e/workflows/provider-sync/hydration.e2e.test.ts +0 -340
- package/references/opentasks/tests/e2e/workflows/provider-sync/materialization.e2e.test.ts +0 -370
- package/references/opentasks/tests/e2e/workflows/provider-sync/sudocode-provider-compat.e2e.test.ts +0 -683
- package/references/opentasks/tests/e2e/workflows/provider-sync/watchable-beads.e2e.test.ts +0 -573
- package/references/opentasks/tests/e2e/workflows/spec-driven.e2e.test.ts +0 -244
- package/references/opentasks/tests/e2e/worktree-location.e2e.test.ts +0 -699
- package/references/opentasks/tests/integration/daemon/helpers.ts +0 -147
- package/references/opentasks/tests/integration/daemon/ipc.integration.test.ts +0 -343
- package/references/opentasks/tests/integration/daemon/lifecycle.integration.test.ts +0 -407
- package/references/opentasks/tests/integration/graph/federated-graph.integration.test.ts +0 -660
- package/references/opentasks/tests/integration/helpers/flags.ts +0 -28
- package/references/opentasks/tests/integration/helpers/index.ts +0 -47
- package/references/opentasks/tests/integration/helpers/process.ts +0 -133
- package/references/opentasks/tests/integration/helpers/temp.ts +0 -105
- package/references/opentasks/tests/integration/helpers/wait.ts +0 -133
- package/references/opentasks/tests/integration/helpers.test.ts +0 -120
- package/references/opentasks/tests/integration/providers/beads-task-manageable.integration.test.ts +0 -450
- package/references/opentasks/tests/integration/providers/beads.integration.test.ts +0 -388
- package/references/opentasks/tests/integration/providers/native-task-manageable.integration.test.ts +0 -667
- package/references/opentasks/tests/integration/providers/sudocode-task-manageable.integration.test.ts +0 -406
- package/references/opentasks/tests/integration/providers/sudocode.integration.test.ts +0 -342
- package/references/opentasks/tests/integration/storage/jsonl-durability.integration.test.ts +0 -390
- package/references/opentasks/tests/integration/storage/sqlite-durability.integration.test.ts +0 -527
- package/references/opentasks/tests/integration/worktree/redirect-location-resolution.integration.test.ts +0 -578
- package/references/opentasks/tests/integration/worktree/worktree-flow.integration.test.ts +0 -656
- package/references/opentasks/tsconfig.json +0 -18
- package/references/opentasks/vitest.config.ts +0 -27
- package/references/opentasks/vitest.e2e.config.ts +0 -35
- package/references/opentasks/vitest.integration.config.ts +0 -19
- package/references/openteams/.claude/settings.json +0 -6
- package/references/openteams/CLAUDE.md +0 -98
- package/references/openteams/README.md +0 -508
- package/references/openteams/SKILL.md +0 -198
- package/references/openteams/design.md +0 -250
- package/references/openteams/docs/visual-editor-design.md +0 -1225
- package/references/openteams/editor/index.html +0 -15
- package/references/openteams/editor/package.json +0 -39
- package/references/openteams/editor/src/App.tsx +0 -48
- package/references/openteams/editor/src/components/canvas/Canvas.tsx +0 -131
- package/references/openteams/editor/src/components/canvas/QuickAddMenu.tsx +0 -134
- package/references/openteams/editor/src/components/edges/PeerRouteEdge.tsx +0 -82
- package/references/openteams/editor/src/components/edges/SignalFlowEdge.tsx +0 -77
- package/references/openteams/editor/src/components/edges/SpawnEdge.tsx +0 -54
- package/references/openteams/editor/src/components/inspector/ChannelInspector.tsx +0 -158
- package/references/openteams/editor/src/components/inspector/EdgeInspector.tsx +0 -168
- package/references/openteams/editor/src/components/inspector/Inspector.tsx +0 -46
- package/references/openteams/editor/src/components/inspector/RoleInspector.tsx +0 -508
- package/references/openteams/editor/src/components/inspector/TeamInspector.tsx +0 -126
- package/references/openteams/editor/src/components/nodes/ChannelNode.tsx +0 -103
- package/references/openteams/editor/src/components/nodes/RoleNode.tsx +0 -157
- package/references/openteams/editor/src/components/nodes/node-styles.ts +0 -101
- package/references/openteams/editor/src/components/sidebar/Sidebar.tsx +0 -227
- package/references/openteams/editor/src/components/toolbar/ExportModal.tsx +0 -110
- package/references/openteams/editor/src/components/toolbar/ImportModal.tsx +0 -139
- package/references/openteams/editor/src/components/toolbar/Toolbar.tsx +0 -190
- package/references/openteams/editor/src/hooks/use-autosave.ts +0 -126
- package/references/openteams/editor/src/hooks/use-keyboard.ts +0 -106
- package/references/openteams/editor/src/hooks/use-validation.ts +0 -45
- package/references/openteams/editor/src/index.css +0 -245
- package/references/openteams/editor/src/lib/auto-layout.ts +0 -51
- package/references/openteams/editor/src/lib/bundled-templates.ts +0 -42
- package/references/openteams/editor/src/lib/compiler.ts +0 -75
- package/references/openteams/editor/src/lib/load-template.ts +0 -103
- package/references/openteams/editor/src/lib/rebuild-edges.ts +0 -104
- package/references/openteams/editor/src/lib/serializer.ts +0 -408
- package/references/openteams/editor/src/lib/signal-catalog.ts +0 -50
- package/references/openteams/editor/src/lib/validator.ts +0 -172
- package/references/openteams/editor/src/main.tsx +0 -10
- package/references/openteams/editor/src/stores/canvas-store.ts +0 -80
- package/references/openteams/editor/src/stores/config-store.ts +0 -243
- package/references/openteams/editor/src/stores/history-store.ts +0 -143
- package/references/openteams/editor/src/stores/theme-store.ts +0 -66
- package/references/openteams/editor/src/stores/ui-store.ts +0 -46
- package/references/openteams/editor/src/stores/validation-store.ts +0 -27
- package/references/openteams/editor/src/types/editor.ts +0 -74
- package/references/openteams/editor/src/vite-env.d.ts +0 -1
- package/references/openteams/editor/tests/compiler.test.ts +0 -151
- package/references/openteams/editor/tests/e2e-add-remove.test.ts +0 -386
- package/references/openteams/editor/tests/e2e-components.test.tsx +0 -424
- package/references/openteams/editor/tests/e2e-export-roundtrip.test.ts +0 -299
- package/references/openteams/editor/tests/e2e-template-load.test.ts +0 -204
- package/references/openteams/editor/tests/e2e-ui-store.test.ts +0 -126
- package/references/openteams/editor/tests/e2e-undo-redo.test.ts +0 -203
- package/references/openteams/editor/tests/e2e-validation.test.ts +0 -307
- package/references/openteams/editor/tests/serializer.test.ts +0 -142
- package/references/openteams/editor/tests/setup.ts +0 -52
- package/references/openteams/editor/tests/validator.test.ts +0 -92
- package/references/openteams/editor/tsconfig.json +0 -21
- package/references/openteams/editor/tsconfig.tsbuildinfo +0 -1
- package/references/openteams/editor/vite.config.ts +0 -28
- package/references/openteams/examples/bmad-method/prompts/analyst/ROLE.md +0 -16
- package/references/openteams/examples/bmad-method/prompts/analyst/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/prompts/architect/ROLE.md +0 -24
- package/references/openteams/examples/bmad-method/prompts/architect/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/prompts/developer/ROLE.md +0 -25
- package/references/openteams/examples/bmad-method/prompts/developer/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/prompts/master/ROLE.md +0 -21
- package/references/openteams/examples/bmad-method/prompts/master/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/prompts/pm/ROLE.md +0 -20
- package/references/openteams/examples/bmad-method/prompts/pm/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/prompts/qa/ROLE.md +0 -17
- package/references/openteams/examples/bmad-method/prompts/qa/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/ROLE.md +0 -23
- package/references/openteams/examples/bmad-method/prompts/quick-flow-dev/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/prompts/scrum-master/ROLE.md +0 -27
- package/references/openteams/examples/bmad-method/prompts/scrum-master/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/prompts/tech-writer/ROLE.md +0 -21
- package/references/openteams/examples/bmad-method/prompts/tech-writer/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/prompts/ux-designer/ROLE.md +0 -16
- package/references/openteams/examples/bmad-method/prompts/ux-designer/SOUL.md +0 -5
- package/references/openteams/examples/bmad-method/roles/analyst.yaml +0 -9
- package/references/openteams/examples/bmad-method/roles/architect.yaml +0 -9
- package/references/openteams/examples/bmad-method/roles/developer.yaml +0 -8
- package/references/openteams/examples/bmad-method/roles/master.yaml +0 -8
- package/references/openteams/examples/bmad-method/roles/pm.yaml +0 -9
- package/references/openteams/examples/bmad-method/roles/qa.yaml +0 -8
- package/references/openteams/examples/bmad-method/roles/quick-flow-dev.yaml +0 -8
- package/references/openteams/examples/bmad-method/roles/scrum-master.yaml +0 -9
- package/references/openteams/examples/bmad-method/roles/tech-writer.yaml +0 -8
- package/references/openteams/examples/bmad-method/roles/ux-designer.yaml +0 -8
- package/references/openteams/examples/bmad-method/team.yaml +0 -161
- package/references/openteams/examples/bug-fix-pipeline/roles/fixer.yaml +0 -9
- package/references/openteams/examples/bug-fix-pipeline/roles/investigator.yaml +0 -8
- package/references/openteams/examples/bug-fix-pipeline/roles/pr-creator.yaml +0 -6
- package/references/openteams/examples/bug-fix-pipeline/roles/triager.yaml +0 -7
- package/references/openteams/examples/bug-fix-pipeline/roles/verifier.yaml +0 -8
- package/references/openteams/examples/bug-fix-pipeline/team.yaml +0 -88
- package/references/openteams/examples/codebase-migration/roles/assessor.yaml +0 -7
- package/references/openteams/examples/codebase-migration/roles/migrator.yaml +0 -9
- package/references/openteams/examples/codebase-migration/roles/planner.yaml +0 -5
- package/references/openteams/examples/codebase-migration/roles/test-extractor.yaml +0 -9
- package/references/openteams/examples/codebase-migration/roles/validator.yaml +0 -7
- package/references/openteams/examples/codebase-migration/team.yaml +0 -81
- package/references/openteams/examples/docs-sync/roles/adr-writer.yaml +0 -7
- package/references/openteams/examples/docs-sync/roles/api-doc-writer.yaml +0 -7
- package/references/openteams/examples/docs-sync/roles/change-detector.yaml +0 -7
- package/references/openteams/examples/docs-sync/roles/doc-reviewer.yaml +0 -7
- package/references/openteams/examples/docs-sync/roles/guide-writer.yaml +0 -7
- package/references/openteams/examples/docs-sync/team.yaml +0 -84
- package/references/openteams/examples/gsd/prompts/codebase-mapper/ROLE.md +0 -17
- package/references/openteams/examples/gsd/prompts/codebase-mapper/SOUL.md +0 -5
- package/references/openteams/examples/gsd/prompts/debugger/ROLE.md +0 -25
- package/references/openteams/examples/gsd/prompts/debugger/SOUL.md +0 -5
- package/references/openteams/examples/gsd/prompts/executor/ROLE.md +0 -34
- package/references/openteams/examples/gsd/prompts/executor/SOUL.md +0 -5
- package/references/openteams/examples/gsd/prompts/integration-checker/ROLE.md +0 -18
- package/references/openteams/examples/gsd/prompts/integration-checker/SOUL.md +0 -3
- package/references/openteams/examples/gsd/prompts/orchestrator/ROLE.md +0 -42
- package/references/openteams/examples/gsd/prompts/orchestrator/SOUL.md +0 -5
- package/references/openteams/examples/gsd/prompts/phase-researcher/ROLE.md +0 -15
- package/references/openteams/examples/gsd/prompts/phase-researcher/SOUL.md +0 -3
- package/references/openteams/examples/gsd/prompts/plan-checker/ROLE.md +0 -17
- package/references/openteams/examples/gsd/prompts/plan-checker/SOUL.md +0 -3
- package/references/openteams/examples/gsd/prompts/planner/ROLE.md +0 -28
- package/references/openteams/examples/gsd/prompts/planner/SOUL.md +0 -5
- package/references/openteams/examples/gsd/prompts/project-researcher/ROLE.md +0 -16
- package/references/openteams/examples/gsd/prompts/project-researcher/SOUL.md +0 -3
- package/references/openteams/examples/gsd/prompts/research-synthesizer/ROLE.md +0 -13
- package/references/openteams/examples/gsd/prompts/research-synthesizer/SOUL.md +0 -3
- package/references/openteams/examples/gsd/prompts/roadmapper/ROLE.md +0 -14
- package/references/openteams/examples/gsd/prompts/roadmapper/SOUL.md +0 -3
- package/references/openteams/examples/gsd/prompts/verifier/ROLE.md +0 -19
- package/references/openteams/examples/gsd/prompts/verifier/SOUL.md +0 -5
- package/references/openteams/examples/gsd/roles/codebase-mapper.yaml +0 -8
- package/references/openteams/examples/gsd/roles/debugger.yaml +0 -8
- package/references/openteams/examples/gsd/roles/executor.yaml +0 -8
- package/references/openteams/examples/gsd/roles/integration-checker.yaml +0 -8
- package/references/openteams/examples/gsd/roles/orchestrator.yaml +0 -9
- package/references/openteams/examples/gsd/roles/phase-researcher.yaml +0 -7
- package/references/openteams/examples/gsd/roles/plan-checker.yaml +0 -8
- package/references/openteams/examples/gsd/roles/planner.yaml +0 -8
- package/references/openteams/examples/gsd/roles/project-researcher.yaml +0 -8
- package/references/openteams/examples/gsd/roles/research-synthesizer.yaml +0 -7
- package/references/openteams/examples/gsd/roles/roadmapper.yaml +0 -7
- package/references/openteams/examples/gsd/roles/verifier.yaml +0 -8
- package/references/openteams/examples/gsd/team.yaml +0 -154
- package/references/openteams/examples/incident-response/roles/communicator.yaml +0 -5
- package/references/openteams/examples/incident-response/roles/fix-proposer.yaml +0 -7
- package/references/openteams/examples/incident-response/roles/incident-triager.yaml +0 -8
- package/references/openteams/examples/incident-response/roles/investigator.yaml +0 -8
- package/references/openteams/examples/incident-response/team.yaml +0 -68
- package/references/openteams/examples/pr-review-checks/roles/code-reviewer.yaml +0 -7
- package/references/openteams/examples/pr-review-checks/roles/security-scanner.yaml +0 -6
- package/references/openteams/examples/pr-review-checks/roles/summarizer.yaml +0 -6
- package/references/openteams/examples/pr-review-checks/roles/test-checker.yaml +0 -8
- package/references/openteams/examples/pr-review-checks/team.yaml +0 -64
- package/references/openteams/examples/security-audit/roles/code-analyzer.yaml +0 -6
- package/references/openteams/examples/security-audit/roles/dep-scanner.yaml +0 -7
- package/references/openteams/examples/security-audit/roles/fixer.yaml +0 -9
- package/references/openteams/examples/security-audit/roles/pr-creator.yaml +0 -6
- package/references/openteams/examples/security-audit/roles/prioritizer.yaml +0 -6
- package/references/openteams/examples/security-audit/roles/secrets-scanner.yaml +0 -6
- package/references/openteams/examples/security-audit/roles/verifier.yaml +0 -8
- package/references/openteams/examples/security-audit/team.yaml +0 -102
- package/references/openteams/media/banner.png +0 -0
- package/references/openteams/media/editor.png +0 -0
- package/references/openteams/package-lock.json +0 -4804
- package/references/openteams/package.json +0 -58
- package/references/openteams/schema/role.schema.json +0 -147
- package/references/openteams/schema/team.schema.json +0 -311
- package/references/openteams/src/cli/editor.ts +0 -170
- package/references/openteams/src/cli/generate.test.ts +0 -191
- package/references/openteams/src/cli/generate.ts +0 -220
- package/references/openteams/src/cli/prompt-utils.ts +0 -42
- package/references/openteams/src/cli/template.test.ts +0 -365
- package/references/openteams/src/cli/template.ts +0 -205
- package/references/openteams/src/cli.ts +0 -22
- package/references/openteams/src/generators/agent-prompt-generator.test.ts +0 -332
- package/references/openteams/src/generators/agent-prompt-generator.ts +0 -527
- package/references/openteams/src/generators/package-generator.test.ts +0 -129
- package/references/openteams/src/generators/package-generator.ts +0 -102
- package/references/openteams/src/generators/skill-generator.test.ts +0 -246
- package/references/openteams/src/generators/skill-generator.ts +0 -388
- package/references/openteams/src/index.ts +0 -84
- package/references/openteams/src/template/builtins.test.ts +0 -74
- package/references/openteams/src/template/builtins.ts +0 -108
- package/references/openteams/src/template/install-service.test.ts +0 -452
- package/references/openteams/src/template/install-service.ts +0 -332
- package/references/openteams/src/template/loader.test.ts +0 -1696
- package/references/openteams/src/template/loader.ts +0 -804
- package/references/openteams/src/template/resolver.test.ts +0 -304
- package/references/openteams/src/template/resolver.ts +0 -251
- package/references/openteams/src/template/types.ts +0 -229
- package/references/openteams/tsconfig.cjs.json +0 -7
- package/references/openteams/tsconfig.esm.json +0 -8
- package/references/openteams/tsconfig.json +0 -16
- package/references/openteams/vitest.config.ts +0 -9
- package/references/sessionlog/.husky/pre-commit +0 -1
- package/references/sessionlog/.lintstagedrc.json +0 -4
- package/references/sessionlog/.prettierignore +0 -4
- package/references/sessionlog/.prettierrc.json +0 -11
- package/references/sessionlog/LICENSE +0 -21
- package/references/sessionlog/README.md +0 -453
- package/references/sessionlog/eslint.config.js +0 -58
- package/references/sessionlog/package-lock.json +0 -3672
- package/references/sessionlog/package.json +0 -65
- package/references/sessionlog/src/__tests__/agent-hooks.test.ts +0 -570
- package/references/sessionlog/src/__tests__/agent-registry.test.ts +0 -127
- package/references/sessionlog/src/__tests__/claude-code-hooks.test.ts +0 -225
- package/references/sessionlog/src/__tests__/claude-generator.test.ts +0 -46
- package/references/sessionlog/src/__tests__/commit-msg.test.ts +0 -86
- package/references/sessionlog/src/__tests__/cursor-agent.test.ts +0 -224
- package/references/sessionlog/src/__tests__/e2e-live.test.ts +0 -890
- package/references/sessionlog/src/__tests__/event-log.test.ts +0 -183
- package/references/sessionlog/src/__tests__/flush-sentinel.test.ts +0 -105
- package/references/sessionlog/src/__tests__/gemini-agent.test.ts +0 -375
- package/references/sessionlog/src/__tests__/git-hooks.test.ts +0 -78
- package/references/sessionlog/src/__tests__/hook-managers.test.ts +0 -121
- package/references/sessionlog/src/__tests__/lifecycle-tasks.test.ts +0 -759
- package/references/sessionlog/src/__tests__/opencode-agent.test.ts +0 -338
- package/references/sessionlog/src/__tests__/redaction.test.ts +0 -136
- package/references/sessionlog/src/__tests__/session-repo.test.ts +0 -353
- package/references/sessionlog/src/__tests__/session-store.test.ts +0 -166
- package/references/sessionlog/src/__tests__/setup-ccweb.test.ts +0 -466
- package/references/sessionlog/src/__tests__/skill-live.test.ts +0 -461
- package/references/sessionlog/src/__tests__/summarize.test.ts +0 -348
- package/references/sessionlog/src/__tests__/task-plan-e2e.test.ts +0 -610
- package/references/sessionlog/src/__tests__/task-plan-live.test.ts +0 -632
- package/references/sessionlog/src/__tests__/transcript-timestamp.test.ts +0 -121
- package/references/sessionlog/src/__tests__/types.test.ts +0 -166
- package/references/sessionlog/src/__tests__/utils.test.ts +0 -333
- package/references/sessionlog/src/__tests__/validation.test.ts +0 -103
- package/references/sessionlog/src/__tests__/worktree.test.ts +0 -57
- package/references/sessionlog/src/agent/registry.ts +0 -143
- package/references/sessionlog/src/agent/session-types.ts +0 -113
- package/references/sessionlog/src/agent/types.ts +0 -220
- package/references/sessionlog/src/cli.ts +0 -597
- package/references/sessionlog/src/commands/clean.ts +0 -133
- package/references/sessionlog/src/commands/disable.ts +0 -84
- package/references/sessionlog/src/commands/doctor.ts +0 -145
- package/references/sessionlog/src/commands/enable.ts +0 -202
- package/references/sessionlog/src/commands/explain.ts +0 -261
- package/references/sessionlog/src/commands/reset.ts +0 -105
- package/references/sessionlog/src/commands/resume.ts +0 -180
- package/references/sessionlog/src/commands/rewind.ts +0 -195
- package/references/sessionlog/src/commands/setup-ccweb.ts +0 -275
- package/references/sessionlog/src/commands/status.ts +0 -172
- package/references/sessionlog/src/config.ts +0 -165
- package/references/sessionlog/src/events/event-log.ts +0 -126
- package/references/sessionlog/src/git-operations.ts +0 -558
- package/references/sessionlog/src/hooks/git-hooks.ts +0 -165
- package/references/sessionlog/src/hooks/lifecycle.ts +0 -391
- package/references/sessionlog/src/index.ts +0 -650
- package/references/sessionlog/src/security/redaction.ts +0 -283
- package/references/sessionlog/src/session/state-machine.ts +0 -452
- package/references/sessionlog/src/store/checkpoint-store.ts +0 -509
- package/references/sessionlog/src/store/native-store.ts +0 -173
- package/references/sessionlog/src/store/provider-types.ts +0 -99
- package/references/sessionlog/src/store/session-store.ts +0 -266
- package/references/sessionlog/src/strategy/attribution.ts +0 -296
- package/references/sessionlog/src/strategy/common.ts +0 -207
- package/references/sessionlog/src/strategy/content-overlap.ts +0 -228
- package/references/sessionlog/src/strategy/manual-commit.ts +0 -988
- package/references/sessionlog/src/strategy/types.ts +0 -279
- package/references/sessionlog/src/summarize/claude-generator.ts +0 -115
- package/references/sessionlog/src/summarize/summarize.ts +0 -432
- package/references/sessionlog/src/types.ts +0 -508
- package/references/sessionlog/src/utils/chunk-files.ts +0 -49
- package/references/sessionlog/src/utils/commit-message.ts +0 -65
- package/references/sessionlog/src/utils/detect-agent.ts +0 -36
- package/references/sessionlog/src/utils/hook-managers.ts +0 -125
- package/references/sessionlog/src/utils/ide-tags.ts +0 -32
- package/references/sessionlog/src/utils/paths.ts +0 -79
- package/references/sessionlog/src/utils/preview-rewind.ts +0 -80
- package/references/sessionlog/src/utils/rewind-conflict.ts +0 -121
- package/references/sessionlog/src/utils/shadow-branch.ts +0 -109
- package/references/sessionlog/src/utils/string-utils.ts +0 -46
- package/references/sessionlog/src/utils/todo-extract.ts +0 -188
- package/references/sessionlog/src/utils/trailers.ts +0 -187
- package/references/sessionlog/src/utils/transcript-parse.ts +0 -177
- package/references/sessionlog/src/utils/transcript-timestamp.ts +0 -59
- package/references/sessionlog/src/utils/tree-ops.ts +0 -219
- package/references/sessionlog/src/utils/tty.ts +0 -72
- package/references/sessionlog/src/utils/validation.ts +0 -65
- package/references/sessionlog/src/utils/worktree.ts +0 -58
- package/references/sessionlog/src/wire-types.ts +0 -59
- package/references/sessionlog/templates/setup-env.sh +0 -153
- package/references/sessionlog/tsconfig.json +0 -18
- package/references/sessionlog/vitest.config.ts +0 -12
- package/references/swarmkit/LICENSE +0 -21
- package/references/swarmkit/README.md +0 -130
- package/references/swarmkit/docs/design.md +0 -453
- package/references/swarmkit/docs/package-setup-reference.md +0 -519
- package/references/swarmkit/package-lock.json +0 -1938
- package/references/swarmkit/package.json +0 -43
- package/references/swarmkit/src/cli.ts +0 -41
- package/references/swarmkit/src/commands/add.ts +0 -126
- package/references/swarmkit/src/commands/doctor.ts +0 -117
- package/references/swarmkit/src/commands/hive.ts +0 -279
- package/references/swarmkit/src/commands/init/phases/configure.ts +0 -96
- package/references/swarmkit/src/commands/init/phases/global-setup.ts +0 -102
- package/references/swarmkit/src/commands/init/phases/packages.ts +0 -44
- package/references/swarmkit/src/commands/init/phases/project.ts +0 -81
- package/references/swarmkit/src/commands/init/phases/use-case.ts +0 -47
- package/references/swarmkit/src/commands/init/state.test.ts +0 -23
- package/references/swarmkit/src/commands/init/state.ts +0 -22
- package/references/swarmkit/src/commands/init/wizard.ts +0 -160
- package/references/swarmkit/src/commands/init.ts +0 -17
- package/references/swarmkit/src/commands/login.ts +0 -106
- package/references/swarmkit/src/commands/logout.ts +0 -22
- package/references/swarmkit/src/commands/remove.ts +0 -72
- package/references/swarmkit/src/commands/status.ts +0 -101
- package/references/swarmkit/src/commands/update.ts +0 -62
- package/references/swarmkit/src/commands/whoami.ts +0 -41
- package/references/swarmkit/src/config/global.test.ts +0 -258
- package/references/swarmkit/src/config/global.ts +0 -141
- package/references/swarmkit/src/config/keys.test.ts +0 -109
- package/references/swarmkit/src/config/keys.ts +0 -49
- package/references/swarmkit/src/doctor/checks.test.ts +0 -366
- package/references/swarmkit/src/doctor/checks.ts +0 -292
- package/references/swarmkit/src/doctor/types.ts +0 -33
- package/references/swarmkit/src/hub/auth-flow.test.ts +0 -127
- package/references/swarmkit/src/hub/auth-flow.ts +0 -144
- package/references/swarmkit/src/hub/client.test.ts +0 -224
- package/references/swarmkit/src/hub/client.ts +0 -185
- package/references/swarmkit/src/hub/credentials.test.ts +0 -132
- package/references/swarmkit/src/hub/credentials.ts +0 -51
- package/references/swarmkit/src/index.ts +0 -116
- package/references/swarmkit/src/packages/installer.test.ts +0 -365
- package/references/swarmkit/src/packages/installer.ts +0 -206
- package/references/swarmkit/src/packages/plugin.test.ts +0 -141
- package/references/swarmkit/src/packages/plugin.ts +0 -46
- package/references/swarmkit/src/packages/registry.test.ts +0 -235
- package/references/swarmkit/src/packages/registry.ts +0 -209
- package/references/swarmkit/src/packages/setup.test.ts +0 -1349
- package/references/swarmkit/src/packages/setup.ts +0 -635
- package/references/swarmkit/src/utils/ui.test.ts +0 -115
- package/references/swarmkit/src/utils/ui.ts +0 -62
- package/references/swarmkit/tsconfig.json +0 -17
- package/references/swarmkit/vitest.config.ts +0 -9
|
@@ -1,1072 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Comprehensive test suite for coordination subsystem.
|
|
3
|
-
* Covers: coordination DAL (tasks, messages, shared contexts),
|
|
4
|
-
* coordination listener (type guard + dispatch), and coordination types.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { describe, it, expect, beforeAll, afterAll, beforeEach, vi } from 'vitest';
|
|
8
|
-
import { initDatabase, closeDatabase, getDatabase } from '../../db/index.js';
|
|
9
|
-
import * as agentsDAL from '../../db/dal/agents.js';
|
|
10
|
-
import * as hivesDAL from '../../db/dal/hives.js';
|
|
11
|
-
import * as mapDAL from '../../db/dal/map.js';
|
|
12
|
-
import * as coordinationDAL from '../../db/dal/coordination.js';
|
|
13
|
-
import { testRoot, testDbPath, cleanTestRoot } from '../helpers/test-dirs.js';
|
|
14
|
-
|
|
15
|
-
// Mock the coordination service for listener tests
|
|
16
|
-
vi.mock('../../coordination/index.js', () => ({
|
|
17
|
-
getCoordinationService: vi.fn(),
|
|
18
|
-
}));
|
|
19
|
-
|
|
20
|
-
import { getCoordinationService } from '../../coordination/index.js';
|
|
21
|
-
const mockGetService = vi.mocked(getCoordinationService);
|
|
22
|
-
|
|
23
|
-
import { isCoordinationMessage, handleCoordinationMessage } from '../../coordination/listener.js';
|
|
24
|
-
import { createCoordinationNotification } from '../../coordination/types.js';
|
|
25
|
-
import type {
|
|
26
|
-
MapCoordinationMessage,
|
|
27
|
-
TaskAssignParams,
|
|
28
|
-
TaskStatusParams,
|
|
29
|
-
ContextShareParams,
|
|
30
|
-
MessageSendParams,
|
|
31
|
-
} from '../../coordination/types.js';
|
|
32
|
-
|
|
33
|
-
const TEST_ROOT = testRoot('coordination');
|
|
34
|
-
const TEST_DB_PATH = testDbPath(TEST_ROOT, 'coordination-test.db');
|
|
35
|
-
|
|
36
|
-
describe('Coordination System', () => {
|
|
37
|
-
let agentId: string;
|
|
38
|
-
let agent2Id: string;
|
|
39
|
-
let hiveId: string;
|
|
40
|
-
let swarmId1: string;
|
|
41
|
-
let swarmId2: string;
|
|
42
|
-
|
|
43
|
-
beforeAll(async () => {
|
|
44
|
-
initDatabase(TEST_DB_PATH);
|
|
45
|
-
|
|
46
|
-
// Create two agents
|
|
47
|
-
const { agent } = await agentsDAL.createAgent({
|
|
48
|
-
name: 'coord-test-agent-1',
|
|
49
|
-
description: 'Agent 1 for coordination tests',
|
|
50
|
-
});
|
|
51
|
-
agentId = agent.id;
|
|
52
|
-
|
|
53
|
-
const { agent: agent2 } = await agentsDAL.createAgent({
|
|
54
|
-
name: 'coord-test-agent-2',
|
|
55
|
-
description: 'Agent 2 for coordination tests',
|
|
56
|
-
});
|
|
57
|
-
agent2Id = agent2.id;
|
|
58
|
-
|
|
59
|
-
// Create a hive
|
|
60
|
-
const hive = hivesDAL.createHive({
|
|
61
|
-
name: 'coord-test-hive',
|
|
62
|
-
description: 'Test hive for coordination',
|
|
63
|
-
owner_id: agentId,
|
|
64
|
-
});
|
|
65
|
-
hiveId = hive.id;
|
|
66
|
-
|
|
67
|
-
// Create two MAP swarms (coordination_tasks references map_swarms via FK)
|
|
68
|
-
const swarm1 = mapDAL.createSwarm(agentId, {
|
|
69
|
-
name: 'coord-swarm-1',
|
|
70
|
-
map_endpoint: 'ws://localhost:9001/map',
|
|
71
|
-
map_transport: 'websocket',
|
|
72
|
-
});
|
|
73
|
-
swarmId1 = swarm1.id;
|
|
74
|
-
|
|
75
|
-
const swarm2 = mapDAL.createSwarm(agent2Id, {
|
|
76
|
-
name: 'coord-swarm-2',
|
|
77
|
-
map_endpoint: 'ws://localhost:9002/map',
|
|
78
|
-
map_transport: 'websocket',
|
|
79
|
-
});
|
|
80
|
-
swarmId2 = swarm2.id;
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
afterAll(() => {
|
|
84
|
-
closeDatabase();
|
|
85
|
-
cleanTestRoot(TEST_ROOT);
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
// ═══════════════════════════════════════════════════════════════
|
|
89
|
-
// Phase 1: Coordination Tasks DAL
|
|
90
|
-
// ═══════════════════════════════════════════════════════════════
|
|
91
|
-
|
|
92
|
-
describe('Tasks DAL', () => {
|
|
93
|
-
let taskId: string;
|
|
94
|
-
|
|
95
|
-
it('should create a task with defaults', () => {
|
|
96
|
-
const task = coordinationDAL.createTask(hiveId, {
|
|
97
|
-
title: 'Analyze dataset',
|
|
98
|
-
assigned_by_agent_id: agentId,
|
|
99
|
-
assigned_to_swarm_id: swarmId2,
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
taskId = task.id;
|
|
103
|
-
|
|
104
|
-
expect(task.id).toMatch(/^ct_/);
|
|
105
|
-
expect(task.hive_id).toBe(hiveId);
|
|
106
|
-
expect(task.title).toBe('Analyze dataset');
|
|
107
|
-
expect(task.description).toBeNull();
|
|
108
|
-
expect(task.priority).toBe('medium');
|
|
109
|
-
expect(task.status).toBe('pending');
|
|
110
|
-
expect(task.assigned_by_agent_id).toBe(agentId);
|
|
111
|
-
expect(task.assigned_by_swarm_id).toBeNull();
|
|
112
|
-
expect(task.assigned_to_swarm_id).toBe(swarmId2);
|
|
113
|
-
expect(task.context).toBeNull();
|
|
114
|
-
expect(task.result).toBeNull();
|
|
115
|
-
expect(task.error).toBeNull();
|
|
116
|
-
expect(task.progress).toBe(0);
|
|
117
|
-
expect(task.deadline).toBeNull();
|
|
118
|
-
expect(task.completed_at).toBeNull();
|
|
119
|
-
expect(task.created_at).toBeDefined();
|
|
120
|
-
expect(task.updated_at).toBeDefined();
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it('should create a task with all optional fields', () => {
|
|
124
|
-
const deadline = new Date(Date.now() + 86400000).toISOString();
|
|
125
|
-
const task = coordinationDAL.createTask(hiveId, {
|
|
126
|
-
title: 'Full-featured task',
|
|
127
|
-
description: 'This task has every field set',
|
|
128
|
-
priority: 'critical',
|
|
129
|
-
assigned_by_agent_id: agentId,
|
|
130
|
-
assigned_by_swarm_id: swarmId1,
|
|
131
|
-
assigned_to_swarm_id: swarmId2,
|
|
132
|
-
context: { key: 'value', nested: { a: 1 } },
|
|
133
|
-
deadline,
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
expect(task.priority).toBe('critical');
|
|
137
|
-
expect(task.description).toBe('This task has every field set');
|
|
138
|
-
expect(task.assigned_by_swarm_id).toBe(swarmId1);
|
|
139
|
-
expect(task.context).toEqual({ key: 'value', nested: { a: 1 } });
|
|
140
|
-
expect(task.deadline).toBe(deadline);
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it('should create tasks with different priority levels', () => {
|
|
144
|
-
const priorities = ['low', 'medium', 'high', 'critical'] as const;
|
|
145
|
-
for (const priority of priorities) {
|
|
146
|
-
const task = coordinationDAL.createTask(hiveId, {
|
|
147
|
-
title: `Task with ${priority} priority`,
|
|
148
|
-
priority,
|
|
149
|
-
assigned_by_agent_id: agentId,
|
|
150
|
-
assigned_to_swarm_id: swarmId2,
|
|
151
|
-
});
|
|
152
|
-
expect(task.priority).toBe(priority);
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
it('should generate unique IDs for each task', () => {
|
|
157
|
-
const task1 = coordinationDAL.createTask(hiveId, {
|
|
158
|
-
title: 'Unique task 1',
|
|
159
|
-
assigned_by_agent_id: agentId,
|
|
160
|
-
assigned_to_swarm_id: swarmId2,
|
|
161
|
-
});
|
|
162
|
-
const task2 = coordinationDAL.createTask(hiveId, {
|
|
163
|
-
title: 'Unique task 2',
|
|
164
|
-
assigned_by_agent_id: agentId,
|
|
165
|
-
assigned_to_swarm_id: swarmId2,
|
|
166
|
-
});
|
|
167
|
-
expect(task1.id).not.toBe(task2.id);
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
it('should find a task by ID', () => {
|
|
171
|
-
const found = coordinationDAL.findTaskById(taskId);
|
|
172
|
-
expect(found).not.toBeNull();
|
|
173
|
-
expect(found!.id).toBe(taskId);
|
|
174
|
-
expect(found!.title).toBe('Analyze dataset');
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it('should return null for unknown task ID', () => {
|
|
178
|
-
const found = coordinationDAL.findTaskById('ct_nonexistent');
|
|
179
|
-
expect(found).toBeNull();
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
it('should update task status', () => {
|
|
183
|
-
const updated = coordinationDAL.updateTask(taskId, {
|
|
184
|
-
status: 'in_progress',
|
|
185
|
-
});
|
|
186
|
-
expect(updated).not.toBeNull();
|
|
187
|
-
expect(updated!.status).toBe('in_progress');
|
|
188
|
-
expect(updated!.completed_at).toBeNull(); // Not completed yet
|
|
189
|
-
});
|
|
190
|
-
|
|
191
|
-
it('should update task progress', () => {
|
|
192
|
-
const updated = coordinationDAL.updateTask(taskId, {
|
|
193
|
-
progress: 50,
|
|
194
|
-
});
|
|
195
|
-
expect(updated).not.toBeNull();
|
|
196
|
-
expect(updated!.progress).toBe(50);
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
it('should set completed_at when status is completed', () => {
|
|
200
|
-
const updated = coordinationDAL.updateTask(taskId, {
|
|
201
|
-
status: 'completed',
|
|
202
|
-
result: { output: 'Analysis complete', rows_processed: 1000 },
|
|
203
|
-
});
|
|
204
|
-
expect(updated).not.toBeNull();
|
|
205
|
-
expect(updated!.status).toBe('completed');
|
|
206
|
-
expect(updated!.completed_at).not.toBeNull();
|
|
207
|
-
expect(updated!.result).toEqual({ output: 'Analysis complete', rows_processed: 1000 });
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
it('should set completed_at when status is failed', () => {
|
|
211
|
-
const failTask = coordinationDAL.createTask(hiveId, {
|
|
212
|
-
title: 'Task that will fail',
|
|
213
|
-
assigned_by_agent_id: agentId,
|
|
214
|
-
assigned_to_swarm_id: swarmId2,
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
const updated = coordinationDAL.updateTask(failTask.id, {
|
|
218
|
-
status: 'failed',
|
|
219
|
-
error: 'Out of memory',
|
|
220
|
-
});
|
|
221
|
-
expect(updated).not.toBeNull();
|
|
222
|
-
expect(updated!.status).toBe('failed');
|
|
223
|
-
expect(updated!.completed_at).not.toBeNull();
|
|
224
|
-
expect(updated!.error).toBe('Out of memory');
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
it('should return null when updating a non-existent task', () => {
|
|
228
|
-
const updated = coordinationDAL.updateTask('ct_nonexistent', {
|
|
229
|
-
status: 'completed',
|
|
230
|
-
});
|
|
231
|
-
// updateTask calls findTaskById after the UPDATE, which returns null for unknown IDs
|
|
232
|
-
expect(updated).toBeNull();
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
it('should list tasks without filters', () => {
|
|
236
|
-
const { data, total } = coordinationDAL.listTasks();
|
|
237
|
-
expect(data.length).toBeGreaterThan(0);
|
|
238
|
-
expect(total).toBeGreaterThan(0);
|
|
239
|
-
expect(total).toBe(data.length); // No pagination limit hit
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
it('should list tasks filtered by hive_id', () => {
|
|
243
|
-
const { data, total } = coordinationDAL.listTasks({ hive_id: hiveId });
|
|
244
|
-
expect(data.length).toBeGreaterThan(0);
|
|
245
|
-
expect(data.every(t => t.hive_id === hiveId)).toBe(true);
|
|
246
|
-
expect(total).toBe(data.length);
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
it('should list tasks filtered by status', () => {
|
|
250
|
-
const { data } = coordinationDAL.listTasks({ status: 'completed' });
|
|
251
|
-
expect(data.length).toBeGreaterThanOrEqual(1);
|
|
252
|
-
expect(data.every(t => t.status === 'completed')).toBe(true);
|
|
253
|
-
});
|
|
254
|
-
|
|
255
|
-
it('should list tasks filtered by assigned_to_swarm_id', () => {
|
|
256
|
-
const { data } = coordinationDAL.listTasks({
|
|
257
|
-
assigned_to_swarm_id: swarmId2,
|
|
258
|
-
});
|
|
259
|
-
expect(data.length).toBeGreaterThan(0);
|
|
260
|
-
expect(data.every(t => t.assigned_to_swarm_id === swarmId2)).toBe(true);
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
it('should return empty list for non-matching filters', () => {
|
|
264
|
-
const { data, total } = coordinationDAL.listTasks({
|
|
265
|
-
hive_id: 'nonexistent_hive',
|
|
266
|
-
});
|
|
267
|
-
expect(data).toEqual([]);
|
|
268
|
-
expect(total).toBe(0);
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
it('should paginate task results', () => {
|
|
272
|
-
const { data: allTasks, total: allTotal } = coordinationDAL.listTasks({ hive_id: hiveId });
|
|
273
|
-
expect(allTotal).toBeGreaterThan(1); // We have multiple tasks
|
|
274
|
-
|
|
275
|
-
// Fetch first page with limit 2
|
|
276
|
-
const { data: page1, total: total1 } = coordinationDAL.listTasks({
|
|
277
|
-
hive_id: hiveId,
|
|
278
|
-
limit: 2,
|
|
279
|
-
offset: 0,
|
|
280
|
-
});
|
|
281
|
-
expect(page1.length).toBe(2);
|
|
282
|
-
expect(total1).toBe(allTotal);
|
|
283
|
-
|
|
284
|
-
// Fetch second page
|
|
285
|
-
const { data: page2 } = coordinationDAL.listTasks({
|
|
286
|
-
hive_id: hiveId,
|
|
287
|
-
limit: 2,
|
|
288
|
-
offset: 2,
|
|
289
|
-
});
|
|
290
|
-
expect(page2.length).toBeGreaterThan(0);
|
|
291
|
-
|
|
292
|
-
// Pages should not overlap
|
|
293
|
-
const page1Ids = new Set(page1.map(t => t.id));
|
|
294
|
-
const page2Ids = new Set(page2.map(t => t.id));
|
|
295
|
-
for (const id of page2Ids) {
|
|
296
|
-
expect(page1Ids.has(id)).toBe(false);
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
|
|
300
|
-
it('should combine multiple filters', () => {
|
|
301
|
-
const { data } = coordinationDAL.listTasks({
|
|
302
|
-
hive_id: hiveId,
|
|
303
|
-
status: 'pending',
|
|
304
|
-
assigned_to_swarm_id: swarmId2,
|
|
305
|
-
});
|
|
306
|
-
expect(data.every(t =>
|
|
307
|
-
t.hive_id === hiveId &&
|
|
308
|
-
t.status === 'pending' &&
|
|
309
|
-
t.assigned_to_swarm_id === swarmId2,
|
|
310
|
-
)).toBe(true);
|
|
311
|
-
});
|
|
312
|
-
});
|
|
313
|
-
|
|
314
|
-
// ═══════════════════════════════════════════════════════════════
|
|
315
|
-
// Phase 2: Swarm Messages DAL
|
|
316
|
-
// ═══════════════════════════════════════════════════════════════
|
|
317
|
-
|
|
318
|
-
describe('Messages DAL', () => {
|
|
319
|
-
let messageId: string;
|
|
320
|
-
|
|
321
|
-
it('should create a message with defaults', () => {
|
|
322
|
-
const msg = coordinationDAL.createMessage({
|
|
323
|
-
from_swarm_id: swarmId1,
|
|
324
|
-
to_swarm_id: swarmId2,
|
|
325
|
-
content: 'Hello from swarm 1',
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
messageId = msg.id;
|
|
329
|
-
|
|
330
|
-
expect(msg.id).toMatch(/^sm_/);
|
|
331
|
-
expect(msg.hive_id).toBeNull();
|
|
332
|
-
expect(msg.from_swarm_id).toBe(swarmId1);
|
|
333
|
-
expect(msg.to_swarm_id).toBe(swarmId2);
|
|
334
|
-
expect(msg.content_type).toBe('text');
|
|
335
|
-
expect(msg.content).toBe('Hello from swarm 1');
|
|
336
|
-
expect(msg.reply_to).toBeNull();
|
|
337
|
-
expect(msg.metadata).toBeNull();
|
|
338
|
-
expect(msg.read_at).toBeNull();
|
|
339
|
-
expect(msg.created_at).toBeDefined();
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
it('should create a message with all optional fields', () => {
|
|
343
|
-
const msg = coordinationDAL.createMessage({
|
|
344
|
-
hive_id: hiveId,
|
|
345
|
-
from_swarm_id: swarmId2,
|
|
346
|
-
to_swarm_id: swarmId1,
|
|
347
|
-
content_type: 'json',
|
|
348
|
-
content: JSON.stringify({ action: 'status_report', data: [1, 2, 3] }),
|
|
349
|
-
reply_to: messageId,
|
|
350
|
-
metadata: { urgency: 'high', thread_id: 'thread-001' },
|
|
351
|
-
});
|
|
352
|
-
|
|
353
|
-
expect(msg.hive_id).toBe(hiveId);
|
|
354
|
-
expect(msg.content_type).toBe('json');
|
|
355
|
-
expect(msg.reply_to).toBe(messageId);
|
|
356
|
-
expect(msg.metadata).toEqual({ urgency: 'high', thread_id: 'thread-001' });
|
|
357
|
-
});
|
|
358
|
-
|
|
359
|
-
it('should create a message with binary_ref content type', () => {
|
|
360
|
-
const msg = coordinationDAL.createMessage({
|
|
361
|
-
from_swarm_id: swarmId1,
|
|
362
|
-
to_swarm_id: swarmId2,
|
|
363
|
-
content_type: 'binary_ref',
|
|
364
|
-
content: 's3://bucket/path/to/artifact.tar.gz',
|
|
365
|
-
});
|
|
366
|
-
|
|
367
|
-
expect(msg.content_type).toBe('binary_ref');
|
|
368
|
-
expect(msg.content).toBe('s3://bucket/path/to/artifact.tar.gz');
|
|
369
|
-
});
|
|
370
|
-
|
|
371
|
-
it('should generate unique IDs for each message', () => {
|
|
372
|
-
const msg1 = coordinationDAL.createMessage({
|
|
373
|
-
from_swarm_id: swarmId1,
|
|
374
|
-
to_swarm_id: swarmId2,
|
|
375
|
-
content: 'Message A',
|
|
376
|
-
});
|
|
377
|
-
const msg2 = coordinationDAL.createMessage({
|
|
378
|
-
from_swarm_id: swarmId1,
|
|
379
|
-
to_swarm_id: swarmId2,
|
|
380
|
-
content: 'Message B',
|
|
381
|
-
});
|
|
382
|
-
expect(msg1.id).not.toBe(msg2.id);
|
|
383
|
-
});
|
|
384
|
-
|
|
385
|
-
it('should find a message by ID', () => {
|
|
386
|
-
const found = coordinationDAL.findMessageById(messageId);
|
|
387
|
-
expect(found).not.toBeNull();
|
|
388
|
-
expect(found!.id).toBe(messageId);
|
|
389
|
-
expect(found!.content).toBe('Hello from swarm 1');
|
|
390
|
-
});
|
|
391
|
-
|
|
392
|
-
it('should return null for unknown message ID', () => {
|
|
393
|
-
const found = coordinationDAL.findMessageById('sm_nonexistent');
|
|
394
|
-
expect(found).toBeNull();
|
|
395
|
-
});
|
|
396
|
-
|
|
397
|
-
it('should mark a message as read', () => {
|
|
398
|
-
coordinationDAL.markMessageRead(messageId);
|
|
399
|
-
|
|
400
|
-
const found = coordinationDAL.findMessageById(messageId);
|
|
401
|
-
expect(found).not.toBeNull();
|
|
402
|
-
expect(found!.read_at).not.toBeNull();
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
it('should list messages without filters', () => {
|
|
406
|
-
const { data, total } = coordinationDAL.listMessages();
|
|
407
|
-
expect(data.length).toBeGreaterThan(0);
|
|
408
|
-
expect(total).toBeGreaterThan(0);
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
it('should list messages filtered by to_swarm_id', () => {
|
|
412
|
-
const { data } = coordinationDAL.listMessages({ to_swarm_id: swarmId2 });
|
|
413
|
-
expect(data.length).toBeGreaterThan(0);
|
|
414
|
-
expect(data.every(m => m.to_swarm_id === swarmId2)).toBe(true);
|
|
415
|
-
});
|
|
416
|
-
|
|
417
|
-
it('should list messages filtered by from_swarm_id', () => {
|
|
418
|
-
const { data } = coordinationDAL.listMessages({ from_swarm_id: swarmId1 });
|
|
419
|
-
expect(data.length).toBeGreaterThan(0);
|
|
420
|
-
expect(data.every(m => m.from_swarm_id === swarmId1)).toBe(true);
|
|
421
|
-
});
|
|
422
|
-
|
|
423
|
-
it('should list messages filtered by hive_id', () => {
|
|
424
|
-
const { data } = coordinationDAL.listMessages({ hive_id: hiveId });
|
|
425
|
-
expect(data.length).toBeGreaterThanOrEqual(1);
|
|
426
|
-
expect(data.every(m => m.hive_id === hiveId)).toBe(true);
|
|
427
|
-
});
|
|
428
|
-
|
|
429
|
-
it('should list messages filtered by since timestamp', () => {
|
|
430
|
-
// SQLite datetime('now') produces 'YYYY-MM-DD HH:MM:SS' (UTC, no T/Z).
|
|
431
|
-
// The DAL compares with `created_at > ?`, so we must use the same format.
|
|
432
|
-
const toSqliteDatetime = (d: Date) =>
|
|
433
|
-
d.toISOString().replace('T', ' ').replace(/\.\d{3}Z$/, '');
|
|
434
|
-
|
|
435
|
-
// Use a timestamp in the past — all messages should appear
|
|
436
|
-
const pastDate = toSqliteDatetime(new Date(Date.now() - 3600000));
|
|
437
|
-
const { data: recent } = coordinationDAL.listMessages({ since: pastDate });
|
|
438
|
-
expect(recent.length).toBeGreaterThan(0);
|
|
439
|
-
|
|
440
|
-
// Use a future timestamp — no messages should appear
|
|
441
|
-
const futureDate = toSqliteDatetime(new Date(Date.now() + 3600000));
|
|
442
|
-
const { data: future } = coordinationDAL.listMessages({ since: futureDate });
|
|
443
|
-
expect(future.length).toBe(0);
|
|
444
|
-
});
|
|
445
|
-
|
|
446
|
-
it('should return empty list for non-matching filters', () => {
|
|
447
|
-
const { data, total } = coordinationDAL.listMessages({
|
|
448
|
-
to_swarm_id: 'nonexistent_swarm',
|
|
449
|
-
});
|
|
450
|
-
expect(data).toEqual([]);
|
|
451
|
-
expect(total).toBe(0);
|
|
452
|
-
});
|
|
453
|
-
|
|
454
|
-
it('should paginate message results', () => {
|
|
455
|
-
const { data: all, total: allTotal } = coordinationDAL.listMessages();
|
|
456
|
-
expect(allTotal).toBeGreaterThan(1);
|
|
457
|
-
|
|
458
|
-
const { data: page1, total: total1 } = coordinationDAL.listMessages({
|
|
459
|
-
limit: 2,
|
|
460
|
-
offset: 0,
|
|
461
|
-
});
|
|
462
|
-
expect(page1.length).toBe(2);
|
|
463
|
-
expect(total1).toBe(allTotal);
|
|
464
|
-
|
|
465
|
-
const { data: page2 } = coordinationDAL.listMessages({
|
|
466
|
-
limit: 2,
|
|
467
|
-
offset: 2,
|
|
468
|
-
});
|
|
469
|
-
|
|
470
|
-
// Pages should not overlap
|
|
471
|
-
const page1Ids = new Set(page1.map(m => m.id));
|
|
472
|
-
for (const m of page2) {
|
|
473
|
-
expect(page1Ids.has(m.id)).toBe(false);
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
});
|
|
477
|
-
|
|
478
|
-
// ═══════════════════════════════════════════════════════════════
|
|
479
|
-
// Phase 3: Shared Contexts DAL
|
|
480
|
-
// ═══════════════════════════════════════════════════════════════
|
|
481
|
-
|
|
482
|
-
describe('Shared Contexts DAL', () => {
|
|
483
|
-
let contextId: string;
|
|
484
|
-
|
|
485
|
-
it('should create a context without TTL', () => {
|
|
486
|
-
const ctx = coordinationDAL.createContext(hiveId, {
|
|
487
|
-
source_swarm_id: swarmId1,
|
|
488
|
-
context_type: 'environment',
|
|
489
|
-
data: { os: 'linux', cpu_count: 8, memory_gb: 32 },
|
|
490
|
-
});
|
|
491
|
-
|
|
492
|
-
contextId = ctx.id;
|
|
493
|
-
|
|
494
|
-
expect(ctx.id).toMatch(/^sc_/);
|
|
495
|
-
expect(ctx.hive_id).toBe(hiveId);
|
|
496
|
-
expect(ctx.source_swarm_id).toBe(swarmId1);
|
|
497
|
-
expect(ctx.context_type).toBe('environment');
|
|
498
|
-
expect(ctx.data).toEqual({ os: 'linux', cpu_count: 8, memory_gb: 32 });
|
|
499
|
-
expect(ctx.expires_at).toBeNull();
|
|
500
|
-
expect(ctx.created_at).toBeDefined();
|
|
501
|
-
});
|
|
502
|
-
|
|
503
|
-
it('should create a context with TTL and compute expires_at', () => {
|
|
504
|
-
const beforeCreate = new Date();
|
|
505
|
-
const ctx = coordinationDAL.createContext(hiveId, {
|
|
506
|
-
source_swarm_id: swarmId2,
|
|
507
|
-
context_type: 'session_state',
|
|
508
|
-
data: { step: 3, tokens_used: 500 },
|
|
509
|
-
ttl_seconds: 3600, // 1 hour
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
expect(ctx.expires_at).not.toBeNull();
|
|
513
|
-
const expiresAt = new Date(ctx.expires_at!);
|
|
514
|
-
// expires_at should be roughly 1 hour from now
|
|
515
|
-
const expectedMin = new Date(beforeCreate.getTime() + 3500 * 1000);
|
|
516
|
-
const expectedMax = new Date(beforeCreate.getTime() + 3700 * 1000);
|
|
517
|
-
expect(expiresAt.getTime()).toBeGreaterThan(expectedMin.getTime());
|
|
518
|
-
expect(expiresAt.getTime()).toBeLessThan(expectedMax.getTime());
|
|
519
|
-
});
|
|
520
|
-
|
|
521
|
-
it('should create a context with target_swarm_ids in data', () => {
|
|
522
|
-
const ctx = coordinationDAL.createContext(hiveId, {
|
|
523
|
-
source_swarm_id: swarmId1,
|
|
524
|
-
context_type: 'tool_results',
|
|
525
|
-
data: { results: [{ tool: 'search', output: 'found 42 results' }] },
|
|
526
|
-
target_swarm_ids: [swarmId2],
|
|
527
|
-
});
|
|
528
|
-
|
|
529
|
-
// target_swarm_ids is not stored in the DB row directly,
|
|
530
|
-
// but the context should be created successfully
|
|
531
|
-
expect(ctx.id).toMatch(/^sc_/);
|
|
532
|
-
expect(ctx.context_type).toBe('tool_results');
|
|
533
|
-
});
|
|
534
|
-
|
|
535
|
-
it('should generate unique IDs for each context', () => {
|
|
536
|
-
const ctx1 = coordinationDAL.createContext(hiveId, {
|
|
537
|
-
source_swarm_id: swarmId1,
|
|
538
|
-
context_type: 'test',
|
|
539
|
-
data: { n: 1 },
|
|
540
|
-
});
|
|
541
|
-
const ctx2 = coordinationDAL.createContext(hiveId, {
|
|
542
|
-
source_swarm_id: swarmId1,
|
|
543
|
-
context_type: 'test',
|
|
544
|
-
data: { n: 2 },
|
|
545
|
-
});
|
|
546
|
-
expect(ctx1.id).not.toBe(ctx2.id);
|
|
547
|
-
});
|
|
548
|
-
|
|
549
|
-
it('should find a context by ID', () => {
|
|
550
|
-
const found = coordinationDAL.findContextById(contextId);
|
|
551
|
-
expect(found).not.toBeNull();
|
|
552
|
-
expect(found!.id).toBe(contextId);
|
|
553
|
-
expect(found!.context_type).toBe('environment');
|
|
554
|
-
});
|
|
555
|
-
|
|
556
|
-
it('should return null for unknown context ID', () => {
|
|
557
|
-
const found = coordinationDAL.findContextById('sc_nonexistent');
|
|
558
|
-
expect(found).toBeNull();
|
|
559
|
-
});
|
|
560
|
-
|
|
561
|
-
it('should list contexts without filters (excludes expired)', () => {
|
|
562
|
-
const { data, total } = coordinationDAL.listContexts();
|
|
563
|
-
expect(data.length).toBeGreaterThan(0);
|
|
564
|
-
expect(total).toBeGreaterThan(0);
|
|
565
|
-
});
|
|
566
|
-
|
|
567
|
-
it('should list contexts filtered by hive_id', () => {
|
|
568
|
-
const { data } = coordinationDAL.listContexts({ hive_id: hiveId });
|
|
569
|
-
expect(data.length).toBeGreaterThan(0);
|
|
570
|
-
expect(data.every(c => c.hive_id === hiveId)).toBe(true);
|
|
571
|
-
});
|
|
572
|
-
|
|
573
|
-
it('should list contexts filtered by context_type', () => {
|
|
574
|
-
const { data } = coordinationDAL.listContexts({ context_type: 'environment' });
|
|
575
|
-
expect(data.length).toBeGreaterThanOrEqual(1);
|
|
576
|
-
expect(data.every(c => c.context_type === 'environment')).toBe(true);
|
|
577
|
-
});
|
|
578
|
-
|
|
579
|
-
it('should list contexts filtered by source_swarm_id', () => {
|
|
580
|
-
const { data } = coordinationDAL.listContexts({ source_swarm_id: swarmId1 });
|
|
581
|
-
expect(data.length).toBeGreaterThan(0);
|
|
582
|
-
expect(data.every(c => c.source_swarm_id === swarmId1)).toBe(true);
|
|
583
|
-
});
|
|
584
|
-
|
|
585
|
-
it('should return empty list for non-matching filters', () => {
|
|
586
|
-
const { data, total } = coordinationDAL.listContexts({
|
|
587
|
-
hive_id: 'nonexistent_hive',
|
|
588
|
-
});
|
|
589
|
-
expect(data).toEqual([]);
|
|
590
|
-
expect(total).toBe(0);
|
|
591
|
-
});
|
|
592
|
-
|
|
593
|
-
it('should paginate context results', () => {
|
|
594
|
-
const { total: allTotal } = coordinationDAL.listContexts({ hive_id: hiveId });
|
|
595
|
-
expect(allTotal).toBeGreaterThan(1);
|
|
596
|
-
|
|
597
|
-
const { data: page1, total: total1 } = coordinationDAL.listContexts({
|
|
598
|
-
hive_id: hiveId,
|
|
599
|
-
limit: 2,
|
|
600
|
-
offset: 0,
|
|
601
|
-
});
|
|
602
|
-
expect(page1.length).toBe(2);
|
|
603
|
-
expect(total1).toBe(allTotal);
|
|
604
|
-
|
|
605
|
-
const { data: page2 } = coordinationDAL.listContexts({
|
|
606
|
-
hive_id: hiveId,
|
|
607
|
-
limit: 2,
|
|
608
|
-
offset: 2,
|
|
609
|
-
});
|
|
610
|
-
|
|
611
|
-
const page1Ids = new Set(page1.map(c => c.id));
|
|
612
|
-
for (const c of page2) {
|
|
613
|
-
expect(page1Ids.has(c.id)).toBe(false);
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
|
|
617
|
-
it('should exclude expired contexts from listing', () => {
|
|
618
|
-
// Insert a context with an already-expired TTL by manipulating the DB directly
|
|
619
|
-
const db = getDatabase();
|
|
620
|
-
const expiredId = 'sc_expired_test';
|
|
621
|
-
db.prepare(`
|
|
622
|
-
INSERT INTO shared_contexts (id, hive_id, source_swarm_id, context_type, data, expires_at)
|
|
623
|
-
VALUES (?, ?, ?, ?, ?, datetime('now', '-1 hour'))
|
|
624
|
-
`).run(expiredId, hiveId, swarmId1, 'expired_type', JSON.stringify({ stale: true }));
|
|
625
|
-
|
|
626
|
-
// The expired context should exist in the DB
|
|
627
|
-
const raw = coordinationDAL.findContextById(expiredId);
|
|
628
|
-
expect(raw).not.toBeNull();
|
|
629
|
-
|
|
630
|
-
// But should NOT appear in listContexts
|
|
631
|
-
const { data } = coordinationDAL.listContexts({ context_type: 'expired_type' });
|
|
632
|
-
expect(data.find(c => c.id === expiredId)).toBeUndefined();
|
|
633
|
-
});
|
|
634
|
-
|
|
635
|
-
it('should delete expired contexts', () => {
|
|
636
|
-
// We already have an expired context from the previous test
|
|
637
|
-
const deleted = coordinationDAL.deleteExpiredContexts();
|
|
638
|
-
expect(deleted).toBeGreaterThanOrEqual(1);
|
|
639
|
-
|
|
640
|
-
// The expired context should now be gone entirely
|
|
641
|
-
const raw = coordinationDAL.findContextById('sc_expired_test');
|
|
642
|
-
expect(raw).toBeNull();
|
|
643
|
-
});
|
|
644
|
-
|
|
645
|
-
it('should return 0 when no expired contexts exist', () => {
|
|
646
|
-
// All expired contexts were already deleted
|
|
647
|
-
const deleted = coordinationDAL.deleteExpiredContexts();
|
|
648
|
-
expect(deleted).toBe(0);
|
|
649
|
-
});
|
|
650
|
-
});
|
|
651
|
-
|
|
652
|
-
// ═══════════════════════════════════════════════════════════════
|
|
653
|
-
// Phase 4: Coordination Listener — isCoordinationMessage
|
|
654
|
-
// ═══════════════════════════════════════════════════════════════
|
|
655
|
-
|
|
656
|
-
describe('isCoordinationMessage', () => {
|
|
657
|
-
it('should accept a valid task.assign message', () => {
|
|
658
|
-
const msg = {
|
|
659
|
-
jsonrpc: '2.0',
|
|
660
|
-
method: 'x-openhive/task.assign',
|
|
661
|
-
params: {
|
|
662
|
-
task_id: 'ct_abc',
|
|
663
|
-
title: 'Do stuff',
|
|
664
|
-
description: 'Please do stuff',
|
|
665
|
-
priority: 'medium',
|
|
666
|
-
assigned_by: agentId,
|
|
667
|
-
assigned_to_swarm: swarmId2,
|
|
668
|
-
hive_id: hiveId,
|
|
669
|
-
},
|
|
670
|
-
};
|
|
671
|
-
expect(isCoordinationMessage(msg)).toBe(true);
|
|
672
|
-
});
|
|
673
|
-
|
|
674
|
-
it('should accept a valid task.status message', () => {
|
|
675
|
-
const msg = {
|
|
676
|
-
jsonrpc: '2.0',
|
|
677
|
-
method: 'x-openhive/task.status',
|
|
678
|
-
params: {
|
|
679
|
-
task_id: 'ct_abc',
|
|
680
|
-
status: 'completed',
|
|
681
|
-
progress: 100,
|
|
682
|
-
result: { output: 'done' },
|
|
683
|
-
},
|
|
684
|
-
};
|
|
685
|
-
expect(isCoordinationMessage(msg)).toBe(true);
|
|
686
|
-
});
|
|
687
|
-
|
|
688
|
-
it('should accept a valid context.share message', () => {
|
|
689
|
-
const msg = {
|
|
690
|
-
jsonrpc: '2.0',
|
|
691
|
-
method: 'x-openhive/context.share',
|
|
692
|
-
params: {
|
|
693
|
-
context_id: 'sc_xyz',
|
|
694
|
-
source_swarm_id: swarmId1,
|
|
695
|
-
target_swarm_ids: [swarmId2],
|
|
696
|
-
hive_id: hiveId,
|
|
697
|
-
context_type: 'environment',
|
|
698
|
-
data: { key: 'val' },
|
|
699
|
-
},
|
|
700
|
-
};
|
|
701
|
-
expect(isCoordinationMessage(msg)).toBe(true);
|
|
702
|
-
});
|
|
703
|
-
|
|
704
|
-
it('should accept a valid message.send message', () => {
|
|
705
|
-
const msg = {
|
|
706
|
-
jsonrpc: '2.0',
|
|
707
|
-
method: 'x-openhive/message.send',
|
|
708
|
-
params: {
|
|
709
|
-
message_id: 'sm_xyz',
|
|
710
|
-
from_swarm_id: swarmId1,
|
|
711
|
-
to_swarm_id: swarmId2,
|
|
712
|
-
content_type: 'text',
|
|
713
|
-
content: 'Hello',
|
|
714
|
-
},
|
|
715
|
-
};
|
|
716
|
-
expect(isCoordinationMessage(msg)).toBe(true);
|
|
717
|
-
});
|
|
718
|
-
|
|
719
|
-
it('should reject null', () => {
|
|
720
|
-
expect(isCoordinationMessage(null)).toBe(false);
|
|
721
|
-
});
|
|
722
|
-
|
|
723
|
-
it('should reject undefined', () => {
|
|
724
|
-
expect(isCoordinationMessage(undefined)).toBe(false);
|
|
725
|
-
});
|
|
726
|
-
|
|
727
|
-
it('should reject a number', () => {
|
|
728
|
-
expect(isCoordinationMessage(42)).toBe(false);
|
|
729
|
-
});
|
|
730
|
-
|
|
731
|
-
it('should reject a string', () => {
|
|
732
|
-
expect(isCoordinationMessage('hello')).toBe(false);
|
|
733
|
-
});
|
|
734
|
-
|
|
735
|
-
it('should reject an array', () => {
|
|
736
|
-
expect(isCoordinationMessage([1, 2, 3])).toBe(false);
|
|
737
|
-
});
|
|
738
|
-
|
|
739
|
-
it('should reject missing jsonrpc field', () => {
|
|
740
|
-
const msg = {
|
|
741
|
-
method: 'x-openhive/task.assign',
|
|
742
|
-
params: { title: 'Test' },
|
|
743
|
-
};
|
|
744
|
-
expect(isCoordinationMessage(msg)).toBe(false);
|
|
745
|
-
});
|
|
746
|
-
|
|
747
|
-
it('should reject wrong jsonrpc version', () => {
|
|
748
|
-
const msg = {
|
|
749
|
-
jsonrpc: '1.0',
|
|
750
|
-
method: 'x-openhive/task.assign',
|
|
751
|
-
params: { title: 'Test' },
|
|
752
|
-
};
|
|
753
|
-
expect(isCoordinationMessage(msg)).toBe(false);
|
|
754
|
-
});
|
|
755
|
-
|
|
756
|
-
it('should reject invalid method name', () => {
|
|
757
|
-
const msg = {
|
|
758
|
-
jsonrpc: '2.0',
|
|
759
|
-
method: 'x-openhive/unknown.method',
|
|
760
|
-
params: { title: 'Test' },
|
|
761
|
-
};
|
|
762
|
-
expect(isCoordinationMessage(msg)).toBe(false);
|
|
763
|
-
});
|
|
764
|
-
|
|
765
|
-
it('should reject non-string method', () => {
|
|
766
|
-
const msg = {
|
|
767
|
-
jsonrpc: '2.0',
|
|
768
|
-
method: 123,
|
|
769
|
-
params: { title: 'Test' },
|
|
770
|
-
};
|
|
771
|
-
expect(isCoordinationMessage(msg)).toBe(false);
|
|
772
|
-
});
|
|
773
|
-
|
|
774
|
-
it('should reject missing params', () => {
|
|
775
|
-
const msg = {
|
|
776
|
-
jsonrpc: '2.0',
|
|
777
|
-
method: 'x-openhive/task.assign',
|
|
778
|
-
};
|
|
779
|
-
expect(isCoordinationMessage(msg)).toBe(false);
|
|
780
|
-
});
|
|
781
|
-
|
|
782
|
-
it('should reject null params', () => {
|
|
783
|
-
const msg = {
|
|
784
|
-
jsonrpc: '2.0',
|
|
785
|
-
method: 'x-openhive/task.assign',
|
|
786
|
-
params: null,
|
|
787
|
-
};
|
|
788
|
-
expect(isCoordinationMessage(msg)).toBe(false);
|
|
789
|
-
});
|
|
790
|
-
|
|
791
|
-
it('should reject non-object params', () => {
|
|
792
|
-
const msg = {
|
|
793
|
-
jsonrpc: '2.0',
|
|
794
|
-
method: 'x-openhive/task.assign',
|
|
795
|
-
params: 'not an object',
|
|
796
|
-
};
|
|
797
|
-
expect(isCoordinationMessage(msg)).toBe(false);
|
|
798
|
-
});
|
|
799
|
-
|
|
800
|
-
it('should reject empty object (no jsonrpc, no method, no params)', () => {
|
|
801
|
-
expect(isCoordinationMessage({})).toBe(false);
|
|
802
|
-
});
|
|
803
|
-
});
|
|
804
|
-
|
|
805
|
-
// ═══════════════════════════════════════════════════════════════
|
|
806
|
-
// Phase 5: Coordination Listener — handleCoordinationMessage
|
|
807
|
-
// ═══════════════════════════════════════════════════════════════
|
|
808
|
-
|
|
809
|
-
describe('handleCoordinationMessage', () => {
|
|
810
|
-
const mockService = {
|
|
811
|
-
assignTask: vi.fn(),
|
|
812
|
-
updateTaskStatus: vi.fn(),
|
|
813
|
-
shareContext: vi.fn(),
|
|
814
|
-
sendMessage: vi.fn(),
|
|
815
|
-
};
|
|
816
|
-
|
|
817
|
-
beforeEach(() => {
|
|
818
|
-
vi.clearAllMocks();
|
|
819
|
-
mockGetService.mockReturnValue(mockService as any);
|
|
820
|
-
});
|
|
821
|
-
|
|
822
|
-
it('should dispatch task.assign to service.assignTask', () => {
|
|
823
|
-
const msg: MapCoordinationMessage = {
|
|
824
|
-
jsonrpc: '2.0',
|
|
825
|
-
method: 'x-openhive/task.assign',
|
|
826
|
-
params: {
|
|
827
|
-
task_id: 'ct_test',
|
|
828
|
-
title: 'Delegated task',
|
|
829
|
-
description: 'Do the thing',
|
|
830
|
-
priority: 'high',
|
|
831
|
-
assigned_by: agentId,
|
|
832
|
-
assigned_to_swarm: swarmId2,
|
|
833
|
-
hive_id: hiveId,
|
|
834
|
-
context: { prompt: 'analyze this' },
|
|
835
|
-
deadline: '2026-12-31T00:00:00Z',
|
|
836
|
-
} as TaskAssignParams,
|
|
837
|
-
};
|
|
838
|
-
|
|
839
|
-
handleCoordinationMessage(msg, swarmId1);
|
|
840
|
-
|
|
841
|
-
expect(mockService.assignTask).toHaveBeenCalledOnce();
|
|
842
|
-
expect(mockService.assignTask).toHaveBeenCalledWith(hiveId, {
|
|
843
|
-
title: 'Delegated task',
|
|
844
|
-
description: 'Do the thing',
|
|
845
|
-
priority: 'high',
|
|
846
|
-
assigned_by_agent_id: agentId,
|
|
847
|
-
assigned_by_swarm_id: swarmId1,
|
|
848
|
-
assigned_to_swarm_id: swarmId2,
|
|
849
|
-
context: { prompt: 'analyze this' },
|
|
850
|
-
deadline: '2026-12-31T00:00:00Z',
|
|
851
|
-
});
|
|
852
|
-
});
|
|
853
|
-
|
|
854
|
-
it('should dispatch task.status to service.updateTaskStatus', () => {
|
|
855
|
-
const msg: MapCoordinationMessage = {
|
|
856
|
-
jsonrpc: '2.0',
|
|
857
|
-
method: 'x-openhive/task.status',
|
|
858
|
-
params: {
|
|
859
|
-
task_id: 'ct_abc123',
|
|
860
|
-
status: 'completed',
|
|
861
|
-
progress: 100,
|
|
862
|
-
result: { summary: 'All done' },
|
|
863
|
-
} as TaskStatusParams,
|
|
864
|
-
};
|
|
865
|
-
|
|
866
|
-
handleCoordinationMessage(msg, swarmId2);
|
|
867
|
-
|
|
868
|
-
expect(mockService.updateTaskStatus).toHaveBeenCalledOnce();
|
|
869
|
-
expect(mockService.updateTaskStatus).toHaveBeenCalledWith('ct_abc123', {
|
|
870
|
-
status: 'completed',
|
|
871
|
-
progress: 100,
|
|
872
|
-
result: { summary: 'All done' },
|
|
873
|
-
error: undefined,
|
|
874
|
-
});
|
|
875
|
-
});
|
|
876
|
-
|
|
877
|
-
it('should dispatch task.status with error', () => {
|
|
878
|
-
const msg: MapCoordinationMessage = {
|
|
879
|
-
jsonrpc: '2.0',
|
|
880
|
-
method: 'x-openhive/task.status',
|
|
881
|
-
params: {
|
|
882
|
-
task_id: 'ct_failing',
|
|
883
|
-
status: 'failed',
|
|
884
|
-
error: 'Connection timed out',
|
|
885
|
-
} as TaskStatusParams,
|
|
886
|
-
};
|
|
887
|
-
|
|
888
|
-
handleCoordinationMessage(msg, swarmId2);
|
|
889
|
-
|
|
890
|
-
expect(mockService.updateTaskStatus).toHaveBeenCalledOnce();
|
|
891
|
-
expect(mockService.updateTaskStatus).toHaveBeenCalledWith('ct_failing', {
|
|
892
|
-
status: 'failed',
|
|
893
|
-
progress: undefined,
|
|
894
|
-
result: undefined,
|
|
895
|
-
error: 'Connection timed out',
|
|
896
|
-
});
|
|
897
|
-
});
|
|
898
|
-
|
|
899
|
-
it('should dispatch context.share to service.shareContext', () => {
|
|
900
|
-
const msg: MapCoordinationMessage = {
|
|
901
|
-
jsonrpc: '2.0',
|
|
902
|
-
method: 'x-openhive/context.share',
|
|
903
|
-
params: {
|
|
904
|
-
context_id: 'sc_ctx1',
|
|
905
|
-
source_swarm_id: swarmId1,
|
|
906
|
-
target_swarm_ids: [swarmId2],
|
|
907
|
-
hive_id: hiveId,
|
|
908
|
-
context_type: 'tool_output',
|
|
909
|
-
data: { tool: 'web_search', results: ['a', 'b'] },
|
|
910
|
-
ttl_seconds: 600,
|
|
911
|
-
} as ContextShareParams,
|
|
912
|
-
};
|
|
913
|
-
|
|
914
|
-
handleCoordinationMessage(msg, swarmId1);
|
|
915
|
-
|
|
916
|
-
expect(mockService.shareContext).toHaveBeenCalledOnce();
|
|
917
|
-
expect(mockService.shareContext).toHaveBeenCalledWith(hiveId, {
|
|
918
|
-
source_swarm_id: swarmId1,
|
|
919
|
-
context_type: 'tool_output',
|
|
920
|
-
data: { tool: 'web_search', results: ['a', 'b'] },
|
|
921
|
-
target_swarm_ids: [swarmId2],
|
|
922
|
-
ttl_seconds: 600,
|
|
923
|
-
});
|
|
924
|
-
});
|
|
925
|
-
|
|
926
|
-
it('should dispatch message.send to service.sendMessage', () => {
|
|
927
|
-
const msg: MapCoordinationMessage = {
|
|
928
|
-
jsonrpc: '2.0',
|
|
929
|
-
method: 'x-openhive/message.send',
|
|
930
|
-
params: {
|
|
931
|
-
message_id: 'sm_msg1',
|
|
932
|
-
from_swarm_id: swarmId1,
|
|
933
|
-
to_swarm_id: swarmId2,
|
|
934
|
-
hive_id: hiveId,
|
|
935
|
-
content_type: 'text',
|
|
936
|
-
content: 'Hey, are you done yet?',
|
|
937
|
-
reply_to: 'sm_prev',
|
|
938
|
-
metadata: { thread: 'main' },
|
|
939
|
-
} as MessageSendParams,
|
|
940
|
-
};
|
|
941
|
-
|
|
942
|
-
handleCoordinationMessage(msg, swarmId1);
|
|
943
|
-
|
|
944
|
-
expect(mockService.sendMessage).toHaveBeenCalledOnce();
|
|
945
|
-
expect(mockService.sendMessage).toHaveBeenCalledWith({
|
|
946
|
-
hive_id: hiveId,
|
|
947
|
-
from_swarm_id: swarmId1,
|
|
948
|
-
to_swarm_id: swarmId2,
|
|
949
|
-
content_type: 'text',
|
|
950
|
-
content: 'Hey, are you done yet?',
|
|
951
|
-
reply_to: 'sm_prev',
|
|
952
|
-
metadata: { thread: 'main' },
|
|
953
|
-
});
|
|
954
|
-
});
|
|
955
|
-
|
|
956
|
-
it('should stringify non-string content in message.send', () => {
|
|
957
|
-
const msg: MapCoordinationMessage = {
|
|
958
|
-
jsonrpc: '2.0',
|
|
959
|
-
method: 'x-openhive/message.send',
|
|
960
|
-
params: {
|
|
961
|
-
message_id: 'sm_json',
|
|
962
|
-
from_swarm_id: swarmId1,
|
|
963
|
-
to_swarm_id: swarmId2,
|
|
964
|
-
content_type: 'json',
|
|
965
|
-
content: { nested: true, values: [1, 2] },
|
|
966
|
-
} as MessageSendParams,
|
|
967
|
-
};
|
|
968
|
-
|
|
969
|
-
handleCoordinationMessage(msg, swarmId1);
|
|
970
|
-
|
|
971
|
-
expect(mockService.sendMessage).toHaveBeenCalledOnce();
|
|
972
|
-
const callArgs = mockService.sendMessage.mock.calls[0][0];
|
|
973
|
-
expect(callArgs.content).toBe(JSON.stringify({ nested: true, values: [1, 2] }));
|
|
974
|
-
});
|
|
975
|
-
|
|
976
|
-
it('should use sourceSwarmId as assigned_by_swarm_id for task.assign', () => {
|
|
977
|
-
const msg: MapCoordinationMessage = {
|
|
978
|
-
jsonrpc: '2.0',
|
|
979
|
-
method: 'x-openhive/task.assign',
|
|
980
|
-
params: {
|
|
981
|
-
task_id: 'ct_swarm_source',
|
|
982
|
-
title: 'Verify source swarm mapping',
|
|
983
|
-
description: '',
|
|
984
|
-
priority: 'low',
|
|
985
|
-
assigned_by: agentId,
|
|
986
|
-
assigned_to_swarm: swarmId2,
|
|
987
|
-
hive_id: hiveId,
|
|
988
|
-
} as TaskAssignParams,
|
|
989
|
-
};
|
|
990
|
-
|
|
991
|
-
const sourceSwarm = 'swarm_custom_source';
|
|
992
|
-
handleCoordinationMessage(msg, sourceSwarm);
|
|
993
|
-
|
|
994
|
-
expect(mockService.assignTask).toHaveBeenCalledWith(
|
|
995
|
-
hiveId,
|
|
996
|
-
expect.objectContaining({
|
|
997
|
-
assigned_by_swarm_id: sourceSwarm,
|
|
998
|
-
}),
|
|
999
|
-
);
|
|
1000
|
-
});
|
|
1001
|
-
});
|
|
1002
|
-
|
|
1003
|
-
// ═══════════════════════════════════════════════════════════════
|
|
1004
|
-
// Phase 6: Coordination Types — createCoordinationNotification
|
|
1005
|
-
// ═══════════════════════════════════════════════════════════════
|
|
1006
|
-
|
|
1007
|
-
describe('createCoordinationNotification', () => {
|
|
1008
|
-
it('should create a well-formed JSON-RPC 2.0 notification', () => {
|
|
1009
|
-
const params: TaskAssignParams = {
|
|
1010
|
-
task_id: 'ct_notify',
|
|
1011
|
-
title: 'Notification test',
|
|
1012
|
-
description: 'Testing notification creation',
|
|
1013
|
-
priority: 'medium',
|
|
1014
|
-
assigned_by: agentId,
|
|
1015
|
-
assigned_to_swarm: swarmId2,
|
|
1016
|
-
hive_id: hiveId,
|
|
1017
|
-
};
|
|
1018
|
-
|
|
1019
|
-
const notification = createCoordinationNotification('x-openhive/task.assign', params);
|
|
1020
|
-
|
|
1021
|
-
expect(notification.jsonrpc).toBe('2.0');
|
|
1022
|
-
expect(notification.method).toBe('x-openhive/task.assign');
|
|
1023
|
-
expect(notification.params).toBe(params);
|
|
1024
|
-
});
|
|
1025
|
-
|
|
1026
|
-
it('should create notifications for each method type', () => {
|
|
1027
|
-
const taskAssign = createCoordinationNotification('x-openhive/task.assign', {
|
|
1028
|
-
task_id: 'ct_1', title: 'T', description: 'D', priority: 'low',
|
|
1029
|
-
assigned_by: agentId, assigned_to_swarm: swarmId2, hive_id: hiveId,
|
|
1030
|
-
} as TaskAssignParams);
|
|
1031
|
-
expect(taskAssign.method).toBe('x-openhive/task.assign');
|
|
1032
|
-
|
|
1033
|
-
const taskStatus = createCoordinationNotification('x-openhive/task.status', {
|
|
1034
|
-
task_id: 'ct_1', status: 'in_progress',
|
|
1035
|
-
} as TaskStatusParams);
|
|
1036
|
-
expect(taskStatus.method).toBe('x-openhive/task.status');
|
|
1037
|
-
|
|
1038
|
-
const contextShare = createCoordinationNotification('x-openhive/context.share', {
|
|
1039
|
-
context_id: 'sc_1', source_swarm_id: swarmId1, target_swarm_ids: [],
|
|
1040
|
-
hive_id: hiveId, context_type: 'test', data: {},
|
|
1041
|
-
} as ContextShareParams);
|
|
1042
|
-
expect(contextShare.method).toBe('x-openhive/context.share');
|
|
1043
|
-
|
|
1044
|
-
const messageSend = createCoordinationNotification('x-openhive/message.send', {
|
|
1045
|
-
message_id: 'sm_1', from_swarm_id: swarmId1, to_swarm_id: swarmId2,
|
|
1046
|
-
content_type: 'text', content: 'Hi',
|
|
1047
|
-
} as MessageSendParams);
|
|
1048
|
-
expect(messageSend.method).toBe('x-openhive/message.send');
|
|
1049
|
-
});
|
|
1050
|
-
|
|
1051
|
-
it('should pass params by reference, not copy', () => {
|
|
1052
|
-
const params: TaskStatusParams = {
|
|
1053
|
-
task_id: 'ct_ref',
|
|
1054
|
-
status: 'accepted',
|
|
1055
|
-
};
|
|
1056
|
-
const notification = createCoordinationNotification('x-openhive/task.status', params);
|
|
1057
|
-
expect(notification.params).toBe(params); // Same reference
|
|
1058
|
-
});
|
|
1059
|
-
|
|
1060
|
-
it('should produce output accepted by isCoordinationMessage', () => {
|
|
1061
|
-
const notification = createCoordinationNotification('x-openhive/message.send', {
|
|
1062
|
-
message_id: 'sm_roundtrip',
|
|
1063
|
-
from_swarm_id: swarmId1,
|
|
1064
|
-
to_swarm_id: swarmId2,
|
|
1065
|
-
content_type: 'text',
|
|
1066
|
-
content: 'roundtrip test',
|
|
1067
|
-
} as MessageSendParams);
|
|
1068
|
-
|
|
1069
|
-
expect(isCoordinationMessage(notification)).toBe(true);
|
|
1070
|
-
});
|
|
1071
|
-
});
|
|
1072
|
-
});
|