@haaaiawd/second-nature 0.1.50 → 0.1.51
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/SKILL.md +22 -320
- package/{docs/claw-second-nature-inner-guide.md → agent-inner-guide.md} +43 -0
- package/openclaw.plugin.json +29 -0
- package/package.json +32 -61
- package/{dist/src → runtime}/cli/commands/index.js +325 -325
- package/{dist/src → runtime}/cli/ops/heartbeat-surface.d.ts +84 -84
- package/{dist/src → runtime}/cli/ops/heartbeat-surface.js +100 -100
- package/{dist/src → runtime}/cli/ops/ops-router.js +1482 -1482
- package/{dist/src → runtime}/cli/ops/workspace-heartbeat-runner.d.ts +85 -85
- package/{dist/src → runtime}/cli/ops/workspace-heartbeat-runner.js +242 -242
- package/{dist/src → runtime}/connectors/base/contract.d.ts +111 -111
- package/{dist/src → runtime}/connectors/base/failure-taxonomy.d.ts +13 -13
- package/{dist/src → runtime}/connectors/base/failure-taxonomy.js +186 -186
- package/{dist/src → runtime}/connectors/base/map-life-evidence.js +137 -137
- package/{dist/src → runtime}/connectors/base/policy-layer.js +202 -202
- package/{dist/src → runtime}/connectors/manifest/manifest-schema.d.ts +152 -152
- package/{dist/src → runtime}/connectors/manifest/manifest-schema.js +54 -54
- package/{dist/src → runtime}/connectors/services/connector-executor-adapter.d.ts +20 -20
- package/{dist/src → runtime}/connectors/services/connector-executor-adapter.js +645 -645
- package/{dist/src → runtime}/core/second-nature/heartbeat/goal-lifecycle-policy.d.ts +24 -24
- package/{dist/src → runtime}/core/second-nature/heartbeat/goal-lifecycle-policy.js +61 -61
- package/{dist/src → runtime}/core/second-nature/heartbeat/heartbeat-loop.d.ts +97 -97
- package/{dist/src → runtime}/core/second-nature/heartbeat/heartbeat-loop.js +397 -397
- package/{dist/src → runtime}/core/second-nature/orchestrator/platform-capability-router.js +149 -149
- package/HEARTBEAT.md +0 -44
- package/LICENSE +0 -176
- package/README.md +0 -136
- package/README.zh-CN.md +0 -120
- package/dist/data/observability.db +0 -0
- package/dist/data/state.db +0 -0
- package/dist/plugin/index.d.ts +0 -31
- package/dist/plugin/workspace-ops-bridge.d.ts +0 -15
- package/dist/scripts/build-plugin-package.d.ts +0 -12
- package/dist/scripts/build-plugin-package.js +0 -220
- package/dist/scripts/build-plugin-runtime.d.ts +0 -10
- package/dist/scripts/build-plugin-runtime.js +0 -198
- package/dist/scripts/packaging-feasibility-poc.d.ts +0 -1
- package/dist/scripts/packaging-feasibility-poc.js +0 -127
- package/dist/scripts/plugin-smoke-check.d.ts +0 -1
- package/dist/scripts/plugin-smoke-check.js +0 -124
- package/dist/src/cli/action-bridge.d.ts +0 -11
- package/dist/src/cli/index.d.ts +0 -65
- package/dist/tests/integration/cli/cli-ops-surface.test.d.ts +0 -1
- package/dist/tests/integration/cli/cli-ops-surface.test.js +0 -380
- package/dist/tests/integration/cli/heartbeat-surface-workspace.test.d.ts +0 -1
- package/dist/tests/integration/cli/heartbeat-surface-workspace.test.js +0 -61
- package/dist/tests/integration/cli/host-capability-probe.test.d.ts +0 -1
- package/dist/tests/integration/cli/host-capability-probe.test.js +0 -37
- package/dist/tests/integration/cli/host-smoke-heartbeat-tool.test.d.ts +0 -1
- package/dist/tests/integration/cli/host-smoke-heartbeat-tool.test.js +0 -34
- package/dist/tests/integration/cli/plugin-packaging-walkthrough.test.d.ts +0 -1
- package/dist/tests/integration/cli/plugin-packaging-walkthrough.test.js +0 -79
- package/dist/tests/integration/cli/plugin-runtime-registration.test.d.ts +0 -1
- package/dist/tests/integration/cli/plugin-runtime-registration.test.js +0 -285
- package/dist/tests/integration/cli/plugin-workspace-ops-bridge.test.d.ts +0 -1
- package/dist/tests/integration/cli/plugin-workspace-ops-bridge.test.js +0 -487
- package/dist/tests/integration/cli/t1-2-1-explain-read-models.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-1-explain-read-models.test.js +0 -58
- package/dist/tests/integration/cli/t1-2-1-narrative-command.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-1-narrative-command.test.js +0 -194
- package/dist/tests/integration/cli/t1-2-2-dream-recent.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-2-dream-recent.test.js +0 -100
- package/dist/tests/integration/cli/t1-2-3-status-observability-writeback.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-3-status-observability-writeback.test.js +0 -71
- package/dist/tests/integration/cli/t1-2-4-quiet-report-read-canonical.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-4-quiet-report-read-canonical.test.js +0 -206
- package/dist/tests/integration/cli/t1-2-5-cycle-recent.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-5-cycle-recent.test.js +0 -156
- package/dist/tests/integration/cli/t1-2-5-status-delivery-posture-audit-store.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-5-status-delivery-posture-audit-store.test.js +0 -95
- package/dist/tests/integration/cli/t1-2-6-policy-show-non-shell.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-6-policy-show-non-shell.test.js +0 -74
- package/dist/tests/integration/cli/t1-2-6-status-aggregate.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-6-status-aggregate.test.js +0 -223
- package/dist/tests/integration/cli/t1-2-7-audit-command-minimal-closure.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-7-audit-command-minimal-closure.test.js +0 -101
- package/dist/tests/integration/cli/t1-2-8-capability-probe-ops-surface.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-8-capability-probe-ops-surface.test.js +0 -74
- package/dist/tests/integration/cli/t1-2-9-decision-denied-not-degraded.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-2-9-decision-denied-not-degraded.test.js +0 -79
- package/dist/tests/integration/cli/t1-4-1-runtime-secret-bootstrap.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-4-1-runtime-secret-bootstrap.test.js +0 -139
- package/dist/tests/integration/cli/t1-4-2-activation-ux-contract.test.d.ts +0 -1
- package/dist/tests/integration/cli/t1-4-2-activation-ux-contract.test.js +0 -143
- package/dist/tests/integration/cli/t2-2-2-snapshot-life-evidence.test.d.ts +0 -1
- package/dist/tests/integration/cli/t2-2-2-snapshot-life-evidence.test.js +0 -116
- package/dist/tests/integration/cli/t3-3-2-near-real-smoke-cli-bridge.test.d.ts +0 -1
- package/dist/tests/integration/cli/t3-3-2-near-real-smoke-cli-bridge.test.js +0 -69
- package/dist/tests/integration/connectors/connector-base.test.d.ts +0 -1
- package/dist/tests/integration/connectors/connector-base.test.js +0 -211
- package/dist/tests/integration/connectors/connector-executor-adapter-honest-failure.test.d.ts +0 -1
- package/dist/tests/integration/connectors/connector-executor-adapter-honest-failure.test.js +0 -311
- package/dist/tests/integration/connectors/credential-optional-regression.test.d.ts +0 -1
- package/dist/tests/integration/connectors/credential-optional-regression.test.js +0 -117
- package/dist/tests/integration/connectors/declarative-http-runner.test.d.ts +0 -7
- package/dist/tests/integration/connectors/declarative-http-runner.test.js +0 -229
- package/dist/tests/integration/connectors/evomap-secret-port.test.d.ts +0 -1
- package/dist/tests/integration/connectors/evomap-secret-port.test.js +0 -83
- package/dist/tests/integration/connectors/life-evidence-chain.test.d.ts +0 -1
- package/dist/tests/integration/connectors/life-evidence-chain.test.js +0 -188
- package/dist/tests/integration/connectors/moltbook-client.test.d.ts +0 -1
- package/dist/tests/integration/connectors/moltbook-client.test.js +0 -274
- package/dist/tests/integration/connectors/moltbook-mock-runner.test.d.ts +0 -7
- package/dist/tests/integration/connectors/moltbook-mock-runner.test.js +0 -108
- package/dist/tests/integration/connectors/near-real-connector-smoke.test.d.ts +0 -1
- package/dist/tests/integration/connectors/near-real-connector-smoke.test.js +0 -38
- package/dist/tests/integration/connectors/platform-adapters.test.d.ts +0 -1
- package/dist/tests/integration/connectors/platform-adapters.test.js +0 -189
- package/dist/tests/integration/connectors/policy-layer.test.d.ts +0 -1
- package/dist/tests/integration/connectors/policy-layer.test.js +0 -249
- package/dist/tests/integration/connectors/scriptable-node-e2e.test.d.ts +0 -1
- package/dist/tests/integration/connectors/scriptable-node-e2e.test.js +0 -228
- package/dist/tests/integration/connectors/t3-3-1-real-connector-evidence.test.d.ts +0 -1
- package/dist/tests/integration/connectors/t3-3-1-real-connector-evidence.test.js +0 -171
- package/dist/tests/integration/control-plane/_helpers/decision-cycle-harness.d.ts +0 -40
- package/dist/tests/integration/control-plane/_helpers/decision-cycle-harness.js +0 -116
- package/dist/tests/integration/control-plane/decision-loop-validation.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/decision-loop-validation.test.js +0 -319
- package/dist/tests/integration/control-plane/delivery-failed-fallback.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/delivery-failed-fallback.test.js +0 -118
- package/dist/tests/integration/control-plane/dream-projection-heartbeat.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/dream-projection-heartbeat.test.js +0 -109
- package/dist/tests/integration/control-plane/effect-dispatcher.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/effect-dispatcher.test.js +0 -157
- package/dist/tests/integration/control-plane/guidance-request.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/guidance-request.test.js +0 -63
- package/dist/tests/integration/control-plane/heartbeat-executor.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-executor.test.js +0 -363
- package/dist/tests/integration/control-plane/heartbeat-loop.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-loop.test.js +0 -190
- package/dist/tests/integration/control-plane/heartbeat-quiet-orchestration.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-quiet-orchestration.test.js +0 -133
- package/dist/tests/integration/control-plane/heartbeat-spine-integration.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-spine-integration.test.js +0 -342
- package/dist/tests/integration/control-plane/heartbeat-spine.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/heartbeat-spine.test.js +0 -216
- package/dist/tests/integration/control-plane/int-s3-outreach-delivery-quiet-closure.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/int-s3-outreach-delivery-quiet-closure.test.js +0 -241
- package/dist/tests/integration/control-plane/outreach-resume.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/outreach-resume.test.js +0 -158
- package/dist/tests/integration/control-plane/outreach-style.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/outreach-style.test.js +0 -46
- package/dist/tests/integration/control-plane/quiet-reflection.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/quiet-reflection.test.js +0 -73
- package/dist/tests/integration/control-plane/rhythm-intent-guard.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/rhythm-intent-guard.test.js +0 -99
- package/dist/tests/integration/control-plane/run-heartbeat-cycle.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/run-heartbeat-cycle.test.js +0 -80
- package/dist/tests/integration/control-plane/t2-3-1-outreach-v6.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/t2-3-1-outreach-v6.test.js +0 -208
- package/dist/tests/integration/control-plane/t2-4-1-heartbeat-platform-intent.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/t2-4-1-heartbeat-platform-intent.test.js +0 -156
- package/dist/tests/integration/control-plane/t2-4-2-source-backed-outreach-loop.test.d.ts +0 -1
- package/dist/tests/integration/control-plane/t2-4-2-source-backed-outreach-loop.test.js +0 -188
- package/dist/tests/integration/control-plane/v7c-evidence-body-feedback.test.d.ts +0 -11
- package/dist/tests/integration/control-plane/v7c-evidence-body-feedback.test.js +0 -213
- package/dist/tests/integration/control-plane/v7c-heartbeat-unlock-e2e.test.d.ts +0 -9
- package/dist/tests/integration/control-plane/v7c-heartbeat-unlock-e2e.test.js +0 -134
- package/dist/tests/integration/dream/quiet-dream-trigger.test.d.ts +0 -1
- package/dist/tests/integration/dream/quiet-dream-trigger.test.js +0 -86
- package/dist/tests/integration/dream/t7-1-1-dream-pipeline.test.d.ts +0 -1
- package/dist/tests/integration/dream/t7-1-1-dream-pipeline.test.js +0 -378
- package/dist/tests/integration/dream/t7-1-2-dream-scheduler.test.d.ts +0 -1
- package/dist/tests/integration/dream/t7-1-2-dream-scheduler.test.js +0 -124
- package/dist/tests/integration/dream/v7c-rhythm-loop.test.d.ts +0 -10
- package/dist/tests/integration/dream/v7c-rhythm-loop.test.js +0 -185
- package/dist/tests/integration/guidance/assembler-and-fallback.test.d.ts +0 -1
- package/dist/tests/integration/guidance/assembler-and-fallback.test.js +0 -86
- package/dist/tests/integration/guidance/outreach-draft-contract.test.d.ts +0 -1
- package/dist/tests/integration/guidance/outreach-draft-contract.test.js +0 -106
- package/dist/tests/integration/guidance/persona-selection.test.d.ts +0 -1
- package/dist/tests/integration/guidance/persona-selection.test.js +0 -70
- package/dist/tests/integration/guidance/template-review.test.d.ts +0 -1
- package/dist/tests/integration/guidance/template-review.test.js +0 -26
- package/dist/tests/integration/guidance/user-reply-continuity.test.d.ts +0 -1
- package/dist/tests/integration/guidance/user-reply-continuity.test.js +0 -96
- package/dist/tests/integration/guidance/v7c-guidance-chain.test.d.ts +0 -1
- package/dist/tests/integration/guidance/v7c-guidance-chain.test.js +0 -190
- package/dist/tests/integration/guidance/v7c-guidance-semantics.test.d.ts +0 -1
- package/dist/tests/integration/guidance/v7c-guidance-semantics.test.js +0 -146
- package/dist/tests/integration/observability/digest-delivery.test.d.ts +0 -14
- package/dist/tests/integration/observability/digest-delivery.test.js +0 -160
- package/dist/tests/integration/observability/evidence-query-engine.test.d.ts +0 -1
- package/dist/tests/integration/observability/evidence-query-engine.test.js +0 -219
- package/dist/tests/integration/observability/explain-query-export.test.d.ts +0 -1
- package/dist/tests/integration/observability/explain-query-export.test.js +0 -92
- package/dist/tests/integration/observability/guidance-audit.test.d.ts +0 -1
- package/dist/tests/integration/observability/guidance-audit.test.js +0 -55
- package/dist/tests/integration/observability/heartbeat-decision-record.test.d.ts +0 -1
- package/dist/tests/integration/observability/heartbeat-decision-record.test.js +0 -223
- package/dist/tests/integration/observability/heartbeat-narrative-trace.test.d.ts +0 -1
- package/dist/tests/integration/observability/heartbeat-narrative-trace.test.js +0 -230
- package/dist/tests/integration/observability/lived-experience-audit-chain.test.d.ts +0 -1
- package/dist/tests/integration/observability/lived-experience-audit-chain.test.js +0 -43
- package/dist/tests/integration/observability/observability-gates.test.d.ts +0 -1
- package/dist/tests/integration/observability/observability-gates.test.js +0 -224
- package/dist/tests/integration/observability/observability-retention-cleanup.test.d.ts +0 -1
- package/dist/tests/integration/observability/observability-retention-cleanup.test.js +0 -94
- package/dist/tests/integration/observability/observability-services.test.d.ts +0 -1
- package/dist/tests/integration/observability/observability-services.test.js +0 -219
- package/dist/tests/integration/observability/projections.test.d.ts +0 -1
- package/dist/tests/integration/observability/projections.test.js +0 -36
- package/dist/tests/integration/observability/t5-1-1-dream-trace-audit.test.d.ts +0 -1
- package/dist/tests/integration/observability/t5-1-1-dream-trace-audit.test.js +0 -115
- package/dist/tests/integration/plugin/plugin-registration.test.d.ts +0 -16
- package/dist/tests/integration/plugin/plugin-registration.test.js +0 -151
- package/dist/tests/integration/runtime-ops/commands.test.d.ts +0 -16
- package/dist/tests/integration/runtime-ops/commands.test.js +0 -662
- package/dist/tests/integration/s3-exit/int-s3-body-heartbeat.test.d.ts +0 -15
- package/dist/tests/integration/s3-exit/int-s3-body-heartbeat.test.js +0 -462
- package/dist/tests/integration/s5-exit/int-s5-observability.test.d.ts +0 -17
- package/dist/tests/integration/s5-exit/int-s5-observability.test.js +0 -402
- package/dist/tests/integration/state/t4-2-1-owner-reply-relationship-loop.test.d.ts +0 -1
- package/dist/tests/integration/state/t4-2-1-owner-reply-relationship-loop.test.js +0 -132
- package/dist/tests/integration/state/v7c-identity-goal-hygiene.test.d.ts +0 -9
- package/dist/tests/integration/state/v7c-identity-goal-hygiene.test.js +0 -240
- package/dist/tests/integration/storage/packaged-runtime-smoke.test.d.ts +0 -1
- package/dist/tests/integration/storage/packaged-runtime-smoke.test.js +0 -17
- package/dist/tests/integration/storage/persona-candidate-loader.test.d.ts +0 -1
- package/dist/tests/integration/storage/persona-candidate-loader.test.js +0 -23
- package/dist/tests/integration/storage/quiet-artifact-writer.test.d.ts +0 -1
- package/dist/tests/integration/storage/quiet-artifact-writer.test.js +0 -66
- package/dist/tests/integration/storage/repair-and-backup.test.d.ts +0 -1
- package/dist/tests/integration/storage/repair-and-backup.test.js +0 -125
- package/dist/tests/integration/storage/schema-migration.test.d.ts +0 -11
- package/dist/tests/integration/storage/schema-migration.test.js +0 -183
- package/dist/tests/integration/storage/storage-mode-smoke.test.d.ts +0 -1
- package/dist/tests/integration/storage/storage-mode-smoke.test.js +0 -18
- package/dist/tests/integration/storage/t4-1-5-memory-store-lifecycle.test.d.ts +0 -1
- package/dist/tests/integration/storage/t4-1-5-memory-store-lifecycle.test.js +0 -118
- package/dist/tests/unit/body/affordance-assembler.test.d.ts +0 -14
- package/dist/tests/unit/body/affordance-assembler.test.js +0 -259
- package/dist/tests/unit/body/affordance-context-scope.test.d.ts +0 -12
- package/dist/tests/unit/body/affordance-context-scope.test.js +0 -73
- package/dist/tests/unit/body/behavior-promotion-loop.test.d.ts +0 -15
- package/dist/tests/unit/body/behavior-promotion-loop.test.js +0 -130
- package/dist/tests/unit/body/circuit-breaker-manager.test.d.ts +0 -13
- package/dist/tests/unit/body/circuit-breaker-manager.test.js +0 -160
- package/dist/tests/unit/body/experience-writer.test.d.ts +0 -11
- package/dist/tests/unit/body/experience-writer.test.js +0 -77
- package/dist/tests/unit/body/pain-signal-query.test.d.ts +0 -11
- package/dist/tests/unit/body/pain-signal-query.test.js +0 -104
- package/dist/tests/unit/cli/connector-init-manifest.test.d.ts +0 -9
- package/dist/tests/unit/cli/connector-init-manifest.test.js +0 -68
- package/dist/tests/unit/cli/delivery-target-probe.test.d.ts +0 -1
- package/dist/tests/unit/cli/delivery-target-probe.test.js +0 -108
- package/dist/tests/unit/cli/host-capability.test.d.ts +0 -1
- package/dist/tests/unit/cli/host-capability.test.js +0 -50
- package/dist/tests/unit/cli/operator-fallback-view.test.d.ts +0 -1
- package/dist/tests/unit/cli/operator-fallback-view.test.js +0 -60
- package/dist/tests/unit/cli/runtime-artifact-boundary.test.d.ts +0 -1
- package/dist/tests/unit/cli/runtime-artifact-boundary.test.js +0 -57
- package/dist/tests/unit/cli/t1-2-3-connector-status.test.d.ts +0 -1
- package/dist/tests/unit/cli/t1-2-3-connector-status.test.js +0 -214
- package/dist/tests/unit/cli/t1-2-4-goal-command.test.d.ts +0 -1
- package/dist/tests/unit/cli/t1-2-4-goal-command.test.js +0 -207
- package/dist/tests/unit/cli/t1-3-1-connector-init.test.d.ts +0 -1
- package/dist/tests/unit/cli/t1-3-1-connector-init.test.js +0 -212
- package/dist/tests/unit/connectors/connector-manifest-and-evidence-map.test.d.ts +0 -1
- package/dist/tests/unit/connectors/connector-manifest-and-evidence-map.test.js +0 -71
- package/dist/tests/unit/connectors/effect-commit-ledger-sqlite.test.d.ts +0 -10
- package/dist/tests/unit/connectors/effect-commit-ledger-sqlite.test.js +0 -101
- package/dist/tests/unit/connectors/evomap-runner.test.d.ts +0 -1
- package/dist/tests/unit/connectors/evomap-runner.test.js +0 -136
- package/dist/tests/unit/connectors/execution-policy.test.d.ts +0 -1
- package/dist/tests/unit/connectors/execution-policy.test.js +0 -71
- package/dist/tests/unit/connectors/instreet-registration.test.d.ts +0 -1
- package/dist/tests/unit/connectors/instreet-registration.test.js +0 -102
- package/dist/tests/unit/connectors/manifest-v7-schema.test.d.ts +0 -9
- package/dist/tests/unit/connectors/manifest-v7-schema.test.js +0 -165
- package/dist/tests/unit/connectors/scriptable-node-runner.test.d.ts +0 -1
- package/dist/tests/unit/connectors/scriptable-node-runner.test.js +0 -246
- package/dist/tests/unit/connectors/structured-unavailable-reason.test.d.ts +0 -11
- package/dist/tests/unit/connectors/structured-unavailable-reason.test.js +0 -76
- package/dist/tests/unit/connectors/t3-1-1-dynamic-registry.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-1-1-dynamic-registry.test.js +0 -178
- package/dist/tests/unit/connectors/t3-1-2-capability-registry.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-1-2-capability-registry.test.js +0 -105
- package/dist/tests/unit/connectors/t3-2-1-v5-parity.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-2-1-v5-parity.test.js +0 -103
- package/dist/tests/unit/connectors/t3-3-1-evidence-mapper.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-3-1-evidence-mapper.test.js +0 -198
- package/dist/tests/unit/connectors/t3-3-1-evidence-redaction.test.d.ts +0 -1
- package/dist/tests/unit/connectors/t3-3-1-evidence-redaction.test.js +0 -95
- package/dist/tests/unit/connectors/wet-probe-runner.test.d.ts +0 -11
- package/dist/tests/unit/connectors/wet-probe-runner.test.js +0 -84
- package/dist/tests/unit/control-plane/decision-trace-emitter.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/decision-trace-emitter.test.js +0 -51
- package/dist/tests/unit/control-plane/downstream-intent-orchestrator.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/downstream-intent-orchestrator.test.js +0 -57
- package/dist/tests/unit/control-plane/embodied-context-assembler.test.d.ts +0 -13
- package/dist/tests/unit/control-plane/embodied-context-assembler.test.js +0 -182
- package/dist/tests/unit/control-plane/goal-lifecycle-policy.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/goal-lifecycle-policy.test.js +0 -75
- package/dist/tests/unit/control-plane/hard-guard-evaluator.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/hard-guard-evaluator.test.js +0 -113
- package/dist/tests/unit/control-plane/idle-curiosity-policy.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/idle-curiosity-policy.test.js +0 -69
- package/dist/tests/unit/control-plane/intent-planner-source-ref-fallback.test.d.ts +0 -7
- package/dist/tests/unit/control-plane/intent-planner-source-ref-fallback.test.js +0 -124
- package/dist/tests/unit/control-plane/rhythm-policy-snapshot-window.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/rhythm-policy-snapshot-window.test.js +0 -64
- package/dist/tests/unit/control-plane/run-heartbeat-cycle-v7.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/run-heartbeat-cycle-v7.test.js +0 -165
- package/dist/tests/unit/control-plane/t2-1-4-goal-priority.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/t2-1-4-goal-priority.test.js +0 -185
- package/dist/tests/unit/control-plane/t2-1-5-narrative-update.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/t2-1-5-narrative-update.test.js +0 -313
- package/dist/tests/unit/control-plane/t2-4-1-credential-route.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/t2-4-1-credential-route.test.js +0 -75
- package/dist/tests/unit/control-plane/t2-4-1-platform-intent.test.d.ts +0 -1
- package/dist/tests/unit/control-plane/t2-4-1-platform-intent.test.js +0 -168
- package/dist/tests/unit/core/outreach-judgment.test.d.ts +0 -1
- package/dist/tests/unit/core/outreach-judgment.test.js +0 -109
- package/dist/tests/unit/core/resolve-allowed-intent.test.d.ts +0 -1
- package/dist/tests/unit/core/resolve-allowed-intent.test.js +0 -69
- package/dist/tests/unit/core/t2-2-3-connector-action-honest-result.test.d.ts +0 -1
- package/dist/tests/unit/core/t2-2-3-connector-action-honest-result.test.js +0 -130
- package/dist/tests/unit/core/t2-2-3-connector-dispatch-wired.test.d.ts +0 -1
- package/dist/tests/unit/core/t2-2-3-connector-dispatch-wired.test.js +0 -99
- package/dist/tests/unit/dream/dream-input-loader.test.d.ts +0 -15
- package/dist/tests/unit/dream/dream-input-loader.test.js +0 -424
- package/dist/tests/unit/dream/dream-scheduler.test.d.ts +0 -1
- package/dist/tests/unit/dream/dream-scheduler.test.js +0 -57
- package/dist/tests/unit/dream/t-dqs-c3-redacted-evidence.test.d.ts +0 -11
- package/dist/tests/unit/dream/t-dqs-c3-redacted-evidence.test.js +0 -298
- package/dist/tests/unit/dream/t7-1-3-insight-extraction.test.d.ts +0 -1
- package/dist/tests/unit/dream/t7-1-3-insight-extraction.test.js +0 -79
- package/dist/tests/unit/dream/t7-1-4-narrative-update.test.d.ts +0 -1
- package/dist/tests/unit/dream/t7-1-4-narrative-update.test.js +0 -93
- package/dist/tests/unit/dream/t7-1-5-relationship-update.test.d.ts +0 -1
- package/dist/tests/unit/dream/t7-1-5-relationship-update.test.js +0 -116
- package/dist/tests/unit/feedback/t4-2-1-owner-reply-inference.test.d.ts +0 -1
- package/dist/tests/unit/feedback/t4-2-1-owner-reply-inference.test.js +0 -58
- package/dist/tests/unit/guidance/capability-class.test.d.ts +0 -1
- package/dist/tests/unit/guidance/capability-class.test.js +0 -96
- package/dist/tests/unit/guidance/channel-feedback-ingestion.test.d.ts +0 -1
- package/dist/tests/unit/guidance/channel-feedback-ingestion.test.js +0 -163
- package/dist/tests/unit/guidance/evidence-guidance.test.d.ts +0 -1
- package/dist/tests/unit/guidance/evidence-guidance.test.js +0 -40
- package/dist/tests/unit/guidance/guidance-draft-service.test.d.ts +0 -1
- package/dist/tests/unit/guidance/guidance-draft-service.test.js +0 -140
- package/dist/tests/unit/guidance/impulse-assembler.test.d.ts +0 -1
- package/dist/tests/unit/guidance/impulse-assembler.test.js +0 -169
- package/dist/tests/unit/guidance/outreach-draft-schema.test.d.ts +0 -1
- package/dist/tests/unit/guidance/outreach-draft-schema.test.js +0 -56
- package/dist/tests/unit/guidance/outreach-strategy-selector.test.d.ts +0 -1
- package/dist/tests/unit/guidance/outreach-strategy-selector.test.js +0 -208
- package/dist/tests/unit/guidance/outreach-style-fixtures.test.d.ts +0 -1
- package/dist/tests/unit/guidance/outreach-style-fixtures.test.js +0 -81
- package/dist/tests/unit/guidance/t6-1-1-narrative-outreach.test.d.ts +0 -1
- package/dist/tests/unit/guidance/t6-1-1-narrative-outreach.test.js +0 -256
- package/dist/tests/unit/observability/audit-envelope.test.d.ts +0 -1
- package/dist/tests/unit/observability/audit-envelope.test.js +0 -169
- package/dist/tests/unit/observability/connector-inventory-ledger.test.d.ts +0 -1
- package/dist/tests/unit/observability/connector-inventory-ledger.test.js +0 -128
- package/dist/tests/unit/observability/family-registry.test.d.ts +0 -12
- package/dist/tests/unit/observability/family-registry.test.js +0 -105
- package/dist/tests/unit/observability/governance-plane-recorder.test.d.ts +0 -1
- package/dist/tests/unit/observability/governance-plane-recorder.test.js +0 -72
- package/dist/tests/unit/observability/heartbeat-digest-assembler.test.d.ts +0 -1
- package/dist/tests/unit/observability/heartbeat-digest-assembler.test.js +0 -227
- package/dist/tests/unit/observability/lived-experience-audit.test.d.ts +0 -1
- package/dist/tests/unit/observability/lived-experience-audit.test.js +0 -105
- package/dist/tests/unit/observability/narrative-timeline-query.test.d.ts +0 -18
- package/dist/tests/unit/observability/narrative-timeline-query.test.js +0 -239
- package/dist/tests/unit/observability/restore-audit-service.test.d.ts +0 -16
- package/dist/tests/unit/observability/restore-audit-service.test.js +0 -186
- package/dist/tests/unit/observability/runtime-decision-recorder.test.d.ts +0 -1
- package/dist/tests/unit/observability/runtime-decision-recorder.test.js +0 -66
- package/dist/tests/unit/observability/runtime-secret-anchor-view.test.d.ts +0 -18
- package/dist/tests/unit/observability/runtime-secret-anchor-view.test.js +0 -209
- package/dist/tests/unit/observability/self-health-snapshot.test.d.ts +0 -1
- package/dist/tests/unit/observability/self-health-snapshot.test.js +0 -223
- package/dist/tests/unit/observability/verify-audit-hash-chain.test.d.ts +0 -1
- package/dist/tests/unit/observability/verify-audit-hash-chain.test.js +0 -93
- package/dist/tests/unit/ops/manual-run-dispatcher.test.d.ts +0 -13
- package/dist/tests/unit/ops/manual-run-dispatcher.test.js +0 -219
- package/dist/tests/unit/quiet/claim-synthesizer.test.d.ts +0 -17
- package/dist/tests/unit/quiet/claim-synthesizer.test.js +0 -289
- package/dist/tests/unit/quiet/daily-diary-writer.test.d.ts +0 -12
- package/dist/tests/unit/quiet/daily-diary-writer.test.js +0 -108
- package/dist/tests/unit/shared/v7-entities.test.d.ts +0 -13
- package/dist/tests/unit/shared/v7-entities.test.js +0 -306
- package/dist/tests/unit/storage/delivery-attempt.test.d.ts +0 -1
- package/dist/tests/unit/storage/delivery-attempt.test.js +0 -72
- package/dist/tests/unit/storage/diary-dream-store.test.d.ts +0 -12
- package/dist/tests/unit/storage/diary-dream-store.test.js +0 -118
- package/dist/tests/unit/storage/embodied-context-state-port.test.d.ts +0 -4
- package/dist/tests/unit/storage/embodied-context-state-port.test.js +0 -77
- package/dist/tests/unit/storage/goal-lifecycle-store.test.d.ts +0 -4
- package/dist/tests/unit/storage/goal-lifecycle-store.test.js +0 -143
- package/dist/tests/unit/storage/history-digest-store.test.d.ts +0 -10
- package/dist/tests/unit/storage/history-digest-store.test.js +0 -126
- package/dist/tests/unit/storage/identity-profile-store.test.d.ts +0 -4
- package/dist/tests/unit/storage/identity-profile-store.test.js +0 -48
- package/dist/tests/unit/storage/life-evidence-snapshot.test.d.ts +0 -1
- package/dist/tests/unit/storage/life-evidence-snapshot.test.js +0 -60
- package/dist/tests/unit/storage/life-evidence.test.d.ts +0 -1
- package/dist/tests/unit/storage/life-evidence.test.js +0 -54
- package/dist/tests/unit/storage/migration-runner.test.d.ts +0 -12
- package/dist/tests/unit/storage/migration-runner.test.js +0 -197
- package/dist/tests/unit/storage/repair-gate.test.d.ts +0 -1
- package/dist/tests/unit/storage/repair-gate.test.js +0 -41
- package/dist/tests/unit/storage/restore-snapshot-store.test.d.ts +0 -11
- package/dist/tests/unit/storage/restore-snapshot-store.test.js +0 -161
- package/dist/tests/unit/storage/rhythm-policy-snapshot.test.d.ts +0 -1
- package/dist/tests/unit/storage/rhythm-policy-snapshot.test.js +0 -31
- package/dist/tests/unit/storage/runtime-secret-anchor-store.test.d.ts +0 -10
- package/dist/tests/unit/storage/runtime-secret-anchor-store.test.js +0 -81
- package/dist/tests/unit/storage/t1-4-1-credential-health-mapper.test.d.ts +0 -1
- package/dist/tests/unit/storage/t1-4-1-credential-health-mapper.test.js +0 -83
- package/dist/tests/unit/storage/t4-1-1-session-chronicle.test.d.ts +0 -1
- package/dist/tests/unit/storage/t4-1-1-session-chronicle.test.js +0 -112
- package/dist/tests/unit/storage/t4-1-2-narrative-state.test.d.ts +0 -1
- package/dist/tests/unit/storage/t4-1-2-narrative-state.test.js +0 -80
- package/dist/tests/unit/storage/t4-1-3-relationship-memory.test.d.ts +0 -1
- package/dist/tests/unit/storage/t4-1-3-relationship-memory.test.js +0 -65
- package/dist/tests/unit/storage/t4-1-4-agent-goal.test.d.ts +0 -1
- package/dist/tests/unit/storage/t4-1-4-agent-goal.test.js +0 -166
- package/dist/tests/unit/storage/tool-experience-store.test.d.ts +0 -4
- package/dist/tests/unit/storage/tool-experience-store.test.js +0 -92
- package/dist/tests/unit/storage/user-interest-snapshot.test.d.ts +0 -1
- package/dist/tests/unit/storage/user-interest-snapshot.test.js +0 -48
- package/dist/tests/unit/storage/write-queue.test.d.ts +0 -12
- package/dist/tests/unit/storage/write-queue.test.js +0 -177
- package/dist/tests/unit/storage/write-validation-gate.test.d.ts +0 -9
- package/dist/tests/unit/storage/write-validation-gate.test.js +0 -153
- /package/{dist/plugin/index.js → index.js} +0 -0
- /package/{dist/src → runtime}/cli/action-bridge.js +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-behavior.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-behavior.js +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-init.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-init.js +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-status.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/connector-status.js +0 -0
- /package/{dist/src → runtime}/cli/commands/credential.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/credential.js +0 -0
- /package/{dist/src → runtime}/cli/commands/goal.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/goal.js +0 -0
- /package/{dist/src → runtime}/cli/commands/index.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/policy.d.ts +0 -0
- /package/{dist/src → runtime}/cli/commands/policy.js +0 -0
- /package/{dist/src → runtime}/cli/explain/explain-surface-subject.d.ts +0 -0
- /package/{dist/src → runtime}/cli/explain/explain-surface-subject.js +0 -0
- /package/{dist/src → runtime}/cli/explain/format-explanation.d.ts +0 -0
- /package/{dist/src → runtime}/cli/explain/format-explanation.js +0 -0
- /package/{dist/src → runtime}/cli/explain/resolve-subject.d.ts +0 -0
- /package/{dist/src → runtime}/cli/explain/resolve-subject.js +0 -0
- /package/{dist/src → runtime}/cli/host-capability/classify-delivery.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-capability/classify-delivery.js +0 -0
- /package/{dist/src → runtime}/cli/host-capability/probe-host-capability.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-capability/probe-host-capability.js +0 -0
- /package/{dist/src → runtime}/cli/host-capability/record-host-capability.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-capability/record-host-capability.js +0 -0
- /package/{dist/src → runtime}/cli/host-capability/types.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-capability/types.js +0 -0
- /package/{dist/src → runtime}/cli/host-smoke/run-host-smoke.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-smoke/run-host-smoke.js +0 -0
- /package/{dist/src → runtime}/cli/host-smoke/types.d.ts +0 -0
- /package/{dist/src → runtime}/cli/host-smoke/types.js +0 -0
- /package/{dist/src → runtime}/cli/index.js +0 -0
- /package/{dist/src → runtime}/cli/ops/manual-run-dispatcher.d.ts +0 -0
- /package/{dist/src → runtime}/cli/ops/manual-run-dispatcher.js +0 -0
- /package/{dist/src → runtime}/cli/ops/ops-router.d.ts +0 -0
- /package/{dist/src → runtime}/cli/ops/show-operator-fallback.d.ts +0 -0
- /package/{dist/src → runtime}/cli/ops/show-operator-fallback.js +0 -0
- /package/{dist/src → runtime}/cli/read-models/index.d.ts +0 -0
- /package/{dist/src → runtime}/cli/read-models/index.js +0 -0
- /package/{dist/src → runtime}/cli/read-models/operator-explain-map.d.ts +0 -0
- /package/{dist/src → runtime}/cli/read-models/operator-explain-map.js +0 -0
- /package/{dist/src → runtime}/cli/read-models/types.d.ts +0 -0
- /package/{dist/src → runtime}/cli/read-models/types.js +0 -0
- /package/{dist/src → runtime}/cli/runtime/runtime-artifact-boundary.d.ts +0 -0
- /package/{dist/src → runtime}/cli/runtime/runtime-artifact-boundary.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/adapter.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/adapter.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/index.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/agent-world/manifest.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/adapter.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/adapter.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/index.js +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/agent-network/evomap/manifest.js +0 -0
- /package/{dist/src → runtime}/connectors/base/channel-health.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/channel-health.js +0 -0
- /package/{dist/src → runtime}/connectors/base/contract.js +0 -0
- /package/{dist/src → runtime}/connectors/base/effect-commit-ledger-sqlite.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/effect-commit-ledger-sqlite.js +0 -0
- /package/{dist/src → runtime}/connectors/base/execution-policy.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/execution-policy.js +0 -0
- /package/{dist/src → runtime}/connectors/base/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/index.js +0 -0
- /package/{dist/src → runtime}/connectors/base/manifest-v7.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/manifest-v7.js +0 -0
- /package/{dist/src → runtime}/connectors/base/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/manifest.js +0 -0
- /package/{dist/src → runtime}/connectors/base/map-life-evidence.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/policy-layer.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/route-planner.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/route-planner.js +0 -0
- /package/{dist/src → runtime}/connectors/base/structured-unavailable-reason.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/structured-unavailable-reason.js +0 -0
- /package/{dist/src → runtime}/connectors/base/wet-probe-runner.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/base/wet-probe-runner.js +0 -0
- /package/{dist/src → runtime}/connectors/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/index.js +0 -0
- /package/{dist/src → runtime}/connectors/manifest/manifest-parser.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/manifest/manifest-parser.js +0 -0
- /package/{dist/src → runtime}/connectors/near-real/near-real-connector-smoke.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/near-real/near-real-connector-smoke.js +0 -0
- /package/{dist/src → runtime}/connectors/registry/dynamic-connector-registry.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/registry/dynamic-connector-registry.js +0 -0
- /package/{dist/src → runtime}/connectors/registry/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/registry/index.js +0 -0
- /package/{dist/src → runtime}/connectors/registry/manifest-scanner.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/registry/manifest-scanner.js +0 -0
- /package/{dist/src → runtime}/connectors/registry/trust-policy.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/registry/trust-policy.js +0 -0
- /package/{dist/src → runtime}/connectors/services/credential-route-context.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/services/credential-route-context.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/adapter.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/adapter.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/index.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/instreet/manifest.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/adapter.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/adapter.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/api-client.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/api-client.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/index.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/index.js +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/connectors/social-community/moltbook/manifest.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/behavior-promotion/behavior-promotion-loop.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/behavior-promotion/behavior-promotion-loop.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/circuit-breaker/circuit-breaker-manager.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/circuit-breaker/circuit-breaker-manager.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/probe-signal-adapter.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/probe-signal-adapter.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-affordance/affordance-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-affordance/affordance-assembler.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-affordance/affordance-context-scope.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-affordance/affordance-context-scope.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-experience/experience-writer.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-experience/experience-writer.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-experience/pain-signal-query.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/body/tool-experience/pain-signal-query.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/feedback/owner-reply-feedback.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/feedback/owner-reply-feedback.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/apply-guidance.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/apply-guidance.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/request-guidance.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/request-guidance.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/user-reply-continuity.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/guidance/user-reply-continuity.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/decision-trace-emitter.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/decision-trace-emitter.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/embodied-context-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/embodied-context-assembler.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/heartbeat-executor.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/heartbeat-executor.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/idle-curiosity-policy.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/idle-curiosity-policy.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/index.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/index.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/run-heartbeat-cycle-v7.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/run-heartbeat-cycle-v7.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/run-heartbeat-cycle.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/run-heartbeat-cycle.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/runtime-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/runtime-snapshot.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/scope-router.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/scope-router.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/signal.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/signal.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/snapshot-builder.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/heartbeat/snapshot-builder.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/index.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/index.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/downstream-intent-orchestrator.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/downstream-intent-orchestrator.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/effect-dispatcher.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/effect-dispatcher.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/goal-priority.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/goal-priority.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/guard-layer.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/guard-layer.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/hard-guard-evaluator.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/hard-guard-evaluator.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/index.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/index.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/intent-planner.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/intent-planner.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/lease-manager.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/lease-manager.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/narrative-update.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/narrative-update.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/platform-capability-router.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/resume-from-checkpoint.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/orchestrator/resume-from-checkpoint.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/build-message.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/build-message.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/build-outreach-draft-request.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/build-outreach-draft-request.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/delivery-target.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/delivery-target.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/dispatch-user-outreach.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/dispatch-user-outreach.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/evaluate-outreach.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/evaluate-outreach.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/judge-input-from-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/judge-input-from-snapshot.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/judge-outreach.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/outreach/judge-outreach.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/claim-synthesizer.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/claim-synthesizer.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/daily-diary-writer.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/daily-diary-writer.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/index.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/index.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/quiet-pipeline.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/quiet-pipeline.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/run-source-backed-quiet.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/quiet/run-source-backed-quiet.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/reflection/run-narrative-reflection.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/reflection/run-narrative-reflection.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/planner-rhythm-window.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/planner-rhythm-window.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/policy-bridge.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/policy-bridge.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/rhythm-policy.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/rhythm-policy.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/select-window.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/rhythm/select-window.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/runtime/lifecycle-service.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/runtime/lifecycle-service.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/runtime/service-entry.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/runtime/service-entry.js +0 -0
- /package/{dist/src → runtime}/core/second-nature/types.d.ts +0 -0
- /package/{dist/src → runtime}/core/second-nature/types.js +0 -0
- /package/{dist/src → runtime}/dream/dream-engine.d.ts +0 -0
- /package/{dist/src → runtime}/dream/dream-engine.js +0 -0
- /package/{dist/src → runtime}/dream/dream-input-loader.d.ts +0 -0
- /package/{dist/src → runtime}/dream/dream-input-loader.js +0 -0
- /package/{dist/src → runtime}/dream/dream-scheduler.d.ts +0 -0
- /package/{dist/src → runtime}/dream/dream-scheduler.js +0 -0
- /package/{dist/src → runtime}/dream/index.d.ts +0 -0
- /package/{dist/src → runtime}/dream/index.js +0 -0
- /package/{dist/src → runtime}/dream/insight-extractor.d.ts +0 -0
- /package/{dist/src → runtime}/dream/insight-extractor.js +0 -0
- /package/{dist/src → runtime}/dream/memory-consolidator.d.ts +0 -0
- /package/{dist/src → runtime}/dream/memory-consolidator.js +0 -0
- /package/{dist/src → runtime}/dream/narrative-update-proposal.d.ts +0 -0
- /package/{dist/src → runtime}/dream/narrative-update-proposal.js +0 -0
- /package/{dist/src → runtime}/dream/output-validator.d.ts +0 -0
- /package/{dist/src → runtime}/dream/output-validator.js +0 -0
- /package/{dist/src → runtime}/dream/redaction-gate.d.ts +0 -0
- /package/{dist/src → runtime}/dream/redaction-gate.js +0 -0
- /package/{dist/src → runtime}/dream/relationship-update-proposal.d.ts +0 -0
- /package/{dist/src → runtime}/dream/relationship-update-proposal.js +0 -0
- /package/{dist/src → runtime}/dream/sampler.d.ts +0 -0
- /package/{dist/src → runtime}/dream/sampler.js +0 -0
- /package/{dist/src → runtime}/dream/types.d.ts +0 -0
- /package/{dist/src → runtime}/dream/types.js +0 -0
- /package/{dist/src → runtime}/guidance/capability-class.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/capability-class.js +0 -0
- /package/{dist/src → runtime}/guidance/channel-feedback-ingestion-service.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/channel-feedback-ingestion-service.js +0 -0
- /package/{dist/src → runtime}/guidance/contracts.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/contracts.js +0 -0
- /package/{dist/src → runtime}/guidance/draft-narrative-outreach.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/draft-narrative-outreach.js +0 -0
- /package/{dist/src → runtime}/guidance/draft-outreach-message.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/draft-outreach-message.js +0 -0
- /package/{dist/src → runtime}/guidance/evidence-guidance.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/evidence-guidance.js +0 -0
- /package/{dist/src → runtime}/guidance/fallback.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/fallback.js +0 -0
- /package/{dist/src → runtime}/guidance/guidance-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/guidance-assembler.js +0 -0
- /package/{dist/src → runtime}/guidance/guidance-draft-service.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/guidance-draft-service.js +0 -0
- /package/{dist/src → runtime}/guidance/impulse-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/impulse-assembler.js +0 -0
- /package/{dist/src → runtime}/guidance/index.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/index.js +0 -0
- /package/{dist/src → runtime}/guidance/output-guard.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/output-guard.js +0 -0
- /package/{dist/src → runtime}/guidance/outreach-draft-schema.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/outreach-draft-schema.js +0 -0
- /package/{dist/src → runtime}/guidance/outreach-strategy-selector.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/outreach-strategy-selector.js +0 -0
- /package/{dist/src → runtime}/guidance/persona-selection.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/persona-selection.js +0 -0
- /package/{dist/src → runtime}/guidance/review-workflow.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/review-workflow.js +0 -0
- /package/{dist/src → runtime}/guidance/template-registry.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/template-registry.js +0 -0
- /package/{dist/src → runtime}/guidance/types.d.ts +0 -0
- /package/{dist/src → runtime}/guidance/types.js +0 -0
- /package/{dist/src → runtime}/observability/audit/append-only-audit-store.d.ts +0 -0
- /package/{dist/src → runtime}/observability/audit/append-only-audit-store.js +0 -0
- /package/{dist/src → runtime}/observability/audit/audit-envelope.d.ts +0 -0
- /package/{dist/src → runtime}/observability/audit/audit-envelope.js +0 -0
- /package/{dist/src → runtime}/observability/audit/audit-family-registry.json +0 -0
- /package/{dist/src → runtime}/observability/audit/family-registry.d.ts +0 -0
- /package/{dist/src → runtime}/observability/audit/family-registry.js +0 -0
- /package/{dist/src → runtime}/observability/audit/verify-audit-hash-chain.d.ts +0 -0
- /package/{dist/src → runtime}/observability/audit/verify-audit-hash-chain.js +0 -0
- /package/{dist/src → runtime}/observability/connector-inventory-ledger.d.ts +0 -0
- /package/{dist/src → runtime}/observability/connector-inventory-ledger.js +0 -0
- /package/{dist/src → runtime}/observability/db/index.d.ts +0 -0
- /package/{dist/src → runtime}/observability/db/index.js +0 -0
- /package/{dist/src → runtime}/observability/db/schema/connector-inventory.d.ts +0 -0
- /package/{dist/src → runtime}/observability/db/schema/connector-inventory.js +0 -0
- /package/{dist/src → runtime}/observability/db/schema/host-capability-reports.d.ts +0 -0
- /package/{dist/src → runtime}/observability/db/schema/host-capability-reports.js +0 -0
- /package/{dist/src → runtime}/observability/db/schema/index.d.ts +0 -0
- /package/{dist/src → runtime}/observability/db/schema/index.js +0 -0
- /package/{dist/src → runtime}/observability/index.d.ts +0 -0
- /package/{dist/src → runtime}/observability/index.js +0 -0
- /package/{dist/src → runtime}/observability/projections/guidance-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/projections/guidance-audit.js +0 -0
- /package/{dist/src → runtime}/observability/projections/outreach-quality-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/projections/outreach-quality-audit.js +0 -0
- /package/{dist/src → runtime}/observability/projections/reflection-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/projections/reflection-audit.js +0 -0
- /package/{dist/src → runtime}/observability/query/compose-evidence.d.ts +0 -0
- /package/{dist/src → runtime}/observability/query/compose-evidence.js +0 -0
- /package/{dist/src → runtime}/observability/query/evidence-query-engine.d.ts +0 -0
- /package/{dist/src → runtime}/observability/query/evidence-query-engine.js +0 -0
- /package/{dist/src → runtime}/observability/query/explain-query.d.ts +0 -0
- /package/{dist/src → runtime}/observability/query/explain-query.js +0 -0
- /package/{dist/src → runtime}/observability/query/export-audit-bundle.d.ts +0 -0
- /package/{dist/src → runtime}/observability/query/export-audit-bundle.js +0 -0
- /package/{dist/src → runtime}/observability/redaction/manifest.d.ts +0 -0
- /package/{dist/src → runtime}/observability/redaction/manifest.js +0 -0
- /package/{dist/src → runtime}/observability/redaction/policy.d.ts +0 -0
- /package/{dist/src → runtime}/observability/redaction/policy.js +0 -0
- /package/{dist/src → runtime}/observability/services/decision-ledger.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/decision-ledger.js +0 -0
- /package/{dist/src → runtime}/observability/services/execution-telemetry.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/execution-telemetry.js +0 -0
- /package/{dist/src → runtime}/observability/services/governance-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/governance-audit.js +0 -0
- /package/{dist/src → runtime}/observability/services/governance-plane-recorder.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/governance-plane-recorder.js +0 -0
- /package/{dist/src → runtime}/observability/services/heartbeat-digest-assembler.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/heartbeat-digest-assembler.js +0 -0
- /package/{dist/src → runtime}/observability/services/lived-experience-audit.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/lived-experience-audit.js +0 -0
- /package/{dist/src → runtime}/observability/services/narrative-timeline-query-service.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/narrative-timeline-query-service.js +0 -0
- /package/{dist/src → runtime}/observability/services/observability-retention.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/observability-retention.js +0 -0
- /package/{dist/src → runtime}/observability/services/redaction-store.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/redaction-store.js +0 -0
- /package/{dist/src → runtime}/observability/services/restore-audit-service.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/restore-audit-service.js +0 -0
- /package/{dist/src → runtime}/observability/services/runtime-decision-recorder.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/runtime-decision-recorder.js +0 -0
- /package/{dist/src → runtime}/observability/services/runtime-secret-anchor-view.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/runtime-secret-anchor-view.js +0 -0
- /package/{dist/src → runtime}/observability/services/self-health-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/observability/services/self-health-snapshot.js +0 -0
- /package/{dist/src → runtime}/shared/types/continuity.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/continuity.js +0 -0
- /package/{dist/src → runtime}/shared/types/credential.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/credential.js +0 -0
- /package/{dist/src → runtime}/shared/types/goal.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/goal.js +0 -0
- /package/{dist/src → runtime}/shared/types/index.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/index.js +0 -0
- /package/{dist/src → runtime}/shared/types/outreach.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/outreach.js +0 -0
- /package/{dist/src → runtime}/shared/types/source-ref.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/source-ref.js +0 -0
- /package/{dist/src → runtime}/shared/types/v7-entities.d.ts +0 -0
- /package/{dist/src → runtime}/shared/types/v7-entities.js +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/native-sqlite-probe.d.ts +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/native-sqlite-probe.js +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/repair-gate.d.ts +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/repair-gate.js +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/repair.d.ts +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/repair.js +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/storage-mode-smoke.d.ts +0 -0
- /package/{dist/src → runtime}/storage/bootstrap/storage-mode-smoke.js +0 -0
- /package/{dist/src → runtime}/storage/chronicle/session-chronicle-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/chronicle/session-chronicle-store.js +0 -0
- /package/{dist/src → runtime}/storage/db/index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/index.js +0 -0
- /package/{dist/src → runtime}/storage/db/migration-runner.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migration-runner.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/index.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-001-foundation.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-001-foundation.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-002-effect-commit-ledger.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-002-effect-commit-ledger.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-003-circuit-breaker.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-003-circuit-breaker.js +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-004-behavior-promotion.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/migrations/v7-004-behavior-promotion.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/agent-goal.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/agent-goal.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/assets.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/assets.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/credentials.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/credentials.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/delivery-attempts.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/delivery-attempts.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/index.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/intent-commits.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/intent-commits.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/life-evidence-index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/life-evidence-index.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/memory-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/memory-store.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/narrative-state.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/narrative-state.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/operator-fallback-artifacts.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/operator-fallback-artifacts.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/policies.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/policies.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/proposals.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/proposals.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/provenance.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/provenance.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/relationship-memory.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/relationship-memory.js +0 -0
- /package/{dist/src → runtime}/storage/db/schema/session-chronicle.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/schema/session-chronicle.js +0 -0
- /package/{dist/src → runtime}/storage/db/transaction-utils.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/transaction-utils.js +0 -0
- /package/{dist/src → runtime}/storage/db/write-queue.d.ts +0 -0
- /package/{dist/src → runtime}/storage/db/write-queue.js +0 -0
- /package/{dist/src → runtime}/storage/delivery/query-delivery-attempts.d.ts +0 -0
- /package/{dist/src → runtime}/storage/delivery/query-delivery-attempts.js +0 -0
- /package/{dist/src → runtime}/storage/delivery/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/delivery/types.js +0 -0
- /package/{dist/src → runtime}/storage/delivery/write-delivery-attempt.d.ts +0 -0
- /package/{dist/src → runtime}/storage/delivery/write-delivery-attempt.js +0 -0
- /package/{dist/src → runtime}/storage/fallback/load-operator-fallback.d.ts +0 -0
- /package/{dist/src → runtime}/storage/fallback/load-operator-fallback.js +0 -0
- /package/{dist/src → runtime}/storage/fallback/operator-fallback-types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/fallback/operator-fallback-types.js +0 -0
- /package/{dist/src → runtime}/storage/fallback/operator-fallback-view.d.ts +0 -0
- /package/{dist/src → runtime}/storage/fallback/operator-fallback-view.js +0 -0
- /package/{dist/src → runtime}/storage/fallback/write-operator-fallback.d.ts +0 -0
- /package/{dist/src → runtime}/storage/fallback/write-operator-fallback.js +0 -0
- /package/{dist/src → runtime}/storage/goal/agent-goal-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/goal/agent-goal-store.js +0 -0
- /package/{dist/src → runtime}/storage/index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/index.js +0 -0
- /package/{dist/src → runtime}/storage/life-evidence/append-life-evidence.d.ts +0 -0
- /package/{dist/src → runtime}/storage/life-evidence/append-life-evidence.js +0 -0
- /package/{dist/src → runtime}/storage/life-evidence/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/life-evidence/types.js +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/paths.d.ts +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/paths.js +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/store.js +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/memory/workspace/types.js +0 -0
- /package/{dist/src → runtime}/storage/memory-store/memory-store-lifecycle.d.ts +0 -0
- /package/{dist/src → runtime}/storage/memory-store/memory-store-lifecycle.js +0 -0
- /package/{dist/src → runtime}/storage/narrative/narrative-state-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/narrative/narrative-state-store.js +0 -0
- /package/{dist/src → runtime}/storage/quiet/persist-quiet-artifact.d.ts +0 -0
- /package/{dist/src → runtime}/storage/quiet/persist-quiet-artifact.js +0 -0
- /package/{dist/src → runtime}/storage/quiet/quiet-artifact-types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/quiet/quiet-artifact-types.js +0 -0
- /package/{dist/src → runtime}/storage/quiet/quiet-artifact-writer.d.ts +0 -0
- /package/{dist/src → runtime}/storage/quiet/quiet-artifact-writer.js +0 -0
- /package/{dist/src → runtime}/storage/relationship/relationship-memory-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/relationship/relationship-memory-store.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/asset-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/asset-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/credential-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/credential-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/index.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/index.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/intent-commit-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/intent-commit-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/policy-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/policy-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/proposal-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/proposal-repository.js +0 -0
- /package/{dist/src → runtime}/storage/repositories/provenance-repository.d.ts +0 -0
- /package/{dist/src → runtime}/storage/repositories/provenance-repository.js +0 -0
- /package/{dist/src → runtime}/storage/rhythm/rhythm-policy-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/storage/rhythm/rhythm-policy-snapshot.js +0 -0
- /package/{dist/src → runtime}/storage/services/credential-vault.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/credential-vault.js +0 -0
- /package/{dist/src → runtime}/storage/services/daily-log-pipeline.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/daily-log-pipeline.js +0 -0
- /package/{dist/src → runtime}/storage/services/diary-dream-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/diary-dream-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/effect-commit-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/effect-commit-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/embodied-context-state-port.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/embodied-context-state-port.js +0 -0
- /package/{dist/src → runtime}/storage/services/goal-lifecycle-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/goal-lifecycle-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/governance-layer.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/governance-layer.js +0 -0
- /package/{dist/src → runtime}/storage/services/history-digest-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/history-digest-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/identity-profile-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/identity-profile-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/interaction-snapshot-projector.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/interaction-snapshot-projector.js +0 -0
- /package/{dist/src → runtime}/storage/services/persona-candidate-loader.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/persona-candidate-loader.js +0 -0
- /package/{dist/src → runtime}/storage/services/provenance-service.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/provenance-service.js +0 -0
- /package/{dist/src → runtime}/storage/services/quiet-input-loader.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/quiet-input-loader.js +0 -0
- /package/{dist/src → runtime}/storage/services/repair-and-backup.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/repair-and-backup.js +0 -0
- /package/{dist/src → runtime}/storage/services/restore-snapshot-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/restore-snapshot-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/runtime-secret-anchor-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/runtime-secret-anchor-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/tool-experience-store.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/tool-experience-store.js +0 -0
- /package/{dist/src → runtime}/storage/services/write-validation-gate.d.ts +0 -0
- /package/{dist/src → runtime}/storage/services/write-validation-gate.js +0 -0
- /package/{dist/src → runtime}/storage/snapshots/continuity-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/storage/snapshots/continuity-snapshot.js +0 -0
- /package/{dist/src → runtime}/storage/snapshots/life-evidence-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/storage/snapshots/life-evidence-snapshot.js +0 -0
- /package/{dist/src → runtime}/storage/snapshots/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/snapshots/types.js +0 -0
- /package/{dist/src → runtime}/storage/state-api.d.ts +0 -0
- /package/{dist/src → runtime}/storage/state-api.js +0 -0
- /package/{dist/src → runtime}/storage/user-interest/load-user-interest-snapshot.d.ts +0 -0
- /package/{dist/src → runtime}/storage/user-interest/load-user-interest-snapshot.js +0 -0
- /package/{dist/src → runtime}/storage/user-interest/types.d.ts +0 -0
- /package/{dist/src → runtime}/storage/user-interest/types.js +0 -0
- /package/{dist/plugin/workspace-ops-bridge.js → workspace-ops-bridge.js} +0 -0
|
@@ -1,645 +1,645 @@
|
|
|
1
|
-
import { CapabilityContractRegistry } from "../base/manifest.js";
|
|
2
|
-
import { ConnectorRoutePlanner } from "../base/route-planner.js";
|
|
3
|
-
import { ChannelHealthStore } from "../base/channel-health.js";
|
|
4
|
-
import { createConnectorPolicyLayer } from "../base/policy-layer.js";
|
|
5
|
-
import { InMemoryEffectCommitLedger } from "../base/execution-policy.js";
|
|
6
|
-
import { moltbookManifest } from "../social-community/moltbook/manifest.js";
|
|
7
|
-
import { instreetManifest } from "../social-community/instreet/manifest.js";
|
|
8
|
-
import { evomapManifest } from "../agent-network/evomap/manifest.js";
|
|
9
|
-
import { agentWorldManifest } from "../agent-network/agent-world/manifest.js";
|
|
10
|
-
import { createMoltbookApiClient } from "../social-community/moltbook/api-client.js";
|
|
11
|
-
import { createMoltbookRunner } from "../social-community/moltbook/adapter.js";
|
|
12
|
-
import { createAgentWorldRunner } from "../agent-network/agent-world/adapter.js";
|
|
13
|
-
import { createEvoMapRunner } from "../agent-network/evomap/adapter.js";
|
|
14
|
-
import { ExecutionTelemetry } from "../../observability/services/execution-telemetry.js";
|
|
15
|
-
import { createCredentialVault } from "../../storage/services/credential-vault.js";
|
|
16
|
-
import { createCredentialRouteContextPort } from "./credential-route-context.js";
|
|
17
|
-
import { scanConnectorManifests } from "../registry/manifest-scanner.js";
|
|
18
|
-
import { parseConnectorManifestV6 } from "../manifest/manifest-parser.js";
|
|
19
|
-
import fs from "node:fs";
|
|
20
|
-
import path from "node:path";
|
|
21
|
-
import { pathToFileURL } from "node:url";
|
|
22
|
-
const DEFAULT_AGENT_WORLD_USERNAME = "nyx_ha";
|
|
23
|
-
const DEFAULT_AGENT_WORLD_PROFILE_PATH_TEMPLATE = "/api/agents/profile/{username}";
|
|
24
|
-
function readString(value) {
|
|
25
|
-
return typeof value === "string" && value.trim().length > 0
|
|
26
|
-
? value.trim()
|
|
27
|
-
: undefined;
|
|
28
|
-
}
|
|
29
|
-
function channelPriorityForRunner(manifest) {
|
|
30
|
-
const declared = manifest.capabilities
|
|
31
|
-
.map((capability) => capability.channel)
|
|
32
|
-
.filter((channel) => channel === "api_rest" ||
|
|
33
|
-
channel === "api_rpc" ||
|
|
34
|
-
channel === "a2a" ||
|
|
35
|
-
channel === "mcp" ||
|
|
36
|
-
channel === "cli" ||
|
|
37
|
-
channel === "skill" ||
|
|
38
|
-
channel === "browser");
|
|
39
|
-
if (declared.length > 0)
|
|
40
|
-
return [...new Set(declared)];
|
|
41
|
-
if (manifest.runner.kind === "declarative_a2a")
|
|
42
|
-
return ["a2a"];
|
|
43
|
-
if (manifest.runner.kind === "declarative_mcp")
|
|
44
|
-
return ["mcp"];
|
|
45
|
-
if (manifest.runner.kind === "cli_descriptor")
|
|
46
|
-
return ["cli"];
|
|
47
|
-
if (manifest.runner.kind === "skill")
|
|
48
|
-
return ["skill"];
|
|
49
|
-
if (manifest.runner.kind === "browser")
|
|
50
|
-
return ["browser"];
|
|
51
|
-
return ["api_rest"];
|
|
52
|
-
}
|
|
53
|
-
function registerWorkspaceManifests(registry, workspaceRoot) {
|
|
54
|
-
if (!workspaceRoot)
|
|
55
|
-
return;
|
|
56
|
-
for (const file of scanConnectorManifests(workspaceRoot)) {
|
|
57
|
-
const parsed = parseConnectorManifestV6(file.content, file.path);
|
|
58
|
-
if (!parsed.ok)
|
|
59
|
-
continue;
|
|
60
|
-
const manifest = parsed.manifest;
|
|
61
|
-
try {
|
|
62
|
-
registry.register({
|
|
63
|
-
platformId: manifest.platformId,
|
|
64
|
-
supportedCapabilities: manifest.capabilities.map((capability) => capability.id),
|
|
65
|
-
channelPriority: channelPriorityForRunner(manifest),
|
|
66
|
-
credentialTypes: manifest.credentials
|
|
67
|
-
.filter((credential) => credential.required !== false)
|
|
68
|
-
.map((credential) => credential.type),
|
|
69
|
-
sourceRefPolicy: manifest.sourceRefPolicy,
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
catch {
|
|
73
|
-
// Invalid workspace manifests remain visible through connector_status validation.
|
|
74
|
-
// Execution side keeps fail-closed behavior by not registering them here.
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function resolveAgentWorldUsername(payload, purpose) {
|
|
79
|
-
const payloadUsername = (purpose === "discover" ? readString(payload.targetUsername) : undefined) ??
|
|
80
|
-
readString(payload.username) ??
|
|
81
|
-
readString(payload.agentUsername);
|
|
82
|
-
return (payloadUsername ??
|
|
83
|
-
readString(process.env.SECOND_NATURE_AGENT_WORLD_USERNAME) ??
|
|
84
|
-
DEFAULT_AGENT_WORLD_USERNAME);
|
|
85
|
-
}
|
|
86
|
-
function resolveAgentWorldProfilePath(payload, username) {
|
|
87
|
-
const template = readString(payload.profilePathTemplate) ??
|
|
88
|
-
readString(process.env.SECOND_NATURE_AGENT_WORLD_PROFILE_PATH_TEMPLATE) ??
|
|
89
|
-
DEFAULT_AGENT_WORLD_PROFILE_PATH_TEMPLATE;
|
|
90
|
-
return template.replaceAll("{username}", encodeURIComponent(username));
|
|
91
|
-
}
|
|
92
|
-
function joinAgentWorldUrl(baseUrl, path) {
|
|
93
|
-
if (/^https?:\/\//i.test(path))
|
|
94
|
-
return path;
|
|
95
|
-
return `${baseUrl.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
|
96
|
-
}
|
|
97
|
-
async function fetchAgentWorldJson(input) {
|
|
98
|
-
const resp = await fetch(joinAgentWorldUrl(input.baseUrl, input.path), {
|
|
99
|
-
method: input.method ?? "GET",
|
|
100
|
-
headers: {
|
|
101
|
-
"Authorization": `Bearer ${input.apiKey}`,
|
|
102
|
-
"Content-Type": "application/json",
|
|
103
|
-
},
|
|
104
|
-
body: input.body === undefined ? undefined : JSON.stringify(input.body),
|
|
105
|
-
});
|
|
106
|
-
if (!resp.ok) {
|
|
107
|
-
throw { code: "api_error", detail: `agent-world ${input.label}: ${resp.status}` };
|
|
108
|
-
}
|
|
109
|
-
return resp.json();
|
|
110
|
-
}
|
|
111
|
-
export function createEvoMapSecretPort(vault) {
|
|
112
|
-
const NODE_SECRET_KEY = "evomap_node_secret";
|
|
113
|
-
return {
|
|
114
|
-
async loadNodeSecret(_platformId) {
|
|
115
|
-
const ctx = await vault.loadCredentialContext(NODE_SECRET_KEY);
|
|
116
|
-
if (!ctx || ctx.status !== "active" || !ctx.encryptedValue)
|
|
117
|
-
return null;
|
|
118
|
-
// CredentialVault.loadCredentialContext already decrypts at rest;
|
|
119
|
-
// encryptedValue here is the plaintext.
|
|
120
|
-
return ctx.encryptedValue;
|
|
121
|
-
},
|
|
122
|
-
async saveNodeSecret(_platformId, nodeSecret) {
|
|
123
|
-
await vault.saveCredentialContext({
|
|
124
|
-
platformId: NODE_SECRET_KEY,
|
|
125
|
-
credentialType: "node_secret",
|
|
126
|
-
encryptedValue: nodeSecret,
|
|
127
|
-
status: "active",
|
|
128
|
-
});
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
function joinEvoMapUrl(baseUrl, path) {
|
|
133
|
-
if (/^https?:\/\//i.test(path))
|
|
134
|
-
return path;
|
|
135
|
-
return `${baseUrl.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
|
136
|
-
}
|
|
137
|
-
async function fetchEvoMapJson(input) {
|
|
138
|
-
const headers = {
|
|
139
|
-
"Content-Type": "application/json",
|
|
140
|
-
};
|
|
141
|
-
if (input.nodeSecret) {
|
|
142
|
-
headers["Authorization"] = `Bearer ${input.nodeSecret}`;
|
|
143
|
-
}
|
|
144
|
-
const resp = await fetch(joinEvoMapUrl(input.baseUrl, input.path), {
|
|
145
|
-
method: input.method ?? "GET",
|
|
146
|
-
headers,
|
|
147
|
-
body: input.body === undefined ? undefined : JSON.stringify(input.body),
|
|
148
|
-
});
|
|
149
|
-
if (!resp.ok) {
|
|
150
|
-
throw { code: "api_error", detail: `evomap ${input.label}: ${resp.status}` };
|
|
151
|
-
}
|
|
152
|
-
return resp.json();
|
|
153
|
-
}
|
|
154
|
-
function createMoltbookMockRunner(workspaceRoot) {
|
|
155
|
-
return {
|
|
156
|
-
async run(_plan, request) {
|
|
157
|
-
const started = Date.now();
|
|
158
|
-
const mockPath = workspaceRoot
|
|
159
|
-
? path.join(workspaceRoot, ".second-nature", "mock", "moltbook-feed.json")
|
|
160
|
-
: undefined;
|
|
161
|
-
if (!mockPath || !fs.existsSync(mockPath)) {
|
|
162
|
-
return {
|
|
163
|
-
platformId: request.platformId,
|
|
164
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
165
|
-
latencyMs: Date.now() - started,
|
|
166
|
-
success: false,
|
|
167
|
-
error: {
|
|
168
|
-
code: "configuration_missing",
|
|
169
|
-
detail: "SECOND_NATURE_MOLTBOOK_BASE_URL not set and no mock data found",
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
try {
|
|
174
|
-
const raw = fs.readFileSync(mockPath, "utf-8");
|
|
175
|
-
const data = JSON.parse(raw);
|
|
176
|
-
return {
|
|
177
|
-
platformId: request.platformId,
|
|
178
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
179
|
-
latencyMs: Date.now() - started,
|
|
180
|
-
degraded: true,
|
|
181
|
-
success: true,
|
|
182
|
-
payload: {
|
|
183
|
-
capability: request.intent,
|
|
184
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
185
|
-
data: {
|
|
186
|
-
source: "mock",
|
|
187
|
-
items: Array.isArray(data.items) ? data.items : [],
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
catch (err) {
|
|
193
|
-
return {
|
|
194
|
-
platformId: request.platformId,
|
|
195
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
196
|
-
latencyMs: Date.now() - started,
|
|
197
|
-
success: false,
|
|
198
|
-
error: {
|
|
199
|
-
code: "mock_read_error",
|
|
200
|
-
detail: String(err),
|
|
201
|
-
},
|
|
202
|
-
};
|
|
203
|
-
}
|
|
204
|
-
},
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
function findWorkspaceManifest(platformId, workspaceRoot) {
|
|
208
|
-
if (!workspaceRoot)
|
|
209
|
-
return undefined;
|
|
210
|
-
for (const file of scanConnectorManifests(workspaceRoot)) {
|
|
211
|
-
const parsed = parseConnectorManifestV6(file.content, file.path);
|
|
212
|
-
if (parsed.ok && parsed.manifest.platformId === platformId) {
|
|
213
|
-
return { manifest: parsed.manifest, manifestDir: path.dirname(file.path) };
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
return undefined;
|
|
217
|
-
}
|
|
218
|
-
function resolveDeclarativeHttpPath(capabilityId) {
|
|
219
|
-
return `/${capabilityId.replace(/\./g, "/")}`;
|
|
220
|
-
}
|
|
221
|
-
function resolveDeclarativeHttpMethod(capabilityId) {
|
|
222
|
-
const readOps = ["read", "list", "discover", "get", "heartbeat", "fetch"];
|
|
223
|
-
if (readOps.some((op) => capabilityId.includes(op)))
|
|
224
|
-
return "GET";
|
|
225
|
-
return "POST";
|
|
226
|
-
}
|
|
227
|
-
function createDeclarativeHttpRunner(manifest, credential) {
|
|
228
|
-
return {
|
|
229
|
-
async run(plan, request) {
|
|
230
|
-
const started = Date.now();
|
|
231
|
-
const baseUrl = manifest.runner.config?.baseUrl ?? "";
|
|
232
|
-
if (!baseUrl) {
|
|
233
|
-
return {
|
|
234
|
-
platformId: request.platformId,
|
|
235
|
-
channel: plan.channel,
|
|
236
|
-
latencyMs: Date.now() - started,
|
|
237
|
-
success: false,
|
|
238
|
-
error: {
|
|
239
|
-
code: "configuration_missing",
|
|
240
|
-
detail: "runner.config.baseUrl not set for declarative_http connector",
|
|
241
|
-
},
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
const httpPath = resolveDeclarativeHttpPath(request.intent);
|
|
245
|
-
const method = resolveDeclarativeHttpMethod(request.intent);
|
|
246
|
-
try {
|
|
247
|
-
const headers = {
|
|
248
|
-
"Content-Type": "application/json",
|
|
249
|
-
};
|
|
250
|
-
if (credential?.encryptedValue) {
|
|
251
|
-
headers.Authorization = `Bearer ${credential.encryptedValue}`;
|
|
252
|
-
}
|
|
253
|
-
const resp = await fetch(`${baseUrl.replace(/\/+$/, "")}${httpPath}`, {
|
|
254
|
-
method,
|
|
255
|
-
headers,
|
|
256
|
-
body: method !== "GET" && request.payload ? JSON.stringify(request.payload) : undefined,
|
|
257
|
-
});
|
|
258
|
-
if (!resp.ok) {
|
|
259
|
-
return {
|
|
260
|
-
platformId: request.platformId,
|
|
261
|
-
channel: plan.channel,
|
|
262
|
-
latencyMs: Date.now() - started,
|
|
263
|
-
success: false,
|
|
264
|
-
error: {
|
|
265
|
-
code: "api_error",
|
|
266
|
-
detail: `HTTP ${resp.status}: ${await resp.text().catch(() => "")}`,
|
|
267
|
-
},
|
|
268
|
-
};
|
|
269
|
-
}
|
|
270
|
-
const data = await resp.json();
|
|
271
|
-
return {
|
|
272
|
-
platformId: request.platformId,
|
|
273
|
-
channel: plan.channel,
|
|
274
|
-
latencyMs: Date.now() - started,
|
|
275
|
-
success: true,
|
|
276
|
-
payload: {
|
|
277
|
-
capability: request.intent,
|
|
278
|
-
channel: plan.channel,
|
|
279
|
-
data,
|
|
280
|
-
},
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
catch (err) {
|
|
284
|
-
return {
|
|
285
|
-
platformId: request.platformId,
|
|
286
|
-
channel: plan.channel,
|
|
287
|
-
latencyMs: Date.now() - started,
|
|
288
|
-
success: false,
|
|
289
|
-
error: {
|
|
290
|
-
code: "network_error",
|
|
291
|
-
detail: String(err),
|
|
292
|
-
},
|
|
293
|
-
};
|
|
294
|
-
}
|
|
295
|
-
},
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Scriptable Node Runner — workspace connector execution via dynamic ES Module import.
|
|
300
|
-
*
|
|
301
|
-
* Contract (runner.mjs default export):
|
|
302
|
-
* Input: { intent: string, payload: unknown, credential?: string }
|
|
303
|
-
* Output: { success: boolean, data?: unknown, error?: { code: string, detail: string } }
|
|
304
|
-
*
|
|
305
|
-
* Timeout: default 10s, overridable via manifest.runner.config.timeoutMs.
|
|
306
|
-
* Credential: passed as plain string when manifest.credentials required and vault has active entry.
|
|
307
|
-
* Error mapping:
|
|
308
|
-
* - missing entrypoint file → configuration_missing
|
|
309
|
-
* - default export is not function → script_error
|
|
310
|
-
* - runner throws → script_error (detail includes error message)
|
|
311
|
-
* - Promise.race timeout → timeout
|
|
312
|
-
*/
|
|
313
|
-
function createScriptableNodeRunner(manifest, manifestDir, activeCredential) {
|
|
314
|
-
const entryPath = manifest.runner.entrypoint ?? "runner.mjs";
|
|
315
|
-
const absoluteEntryPath = path.resolve(manifestDir, entryPath);
|
|
316
|
-
const DEFAULT_TIMEOUT_MS = 10000;
|
|
317
|
-
const timeoutMs = typeof manifest.runner.config?.timeoutMs === "number" &&
|
|
318
|
-
Number.isFinite(manifest.runner.config.timeoutMs) &&
|
|
319
|
-
manifest.runner.config.timeoutMs > 0
|
|
320
|
-
? manifest.runner.config.timeoutMs
|
|
321
|
-
: DEFAULT_TIMEOUT_MS;
|
|
322
|
-
return {
|
|
323
|
-
async run(_plan, request) {
|
|
324
|
-
const started = Date.now();
|
|
325
|
-
if (!fs.existsSync(absoluteEntryPath)) {
|
|
326
|
-
return {
|
|
327
|
-
platformId: request.platformId,
|
|
328
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
329
|
-
latencyMs: Date.now() - started,
|
|
330
|
-
success: false,
|
|
331
|
-
error: {
|
|
332
|
-
code: "configuration_missing",
|
|
333
|
-
detail: `scriptable_node runner not found: ${absoluteEntryPath}`,
|
|
334
|
-
},
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
try {
|
|
338
|
-
const module = await import(pathToFileURL(absoluteEntryPath).href);
|
|
339
|
-
const handler = module.default;
|
|
340
|
-
if (typeof handler !== "function") {
|
|
341
|
-
return {
|
|
342
|
-
platformId: request.platformId,
|
|
343
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
344
|
-
latencyMs: Date.now() - started,
|
|
345
|
-
success: false,
|
|
346
|
-
error: {
|
|
347
|
-
code: "script_error",
|
|
348
|
-
detail: `scriptable_node runner must export a default function from ${absoluteEntryPath}`,
|
|
349
|
-
},
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
const result = await Promise.race([
|
|
353
|
-
handler({
|
|
354
|
-
intent: request.intent,
|
|
355
|
-
payload: request.payload,
|
|
356
|
-
credential: activeCredential?.encryptedValue,
|
|
357
|
-
}),
|
|
358
|
-
new Promise((_, reject) => setTimeout(() => reject(new Error("scriptable_node_timeout")), timeoutMs)),
|
|
359
|
-
]);
|
|
360
|
-
if (result && typeof result === "object" && "success" in result) {
|
|
361
|
-
return {
|
|
362
|
-
platformId: request.platformId,
|
|
363
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
364
|
-
latencyMs: Date.now() - started,
|
|
365
|
-
success: Boolean(result.success),
|
|
366
|
-
payload: result.success
|
|
367
|
-
? {
|
|
368
|
-
capability: request.intent,
|
|
369
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
370
|
-
data: result.data,
|
|
371
|
-
}
|
|
372
|
-
: undefined,
|
|
373
|
-
error: !result.success
|
|
374
|
-
? {
|
|
375
|
-
code: result.error?.code ?? "script_error",
|
|
376
|
-
detail: result.error?.detail ?? "scriptable_node_runner_returned_failure",
|
|
377
|
-
}
|
|
378
|
-
: undefined,
|
|
379
|
-
};
|
|
380
|
-
}
|
|
381
|
-
return {
|
|
382
|
-
platformId: request.platformId,
|
|
383
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
384
|
-
latencyMs: Date.now() - started,
|
|
385
|
-
success: false,
|
|
386
|
-
error: {
|
|
387
|
-
code: "script_error",
|
|
388
|
-
detail: `scriptable_node runner returned invalid shape from ${absoluteEntryPath}`,
|
|
389
|
-
},
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
catch (err) {
|
|
393
|
-
const isTimeout = err instanceof Error && err.message === "scriptable_node_timeout";
|
|
394
|
-
return {
|
|
395
|
-
platformId: request.platformId,
|
|
396
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
397
|
-
latencyMs: Date.now() - started,
|
|
398
|
-
success: false,
|
|
399
|
-
error: {
|
|
400
|
-
code: isTimeout ? "timeout" : "script_error",
|
|
401
|
-
detail: isTimeout
|
|
402
|
-
? `scriptable_node runner exceeded ${timeoutMs}ms timeout`
|
|
403
|
-
: String(err),
|
|
404
|
-
},
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
},
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
function createAdaptiveExecutionRunner(vault, workspaceRoot) {
|
|
411
|
-
return {
|
|
412
|
-
async run(_plan, request) {
|
|
413
|
-
const platformId = request.platformId;
|
|
414
|
-
const started = Date.now();
|
|
415
|
-
const workspaceManifestResult = findWorkspaceManifest(platformId, workspaceRoot);
|
|
416
|
-
const workspaceManifest = workspaceManifestResult?.manifest;
|
|
417
|
-
const isBuiltInPlatform = platformId === "moltbook" ||
|
|
418
|
-
platformId === "evomap" ||
|
|
419
|
-
platformId === "agent-world";
|
|
420
|
-
const requiresCredential = isBuiltInPlatform ||
|
|
421
|
-
Boolean(workspaceManifest?.credentials.some((credential) => credential.required !== false));
|
|
422
|
-
const credential = requiresCredential
|
|
423
|
-
? await vault.loadCredentialContext(platformId)
|
|
424
|
-
: undefined;
|
|
425
|
-
if (requiresCredential &&
|
|
426
|
-
(!credential ||
|
|
427
|
-
credential.status !== "active" ||
|
|
428
|
-
!credential.encryptedValue)) {
|
|
429
|
-
return {
|
|
430
|
-
platformId,
|
|
431
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
432
|
-
latencyMs: Date.now() - started,
|
|
433
|
-
success: false,
|
|
434
|
-
error: {
|
|
435
|
-
code: "auth_failure",
|
|
436
|
-
detail: "credential_unavailable_for_execution",
|
|
437
|
-
},
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
const activeCredential = credential?.status === "active" && credential.encryptedValue
|
|
441
|
-
? { encryptedValue: credential.encryptedValue }
|
|
442
|
-
: undefined;
|
|
443
|
-
if (platformId === "moltbook") {
|
|
444
|
-
const baseUrl = process.env.SECOND_NATURE_MOLTBOOK_BASE_URL;
|
|
445
|
-
if (baseUrl) {
|
|
446
|
-
const apiClient = createMoltbookApiClient({
|
|
447
|
-
baseUrl,
|
|
448
|
-
accessToken: activeCredential.encryptedValue,
|
|
449
|
-
timeoutMs: 10000,
|
|
450
|
-
});
|
|
451
|
-
const runner = createMoltbookRunner({
|
|
452
|
-
apiClient,
|
|
453
|
-
skillRunner: {
|
|
454
|
-
run: async () => {
|
|
455
|
-
throw {
|
|
456
|
-
code: "protocol_mismatch",
|
|
457
|
-
detail: "moltbook_skill_runner_not_configured",
|
|
458
|
-
};
|
|
459
|
-
},
|
|
460
|
-
},
|
|
461
|
-
});
|
|
462
|
-
return runner.run(_plan, request);
|
|
463
|
-
}
|
|
464
|
-
// Mock fallback when real API is not configured
|
|
465
|
-
const mockRunner = createMoltbookMockRunner(workspaceRoot);
|
|
466
|
-
return mockRunner.run(_plan, request);
|
|
467
|
-
}
|
|
468
|
-
if (platformId === "evomap") {
|
|
469
|
-
const baseUrl = process.env.SECOND_NATURE_EVOMAP_BASE_URL;
|
|
470
|
-
if (!baseUrl) {
|
|
471
|
-
return {
|
|
472
|
-
platformId,
|
|
473
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
474
|
-
latencyMs: Date.now() - started,
|
|
475
|
-
success: false,
|
|
476
|
-
error: {
|
|
477
|
-
code: "configuration_missing",
|
|
478
|
-
detail: "SECOND_NATURE_EVOMAP_BASE_URL not set. This connector requires the evomap node base URL to be configured via environment variable.",
|
|
479
|
-
},
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
|
-
const secretPort = createEvoMapSecretPort(vault);
|
|
483
|
-
const runner = createEvoMapRunner({
|
|
484
|
-
apiClient: {
|
|
485
|
-
async heartbeat(payload, nodeSecret) {
|
|
486
|
-
const path = readString(payload.heartbeatPath) ?? "/api/heartbeat";
|
|
487
|
-
return fetchEvoMapJson({ baseUrl, path, nodeSecret, method: "POST", body: payload, label: "heartbeat" });
|
|
488
|
-
},
|
|
489
|
-
async claimTask(payload, nodeSecret) {
|
|
490
|
-
const path = readString(payload.claimPath) ?? "/api/tasks/claim";
|
|
491
|
-
return fetchEvoMapJson({ baseUrl, path, nodeSecret, method: "POST", body: payload, label: "claim" });
|
|
492
|
-
},
|
|
493
|
-
},
|
|
494
|
-
a2aClient: {
|
|
495
|
-
async helloOrRegister(payload) {
|
|
496
|
-
const path = readString(payload.registerPath) ?? "/a2a/hello";
|
|
497
|
-
return fetchEvoMapJson({ baseUrl, path, method: "POST", body: payload, label: "register" });
|
|
498
|
-
},
|
|
499
|
-
async discoverWork(payload, nodeSecret) {
|
|
500
|
-
const path = readString(payload.discoverPath) ?? "/a2a/discover";
|
|
501
|
-
return fetchEvoMapJson({ baseUrl, path, nodeSecret, method: "POST", body: payload, label: "discover" });
|
|
502
|
-
},
|
|
503
|
-
},
|
|
504
|
-
secretPort,
|
|
505
|
-
});
|
|
506
|
-
return runner.run(_plan, request);
|
|
507
|
-
}
|
|
508
|
-
if (platformId === "agent-world") {
|
|
509
|
-
const baseUrl = process.env.SECOND_NATURE_AGENT_WORLD_BASE_URL;
|
|
510
|
-
if (!baseUrl) {
|
|
511
|
-
return {
|
|
512
|
-
platformId,
|
|
513
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
514
|
-
latencyMs: Date.now() - started,
|
|
515
|
-
success: false,
|
|
516
|
-
error: {
|
|
517
|
-
code: "configuration_missing",
|
|
518
|
-
detail: "SECOND_NATURE_AGENT_WORLD_BASE_URL not set. This connector requires the agent-world node base URL to be configured via environment variable.",
|
|
519
|
-
},
|
|
520
|
-
};
|
|
521
|
-
}
|
|
522
|
-
const runner = createAgentWorldRunner({
|
|
523
|
-
apiKey: activeCredential.encryptedValue,
|
|
524
|
-
apiClient: {
|
|
525
|
-
async readFeed(payload, _apiKey) {
|
|
526
|
-
const username = resolveAgentWorldUsername(payload, "feed");
|
|
527
|
-
return fetchAgentWorldJson({
|
|
528
|
-
baseUrl,
|
|
529
|
-
path: resolveAgentWorldProfilePath(payload, username),
|
|
530
|
-
apiKey: _apiKey,
|
|
531
|
-
label: "profile feed",
|
|
532
|
-
});
|
|
533
|
-
},
|
|
534
|
-
async discoverWork(payload, _apiKey) {
|
|
535
|
-
const username = resolveAgentWorldUsername(payload, "discover");
|
|
536
|
-
return fetchAgentWorldJson({
|
|
537
|
-
baseUrl,
|
|
538
|
-
path: resolveAgentWorldProfilePath(payload, username),
|
|
539
|
-
apiKey: _apiKey,
|
|
540
|
-
label: "profile discover",
|
|
541
|
-
});
|
|
542
|
-
},
|
|
543
|
-
async claimTask(payload, _apiKey) {
|
|
544
|
-
const claimPath = readString(payload.claimEndpointPath);
|
|
545
|
-
if (!claimPath) {
|
|
546
|
-
throw {
|
|
547
|
-
code: "protocol_mismatch",
|
|
548
|
-
detail: "agent_world_task_claim_endpoint_not_configured",
|
|
549
|
-
};
|
|
550
|
-
}
|
|
551
|
-
return fetchAgentWorldJson({
|
|
552
|
-
baseUrl,
|
|
553
|
-
path: claimPath,
|
|
554
|
-
apiKey: _apiKey,
|
|
555
|
-
method: "POST",
|
|
556
|
-
body: payload,
|
|
557
|
-
label: "task claim",
|
|
558
|
-
});
|
|
559
|
-
},
|
|
560
|
-
},
|
|
561
|
-
});
|
|
562
|
-
return runner.run(_plan, request);
|
|
563
|
-
}
|
|
564
|
-
// T-CS.C.9: instreet is registered but requires skill/browser channel;
|
|
565
|
-
// pure api_rest execution returns platform_unavailable.
|
|
566
|
-
if (platformId === "instreet") {
|
|
567
|
-
return {
|
|
568
|
-
platformId,
|
|
569
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
570
|
-
latencyMs: Date.now() - started,
|
|
571
|
-
success: false,
|
|
572
|
-
error: {
|
|
573
|
-
code: "platform_unavailable",
|
|
574
|
-
detail: "instreet_requires_skill_browser_channel",
|
|
575
|
-
},
|
|
576
|
-
};
|
|
577
|
-
}
|
|
578
|
-
// Wave 83: workspace declarative_http connector fallback
|
|
579
|
-
if (workspaceManifest && workspaceManifest.runner.kind === "declarative_http") {
|
|
580
|
-
const httpRunner = createDeclarativeHttpRunner(workspaceManifest, activeCredential);
|
|
581
|
-
return httpRunner.run(_plan, request);
|
|
582
|
-
}
|
|
583
|
-
// Wave 90: workspace scriptable_node connector
|
|
584
|
-
if (workspaceManifest && workspaceManifest.runner.kind === "scriptable_node") {
|
|
585
|
-
if (!workspaceManifestResult) {
|
|
586
|
-
return {
|
|
587
|
-
platformId,
|
|
588
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
589
|
-
latencyMs: Date.now() - started,
|
|
590
|
-
success: false,
|
|
591
|
-
error: {
|
|
592
|
-
code: "configuration_missing",
|
|
593
|
-
detail: "scriptable_node requires workspace manifest with manifestDir",
|
|
594
|
-
},
|
|
595
|
-
};
|
|
596
|
-
}
|
|
597
|
-
const scriptRunner = createScriptableNodeRunner(workspaceManifest, workspaceManifestResult.manifestDir, activeCredential);
|
|
598
|
-
return scriptRunner.run(_plan, request);
|
|
599
|
-
}
|
|
600
|
-
return {
|
|
601
|
-
platformId,
|
|
602
|
-
channel: request.preferredChannel ?? "api_rest",
|
|
603
|
-
latencyMs: Date.now() - started,
|
|
604
|
-
success: false,
|
|
605
|
-
error: {
|
|
606
|
-
code: "unknown_platform",
|
|
607
|
-
detail: `no execution runner for ${platformId}`,
|
|
608
|
-
},
|
|
609
|
-
};
|
|
610
|
-
},
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
export function createConnectorExecutorAdapter(options) {
|
|
614
|
-
const vault = createCredentialVault(options.stateDb.db);
|
|
615
|
-
const registry = new CapabilityContractRegistry();
|
|
616
|
-
registry.register({ ...moltbookManifest });
|
|
617
|
-
registry.register({ ...evomapManifest });
|
|
618
|
-
registry.register({ ...agentWorldManifest });
|
|
619
|
-
registry.register({ ...instreetManifest });
|
|
620
|
-
registerWorkspaceManifests(registry, options.workspaceRoot);
|
|
621
|
-
const routeContextPort = createCredentialRouteContextPort(vault);
|
|
622
|
-
const routePlanner = new ConnectorRoutePlanner(registry, routeContextPort, new ChannelHealthStore());
|
|
623
|
-
const telemetry = new ExecutionTelemetry(options.observabilityDb);
|
|
624
|
-
const executionRunner = createAdaptiveExecutionRunner(vault, options.workspaceRoot);
|
|
625
|
-
const policy = createConnectorPolicyLayer({
|
|
626
|
-
routePlanner,
|
|
627
|
-
executionRunner,
|
|
628
|
-
telemetry,
|
|
629
|
-
effectCommitLedger: new InMemoryEffectCommitLedger(),
|
|
630
|
-
retryPolicy: { maxRetries: 2, jitter: true },
|
|
631
|
-
});
|
|
632
|
-
return {
|
|
633
|
-
async executeEffect(input) {
|
|
634
|
-
registerWorkspaceManifests(registry, options.workspaceRoot);
|
|
635
|
-
return policy.executeWithPolicy(input.intent, {
|
|
636
|
-
platformId: input.platformId,
|
|
637
|
-
intent: input.intent,
|
|
638
|
-
payload: input.payload,
|
|
639
|
-
decisionId: input.decisionId,
|
|
640
|
-
intentId: input.intentId,
|
|
641
|
-
idempotencyKey: input.idempotencyKey,
|
|
642
|
-
});
|
|
643
|
-
},
|
|
644
|
-
};
|
|
645
|
-
}
|
|
1
|
+
import { CapabilityContractRegistry } from "../base/manifest.js";
|
|
2
|
+
import { ConnectorRoutePlanner } from "../base/route-planner.js";
|
|
3
|
+
import { ChannelHealthStore } from "../base/channel-health.js";
|
|
4
|
+
import { createConnectorPolicyLayer } from "../base/policy-layer.js";
|
|
5
|
+
import { InMemoryEffectCommitLedger } from "../base/execution-policy.js";
|
|
6
|
+
import { moltbookManifest } from "../social-community/moltbook/manifest.js";
|
|
7
|
+
import { instreetManifest } from "../social-community/instreet/manifest.js";
|
|
8
|
+
import { evomapManifest } from "../agent-network/evomap/manifest.js";
|
|
9
|
+
import { agentWorldManifest } from "../agent-network/agent-world/manifest.js";
|
|
10
|
+
import { createMoltbookApiClient } from "../social-community/moltbook/api-client.js";
|
|
11
|
+
import { createMoltbookRunner } from "../social-community/moltbook/adapter.js";
|
|
12
|
+
import { createAgentWorldRunner } from "../agent-network/agent-world/adapter.js";
|
|
13
|
+
import { createEvoMapRunner } from "../agent-network/evomap/adapter.js";
|
|
14
|
+
import { ExecutionTelemetry } from "../../observability/services/execution-telemetry.js";
|
|
15
|
+
import { createCredentialVault } from "../../storage/services/credential-vault.js";
|
|
16
|
+
import { createCredentialRouteContextPort } from "./credential-route-context.js";
|
|
17
|
+
import { scanConnectorManifests } from "../registry/manifest-scanner.js";
|
|
18
|
+
import { parseConnectorManifestV6 } from "../manifest/manifest-parser.js";
|
|
19
|
+
import fs from "node:fs";
|
|
20
|
+
import path from "node:path";
|
|
21
|
+
import { pathToFileURL } from "node:url";
|
|
22
|
+
const DEFAULT_AGENT_WORLD_USERNAME = "nyx_ha";
|
|
23
|
+
const DEFAULT_AGENT_WORLD_PROFILE_PATH_TEMPLATE = "/api/agents/profile/{username}";
|
|
24
|
+
function readString(value) {
|
|
25
|
+
return typeof value === "string" && value.trim().length > 0
|
|
26
|
+
? value.trim()
|
|
27
|
+
: undefined;
|
|
28
|
+
}
|
|
29
|
+
function channelPriorityForRunner(manifest) {
|
|
30
|
+
const declared = manifest.capabilities
|
|
31
|
+
.map((capability) => capability.channel)
|
|
32
|
+
.filter((channel) => channel === "api_rest" ||
|
|
33
|
+
channel === "api_rpc" ||
|
|
34
|
+
channel === "a2a" ||
|
|
35
|
+
channel === "mcp" ||
|
|
36
|
+
channel === "cli" ||
|
|
37
|
+
channel === "skill" ||
|
|
38
|
+
channel === "browser");
|
|
39
|
+
if (declared.length > 0)
|
|
40
|
+
return [...new Set(declared)];
|
|
41
|
+
if (manifest.runner.kind === "declarative_a2a")
|
|
42
|
+
return ["a2a"];
|
|
43
|
+
if (manifest.runner.kind === "declarative_mcp")
|
|
44
|
+
return ["mcp"];
|
|
45
|
+
if (manifest.runner.kind === "cli_descriptor")
|
|
46
|
+
return ["cli"];
|
|
47
|
+
if (manifest.runner.kind === "skill")
|
|
48
|
+
return ["skill"];
|
|
49
|
+
if (manifest.runner.kind === "browser")
|
|
50
|
+
return ["browser"];
|
|
51
|
+
return ["api_rest"];
|
|
52
|
+
}
|
|
53
|
+
function registerWorkspaceManifests(registry, workspaceRoot) {
|
|
54
|
+
if (!workspaceRoot)
|
|
55
|
+
return;
|
|
56
|
+
for (const file of scanConnectorManifests(workspaceRoot)) {
|
|
57
|
+
const parsed = parseConnectorManifestV6(file.content, file.path);
|
|
58
|
+
if (!parsed.ok)
|
|
59
|
+
continue;
|
|
60
|
+
const manifest = parsed.manifest;
|
|
61
|
+
try {
|
|
62
|
+
registry.register({
|
|
63
|
+
platformId: manifest.platformId,
|
|
64
|
+
supportedCapabilities: manifest.capabilities.map((capability) => capability.id),
|
|
65
|
+
channelPriority: channelPriorityForRunner(manifest),
|
|
66
|
+
credentialTypes: manifest.credentials
|
|
67
|
+
.filter((credential) => credential.required !== false)
|
|
68
|
+
.map((credential) => credential.type),
|
|
69
|
+
sourceRefPolicy: manifest.sourceRefPolicy,
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// Invalid workspace manifests remain visible through connector_status validation.
|
|
74
|
+
// Execution side keeps fail-closed behavior by not registering them here.
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function resolveAgentWorldUsername(payload, purpose) {
|
|
79
|
+
const payloadUsername = (purpose === "discover" ? readString(payload.targetUsername) : undefined) ??
|
|
80
|
+
readString(payload.username) ??
|
|
81
|
+
readString(payload.agentUsername);
|
|
82
|
+
return (payloadUsername ??
|
|
83
|
+
readString(process.env.SECOND_NATURE_AGENT_WORLD_USERNAME) ??
|
|
84
|
+
DEFAULT_AGENT_WORLD_USERNAME);
|
|
85
|
+
}
|
|
86
|
+
function resolveAgentWorldProfilePath(payload, username) {
|
|
87
|
+
const template = readString(payload.profilePathTemplate) ??
|
|
88
|
+
readString(process.env.SECOND_NATURE_AGENT_WORLD_PROFILE_PATH_TEMPLATE) ??
|
|
89
|
+
DEFAULT_AGENT_WORLD_PROFILE_PATH_TEMPLATE;
|
|
90
|
+
return template.replaceAll("{username}", encodeURIComponent(username));
|
|
91
|
+
}
|
|
92
|
+
function joinAgentWorldUrl(baseUrl, path) {
|
|
93
|
+
if (/^https?:\/\//i.test(path))
|
|
94
|
+
return path;
|
|
95
|
+
return `${baseUrl.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
|
96
|
+
}
|
|
97
|
+
async function fetchAgentWorldJson(input) {
|
|
98
|
+
const resp = await fetch(joinAgentWorldUrl(input.baseUrl, input.path), {
|
|
99
|
+
method: input.method ?? "GET",
|
|
100
|
+
headers: {
|
|
101
|
+
"Authorization": `Bearer ${input.apiKey}`,
|
|
102
|
+
"Content-Type": "application/json",
|
|
103
|
+
},
|
|
104
|
+
body: input.body === undefined ? undefined : JSON.stringify(input.body),
|
|
105
|
+
});
|
|
106
|
+
if (!resp.ok) {
|
|
107
|
+
throw { code: "api_error", detail: `agent-world ${input.label}: ${resp.status}` };
|
|
108
|
+
}
|
|
109
|
+
return resp.json();
|
|
110
|
+
}
|
|
111
|
+
export function createEvoMapSecretPort(vault) {
|
|
112
|
+
const NODE_SECRET_KEY = "evomap_node_secret";
|
|
113
|
+
return {
|
|
114
|
+
async loadNodeSecret(_platformId) {
|
|
115
|
+
const ctx = await vault.loadCredentialContext(NODE_SECRET_KEY);
|
|
116
|
+
if (!ctx || ctx.status !== "active" || !ctx.encryptedValue)
|
|
117
|
+
return null;
|
|
118
|
+
// CredentialVault.loadCredentialContext already decrypts at rest;
|
|
119
|
+
// encryptedValue here is the plaintext.
|
|
120
|
+
return ctx.encryptedValue;
|
|
121
|
+
},
|
|
122
|
+
async saveNodeSecret(_platformId, nodeSecret) {
|
|
123
|
+
await vault.saveCredentialContext({
|
|
124
|
+
platformId: NODE_SECRET_KEY,
|
|
125
|
+
credentialType: "node_secret",
|
|
126
|
+
encryptedValue: nodeSecret,
|
|
127
|
+
status: "active",
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function joinEvoMapUrl(baseUrl, path) {
|
|
133
|
+
if (/^https?:\/\//i.test(path))
|
|
134
|
+
return path;
|
|
135
|
+
return `${baseUrl.replace(/\/+$/, "")}/${path.replace(/^\/+/, "")}`;
|
|
136
|
+
}
|
|
137
|
+
async function fetchEvoMapJson(input) {
|
|
138
|
+
const headers = {
|
|
139
|
+
"Content-Type": "application/json",
|
|
140
|
+
};
|
|
141
|
+
if (input.nodeSecret) {
|
|
142
|
+
headers["Authorization"] = `Bearer ${input.nodeSecret}`;
|
|
143
|
+
}
|
|
144
|
+
const resp = await fetch(joinEvoMapUrl(input.baseUrl, input.path), {
|
|
145
|
+
method: input.method ?? "GET",
|
|
146
|
+
headers,
|
|
147
|
+
body: input.body === undefined ? undefined : JSON.stringify(input.body),
|
|
148
|
+
});
|
|
149
|
+
if (!resp.ok) {
|
|
150
|
+
throw { code: "api_error", detail: `evomap ${input.label}: ${resp.status}` };
|
|
151
|
+
}
|
|
152
|
+
return resp.json();
|
|
153
|
+
}
|
|
154
|
+
function createMoltbookMockRunner(workspaceRoot) {
|
|
155
|
+
return {
|
|
156
|
+
async run(_plan, request) {
|
|
157
|
+
const started = Date.now();
|
|
158
|
+
const mockPath = workspaceRoot
|
|
159
|
+
? path.join(workspaceRoot, ".second-nature", "mock", "moltbook-feed.json")
|
|
160
|
+
: undefined;
|
|
161
|
+
if (!mockPath || !fs.existsSync(mockPath)) {
|
|
162
|
+
return {
|
|
163
|
+
platformId: request.platformId,
|
|
164
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
165
|
+
latencyMs: Date.now() - started,
|
|
166
|
+
success: false,
|
|
167
|
+
error: {
|
|
168
|
+
code: "configuration_missing",
|
|
169
|
+
detail: "SECOND_NATURE_MOLTBOOK_BASE_URL not set and no mock data found",
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const raw = fs.readFileSync(mockPath, "utf-8");
|
|
175
|
+
const data = JSON.parse(raw);
|
|
176
|
+
return {
|
|
177
|
+
platformId: request.platformId,
|
|
178
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
179
|
+
latencyMs: Date.now() - started,
|
|
180
|
+
degraded: true,
|
|
181
|
+
success: true,
|
|
182
|
+
payload: {
|
|
183
|
+
capability: request.intent,
|
|
184
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
185
|
+
data: {
|
|
186
|
+
source: "mock",
|
|
187
|
+
items: Array.isArray(data.items) ? data.items : [],
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
catch (err) {
|
|
193
|
+
return {
|
|
194
|
+
platformId: request.platformId,
|
|
195
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
196
|
+
latencyMs: Date.now() - started,
|
|
197
|
+
success: false,
|
|
198
|
+
error: {
|
|
199
|
+
code: "mock_read_error",
|
|
200
|
+
detail: String(err),
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
function findWorkspaceManifest(platformId, workspaceRoot) {
|
|
208
|
+
if (!workspaceRoot)
|
|
209
|
+
return undefined;
|
|
210
|
+
for (const file of scanConnectorManifests(workspaceRoot)) {
|
|
211
|
+
const parsed = parseConnectorManifestV6(file.content, file.path);
|
|
212
|
+
if (parsed.ok && parsed.manifest.platformId === platformId) {
|
|
213
|
+
return { manifest: parsed.manifest, manifestDir: path.dirname(file.path) };
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
function resolveDeclarativeHttpPath(capabilityId) {
|
|
219
|
+
return `/${capabilityId.replace(/\./g, "/")}`;
|
|
220
|
+
}
|
|
221
|
+
function resolveDeclarativeHttpMethod(capabilityId) {
|
|
222
|
+
const readOps = ["read", "list", "discover", "get", "heartbeat", "fetch"];
|
|
223
|
+
if (readOps.some((op) => capabilityId.includes(op)))
|
|
224
|
+
return "GET";
|
|
225
|
+
return "POST";
|
|
226
|
+
}
|
|
227
|
+
function createDeclarativeHttpRunner(manifest, credential) {
|
|
228
|
+
return {
|
|
229
|
+
async run(plan, request) {
|
|
230
|
+
const started = Date.now();
|
|
231
|
+
const baseUrl = manifest.runner.config?.baseUrl ?? "";
|
|
232
|
+
if (!baseUrl) {
|
|
233
|
+
return {
|
|
234
|
+
platformId: request.platformId,
|
|
235
|
+
channel: plan.channel,
|
|
236
|
+
latencyMs: Date.now() - started,
|
|
237
|
+
success: false,
|
|
238
|
+
error: {
|
|
239
|
+
code: "configuration_missing",
|
|
240
|
+
detail: "runner.config.baseUrl not set for declarative_http connector",
|
|
241
|
+
},
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
const httpPath = resolveDeclarativeHttpPath(request.intent);
|
|
245
|
+
const method = resolveDeclarativeHttpMethod(request.intent);
|
|
246
|
+
try {
|
|
247
|
+
const headers = {
|
|
248
|
+
"Content-Type": "application/json",
|
|
249
|
+
};
|
|
250
|
+
if (credential?.encryptedValue) {
|
|
251
|
+
headers.Authorization = `Bearer ${credential.encryptedValue}`;
|
|
252
|
+
}
|
|
253
|
+
const resp = await fetch(`${baseUrl.replace(/\/+$/, "")}${httpPath}`, {
|
|
254
|
+
method,
|
|
255
|
+
headers,
|
|
256
|
+
body: method !== "GET" && request.payload ? JSON.stringify(request.payload) : undefined,
|
|
257
|
+
});
|
|
258
|
+
if (!resp.ok) {
|
|
259
|
+
return {
|
|
260
|
+
platformId: request.platformId,
|
|
261
|
+
channel: plan.channel,
|
|
262
|
+
latencyMs: Date.now() - started,
|
|
263
|
+
success: false,
|
|
264
|
+
error: {
|
|
265
|
+
code: "api_error",
|
|
266
|
+
detail: `HTTP ${resp.status}: ${await resp.text().catch(() => "")}`,
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
const data = await resp.json();
|
|
271
|
+
return {
|
|
272
|
+
platformId: request.platformId,
|
|
273
|
+
channel: plan.channel,
|
|
274
|
+
latencyMs: Date.now() - started,
|
|
275
|
+
success: true,
|
|
276
|
+
payload: {
|
|
277
|
+
capability: request.intent,
|
|
278
|
+
channel: plan.channel,
|
|
279
|
+
data,
|
|
280
|
+
},
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
catch (err) {
|
|
284
|
+
return {
|
|
285
|
+
platformId: request.platformId,
|
|
286
|
+
channel: plan.channel,
|
|
287
|
+
latencyMs: Date.now() - started,
|
|
288
|
+
success: false,
|
|
289
|
+
error: {
|
|
290
|
+
code: "network_error",
|
|
291
|
+
detail: String(err),
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
},
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Scriptable Node Runner — workspace connector execution via dynamic ES Module import.
|
|
300
|
+
*
|
|
301
|
+
* Contract (runner.mjs default export):
|
|
302
|
+
* Input: { intent: string, payload: unknown, credential?: string }
|
|
303
|
+
* Output: { success: boolean, data?: unknown, error?: { code: string, detail: string } }
|
|
304
|
+
*
|
|
305
|
+
* Timeout: default 10s, overridable via manifest.runner.config.timeoutMs.
|
|
306
|
+
* Credential: passed as plain string when manifest.credentials required and vault has active entry.
|
|
307
|
+
* Error mapping:
|
|
308
|
+
* - missing entrypoint file → configuration_missing
|
|
309
|
+
* - default export is not function → script_error
|
|
310
|
+
* - runner throws → script_error (detail includes error message)
|
|
311
|
+
* - Promise.race timeout → timeout
|
|
312
|
+
*/
|
|
313
|
+
function createScriptableNodeRunner(manifest, manifestDir, activeCredential) {
|
|
314
|
+
const entryPath = manifest.runner.entrypoint ?? "runner.mjs";
|
|
315
|
+
const absoluteEntryPath = path.resolve(manifestDir, entryPath);
|
|
316
|
+
const DEFAULT_TIMEOUT_MS = 10000;
|
|
317
|
+
const timeoutMs = typeof manifest.runner.config?.timeoutMs === "number" &&
|
|
318
|
+
Number.isFinite(manifest.runner.config.timeoutMs) &&
|
|
319
|
+
manifest.runner.config.timeoutMs > 0
|
|
320
|
+
? manifest.runner.config.timeoutMs
|
|
321
|
+
: DEFAULT_TIMEOUT_MS;
|
|
322
|
+
return {
|
|
323
|
+
async run(_plan, request) {
|
|
324
|
+
const started = Date.now();
|
|
325
|
+
if (!fs.existsSync(absoluteEntryPath)) {
|
|
326
|
+
return {
|
|
327
|
+
platformId: request.platformId,
|
|
328
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
329
|
+
latencyMs: Date.now() - started,
|
|
330
|
+
success: false,
|
|
331
|
+
error: {
|
|
332
|
+
code: "configuration_missing",
|
|
333
|
+
detail: `scriptable_node runner not found: ${absoluteEntryPath}`,
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
try {
|
|
338
|
+
const module = await import(pathToFileURL(absoluteEntryPath).href);
|
|
339
|
+
const handler = module.default;
|
|
340
|
+
if (typeof handler !== "function") {
|
|
341
|
+
return {
|
|
342
|
+
platformId: request.platformId,
|
|
343
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
344
|
+
latencyMs: Date.now() - started,
|
|
345
|
+
success: false,
|
|
346
|
+
error: {
|
|
347
|
+
code: "script_error",
|
|
348
|
+
detail: `scriptable_node runner must export a default function from ${absoluteEntryPath}`,
|
|
349
|
+
},
|
|
350
|
+
};
|
|
351
|
+
}
|
|
352
|
+
const result = await Promise.race([
|
|
353
|
+
handler({
|
|
354
|
+
intent: request.intent,
|
|
355
|
+
payload: request.payload,
|
|
356
|
+
credential: activeCredential?.encryptedValue,
|
|
357
|
+
}),
|
|
358
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("scriptable_node_timeout")), timeoutMs)),
|
|
359
|
+
]);
|
|
360
|
+
if (result && typeof result === "object" && "success" in result) {
|
|
361
|
+
return {
|
|
362
|
+
platformId: request.platformId,
|
|
363
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
364
|
+
latencyMs: Date.now() - started,
|
|
365
|
+
success: Boolean(result.success),
|
|
366
|
+
payload: result.success
|
|
367
|
+
? {
|
|
368
|
+
capability: request.intent,
|
|
369
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
370
|
+
data: result.data,
|
|
371
|
+
}
|
|
372
|
+
: undefined,
|
|
373
|
+
error: !result.success
|
|
374
|
+
? {
|
|
375
|
+
code: result.error?.code ?? "script_error",
|
|
376
|
+
detail: result.error?.detail ?? "scriptable_node_runner_returned_failure",
|
|
377
|
+
}
|
|
378
|
+
: undefined,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
return {
|
|
382
|
+
platformId: request.platformId,
|
|
383
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
384
|
+
latencyMs: Date.now() - started,
|
|
385
|
+
success: false,
|
|
386
|
+
error: {
|
|
387
|
+
code: "script_error",
|
|
388
|
+
detail: `scriptable_node runner returned invalid shape from ${absoluteEntryPath}`,
|
|
389
|
+
},
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
catch (err) {
|
|
393
|
+
const isTimeout = err instanceof Error && err.message === "scriptable_node_timeout";
|
|
394
|
+
return {
|
|
395
|
+
platformId: request.platformId,
|
|
396
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
397
|
+
latencyMs: Date.now() - started,
|
|
398
|
+
success: false,
|
|
399
|
+
error: {
|
|
400
|
+
code: isTimeout ? "timeout" : "script_error",
|
|
401
|
+
detail: isTimeout
|
|
402
|
+
? `scriptable_node runner exceeded ${timeoutMs}ms timeout`
|
|
403
|
+
: String(err),
|
|
404
|
+
},
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
},
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
function createAdaptiveExecutionRunner(vault, workspaceRoot) {
|
|
411
|
+
return {
|
|
412
|
+
async run(_plan, request) {
|
|
413
|
+
const platformId = request.platformId;
|
|
414
|
+
const started = Date.now();
|
|
415
|
+
const workspaceManifestResult = findWorkspaceManifest(platformId, workspaceRoot);
|
|
416
|
+
const workspaceManifest = workspaceManifestResult?.manifest;
|
|
417
|
+
const isBuiltInPlatform = platformId === "moltbook" ||
|
|
418
|
+
platformId === "evomap" ||
|
|
419
|
+
platformId === "agent-world";
|
|
420
|
+
const requiresCredential = isBuiltInPlatform ||
|
|
421
|
+
Boolean(workspaceManifest?.credentials.some((credential) => credential.required !== false));
|
|
422
|
+
const credential = requiresCredential
|
|
423
|
+
? await vault.loadCredentialContext(platformId)
|
|
424
|
+
: undefined;
|
|
425
|
+
if (requiresCredential &&
|
|
426
|
+
(!credential ||
|
|
427
|
+
credential.status !== "active" ||
|
|
428
|
+
!credential.encryptedValue)) {
|
|
429
|
+
return {
|
|
430
|
+
platformId,
|
|
431
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
432
|
+
latencyMs: Date.now() - started,
|
|
433
|
+
success: false,
|
|
434
|
+
error: {
|
|
435
|
+
code: "auth_failure",
|
|
436
|
+
detail: "credential_unavailable_for_execution",
|
|
437
|
+
},
|
|
438
|
+
};
|
|
439
|
+
}
|
|
440
|
+
const activeCredential = credential?.status === "active" && credential.encryptedValue
|
|
441
|
+
? { encryptedValue: credential.encryptedValue }
|
|
442
|
+
: undefined;
|
|
443
|
+
if (platformId === "moltbook") {
|
|
444
|
+
const baseUrl = process.env.SECOND_NATURE_MOLTBOOK_BASE_URL;
|
|
445
|
+
if (baseUrl) {
|
|
446
|
+
const apiClient = createMoltbookApiClient({
|
|
447
|
+
baseUrl,
|
|
448
|
+
accessToken: activeCredential.encryptedValue,
|
|
449
|
+
timeoutMs: 10000,
|
|
450
|
+
});
|
|
451
|
+
const runner = createMoltbookRunner({
|
|
452
|
+
apiClient,
|
|
453
|
+
skillRunner: {
|
|
454
|
+
run: async () => {
|
|
455
|
+
throw {
|
|
456
|
+
code: "protocol_mismatch",
|
|
457
|
+
detail: "moltbook_skill_runner_not_configured",
|
|
458
|
+
};
|
|
459
|
+
},
|
|
460
|
+
},
|
|
461
|
+
});
|
|
462
|
+
return runner.run(_plan, request);
|
|
463
|
+
}
|
|
464
|
+
// Mock fallback when real API is not configured
|
|
465
|
+
const mockRunner = createMoltbookMockRunner(workspaceRoot);
|
|
466
|
+
return mockRunner.run(_plan, request);
|
|
467
|
+
}
|
|
468
|
+
if (platformId === "evomap") {
|
|
469
|
+
const baseUrl = process.env.SECOND_NATURE_EVOMAP_BASE_URL;
|
|
470
|
+
if (!baseUrl) {
|
|
471
|
+
return {
|
|
472
|
+
platformId,
|
|
473
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
474
|
+
latencyMs: Date.now() - started,
|
|
475
|
+
success: false,
|
|
476
|
+
error: {
|
|
477
|
+
code: "configuration_missing",
|
|
478
|
+
detail: "SECOND_NATURE_EVOMAP_BASE_URL not set. This connector requires the evomap node base URL to be configured via environment variable.",
|
|
479
|
+
},
|
|
480
|
+
};
|
|
481
|
+
}
|
|
482
|
+
const secretPort = createEvoMapSecretPort(vault);
|
|
483
|
+
const runner = createEvoMapRunner({
|
|
484
|
+
apiClient: {
|
|
485
|
+
async heartbeat(payload, nodeSecret) {
|
|
486
|
+
const path = readString(payload.heartbeatPath) ?? "/api/heartbeat";
|
|
487
|
+
return fetchEvoMapJson({ baseUrl, path, nodeSecret, method: "POST", body: payload, label: "heartbeat" });
|
|
488
|
+
},
|
|
489
|
+
async claimTask(payload, nodeSecret) {
|
|
490
|
+
const path = readString(payload.claimPath) ?? "/api/tasks/claim";
|
|
491
|
+
return fetchEvoMapJson({ baseUrl, path, nodeSecret, method: "POST", body: payload, label: "claim" });
|
|
492
|
+
},
|
|
493
|
+
},
|
|
494
|
+
a2aClient: {
|
|
495
|
+
async helloOrRegister(payload) {
|
|
496
|
+
const path = readString(payload.registerPath) ?? "/a2a/hello";
|
|
497
|
+
return fetchEvoMapJson({ baseUrl, path, method: "POST", body: payload, label: "register" });
|
|
498
|
+
},
|
|
499
|
+
async discoverWork(payload, nodeSecret) {
|
|
500
|
+
const path = readString(payload.discoverPath) ?? "/a2a/discover";
|
|
501
|
+
return fetchEvoMapJson({ baseUrl, path, nodeSecret, method: "POST", body: payload, label: "discover" });
|
|
502
|
+
},
|
|
503
|
+
},
|
|
504
|
+
secretPort,
|
|
505
|
+
});
|
|
506
|
+
return runner.run(_plan, request);
|
|
507
|
+
}
|
|
508
|
+
if (platformId === "agent-world") {
|
|
509
|
+
const baseUrl = process.env.SECOND_NATURE_AGENT_WORLD_BASE_URL;
|
|
510
|
+
if (!baseUrl) {
|
|
511
|
+
return {
|
|
512
|
+
platformId,
|
|
513
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
514
|
+
latencyMs: Date.now() - started,
|
|
515
|
+
success: false,
|
|
516
|
+
error: {
|
|
517
|
+
code: "configuration_missing",
|
|
518
|
+
detail: "SECOND_NATURE_AGENT_WORLD_BASE_URL not set. This connector requires the agent-world node base URL to be configured via environment variable.",
|
|
519
|
+
},
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
const runner = createAgentWorldRunner({
|
|
523
|
+
apiKey: activeCredential.encryptedValue,
|
|
524
|
+
apiClient: {
|
|
525
|
+
async readFeed(payload, _apiKey) {
|
|
526
|
+
const username = resolveAgentWorldUsername(payload, "feed");
|
|
527
|
+
return fetchAgentWorldJson({
|
|
528
|
+
baseUrl,
|
|
529
|
+
path: resolveAgentWorldProfilePath(payload, username),
|
|
530
|
+
apiKey: _apiKey,
|
|
531
|
+
label: "profile feed",
|
|
532
|
+
});
|
|
533
|
+
},
|
|
534
|
+
async discoverWork(payload, _apiKey) {
|
|
535
|
+
const username = resolveAgentWorldUsername(payload, "discover");
|
|
536
|
+
return fetchAgentWorldJson({
|
|
537
|
+
baseUrl,
|
|
538
|
+
path: resolveAgentWorldProfilePath(payload, username),
|
|
539
|
+
apiKey: _apiKey,
|
|
540
|
+
label: "profile discover",
|
|
541
|
+
});
|
|
542
|
+
},
|
|
543
|
+
async claimTask(payload, _apiKey) {
|
|
544
|
+
const claimPath = readString(payload.claimEndpointPath);
|
|
545
|
+
if (!claimPath) {
|
|
546
|
+
throw {
|
|
547
|
+
code: "protocol_mismatch",
|
|
548
|
+
detail: "agent_world_task_claim_endpoint_not_configured",
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
return fetchAgentWorldJson({
|
|
552
|
+
baseUrl,
|
|
553
|
+
path: claimPath,
|
|
554
|
+
apiKey: _apiKey,
|
|
555
|
+
method: "POST",
|
|
556
|
+
body: payload,
|
|
557
|
+
label: "task claim",
|
|
558
|
+
});
|
|
559
|
+
},
|
|
560
|
+
},
|
|
561
|
+
});
|
|
562
|
+
return runner.run(_plan, request);
|
|
563
|
+
}
|
|
564
|
+
// T-CS.C.9: instreet is registered but requires skill/browser channel;
|
|
565
|
+
// pure api_rest execution returns platform_unavailable.
|
|
566
|
+
if (platformId === "instreet") {
|
|
567
|
+
return {
|
|
568
|
+
platformId,
|
|
569
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
570
|
+
latencyMs: Date.now() - started,
|
|
571
|
+
success: false,
|
|
572
|
+
error: {
|
|
573
|
+
code: "platform_unavailable",
|
|
574
|
+
detail: "instreet_requires_skill_browser_channel",
|
|
575
|
+
},
|
|
576
|
+
};
|
|
577
|
+
}
|
|
578
|
+
// Wave 83: workspace declarative_http connector fallback
|
|
579
|
+
if (workspaceManifest && workspaceManifest.runner.kind === "declarative_http") {
|
|
580
|
+
const httpRunner = createDeclarativeHttpRunner(workspaceManifest, activeCredential);
|
|
581
|
+
return httpRunner.run(_plan, request);
|
|
582
|
+
}
|
|
583
|
+
// Wave 90: workspace scriptable_node connector
|
|
584
|
+
if (workspaceManifest && workspaceManifest.runner.kind === "scriptable_node") {
|
|
585
|
+
if (!workspaceManifestResult) {
|
|
586
|
+
return {
|
|
587
|
+
platformId,
|
|
588
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
589
|
+
latencyMs: Date.now() - started,
|
|
590
|
+
success: false,
|
|
591
|
+
error: {
|
|
592
|
+
code: "configuration_missing",
|
|
593
|
+
detail: "scriptable_node requires workspace manifest with manifestDir",
|
|
594
|
+
},
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
const scriptRunner = createScriptableNodeRunner(workspaceManifest, workspaceManifestResult.manifestDir, activeCredential);
|
|
598
|
+
return scriptRunner.run(_plan, request);
|
|
599
|
+
}
|
|
600
|
+
return {
|
|
601
|
+
platformId,
|
|
602
|
+
channel: request.preferredChannel ?? "api_rest",
|
|
603
|
+
latencyMs: Date.now() - started,
|
|
604
|
+
success: false,
|
|
605
|
+
error: {
|
|
606
|
+
code: "unknown_platform",
|
|
607
|
+
detail: `no execution runner for ${platformId}`,
|
|
608
|
+
},
|
|
609
|
+
};
|
|
610
|
+
},
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
export function createConnectorExecutorAdapter(options) {
|
|
614
|
+
const vault = createCredentialVault(options.stateDb.db);
|
|
615
|
+
const registry = new CapabilityContractRegistry();
|
|
616
|
+
registry.register({ ...moltbookManifest });
|
|
617
|
+
registry.register({ ...evomapManifest });
|
|
618
|
+
registry.register({ ...agentWorldManifest });
|
|
619
|
+
registry.register({ ...instreetManifest });
|
|
620
|
+
registerWorkspaceManifests(registry, options.workspaceRoot);
|
|
621
|
+
const routeContextPort = createCredentialRouteContextPort(vault);
|
|
622
|
+
const routePlanner = new ConnectorRoutePlanner(registry, routeContextPort, new ChannelHealthStore());
|
|
623
|
+
const telemetry = new ExecutionTelemetry(options.observabilityDb);
|
|
624
|
+
const executionRunner = createAdaptiveExecutionRunner(vault, options.workspaceRoot);
|
|
625
|
+
const policy = createConnectorPolicyLayer({
|
|
626
|
+
routePlanner,
|
|
627
|
+
executionRunner,
|
|
628
|
+
telemetry,
|
|
629
|
+
effectCommitLedger: new InMemoryEffectCommitLedger(),
|
|
630
|
+
retryPolicy: { maxRetries: 2, jitter: true },
|
|
631
|
+
});
|
|
632
|
+
return {
|
|
633
|
+
async executeEffect(input) {
|
|
634
|
+
registerWorkspaceManifests(registry, options.workspaceRoot);
|
|
635
|
+
return policy.executeWithPolicy(input.intent, {
|
|
636
|
+
platformId: input.platformId,
|
|
637
|
+
intent: input.intent,
|
|
638
|
+
payload: input.payload,
|
|
639
|
+
decisionId: input.decisionId,
|
|
640
|
+
intentId: input.intentId,
|
|
641
|
+
idempotencyKey: input.idempotencyKey,
|
|
642
|
+
});
|
|
643
|
+
},
|
|
644
|
+
};
|
|
645
|
+
}
|