kiokuko-dsh 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.ja.md +50 -0
- package/README.ko.md +50 -0
- package/README.md +53 -0
- package/README.zh-CN.md +50 -0
- package/dist/agent-file/atomic-write.d.ts +93 -0
- package/dist/agent-file/atomic-write.d.ts.map +1 -0
- package/dist/agent-file/atomic-write.js +1026 -0
- package/dist/agent-file/atomic-write.js.map +1 -0
- package/dist/agent-file/managed-block.d.ts +23 -0
- package/dist/agent-file/managed-block.d.ts.map +1 -0
- package/dist/agent-file/managed-block.js +101 -0
- package/dist/agent-file/managed-block.js.map +1 -0
- package/dist/agent-file/render.d.ts +14 -0
- package/dist/agent-file/render.d.ts.map +1 -0
- package/dist/agent-file/render.js +63 -0
- package/dist/agent-file/render.js.map +1 -0
- package/dist/akinator/agent-task.d.ts +72 -0
- package/dist/akinator/agent-task.d.ts.map +1 -0
- package/dist/akinator/agent-task.js +684 -0
- package/dist/akinator/agent-task.js.map +1 -0
- package/dist/akinator/capabilities.d.ts +92 -0
- package/dist/akinator/capabilities.d.ts.map +1 -0
- package/dist/akinator/capabilities.js +364 -0
- package/dist/akinator/capabilities.js.map +1 -0
- package/dist/akinator/capability-binding.d.ts +11 -0
- package/dist/akinator/capability-binding.d.ts.map +1 -0
- package/dist/akinator/capability-binding.js +71 -0
- package/dist/akinator/capability-binding.js.map +1 -0
- package/dist/akinator/domain.d.ts +25 -0
- package/dist/akinator/domain.d.ts.map +1 -0
- package/dist/akinator/domain.js +266 -0
- package/dist/akinator/domain.js.map +1 -0
- package/dist/akinator/knowledge-path.d.ts +33 -0
- package/dist/akinator/knowledge-path.d.ts.map +1 -0
- package/dist/akinator/knowledge-path.js +474 -0
- package/dist/akinator/knowledge-path.js.map +1 -0
- package/dist/akinator/orchestrator.d.ts +7 -0
- package/dist/akinator/orchestrator.d.ts.map +1 -0
- package/dist/akinator/orchestrator.js +8 -0
- package/dist/akinator/orchestrator.js.map +1 -0
- package/dist/akinator/reasoning.d.ts +8 -0
- package/dist/akinator/reasoning.d.ts.map +1 -0
- package/dist/akinator/reasoning.js +118 -0
- package/dist/akinator/reasoning.js.map +1 -0
- package/dist/akinator/service.d.ts +32 -0
- package/dist/akinator/service.d.ts.map +1 -0
- package/dist/akinator/service.js +294 -0
- package/dist/akinator/service.js.map +1 -0
- package/dist/akinator/skill-discovery-attempt.d.ts +26 -0
- package/dist/akinator/skill-discovery-attempt.d.ts.map +1 -0
- package/dist/akinator/skill-discovery-attempt.js +469 -0
- package/dist/akinator/skill-discovery-attempt.js.map +1 -0
- package/dist/akinator/store.d.ts +96 -0
- package/dist/akinator/store.d.ts.map +1 -0
- package/dist/akinator/store.js +642 -0
- package/dist/akinator/store.js.map +1 -0
- package/dist/akinator/types.d.ts +70 -0
- package/dist/akinator/types.d.ts.map +1 -0
- package/dist/akinator/types.js +2 -0
- package/dist/akinator/types.js.map +1 -0
- package/dist/bin/kiokuko.d.ts +3 -0
- package/dist/bin/kiokuko.d.ts.map +1 -0
- package/dist/bin/kiokuko.js +13 -0
- package/dist/bin/kiokuko.js.map +1 -0
- package/dist/cli.d.ts +24 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +962 -0
- package/dist/cli.js.map +1 -0
- package/dist/client/server-client.d.ts +22 -0
- package/dist/client/server-client.d.ts.map +1 -0
- package/dist/client/server-client.js +729 -0
- package/dist/client/server-client.js.map +1 -0
- package/dist/commands/agent.d.ts +12 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +1138 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/backup.d.ts +6 -0
- package/dist/commands/backup.d.ts.map +1 -0
- package/dist/commands/backup.js +77 -0
- package/dist/commands/backup.js.map +1 -0
- package/dist/commands/curator.d.ts +25 -0
- package/dist/commands/curator.d.ts.map +1 -0
- package/dist/commands/curator.js +58 -0
- package/dist/commands/curator.js.map +1 -0
- package/dist/commands/doctor.d.ts +61 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +522 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/embeddings.d.ts +40 -0
- package/dist/commands/embeddings.d.ts.map +1 -0
- package/dist/commands/embeddings.js +317 -0
- package/dist/commands/embeddings.js.map +1 -0
- package/dist/commands/enno.d.ts +7 -0
- package/dist/commands/enno.d.ts.map +1 -0
- package/dist/commands/enno.js +76 -0
- package/dist/commands/enno.js.map +1 -0
- package/dist/commands/export.d.ts +17 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +233 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/import.d.ts +24 -0
- package/dist/commands/import.d.ts.map +1 -0
- package/dist/commands/import.js +778 -0
- package/dist/commands/import.js.map +1 -0
- package/dist/commands/init.d.ts +34 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +637 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/ledger.d.ts +7 -0
- package/dist/commands/ledger.d.ts.map +1 -0
- package/dist/commands/ledger.js +66 -0
- package/dist/commands/ledger.js.map +1 -0
- package/dist/commands/purge.d.ts +10 -0
- package/dist/commands/purge.d.ts.map +1 -0
- package/dist/commands/purge.js +29 -0
- package/dist/commands/purge.js.map +1 -0
- package/dist/commands/serve.d.ts +34 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/serve.js +120 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/server-status.d.ts +20 -0
- package/dist/commands/server-status.d.ts.map +1 -0
- package/dist/commands/server-status.js +21 -0
- package/dist/commands/server-status.js.map +1 -0
- package/dist/commands/server.d.ts +13 -0
- package/dist/commands/server.d.ts.map +1 -0
- package/dist/commands/server.js +89 -0
- package/dist/commands/server.js.map +1 -0
- package/dist/commands/setup.d.ts +105 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +793 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/skills.d.ts +9 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +317 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/use.d.ts +40 -0
- package/dist/commands/use.d.ts.map +1 -0
- package/dist/commands/use.js +1090 -0
- package/dist/commands/use.js.map +1 -0
- package/dist/config/paths.d.ts +57 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +352 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/project-config.d.ts +11 -0
- package/dist/config/project-config.d.ts.map +1 -0
- package/dist/config/project-config.js +97 -0
- package/dist/config/project-config.js.map +1 -0
- package/dist/context/broker.d.ts +99 -0
- package/dist/context/broker.d.ts.map +1 -0
- package/dist/context/broker.js +923 -0
- package/dist/context/broker.js.map +1 -0
- package/dist/context/delivery-migration.d.ts +40 -0
- package/dist/context/delivery-migration.d.ts.map +1 -0
- package/dist/context/delivery-migration.js +367 -0
- package/dist/context/delivery-migration.js.map +1 -0
- package/dist/context/delivery.d.ts +61 -0
- package/dist/context/delivery.d.ts.map +1 -0
- package/dist/context/delivery.js +886 -0
- package/dist/context/delivery.js.map +1 -0
- package/dist/context/feedback.d.ts +73 -0
- package/dist/context/feedback.d.ts.map +1 -0
- package/dist/context/feedback.js +993 -0
- package/dist/context/feedback.js.map +1 -0
- package/dist/context/nudge-store.d.ts +57 -0
- package/dist/context/nudge-store.d.ts.map +1 -0
- package/dist/context/nudge-store.js +227 -0
- package/dist/context/nudge-store.js.map +1 -0
- package/dist/context/nudge-validation.d.ts +26 -0
- package/dist/context/nudge-validation.d.ts.map +1 -0
- package/dist/context/nudge-validation.js +122 -0
- package/dist/context/nudge-validation.js.map +1 -0
- package/dist/context/nudges.d.ts +38 -0
- package/dist/context/nudges.d.ts.map +1 -0
- package/dist/context/nudges.js +131 -0
- package/dist/context/nudges.js.map +1 -0
- package/dist/context/origin.d.ts +9 -0
- package/dist/context/origin.d.ts.map +1 -0
- package/dist/context/origin.js +15 -0
- package/dist/context/origin.js.map +1 -0
- package/dist/context/ranking.d.ts +92 -0
- package/dist/context/ranking.d.ts.map +1 -0
- package/dist/context/ranking.js +560 -0
- package/dist/context/ranking.js.map +1 -0
- package/dist/context/recommendations.d.ts +80 -0
- package/dist/context/recommendations.d.ts.map +1 -0
- package/dist/context/recommendations.js +341 -0
- package/dist/context/recommendations.js.map +1 -0
- package/dist/context/run-state.d.ts +26 -0
- package/dist/context/run-state.d.ts.map +1 -0
- package/dist/context/run-state.js +399 -0
- package/dist/context/run-state.js.map +1 -0
- package/dist/context/scoped-broker.d.ts +77 -0
- package/dist/context/scoped-broker.d.ts.map +1 -0
- package/dist/context/scoped-broker.js +690 -0
- package/dist/context/scoped-broker.js.map +1 -0
- package/dist/context/selection-state.d.ts +32 -0
- package/dist/context/selection-state.d.ts.map +1 -0
- package/dist/context/selection-state.js +369 -0
- package/dist/context/selection-state.js.map +1 -0
- package/dist/db/adapter.d.ts +27 -0
- package/dist/db/adapter.d.ts.map +1 -0
- package/dist/db/adapter.js +41 -0
- package/dist/db/adapter.js.map +1 -0
- package/dist/db/capabilities.d.ts +21 -0
- package/dist/db/capabilities.d.ts.map +1 -0
- package/dist/db/capabilities.js +57 -0
- package/dist/db/capabilities.js.map +1 -0
- package/dist/db/connection.d.ts +21 -0
- package/dist/db/connection.d.ts.map +1 -0
- package/dist/db/connection.js +129 -0
- package/dist/db/connection.js.map +1 -0
- package/dist/db/migrate.d.ts +40 -0
- package/dist/db/migrate.d.ts.map +1 -0
- package/dist/db/migrate.js +216 -0
- package/dist/db/migrate.js.map +1 -0
- package/dist/db/sqlite-retry.d.ts +11 -0
- package/dist/db/sqlite-retry.d.ts.map +1 -0
- package/dist/db/sqlite-retry.js +70 -0
- package/dist/db/sqlite-retry.js.map +1 -0
- package/dist/db/transaction.d.ts +17 -0
- package/dist/db/transaction.d.ts.map +1 -0
- package/dist/db/transaction.js +68 -0
- package/dist/db/transaction.js.map +1 -0
- package/dist/db/upgrade-backup.d.ts +59 -0
- package/dist/db/upgrade-backup.d.ts.map +1 -0
- package/dist/db/upgrade-backup.js +773 -0
- package/dist/db/upgrade-backup.js.map +1 -0
- package/dist/dsh/advisory-runner.d.ts +32 -0
- package/dist/dsh/advisory-runner.d.ts.map +1 -0
- package/dist/dsh/advisory-runner.js +111 -0
- package/dist/dsh/advisory-runner.js.map +1 -0
- package/dist/dsh/agent-state.d.ts +49 -0
- package/dist/dsh/agent-state.d.ts.map +1 -0
- package/dist/dsh/agent-state.js +103 -0
- package/dist/dsh/agent-state.js.map +1 -0
- package/dist/dsh/capability-catalog.d.ts +24 -0
- package/dist/dsh/capability-catalog.d.ts.map +1 -0
- package/dist/dsh/capability-catalog.js +108 -0
- package/dist/dsh/capability-catalog.js.map +1 -0
- package/dist/dsh/commands.d.ts +43 -0
- package/dist/dsh/commands.d.ts.map +1 -0
- package/dist/dsh/commands.js +83 -0
- package/dist/dsh/commands.js.map +1 -0
- package/dist/dsh/composition.d.ts +64 -0
- package/dist/dsh/composition.d.ts.map +1 -0
- package/dist/dsh/composition.js +104 -0
- package/dist/dsh/composition.js.map +1 -0
- package/dist/dsh/config.d.ts +7 -0
- package/dist/dsh/config.d.ts.map +1 -0
- package/dist/dsh/config.js +6 -0
- package/dist/dsh/config.js.map +1 -0
- package/dist/dsh/context-injection.d.ts +24 -0
- package/dist/dsh/context-injection.d.ts.map +1 -0
- package/dist/dsh/context-injection.js +61 -0
- package/dist/dsh/context-injection.js.map +1 -0
- package/dist/dsh/enno-controller.d.ts +94 -0
- package/dist/dsh/enno-controller.d.ts.map +1 -0
- package/dist/dsh/enno-controller.js +137 -0
- package/dist/dsh/enno-controller.js.map +1 -0
- package/dist/dsh/index.d.ts +31 -0
- package/dist/dsh/index.d.ts.map +1 -0
- package/dist/dsh/index.js +52 -0
- package/dist/dsh/index.js.map +1 -0
- package/dist/dsh/intake-gate.d.ts +50 -0
- package/dist/dsh/intake-gate.d.ts.map +1 -0
- package/dist/dsh/intake-gate.js +77 -0
- package/dist/dsh/intake-gate.js.map +1 -0
- package/dist/dsh/intake-profile-resolver.d.ts +22 -0
- package/dist/dsh/intake-profile-resolver.d.ts.map +1 -0
- package/dist/dsh/intake-profile-resolver.js +44 -0
- package/dist/dsh/intake-profile-resolver.js.map +1 -0
- package/dist/dsh/message-sources.d.ts +28 -0
- package/dist/dsh/message-sources.d.ts.map +1 -0
- package/dist/dsh/message-sources.js +62 -0
- package/dist/dsh/message-sources.js.map +1 -0
- package/dist/dsh/parity.d.ts +18 -0
- package/dist/dsh/parity.d.ts.map +1 -0
- package/dist/dsh/parity.js +105 -0
- package/dist/dsh/parity.js.map +1 -0
- package/dist/dsh/prompt-policy.d.ts +18 -0
- package/dist/dsh/prompt-policy.d.ts.map +1 -0
- package/dist/dsh/prompt-policy.js +16 -0
- package/dist/dsh/prompt-policy.js.map +1 -0
- package/dist/dsh/runtime.d.ts +40 -0
- package/dist/dsh/runtime.d.ts.map +1 -0
- package/dist/dsh/runtime.js +237 -0
- package/dist/dsh/runtime.js.map +1 -0
- package/dist/dsh/session-bridge.d.ts +98 -0
- package/dist/dsh/session-bridge.d.ts.map +1 -0
- package/dist/dsh/session-bridge.js +202 -0
- package/dist/dsh/session-bridge.js.map +1 -0
- package/dist/dsh/standard-skill-provider.d.ts +50 -0
- package/dist/dsh/standard-skill-provider.d.ts.map +1 -0
- package/dist/dsh/standard-skill-provider.js +71 -0
- package/dist/dsh/standard-skill-provider.js.map +1 -0
- package/dist/dsh/tool-policy.d.ts +40 -0
- package/dist/dsh/tool-policy.d.ts.map +1 -0
- package/dist/dsh/tool-policy.js +125 -0
- package/dist/dsh/tool-policy.js.map +1 -0
- package/dist/dsh/tools.d.ts +85 -0
- package/dist/dsh/tools.d.ts.map +1 -0
- package/dist/dsh/tools.js +156 -0
- package/dist/dsh/tools.js.map +1 -0
- package/dist/dsh/user-interaction.d.ts +51 -0
- package/dist/dsh/user-interaction.d.ts.map +1 -0
- package/dist/dsh/user-interaction.js +92 -0
- package/dist/dsh/user-interaction.js.map +1 -0
- package/dist/embedding/backend.d.ts +27 -0
- package/dist/embedding/backend.d.ts.map +1 -0
- package/dist/embedding/backend.js +67 -0
- package/dist/embedding/backend.js.map +1 -0
- package/dist/embedding/config.d.ts +10 -0
- package/dist/embedding/config.d.ts.map +1 -0
- package/dist/embedding/config.js +142 -0
- package/dist/embedding/config.js.map +1 -0
- package/dist/embedding/diagnostics.d.ts +34 -0
- package/dist/embedding/diagnostics.d.ts.map +1 -0
- package/dist/embedding/diagnostics.js +274 -0
- package/dist/embedding/diagnostics.js.map +1 -0
- package/dist/embedding/document.d.ts +20 -0
- package/dist/embedding/document.d.ts.map +1 -0
- package/dist/embedding/document.js +122 -0
- package/dist/embedding/document.js.map +1 -0
- package/dist/embedding/javascript-backend.d.ts +11 -0
- package/dist/embedding/javascript-backend.d.ts.map +1 -0
- package/dist/embedding/javascript-backend.js +164 -0
- package/dist/embedding/javascript-backend.js.map +1 -0
- package/dist/embedding/jobs.d.ts +67 -0
- package/dist/embedding/jobs.d.ts.map +1 -0
- package/dist/embedding/jobs.js +259 -0
- package/dist/embedding/jobs.js.map +1 -0
- package/dist/embedding/local-model-loader.d.ts +24 -0
- package/dist/embedding/local-model-loader.d.ts.map +1 -0
- package/dist/embedding/local-model-loader.js +64 -0
- package/dist/embedding/local-model-loader.js.map +1 -0
- package/dist/embedding/local-transformers-provider.d.ts +17 -0
- package/dist/embedding/local-transformers-provider.d.ts.map +1 -0
- package/dist/embedding/local-transformers-provider.js +54 -0
- package/dist/embedding/local-transformers-provider.js.map +1 -0
- package/dist/embedding/model-download.d.ts +32 -0
- package/dist/embedding/model-download.d.ts.map +1 -0
- package/dist/embedding/model-download.js +41 -0
- package/dist/embedding/model-download.js.map +1 -0
- package/dist/embedding/model-installation.d.ts +17 -0
- package/dist/embedding/model-installation.d.ts.map +1 -0
- package/dist/embedding/model-installation.js +71 -0
- package/dist/embedding/model-installation.js.map +1 -0
- package/dist/embedding/model-manifest.d.ts +18 -0
- package/dist/embedding/model-manifest.d.ts.map +1 -0
- package/dist/embedding/model-manifest.js +86 -0
- package/dist/embedding/model-manifest.js.map +1 -0
- package/dist/embedding/openai-compatible-provider.d.ts +24 -0
- package/dist/embedding/openai-compatible-provider.d.ts.map +1 -0
- package/dist/embedding/openai-compatible-provider.js +330 -0
- package/dist/embedding/openai-compatible-provider.js.map +1 -0
- package/dist/embedding/presets/local-small.d.ts +8 -0
- package/dist/embedding/presets/local-small.d.ts.map +1 -0
- package/dist/embedding/presets/local-small.js +67 -0
- package/dist/embedding/presets/local-small.js.map +1 -0
- package/dist/embedding/presets/manifest.d.ts +27 -0
- package/dist/embedding/presets/manifest.d.ts.map +1 -0
- package/dist/embedding/presets/manifest.js +5 -0
- package/dist/embedding/presets/manifest.js.map +1 -0
- package/dist/embedding/profile.d.ts +10 -0
- package/dist/embedding/profile.d.ts.map +1 -0
- package/dist/embedding/profile.js +67 -0
- package/dist/embedding/profile.js.map +1 -0
- package/dist/embedding/provider.d.ts +13 -0
- package/dist/embedding/provider.d.ts.map +1 -0
- package/dist/embedding/provider.js +17 -0
- package/dist/embedding/provider.js.map +1 -0
- package/dist/embedding/query-cache.d.ts +45 -0
- package/dist/embedding/query-cache.d.ts.map +1 -0
- package/dist/embedding/query-cache.js +181 -0
- package/dist/embedding/query-cache.js.map +1 -0
- package/dist/embedding/runtime.d.ts +14 -0
- package/dist/embedding/runtime.d.ts.map +1 -0
- package/dist/embedding/runtime.js +407 -0
- package/dist/embedding/runtime.js.map +1 -0
- package/dist/embedding/settings.d.ts +6 -0
- package/dist/embedding/settings.d.ts.map +1 -0
- package/dist/embedding/settings.js +69 -0
- package/dist/embedding/settings.js.map +1 -0
- package/dist/embedding/setup-lock.d.ts +7 -0
- package/dist/embedding/setup-lock.d.ts.map +1 -0
- package/dist/embedding/setup-lock.js +35 -0
- package/dist/embedding/setup-lock.js.map +1 -0
- package/dist/embedding/setup-service.d.ts +53 -0
- package/dist/embedding/setup-service.d.ts.map +1 -0
- package/dist/embedding/setup-service.js +184 -0
- package/dist/embedding/setup-service.js.map +1 -0
- package/dist/embedding/sqlite-vec-backend.d.ts +9 -0
- package/dist/embedding/sqlite-vec-backend.d.ts.map +1 -0
- package/dist/embedding/sqlite-vec-backend.js +106 -0
- package/dist/embedding/sqlite-vec-backend.js.map +1 -0
- package/dist/embedding/sqlite-vec-loader.d.ts +17 -0
- package/dist/embedding/sqlite-vec-loader.d.ts.map +1 -0
- package/dist/embedding/sqlite-vec-loader.js +51 -0
- package/dist/embedding/sqlite-vec-loader.js.map +1 -0
- package/dist/embedding/store.d.ts +66 -0
- package/dist/embedding/store.d.ts.map +1 -0
- package/dist/embedding/store.js +490 -0
- package/dist/embedding/store.js.map +1 -0
- package/dist/embedding/types.d.ts +126 -0
- package/dist/embedding/types.d.ts.map +1 -0
- package/dist/embedding/types.js +2 -0
- package/dist/embedding/types.js.map +1 -0
- package/dist/embedding/vector.d.ts +9 -0
- package/dist/embedding/vector.d.ts.map +1 -0
- package/dist/embedding/vector.js +90 -0
- package/dist/embedding/vector.js.map +1 -0
- package/dist/embedding/worker.d.ts +23 -0
- package/dist/embedding/worker.d.ts.map +1 -0
- package/dist/embedding/worker.js +84 -0
- package/dist/embedding/worker.js.map +1 -0
- package/dist/enno-oduno/adapters.d.ts +21 -0
- package/dist/enno-oduno/adapters.d.ts.map +1 -0
- package/dist/enno-oduno/adapters.js +253 -0
- package/dist/enno-oduno/adapters.js.map +1 -0
- package/dist/enno-oduno/advisory-store.d.ts +31 -0
- package/dist/enno-oduno/advisory-store.d.ts.map +1 -0
- package/dist/enno-oduno/advisory-store.js +105 -0
- package/dist/enno-oduno/advisory-store.js.map +1 -0
- package/dist/enno-oduno/advisory.d.ts +18 -0
- package/dist/enno-oduno/advisory.d.ts.map +1 -0
- package/dist/enno-oduno/advisory.js +310 -0
- package/dist/enno-oduno/advisory.js.map +1 -0
- package/dist/enno-oduno/confirmation.d.ts +4 -0
- package/dist/enno-oduno/confirmation.d.ts.map +1 -0
- package/dist/enno-oduno/confirmation.js +127 -0
- package/dist/enno-oduno/confirmation.js.map +1 -0
- package/dist/enno-oduno/directives.d.ts +12 -0
- package/dist/enno-oduno/directives.d.ts.map +1 -0
- package/dist/enno-oduno/directives.js +276 -0
- package/dist/enno-oduno/directives.js.map +1 -0
- package/dist/enno-oduno/enno-oduno.d.mts +2 -0
- package/dist/enno-oduno/enno-oduno.d.mts.map +1 -0
- package/dist/enno-oduno/enno-oduno.mjs +3 -0
- package/dist/enno-oduno/enno-oduno.mjs.map +1 -0
- package/dist/enno-oduno/experts.d.ts +6 -0
- package/dist/enno-oduno/experts.d.ts.map +1 -0
- package/dist/enno-oduno/experts.js +32 -0
- package/dist/enno-oduno/experts.js.map +1 -0
- package/dist/enno-oduno/goki.d.mts +2 -0
- package/dist/enno-oduno/goki.d.mts.map +1 -0
- package/dist/enno-oduno/goki.mjs +3 -0
- package/dist/enno-oduno/goki.mjs.map +1 -0
- package/dist/enno-oduno/handoff.d.ts +4 -0
- package/dist/enno-oduno/handoff.d.ts.map +1 -0
- package/dist/enno-oduno/handoff.js +18 -0
- package/dist/enno-oduno/handoff.js.map +1 -0
- package/dist/enno-oduno/harness.d.ts +20 -0
- package/dist/enno-oduno/harness.d.ts.map +1 -0
- package/dist/enno-oduno/harness.js +66 -0
- package/dist/enno-oduno/harness.js.map +1 -0
- package/dist/enno-oduno/instructions.d.ts +9 -0
- package/dist/enno-oduno/instructions.d.ts.map +1 -0
- package/dist/enno-oduno/instructions.js +12 -0
- package/dist/enno-oduno/instructions.js.map +1 -0
- package/dist/enno-oduno/plan-recovery.d.ts +44 -0
- package/dist/enno-oduno/plan-recovery.d.ts.map +1 -0
- package/dist/enno-oduno/plan-recovery.js +160 -0
- package/dist/enno-oduno/plan-recovery.js.map +1 -0
- package/dist/enno-oduno/repository-state.d.ts +8 -0
- package/dist/enno-oduno/repository-state.d.ts.map +1 -0
- package/dist/enno-oduno/repository-state.js +139 -0
- package/dist/enno-oduno/repository-state.js.map +1 -0
- package/dist/enno-oduno/role-runner.d.ts +9 -0
- package/dist/enno-oduno/role-runner.d.ts.map +1 -0
- package/dist/enno-oduno/role-runner.js +219 -0
- package/dist/enno-oduno/role-runner.js.map +1 -0
- package/dist/enno-oduno/sanitize.d.ts +17 -0
- package/dist/enno-oduno/sanitize.d.ts.map +1 -0
- package/dist/enno-oduno/sanitize.js +88 -0
- package/dist/enno-oduno/sanitize.js.map +1 -0
- package/dist/enno-oduno/schemas.d.ts +962 -0
- package/dist/enno-oduno/schemas.d.ts.map +1 -0
- package/dist/enno-oduno/schemas.js +609 -0
- package/dist/enno-oduno/schemas.js.map +1 -0
- package/dist/enno-oduno/service.d.ts +57 -0
- package/dist/enno-oduno/service.d.ts.map +1 -0
- package/dist/enno-oduno/service.js +1379 -0
- package/dist/enno-oduno/service.js.map +1 -0
- package/dist/enno-oduno/skills.d.ts +22 -0
- package/dist/enno-oduno/skills.d.ts.map +1 -0
- package/dist/enno-oduno/skills.js +127 -0
- package/dist/enno-oduno/skills.js.map +1 -0
- package/dist/enno-oduno/store.d.ts +106 -0
- package/dist/enno-oduno/store.d.ts.map +1 -0
- package/dist/enno-oduno/store.js +712 -0
- package/dist/enno-oduno/store.js.map +1 -0
- package/dist/enno-oduno/types.d.ts +457 -0
- package/dist/enno-oduno/types.d.ts.map +1 -0
- package/dist/enno-oduno/types.js +66 -0
- package/dist/enno-oduno/types.js.map +1 -0
- package/dist/enno-oduno/validation-errors.d.ts +93 -0
- package/dist/enno-oduno/validation-errors.d.ts.map +1 -0
- package/dist/enno-oduno/validation-errors.js +152 -0
- package/dist/enno-oduno/validation-errors.js.map +1 -0
- package/dist/enno-oduno/verifier.d.ts +10 -0
- package/dist/enno-oduno/verifier.d.ts.map +1 -0
- package/dist/enno-oduno/verifier.js +214 -0
- package/dist/enno-oduno/verifier.js.map +1 -0
- package/dist/enno-oduno/zenki.d.mts +2 -0
- package/dist/enno-oduno/zenki.d.mts.map +1 -0
- package/dist/enno-oduno/zenki.mjs +3 -0
- package/dist/enno-oduno/zenki.mjs.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +60 -0
- package/dist/errors.js.map +1 -0
- package/dist/gateway/agent-service.d.ts +72 -0
- package/dist/gateway/agent-service.d.ts.map +1 -0
- package/dist/gateway/agent-service.js +594 -0
- package/dist/gateway/agent-service.js.map +1 -0
- package/dist/gateway/checkpoint-mutation-service.d.ts +33 -0
- package/dist/gateway/checkpoint-mutation-service.d.ts.map +1 -0
- package/dist/gateway/checkpoint-mutation-service.js +513 -0
- package/dist/gateway/checkpoint-mutation-service.js.map +1 -0
- package/dist/gateway/checkpoint-service.d.ts +40 -0
- package/dist/gateway/checkpoint-service.d.ts.map +1 -0
- package/dist/gateway/checkpoint-service.js +149 -0
- package/dist/gateway/checkpoint-service.js.map +1 -0
- package/dist/gateway/nudge-delivery-service.d.ts +21 -0
- package/dist/gateway/nudge-delivery-service.d.ts.map +1 -0
- package/dist/gateway/nudge-delivery-service.js +67 -0
- package/dist/gateway/nudge-delivery-service.js.map +1 -0
- package/dist/ledger/archive.d.ts +48 -0
- package/dist/ledger/archive.d.ts.map +1 -0
- package/dist/ledger/archive.js +1261 -0
- package/dist/ledger/archive.js.map +1 -0
- package/dist/ledger/checkpoint-contract.d.ts +144 -0
- package/dist/ledger/checkpoint-contract.d.ts.map +1 -0
- package/dist/ledger/checkpoint-contract.js +91 -0
- package/dist/ledger/checkpoint-contract.js.map +1 -0
- package/dist/ledger/checkpoint-eligibility.d.ts +17 -0
- package/dist/ledger/checkpoint-eligibility.d.ts.map +1 -0
- package/dist/ledger/checkpoint-eligibility.js +19 -0
- package/dist/ledger/checkpoint-eligibility.js.map +1 -0
- package/dist/ledger/hash.d.ts +22 -0
- package/dist/ledger/hash.d.ts.map +1 -0
- package/dist/ledger/hash.js +25 -0
- package/dist/ledger/hash.js.map +1 -0
- package/dist/ledger/maintenance.d.ts +68 -0
- package/dist/ledger/maintenance.d.ts.map +1 -0
- package/dist/ledger/maintenance.js +767 -0
- package/dist/ledger/maintenance.js.map +1 -0
- package/dist/ledger/projection.d.ts +38 -0
- package/dist/ledger/projection.d.ts.map +1 -0
- package/dist/ledger/projection.js +315 -0
- package/dist/ledger/projection.js.map +1 -0
- package/dist/ledger/promotion.d.ts +19 -0
- package/dist/ledger/promotion.d.ts.map +1 -0
- package/dist/ledger/promotion.js +310 -0
- package/dist/ledger/promotion.js.map +1 -0
- package/dist/ledger/query.d.ts +41 -0
- package/dist/ledger/query.d.ts.map +1 -0
- package/dist/ledger/query.js +321 -0
- package/dist/ledger/query.js.map +1 -0
- package/dist/ledger/redaction.d.ts +8 -0
- package/dist/ledger/redaction.d.ts.map +1 -0
- package/dist/ledger/redaction.js +40 -0
- package/dist/ledger/redaction.js.map +1 -0
- package/dist/ledger/store.d.ts +45 -0
- package/dist/ledger/store.d.ts.map +1 -0
- package/dist/ledger/store.js +327 -0
- package/dist/ledger/store.js.map +1 -0
- package/dist/ledger/types.d.ts +115 -0
- package/dist/ledger/types.d.ts.map +1 -0
- package/dist/ledger/types.js +27 -0
- package/dist/ledger/types.js.map +1 -0
- package/dist/ledger/validate.d.ts +10 -0
- package/dist/ledger/validate.d.ts.map +1 -0
- package/dist/ledger/validate.js +178 -0
- package/dist/ledger/validate.js.map +1 -0
- package/dist/mcp/bounded-stdio-transport.d.ts +26 -0
- package/dist/mcp/bounded-stdio-transport.d.ts.map +1 -0
- package/dist/mcp/bounded-stdio-transport.js +121 -0
- package/dist/mcp/bounded-stdio-transport.js.map +1 -0
- package/dist/mcp/request-deadline.d.ts +51 -0
- package/dist/mcp/request-deadline.d.ts.map +1 -0
- package/dist/mcp/request-deadline.js +155 -0
- package/dist/mcp/request-deadline.js.map +1 -0
- package/dist/mcp/runtime-owner.d.ts +27 -0
- package/dist/mcp/runtime-owner.d.ts.map +1 -0
- package/dist/mcp/runtime-owner.js +129 -0
- package/dist/mcp/runtime-owner.js.map +1 -0
- package/dist/mcp/server.d.ts +24 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +502 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/memory/audit.d.ts +13 -0
- package/dist/memory/audit.d.ts.map +1 -0
- package/dist/memory/audit.js +15 -0
- package/dist/memory/audit.js.map +1 -0
- package/dist/memory/checkpoint-contract.d.ts +490 -0
- package/dist/memory/checkpoint-contract.d.ts.map +1 -0
- package/dist/memory/checkpoint-contract.js +106 -0
- package/dist/memory/checkpoint-contract.js.map +1 -0
- package/dist/memory/curator-trust.d.ts +15 -0
- package/dist/memory/curator-trust.d.ts.map +1 -0
- package/dist/memory/curator-trust.js +58 -0
- package/dist/memory/curator-trust.js.map +1 -0
- package/dist/memory/curator.d.ts +115 -0
- package/dist/memory/curator.d.ts.map +1 -0
- package/dist/memory/curator.js +706 -0
- package/dist/memory/curator.js.map +1 -0
- package/dist/memory/entries.d.ts +75 -0
- package/dist/memory/entries.d.ts.map +1 -0
- package/dist/memory/entries.js +355 -0
- package/dist/memory/entries.js.map +1 -0
- package/dist/memory/federated-retrieval.d.ts +79 -0
- package/dist/memory/federated-retrieval.d.ts.map +1 -0
- package/dist/memory/federated-retrieval.js +515 -0
- package/dist/memory/federated-retrieval.js.map +1 -0
- package/dist/memory/hybrid-retrieval.d.ts +33 -0
- package/dist/memory/hybrid-retrieval.d.ts.map +1 -0
- package/dist/memory/hybrid-retrieval.js +398 -0
- package/dist/memory/hybrid-retrieval.js.map +1 -0
- package/dist/memory/lifecycle.d.ts +29 -0
- package/dist/memory/lifecycle.d.ts.map +1 -0
- package/dist/memory/lifecycle.js +65 -0
- package/dist/memory/lifecycle.js.map +1 -0
- package/dist/memory/portability.d.ts +10 -0
- package/dist/memory/portability.d.ts.map +1 -0
- package/dist/memory/portability.js +44 -0
- package/dist/memory/portability.js.map +1 -0
- package/dist/memory/rebuild-search.d.ts +24 -0
- package/dist/memory/rebuild-search.d.ts.map +1 -0
- package/dist/memory/rebuild-search.js +167 -0
- package/dist/memory/rebuild-search.js.map +1 -0
- package/dist/memory/retrieval-query.d.ts +16 -0
- package/dist/memory/retrieval-query.d.ts.map +1 -0
- package/dist/memory/retrieval-query.js +161 -0
- package/dist/memory/retrieval-query.js.map +1 -0
- package/dist/memory/retrieval.d.ts +56 -0
- package/dist/memory/retrieval.d.ts.map +1 -0
- package/dist/memory/retrieval.js +101 -0
- package/dist/memory/retrieval.js.map +1 -0
- package/dist/memory/revisions.d.ts +123 -0
- package/dist/memory/revisions.d.ts.map +1 -0
- package/dist/memory/revisions.js +759 -0
- package/dist/memory/revisions.js.map +1 -0
- package/dist/memory/scoped-memory.d.ts +76 -0
- package/dist/memory/scoped-memory.d.ts.map +1 -0
- package/dist/memory/scoped-memory.js +539 -0
- package/dist/memory/scoped-memory.js.map +1 -0
- package/dist/memory/secrets.d.ts +8 -0
- package/dist/memory/secrets.d.ts.map +1 -0
- package/dist/memory/secrets.js +54 -0
- package/dist/memory/secrets.js.map +1 -0
- package/dist/memory/structured-memory.d.ts +60 -0
- package/dist/memory/structured-memory.d.ts.map +1 -0
- package/dist/memory/structured-memory.js +341 -0
- package/dist/memory/structured-memory.js.map +1 -0
- package/dist/memory/workspaces.d.ts +26 -0
- package/dist/memory/workspaces.d.ts.map +1 -0
- package/dist/memory/workspaces.js +159 -0
- package/dist/memory/workspaces.js.map +1 -0
- package/dist/model-tools/contracts.d.ts +1297 -0
- package/dist/model-tools/contracts.d.ts.map +1 -0
- package/dist/model-tools/contracts.js +104 -0
- package/dist/model-tools/contracts.js.map +1 -0
- package/dist/model-tools/registry.d.ts +8 -0
- package/dist/model-tools/registry.d.ts.map +1 -0
- package/dist/model-tools/registry.js +59 -0
- package/dist/model-tools/registry.js.map +1 -0
- package/dist/package-version.d.ts +2 -0
- package/dist/package-version.d.ts.map +1 -0
- package/dist/package-version.js +7 -0
- package/dist/package-version.js.map +1 -0
- package/dist/repository/binding.d.ts +32 -0
- package/dist/repository/binding.d.ts.map +1 -0
- package/dist/repository/binding.js +208 -0
- package/dist/repository/binding.js.map +1 -0
- package/dist/repository/cwd-schema.d.ts +4 -0
- package/dist/repository/cwd-schema.d.ts.map +1 -0
- package/dist/repository/cwd-schema.js +8 -0
- package/dist/repository/cwd-schema.js.map +1 -0
- package/dist/repository/detect-root.d.ts +13 -0
- package/dist/repository/detect-root.d.ts.map +1 -0
- package/dist/repository/detect-root.js +77 -0
- package/dist/repository/detect-root.js.map +1 -0
- package/dist/repository/framework-version.d.ts +8 -0
- package/dist/repository/framework-version.d.ts.map +1 -0
- package/dist/repository/framework-version.js +29 -0
- package/dist/repository/framework-version.js.map +1 -0
- package/dist/repository/git-origin.d.ts +2 -0
- package/dist/repository/git-origin.d.ts.map +1 -0
- package/dist/repository/git-origin.js +15 -0
- package/dist/repository/git-origin.js.map +1 -0
- package/dist/repository/gitignore.d.ts +8 -0
- package/dist/repository/gitignore.d.ts.map +1 -0
- package/dist/repository/gitignore.js +21 -0
- package/dist/repository/gitignore.js.map +1 -0
- package/dist/repository/identity-value.d.ts +4 -0
- package/dist/repository/identity-value.d.ts.map +1 -0
- package/dist/repository/identity-value.js +24 -0
- package/dist/repository/identity-value.js.map +1 -0
- package/dist/repository/identity.d.ts +19 -0
- package/dist/repository/identity.d.ts.map +1 -0
- package/dist/repository/identity.js +25 -0
- package/dist/repository/identity.js.map +1 -0
- package/dist/repository/project-fingerprint.d.ts +33 -0
- package/dist/repository/project-fingerprint.d.ts.map +1 -0
- package/dist/repository/project-fingerprint.js +429 -0
- package/dist/repository/project-fingerprint.js.map +1 -0
- package/dist/repository/remote-url.d.ts +3 -0
- package/dist/repository/remote-url.d.ts.map +1 -0
- package/dist/repository/remote-url.js +35 -0
- package/dist/repository/remote-url.js.map +1 -0
- package/dist/runtime-version.d.ts +6 -0
- package/dist/runtime-version.d.ts.map +1 -0
- package/dist/runtime-version.js +33 -0
- package/dist/runtime-version.js.map +1 -0
- package/dist/security/sanitize.d.ts +4 -0
- package/dist/security/sanitize.d.ts.map +1 -0
- package/dist/security/sanitize.js +174 -0
- package/dist/security/sanitize.js.map +1 -0
- package/dist/serialization/boundary-json.d.ts +20 -0
- package/dist/serialization/boundary-json.d.ts.map +1 -0
- package/dist/serialization/boundary-json.js +129 -0
- package/dist/serialization/boundary-json.js.map +1 -0
- package/dist/serialization/envelope.d.ts +20 -0
- package/dist/serialization/envelope.d.ts.map +1 -0
- package/dist/serialization/envelope.js +11 -0
- package/dist/serialization/envelope.js.map +1 -0
- package/dist/serialization/validate.d.ts +38 -0
- package/dist/serialization/validate.d.ts.map +1 -0
- package/dist/serialization/validate.js +233 -0
- package/dist/serialization/validate.js.map +1 -0
- package/dist/server/agent-application.d.ts +6 -0
- package/dist/server/agent-application.d.ts.map +1 -0
- package/dist/server/agent-application.js +74 -0
- package/dist/server/agent-application.js.map +1 -0
- package/dist/server/agent-checkpoint-use-case.d.ts +41 -0
- package/dist/server/agent-checkpoint-use-case.d.ts.map +1 -0
- package/dist/server/agent-checkpoint-use-case.js +159 -0
- package/dist/server/agent-checkpoint-use-case.js.map +1 -0
- package/dist/server/app.d.ts +5 -0
- package/dist/server/app.d.ts.map +1 -0
- package/dist/server/app.js +87 -0
- package/dist/server/app.js.map +1 -0
- package/dist/server/auth.d.ts +2 -0
- package/dist/server/auth.d.ts.map +1 -0
- package/dist/server/auth.js +22 -0
- package/dist/server/auth.js.map +1 -0
- package/dist/server/http.d.ts +86 -0
- package/dist/server/http.d.ts.map +1 -0
- package/dist/server/http.js +455 -0
- package/dist/server/http.js.map +1 -0
- package/dist/server/idempotency.d.ts +6 -0
- package/dist/server/idempotency.d.ts.map +1 -0
- package/dist/server/idempotency.js +210 -0
- package/dist/server/idempotency.js.map +1 -0
- package/dist/server/instance-lock.d.ts +17 -0
- package/dist/server/instance-lock.d.ts.map +1 -0
- package/dist/server/instance-lock.js +118 -0
- package/dist/server/instance-lock.js.map +1 -0
- package/dist/server/router.d.ts +29 -0
- package/dist/server/router.d.ts.map +1 -0
- package/dist/server/router.js +129 -0
- package/dist/server/router.js.map +1 -0
- package/dist/server/routes/agent-capability-gate.d.ts +43 -0
- package/dist/server/routes/agent-capability-gate.d.ts.map +1 -0
- package/dist/server/routes/agent-capability-gate.js +202 -0
- package/dist/server/routes/agent-capability-gate.js.map +1 -0
- package/dist/server/routes/agent-events.d.ts +5 -0
- package/dist/server/routes/agent-events.d.ts.map +1 -0
- package/dist/server/routes/agent-events.js +53 -0
- package/dist/server/routes/agent-events.js.map +1 -0
- package/dist/server/routes/agent-intake.d.ts +5 -0
- package/dist/server/routes/agent-intake.d.ts.map +1 -0
- package/dist/server/routes/agent-intake.js +50 -0
- package/dist/server/routes/agent-intake.js.map +1 -0
- package/dist/server/routes/agent-promotions.d.ts +5 -0
- package/dist/server/routes/agent-promotions.d.ts.map +1 -0
- package/dist/server/routes/agent-promotions.js +55 -0
- package/dist/server/routes/agent-promotions.js.map +1 -0
- package/dist/server/routes/agent-runs.d.ts +32 -0
- package/dist/server/routes/agent-runs.d.ts.map +1 -0
- package/dist/server/routes/agent-runs.js +165 -0
- package/dist/server/routes/agent-runs.js.map +1 -0
- package/dist/server/routes/request-binding.d.ts +5 -0
- package/dist/server/routes/request-binding.d.ts.map +1 -0
- package/dist/server/routes/request-binding.js +49 -0
- package/dist/server/routes/request-binding.js.map +1 -0
- package/dist/server/routes/task5-support.d.ts +4 -0
- package/dist/server/routes/task5-support.d.ts.map +1 -0
- package/dist/server/routes/task5-support.js +6 -0
- package/dist/server/routes/task5-support.js.map +1 -0
- package/dist/server/routes/task5.d.ts +5 -0
- package/dist/server/routes/task5.d.ts.map +1 -0
- package/dist/server/routes/task5.js +85 -0
- package/dist/server/routes/task5.js.map +1 -0
- package/dist/server/runtime-descriptor.d.ts +24 -0
- package/dist/server/runtime-descriptor.d.ts.map +1 -0
- package/dist/server/runtime-descriptor.js +156 -0
- package/dist/server/runtime-descriptor.js.map +1 -0
- package/dist/server/write-queue.d.ts +20 -0
- package/dist/server/write-queue.d.ts.map +1 -0
- package/dist/server/write-queue.js +83 -0
- package/dist/server/write-queue.js.map +1 -0
- package/dist/setup/claude-config.d.ts +8 -0
- package/dist/setup/claude-config.d.ts.map +1 -0
- package/dist/setup/claude-config.js +95 -0
- package/dist/setup/claude-config.js.map +1 -0
- package/dist/setup/client-detection.d.ts +13 -0
- package/dist/setup/client-detection.d.ts.map +1 -0
- package/dist/setup/client-detection.js +64 -0
- package/dist/setup/client-detection.js.map +1 -0
- package/dist/setup/enno-client-config.d.ts +9 -0
- package/dist/setup/enno-client-config.d.ts.map +1 -0
- package/dist/setup/enno-client-config.js +172 -0
- package/dist/setup/enno-client-config.js.map +1 -0
- package/dist/setup/hermes-config.d.ts +7 -0
- package/dist/setup/hermes-config.d.ts.map +1 -0
- package/dist/setup/hermes-config.js +145 -0
- package/dist/setup/hermes-config.js.map +1 -0
- package/dist/setup/legacy-client-cleanup.d.ts +6 -0
- package/dist/setup/legacy-client-cleanup.d.ts.map +1 -0
- package/dist/setup/legacy-client-cleanup.js +152 -0
- package/dist/setup/legacy-client-cleanup.js.map +1 -0
- package/dist/setup/managed-text.d.ts +6 -0
- package/dist/setup/managed-text.d.ts.map +1 -0
- package/dist/setup/managed-text.js +52 -0
- package/dist/setup/managed-text.js.map +1 -0
- package/dist/setup/mcp-conflict.d.ts +4 -0
- package/dist/setup/mcp-conflict.d.ts.map +1 -0
- package/dist/setup/mcp-conflict.js +15 -0
- package/dist/setup/mcp-conflict.js.map +1 -0
- package/dist/setup/opencode-config.d.ts +8 -0
- package/dist/setup/opencode-config.d.ts.map +1 -0
- package/dist/setup/opencode-config.js +98 -0
- package/dist/setup/opencode-config.js.map +1 -0
- package/dist/setup/project-agent-refresh.d.ts +41 -0
- package/dist/setup/project-agent-refresh.d.ts.map +1 -0
- package/dist/setup/project-agent-refresh.js +158 -0
- package/dist/setup/project-agent-refresh.js.map +1 -0
- package/dist/setup/render.d.ts +13 -0
- package/dist/setup/render.d.ts.map +1 -0
- package/dist/setup/render.js +334 -0
- package/dist/setup/render.js.map +1 -0
- package/dist/setup/standard-skills.d.ts +60 -0
- package/dist/setup/standard-skills.d.ts.map +1 -0
- package/dist/setup/standard-skills.js +133 -0
- package/dist/setup/standard-skills.js.map +1 -0
- package/dist/setup/strict-json.d.ts +7 -0
- package/dist/setup/strict-json.d.ts.map +1 -0
- package/dist/setup/strict-json.js +98 -0
- package/dist/setup/strict-json.js.map +1 -0
- package/dist/setup/strict-toml.d.ts +18 -0
- package/dist/setup/strict-toml.d.ts.map +1 -0
- package/dist/setup/strict-toml.js +491 -0
- package/dist/setup/strict-toml.js.map +1 -0
- package/dist/skills/cache.d.ts +15 -0
- package/dist/skills/cache.d.ts.map +1 -0
- package/dist/skills/cache.js +19 -0
- package/dist/skills/cache.js.map +1 -0
- package/dist/skills/candidate-ranking.d.ts +15 -0
- package/dist/skills/candidate-ranking.d.ts.map +1 -0
- package/dist/skills/candidate-ranking.js +52 -0
- package/dist/skills/candidate-ranking.js.map +1 -0
- package/dist/skills/chunking.d.ts +11 -0
- package/dist/skills/chunking.d.ts.map +1 -0
- package/dist/skills/chunking.js +291 -0
- package/dist/skills/chunking.js.map +1 -0
- package/dist/skills/config.d.ts +19 -0
- package/dist/skills/config.d.ts.map +1 -0
- package/dist/skills/config.js +103 -0
- package/dist/skills/config.js.map +1 -0
- package/dist/skills/discovery-service.d.ts +26 -0
- package/dist/skills/discovery-service.d.ts.map +1 -0
- package/dist/skills/discovery-service.js +929 -0
- package/dist/skills/discovery-service.js.map +1 -0
- package/dist/skills/external-transport.d.ts +2 -0
- package/dist/skills/external-transport.d.ts.map +1 -0
- package/dist/skills/external-transport.js +30 -0
- package/dist/skills/external-transport.js.map +1 -0
- package/dist/skills/find.d.ts +17 -0
- package/dist/skills/find.d.ts.map +1 -0
- package/dist/skills/find.js +59 -0
- package/dist/skills/find.js.map +1 -0
- package/dist/skills/gap-detection.d.ts +23 -0
- package/dist/skills/gap-detection.d.ts.map +1 -0
- package/dist/skills/gap-detection.js +62 -0
- package/dist/skills/gap-detection.js.map +1 -0
- package/dist/skills/import-preparation.d.ts +4 -0
- package/dist/skills/import-preparation.d.ts.map +1 -0
- package/dist/skills/import-preparation.js +20 -0
- package/dist/skills/import-preparation.js.map +1 -0
- package/dist/skills/materialization-authority.d.ts +11 -0
- package/dist/skills/materialization-authority.d.ts.map +1 -0
- package/dist/skills/materialization-authority.js +92 -0
- package/dist/skills/materialization-authority.js.map +1 -0
- package/dist/skills/materialization-service.d.ts +22 -0
- package/dist/skills/materialization-service.d.ts.map +1 -0
- package/dist/skills/materialization-service.js +101 -0
- package/dist/skills/materialization-service.js.map +1 -0
- package/dist/skills/official-catalog.d.ts +31 -0
- package/dist/skills/official-catalog.d.ts.map +1 -0
- package/dist/skills/official-catalog.js +110 -0
- package/dist/skills/official-catalog.js.map +1 -0
- package/dist/skills/providers/schema.d.ts +30 -0
- package/dist/skills/providers/schema.d.ts.map +1 -0
- package/dist/skills/providers/schema.js +354 -0
- package/dist/skills/providers/schema.js.map +1 -0
- package/dist/skills/providers/skills-sh-compat.d.ts +17 -0
- package/dist/skills/providers/skills-sh-compat.d.ts.map +1 -0
- package/dist/skills/providers/skills-sh-compat.js +73 -0
- package/dist/skills/providers/skills-sh-compat.js.map +1 -0
- package/dist/skills/providers/skills-sh-v1.d.ts +23 -0
- package/dist/skills/providers/skills-sh-v1.d.ts.map +1 -0
- package/dist/skills/providers/skills-sh-v1.js +152 -0
- package/dist/skills/providers/skills-sh-v1.js.map +1 -0
- package/dist/skills/query-builder.d.ts +18 -0
- package/dist/skills/query-builder.d.ts.map +1 -0
- package/dist/skills/query-builder.js +93 -0
- package/dist/skills/query-builder.js.map +1 -0
- package/dist/skills/source/errors.d.ts +9 -0
- package/dist/skills/source/errors.d.ts.map +1 -0
- package/dist/skills/source/errors.js +15 -0
- package/dist/skills/source/errors.js.map +1 -0
- package/dist/skills/source/frontmatter.d.ts +9 -0
- package/dist/skills/source/frontmatter.d.ts.map +1 -0
- package/dist/skills/source/frontmatter.js +77 -0
- package/dist/skills/source/frontmatter.js.map +1 -0
- package/dist/skills/source/github-fetcher.d.ts +20 -0
- package/dist/skills/source/github-fetcher.d.ts.map +1 -0
- package/dist/skills/source/github-fetcher.js +296 -0
- package/dist/skills/source/github-fetcher.js.map +1 -0
- package/dist/skills/source/snapshot-validator.d.ts +28 -0
- package/dist/skills/source/snapshot-validator.d.ts.map +1 -0
- package/dist/skills/source/snapshot-validator.js +186 -0
- package/dist/skills/source/snapshot-validator.js.map +1 -0
- package/dist/skills/store.d.ts +180 -0
- package/dist/skills/store.d.ts.map +1 -0
- package/dist/skills/store.js +1712 -0
- package/dist/skills/store.js.map +1 -0
- package/dist/skills/types.d.ts +171 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +2 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/web/i18n.d.ts +184 -0
- package/dist/web/i18n.d.ts.map +1 -0
- package/dist/web/i18n.js +733 -0
- package/dist/web/i18n.js.map +1 -0
- package/dist/web/server.d.ts +16 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/server.js +862 -0
- package/dist/web/server.js.map +1 -0
- package/dist/web/ui.d.ts +6 -0
- package/dist/web/ui.d.ts.map +1 -0
- package/dist/web/ui.js +1328 -0
- package/dist/web/ui.js.map +1 -0
- package/docs/README.ja.md +14 -0
- package/docs/README.md +16 -0
- package/docs/agent-file.md +72 -0
- package/docs/agent-gateway.md +104 -0
- package/docs/architecture.md +12 -0
- package/docs/cli-contract.md +39 -0
- package/docs/client-compatibility.md +299 -0
- package/docs/concepts.ja.md +25 -0
- package/docs/concepts.md +33 -0
- package/docs/database.md +11 -0
- package/docs/dsh-plugin.md +108 -0
- package/docs/enno-oduno.ja.md +22 -0
- package/docs/enno-oduno.md +35 -0
- package/docs/execution-ledger.md +89 -0
- package/docs/getting-started.ja.md +88 -0
- package/docs/getting-started.md +99 -0
- package/docs/release-notes-0.1.18.md +103 -0
- package/docs/retrieval-evaluation.md +10 -0
- package/docs/security-and-trust.ja.md +29 -0
- package/docs/security-and-trust.md +39 -0
- package/docs/security.md +11 -0
- package/docs/semantic-retrieval.ja.md +18 -0
- package/docs/semantic-retrieval.md +26 -0
- package/docs/sqlite-driver-adr.md +8 -0
- package/dsh/cordis.patch.yml +7 -0
- package/migrations/001_initial.sql +123 -0
- package/migrations/002_fts.sql +22 -0
- package/migrations/003_akinator.sql +30 -0
- package/migrations/004_agent_gateway.sql +261 -0
- package/migrations/005_hybrid_search.sql +40 -0
- package/migrations/006_context_v2.sql +4 -0
- package/migrations/007_akinator_reasoning.sql +59 -0
- package/migrations/008_federated_memory.sql +46 -0
- package/migrations/009_external_skill_discovery.sql +126 -0
- package/migrations/010_nudge_deliveries.sql +50 -0
- package/migrations/011_nudge_integrity.sql +52 -0
- package/migrations/012_context_delivery_v4.sql +3 -0
- package/migrations/013_enno_oduno.sql +176 -0
- package/migrations/014_oduno_reflection_phases.sql +40 -0
- package/migrations/015_skill_discovery_attempt_digests.sql +90 -0
- package/migrations/016_enno_advisory_rounds.sql +67 -0
- package/migrations/017_enno_advisory_protocol_v2.sql +101 -0
- package/migrations/018_enno_repository_routing.sql +5 -0
- package/migrations/019_enno_execution_integrity.sql +149 -0
- package/migrations/020_cjk_fts.sql +80 -0
- package/migrations/021_semantic_embeddings.sql +122 -0
- package/migrations/022_embedding_setup_v2.sql +236 -0
- package/migrations/023_enno_dsh_client.sql +291 -0
- package/migrations/down/020_cjk_fts.sql +38 -0
- package/migrations/down/021_semantic_embeddings.sql +17 -0
- package/migrations/down/022_embedding_setup_v2.sql +133 -0
- package/package.json +101 -0
- package/skills/kiokuko-enno-oduno/SKILL.md +209 -0
- package/skills/kiokuko-enno-oduno/enno-oduno.png +0 -0
- package/skills/kiokuko-simple-work/SKILL.md +112 -0
- package/skills/kiokuko-single-purpose-functions/SKILL.md +82 -0
- package/skills/kiokuko-single-purpose-functions/references/boundaries-and-ownership.md +50 -0
- package/skills/kiokuko-single-purpose-functions/references/domain-and-types.md +48 -0
- package/skills/kiokuko-single-purpose-functions/references/effects-and-data.md +43 -0
- package/skills/kiokuko-single-purpose-functions/references/kiokuko-patterns.md +344 -0
- package/skills/kiokuko-single-purpose-functions/references/problem-shaping-and-language.md +84 -0
- package/skills/kiokuko-single-purpose-functions/references/protocols-and-idempotency.md +42 -0
- package/skills/kiokuko-single-purpose-functions/references/review-checklist.md +97 -0
- package/skills/kiokuko-single-purpose-functions/references/verification.md +41 -0
- package/skills/kiokuko-soul/SKILL.md +104 -0
- package/skills/kiokuko-ui-design-soul/SKILL.md +73 -0
- package/skills/kiokuko-ui-design-soul/references/accessibility-and-navigation.md +31 -0
- package/skills/kiokuko-ui-design-soul/references/async-recovery.md +49 -0
- package/skills/kiokuko-ui-design-soul/references/forms-and-controls.md +35 -0
- package/skills/kiokuko-ui-design-soul/references/interaction-feedback.md +34 -0
- package/skills/kiokuko-ui-design-soul/references/responsive-and-platform.md +38 -0
- package/skills/kiokuko-ui-design-soul/references/safety-and-review.md +39 -0
- package/skills/kiokuko-ui-design-soul/references/ui-checklist.md +71 -0
- package/skills/memory-reasoning/SKILL.md +52 -0
- package/templates/AGENTS.md +46 -0
|
@@ -0,0 +1,793 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { mkdir, rmdir } from 'node:fs/promises';
|
|
3
|
+
import { createInterface } from 'node:readline/promises';
|
|
4
|
+
import { stdin, stdout } from 'node:process';
|
|
5
|
+
import { atomicWriteTextIfUnchanged, assertAtomicCleanupComplete, AtomicCommittedMutationError, AtomicCommittedUnlinkError, assertFileExpectation, readDirectoryIdentity, readRegularFile, unlinkRegularFileIfUnchanged, } from '../agent-file/atomic-write.js';
|
|
6
|
+
import { getClaudeInstructionsPath, getClaudeMcpConfigPath, getClaudeSkillsDirectory, getCodexConfigPath, getCodexHooksPath, getCodexInstructionsPath, getCodexSkillsDirectory, getGlobalDatabasePath, getLegacyClaudePromptHookSettingsPath, getLegacyOpenCodeLoopGuardPath, getOpenCodeConfigDirectory, getOpenCodeEnnoPluginPath, getOpenCodeInstructionsPath, getOpenCodeSkillsDirectory, resolveHermesProfilePaths, } from '../config/paths.js';
|
|
7
|
+
import { initializeDatabase } from './init.js';
|
|
8
|
+
import { databaseFileIdentity, openConnection } from '../db/connection.js';
|
|
9
|
+
import { ensureGlobalWorkspace } from '../memory/workspaces.js';
|
|
10
|
+
import { KiokukoError } from '../errors.js';
|
|
11
|
+
import { isSkillDiscoveryMode, normalizeSkillDiscoveryMode, SKILL_DISCOVERY_ENV } from '../skills/config.js';
|
|
12
|
+
import { hasCanonicalOpenCodeMcpConfig, renderOpenCodeConfig } from '../setup/opencode-config.js';
|
|
13
|
+
import { setupMcpIdentityConflictClient } from '../setup/mcp-conflict.js';
|
|
14
|
+
import { hasCanonicalCodexMcpConfig, renderCodexMcpConfig, renderGlobalInstructions } from '../setup/render.js';
|
|
15
|
+
import { hasCanonicalClaudeMcpConfig, renderClaudeConfig } from '../setup/claude-config.js';
|
|
16
|
+
import { renderHermesConfig } from '../setup/hermes-config.js';
|
|
17
|
+
import { detectInstalledClients } from '../setup/client-detection.js';
|
|
18
|
+
import { assertExactLegacyOpenCodeLoopGuard, cleanupLegacyClaudePromptHook, } from '../setup/legacy-client-cleanup.js';
|
|
19
|
+
import { loadBundledStandardSkillFiles, renderStandardSkillFile, } from '../setup/standard-skills.js';
|
|
20
|
+
import { listRegisteredProjectLocations, refreshRegisteredProjectAgentFiles, } from '../setup/project-agent-refresh.js';
|
|
21
|
+
import { findMissingRepositoryLocations, removeMissingRepositoryLocations, } from '../repository/binding.js';
|
|
22
|
+
import { renderEnnoStopHook, renderOpenCodeEnnoPlugin, } from '../setup/enno-client-config.js';
|
|
23
|
+
export const SETUP_CLIENTS = ['codex', 'opencode', 'claude', 'hermes'];
|
|
24
|
+
function setupPathJoin(options, ...segments) {
|
|
25
|
+
const platform = options.platform ?? process.platform;
|
|
26
|
+
return platform === 'win32' ? path.win32.join(...segments) : path.posix.join(...segments);
|
|
27
|
+
}
|
|
28
|
+
export function parseSetupClients(value) {
|
|
29
|
+
const clients = [...new Set(value.split(',').map((client) => client.trim()).filter(Boolean))];
|
|
30
|
+
if (clients.length === 0 || clients.some((client) => !SETUP_CLIENTS.includes(client))) {
|
|
31
|
+
throw new KiokukoError('VALIDATION_ERROR', `clients must be a comma-separated subset of: ${SETUP_CLIENTS.join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
return clients;
|
|
34
|
+
}
|
|
35
|
+
export function parseSetupSkillDiscoveryMode(value) {
|
|
36
|
+
if (!isSkillDiscoveryMode(value)) {
|
|
37
|
+
throw new KiokukoError('VALIDATION_ERROR', 'skill discovery must be off, official, or community');
|
|
38
|
+
}
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
export function parseEnnoSetupMode(value) {
|
|
42
|
+
if (value !== 'on' && value !== 'off') {
|
|
43
|
+
throw new KiokukoError('VALIDATION_ERROR', 'enno-oduno must be on or off');
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
function setupClientLabel(client) {
|
|
48
|
+
if (client === 'codex')
|
|
49
|
+
return 'Codex';
|
|
50
|
+
if (client === 'opencode')
|
|
51
|
+
return 'OpenCode';
|
|
52
|
+
if (client === 'claude')
|
|
53
|
+
return 'Claude Code';
|
|
54
|
+
return 'Hermes Agent';
|
|
55
|
+
}
|
|
56
|
+
async function askSetupClients(prompt, output, detected) {
|
|
57
|
+
const defaultSelection = detected.length === 0 ? 'none' : detected.join(',');
|
|
58
|
+
output.write('Select clients to configure (detected clients are preselected):\n');
|
|
59
|
+
for (const [index, client] of SETUP_CLIENTS.entries()) {
|
|
60
|
+
const checked = detected.includes(client) ? 'x' : ' ';
|
|
61
|
+
const status = detected.includes(client) ? 'detected' : 'not detected';
|
|
62
|
+
output.write(` ${index + 1}. [${checked}] ${setupClientLabel(client)} (${status})\n`);
|
|
63
|
+
}
|
|
64
|
+
output.write('Enter client names or numbers separated by commas. Press Enter to accept the checked clients; type none to skip all.\n');
|
|
65
|
+
while (true) {
|
|
66
|
+
const answer = (await prompt.question(`Clients [${defaultSelection}]: `)).trim();
|
|
67
|
+
if (answer.length === 0)
|
|
68
|
+
return detected;
|
|
69
|
+
if (/^(?:none|なし)$/iu.test(answer))
|
|
70
|
+
return [];
|
|
71
|
+
const selected = [];
|
|
72
|
+
let invalid = false;
|
|
73
|
+
for (const token of answer.split(',').map((value) => value.trim()).filter(Boolean)) {
|
|
74
|
+
const index = Number(token);
|
|
75
|
+
const indexedClient = Number.isInteger(index) && index >= 1 && index <= SETUP_CLIENTS.length
|
|
76
|
+
? SETUP_CLIENTS[index - 1]
|
|
77
|
+
: undefined;
|
|
78
|
+
const client = indexedClient ?? token.toLowerCase();
|
|
79
|
+
if (!SETUP_CLIENTS.includes(client)) {
|
|
80
|
+
invalid = true;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
selected.push(client);
|
|
84
|
+
}
|
|
85
|
+
if (!invalid)
|
|
86
|
+
return [...new Set(selected)];
|
|
87
|
+
output.write(`Invalid selection. Choose names or numbers for: ${SETUP_CLIENTS.join(', ')}.\n`);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
async function askCommunitySkillDiscovery(prompt, output) {
|
|
91
|
+
output.write('Official external Skill discovery is enabled by default and uses validated content only as untrusted references. It never installs or executes Skills.\n');
|
|
92
|
+
output.write('Community discovery can also use audited community Skills as untrusted references when relevant.\n');
|
|
93
|
+
const answer = (await prompt.question('Enable community Skill discovery? [y/N] ')).trim();
|
|
94
|
+
return /^(?:y|yes|はい)$/iu.test(answer) ? 'community' : 'official';
|
|
95
|
+
}
|
|
96
|
+
async function askReplaceConflictingMcp(prompt, output, client) {
|
|
97
|
+
const label = setupClientLabel(client);
|
|
98
|
+
output.write(`${label} already has a non-canonical or unmanaged Kiokuko MCP identity.\n`);
|
|
99
|
+
output.write('Kiokuko can remove that identity, install the managed configuration, and continue setup.\n');
|
|
100
|
+
const answer = (await prompt.question(`Replace the existing ${label} Kiokuko MCP identity and continue? [Y/n] `)).trim();
|
|
101
|
+
return answer.length === 0 || /^(?:y|yes|はい)$/iu.test(answer);
|
|
102
|
+
}
|
|
103
|
+
/** Ask which supported clients should receive configuration in an interactive terminal. */
|
|
104
|
+
export async function promptSetupClients(detected, options = {}) {
|
|
105
|
+
const input = options.input ?? stdin;
|
|
106
|
+
const output = options.output ?? stdout;
|
|
107
|
+
const prompt = createInterface({ input, output });
|
|
108
|
+
try {
|
|
109
|
+
return await askSetupClients(prompt, output, detected);
|
|
110
|
+
}
|
|
111
|
+
finally {
|
|
112
|
+
prompt.close();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/** Ask whether audited community Skill discovery should be enabled. */
|
|
116
|
+
export async function promptCommunitySkillDiscovery(options = {}) {
|
|
117
|
+
const input = options.input ?? stdin;
|
|
118
|
+
const output = options.output ?? stdout;
|
|
119
|
+
const prompt = createInterface({ input, output });
|
|
120
|
+
try {
|
|
121
|
+
return await askCommunitySkillDiscovery(prompt, output);
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
prompt.close();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/** Ask before replacing a client Kiokuko MCP identity that setup does not own. */
|
|
128
|
+
export async function promptReplaceConflictingMcp(client, options = {}) {
|
|
129
|
+
const input = options.input ?? stdin;
|
|
130
|
+
const output = options.output ?? stdout;
|
|
131
|
+
const prompt = createInterface({ input, output });
|
|
132
|
+
try {
|
|
133
|
+
return await askReplaceConflictingMcp(prompt, output, client);
|
|
134
|
+
}
|
|
135
|
+
finally {
|
|
136
|
+
prompt.close();
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/** Run the shared client-selection, conflict-confirmation, and setup flow. */
|
|
140
|
+
export async function runSetupFlow(options = {}, dependencyOverrides = {}) {
|
|
141
|
+
const pathEnvironment = options.environment ?? {};
|
|
142
|
+
const setupProcessEnvironment = pathEnvironment.env ?? process.env;
|
|
143
|
+
const requestedSkillDiscoveryMode = options.skillDiscoveryMode
|
|
144
|
+
?? (Object.prototype.hasOwnProperty.call(setupProcessEnvironment, SKILL_DISCOVERY_ENV)
|
|
145
|
+
? normalizeSkillDiscoveryMode(setupProcessEnvironment[SKILL_DISCOVERY_ENV])
|
|
146
|
+
: undefined);
|
|
147
|
+
const detectedClients = options.clients === undefined
|
|
148
|
+
? await detectInstalledClients(pathEnvironment)
|
|
149
|
+
: [];
|
|
150
|
+
const input = options.input ?? stdin;
|
|
151
|
+
const output = options.output ?? stdout;
|
|
152
|
+
const interactive = options.json !== true
|
|
153
|
+
&& input.isTTY === true
|
|
154
|
+
&& output.isTTY === true;
|
|
155
|
+
let clients;
|
|
156
|
+
let skillDiscoveryMode = requestedSkillDiscoveryMode;
|
|
157
|
+
if (interactive && options.clients === undefined && requestedSkillDiscoveryMode === undefined) {
|
|
158
|
+
const prompted = await promptSetupConfiguration(detectedClients, { input, output });
|
|
159
|
+
clients = prompted.clients;
|
|
160
|
+
skillDiscoveryMode = prompted.skillDiscoveryMode;
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
clients = options.clients ?? (interactive
|
|
164
|
+
? await promptSetupClients(detectedClients, { input, output })
|
|
165
|
+
: detectedClients);
|
|
166
|
+
if (interactive && clients.length > 0 && skillDiscoveryMode === undefined) {
|
|
167
|
+
skillDiscoveryMode = await promptCommunitySkillDiscovery({ input, output });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const setupOptions = {
|
|
171
|
+
...pathEnvironment,
|
|
172
|
+
clients,
|
|
173
|
+
command: options.command ?? 'kiokuko',
|
|
174
|
+
dryRun: options.dryRun === true,
|
|
175
|
+
standardSkills: options.standardSkills ?? true,
|
|
176
|
+
...(skillDiscoveryMode === undefined ? {} : { skillDiscoveryMode }),
|
|
177
|
+
...(options.ennoOduno === undefined ? {} : { ennoOduno: options.ennoOduno }),
|
|
178
|
+
};
|
|
179
|
+
const runSetup = dependencyOverrides.setupGlobalClients
|
|
180
|
+
?? setupGlobalClients;
|
|
181
|
+
const replacementClients = new Set();
|
|
182
|
+
for (;;) {
|
|
183
|
+
try {
|
|
184
|
+
return await runSetup({
|
|
185
|
+
...setupOptions,
|
|
186
|
+
replaceConflictingMcpServers: [...replacementClients],
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
const conflictClient = setupMcpIdentityConflictClient(error);
|
|
191
|
+
if (!interactive
|
|
192
|
+
|| conflictClient === undefined
|
|
193
|
+
|| !clients.includes(conflictClient)
|
|
194
|
+
|| replacementClients.has(conflictClient))
|
|
195
|
+
throw error;
|
|
196
|
+
const replace = await promptReplaceConflictingMcp(conflictClient, { input, output });
|
|
197
|
+
if (!replace)
|
|
198
|
+
throw error;
|
|
199
|
+
replacementClients.add(conflictClient);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
function replacementClientSet(value) {
|
|
204
|
+
if (value === undefined)
|
|
205
|
+
return new Set();
|
|
206
|
+
if (!Array.isArray(value)
|
|
207
|
+
|| value.some((client) => !SETUP_CLIENTS.includes(client))
|
|
208
|
+
|| new Set(value).size !== value.length) {
|
|
209
|
+
throw new KiokukoError('VALIDATION_ERROR', `replaceConflictingMcpServers must be a unique subset of: ${SETUP_CLIENTS.join(', ')}`);
|
|
210
|
+
}
|
|
211
|
+
return new Set(value);
|
|
212
|
+
}
|
|
213
|
+
function wasManagedBeforeSetup(original, replacementAuthorized, isCanonical) {
|
|
214
|
+
if (original === undefined)
|
|
215
|
+
return false;
|
|
216
|
+
if (replacementAuthorized)
|
|
217
|
+
return true;
|
|
218
|
+
return isCanonical(original);
|
|
219
|
+
}
|
|
220
|
+
/** Ask both setup questions through one readline session so buffered input remains intact. */
|
|
221
|
+
export async function promptSetupConfiguration(detected, options = {}) {
|
|
222
|
+
const input = options.input ?? stdin;
|
|
223
|
+
const output = options.output ?? stdout;
|
|
224
|
+
const prompt = createInterface({ input, output });
|
|
225
|
+
try {
|
|
226
|
+
const clients = await askSetupClients(prompt, output, detected);
|
|
227
|
+
const skillDiscoveryMode = clients.length === 0
|
|
228
|
+
? 'official'
|
|
229
|
+
: await askCommunitySkillDiscovery(prompt, output);
|
|
230
|
+
return { clients, skillDiscoveryMode };
|
|
231
|
+
}
|
|
232
|
+
finally {
|
|
233
|
+
prompt.close();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
function sameFileIdentity(left, right) {
|
|
237
|
+
return left.device === right.device && left.inode === right.inode;
|
|
238
|
+
}
|
|
239
|
+
function setupDirectoryChanged(directoryPath) {
|
|
240
|
+
return new KiokukoError('CONFLICT', 'Setup directory changed after planning', { target: directoryPath });
|
|
241
|
+
}
|
|
242
|
+
function plannedDirectoryIdentity(directory) {
|
|
243
|
+
return directory.original ?? directory.created;
|
|
244
|
+
}
|
|
245
|
+
function directoryLineage(directory) {
|
|
246
|
+
const lineage = [];
|
|
247
|
+
let current = directory;
|
|
248
|
+
while (current !== undefined) {
|
|
249
|
+
lineage.push(current);
|
|
250
|
+
current = current.parent;
|
|
251
|
+
}
|
|
252
|
+
return lineage.reverse();
|
|
253
|
+
}
|
|
254
|
+
async function assertPlannedDirectory(directory) {
|
|
255
|
+
for (const planned of directoryLineage(directory)) {
|
|
256
|
+
const current = await readDirectoryIdentity(planned.path);
|
|
257
|
+
const expected = plannedDirectoryIdentity(planned);
|
|
258
|
+
if ((current === undefined) !== (expected === undefined)
|
|
259
|
+
|| (current !== undefined && expected !== undefined && !sameFileIdentity(current, expected))) {
|
|
260
|
+
throw setupDirectoryChanged(planned.path);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
async function planDirectory(planning, directoryPath) {
|
|
265
|
+
const resolved = path.resolve(directoryPath);
|
|
266
|
+
const existing = planning.directories.get(resolved);
|
|
267
|
+
if (existing !== undefined)
|
|
268
|
+
return existing;
|
|
269
|
+
const original = await readDirectoryIdentity(resolved);
|
|
270
|
+
const parentPath = path.dirname(resolved);
|
|
271
|
+
const parent = original !== undefined || parentPath === resolved
|
|
272
|
+
? undefined
|
|
273
|
+
: await planDirectory(planning, parentPath);
|
|
274
|
+
const planned = {
|
|
275
|
+
path: resolved,
|
|
276
|
+
parent,
|
|
277
|
+
original,
|
|
278
|
+
created: undefined,
|
|
279
|
+
};
|
|
280
|
+
planning.directories.set(resolved, planned);
|
|
281
|
+
return planned;
|
|
282
|
+
}
|
|
283
|
+
async function readPlannedRegularFile(planning, filePath) {
|
|
284
|
+
const parentDirectory = await planDirectory(planning, path.dirname(filePath));
|
|
285
|
+
await assertPlannedDirectory(parentDirectory);
|
|
286
|
+
const snapshot = await readRegularFile(filePath);
|
|
287
|
+
await assertPlannedDirectory(parentDirectory);
|
|
288
|
+
return { parentDirectory, snapshot };
|
|
289
|
+
}
|
|
290
|
+
function errno(error) {
|
|
291
|
+
return error instanceof Error && 'code' in error
|
|
292
|
+
? String(error.code)
|
|
293
|
+
: undefined;
|
|
294
|
+
}
|
|
295
|
+
async function preparePlannedDirectories(files, createdDirectories) {
|
|
296
|
+
const required = new Set();
|
|
297
|
+
for (const file of files) {
|
|
298
|
+
if (file.action === 'unchanged')
|
|
299
|
+
continue;
|
|
300
|
+
for (const directory of directoryLineage(file.parentDirectory))
|
|
301
|
+
required.add(directory);
|
|
302
|
+
}
|
|
303
|
+
const ordered = [...required].sort((left, right) => directoryLineage(left).length - directoryLineage(right).length);
|
|
304
|
+
for (const directory of ordered) {
|
|
305
|
+
const expected = plannedDirectoryIdentity(directory);
|
|
306
|
+
if (expected !== undefined) {
|
|
307
|
+
await assertPlannedDirectory(directory);
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
if (directory.parent === undefined) {
|
|
311
|
+
throw new KiokukoError('INTEGRITY_ERROR', 'Setup cannot create a missing filesystem root');
|
|
312
|
+
}
|
|
313
|
+
await assertPlannedDirectory(directory.parent);
|
|
314
|
+
if (await readDirectoryIdentity(directory.path) !== undefined) {
|
|
315
|
+
throw setupDirectoryChanged(directory.path);
|
|
316
|
+
}
|
|
317
|
+
try {
|
|
318
|
+
await mkdir(directory.path, { mode: 0o700 });
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
if (errno(error) === 'EEXIST')
|
|
322
|
+
throw setupDirectoryChanged(directory.path);
|
|
323
|
+
throw error;
|
|
324
|
+
}
|
|
325
|
+
const created = await readDirectoryIdentity(directory.path);
|
|
326
|
+
if (created === undefined) {
|
|
327
|
+
throw new KiokukoError('INTEGRITY_ERROR', 'Setup directory disappeared immediately after creation', {
|
|
328
|
+
target: directory.path,
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
directory.created = created;
|
|
332
|
+
createdDirectories.push(directory);
|
|
333
|
+
await assertPlannedDirectory(directory);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
async function removeCreatedDirectories(createdDirectories) {
|
|
337
|
+
const failures = [];
|
|
338
|
+
for (const directory of [...createdDirectories].reverse()) {
|
|
339
|
+
try {
|
|
340
|
+
await assertPlannedDirectory(directory);
|
|
341
|
+
await rmdir(directory.path);
|
|
342
|
+
if (await readDirectoryIdentity(directory.path) !== undefined) {
|
|
343
|
+
throw setupDirectoryChanged(directory.path);
|
|
344
|
+
}
|
|
345
|
+
directory.created = undefined;
|
|
346
|
+
if (directory.parent !== undefined)
|
|
347
|
+
await assertPlannedDirectory(directory.parent);
|
|
348
|
+
}
|
|
349
|
+
catch (error) {
|
|
350
|
+
failures.push(error);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return failures;
|
|
354
|
+
}
|
|
355
|
+
async function planFile(planning, filePath, client, purpose, render, mustRemainAbsent = []) {
|
|
356
|
+
const { parentDirectory, snapshot: original } = await readPlannedRegularFile(planning, filePath);
|
|
357
|
+
const rendered = render(original?.content);
|
|
358
|
+
const action = original === undefined
|
|
359
|
+
? 'created'
|
|
360
|
+
: rendered.content === original.content ? 'unchanged' : 'updated';
|
|
361
|
+
return {
|
|
362
|
+
path: filePath,
|
|
363
|
+
parentDirectory,
|
|
364
|
+
content: rendered.content,
|
|
365
|
+
mode: original?.mode ?? 0o600,
|
|
366
|
+
original,
|
|
367
|
+
...(mustRemainAbsent.length === 0 ? {} : { mustRemainAbsent }),
|
|
368
|
+
action,
|
|
369
|
+
purpose,
|
|
370
|
+
client,
|
|
371
|
+
report: true,
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
async function planOptionalFile(planning, filePath, client, purpose, render) {
|
|
375
|
+
const { parentDirectory, snapshot: original } = await readPlannedRegularFile(planning, filePath);
|
|
376
|
+
const rendered = render(original?.content);
|
|
377
|
+
const action = original === undefined
|
|
378
|
+
? rendered.content === undefined ? 'unchanged' : 'created'
|
|
379
|
+
: rendered.content === undefined ? 'deleted'
|
|
380
|
+
: rendered.content === original.content ? 'unchanged' : 'updated';
|
|
381
|
+
return {
|
|
382
|
+
path: filePath,
|
|
383
|
+
parentDirectory,
|
|
384
|
+
content: rendered.content,
|
|
385
|
+
mode: original?.mode ?? 0o600,
|
|
386
|
+
original,
|
|
387
|
+
action,
|
|
388
|
+
purpose,
|
|
389
|
+
client,
|
|
390
|
+
report: action !== 'unchanged',
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
async function planClaudeEnnoHooks(planning, options, command, mode) {
|
|
394
|
+
const filePath = getLegacyClaudePromptHookSettingsPath(options);
|
|
395
|
+
const { parentDirectory, snapshot: original } = await readPlannedRegularFile(planning, filePath);
|
|
396
|
+
const cleaned = original === undefined ? undefined : cleanupLegacyClaudePromptHook(original.content);
|
|
397
|
+
const rendered = mode === undefined
|
|
398
|
+
? { content: cleaned, action: cleaned === original?.content ? 'unchanged' : 'updated' }
|
|
399
|
+
: renderEnnoStopHook(cleaned, 'claude', command, mode);
|
|
400
|
+
const action = original === undefined
|
|
401
|
+
? rendered.content === undefined ? 'unchanged' : 'created'
|
|
402
|
+
: rendered.content === undefined ? 'deleted'
|
|
403
|
+
: rendered.content === original.content ? 'unchanged' : 'updated';
|
|
404
|
+
return {
|
|
405
|
+
path: filePath,
|
|
406
|
+
parentDirectory,
|
|
407
|
+
content: rendered.content,
|
|
408
|
+
mode: original?.mode ?? 0o600,
|
|
409
|
+
original,
|
|
410
|
+
action,
|
|
411
|
+
purpose: mode === undefined ? 'legacy-cleanup' : 'enno-hook',
|
|
412
|
+
client: 'claude',
|
|
413
|
+
report: action !== 'unchanged',
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
async function planLegacyOpenCodeGuardCleanup(planning, options) {
|
|
417
|
+
const filePath = getLegacyOpenCodeLoopGuardPath(options);
|
|
418
|
+
const { parentDirectory, snapshot: original } = await readPlannedRegularFile(planning, filePath);
|
|
419
|
+
if (original !== undefined)
|
|
420
|
+
assertExactLegacyOpenCodeLoopGuard(original.content);
|
|
421
|
+
return {
|
|
422
|
+
path: filePath,
|
|
423
|
+
parentDirectory,
|
|
424
|
+
content: undefined,
|
|
425
|
+
mode: original?.mode ?? 0o600,
|
|
426
|
+
original,
|
|
427
|
+
action: original === undefined ? 'unchanged' : 'deleted',
|
|
428
|
+
purpose: 'legacy-cleanup',
|
|
429
|
+
client: 'opencode',
|
|
430
|
+
report: original !== undefined,
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
async function openCodeConfigPath(planning, options) {
|
|
434
|
+
const directory = getOpenCodeConfigDirectory(options);
|
|
435
|
+
const jsonc = setupPathJoin(options, directory, 'opencode.jsonc');
|
|
436
|
+
if ((await readPlannedRegularFile(planning, jsonc)).snapshot !== undefined) {
|
|
437
|
+
return { path: jsonc, mustRemainAbsent: [] };
|
|
438
|
+
}
|
|
439
|
+
return { path: setupPathJoin(options, directory, 'opencode.json'), mustRemainAbsent: [jsonc] };
|
|
440
|
+
}
|
|
441
|
+
async function restoreFiles(mutations, dependencies) {
|
|
442
|
+
const failures = [];
|
|
443
|
+
for (const mutation of [...mutations].reverse()) {
|
|
444
|
+
const { file, installed } = mutation;
|
|
445
|
+
try {
|
|
446
|
+
if (file.original === undefined) {
|
|
447
|
+
if (installed === undefined)
|
|
448
|
+
throw new KiokukoError('INTEGRITY_ERROR', 'Setup rollback record is invalid');
|
|
449
|
+
const outcome = await dependencies.unlinkRegularFileIfUnchanged(file.path, fileExpectation(file, installed, false));
|
|
450
|
+
assertAtomicCleanupComplete(outcome);
|
|
451
|
+
}
|
|
452
|
+
else {
|
|
453
|
+
const outcome = await dependencies.atomicWriteTextIfUnchanged(file.path, file.original.content, fileExpectation(file, installed, false), file.original.mode);
|
|
454
|
+
assertAtomicCleanupComplete(outcome);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
catch (error) {
|
|
458
|
+
failures.push(error);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
return failures;
|
|
462
|
+
}
|
|
463
|
+
function setupNextStep(clients, standardSkills, files) {
|
|
464
|
+
const codexHookNeedsTrust = files.some((file) => (file.client === 'codex'
|
|
465
|
+
&& file.purpose === 'enno-hook'
|
|
466
|
+
&& (file.action === 'created' || file.action === 'updated')
|
|
467
|
+
&& file.content?.includes('enno hook --client codex') === true));
|
|
468
|
+
return clients.map((client) => {
|
|
469
|
+
if (client === 'hermes') {
|
|
470
|
+
return standardSkills
|
|
471
|
+
? 'Restart Hermes Agent, or use /reload-mcp and start a new session, so it reloads its profile-scoped MCP configuration and standard skills.'
|
|
472
|
+
: 'Restart Hermes Agent or use /reload-mcp to reload its profile-scoped MCP configuration.';
|
|
473
|
+
}
|
|
474
|
+
const label = client === 'codex' ? 'Codex' : client === 'opencode' ? 'OpenCode' : 'Claude Code';
|
|
475
|
+
const reload = `Restart ${label} so it reloads global MCP and instruction configuration${standardSkills ? ' and standard skills' : ''}.`;
|
|
476
|
+
return client === 'codex' && codexHookNeedsTrust
|
|
477
|
+
? `${reload} Then run /hooks in Codex and trust the new Kiokuko Stop hook.`
|
|
478
|
+
: reload;
|
|
479
|
+
}).join(' ');
|
|
480
|
+
}
|
|
481
|
+
async function standardSkillDirectory(client, options, hermesProfile) {
|
|
482
|
+
if (client === 'codex')
|
|
483
|
+
return getCodexSkillsDirectory(options);
|
|
484
|
+
if (client === 'opencode')
|
|
485
|
+
return getOpenCodeSkillsDirectory(options);
|
|
486
|
+
if (client === 'claude')
|
|
487
|
+
return getClaudeSkillsDirectory(options);
|
|
488
|
+
if (hermesProfile === undefined)
|
|
489
|
+
throw new KiokukoError('INTEGRITY_ERROR', 'Hermes profile was not bound during setup planning');
|
|
490
|
+
return hermesProfile.skillsDirectory;
|
|
491
|
+
}
|
|
492
|
+
function fileExpectation(file, expected, includeAlternatePaths = true) {
|
|
493
|
+
const expectedParentDirectory = plannedDirectoryIdentity(file.parentDirectory);
|
|
494
|
+
if (expectedParentDirectory === undefined) {
|
|
495
|
+
throw new KiokukoError('INTEGRITY_ERROR', 'Setup file parent was not created or bound before mutation', {
|
|
496
|
+
target: file.parentDirectory.path,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
return {
|
|
500
|
+
expected,
|
|
501
|
+
expectedParentDirectory,
|
|
502
|
+
...(includeAlternatePaths && file.mustRemainAbsent !== undefined
|
|
503
|
+
? { mustRemainAbsent: file.mustRemainAbsent }
|
|
504
|
+
: {}),
|
|
505
|
+
};
|
|
506
|
+
}
|
|
507
|
+
async function assertPlannedFile(file, expected) {
|
|
508
|
+
await assertPlannedDirectory(file.parentDirectory);
|
|
509
|
+
if (plannedDirectoryIdentity(file.parentDirectory) === undefined) {
|
|
510
|
+
if (expected !== undefined || await readRegularFile(file.path) !== undefined) {
|
|
511
|
+
throw setupDirectoryChanged(file.parentDirectory.path);
|
|
512
|
+
}
|
|
513
|
+
for (const absentPath of file.mustRemainAbsent ?? []) {
|
|
514
|
+
if (await readRegularFile(absentPath) !== undefined) {
|
|
515
|
+
throw new KiokukoError('CONFLICT', 'Setup target changed after planning', { target: absentPath });
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
await assertFileExpectation(file.path, fileExpectation(file, expected));
|
|
521
|
+
}
|
|
522
|
+
await assertPlannedDirectory(file.parentDirectory);
|
|
523
|
+
}
|
|
524
|
+
async function assertPlannedFiles(files, applied = []) {
|
|
525
|
+
const installedByPath = new Map(applied.map((mutation) => [mutation.file.path, mutation.installed]));
|
|
526
|
+
for (const file of files) {
|
|
527
|
+
const expected = installedByPath.has(file.path) ? installedByPath.get(file.path) : file.original;
|
|
528
|
+
await assertPlannedFile(file, expected);
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
function setupFilesystemErrorCode(error) {
|
|
532
|
+
if ((typeof error !== 'object' && typeof error !== 'function') || error === null)
|
|
533
|
+
return undefined;
|
|
534
|
+
const descriptor = Object.getOwnPropertyDescriptor(error, 'code');
|
|
535
|
+
return descriptor !== undefined && 'value' in descriptor && typeof descriptor.value === 'string'
|
|
536
|
+
? descriptor.value
|
|
537
|
+
: undefined;
|
|
538
|
+
}
|
|
539
|
+
function readDryRunProjectLocations(databasePath, openDatabase, allowUnavailableRegistry) {
|
|
540
|
+
let identity;
|
|
541
|
+
try {
|
|
542
|
+
identity = databaseFileIdentity(databasePath);
|
|
543
|
+
}
|
|
544
|
+
catch (error) {
|
|
545
|
+
const code = setupFilesystemErrorCode(error);
|
|
546
|
+
if (code === 'ENOENT' || code === 'ENOTDIR')
|
|
547
|
+
return [];
|
|
548
|
+
throw error;
|
|
549
|
+
}
|
|
550
|
+
const database = openDatabase(databasePath, { readOnly: true, expectedFileIdentity: identity });
|
|
551
|
+
let locations;
|
|
552
|
+
let readFailed = false;
|
|
553
|
+
let readError;
|
|
554
|
+
try {
|
|
555
|
+
locations = listRegisteredProjectLocations(database, { allowUnavailableRegistry });
|
|
556
|
+
}
|
|
557
|
+
catch (error) {
|
|
558
|
+
readFailed = true;
|
|
559
|
+
readError = error;
|
|
560
|
+
}
|
|
561
|
+
try {
|
|
562
|
+
database.close();
|
|
563
|
+
}
|
|
564
|
+
catch (closeError) {
|
|
565
|
+
if (readFailed) {
|
|
566
|
+
throw new AggregateError([readError, closeError], 'Registered project discovery failed and closing the database connection also failed');
|
|
567
|
+
}
|
|
568
|
+
throw closeError;
|
|
569
|
+
}
|
|
570
|
+
if (readFailed)
|
|
571
|
+
throw readError;
|
|
572
|
+
if (locations === undefined) {
|
|
573
|
+
throw new KiokukoError('INTEGRITY_ERROR', 'Registered project discovery produced no result');
|
|
574
|
+
}
|
|
575
|
+
return locations;
|
|
576
|
+
}
|
|
577
|
+
export async function setupGlobalClients(options = {}, dependencyOverrides = {}) {
|
|
578
|
+
const dependencies = {
|
|
579
|
+
atomicWriteTextIfUnchanged: dependencyOverrides.atomicWriteTextIfUnchanged ?? atomicWriteTextIfUnchanged,
|
|
580
|
+
unlinkRegularFileIfUnchanged: dependencyOverrides.unlinkRegularFileIfUnchanged ?? unlinkRegularFileIfUnchanged,
|
|
581
|
+
beforeCommit: dependencyOverrides.beforeCommit ?? (() => undefined),
|
|
582
|
+
openConnection: dependencyOverrides.openConnection ?? openConnection,
|
|
583
|
+
ensureGlobalWorkspace: dependencyOverrides.ensureGlobalWorkspace ?? ensureGlobalWorkspace,
|
|
584
|
+
refreshRegisteredProjectAgentFiles: dependencyOverrides.refreshRegisteredProjectAgentFiles
|
|
585
|
+
?? refreshRegisteredProjectAgentFiles,
|
|
586
|
+
};
|
|
587
|
+
const pathEnvironment = {
|
|
588
|
+
...(options.platform === undefined ? {} : { platform: options.platform }),
|
|
589
|
+
...(options.env === undefined ? {} : { env: options.env }),
|
|
590
|
+
};
|
|
591
|
+
if (options.skillDiscoveryMode !== undefined && !isSkillDiscoveryMode(options.skillDiscoveryMode)) {
|
|
592
|
+
throw new KiokukoError('VALIDATION_ERROR', 'skill discovery must be off, official, or community');
|
|
593
|
+
}
|
|
594
|
+
if (options.ennoOduno !== undefined && options.ennoOduno !== 'on' && options.ennoOduno !== 'off') {
|
|
595
|
+
throw new KiokukoError('VALIDATION_ERROR', 'ennoOduno must be on or off');
|
|
596
|
+
}
|
|
597
|
+
const replaceConflictingMcpServers = replacementClientSet(options.replaceConflictingMcpServers);
|
|
598
|
+
const clients = options.clients ?? await detectInstalledClients(pathEnvironment);
|
|
599
|
+
if (!Array.isArray(clients) || clients.some((client) => !SETUP_CLIENTS.includes(client))) {
|
|
600
|
+
throw new KiokukoError('VALIDATION_ERROR', `clients must be a subset of: ${SETUP_CLIENTS.join(', ')}`);
|
|
601
|
+
}
|
|
602
|
+
const command = options.command ?? 'kiokuko';
|
|
603
|
+
if (typeof command !== 'string' || command.trim().length === 0 || command.includes('\0')) {
|
|
604
|
+
throw new KiokukoError('VALIDATION_ERROR', 'command must be a non-empty executable path or name');
|
|
605
|
+
}
|
|
606
|
+
const databasePath = options.databasePath ?? getGlobalDatabasePath(pathEnvironment);
|
|
607
|
+
const standardSkills = options.standardSkills ?? true;
|
|
608
|
+
const environment = options.env ?? process.env;
|
|
609
|
+
const environmentSkillDiscoveryMode = options.skillDiscoveryMode === undefined
|
|
610
|
+
&& Object.prototype.hasOwnProperty.call(environment, SKILL_DISCOVERY_ENV)
|
|
611
|
+
? normalizeSkillDiscoveryMode(environment[SKILL_DISCOVERY_ENV])
|
|
612
|
+
: undefined;
|
|
613
|
+
const skillDiscoveryMode = options.skillDiscoveryMode ?? environmentSkillDiscoveryMode;
|
|
614
|
+
const files = [];
|
|
615
|
+
const planning = { directories: new Map() };
|
|
616
|
+
const hermesProfile = clients.includes('hermes')
|
|
617
|
+
? await resolveHermesProfilePaths(pathEnvironment)
|
|
618
|
+
: undefined;
|
|
619
|
+
if (clients.includes('codex')) {
|
|
620
|
+
const mcpFile = await planFile(planning, getCodexConfigPath(pathEnvironment), 'codex', 'mcp-config', (existing) => renderCodexMcpConfig(existing ?? '', command, skillDiscoveryMode, { replaceConflictingIdentity: replaceConflictingMcpServers.has('codex') }));
|
|
621
|
+
files.push(mcpFile);
|
|
622
|
+
const ennoMode = options.ennoOduno
|
|
623
|
+
?? (wasManagedBeforeSetup(mcpFile.original?.content, replaceConflictingMcpServers.has('codex'), hasCanonicalCodexMcpConfig) ? undefined : 'on');
|
|
624
|
+
if (ennoMode !== undefined) {
|
|
625
|
+
files.push(await planOptionalFile(planning, getCodexHooksPath(pathEnvironment), 'codex', 'enno-hook', (existing) => renderEnnoStopHook(existing, 'codex', command, ennoMode)));
|
|
626
|
+
}
|
|
627
|
+
files.push(await planFile(planning, getCodexInstructionsPath(pathEnvironment), 'codex', 'instructions', (existing) => renderGlobalInstructions(existing ?? '')));
|
|
628
|
+
}
|
|
629
|
+
if (clients.includes('opencode')) {
|
|
630
|
+
const selectedConfig = await openCodeConfigPath(planning, pathEnvironment);
|
|
631
|
+
const mcpFile = await planFile(planning, selectedConfig.path, 'opencode', 'mcp-config', (existing) => renderOpenCodeConfig(existing, command, skillDiscoveryMode, { replaceConflictingIdentity: replaceConflictingMcpServers.has('opencode') }), selectedConfig.mustRemainAbsent);
|
|
632
|
+
files.push(mcpFile);
|
|
633
|
+
const ennoMode = options.ennoOduno
|
|
634
|
+
?? (wasManagedBeforeSetup(mcpFile.original?.content, replaceConflictingMcpServers.has('opencode'), hasCanonicalOpenCodeMcpConfig) ? undefined : 'on');
|
|
635
|
+
if (ennoMode !== undefined) {
|
|
636
|
+
files.push(await planOptionalFile(planning, getOpenCodeEnnoPluginPath(pathEnvironment), 'opencode', 'enno-hook', (existing) => renderOpenCodeEnnoPlugin(existing, command, ennoMode)));
|
|
637
|
+
}
|
|
638
|
+
files.push(await planFile(planning, getOpenCodeInstructionsPath(pathEnvironment), 'opencode', 'instructions', (existing) => renderGlobalInstructions(existing ?? '')));
|
|
639
|
+
files.push(await planLegacyOpenCodeGuardCleanup(planning, pathEnvironment));
|
|
640
|
+
}
|
|
641
|
+
if (clients.includes('claude')) {
|
|
642
|
+
const mcpFile = await planFile(planning, getClaudeMcpConfigPath(pathEnvironment), 'claude', 'mcp-config', (existing) => renderClaudeConfig(existing, command, skillDiscoveryMode, { replaceConflictingIdentity: replaceConflictingMcpServers.has('claude') }));
|
|
643
|
+
files.push(mcpFile);
|
|
644
|
+
const ennoMode = options.ennoOduno
|
|
645
|
+
?? (wasManagedBeforeSetup(mcpFile.original?.content, replaceConflictingMcpServers.has('claude'), hasCanonicalClaudeMcpConfig) ? undefined : 'on');
|
|
646
|
+
files.push(await planFile(planning, getClaudeInstructionsPath(pathEnvironment), 'claude', 'instructions', (existing) => renderGlobalInstructions(existing ?? '')));
|
|
647
|
+
files.push(await planClaudeEnnoHooks(planning, pathEnvironment, command, ennoMode));
|
|
648
|
+
}
|
|
649
|
+
if (clients.includes('hermes')) {
|
|
650
|
+
if (hermesProfile === undefined)
|
|
651
|
+
throw new KiokukoError('INTEGRITY_ERROR', 'Hermes profile was not bound during setup planning');
|
|
652
|
+
files.push(await planFile(planning, hermesProfile.configPath, 'hermes', 'mcp-config', (existing) => renderHermesConfig(existing, command, skillDiscoveryMode, { replaceConflictingIdentity: replaceConflictingMcpServers.has('hermes') })));
|
|
653
|
+
}
|
|
654
|
+
if (standardSkills) {
|
|
655
|
+
const bundledFiles = await loadBundledStandardSkillFiles();
|
|
656
|
+
for (const client of clients) {
|
|
657
|
+
const skillsDirectory = await standardSkillDirectory(client, pathEnvironment, hermesProfile);
|
|
658
|
+
for (const bundled of bundledFiles) {
|
|
659
|
+
const destinationPath = setupPathJoin(pathEnvironment, skillsDirectory, bundled.skillName, bundled.relativePath);
|
|
660
|
+
files.push(await planFile(planning, destinationPath, client, 'standard-skill', (existing) => renderStandardSkillFile(existing, bundled, destinationPath)));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
const result = {
|
|
665
|
+
clients,
|
|
666
|
+
databasePath,
|
|
667
|
+
databaseAction: options.dryRun ? 'planned' : 'initialized',
|
|
668
|
+
databaseBackupPath: null,
|
|
669
|
+
appliedMigrations: [],
|
|
670
|
+
recoveredEntries: 0,
|
|
671
|
+
files: files
|
|
672
|
+
.filter((file) => file.report)
|
|
673
|
+
.map(({ path: filePath, action, purpose, client }) => ({ path: filePath, action, purpose, client })),
|
|
674
|
+
projectAgentFiles: [],
|
|
675
|
+
standardSkills,
|
|
676
|
+
ennoOduno: options.ennoOduno ?? 'new-installs-only',
|
|
677
|
+
dryRun: options.dryRun ?? false,
|
|
678
|
+
nextStep: setupNextStep(clients, standardSkills, files),
|
|
679
|
+
};
|
|
680
|
+
if (options.dryRun) {
|
|
681
|
+
const registeredProjectLocations = readDryRunProjectLocations(databasePath, dependencies.openConnection, options.migrationsDirectory !== undefined);
|
|
682
|
+
result.projectAgentFiles = await dependencies.refreshRegisteredProjectAgentFiles(registeredProjectLocations, {
|
|
683
|
+
databasePath,
|
|
684
|
+
dryRun: true,
|
|
685
|
+
...(options.migrationsDirectory === undefined
|
|
686
|
+
? {}
|
|
687
|
+
: { migrationsDirectory: options.migrationsDirectory }),
|
|
688
|
+
});
|
|
689
|
+
return result;
|
|
690
|
+
}
|
|
691
|
+
const initialized = await initializeDatabase({
|
|
692
|
+
databasePath,
|
|
693
|
+
...(options.migrationsDirectory === undefined ? {} : { migrationsDirectory: options.migrationsDirectory }),
|
|
694
|
+
});
|
|
695
|
+
result.databaseBackupPath = initialized.backupPath;
|
|
696
|
+
result.appliedMigrations = initialized.applied;
|
|
697
|
+
result.recoveredEntries = initialized.recoveredEntries;
|
|
698
|
+
const database = dependencies.openConnection(databasePath);
|
|
699
|
+
let registeredProjectLocations = [];
|
|
700
|
+
let workspaceInitializationFailed = false;
|
|
701
|
+
let workspaceInitializationError;
|
|
702
|
+
try {
|
|
703
|
+
const missingProjectLocations = findMissingRepositoryLocations(database);
|
|
704
|
+
removeMissingRepositoryLocations(database, missingProjectLocations);
|
|
705
|
+
dependencies.ensureGlobalWorkspace(database);
|
|
706
|
+
registeredProjectLocations = listRegisteredProjectLocations(database, {
|
|
707
|
+
allowUnavailableRegistry: options.migrationsDirectory !== undefined,
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
catch (error) {
|
|
711
|
+
workspaceInitializationFailed = true;
|
|
712
|
+
workspaceInitializationError = error;
|
|
713
|
+
}
|
|
714
|
+
try {
|
|
715
|
+
database.close();
|
|
716
|
+
}
|
|
717
|
+
catch (closeError) {
|
|
718
|
+
if (workspaceInitializationFailed) {
|
|
719
|
+
throw new AggregateError([workspaceInitializationError, closeError], 'Global workspace initialization failed and closing the database connection also failed');
|
|
720
|
+
}
|
|
721
|
+
throw closeError;
|
|
722
|
+
}
|
|
723
|
+
if (workspaceInitializationFailed)
|
|
724
|
+
throw workspaceInitializationError;
|
|
725
|
+
const applied = [];
|
|
726
|
+
const createdDirectories = [];
|
|
727
|
+
try {
|
|
728
|
+
await dependencies.beforeCommit();
|
|
729
|
+
await preparePlannedDirectories(files, createdDirectories);
|
|
730
|
+
await assertPlannedFiles(files);
|
|
731
|
+
for (const file of files) {
|
|
732
|
+
if (file.action === 'unchanged')
|
|
733
|
+
continue;
|
|
734
|
+
// Record a committed mutation before inspecting its cleanup outcome so
|
|
735
|
+
// rollback never loses ownership of a target that already changed.
|
|
736
|
+
let installed;
|
|
737
|
+
if (file.action === 'deleted') {
|
|
738
|
+
if (file.original === undefined)
|
|
739
|
+
throw new KiokukoError('INTEGRITY_ERROR', 'Setup deletion plan is missing original content');
|
|
740
|
+
let outcome;
|
|
741
|
+
try {
|
|
742
|
+
outcome = await dependencies.unlinkRegularFileIfUnchanged(file.path, fileExpectation(file, file.original));
|
|
743
|
+
}
|
|
744
|
+
catch (error) {
|
|
745
|
+
if (error instanceof AtomicCommittedUnlinkError) {
|
|
746
|
+
applied.push({ file, installed: undefined });
|
|
747
|
+
}
|
|
748
|
+
throw error;
|
|
749
|
+
}
|
|
750
|
+
applied.push({ file, installed: undefined });
|
|
751
|
+
assertAtomicCleanupComplete(outcome);
|
|
752
|
+
}
|
|
753
|
+
else {
|
|
754
|
+
if (file.content === undefined)
|
|
755
|
+
throw new KiokukoError('INTEGRITY_ERROR', 'Setup file plan is missing rendered content');
|
|
756
|
+
let outcome;
|
|
757
|
+
try {
|
|
758
|
+
outcome = await dependencies.atomicWriteTextIfUnchanged(file.path, file.content, fileExpectation(file, file.original), file.mode);
|
|
759
|
+
}
|
|
760
|
+
catch (error) {
|
|
761
|
+
if (error instanceof AtomicCommittedMutationError) {
|
|
762
|
+
applied.push({ file, installed: error.outcome.installed });
|
|
763
|
+
}
|
|
764
|
+
else if (error instanceof AtomicCommittedUnlinkError) {
|
|
765
|
+
applied.push({ file, installed: undefined });
|
|
766
|
+
}
|
|
767
|
+
throw error;
|
|
768
|
+
}
|
|
769
|
+
installed = outcome.installed;
|
|
770
|
+
applied.push({ file, installed });
|
|
771
|
+
assertAtomicCleanupComplete(outcome);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
await assertPlannedFiles(files, applied);
|
|
775
|
+
}
|
|
776
|
+
catch (error) {
|
|
777
|
+
const restorationFailures = await restoreFiles(applied, dependencies);
|
|
778
|
+
const directoryRestorationFailures = await removeCreatedDirectories(createdDirectories);
|
|
779
|
+
const failures = [...restorationFailures, ...directoryRestorationFailures];
|
|
780
|
+
if (failures.length > 0) {
|
|
781
|
+
throw new AggregateError([error, ...failures], 'Setup failed and filesystem restoration also failed');
|
|
782
|
+
}
|
|
783
|
+
throw error;
|
|
784
|
+
}
|
|
785
|
+
result.projectAgentFiles = await dependencies.refreshRegisteredProjectAgentFiles(registeredProjectLocations, {
|
|
786
|
+
databasePath,
|
|
787
|
+
...(options.migrationsDirectory === undefined
|
|
788
|
+
? {}
|
|
789
|
+
: { migrationsDirectory: options.migrationsDirectory }),
|
|
790
|
+
});
|
|
791
|
+
return result;
|
|
792
|
+
}
|
|
793
|
+
//# sourceMappingURL=setup.js.map
|