@aexol/spectral 0.8.2 → 0.8.5
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/CHANGELOG.md +82 -55
- package/README.md +80 -82
- package/dist/agent/agents.d.ts +37 -0
- package/dist/agent/agents.d.ts.map +1 -0
- package/dist/agent/index.d.ts +29 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/commands/bind.d.ts +12 -0
- package/dist/commands/bind.d.ts.map +1 -0
- package/dist/commands/login-oauth.d.ts +15 -0
- package/dist/commands/login-oauth.d.ts.map +1 -0
- package/dist/commands/login.d.ts +37 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/logout.d.ts +8 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/serve.d.ts +112 -0
- package/dist/commands/serve.d.ts.map +1 -0
- package/dist/commands/unbind.d.ts +8 -0
- package/dist/commands/unbind.d.ts.map +1 -0
- package/dist/config.d.ts +49 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/designer/guidelines.d.ts +23 -0
- package/dist/designer/guidelines.d.ts.map +1 -0
- package/dist/designer/index.d.ts +26 -0
- package/dist/designer/index.d.ts.map +1 -0
- package/dist/designer/philosophies.d.ts +33 -0
- package/dist/designer/philosophies.d.ts.map +1 -0
- package/dist/designer/skills.d.ts +27 -0
- package/dist/designer/skills.d.ts.map +1 -0
- package/dist/designer/systems.d.ts +36 -0
- package/dist/designer/systems.d.ts.map +1 -0
- package/dist/extensions/aexol-mcp.d.ts +25 -0
- package/dist/extensions/aexol-mcp.d.ts.map +1 -0
- package/dist/extensions/kanban-bridge.d.ts +24 -0
- package/dist/extensions/kanban-bridge.d.ts.map +1 -0
- package/dist/extensions/openrouter-attribution.d.ts +12 -0
- package/dist/extensions/openrouter-attribution.d.ts.map +1 -0
- package/dist/extensions/spectral-vision-fallback.d.ts +23 -0
- package/dist/extensions/spectral-vision-fallback.d.ts.map +1 -0
- package/dist/extensions/spectral-vision-fallback.js +29 -20
- package/dist/index.d.ts +46 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +44 -0
- package/dist/mcp/agent-dir.d.ts +3 -0
- package/dist/mcp/agent-dir.d.ts.map +1 -0
- package/dist/mcp/commands.d.ts +9 -0
- package/dist/mcp/commands.d.ts.map +1 -0
- package/dist/mcp/config.d.ts +78 -0
- package/dist/mcp/config.d.ts.map +1 -0
- package/dist/mcp/consent-manager.d.ts +14 -0
- package/dist/mcp/consent-manager.d.ts.map +1 -0
- package/dist/mcp/direct-tools.d.ts +11 -0
- package/dist/mcp/direct-tools.d.ts.map +1 -0
- package/dist/mcp/errors.d.ts +100 -0
- package/dist/mcp/errors.d.ts.map +1 -0
- package/dist/mcp/glimpse-ui.d.ts +10 -0
- package/dist/mcp/glimpse-ui.d.ts.map +1 -0
- package/dist/mcp/host-html-template.d.ts +17 -0
- package/dist/mcp/host-html-template.d.ts.map +1 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/init.d.ts +10 -0
- package/dist/mcp/init.d.ts.map +1 -0
- package/dist/mcp/lifecycle.d.ts +30 -0
- package/dist/mcp/lifecycle.d.ts.map +1 -0
- package/dist/mcp/logger.d.ts +52 -0
- package/dist/mcp/logger.d.ts.map +1 -0
- package/dist/mcp/mcp-auth-flow.d.ts +69 -0
- package/dist/mcp/mcp-auth-flow.d.ts.map +1 -0
- package/dist/mcp/mcp-auth.d.ts +100 -0
- package/dist/mcp/mcp-auth.d.ts.map +1 -0
- package/dist/mcp/mcp-callback-server.d.ts +40 -0
- package/dist/mcp/mcp-callback-server.d.ts.map +1 -0
- package/dist/mcp/mcp-oauth-provider.d.ts +101 -0
- package/dist/mcp/mcp-oauth-provider.d.ts.map +1 -0
- package/dist/mcp/metadata-cache.d.ts +32 -0
- package/dist/mcp/metadata-cache.d.ts.map +1 -0
- package/dist/mcp/npx-resolver.d.ts +7 -0
- package/dist/mcp/npx-resolver.d.ts.map +1 -0
- package/dist/mcp/oauth-handler.d.ts +19 -0
- package/dist/mcp/oauth-handler.d.ts.map +1 -0
- package/dist/mcp/onboarding-state.d.ts +13 -0
- package/dist/mcp/onboarding-state.d.ts.map +1 -0
- package/dist/mcp/proxy-modes.d.ts +12 -0
- package/dist/mcp/proxy-modes.d.ts.map +1 -0
- package/dist/mcp/resource-tools.d.ts +2 -0
- package/dist/mcp/resource-tools.d.ts.map +1 -0
- package/dist/mcp/sampling-handler.d.ts +16 -0
- package/dist/mcp/sampling-handler.d.ts.map +1 -0
- package/dist/mcp/server-manager.d.ts +42 -0
- package/dist/mcp/server-manager.d.ts.map +1 -0
- package/dist/mcp/state.d.ts +41 -0
- package/dist/mcp/state.d.ts.map +1 -0
- package/dist/mcp/tool-metadata.d.ts +11 -0
- package/dist/mcp/tool-metadata.d.ts.map +1 -0
- package/dist/mcp/tool-registrar.d.ts +9 -0
- package/dist/mcp/tool-registrar.d.ts.map +1 -0
- package/dist/mcp/types.d.ts +263 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/ui-resource-handler.d.ts +10 -0
- package/dist/mcp/ui-resource-handler.d.ts.map +1 -0
- package/dist/mcp/ui-server.d.ts +37 -0
- package/dist/mcp/ui-server.d.ts.map +1 -0
- package/dist/mcp/ui-session.d.ts +27 -0
- package/dist/mcp/ui-session.d.ts.map +1 -0
- package/dist/mcp/ui-stream-types.d.ts +197 -0
- package/dist/mcp/ui-stream-types.d.ts.map +1 -0
- package/dist/mcp/utils.d.ts +17 -0
- package/dist/mcp/utils.d.ts.map +1 -0
- package/dist/mcp/vitest.config.d.ts +3 -0
- package/dist/mcp/vitest.config.d.ts.map +1 -0
- package/dist/mcp-client.d.ts +58 -0
- package/dist/mcp-client.d.ts.map +1 -0
- package/dist/mcp-client.js +2 -1
- package/dist/memory/branch.d.ts +124 -0
- package/dist/memory/branch.d.ts.map +1 -0
- package/dist/memory/commands/status.d.ts +4 -0
- package/dist/memory/commands/status.d.ts.map +1 -0
- package/dist/memory/commands/view.d.ts +4 -0
- package/dist/memory/commands/view.d.ts.map +1 -0
- package/dist/memory/compaction.d.ts +113 -0
- package/dist/memory/compaction.d.ts.map +1 -0
- package/dist/memory/config.d.ts +27 -0
- package/dist/memory/config.d.ts.map +1 -0
- package/dist/memory/debug-log.d.ts +12 -0
- package/dist/memory/debug-log.d.ts.map +1 -0
- package/dist/memory/hooks/compaction-hook.d.ts +4 -0
- package/dist/memory/hooks/compaction-hook.d.ts.map +1 -0
- package/dist/memory/hooks/compaction-trigger.d.ts +4 -0
- package/dist/memory/hooks/compaction-trigger.d.ts.map +1 -0
- package/dist/memory/hooks/observer-trigger.d.ts +4 -0
- package/dist/memory/hooks/observer-trigger.d.ts.map +1 -0
- package/dist/memory/ids.d.ts +2 -0
- package/dist/memory/ids.d.ts.map +1 -0
- package/dist/memory/index.d.ts +3 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/model-budget.d.ts +4 -0
- package/dist/memory/model-budget.d.ts.map +1 -0
- package/dist/memory/observer.d.ts +21 -0
- package/dist/memory/observer.d.ts.map +1 -0
- package/dist/memory/project-observations-store.d.ts +24 -0
- package/dist/memory/project-observations-store.d.ts.map +1 -0
- package/dist/memory/prompts.d.ts +11 -0
- package/dist/memory/prompts.d.ts.map +1 -0
- package/dist/memory/relevance.d.ts +4 -0
- package/dist/memory/relevance.d.ts.map +1 -0
- package/dist/memory/runtime.d.ts +40 -0
- package/dist/memory/runtime.d.ts.map +1 -0
- package/dist/memory/serialize.d.ts +26 -0
- package/dist/memory/serialize.d.ts.map +1 -0
- package/dist/memory/tokens.d.ts +8 -0
- package/dist/memory/tokens.d.ts.map +1 -0
- package/dist/memory/tools/read-project-observations.d.ts +8 -0
- package/dist/memory/tools/read-project-observations.d.ts.map +1 -0
- package/dist/memory/tools/recall-observation.d.ts +63 -0
- package/dist/memory/tools/recall-observation.d.ts.map +1 -0
- package/dist/memory/tools/write-project-observation.d.ts +9 -0
- package/dist/memory/tools/write-project-observation.d.ts.map +1 -0
- package/dist/memory/types.d.ts +65 -0
- package/dist/memory/types.d.ts.map +1 -0
- package/dist/preflight.d.ts +27 -0
- package/dist/preflight.d.ts.map +1 -0
- package/dist/preflight.js +3 -1
- package/dist/relay/auto-research.d.ts +64 -0
- package/dist/relay/auto-research.d.ts.map +1 -0
- package/dist/relay/auto-research.js +174 -69
- package/dist/relay/client.d.ts +126 -0
- package/dist/relay/client.d.ts.map +1 -0
- package/dist/relay/dispatcher.d.ts +207 -0
- package/dist/relay/dispatcher.d.ts.map +1 -0
- package/dist/relay/machine-store.d.ts +68 -0
- package/dist/relay/machine-store.d.ts.map +1 -0
- package/dist/relay/models-fetch.d.ts +75 -0
- package/dist/relay/models-fetch.d.ts.map +1 -0
- package/dist/relay/registration.d.ts +81 -0
- package/dist/relay/registration.d.ts.map +1 -0
- package/dist/sdk/agent-core/agent-loop.d.ts +24 -0
- package/dist/sdk/agent-core/agent-loop.d.ts.map +1 -0
- package/dist/sdk/agent-core/agent.d.ts +125 -0
- package/dist/sdk/agent-core/agent.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/agent-harness.d.ts +92 -0
- package/dist/sdk/agent-core/harness/agent-harness.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts +53 -0
- package/dist/sdk/agent-core/harness/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/compaction/compaction.d.ts +95 -0
- package/dist/sdk/agent-core/harness/compaction/compaction.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/compaction/utils.d.ts +25 -0
- package/dist/sdk/agent-core/harness/compaction/utils.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/env/nodejs.d.ts +51 -0
- package/dist/sdk/agent-core/harness/env/nodejs.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/messages.d.ts +51 -0
- package/dist/sdk/agent-core/harness/messages.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/prompt-templates.d.ts +48 -0
- package/dist/sdk/agent-core/harness/prompt-templates.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts +26 -0
- package/dist/sdk/agent-core/harness/session/jsonl-repo.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts +33 -0
- package/dist/sdk/agent-core/harness/session/jsonl-storage.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/memory-repo.d.ts +18 -0
- package/dist/sdk/agent-core/harness/session/memory-repo.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/memory-storage.d.ts +25 -0
- package/dist/sdk/agent-core/harness/session/memory-storage.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/repo-utils.d.ts +11 -0
- package/dist/sdk/agent-core/harness/session/repo-utils.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/session.d.ts +32 -0
- package/dist/sdk/agent-core/harness/session/session.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/session/uuid.d.ts +2 -0
- package/dist/sdk/agent-core/harness/session/uuid.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/skills.d.ts +44 -0
- package/dist/sdk/agent-core/harness/skills.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/system-prompt.d.ts +3 -0
- package/dist/sdk/agent-core/harness/system-prompt.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/types.d.ts +601 -0
- package/dist/sdk/agent-core/harness/types.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/utils/shell-output.d.ts +14 -0
- package/dist/sdk/agent-core/harness/utils/shell-output.d.ts.map +1 -0
- package/dist/sdk/agent-core/harness/utils/truncate.d.ts +70 -0
- package/dist/sdk/agent-core/harness/utils/truncate.d.ts.map +1 -0
- package/dist/sdk/agent-core/index.d.ts +20 -0
- package/dist/sdk/agent-core/index.d.ts.map +1 -0
- package/dist/sdk/agent-core/node.d.ts +3 -0
- package/dist/sdk/agent-core/node.d.ts.map +1 -0
- package/dist/sdk/agent-core/proxy.d.ts +69 -0
- package/dist/sdk/agent-core/proxy.d.ts.map +1 -0
- package/dist/sdk/agent-core/types.d.ts +393 -0
- package/dist/sdk/agent-core/types.d.ts.map +1 -0
- package/dist/sdk/ai/api-registry.d.ts +20 -0
- package/dist/sdk/ai/api-registry.d.ts.map +1 -0
- package/dist/sdk/ai/cli.d.ts +3 -0
- package/dist/sdk/ai/cli.d.ts.map +1 -0
- package/dist/sdk/ai/env-api-keys.d.ts +18 -0
- package/dist/sdk/ai/env-api-keys.d.ts.map +1 -0
- package/dist/sdk/ai/image-models.d.ts +10 -0
- package/dist/sdk/ai/image-models.d.ts.map +1 -0
- package/dist/sdk/ai/image-models.generated.d.ts +440 -0
- package/dist/sdk/ai/image-models.generated.d.ts.map +1 -0
- package/dist/sdk/ai/images-api-registry.d.ts +14 -0
- package/dist/sdk/ai/images-api-registry.d.ts.map +1 -0
- package/dist/sdk/ai/images.d.ts +4 -0
- package/dist/sdk/ai/images.d.ts.map +1 -0
- package/dist/sdk/ai/index.d.ts +21 -0
- package/dist/sdk/ai/index.d.ts.map +1 -0
- package/dist/sdk/ai/models.d.ts +18 -0
- package/dist/sdk/ai/models.d.ts.map +1 -0
- package/dist/sdk/ai/models.generated.d.ts +17349 -0
- package/dist/sdk/ai/models.generated.d.ts.map +1 -0
- package/dist/sdk/ai/oauth.d.ts +2 -0
- package/dist/sdk/ai/oauth.d.ts.map +1 -0
- package/dist/sdk/ai/providers/anthropic.d.ts +54 -0
- package/dist/sdk/ai/providers/anthropic.d.ts.map +1 -0
- package/dist/sdk/ai/providers/faux.d.ts +56 -0
- package/dist/sdk/ai/providers/faux.d.ts.map +1 -0
- package/dist/sdk/ai/providers/github-copilot-headers.d.ts +8 -0
- package/dist/sdk/ai/providers/github-copilot-headers.d.ts.map +1 -0
- package/dist/sdk/ai/providers/openai-completions.d.ts +19 -0
- package/dist/sdk/ai/providers/openai-completions.d.ts.map +1 -0
- package/dist/sdk/ai/providers/openai-prompt-cache.d.ts +3 -0
- package/dist/sdk/ai/providers/openai-prompt-cache.d.ts.map +1 -0
- package/dist/sdk/ai/providers/register-builtins.d.ts +15 -0
- package/dist/sdk/ai/providers/register-builtins.d.ts.map +1 -0
- package/dist/sdk/ai/providers/simple-options.d.ts +8 -0
- package/dist/sdk/ai/providers/simple-options.d.ts.map +1 -0
- package/dist/sdk/ai/providers/transform-messages.d.ts +8 -0
- package/dist/sdk/ai/providers/transform-messages.d.ts.map +1 -0
- package/dist/sdk/ai/session-resources.d.ts +4 -0
- package/dist/sdk/ai/session-resources.d.ts.map +1 -0
- package/dist/sdk/ai/stream.d.ts +8 -0
- package/dist/sdk/ai/stream.d.ts.map +1 -0
- package/dist/sdk/ai/types.d.ts +488 -0
- package/dist/sdk/ai/types.d.ts.map +1 -0
- package/dist/sdk/ai/utils/diagnostics.d.ts +19 -0
- package/dist/sdk/ai/utils/diagnostics.d.ts.map +1 -0
- package/dist/sdk/ai/utils/event-stream.d.ts +21 -0
- package/dist/sdk/ai/utils/event-stream.d.ts.map +1 -0
- package/dist/sdk/ai/utils/hash.d.ts +3 -0
- package/dist/sdk/ai/utils/hash.d.ts.map +1 -0
- package/dist/sdk/ai/utils/headers.d.ts +2 -0
- package/dist/sdk/ai/utils/headers.d.ts.map +1 -0
- package/dist/sdk/ai/utils/json-parse.d.ts +16 -0
- package/dist/sdk/ai/utils/json-parse.d.ts.map +1 -0
- package/dist/sdk/ai/utils/node-http-proxy.d.ts +10 -0
- package/dist/sdk/ai/utils/node-http-proxy.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/anthropic.d.ts +25 -0
- package/dist/sdk/ai/utils/oauth/anthropic.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/device-code.d.ts +19 -0
- package/dist/sdk/ai/utils/oauth/device-code.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/github-copilot.d.ts +30 -0
- package/dist/sdk/ai/utils/oauth/github-copilot.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/index.d.ts +58 -0
- package/dist/sdk/ai/utils/oauth/index.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/oauth-page.d.ts +3 -0
- package/dist/sdk/ai/utils/oauth/oauth-page.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/openai-codex.d.ts +34 -0
- package/dist/sdk/ai/utils/oauth/openai-codex.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/pkce.d.ts +13 -0
- package/dist/sdk/ai/utils/oauth/pkce.d.ts.map +1 -0
- package/dist/sdk/ai/utils/oauth/types.d.ts +64 -0
- package/dist/sdk/ai/utils/oauth/types.d.ts.map +1 -0
- package/dist/sdk/ai/utils/overflow.d.ts +56 -0
- package/dist/sdk/ai/utils/overflow.d.ts.map +1 -0
- package/dist/sdk/ai/utils/sanitize-unicode.d.ts +22 -0
- package/dist/sdk/ai/utils/sanitize-unicode.d.ts.map +1 -0
- package/dist/sdk/ai/utils/typebox-helpers.d.ts +17 -0
- package/dist/sdk/ai/utils/typebox-helpers.d.ts.map +1 -0
- package/dist/sdk/ai/utils/validation.d.ts +18 -0
- package/dist/sdk/ai/utils/validation.d.ts.map +1 -0
- package/dist/sdk/coding-agent/cli.d.ts +3 -0
- package/dist/sdk/coding-agent/cli.d.ts.map +1 -0
- package/dist/sdk/coding-agent/config.d.ts +71 -0
- package/dist/sdk/coding-agent/config.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts +117 -0
- package/dist/sdk/coding-agent/core/agent-session-runtime.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/agent-session-services.d.ts +86 -0
- package/dist/sdk/coding-agent/core/agent-session-services.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/agent-session.d.ts +626 -0
- package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/auth-guidance.d.ts +5 -0
- package/dist/sdk/coding-agent/core/auth-guidance.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/auth-storage.d.ts +145 -0
- package/dist/sdk/coding-agent/core/auth-storage.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/bash-executor.d.ts +32 -0
- package/dist/sdk/coding-agent/core/bash-executor.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts +88 -0
- package/dist/sdk/coding-agent/core/compaction/branch-summarization.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts +142 -0
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/index.d.ts +7 -0
- package/dist/sdk/coding-agent/core/compaction/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/utils.d.ts +38 -0
- package/dist/sdk/coding-agent/core/compaction/utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/defaults.d.ts +3 -0
- package/dist/sdk/coding-agent/core/defaults.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/diagnostics.d.ts +15 -0
- package/dist/sdk/coding-agent/core/diagnostics.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/event-bus.d.ts +9 -0
- package/dist/sdk/coding-agent/core/event-bus.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/exec.d.ts +29 -0
- package/dist/sdk/coding-agent/core/exec.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/index.d.ts +12 -0
- package/dist/sdk/coding-agent/core/extensions/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/loader.d.ts +24 -0
- package/dist/sdk/coding-agent/core/extensions/loader.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/loader.js +1 -0
- package/dist/sdk/coding-agent/core/extensions/runner.d.ts +161 -0
- package/dist/sdk/coding-agent/core/extensions/runner.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/types.d.ts +1181 -0
- package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts +20 -0
- package/dist/sdk/coding-agent/core/extensions/wrapper.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/http-dispatcher.d.ts +21 -0
- package/dist/sdk/coding-agent/core/http-dispatcher.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/index.d.ts +12 -0
- package/dist/sdk/coding-agent/core/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/keybindings.d.ts +371 -0
- package/dist/sdk/coding-agent/core/keybindings.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/messages.d.ts +77 -0
- package/dist/sdk/coding-agent/core/messages.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-registry.d.ts +150 -0
- package/dist/sdk/coding-agent/core/model-registry.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts +7 -0
- package/dist/sdk/coding-agent/core/model-resolver-utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/model-resolver.d.ts +110 -0
- package/dist/sdk/coding-agent/core/model-resolver.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/output-guard.d.ts +6 -0
- package/dist/sdk/coding-agent/core/output-guard.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/package-manager.d.ts +204 -0
- package/dist/sdk/coding-agent/core/package-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/prompt-templates.d.ts +52 -0
- package/dist/sdk/coding-agent/core/prompt-templates.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/provider-display-names.d.ts +2 -0
- package/dist/sdk/coding-agent/core/provider-display-names.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/resolve-config-value.d.ts +23 -0
- package/dist/sdk/coding-agent/core/resolve-config-value.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/resource-loader.d.ts +194 -0
- package/dist/sdk/coding-agent/core/resource-loader.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/sdk.d.ts +107 -0
- package/dist/sdk/coding-agent/core/sdk.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/session-cwd.d.ts +19 -0
- package/dist/sdk/coding-agent/core/session-cwd.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/session-manager.d.ts +333 -0
- package/dist/sdk/coding-agent/core/session-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/settings-manager.d.ts +209 -0
- package/dist/sdk/coding-agent/core/settings-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/skills.d.ts +60 -0
- package/dist/sdk/coding-agent/core/skills.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/slash-commands.d.ts +14 -0
- package/dist/sdk/coding-agent/core/slash-commands.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/source-info.d.ts +18 -0
- package/dist/sdk/coding-agent/core/source-info.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/system-prompt.d.ts +28 -0
- package/dist/sdk/coding-agent/core/system-prompt.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/telemetry.d.ts +3 -0
- package/dist/sdk/coding-agent/core/telemetry.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/theme.d.ts +28 -0
- package/dist/sdk/coding-agent/core/theme.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/timings.d.ts +8 -0
- package/dist/sdk/coding-agent/core/timings.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/bash.d.ts +63 -0
- package/dist/sdk/coding-agent/core/tools/bash.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts +87 -0
- package/dist/sdk/coding-agent/core/tools/edit-diff.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/edit.d.ts +39 -0
- package/dist/sdk/coding-agent/core/tools/edit.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts +6 -0
- package/dist/sdk/coding-agent/core/tools/file-mutation-queue.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/find.d.ts +35 -0
- package/dist/sdk/coding-agent/core/tools/find.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/grep.d.ts +37 -0
- package/dist/sdk/coding-agent/core/tools/grep.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/index.d.ts +40 -0
- package/dist/sdk/coding-agent/core/tools/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/ls.d.ts +37 -0
- package/dist/sdk/coding-agent/core/tools/ls.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts +52 -0
- package/dist/sdk/coding-agent/core/tools/output-accumulator.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/path-utils.d.ts +8 -0
- package/dist/sdk/coding-agent/core/tools/path-utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/read.d.ts +35 -0
- package/dist/sdk/coding-agent/core/tools/read.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/read.js +18 -10
- package/dist/sdk/coding-agent/core/tools/render-diff.d.ts +17 -0
- package/dist/sdk/coding-agent/core/tools/render-diff.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/render-utils.d.ts +21 -0
- package/dist/sdk/coding-agent/core/tools/render-utils.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/sdk/coding-agent/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/truncate.d.ts +70 -0
- package/dist/sdk/coding-agent/core/tools/truncate.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/tools/write.d.ts +26 -0
- package/dist/sdk/coding-agent/core/tools/write.d.ts.map +1 -0
- package/dist/sdk/coding-agent/index.d.ts +29 -0
- package/dist/sdk/coding-agent/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/main.d.ts +2 -0
- package/dist/sdk/coding-agent/main.d.ts.map +1 -0
- package/dist/sdk/coding-agent/migrations.d.ts +33 -0
- package/dist/sdk/coding-agent/migrations.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/index.d.ts +8 -0
- package/dist/sdk/coding-agent/modes/index.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/print-mode.d.ts +28 -0
- package/dist/sdk/coding-agent/modes/print-mode.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts +17 -0
- package/dist/sdk/coding-agent/modes/rpc/jsonl.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts +224 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-client.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts +20 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-mode.d.ts.map +1 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts +419 -0
- package/dist/sdk/coding-agent/modes/rpc/rpc-types.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/ansi.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/ansi.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/changelog.d.ts +21 -0
- package/dist/sdk/coding-agent/utils/changelog.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/child-process.d.ts +15 -0
- package/dist/sdk/coding-agent/utils/child-process.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/clipboard-image.d.ts +11 -0
- package/dist/sdk/coding-agent/utils/clipboard-image.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/clipboard-native.d.ts +8 -0
- package/dist/sdk/coding-agent/utils/clipboard-native.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/clipboard.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/clipboard.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/exif-orientation.d.ts +5 -0
- package/dist/sdk/coding-agent/utils/exif-orientation.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/frontmatter.d.ts +8 -0
- package/dist/sdk/coding-agent/utils/frontmatter.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/fs-watch.d.ts +5 -0
- package/dist/sdk/coding-agent/utils/fs-watch.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/git.d.ts +26 -0
- package/dist/sdk/coding-agent/utils/git.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/html.d.ts +7 -0
- package/dist/sdk/coding-agent/utils/html.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/image-convert.d.ts +9 -0
- package/dist/sdk/coding-agent/utils/image-convert.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/image-resize.d.ts +36 -0
- package/dist/sdk/coding-agent/utils/image-resize.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/mime.d.ts +3 -0
- package/dist/sdk/coding-agent/utils/mime.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/paths.d.ts +31 -0
- package/dist/sdk/coding-agent/utils/paths.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/photon.d.ts +13 -0
- package/dist/sdk/coding-agent/utils/photon.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts +2 -0
- package/dist/sdk/coding-agent/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/shell.d.ts +30 -0
- package/dist/sdk/coding-agent/utils/shell.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/sleep.d.ts +5 -0
- package/dist/sdk/coding-agent/utils/sleep.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts +12 -0
- package/dist/sdk/coding-agent/utils/syntax-highlight.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/tools-manager.d.ts +3 -0
- package/dist/sdk/coding-agent/utils/tools-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/version-check.d.ts +15 -0
- package/dist/sdk/coding-agent/utils/version-check.d.ts.map +1 -0
- package/dist/sdk/coding-agent/utils/windows-self-update.d.ts +3 -0
- package/dist/sdk/coding-agent/utils/windows-self-update.d.ts.map +1 -0
- package/dist/server/agent-bridge.d.ts +308 -0
- package/dist/server/agent-bridge.d.ts.map +1 -0
- package/dist/server/handlers/errors.d.ts +26 -0
- package/dist/server/handlers/errors.d.ts.map +1 -0
- package/dist/server/handlers/paths-autocomplete.d.ts +45 -0
- package/dist/server/handlers/paths-autocomplete.d.ts.map +1 -0
- package/dist/server/handlers/projects.d.ts +58 -0
- package/dist/server/handlers/projects.d.ts.map +1 -0
- package/dist/server/handlers/queue.d.ts +27 -0
- package/dist/server/handlers/queue.d.ts.map +1 -0
- package/dist/server/handlers/sessions.d.ts +50 -0
- package/dist/server/handlers/sessions.d.ts.map +1 -0
- package/dist/server/paths.d.ts +51 -0
- package/dist/server/paths.d.ts.map +1 -0
- package/dist/server/session-stream.d.ts +379 -0
- package/dist/server/session-stream.d.ts.map +1 -0
- package/dist/server/shutdown.d.ts +102 -0
- package/dist/server/shutdown.d.ts.map +1 -0
- package/dist/server/storage.d.ts +287 -0
- package/dist/server/storage.d.ts.map +1 -0
- package/dist/server/title-generator.d.ts +25 -0
- package/dist/server/title-generator.d.ts.map +1 -0
- package/dist/server/wire.d.ts +448 -0
- package/dist/server/wire.d.ts.map +1 -0
- package/dist/studio-binding.d.ts +44 -0
- package/dist/studio-binding.d.ts.map +1 -0
- package/dist/studio-binding.js +1 -1
- package/package.json +11 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SQLite-backed project/session/message storage for `spectral serve`.
|
|
3
|
+
*
|
|
4
|
+
* Two-tier model:
|
|
5
|
+
* projects ─< sessions ─< messages
|
|
6
|
+
*
|
|
7
|
+
* Single-process, single-file. Using `better-sqlite3` because:
|
|
8
|
+
* - Synchronous API is a perfect fit for the per-WS-event write pattern.
|
|
9
|
+
* - No connection pool, no callback churn, transactions are trivial.
|
|
10
|
+
* - Native module ships prebuilt binaries for every Node version we support.
|
|
11
|
+
*
|
|
12
|
+
* Schema migrations:
|
|
13
|
+
* We track schema with the `user_version` PRAGMA. When opening a DB whose
|
|
14
|
+
* version does not match `SCHEMA_VERSION`, we DROP every known table and
|
|
15
|
+
* recreate. This is safe pre-1.0 because the agent UI is local-only and
|
|
16
|
+
* the data is conversation history we explicitly opted not to migrate
|
|
17
|
+
* for the project-tier rollout. Anything newer (real users with real
|
|
18
|
+
* data) needs a proper migration table.
|
|
19
|
+
*
|
|
20
|
+
* Foreign keys are enabled so DELETE FROM projects cascades to sessions
|
|
21
|
+
* cascades to messages. The route layer must still tear down any in-flight
|
|
22
|
+
* pi streams BEFORE deleting — see `SessionStreamManager.disposeProjectStreams`.
|
|
23
|
+
*
|
|
24
|
+
* The repo is intentionally a thin wrapper. We do NOT expose `Database`
|
|
25
|
+
* itself — callers go through the typed methods so we can swap the backend
|
|
26
|
+
* later (e.g. if we ever need to colocate with a remote service).
|
|
27
|
+
*/
|
|
28
|
+
import type { ImageAttachment, WireMessage, WireProject, WireSessionDetail, WireSessionSummary } from "./wire.js";
|
|
29
|
+
import type { SupportedMemoryDetails } from "../memory/types.js";
|
|
30
|
+
/** A single message as stored in SQLite. Identical to WireMessage. */
|
|
31
|
+
export type StoredMessage = WireMessage;
|
|
32
|
+
/** Input shape for `appendMessage`. */
|
|
33
|
+
export interface AppendMessageInput {
|
|
34
|
+
/** Optional override; otherwise a UUID is generated. */
|
|
35
|
+
id?: string;
|
|
36
|
+
role: "user" | "assistant" | "system";
|
|
37
|
+
content: string;
|
|
38
|
+
/** Already-serialized JSONL of streamed events. Default "". */
|
|
39
|
+
eventsJsonl?: string;
|
|
40
|
+
/** Optional override; otherwise Date.now(). */
|
|
41
|
+
createdAt?: number;
|
|
42
|
+
/** Base64-encoded images attached to user messages (omitted for assistant/system). */
|
|
43
|
+
images?: ImageAttachment[];
|
|
44
|
+
}
|
|
45
|
+
export interface CreateSessionInput {
|
|
46
|
+
/** Owning project. Required — sessions cannot exist standalone. */
|
|
47
|
+
projectId: string;
|
|
48
|
+
/** Optional override; otherwise a UUID is generated. */
|
|
49
|
+
id?: string;
|
|
50
|
+
/** Optional title; default "New conversation". */
|
|
51
|
+
title?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface CreateProjectInput {
|
|
54
|
+
/** Optional override; otherwise a UUID is generated. */
|
|
55
|
+
id?: string;
|
|
56
|
+
name: string;
|
|
57
|
+
/** Absolute, validated filesystem path. */
|
|
58
|
+
path: string;
|
|
59
|
+
}
|
|
60
|
+
export interface SessionMemorySnapshot {
|
|
61
|
+
sessionId: string;
|
|
62
|
+
summary: string;
|
|
63
|
+
details: SupportedMemoryDetails;
|
|
64
|
+
coveredSourceCount: number;
|
|
65
|
+
updatedAt: number;
|
|
66
|
+
}
|
|
67
|
+
export interface UpdateProjectInput {
|
|
68
|
+
name?: string;
|
|
69
|
+
/** Already-validated absolute path. */
|
|
70
|
+
path?: string;
|
|
71
|
+
}
|
|
72
|
+
interface QueueRow {
|
|
73
|
+
id: string;
|
|
74
|
+
session_id: string;
|
|
75
|
+
content: string;
|
|
76
|
+
position: number;
|
|
77
|
+
created_at: string;
|
|
78
|
+
}
|
|
79
|
+
export declare class SessionStore {
|
|
80
|
+
readonly path: string;
|
|
81
|
+
private db;
|
|
82
|
+
private closed;
|
|
83
|
+
private stmtListProjects;
|
|
84
|
+
private stmtGetProject;
|
|
85
|
+
private stmtCreateProject;
|
|
86
|
+
private stmtUpdateProject;
|
|
87
|
+
private stmtDeleteProject;
|
|
88
|
+
private stmtListSessionsByProject;
|
|
89
|
+
private stmtListSessionIdsByProject;
|
|
90
|
+
private stmtGetSession;
|
|
91
|
+
private stmtCreateSession;
|
|
92
|
+
private stmtDeleteSession;
|
|
93
|
+
private stmtListMessages;
|
|
94
|
+
private stmtAppendMessage;
|
|
95
|
+
private stmtDeleteMessage;
|
|
96
|
+
private stmtDeleteMessagesBySession;
|
|
97
|
+
private stmtTouchSession;
|
|
98
|
+
private stmtRenameSession;
|
|
99
|
+
private stmtSessionWithCount;
|
|
100
|
+
private stmtGetSessionMemorySnapshot;
|
|
101
|
+
private stmtUpsertSessionMemorySnapshot;
|
|
102
|
+
private stmtDeleteSessionMemorySnapshot;
|
|
103
|
+
private stmtGetSessionModel;
|
|
104
|
+
private stmtSetSessionModel;
|
|
105
|
+
private stmtGetSessionReasoningEffort;
|
|
106
|
+
private stmtSetSessionReasoningEffort;
|
|
107
|
+
private stmtSetForkCompactSource;
|
|
108
|
+
private stmtGetForkCompactSource;
|
|
109
|
+
private stmtInsertProjectObs;
|
|
110
|
+
private stmtSearchProjectObs;
|
|
111
|
+
private stmtGetProjectByCwd;
|
|
112
|
+
private stmtEnqueuePrompt;
|
|
113
|
+
private stmtGetPromptQueue;
|
|
114
|
+
private stmtDequeuePrompt;
|
|
115
|
+
private stmtDeleteQueueItem;
|
|
116
|
+
private stmtClearSessionQueue;
|
|
117
|
+
private stmtShiftPositions;
|
|
118
|
+
constructor(path: string);
|
|
119
|
+
/** Smoke check: returns the names of the tables in the DB. */
|
|
120
|
+
listTables(): string[];
|
|
121
|
+
listProjects(): WireProject[];
|
|
122
|
+
createProject(input: CreateProjectInput): WireProject;
|
|
123
|
+
/** Returns null if not found. */
|
|
124
|
+
getProject(id: string): WireProject | null;
|
|
125
|
+
/**
|
|
126
|
+
* Update a project's name and/or path. At least one must be provided.
|
|
127
|
+
* Returns the updated project, or null if not found. Empty `name` falls
|
|
128
|
+
* back to "Untitled project" for parity with createProject.
|
|
129
|
+
*/
|
|
130
|
+
updateProject(id: string, input: UpdateProjectInput): WireProject | null;
|
|
131
|
+
/**
|
|
132
|
+
* Delete a project. Cascades to sessions and messages via FK.
|
|
133
|
+
* Caller MUST tear down any active SessionStream subscribers / pi
|
|
134
|
+
* processes for sessions in this project BEFORE invoking this.
|
|
135
|
+
* Returns the list of session ids that belonged to the project (so
|
|
136
|
+
* the caller can include them in the stream-teardown call).
|
|
137
|
+
*/
|
|
138
|
+
deleteProject(id: string): {
|
|
139
|
+
deleted: boolean;
|
|
140
|
+
sessionIds: string[];
|
|
141
|
+
};
|
|
142
|
+
/** Sessions belonging to a single project, newest-first. */
|
|
143
|
+
listSessionsByProject(projectId: string): WireSessionSummary[];
|
|
144
|
+
createSession(input: CreateSessionInput): WireSessionSummary;
|
|
145
|
+
/** Returns null if not found. */
|
|
146
|
+
getSession(id: string): WireSessionDetail | null;
|
|
147
|
+
/** Convenience for routes/managers that just need the projectId. */
|
|
148
|
+
getSessionProjectId(id: string): string | null;
|
|
149
|
+
getMessages(sessionId: string): StoredMessage[];
|
|
150
|
+
/**
|
|
151
|
+
* Append a message and bump the session's updated_at in one transaction.
|
|
152
|
+
* Throws if the session doesn't exist (FK violation).
|
|
153
|
+
*/
|
|
154
|
+
/** Delete a message by id. No-op if the message doesn't exist. */
|
|
155
|
+
deleteMessage(id: string): void;
|
|
156
|
+
/** Delete all persisted messages for a session. */
|
|
157
|
+
deleteMessagesBySession(sessionId: string): void;
|
|
158
|
+
appendMessage(sessionId: string, msg: AppendMessageInput): StoredMessage;
|
|
159
|
+
/**
|
|
160
|
+
* Rename a session. Bumps `updated_at`. Returns the updated summary, or
|
|
161
|
+
* null if the session doesn't exist. Title is trimmed; an empty title falls
|
|
162
|
+
* back to "New conversation" for parity with createSession().
|
|
163
|
+
*/
|
|
164
|
+
renameSession(id: string, title: string): WireSessionSummary | null;
|
|
165
|
+
/** Returns true if a row was deleted. Cascades to messages. */
|
|
166
|
+
deleteSession(id: string): boolean;
|
|
167
|
+
getSessionMemorySnapshot(sessionId: string): SessionMemorySnapshot | null;
|
|
168
|
+
upsertSessionMemorySnapshot(sessionId: string, snapshot: Omit<SessionMemorySnapshot, "sessionId" | "updatedAt">): void;
|
|
169
|
+
deleteSessionMemorySnapshot(sessionId: string): void;
|
|
170
|
+
/**
|
|
171
|
+
* Get the persisted modelId for a session, or null if none was ever set or
|
|
172
|
+
* the session does not exist. The CLI uses this for cross-restart recovery:
|
|
173
|
+
* when an envelope arrives WITHOUT a `modelId` but SQLite has a value
|
|
174
|
+
* persisted from an earlier turn, we apply the persisted value before
|
|
175
|
+
* forwarding to pi. When neither envelope nor SQLite have a value, we
|
|
176
|
+
* leave model selection to pi's own settings file (pre-Phase-3 behaviour).
|
|
177
|
+
*/
|
|
178
|
+
getSessionModel(sessionId: string): string | null;
|
|
179
|
+
/**
|
|
180
|
+
* Persist the modelId for a session. Pass `null` to clear. Does NOT bump
|
|
181
|
+
* `updated_at` — model selection is metadata, not user activity, so it
|
|
182
|
+
* shouldn't promote a session to the top of the sidebar. Silently no-ops
|
|
183
|
+
* when the session does not exist (the caller has already validated the
|
|
184
|
+
* sessionId via attach/getSession in the normal flow).
|
|
185
|
+
*/
|
|
186
|
+
setSessionModel(sessionId: string, modelId: string | null): void;
|
|
187
|
+
/**
|
|
188
|
+
* Get the persisted reasoningEffort for a session, or null if none
|
|
189
|
+
* was ever set. Returns null for unknown sessions (consistent with
|
|
190
|
+
* getSessionModel's contract).
|
|
191
|
+
*/
|
|
192
|
+
getSessionReasoningEffort(sessionId: string): string | null;
|
|
193
|
+
/**
|
|
194
|
+
* Persist the reasoningEffort for a session. Pass `null` to clear.
|
|
195
|
+
* Same semantics as setSessionModel — best-effort metadata, does
|
|
196
|
+
* not bump `updated_at`.
|
|
197
|
+
*/
|
|
198
|
+
setSessionReasoningEffort(sessionId: string, effort: string | null): void;
|
|
199
|
+
/**
|
|
200
|
+
* Fork a session: create a new session in the same project, copy all
|
|
201
|
+
* messages from the source, and set the `fork_compact_source_id` flag
|
|
202
|
+
* so SessionStreamManager compacts the context after the first assistant
|
|
203
|
+
* turn completes.
|
|
204
|
+
*/
|
|
205
|
+
forkSession(sourceId: string, opts?: {
|
|
206
|
+
title?: string;
|
|
207
|
+
newSessionId?: string;
|
|
208
|
+
}): WireSessionSummary;
|
|
209
|
+
/**
|
|
210
|
+
* Read the fork-compact source id for a session, or null if the session
|
|
211
|
+
* was not forked or has already been compacted.
|
|
212
|
+
*/
|
|
213
|
+
getForkCompactSource(sessionId: string): string | null;
|
|
214
|
+
/**
|
|
215
|
+
* Clear the fork-compact flag after compaction completes (or fails).
|
|
216
|
+
* Idempotent-safe.
|
|
217
|
+
*/
|
|
218
|
+
clearForkCompactSource(sessionId: string): void;
|
|
219
|
+
/**
|
|
220
|
+
* Insert multiple project observations in a single transaction.
|
|
221
|
+
* Uses INSERT OR REPLACE so re-running after the same compaction is idempotent.
|
|
222
|
+
*/
|
|
223
|
+
insertProjectObservations(projectId: string, sessionId: string, observations: Array<{
|
|
224
|
+
id: string;
|
|
225
|
+
content: string;
|
|
226
|
+
relevance: string;
|
|
227
|
+
}>, createdAt: number): void;
|
|
228
|
+
/**
|
|
229
|
+
* Search project observations by substring match. Returns up to 20 most recent.
|
|
230
|
+
*/
|
|
231
|
+
searchProjectObservations(projectId: string, query: string, limit?: number): Array<{
|
|
232
|
+
content: string;
|
|
233
|
+
relevance: string;
|
|
234
|
+
createdAt: number;
|
|
235
|
+
sessionId: string;
|
|
236
|
+
}>;
|
|
237
|
+
/**
|
|
238
|
+
* Look up a project by its absolute filesystem path.
|
|
239
|
+
* Returns null when no project has been registered for the given path.
|
|
240
|
+
*/
|
|
241
|
+
getProjectByCwd(cwd: string): string | null;
|
|
242
|
+
/**
|
|
243
|
+
* Enqueue a prompt for a session. Returns the created queue item.
|
|
244
|
+
* Position is auto-assigned as (max existing position + 1).
|
|
245
|
+
*/
|
|
246
|
+
enqueuePrompt(sessionId: string, content: string): QueueRow;
|
|
247
|
+
/**
|
|
248
|
+
* Dequeue (remove and return) the first prompt for a session.
|
|
249
|
+
* Returns null if the queue is empty.
|
|
250
|
+
* Renumbers remaining items so positions stay contiguous from 0.
|
|
251
|
+
*/
|
|
252
|
+
dequeuePrompt(sessionId: string): QueueRow | null;
|
|
253
|
+
/**
|
|
254
|
+
* Get the full prompt queue for a session, ordered by position.
|
|
255
|
+
*/
|
|
256
|
+
getPromptQueue(sessionId: string): QueueRow[];
|
|
257
|
+
/**
|
|
258
|
+
* Remove a specific prompt from the queue by id.
|
|
259
|
+
* Renumbers remaining items so positions stay contiguous.
|
|
260
|
+
*/
|
|
261
|
+
removePrompt(sessionId: string, itemId: string): void;
|
|
262
|
+
/**
|
|
263
|
+
* Clear the entire prompt queue for a session.
|
|
264
|
+
*/
|
|
265
|
+
clearPromptQueue(sessionId: string): void;
|
|
266
|
+
close(): void;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Pre-flight: verify that better-sqlite3 loads and a writable DB can be opened.
|
|
270
|
+
*
|
|
271
|
+
* Called before binding the port so a broken native build fails loudly with
|
|
272
|
+
* a helpful hint instead of crashing later when the first WS connection
|
|
273
|
+
* arrives.
|
|
274
|
+
*
|
|
275
|
+
* Implementation note: we test by opening the *real* target path. Opening a
|
|
276
|
+
* tmpfile would only verify that the native module loads, not that the
|
|
277
|
+
* config dir is writable. Since `open()` already creates the file/dir
|
|
278
|
+
* idempotently, this is safe to call repeatedly.
|
|
279
|
+
*/
|
|
280
|
+
export interface PreflightResult {
|
|
281
|
+
ok: boolean;
|
|
282
|
+
/** Human-friendly error message ready to print. Set when ok=false. */
|
|
283
|
+
error?: string;
|
|
284
|
+
}
|
|
285
|
+
export declare function preflightSqlite(dbPath: string): PreflightResult;
|
|
286
|
+
export {};
|
|
287
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/server/storage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AASH,OAAO,KAAK,EACV,eAAe,EACf,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAGjE,sEAAsE;AACtE,MAAM,MAAM,aAAa,GAAG,WAAW,CAAC;AAExC,uCAAuC;AACvC,MAAM,WAAW,kBAAkB;IACjC,wDAAwD;IACxD,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,I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;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAWtF;;;OAGG;IACH,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAS3C;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,QAAQ;IAW3D;;;;OAIG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI;IAYjD;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,EAAE;IAI7C;;;OAGG;IACH,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAUrD;;OAEG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAIzC,KAAK,IAAI,IAAI;CAKd;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,sEAAsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,CAkB/D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session title utilities.
|
|
3
|
+
*
|
|
4
|
+
* Pure helpers for title sanitization and default-title detection.
|
|
5
|
+
* Title generation now happens via the backend GraphQL mutation
|
|
6
|
+
* `generateSessionTitle`, called from the landing frontend after the
|
|
7
|
+
* first assistant turn completes. The CLI no longer has its own LLM
|
|
8
|
+
* pipeline for titles — the landing→backend→CLI REST PATCH flow
|
|
9
|
+
* handles both the rename and the cross-tab meta publish.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SESSION_TITLE_DEFAULT = "New conversation";
|
|
12
|
+
/** True if `title` looks like the auto-generated default and is fair game. */
|
|
13
|
+
export declare function isDefaultTitle(title: string | null | undefined): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Sanitize raw LLM output into a usable session title.
|
|
16
|
+
* Returns `null` if nothing usable remains.
|
|
17
|
+
*/
|
|
18
|
+
export declare function sanitizeTitle(raw: string): string | null;
|
|
19
|
+
/**
|
|
20
|
+
* A function that takes a prompt string and returns LLM output text.
|
|
21
|
+
* Tests inject stubs here; production code no longer uses this type
|
|
22
|
+
* since the CLI-side auto-title pipeline was removed.
|
|
23
|
+
*/
|
|
24
|
+
export type LlmCall = (prompt: string) => Promise<string>;
|
|
25
|
+
//# sourceMappingURL=title-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"title-generator.d.ts","sourceRoot":"","sources":["../../src/server/title-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,eAAO,MAAM,qBAAqB,qBAAqB,CAAC;AAExD,8EAA8E;AAC9E,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAGxE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAoCxD;AAED;;;;GAIG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC"}
|