comisai 1.0.34 → 1.0.37
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/node_modules/@comis/agent/dist/background/auto-background-middleware.d.ts +11 -1
- package/node_modules/@comis/agent/dist/background/auto-background-middleware.js +30 -4
- package/node_modules/@comis/agent/dist/background/background-task-manager.d.ts +22 -2
- package/node_modules/@comis/agent/dist/background/background-task-manager.js +88 -40
- package/node_modules/@comis/agent/dist/background/background-task-persistence.js +34 -4
- package/node_modules/@comis/agent/dist/background/background-task-types.d.ts +59 -3
- package/node_modules/@comis/agent/dist/background/background-task-types.js +1 -1
- package/node_modules/@comis/agent/dist/background/completion-dispatcher.d.ts +130 -0
- package/node_modules/@comis/agent/dist/background/completion-dispatcher.js +215 -0
- package/node_modules/@comis/agent/dist/background/completion-formatter.d.ts +39 -0
- package/node_modules/@comis/agent/dist/background/completion-formatter.js +77 -0
- package/node_modules/@comis/agent/dist/background/completion-runner.d.ts +62 -0
- package/node_modules/@comis/agent/dist/background/completion-runner.js +234 -0
- package/node_modules/@comis/agent/dist/background/index.d.ts +10 -1
- package/node_modules/@comis/agent/dist/background/index.js +4 -0
- package/node_modules/@comis/agent/dist/background/session-resolver.d.ts +85 -0
- package/node_modules/@comis/agent/dist/background/session-resolver.js +78 -0
- package/node_modules/@comis/agent/dist/bootstrap/sections/messaging-sections.js +1 -0
- package/node_modules/@comis/agent/dist/bootstrap/sections/tool-descriptions.js +3 -3
- package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.d.ts +30 -2
- package/node_modules/@comis/agent/dist/bootstrap/sections/tooling-sections.js +51 -2
- package/node_modules/@comis/agent/dist/bootstrap/system-prompt-assembler.d.ts +22 -0
- package/node_modules/@comis/agent/dist/bootstrap/system-prompt-assembler.js +2 -2
- package/node_modules/@comis/agent/dist/bridge/bridge-event-handlers.d.ts +1 -5
- package/node_modules/@comis/agent/dist/bridge/bridge-event-handlers.js +2 -14
- package/node_modules/@comis/agent/dist/bridge/bridge-metrics.d.ts +43 -2
- package/node_modules/@comis/agent/dist/bridge/bridge-metrics.js +17 -2
- package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.d.ts +32 -23
- package/node_modules/@comis/agent/dist/bridge/pi-event-bridge.js +145 -62
- package/node_modules/@comis/agent/dist/bridge/thinking-block-hash-invariant.d.ts +6 -7
- package/node_modules/@comis/agent/dist/bridge/thinking-block-hash-invariant.js +24 -25
- package/node_modules/@comis/agent/dist/budget/cost-tracker.d.ts +1 -1
- package/node_modules/@comis/agent/dist/context-engine/constants.d.ts +5 -5
- package/node_modules/@comis/agent/dist/context-engine/constants.js +12 -12
- package/node_modules/@comis/agent/dist/context-engine/context-engine.js +13 -4
- package/node_modules/@comis/agent/dist/context-engine/dag-annotator.d.ts +1 -2
- package/node_modules/@comis/agent/dist/context-engine/dag-annotator.js +1 -2
- package/node_modules/@comis/agent/dist/context-engine/llm-compaction.js +20 -16
- package/node_modules/@comis/agent/dist/context-engine/rehydration.js +6 -6
- package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.d.ts +12 -12
- package/node_modules/@comis/agent/dist/context-engine/signature-replay-scrubber.js +36 -22
- package/node_modules/@comis/agent/dist/context-engine/signature-surrogate-guard.d.ts +10 -10
- package/node_modules/@comis/agent/dist/context-engine/signature-surrogate-guard.js +14 -14
- package/node_modules/@comis/agent/dist/context-engine/thinking-block-cleaner.d.ts +11 -13
- package/node_modules/@comis/agent/dist/context-engine/thinking-block-cleaner.js +14 -15
- package/node_modules/@comis/agent/dist/context-engine/types-core.d.ts +15 -0
- package/node_modules/@comis/agent/dist/executor/cache-break-detection.d.ts +6 -6
- package/node_modules/@comis/agent/dist/executor/cache-break-detection.js +8 -8
- package/node_modules/@comis/agent/dist/executor/capability-index-context.d.ts +72 -0
- package/node_modules/@comis/agent/dist/executor/capability-index-context.js +329 -0
- package/node_modules/@comis/agent/dist/executor/drain-helper.d.ts +122 -0
- package/node_modules/@comis/agent/dist/executor/drain-helper.js +173 -0
- package/node_modules/@comis/agent/dist/executor/error-classifier.js +2 -2
- package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.d.ts +16 -0
- package/node_modules/@comis/agent/dist/executor/executor-context-engine-setup.js +46 -5
- package/node_modules/@comis/agent/dist/executor/executor-post-execution.d.ts +78 -4
- package/node_modules/@comis/agent/dist/executor/executor-post-execution.js +150 -31
- package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.d.ts +7 -0
- package/node_modules/@comis/agent/dist/executor/executor-prompt-runner.js +26 -5
- package/node_modules/@comis/agent/dist/executor/executor-response-filter.d.ts +7 -6
- package/node_modules/@comis/agent/dist/executor/executor-response-filter.js +9 -42
- package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.d.ts +18 -1
- package/node_modules/@comis/agent/dist/executor/executor-tool-assembly.js +20 -18
- package/node_modules/@comis/agent/dist/executor/gemini-cache-injector.d.ts +2 -2
- package/node_modules/@comis/agent/dist/executor/gemini-cache-injector.js +4 -4
- package/node_modules/@comis/agent/dist/executor/jit-guide-injector.d.ts +11 -2
- package/node_modules/@comis/agent/dist/executor/jit-guide-injector.js +16 -2
- package/node_modules/@comis/agent/dist/executor/phase-filter.d.ts +2 -2
- package/node_modules/@comis/agent/dist/executor/phase-filter.js +5 -7
- package/node_modules/@comis/agent/dist/executor/pi-executor.d.ts +21 -2
- package/node_modules/@comis/agent/dist/executor/pi-executor.js +96 -18
- package/node_modules/@comis/agent/dist/executor/post-batch-continuation.js +7 -7
- package/node_modules/@comis/agent/dist/executor/prompt-assembly.d.ts +9 -1
- package/node_modules/@comis/agent/dist/executor/prompt-assembly.js +15 -1
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.d.ts +1 -1
- package/node_modules/@comis/agent/dist/executor/stream-wrappers/request-body-injector.js +1 -1
- package/node_modules/@comis/agent/dist/executor/tool-deferral.d.ts +18 -27
- package/node_modules/@comis/agent/dist/executor/tool-deferral.js +34 -43
- package/node_modules/@comis/agent/dist/index.d.ts +17 -0
- package/node_modules/@comis/agent/dist/index.js +32 -11
- package/node_modules/@comis/agent/dist/model/auth-provider.d.ts +25 -2
- package/node_modules/@comis/agent/dist/model/auth-provider.js +6 -0
- package/node_modules/@comis/agent/dist/model/compaction-model-resolver.d.ts +3 -3
- package/node_modules/@comis/agent/dist/model/compaction-model-resolver.js +3 -3
- package/node_modules/@comis/agent/dist/model/model-registry-adapter.js +1 -1
- package/node_modules/@comis/agent/dist/model/model-scanner.js +1 -1
- package/node_modules/@comis/agent/dist/model/oauth-credential-store-file.d.ts +37 -0
- package/node_modules/@comis/agent/dist/model/oauth-credential-store-file.js +279 -0
- package/node_modules/@comis/agent/dist/model/oauth-credential-store-selector.d.ts +49 -0
- package/node_modules/@comis/agent/dist/model/oauth-credential-store-selector.js +50 -0
- package/node_modules/@comis/agent/dist/model/oauth-device-code.d.ts +57 -0
- package/node_modules/@comis/agent/dist/model/oauth-device-code.js +302 -0
- package/node_modules/@comis/agent/dist/model/oauth-env.d.ts +33 -0
- package/node_modules/@comis/agent/dist/model/oauth-env.js +38 -0
- package/node_modules/@comis/agent/dist/model/oauth-errors.d.ts +41 -0
- package/node_modules/@comis/agent/dist/model/oauth-errors.js +88 -0
- package/node_modules/@comis/agent/dist/model/oauth-identity.d.ts +53 -0
- package/node_modules/@comis/agent/dist/model/oauth-identity.js +141 -0
- package/node_modules/@comis/agent/dist/model/oauth-login-runner.d.ts +99 -0
- package/node_modules/@comis/agent/dist/model/oauth-login-runner.js +374 -0
- package/node_modules/@comis/agent/dist/model/oauth-tls-preflight.d.ts +58 -0
- package/node_modules/@comis/agent/dist/model/oauth-tls-preflight.js +82 -0
- package/node_modules/@comis/agent/dist/model/oauth-token-manager.d.ts +86 -16
- package/node_modules/@comis/agent/dist/model/oauth-token-manager.js +961 -66
- package/node_modules/@comis/agent/dist/model/operation-model-defaults.d.ts +9 -4
- package/node_modules/@comis/agent/dist/model/operation-model-defaults.js +36 -9
- package/node_modules/@comis/agent/dist/model/resolve-provider-api-key.d.ts +48 -0
- package/node_modules/@comis/agent/dist/model/resolve-provider-api-key.js +66 -0
- package/node_modules/@comis/agent/dist/provider/capabilities.d.ts +5 -5
- package/node_modules/@comis/agent/dist/provider/capabilities.js +10 -23
- package/node_modules/@comis/agent/dist/safety/tool-output-safety.js +3 -3
- package/node_modules/@comis/agent/dist/safety/tool-retry-breaker.d.ts +11 -1
- package/node_modules/@comis/agent/dist/safety/tool-retry-breaker.js +19 -22
- package/node_modules/@comis/agent/dist/session/comis-session-manager.d.ts +17 -3
- package/node_modules/@comis/agent/dist/session/comis-session-manager.js +1 -1
- package/node_modules/@comis/agent/dist/spawn/narrative-caster.d.ts +10 -0
- package/node_modules/@comis/agent/dist/spawn/narrative-caster.js +5 -1
- package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.d.ts +1 -1
- package/node_modules/@comis/agent/dist/spawn/pi-mono-adapters.js +5 -5
- package/node_modules/@comis/agent/dist/workspace/data-env.d.ts +38 -0
- package/node_modules/@comis/agent/dist/workspace/data-env.js +56 -0
- package/node_modules/@comis/agent/dist/workspace/index.d.ts +1 -0
- package/node_modules/@comis/agent/dist/workspace/index.js +1 -0
- package/node_modules/@comis/agent/dist/workspace/templates.js +5 -1
- package/node_modules/@comis/agent/package.json +1 -1
- package/node_modules/@comis/channels/dist/email/email-adapter.js +6 -6
- package/node_modules/@comis/channels/dist/email/imap-lifecycle.js +7 -7
- package/node_modules/@comis/channels/dist/index.d.ts +1 -1
- package/node_modules/@comis/channels/dist/index.js +1 -1
- package/node_modules/@comis/channels/dist/shared/channel-manager.d.ts +9 -3
- package/node_modules/@comis/channels/dist/shared/deliver-to-channel.js +12 -10
- package/node_modules/@comis/channels/dist/shared/inbound-gate.d.ts +1 -1
- package/node_modules/@comis/channels/dist/shared/inbound-gate.js +22 -7
- package/node_modules/@comis/channels/dist/shared/inbound-pipeline.d.ts +10 -3
- package/node_modules/@comis/channels/dist/shared/inbound-route.d.ts +1 -1
- package/node_modules/@comis/channels/dist/shared/inbound-route.js +13 -2
- package/node_modules/@comis/channels/dist/shared/response-filter.d.ts +11 -24
- package/node_modules/@comis/channels/dist/shared/response-filter.js +25 -53
- package/node_modules/@comis/channels/dist/telegram/telegram-adapter.js +1 -1
- package/node_modules/@comis/channels/package.json +1 -1
- package/node_modules/@comis/cli/dist/cli.js +2 -0
- package/node_modules/@comis/cli/dist/commands/agent.d.ts +3 -3
- package/node_modules/@comis/cli/dist/commands/agent.js +46 -3
- package/node_modules/@comis/cli/dist/commands/auth.d.ts +37 -0
- package/node_modules/@comis/cli/dist/commands/auth.js +433 -0
- package/node_modules/@comis/cli/dist/commands/doctor.d.ts +4 -1
- package/node_modules/@comis/cli/dist/commands/doctor.js +20 -5
- package/node_modules/@comis/cli/dist/commands/providers.d.ts +1 -2
- package/node_modules/@comis/cli/dist/commands/providers.js +5 -6
- package/node_modules/@comis/cli/dist/doctor/checks/oauth-health.d.ts +39 -0
- package/node_modules/@comis/cli/dist/doctor/checks/oauth-health.js +399 -0
- package/node_modules/@comis/cli/dist/doctor/types.d.ts +19 -0
- package/node_modules/@comis/cli/dist/index.d.ts +1 -0
- package/node_modules/@comis/cli/dist/index.js +10 -4
- package/node_modules/@comis/cli/dist/output/relative-time.d.ts +23 -0
- package/node_modules/@comis/cli/dist/output/relative-time.js +36 -0
- package/node_modules/@comis/cli/dist/wizard/non-interactive.js +17 -8
- package/node_modules/@comis/cli/dist/wizard/steps/03-provider.js +2 -1
- package/node_modules/@comis/cli/dist/wizard/steps/04-credentials.js +223 -34
- package/node_modules/@comis/cli/dist/wizard/steps/10-write-config.js +14 -0
- package/node_modules/@comis/cli/dist/wizard/steps/11-daemon-start.js +3 -3
- package/node_modules/@comis/cli/dist/wizard/types.d.ts +7 -0
- package/node_modules/@comis/cli/package.json +1 -1
- package/node_modules/@comis/core/dist/bootstrap.d.ts +1 -1
- package/node_modules/@comis/core/dist/config/env-substitution.d.ts +66 -0
- package/node_modules/@comis/core/dist/config/env-substitution.js +115 -0
- package/node_modules/@comis/core/dist/config/field-metadata.js +2 -0
- package/node_modules/@comis/core/dist/config/immutable-keys.js +4 -1
- package/node_modules/@comis/core/dist/config/index.d.ts +7 -1
- package/node_modules/@comis/core/dist/config/index.js +4 -1
- package/node_modules/@comis/core/dist/config/loader.js +61 -0
- package/node_modules/@comis/core/dist/config/managed-sections.d.ts +3 -3
- package/node_modules/@comis/core/dist/config/managed-sections.js +10 -5
- package/node_modules/@comis/core/dist/config/schema-agent.d.ts +4 -792
- package/node_modules/@comis/core/dist/config/schema-agent.js +16 -1
- package/node_modules/@comis/core/dist/config/schema-approvals.d.ts +0 -14
- package/node_modules/@comis/core/dist/config/schema-auto-reply-engine.d.ts +0 -6
- package/node_modules/@comis/core/dist/config/schema-background-tasks.d.ts +1 -6
- package/node_modules/@comis/core/dist/config/schema-background-tasks.js +7 -0
- package/node_modules/@comis/core/dist/config/schema-browser.d.ts +0 -18
- package/node_modules/@comis/core/dist/config/schema-channel.d.ts +0 -158
- package/node_modules/@comis/core/dist/config/schema-coalescer.d.ts +0 -5
- package/node_modules/@comis/core/dist/config/schema-daemon.d.ts +0 -32
- package/node_modules/@comis/core/dist/config/schema-delivery.d.ts +1 -17
- package/node_modules/@comis/core/dist/config/schema-delivery.js +2 -0
- package/node_modules/@comis/core/dist/config/schema-documentation.d.ts +0 -12
- package/node_modules/@comis/core/dist/config/schema-embedding.d.ts +0 -20
- package/node_modules/@comis/core/dist/config/schema-envelope.d.ts +0 -15
- package/node_modules/@comis/core/dist/config/schema-gateway.d.ts +0 -37
- package/node_modules/@comis/core/dist/config/schema-gemini-cache.d.ts +0 -4
- package/node_modules/@comis/core/dist/config/schema-gemini-cache.js +0 -2
- package/node_modules/@comis/core/dist/config/schema-integrations.d.ts +0 -318
- package/node_modules/@comis/core/dist/config/schema-lifecycle-reactions.d.ts +0 -18
- package/node_modules/@comis/core/dist/config/schema-memory-review.d.ts +0 -7
- package/node_modules/@comis/core/dist/config/schema-memory.d.ts +0 -16
- package/node_modules/@comis/core/dist/config/schema-messages.d.ts +0 -8
- package/node_modules/@comis/core/dist/config/schema-models.d.ts +0 -15
- package/node_modules/@comis/core/dist/config/schema-notification.d.ts +0 -5
- package/node_modules/@comis/core/dist/config/schema-oauth.d.ts +18 -0
- package/node_modules/@comis/core/dist/config/schema-oauth.js +19 -0
- package/node_modules/@comis/core/dist/config/schema-observability.d.ts +0 -38
- package/node_modules/@comis/core/dist/config/schema-output-retention.d.ts +34 -0
- package/node_modules/@comis/core/dist/config/schema-output-retention.js +48 -0
- package/node_modules/@comis/core/dist/config/schema-plugins.d.ts +0 -8
- package/node_modules/@comis/core/dist/config/schema-providers.d.ts +0 -64
- package/node_modules/@comis/core/dist/config/schema-queue.d.ts +0 -58
- package/node_modules/@comis/core/dist/config/schema-response-prefix.d.ts +0 -2
- package/node_modules/@comis/core/dist/config/schema-retry.d.ts +0 -6
- package/node_modules/@comis/core/dist/config/schema-scheduler.d.ts +0 -39
- package/node_modules/@comis/core/dist/config/schema-secrets.d.ts +0 -3
- package/node_modules/@comis/core/dist/config/schema-security.d.ts +0 -18
- package/node_modules/@comis/core/dist/config/schema-send-policy.d.ts +0 -13
- package/node_modules/@comis/core/dist/config/schema-sender-trust-display.d.ts +0 -5
- package/node_modules/@comis/core/dist/config/schema-serializer.js +2 -0
- package/node_modules/@comis/core/dist/config/schema-skills.d.ts +0 -63
- package/node_modules/@comis/core/dist/config/schema-skills.js +3 -4
- package/node_modules/@comis/core/dist/config/schema-streaming.d.ts +0 -38
- package/node_modules/@comis/core/dist/config/schema-telegram-file-guard.d.ts +0 -3
- package/node_modules/@comis/core/dist/config/schema-tooling.d.ts +87 -0
- package/node_modules/@comis/core/dist/config/schema-tooling.js +152 -0
- package/node_modules/@comis/core/dist/config/schema-verbosity.d.ts +0 -12
- package/node_modules/@comis/core/dist/config/schema-webhooks.d.ts +0 -40
- package/node_modules/@comis/core/dist/config/schema.d.ts +50 -37
- package/node_modules/@comis/core/dist/config/schema.js +9 -0
- package/node_modules/@comis/core/dist/context/context.d.ts +0 -4
- package/node_modules/@comis/core/dist/domain/approval-request.d.ts +0 -17
- package/node_modules/@comis/core/dist/domain/background-task-origin.d.ts +29 -0
- package/node_modules/@comis/core/dist/domain/background-task-origin.js +39 -0
- package/node_modules/@comis/core/dist/domain/delivery-origin.d.ts +0 -5
- package/node_modules/@comis/core/dist/domain/execution-graph.d.ts +0 -48
- package/node_modules/@comis/core/dist/domain/memory-entry.d.ts +0 -3
- package/node_modules/@comis/core/dist/domain/model-compat.d.ts +0 -4
- package/node_modules/@comis/core/dist/domain/normalized-message.d.ts +0 -15
- package/node_modules/@comis/core/dist/domain/provider-capabilities.d.ts +0 -6
- package/node_modules/@comis/core/dist/domain/rich-message.d.ts +0 -14
- package/node_modules/@comis/core/dist/domain/subagent-context-config.d.ts +0 -22
- package/node_modules/@comis/core/dist/domain/subagent-context-types.d.ts +0 -8
- package/node_modules/@comis/core/dist/event-bus/events-agent.d.ts +31 -0
- package/node_modules/@comis/core/dist/event-bus/events-infra.d.ts +76 -2
- package/node_modules/@comis/core/dist/exports/config.d.ts +2 -2
- package/node_modules/@comis/core/dist/exports/config.js +3 -1
- package/node_modules/@comis/core/dist/exports/domain.d.ts +2 -0
- package/node_modules/@comis/core/dist/exports/domain.js +1 -0
- package/node_modules/@comis/core/dist/exports/hooks.d.ts +1 -1
- package/node_modules/@comis/core/dist/exports/ports.d.ts +2 -2
- package/node_modules/@comis/core/dist/exports/ports.js +1 -1
- package/node_modules/@comis/core/dist/ports/channel-plugin.d.ts +0 -13
- package/node_modules/@comis/core/dist/ports/delivery-queue.d.ts +23 -0
- package/node_modules/@comis/core/dist/ports/delivery-queue.js +2 -0
- package/node_modules/@comis/core/dist/ports/index.d.ts +4 -0
- package/node_modules/@comis/core/dist/ports/index.js +5 -0
- package/node_modules/@comis/core/dist/ports/no-op-tool-capability.d.ts +30 -0
- package/node_modules/@comis/core/dist/ports/no-op-tool-capability.js +47 -0
- package/node_modules/@comis/core/dist/ports/oauth-credential-store.d.ts +64 -0
- package/node_modules/@comis/core/dist/ports/oauth-credential-store.js +37 -0
- package/node_modules/@comis/core/dist/ports/tool-capability.d.ts +165 -0
- package/node_modules/@comis/core/dist/ports/tool-capability.js +15 -0
- package/node_modules/@comis/core/dist/security/audit.d.ts +0 -11
- package/node_modules/@comis/core/dist/tool-metadata.d.ts +41 -1
- package/node_modules/@comis/core/dist/tool-metadata.js +1 -1
- package/node_modules/@comis/core/package.json +1 -1
- package/node_modules/@comis/daemon/bundled-skills/skill-creator/scripts/validate-skill.py +1 -1
- package/node_modules/@comis/daemon/dist/daemon-types.d.ts +23 -3
- package/node_modules/@comis/daemon/dist/daemon.js +168 -30
- package/node_modules/@comis/daemon/dist/index.d.ts +2 -0
- package/node_modules/@comis/daemon/dist/index.js +5 -0
- package/node_modules/@comis/daemon/dist/observability/channel-health-logger.js +3 -3
- package/node_modules/@comis/daemon/dist/observability/delivery-queue-logger.js +1 -1
- package/node_modules/@comis/daemon/dist/rpc/agent-handlers.d.ts +22 -1
- package/node_modules/@comis/daemon/dist/rpc/agent-handlers.js +84 -21
- package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.d.ts +1 -1
- package/node_modules/@comis/daemon/dist/rpc/agent-inline-workspace.js +3 -3
- package/node_modules/@comis/daemon/dist/rpc/builtin-provider-guard.js +2 -2
- package/node_modules/@comis/daemon/dist/rpc/config-handlers.d.ts +9 -1
- package/node_modules/@comis/daemon/dist/rpc/config-handlers.js +104 -23
- package/node_modules/@comis/daemon/dist/rpc/credential-resolver.d.ts +30 -1
- package/node_modules/@comis/daemon/dist/rpc/credential-resolver.js +74 -11
- package/node_modules/@comis/daemon/dist/rpc/mcp-handlers.d.ts +8 -0
- package/node_modules/@comis/daemon/dist/rpc/mcp-handlers.js +22 -8
- package/node_modules/@comis/daemon/dist/rpc/model-handlers.d.ts +1 -1
- package/node_modules/@comis/daemon/dist/rpc/model-handlers.js +2 -2
- package/node_modules/@comis/daemon/dist/rpc/provider-handlers.js +9 -12
- package/node_modules/@comis/daemon/dist/rpc/rpc-dispatch.d.ts +1 -0
- package/node_modules/@comis/daemon/dist/rpc/rpc-dispatch.js +27 -2
- package/node_modules/@comis/daemon/dist/setup-docker-restart-warn.js +0 -1
- package/node_modules/@comis/daemon/dist/sub-agent-runner.d.ts +18 -0
- package/node_modules/@comis/daemon/dist/sub-agent-runner.js +41 -9
- package/node_modules/@comis/daemon/dist/wiring/index.d.ts +4 -0
- package/node_modules/@comis/daemon/dist/wiring/index.js +2 -0
- package/node_modules/@comis/daemon/dist/wiring/oauth-preflight.d.ts +21 -0
- package/node_modules/@comis/daemon/dist/wiring/oauth-preflight.js +134 -0
- package/node_modules/@comis/daemon/dist/wiring/setup-agents.d.ts +81 -2
- package/node_modules/@comis/daemon/dist/wiring/setup-agents.js +164 -3
- package/node_modules/@comis/daemon/dist/wiring/setup-background-completion-runner.d.ts +58 -0
- package/node_modules/@comis/daemon/dist/wiring/setup-background-completion-runner.js +59 -0
- package/node_modules/@comis/daemon/dist/wiring/setup-background-tasks.d.ts +10 -3
- package/node_modules/@comis/daemon/dist/wiring/setup-background-tasks.js +13 -7
- package/node_modules/@comis/daemon/dist/wiring/setup-channels.d.ts +9 -2
- package/node_modules/@comis/daemon/dist/wiring/setup-channels.js +35 -10
- package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.d.ts +20 -5
- package/node_modules/@comis/daemon/dist/wiring/setup-cross-session.js +21 -16
- package/node_modules/@comis/daemon/dist/wiring/setup-delivery.d.ts +14 -5
- package/node_modules/@comis/daemon/dist/wiring/setup-delivery.js +65 -20
- package/node_modules/@comis/daemon/dist/wiring/setup-gateway.d.ts +4 -6
- package/node_modules/@comis/daemon/dist/wiring/setup-gateway.js +3 -5
- package/node_modules/@comis/daemon/dist/wiring/setup-heartbeat.d.ts +20 -5
- package/node_modules/@comis/daemon/dist/wiring/setup-heartbeat.js +11 -2
- package/node_modules/@comis/daemon/dist/wiring/setup-output-retention.d.ts +89 -0
- package/node_modules/@comis/daemon/dist/wiring/setup-output-retention.js +212 -0
- package/node_modules/@comis/daemon/dist/wiring/setup-schedulers.js +4 -0
- package/node_modules/@comis/daemon/dist/wiring/setup-tools.d.ts +18 -4
- package/node_modules/@comis/daemon/dist/wiring/setup-tools.js +29 -10
- package/node_modules/@comis/daemon/dist/wiring/tool-capability-adapter.d.ts +75 -0
- package/node_modules/@comis/daemon/dist/wiring/tool-capability-adapter.js +253 -0
- package/node_modules/@comis/daemon/package.json +1 -1
- package/node_modules/@comis/gateway/dist/index.d.ts +2 -0
- package/node_modules/@comis/gateway/dist/index.js +2 -0
- package/node_modules/@comis/gateway/dist/oauth/oauth-callback-route.d.ts +66 -0
- package/node_modules/@comis/gateway/dist/oauth/oauth-callback-route.js +212 -0
- package/node_modules/@comis/gateway/dist/server/hono-server.d.ts +14 -0
- package/node_modules/@comis/gateway/dist/server/hono-server.js +10 -0
- package/node_modules/@comis/gateway/dist/webhook/webhook-endpoint.d.ts +0 -4
- package/node_modules/@comis/gateway/package.json +1 -1
- package/node_modules/@comis/infra/dist/logging/log-fields.d.ts +23 -0
- package/node_modules/@comis/infra/package.json +1 -1
- package/node_modules/@comis/memory/dist/compaction.d.ts +3 -5
- package/node_modules/@comis/memory/dist/compaction.js +2 -3
- package/node_modules/@comis/memory/dist/delivery-queue-adapter.d.ts +2 -2
- package/node_modules/@comis/memory/dist/delivery-queue-adapter.js +49 -1
- package/node_modules/@comis/memory/dist/index.d.ts +2 -0
- package/node_modules/@comis/memory/dist/index.js +3 -0
- package/node_modules/@comis/memory/dist/memory-api.d.ts +1 -1
- package/node_modules/@comis/memory/dist/memory-api.js +1 -1
- package/node_modules/@comis/memory/dist/oauth-profile-schema.d.ts +17 -0
- package/node_modules/@comis/memory/dist/oauth-profile-schema.js +33 -0
- package/node_modules/@comis/memory/dist/oauth-profile-store-encrypted.d.ts +27 -0
- package/node_modules/@comis/memory/dist/oauth-profile-store-encrypted.js +144 -0
- package/node_modules/@comis/memory/dist/session-store.d.ts +1 -1
- package/node_modules/@comis/memory/dist/session-store.js +1 -1
- package/node_modules/@comis/memory/dist/sqlite-secret-store.d.ts +29 -3
- package/node_modules/@comis/memory/dist/sqlite-secret-store.js +11 -3
- package/node_modules/@comis/memory/package.json +1 -1
- package/node_modules/@comis/scheduler/dist/cron/cron-types.d.ts +0 -42
- package/node_modules/@comis/scheduler/dist/execution/execution-lock.d.ts +13 -0
- package/node_modules/@comis/scheduler/dist/execution/execution-lock.js +1 -1
- package/node_modules/@comis/scheduler/dist/execution/index.d.ts +2 -0
- package/node_modules/@comis/scheduler/dist/execution/index.js +2 -0
- package/node_modules/@comis/scheduler/dist/heartbeat/agent-heartbeat-source.d.ts +29 -8
- package/node_modules/@comis/scheduler/dist/heartbeat/agent-heartbeat-source.js +20 -8
- package/node_modules/@comis/scheduler/dist/index.d.ts +2 -0
- package/node_modules/@comis/scheduler/dist/index.js +2 -0
- package/node_modules/@comis/scheduler/dist/system-events/system-event-types.d.ts +0 -3
- package/node_modules/@comis/scheduler/dist/tasks/task-types.d.ts +0 -17
- package/node_modules/@comis/scheduler/package.json +1 -1
- package/node_modules/@comis/shared/dist/index.d.ts +3 -0
- package/node_modules/@comis/shared/dist/index.js +4 -0
- package/node_modules/@comis/shared/dist/mcp-tool-name.d.ts +78 -0
- package/node_modules/@comis/shared/dist/mcp-tool-name.js +92 -0
- package/node_modules/@comis/shared/dist/silent-tokens.d.ts +38 -0
- package/node_modules/@comis/shared/dist/silent-tokens.js +51 -0
- package/node_modules/@comis/shared/dist/visible-delivery.d.ts +28 -0
- package/node_modules/@comis/shared/dist/visible-delivery.js +16 -0
- package/node_modules/@comis/shared/package.json +1 -1
- package/node_modules/@comis/skills/dist/bridge/mcp-tool-bridge.d.ts +2 -13
- package/node_modules/@comis/skills/dist/bridge/mcp-tool-bridge.js +3 -21
- package/node_modules/@comis/skills/dist/bridge/schema-validator.d.ts +38 -0
- package/node_modules/@comis/skills/dist/bridge/schema-validator.js +169 -0
- package/node_modules/@comis/skills/dist/bridge/tool-metadata-enforcement.js +12 -0
- package/node_modules/@comis/skills/dist/bridge/tool-metadata-registry.js +133 -3
- package/node_modules/@comis/skills/dist/builtin/exec-diagnostics.d.ts +32 -0
- package/node_modules/@comis/skills/dist/builtin/exec-diagnostics.js +127 -0
- package/node_modules/@comis/skills/dist/builtin/exec-security.js +38 -0
- package/node_modules/@comis/skills/dist/builtin/exec-tool.d.ts +55 -9
- package/node_modules/@comis/skills/dist/builtin/exec-tool.js +392 -19
- package/node_modules/@comis/skills/dist/builtin/file-tools/grep-tool.js +6 -6
- package/node_modules/@comis/skills/dist/builtin/install-detour.d.ts +67 -0
- package/node_modules/@comis/skills/dist/builtin/install-detour.js +342 -0
- package/node_modules/@comis/skills/dist/builtin/platform/admin-manage-factory.js +5 -5
- package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.d.ts +7 -6
- package/node_modules/@comis/skills/dist/builtin/platform/agents-manage-tool.js +40 -29
- package/node_modules/@comis/skills/dist/builtin/platform/background-tasks-tool.d.ts +4 -1
- package/node_modules/@comis/skills/dist/builtin/platform/background-tasks-tool.js +3 -3
- package/node_modules/@comis/skills/dist/builtin/platform/cron-tool.js +1 -1
- package/node_modules/@comis/skills/dist/builtin/platform/gateway-tool.js +6 -6
- package/node_modules/@comis/skills/dist/builtin/platform/mcp-manage-tool.d.ts +1 -1
- package/node_modules/@comis/skills/dist/builtin/platform/mcp-manage-tool.js +9 -9
- package/node_modules/@comis/skills/dist/builtin/platform/message-tool.js +18 -0
- package/node_modules/@comis/skills/dist/builtin/platform/messaging-factory.d.ts +18 -1
- package/node_modules/@comis/skills/dist/builtin/platform/messaging-factory.js +18 -2
- package/node_modules/@comis/skills/dist/builtin/platform/models-manage-tool.js +3 -3
- package/node_modules/@comis/skills/dist/builtin/process-registry.d.ts +14 -0
- package/node_modules/@comis/skills/dist/builtin/process-tool.d.ts +24 -4
- package/node_modules/@comis/skills/dist/builtin/process-tool.js +25 -7
- package/node_modules/@comis/skills/dist/builtin/sandbox/bwrap-provider.d.ts +11 -0
- package/node_modules/@comis/skills/dist/builtin/sandbox/bwrap-provider.js +123 -1
- package/node_modules/@comis/skills/dist/builtin/sandbox/detect-provider.js +40 -15
- package/node_modules/@comis/skills/dist/index.d.ts +4 -1
- package/node_modules/@comis/skills/dist/index.js +3 -1
- package/node_modules/@comis/skills/dist/manifest/capability-parser.d.ts +44 -0
- package/node_modules/@comis/skills/dist/manifest/capability-parser.js +68 -0
- package/node_modules/@comis/skills/dist/manifest/schema.d.ts +44 -37
- package/node_modules/@comis/skills/dist/manifest/schema.js +35 -0
- package/node_modules/@comis/skills/dist/media/ssrf-fetcher.d.ts +7 -0
- package/node_modules/@comis/skills/dist/media/ssrf-fetcher.js +9 -2
- package/node_modules/@comis/skills/dist/registry/discovery.d.ts +8 -0
- package/node_modules/@comis/skills/dist/registry/discovery.js +10 -3
- package/node_modules/@comis/skills/dist/registry/skill-registry.d.ts +45 -1
- package/node_modules/@comis/skills/dist/registry/skill-registry.js +70 -7
- package/node_modules/@comis/skills/package.json +1 -1
- package/node_modules/@comis/web/dist/assets/{agent-detail-71BSbSfD.js → agent-detail-q8t1NB7w.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{agent-editor-CTSDZhwT.js → agent-editor-B46io5gv.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{agent-list-BEhni2ea.js → agent-list-DQ6g2Rcx.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{billing-view-DVP1IvVs.js → billing-view-IWPR8LgF.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{channel-detail-N_YK74xC.js → channel-detail-DlNNZuuC.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{channel-list-DRk6ZJaF.js → channel-list-DhGwxiMc.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{chat-console-Dm-GtSf9.js → chat-console-Nv6fM3Rc.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{config-editor-CIferYX6.js → config-editor-BYKuJF76.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{context-dag-browser-CL84rXXM.js → context-dag-browser-ClNEtzYE.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{context-engine-B1HOTEZv.js → context-engine-BZJ6HChd.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{delivery-view-Y6JKYVFw.js → delivery-view-Cb7I3vGu.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{diagnostics-view-DWV1UQjz.js → diagnostics-view-9u9Lyu5a.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{ic-chat-message-DfSERzzg.js → ic-chat-message-BFt3cVpx.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{ic-connection-dot-CXyhlJup.js → ic-connection-dot-y77LZ3Gu.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{ic-tool-call-DNmwTjek.js → ic-tool-call-qt6w1NQl.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{index-CBr0Tm9_.js → index-8Tg9oc-C.js} +2 -2
- package/node_modules/@comis/web/dist/assets/{mcp-management-BaH2-vox.js → mcp-management-69dtH_kY.js} +2 -2
- package/node_modules/@comis/web/dist/assets/{media-config-CZLshJoN.js → media-config-BdjLj5c1.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{media-test-C9NUWgo_.js → media-test-DuPqrixi.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{memory-inspector-D_fmTcRN.js → memory-inspector-B-Pepbq-.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{message-center-BBFlNCZn.js → message-center-B7l0yNYY.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{models-BytGLm99.js → models-JHFHuv5S.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{observe-view-VXtHqaqq.js → observe-view-r8mqhy4O.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{pipeline-builder-CfXczlfJ.js → pipeline-builder-XjkiZRcR.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{pipeline-history-CPmXFnbe.js → pipeline-history-CZqJv_Hj.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{pipeline-history-detail-DcueTMs9.js → pipeline-history-detail-BEFGMoDy.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{pipeline-list-B-xG5WZh.js → pipeline-list-B6q5LvO1.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{pipeline-monitor-pnIOYaSY.js → pipeline-monitor-BNomXjVL.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{scheduler-BtUIFHhA.js → scheduler-BJEjcGKA.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{security-C8mWRq2y.js → security-2G1jhBfV.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{session-detail-DgdkO5ka.js → session-detail-DmVPzFBR.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{session-list-DcylcfTn.js → session-list-CsqMQoHs.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{setup-wizard-BP5yjsuL.js → setup-wizard-CAdM-gSP.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{skills-DXt1bX8Z.js → skills-2ODqKaWr.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{subagents-C7YbUHXY.js → subagents-BFlwfTbD.js} +1 -1
- package/node_modules/@comis/web/dist/assets/{workspace-manager-DP6pW4wa.js → workspace-manager--CbOx_dI.js} +1 -1
- package/node_modules/@comis/web/dist/index.html +1 -1
- package/node_modules/@comis/web/package.json +1 -1
- package/package.json +25 -24
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// @comis/core exports — Port interfaces (hexagonal architecture boundaries)
|
|
3
|
-
export { ChannelCapabilitySchema, createNoOpDeliveryQueue, createNoOpDeliveryMirror } from "../ports/index.js";
|
|
3
|
+
export { ChannelCapabilitySchema, createNoOpDeliveryQueue, createNoOpDeliveryMirror, createNoOpCapabilityPort, validateProfileId, PROFILE_ID_RE, } from "../ports/index.js";
|
|
@@ -2,7 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
import type { PluginPort } from "./plugin.js";
|
|
3
3
|
import type { ChannelPort } from "./channel.js";
|
|
4
4
|
export declare const ChannelCapabilitySchema: z.ZodObject<{
|
|
5
|
-
/** Chat types this channel supports */
|
|
6
5
|
chatTypes: z.ZodArray<z.ZodEnum<{
|
|
7
6
|
channel: "channel";
|
|
8
7
|
dm: "dm";
|
|
@@ -10,7 +9,6 @@ export declare const ChannelCapabilitySchema: z.ZodObject<{
|
|
|
10
9
|
thread: "thread";
|
|
11
10
|
forum: "forum";
|
|
12
11
|
}>>;
|
|
13
|
-
/** Feature flags for optional capabilities */
|
|
14
12
|
features: z.ZodDefault<z.ZodObject<{
|
|
15
13
|
reactions: z.ZodDefault<z.ZodBoolean>;
|
|
16
14
|
editMessages: z.ZodDefault<z.ZodBoolean>;
|
|
@@ -20,44 +18,33 @@ export declare const ChannelCapabilitySchema: z.ZodObject<{
|
|
|
20
18
|
threads: z.ZodDefault<z.ZodBoolean>;
|
|
21
19
|
mentions: z.ZodDefault<z.ZodBoolean>;
|
|
22
20
|
formatting: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
23
|
-
/** Whether the channel supports interactive buttons */
|
|
24
21
|
buttons: z.ZodDefault<z.ZodBoolean>;
|
|
25
|
-
/** Whether the channel supports rich card embeds */
|
|
26
22
|
cards: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
-
/** Whether the channel supports message delivery effects (spoiler, silent) */
|
|
28
23
|
effects: z.ZodDefault<z.ZodBoolean>;
|
|
29
24
|
}, z.core.$strict>>;
|
|
30
|
-
/** Platform-specific message and attachment size limits */
|
|
31
25
|
limits: z.ZodObject<{
|
|
32
26
|
maxMessageChars: z.ZodNumber;
|
|
33
27
|
maxAttachmentSizeMb: z.ZodOptional<z.ZodNumber>;
|
|
34
28
|
}, z.core.$strict>;
|
|
35
|
-
/** Streaming support configuration */
|
|
36
29
|
streaming: z.ZodDefault<z.ZodObject<{
|
|
37
30
|
supported: z.ZodDefault<z.ZodBoolean>;
|
|
38
31
|
throttleMs: z.ZodDefault<z.ZodNumber>;
|
|
39
32
|
maxChars: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
/** Streaming delivery method: "edit" = edit message in-place, "block" = sequential messages, "none" = no streaming */
|
|
41
33
|
method: z.ZodDefault<z.ZodEnum<{
|
|
42
34
|
edit: "edit";
|
|
43
35
|
none: "none";
|
|
44
36
|
block: "block";
|
|
45
37
|
}>>;
|
|
46
38
|
}, z.core.$strict>>;
|
|
47
|
-
/** Threading capability metadata (extends features.threads with detail) */
|
|
48
39
|
threading: z.ZodDefault<z.ZodObject<{
|
|
49
|
-
/** Whether threading is supported at all (mirrors features.threads for convenience) */
|
|
50
40
|
supported: z.ZodDefault<z.ZodBoolean>;
|
|
51
|
-
/** Type of threading: "native" = platform threads (Discord), "reply-chain" = thread_ts reply chains (Slack), "none" = no threading */
|
|
52
41
|
threadType: z.ZodDefault<z.ZodEnum<{
|
|
53
42
|
none: "none";
|
|
54
43
|
native: "native";
|
|
55
44
|
"reply-chain": "reply-chain";
|
|
56
45
|
}>>;
|
|
57
|
-
/** Maximum thread nesting depth (undefined = unlimited within a thread) */
|
|
58
46
|
maxDepth: z.ZodOptional<z.ZodNumber>;
|
|
59
47
|
}, z.core.$strict>>;
|
|
60
|
-
/** Metadata key used for reply-to references (platform-specific) */
|
|
61
48
|
replyToMetaKey: z.ZodOptional<z.ZodString>;
|
|
62
49
|
}, z.core.$strict>;
|
|
63
50
|
/** Inferred type from ChannelCapabilitySchema */
|
|
@@ -65,6 +65,19 @@ export interface DeliveryQueuePort {
|
|
|
65
65
|
* @returns The assigned entry ID on success.
|
|
66
66
|
*/
|
|
67
67
|
enqueue(entry: DeliveryQueueEnqueueInput): Promise<Result<string, Error>>;
|
|
68
|
+
/**
|
|
69
|
+
* Enqueue a new outbound message with status='in_flight' (process-local lease).
|
|
70
|
+
*
|
|
71
|
+
* Used by the channel-side synchronous-send path: insert as 'in_flight' so the
|
|
72
|
+
* recurring drainer's `WHERE status='pending'` filter does not race-pick the row
|
|
73
|
+
* mid-send. Same semantics as enqueue() except for the initial status.
|
|
74
|
+
* On crash, the startup sweep (recoverInFlight) resets these rows back to 'pending'.
|
|
75
|
+
*
|
|
76
|
+
* Emits delivery:enqueued (same event as enqueue()) -- universal observability.
|
|
77
|
+
*
|
|
78
|
+
* @returns The assigned entry ID on success.
|
|
79
|
+
*/
|
|
80
|
+
enqueueInFlight(entry: DeliveryQueueEnqueueInput): Promise<Result<string, Error>>;
|
|
68
81
|
/**
|
|
69
82
|
* Mark an entry as successfully delivered.
|
|
70
83
|
* @param id - The queue entry ID
|
|
@@ -103,6 +116,16 @@ export interface DeliveryQueuePort {
|
|
|
103
116
|
* @param channelType - Optional filter to restrict counts to a specific channel.
|
|
104
117
|
*/
|
|
105
118
|
statusCounts(channelType?: string): Promise<Result<DeliveryQueueStatusCounts, Error>>;
|
|
119
|
+
/**
|
|
120
|
+
* Reset all rows with status='in_flight' to status='pending', clearing last_error.
|
|
121
|
+
*
|
|
122
|
+
* Called once at daemon startup before the existing startup drain. Treats
|
|
123
|
+
* 'in_flight' as a process-local lease -- any in_flight row left over from a
|
|
124
|
+
* prior daemon process is by definition stale and must be re-attempted.
|
|
125
|
+
*
|
|
126
|
+
* @returns The number of rows recovered (transitioned in_flight -> pending).
|
|
127
|
+
*/
|
|
128
|
+
recoverInFlight(): Promise<Result<number, Error>>;
|
|
106
129
|
}
|
|
107
130
|
/**
|
|
108
131
|
* No-op delivery queue for when the queue feature is disabled.
|
|
@@ -22,6 +22,7 @@ import { ok } from "@comis/shared";
|
|
|
22
22
|
export function createNoOpDeliveryQueue() {
|
|
23
23
|
return Object.freeze({
|
|
24
24
|
enqueue: () => Promise.resolve(ok(randomUUID())),
|
|
25
|
+
enqueueInFlight: () => Promise.resolve(ok(randomUUID())),
|
|
25
26
|
ack: () => Promise.resolve(ok(undefined)),
|
|
26
27
|
nack: () => Promise.resolve(ok(undefined)),
|
|
27
28
|
fail: () => Promise.resolve(ok(undefined)),
|
|
@@ -29,5 +30,6 @@ export function createNoOpDeliveryQueue() {
|
|
|
29
30
|
pruneExpired: () => Promise.resolve(ok(0)),
|
|
30
31
|
depth: () => Promise.resolve(ok(0)),
|
|
31
32
|
statusCounts: () => Promise.resolve(ok({ pending: 0, inFlight: 0, failed: 0, delivered: 0, expired: 0 })),
|
|
33
|
+
recoverInFlight: () => Promise.resolve(ok(0)),
|
|
32
34
|
});
|
|
33
35
|
}
|
|
@@ -16,8 +16,12 @@ export type { DeviceIdentity, DeviceIdentityPort, PairingRequest, PairedDevice,
|
|
|
16
16
|
export type { OutputGuardPort, OutputGuardFinding, OutputGuardResult, } from "./output-guard.js";
|
|
17
17
|
export type { SecretStorePort, SecretMetadata, } from "./secret-store.js";
|
|
18
18
|
export type { CredentialMappingPort } from "./credential-mapping.js";
|
|
19
|
+
export type { OAuthCredentialStorePort, OAuthProfile } from "./oauth-credential-store.js";
|
|
20
|
+
export { validateProfileId, PROFILE_ID_RE } from "./oauth-credential-store.js";
|
|
19
21
|
export type { Provider, ImageGenInput, ImageGenOutput, ImageGenerationPort } from "./provider.js";
|
|
20
22
|
export type { DeliveryQueuePort, DeliveryQueueEntry, DeliveryQueueEnqueueInput, DeliveryQueueStatusCounts, } from "./delivery-queue.js";
|
|
21
23
|
export { createNoOpDeliveryQueue } from "./delivery-queue.js";
|
|
22
24
|
export type { DeliveryMirrorPort, DeliveryMirrorEntry, DeliveryMirrorRecordInput, } from "./delivery-mirror.js";
|
|
23
25
|
export { createNoOpDeliveryMirror } from "./delivery-mirror.js";
|
|
26
|
+
export type { ToolCapabilityPort, PromptSkillCapability, CapabilitySourceRef, ClusterConfig, McpServerHint, SkillHint, } from "./tool-capability.js";
|
|
27
|
+
export { createNoOpCapabilityPort } from "./no-op-tool-capability.js";
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: Apache-2.0
|
|
2
2
|
// Port interfaces - Hexagonal architecture boundaries
|
|
3
3
|
export { ChannelCapabilitySchema } from "./channel-plugin.js";
|
|
4
|
+
export { validateProfileId, PROFILE_ID_RE } from "./oauth-credential-store.js";
|
|
4
5
|
export { createNoOpDeliveryQueue } from "./delivery-queue.js";
|
|
5
6
|
export { createNoOpDeliveryMirror } from "./delivery-mirror.js";
|
|
7
|
+
export { createNoOpCapabilityPort } from "./no-op-tool-capability.js";
|
|
8
|
+
// NOTE: the test-only stub factory in `__test-helpers/` is intentionally NOT
|
|
9
|
+
// re-exported here. It must NEVER appear on this barrel (the architecture-grep
|
|
10
|
+
// test enforces this).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Production no-op factory for ToolCapabilityPort.
|
|
3
|
+
*
|
|
4
|
+
* Returns an empty-defaults adapter that is safe to inject from any production
|
|
5
|
+
* code path. Used as the production no-op until the live daemon-side adapter
|
|
6
|
+
* is wired.
|
|
7
|
+
*
|
|
8
|
+
* With the no-op port:
|
|
9
|
+
* - The capability-index renderer sees no clusters/skills/servers -> returns
|
|
10
|
+
* empty text -> executor-prompt-runner.ts filters it out.
|
|
11
|
+
* - The install-detour parser sees no overlaps -> no events emitted, no hints,
|
|
12
|
+
* no soft-stop refusals.
|
|
13
|
+
* Both subsystems are inert but not broken.
|
|
14
|
+
*
|
|
15
|
+
* IMPORTANT -- boundary discipline:
|
|
16
|
+
* Test code must NOT import this. Tests use the test-only stub factory in
|
|
17
|
+
* `__test-helpers/` instead. The architecture-grep test in
|
|
18
|
+
* `packages/<pkg>/src/__tests__/architecture.test.ts` enforces this both ways.
|
|
19
|
+
*
|
|
20
|
+
* @module
|
|
21
|
+
*/
|
|
22
|
+
import type { ToolCapabilityPort } from "./tool-capability.js";
|
|
23
|
+
/**
|
|
24
|
+
* Production no-op factory. Production-OK; safe to import from any production
|
|
25
|
+
* code path. Tests must NOT import this -- use the test-only stub factory in
|
|
26
|
+
* `__test-helpers/` instead.
|
|
27
|
+
*
|
|
28
|
+
* @returns A frozen ToolCapabilityPort with empty defaults for all 9 methods.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createNoOpCapabilityPort(): ToolCapabilityPort;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Production no-op factory for ToolCapabilityPort.
|
|
4
|
+
*
|
|
5
|
+
* Returns an empty-defaults adapter that is safe to inject from any production
|
|
6
|
+
* code path. Used as the production no-op until the live daemon-side adapter
|
|
7
|
+
* is wired.
|
|
8
|
+
*
|
|
9
|
+
* With the no-op port:
|
|
10
|
+
* - The capability-index renderer sees no clusters/skills/servers -> returns
|
|
11
|
+
* empty text -> executor-prompt-runner.ts filters it out.
|
|
12
|
+
* - The install-detour parser sees no overlaps -> no events emitted, no hints,
|
|
13
|
+
* no soft-stop refusals.
|
|
14
|
+
* Both subsystems are inert but not broken.
|
|
15
|
+
*
|
|
16
|
+
* IMPORTANT -- boundary discipline:
|
|
17
|
+
* Test code must NOT import this. Tests use the test-only stub factory in
|
|
18
|
+
* `__test-helpers/` instead. The architecture-grep test in
|
|
19
|
+
* `packages/<pkg>/src/__tests__/architecture.test.ts` enforces this both ways.
|
|
20
|
+
*
|
|
21
|
+
* @module
|
|
22
|
+
*/
|
|
23
|
+
// Module-level constants -- returned by every call so callers can rely on
|
|
24
|
+
// reference-stability for cheap equality checks.
|
|
25
|
+
const EMPTY_ALIAS_MAP = new Map();
|
|
26
|
+
const EMPTY_SERVERS = Object.freeze([]);
|
|
27
|
+
const EMPTY_SKILLS = Object.freeze([]);
|
|
28
|
+
/**
|
|
29
|
+
* Production no-op factory. Production-OK; safe to import from any production
|
|
30
|
+
* code path. Tests must NOT import this -- use the test-only stub factory in
|
|
31
|
+
* `__test-helpers/` instead.
|
|
32
|
+
*
|
|
33
|
+
* @returns A frozen ToolCapabilityPort with empty defaults for all 9 methods.
|
|
34
|
+
*/
|
|
35
|
+
export function createNoOpCapabilityPort() {
|
|
36
|
+
return Object.freeze({
|
|
37
|
+
isCapabilityIndexEnabled: () => true,
|
|
38
|
+
getInstallDetourMode: () => "advise",
|
|
39
|
+
getBuiltinCluster: () => undefined,
|
|
40
|
+
getClusterConfig: () => undefined,
|
|
41
|
+
getMcpServerHint: () => undefined,
|
|
42
|
+
getSkillHint: () => undefined,
|
|
43
|
+
getPackageAliasMap: () => EMPTY_ALIAS_MAP,
|
|
44
|
+
getConnectedMcpServers: () => EMPTY_SERVERS,
|
|
45
|
+
getPromptSkillCapabilities: () => EMPTY_SKILLS,
|
|
46
|
+
});
|
|
47
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { Result } from "@comis/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Persisted OAuth profile shape.
|
|
4
|
+
*
|
|
5
|
+
* Maps to pi-ai's OAuthCredentials plus comis-managed metadata
|
|
6
|
+
* (provider, profileId, identity claims). The expires field is
|
|
7
|
+
* milliseconds since epoch (matches pi-ai — the JWT exp claim is
|
|
8
|
+
* seconds, but pi-ai stores ms).
|
|
9
|
+
*/
|
|
10
|
+
export interface OAuthProfile {
|
|
11
|
+
/** OAuth provider id (e.g. "openai-codex", "anthropic"). */
|
|
12
|
+
provider: string;
|
|
13
|
+
/** Canonical profile identifier in the form "<provider>:<identity>". */
|
|
14
|
+
profileId: string;
|
|
15
|
+
/** OAuth access token (JWT for OpenAI Codex). NEVER log this value. */
|
|
16
|
+
access: string;
|
|
17
|
+
/** OAuth refresh token. NEVER log this value. */
|
|
18
|
+
refresh: string;
|
|
19
|
+
/** Access-token expiry in ms since epoch. */
|
|
20
|
+
expires: number;
|
|
21
|
+
/** Provider-specific account identifier (e.g. Codex chatgpt_account_id). */
|
|
22
|
+
accountId?: string;
|
|
23
|
+
/** Identity email (when JWT decode produced one). */
|
|
24
|
+
email?: string;
|
|
25
|
+
/** Human-friendly display name (when available). */
|
|
26
|
+
displayName?: string;
|
|
27
|
+
/** Schema version. Currently always 1. Hard-fail on mismatch. */
|
|
28
|
+
version: 1;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* OAuthCredentialStorePort: Hexagonal architecture boundary for mutable
|
|
32
|
+
* OAuth credential persistence.
|
|
33
|
+
*
|
|
34
|
+
* Distinct from SecretStorePort (which is read-only). Every storage
|
|
35
|
+
* backend (file-based, encrypted SQLite) implements this interface.
|
|
36
|
+
*
|
|
37
|
+
* All operations are asynchronous and return Result<T, Error> for
|
|
38
|
+
* explicit error handling — never throw at the public boundary.
|
|
39
|
+
*/
|
|
40
|
+
export interface OAuthCredentialStorePort {
|
|
41
|
+
get(profileId: string): Promise<Result<OAuthProfile | undefined, Error>>;
|
|
42
|
+
set(profileId: string, profile: OAuthProfile): Promise<Result<void, Error>>;
|
|
43
|
+
delete(profileId: string): Promise<Result<boolean, Error>>;
|
|
44
|
+
list(filter?: {
|
|
45
|
+
provider?: string;
|
|
46
|
+
}): Promise<Result<OAuthProfile[], Error>>;
|
|
47
|
+
has(profileId: string): Promise<Result<boolean, Error>>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Profile-ID format regex: <provider>:<identity>.
|
|
51
|
+
* Provider must start with letter; alphanumeric + hyphen only.
|
|
52
|
+
* Identity is non-empty and may contain @, ., etc.
|
|
53
|
+
*/
|
|
54
|
+
export declare const PROFILE_ID_RE: RegExp;
|
|
55
|
+
/**
|
|
56
|
+
* Validate a profile-ID string against the <provider>:<identity> shape.
|
|
57
|
+
* Returns parsed parts on success; an Error describing the violation otherwise.
|
|
58
|
+
* Defense-in-depth: also rejects identities containing path-traversal or
|
|
59
|
+
* control characters (newline, null, slash, backslash, ..).
|
|
60
|
+
*/
|
|
61
|
+
export declare function validateProfileId(id: string): Result<{
|
|
62
|
+
provider: string;
|
|
63
|
+
identity: string;
|
|
64
|
+
}, Error>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ok, err } from "@comis/shared";
|
|
2
|
+
/**
|
|
3
|
+
* Profile-ID format regex: <provider>:<identity>.
|
|
4
|
+
* Provider must start with letter; alphanumeric + hyphen only.
|
|
5
|
+
* Identity is non-empty and may contain @, ., etc.
|
|
6
|
+
*/
|
|
7
|
+
export const PROFILE_ID_RE = /^[a-z][a-z0-9-]*:.+$/i;
|
|
8
|
+
/**
|
|
9
|
+
* Validate a profile-ID string against the <provider>:<identity> shape.
|
|
10
|
+
* Returns parsed parts on success; an Error describing the violation otherwise.
|
|
11
|
+
* Defense-in-depth: also rejects identities containing path-traversal or
|
|
12
|
+
* control characters (newline, null, slash, backslash, ..).
|
|
13
|
+
*/
|
|
14
|
+
export function validateProfileId(id) {
|
|
15
|
+
if (typeof id !== "string" || id.length === 0) {
|
|
16
|
+
return err(new Error("Invalid profile ID: empty or non-string"));
|
|
17
|
+
}
|
|
18
|
+
if (!PROFILE_ID_RE.test(id)) {
|
|
19
|
+
return err(new Error('Invalid profile ID "' + id + '": expected "<provider>:<identity>"'));
|
|
20
|
+
}
|
|
21
|
+
const colonIdx = id.indexOf(":");
|
|
22
|
+
const provider = id.slice(0, colonIdx);
|
|
23
|
+
const identity = id.slice(colonIdx + 1);
|
|
24
|
+
if (!provider)
|
|
25
|
+
return err(new Error('Invalid profile ID "' + id + '": empty provider'));
|
|
26
|
+
if (!identity)
|
|
27
|
+
return err(new Error('Invalid profile ID "' + id + '": empty identity'));
|
|
28
|
+
if (identity.includes("\0") ||
|
|
29
|
+
identity.includes("\n") ||
|
|
30
|
+
identity.includes("\r") ||
|
|
31
|
+
identity.includes("..") ||
|
|
32
|
+
identity.includes("/") ||
|
|
33
|
+
identity.includes("\\")) {
|
|
34
|
+
return err(new Error('Invalid profile ID "' + id + '": identity contains forbidden characters'));
|
|
35
|
+
}
|
|
36
|
+
return ok({ provider, identity });
|
|
37
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolCapabilityPort -- hexagonal architecture boundary for the v1.1 capability layer.
|
|
3
|
+
*
|
|
4
|
+
* Provides both a static config-derived view (clusters, hints, aliases) AND a
|
|
5
|
+
* live runtime view (connected MCP servers, visible prompt skills). One port,
|
|
6
|
+
* two views -- exec runs per-tool-call (not per-turn) and needs a live getter.
|
|
7
|
+
*
|
|
8
|
+
* Adapters: live daemon-side adapter, createNoOpCapabilityPort (production
|
|
9
|
+
* no-op, this package), test-only stub factory (lives in `__test-helpers/` --
|
|
10
|
+
* production source MUST NOT import).
|
|
11
|
+
*
|
|
12
|
+
* @module
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Capability source reference -- discriminated union pointing at either a
|
|
16
|
+
* connected MCP server or a visible prompt skill. Used in the package-alias
|
|
17
|
+
* map to resolve "import yfinance" or "pip install pandas" back to a connected
|
|
18
|
+
* tool/skill that should be preferred over the install.
|
|
19
|
+
*/
|
|
20
|
+
export type CapabilitySourceRef = {
|
|
21
|
+
readonly type: "mcp";
|
|
22
|
+
readonly name: string;
|
|
23
|
+
} | {
|
|
24
|
+
readonly type: "skill";
|
|
25
|
+
readonly name: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Merged capability view of a single visible prompt skill.
|
|
29
|
+
*
|
|
30
|
+
* All operator overrides, manifest `comis.capability` values, and skill-key
|
|
31
|
+
* fallbacks are pre-merged in the adapter (precedence:
|
|
32
|
+
* operator(skillKey) > operator(skillName) > comis.capability > fallback).
|
|
33
|
+
* Consumers see the final merged shape.
|
|
34
|
+
*/
|
|
35
|
+
export interface PromptSkillCapability {
|
|
36
|
+
/** Stable skill identifier used by the agent runtime. */
|
|
37
|
+
readonly name: string;
|
|
38
|
+
/** Optional canonical key (`<author>::<slug>`) for cross-host portability. */
|
|
39
|
+
readonly skillKey?: string;
|
|
40
|
+
/** Human-readable description (falls back to manifest description if no override). */
|
|
41
|
+
readonly description: string;
|
|
42
|
+
/** Cluster ID for capability-index grouping (e.g. "data-fetching-financial"). */
|
|
43
|
+
readonly cluster?: string;
|
|
44
|
+
/** Operator-tunable display summary; falls back to description when absent. */
|
|
45
|
+
readonly summary?: string;
|
|
46
|
+
/** Package names this skill replaces (for install-detour overlap detection). */
|
|
47
|
+
readonly replacesPackages: readonly string[];
|
|
48
|
+
/** Where the skill was discovered from. */
|
|
49
|
+
readonly source?: "bundled" | "workspace" | "local";
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Cluster metadata used by the capability-index renderer.
|
|
53
|
+
*/
|
|
54
|
+
export interface ClusterConfig {
|
|
55
|
+
readonly label: string;
|
|
56
|
+
readonly priority: number;
|
|
57
|
+
readonly preferOverInstalls: boolean;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Hint metadata for a connected MCP server.
|
|
61
|
+
*/
|
|
62
|
+
export interface McpServerHint {
|
|
63
|
+
readonly cluster: string;
|
|
64
|
+
readonly description: string;
|
|
65
|
+
readonly replacesPackages: readonly string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Hint metadata for a visible prompt skill (operator-supplied overrides).
|
|
69
|
+
*/
|
|
70
|
+
export interface SkillHint {
|
|
71
|
+
readonly cluster: string;
|
|
72
|
+
readonly description?: string;
|
|
73
|
+
readonly replacesPackages: readonly string[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The capability port. Covers both the static config-derived view and a live
|
|
77
|
+
* runtime view. Adapter implementation lives in @comis/daemon; the in-package
|
|
78
|
+
* createNoOpCapabilityPort serves as the production no-op.
|
|
79
|
+
*
|
|
80
|
+
* Adapters: createNoOpCapabilityPort (production no-op, this package),
|
|
81
|
+
* test-only stub factory in `__test-helpers/`, live daemon-side adapter.
|
|
82
|
+
*/
|
|
83
|
+
export interface ToolCapabilityPort {
|
|
84
|
+
/**
|
|
85
|
+
* Whether the per-turn capability index renderer should fire at all. When
|
|
86
|
+
* false, the renderer returns empty text and the executor-prompt-runner
|
|
87
|
+
* filters it out.
|
|
88
|
+
*
|
|
89
|
+
* @returns `true` if the operator has enabled the capability index.
|
|
90
|
+
*/
|
|
91
|
+
isCapabilityIndexEnabled(): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Install-detour mode for pip/npm/pnpm/yarn detection.
|
|
94
|
+
* - `observe`: log only, no agent-visible response.
|
|
95
|
+
* - `advise`: emit a non-blocking advisory next turn.
|
|
96
|
+
* - `soft-stop`: refuse the exec call with an operator-overridable message.
|
|
97
|
+
*
|
|
98
|
+
* @returns The currently-configured mode.
|
|
99
|
+
*/
|
|
100
|
+
getInstallDetourMode(): "observe" | "advise" | "soft-stop";
|
|
101
|
+
/**
|
|
102
|
+
* Cluster ID for a builtin tool (exec, read, write, ...).
|
|
103
|
+
*
|
|
104
|
+
* @param toolName - The builtin tool's registered name.
|
|
105
|
+
* @returns The cluster ID, or undefined if the tool is uncategorized.
|
|
106
|
+
*/
|
|
107
|
+
getBuiltinCluster(toolName: string): string | undefined;
|
|
108
|
+
/**
|
|
109
|
+
* Cluster metadata (label, priority, preferOverInstalls flag).
|
|
110
|
+
*
|
|
111
|
+
* @param clusterId - The cluster identifier.
|
|
112
|
+
* @returns The cluster config, or undefined if the cluster is unknown.
|
|
113
|
+
*/
|
|
114
|
+
getClusterConfig(clusterId: string): ClusterConfig | undefined;
|
|
115
|
+
/**
|
|
116
|
+
* Hint metadata for a connected MCP server (operator-supplied overrides).
|
|
117
|
+
*
|
|
118
|
+
* @param serverName - The MCP server name (sanitized form).
|
|
119
|
+
* @returns The hint, or undefined if no operator override exists.
|
|
120
|
+
*/
|
|
121
|
+
getMcpServerHint(serverName: string): McpServerHint | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Hint metadata for a visible prompt skill (operator-supplied overrides).
|
|
124
|
+
*
|
|
125
|
+
* @param skillName - The skill's runtime name.
|
|
126
|
+
* @param skillKey - Optional canonical key (`<author>::<slug>`).
|
|
127
|
+
* @returns The hint, or undefined if no operator override exists.
|
|
128
|
+
*/
|
|
129
|
+
getSkillHint(skillName: string, skillKey?: string): SkillHint | undefined;
|
|
130
|
+
/**
|
|
131
|
+
* Pre-normalized package alias map (PEP-503-like keys for Python:
|
|
132
|
+
* lowercase, `_` and `.` collapsed to `-`).
|
|
133
|
+
*
|
|
134
|
+
* Build fresh on each call (no memoization in v1.1) -- visible skills can
|
|
135
|
+
* change mid-session (skill discovery, allow/deny edits), connected MCP
|
|
136
|
+
* servers can connect/disconnect, capturing at construction would freeze
|
|
137
|
+
* stale state.
|
|
138
|
+
*
|
|
139
|
+
* @returns A read-only map keyed by normalized package name pointing at
|
|
140
|
+
* the matching MCP server or prompt skill.
|
|
141
|
+
*/
|
|
142
|
+
getPackageAliasMap(): ReadonlyMap<string, CapabilitySourceRef>;
|
|
143
|
+
/**
|
|
144
|
+
* Currently-connected MCP server names (sanitized form).
|
|
145
|
+
*
|
|
146
|
+
* @returns A read-only array of server names. Order is undefined.
|
|
147
|
+
*/
|
|
148
|
+
getConnectedMcpServers(): readonly string[];
|
|
149
|
+
/**
|
|
150
|
+
* Visible eligible prompt skills with merged capability metadata.
|
|
151
|
+
* Filters: allowedSkills/deniedSkills, runtime eligibility (os/bins/env),
|
|
152
|
+
* AND `disableModelInvocation !== true`.
|
|
153
|
+
* Merging: operator(skillKey) > operator(skillName) > comis.capability > fallback.
|
|
154
|
+
*
|
|
155
|
+
* IMPORTANT -- cache fence:
|
|
156
|
+
* This method MUST NOT be consumed by `assembleRichSystemPrompt`'s
|
|
157
|
+
* `assemblerParams` in `packages/agent/src/executor/prompt-assembly.ts`.
|
|
158
|
+
* If a skill discovery sweep runs between turns, the cached system-prompt
|
|
159
|
+
* prefix MUST stay byte-identical. Consumers: per-turn capability index
|
|
160
|
+
* renderer + install-detour parser ONLY.
|
|
161
|
+
*
|
|
162
|
+
* @returns A read-only array of merged capability views.
|
|
163
|
+
*/
|
|
164
|
+
getPromptSkillCapabilities(): readonly PromptSkillCapability[];
|
|
165
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* ToolCapabilityPort -- hexagonal architecture boundary for the v1.1 capability layer.
|
|
4
|
+
*
|
|
5
|
+
* Provides both a static config-derived view (clusters, hints, aliases) AND a
|
|
6
|
+
* live runtime view (connected MCP servers, visible prompt skills). One port,
|
|
7
|
+
* two views -- exec runs per-tool-call (not per-turn) and needs a live getter.
|
|
8
|
+
*
|
|
9
|
+
* Adapters: live daemon-side adapter, createNoOpCapabilityPort (production
|
|
10
|
+
* no-op, this package), test-only stub factory (lives in `__test-helpers/` --
|
|
11
|
+
* production source MUST NOT import).
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
@@ -7,35 +7,24 @@ import type { ActionClassification } from "./action-classifier.js";
|
|
|
7
7
|
* classification, outcome, tracing, and timing information.
|
|
8
8
|
*/
|
|
9
9
|
export declare const AuditEventSchema: z.ZodObject<{
|
|
10
|
-
/** Unique event identifier (UUIDv4). */
|
|
11
10
|
id: z.ZodGUID;
|
|
12
|
-
/** ISO 8601 timestamp of when the event occurred. */
|
|
13
11
|
timestamp: z.ZodISODateTime;
|
|
14
|
-
/** Tenant identifier for multi-tenant isolation. */
|
|
15
12
|
tenantId: z.ZodString;
|
|
16
|
-
/** Agent that performed the action (may be system). */
|
|
17
13
|
agentId: z.ZodString;
|
|
18
|
-
/** User who triggered or owns the action (may be "system"). */
|
|
19
14
|
userId: z.ZodString;
|
|
20
|
-
/** The action that was performed (e.g., "file.delete"). */
|
|
21
15
|
actionType: z.ZodString;
|
|
22
|
-
/** Risk classification of the action. */
|
|
23
16
|
classification: z.ZodEnum<{
|
|
24
17
|
read: "read";
|
|
25
18
|
mutate: "mutate";
|
|
26
19
|
destructive: "destructive";
|
|
27
20
|
}>;
|
|
28
|
-
/** Whether the action succeeded or failed. */
|
|
29
21
|
outcome: z.ZodEnum<{
|
|
30
22
|
success: "success";
|
|
31
23
|
failure: "failure";
|
|
32
24
|
denied: "denied";
|
|
33
25
|
}>;
|
|
34
|
-
/** Arbitrary metadata about the event. */
|
|
35
26
|
metadata: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
36
|
-
/** Distributed tracing identifier for correlating events. */
|
|
37
27
|
traceId: z.ZodOptional<z.ZodString>;
|
|
38
|
-
/** Duration of the action in milliseconds. */
|
|
39
28
|
duration: z.ZodOptional<z.ZodNumber>;
|
|
40
29
|
}, z.core.$strict>;
|
|
41
30
|
/** TypeScript type inferred from the AuditEvent Zod schema. */
|
|
@@ -8,6 +8,24 @@
|
|
|
8
8
|
* Registry supports incremental registration via spread-merge semantics:
|
|
9
9
|
* different sources can register different fields for the same tool.
|
|
10
10
|
*/
|
|
11
|
+
/**
|
|
12
|
+
* Capability metadata for a builtin/platform tool -- used by the v1.1 capability
|
|
13
|
+
* layer to route tools into clusters and detect install-detour overlap.
|
|
14
|
+
*
|
|
15
|
+
* All fields optional. Operators may override `cluster` per-tool via
|
|
16
|
+
* `tooling.capabilityClusters.builtinAssignments[toolName]`. The metadata
|
|
17
|
+
* default applies when no operator override is present.
|
|
18
|
+
*
|
|
19
|
+
* `getBuiltinCluster` precedence: operator override > metadata default > undefined.
|
|
20
|
+
*/
|
|
21
|
+
export interface ToolCapabilityMetadata {
|
|
22
|
+
/** Cluster ID this tool belongs to (e.g., "data-fetching-financial"). */
|
|
23
|
+
readonly cluster?: string;
|
|
24
|
+
/** Operator-tunable display summary; falls back to tool description if absent. */
|
|
25
|
+
readonly summary?: string;
|
|
26
|
+
/** Package names this tool replaces (for install-detour overlap detection). */
|
|
27
|
+
readonly replacesPackages?: readonly string[];
|
|
28
|
+
}
|
|
11
29
|
/** Per-tool metadata stored in the side-channel registry. All fields optional. */
|
|
12
30
|
export interface ComisToolMetadata {
|
|
13
31
|
/** Per-tool result size cap in characters. */
|
|
@@ -22,12 +40,34 @@ export interface ComisToolMetadata {
|
|
|
22
40
|
outputSchema?: Record<string, unknown>;
|
|
23
41
|
/** Tool names that should be co-discovered whenever this tool is discovered (bidirectional). */
|
|
24
42
|
coDiscoverWith?: string[];
|
|
43
|
+
/** Valid `action` enum values for action-discriminated tools. Used by the
|
|
44
|
+
* generic schema-validator in @comis/skills/bridge to gate unknown actions
|
|
45
|
+
* before the per-tool validateInput runs. Field shape mirrors
|
|
46
|
+
* `ManagedSectionRedirect.schemaFragment.actions` in
|
|
47
|
+
* @comis/core/src/config/managed-sections.ts so cross-consistency tests
|
|
48
|
+
* can compare them. */
|
|
49
|
+
validActions?: readonly string[];
|
|
50
|
+
/** Full set of accepted top-level parameter keys. Unknown keys trigger a
|
|
51
|
+
* Levenshtein "did you mean" hint via the schema-validator. Action-
|
|
52
|
+
* discriminated tools list the union across all actions; non-discriminated
|
|
53
|
+
* tools list every accepted key. Omit when the tool's params are open-
|
|
54
|
+
* ended (e.g. exec). */
|
|
55
|
+
validKeys?: readonly string[];
|
|
56
|
+
/** Required keys per action value (action-discriminated tools only). Maps
|
|
57
|
+
* each `action` literal to the list of params that MUST be present beyond
|
|
58
|
+
* `action` itself. Field name + shape mirror
|
|
59
|
+
* `ManagedSectionRedirect.schemaFragment.requiredByAction` in
|
|
60
|
+
* @comis/core/src/config/managed-sections.ts. Omit actions with no
|
|
61
|
+
* required fields beyond `action`. */
|
|
62
|
+
requiredByAction?: Readonly<Record<string, readonly string[]>>;
|
|
25
63
|
/** Pre-flight input validator. Returns error string on failure, undefined on success. */
|
|
26
64
|
validateInput?: (params: Record<string, unknown>) => string | undefined | Promise<string | undefined>;
|
|
65
|
+
/** Capability metadata for tool-first routing (v1.1). */
|
|
66
|
+
capability?: ToolCapabilityMetadata;
|
|
27
67
|
}
|
|
28
68
|
/**
|
|
29
69
|
* Register metadata for a tool. Merges with any existing metadata via spread,
|
|
30
|
-
* allowing incremental registration from different
|
|
70
|
+
* allowing incremental registration from different sources.
|
|
31
71
|
*/
|
|
32
72
|
export declare function registerToolMetadata(name: string, meta: ComisToolMetadata): void;
|
|
33
73
|
/**
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
const registry = new Map();
|
|
16
16
|
/**
|
|
17
17
|
* Register metadata for a tool. Merges with any existing metadata via spread,
|
|
18
|
-
* allowing incremental registration from different
|
|
18
|
+
* allowing incremental registration from different sources.
|
|
19
19
|
*/
|
|
20
20
|
export function registerToolMetadata(name, meta) {
|
|
21
21
|
registry.set(name, { ...registry.get(name), ...meta });
|
|
@@ -31,7 +31,7 @@ VALID_TOP_FIELDS = {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
VALID_COMIS_FIELDS = {
|
|
34
|
-
"os", "requires", "skill-key", "primary-env", "command-dispatch",
|
|
34
|
+
"os", "requires", "skill-key", "primary-env", "command-dispatch", "capability",
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
VALID_PERMISSIONS_FIELDS = {"fsRead", "fsWrite", "net", "env"}
|