@aexol/spectral 0.9.230 → 0.9.234
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 +2 -0
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +89 -14
- package/dist/backend/generated-images.d.ts +1 -1
- package/dist/backend/generated-images.d.ts.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +12 -1
- package/dist/designer/data/skills/blog-post.d.ts +3 -0
- package/dist/designer/data/skills/blog-post.d.ts.map +1 -0
- package/dist/designer/data/skills/blog-post.js +84 -0
- package/dist/designer/data/skills/blog-post.ts +87 -0
- package/dist/designer/data/skills/critique.d.ts +3 -0
- package/dist/designer/data/skills/critique.d.ts.map +1 -0
- package/dist/designer/data/skills/critique.js +109 -0
- package/dist/designer/data/skills/critique.ts +112 -0
- package/dist/designer/data/skills/dashboard.d.ts +3 -0
- package/dist/designer/data/skills/dashboard.d.ts.map +1 -0
- package/dist/designer/data/skills/dashboard.js +165 -0
- package/dist/designer/data/skills/dashboard.ts +168 -0
- package/dist/designer/data/skills/design-brief.d.ts +3 -0
- package/dist/designer/data/skills/design-brief.d.ts.map +1 -0
- package/dist/designer/data/skills/design-brief.js +141 -0
- package/dist/designer/data/skills/design-brief.ts +144 -0
- package/dist/designer/data/skills/design-skill.d.ts +10 -0
- package/dist/designer/data/skills/design-skill.d.ts.map +1 -0
- package/dist/designer/data/skills/design-skill.js +1 -0
- package/dist/designer/data/skills/design-skill.ts +9 -0
- package/dist/designer/data/skills/docs-page.d.ts +3 -0
- package/dist/designer/data/skills/docs-page.d.ts.map +1 -0
- package/dist/designer/data/skills/docs-page.js +68 -0
- package/dist/designer/data/skills/docs-page.ts +71 -0
- package/dist/designer/data/skills/index.d.ts +3 -0
- package/dist/designer/data/skills/index.d.ts.map +1 -0
- package/dist/designer/data/skills/index.js +28 -0
- package/dist/designer/data/skills/index.ts +30 -0
- package/dist/designer/data/skills/magazine-poster.d.ts +3 -0
- package/dist/designer/data/skills/magazine-poster.d.ts.map +1 -0
- package/dist/designer/data/skills/magazine-poster.js +70 -0
- package/dist/designer/data/skills/magazine-poster.ts +73 -0
- package/dist/designer/data/skills/mobile-app.d.ts +3 -0
- package/dist/designer/data/skills/mobile-app.d.ts.map +1 -0
- package/dist/designer/data/skills/mobile-app.js +229 -0
- package/dist/designer/data/skills/mobile-app.ts +232 -0
- package/dist/designer/data/skills/motion-frames.d.ts +3 -0
- package/dist/designer/data/skills/motion-frames.d.ts.map +1 -0
- package/dist/designer/data/skills/motion-frames.js +121 -0
- package/dist/designer/data/skills/motion-frames.ts +124 -0
- package/dist/designer/data/skills/pricing-page.d.ts +3 -0
- package/dist/designer/data/skills/pricing-page.d.ts.map +1 -0
- package/dist/designer/data/skills/pricing-page.js +76 -0
- package/dist/designer/data/skills/pricing-page.ts +79 -0
- package/dist/designer/data/skills/saas-landing.d.ts +3 -0
- package/dist/designer/data/skills/saas-landing.d.ts.map +1 -0
- package/dist/designer/data/skills/saas-landing.js +71 -0
- package/dist/designer/data/skills/saas-landing.ts +74 -0
- package/dist/designer/data/skills/slide-deck.d.ts +3 -0
- package/dist/designer/data/skills/slide-deck.d.ts.map +1 -0
- package/dist/designer/data/skills/slide-deck.js +213 -0
- package/dist/designer/data/skills/slide-deck.ts +216 -0
- package/dist/designer/data/skills/social-carousel.d.ts +3 -0
- package/dist/designer/data/skills/social-carousel.d.ts.map +1 -0
- package/dist/designer/data/skills/social-carousel.js +135 -0
- package/dist/designer/data/skills/social-carousel.ts +138 -0
- package/dist/designer/data/skills/web-prototype.d.ts +3 -0
- package/dist/designer/data/skills/web-prototype.d.ts.map +1 -0
- package/dist/designer/data/skills/web-prototype.js +159 -0
- package/dist/designer/data/skills/web-prototype.ts +162 -0
- package/dist/designer/skills.d.ts +4 -10
- package/dist/designer/skills.d.ts.map +1 -1
- package/dist/designer/skills.js +2 -1643
- package/dist/extensions/logic-trace.d.ts +1 -1
- package/dist/extensions/logic-trace.d.ts.map +1 -1
- package/dist/extensions/logic-trace.js +199 -70
- package/dist/extensions/video-generation/index.d.ts +3 -0
- package/dist/extensions/video-generation/index.d.ts.map +1 -0
- package/dist/extensions/video-generation/index.js +299 -0
- package/dist/extensions/wizard/index.js +9 -1
- package/dist/generated/parser/ast/nodes.d.ts +115 -0
- package/dist/generated/parser/ast/nodes.d.ts.map +1 -0
- package/dist/generated/parser/ast/nodes.js +8 -0
- package/dist/generated/parser/lexer/lexer.d.ts +28 -0
- package/dist/generated/parser/lexer/lexer.d.ts.map +1 -0
- package/dist/generated/parser/{lexer.js → lexer/lexer.js} +1 -180
- package/dist/generated/parser/{lexer.d.ts → lexer/tokens.d.ts} +5 -24
- package/dist/generated/parser/lexer/tokens.d.ts.map +1 -0
- package/dist/generated/parser/lexer/tokens.js +187 -0
- package/dist/generated/parser/mod.d.ts +5 -7
- package/dist/generated/parser/mod.d.ts.map +1 -1
- package/dist/generated/parser/mod.js +2 -1
- package/dist/generated/parser/parser/cursor.d.ts +47 -0
- package/dist/generated/parser/parser/cursor.d.ts.map +1 -0
- package/dist/generated/parser/parser/cursor.js +12 -0
- package/dist/generated/parser/parser/definitions.d.ts +16 -0
- package/dist/generated/parser/parser/definitions.d.ts.map +1 -0
- package/dist/generated/parser/parser/definitions.js +353 -0
- package/dist/generated/parser/parser/expressions.d.ts +17 -0
- package/dist/generated/parser/parser/expressions.d.ts.map +1 -0
- package/dist/generated/parser/parser/expressions.js +165 -0
- package/dist/generated/parser/parser.d.ts +18 -133
- package/dist/generated/parser/parser.d.ts.map +1 -1
- package/dist/generated/parser/parser.js +9 -505
- package/dist/generated/parser/tokenizer.d.ts +1 -2
- package/dist/generated/parser/tokenizer.d.ts.map +1 -1
- package/dist/generated/parser/tokenizer.js +2 -1
- package/dist/generated/parser/validator.d.ts +1 -1
- package/dist/generated/parser/validator.d.ts.map +1 -1
- package/dist/generated/zeus/const.d.ts.map +1 -1
- package/dist/generated/zeus/const.js +30 -0
- package/dist/generated/zeus/index.d.ts +140 -0
- package/dist/generated/zeus/index.d.ts.map +1 -1
- package/dist/generated/zeus/index.js +5 -0
- package/dist/mcp/glimpse-ui.js +9 -1
- package/dist/relay/dispatcher.d.ts +23 -104
- package/dist/relay/dispatcher.d.ts.map +1 -1
- package/dist/relay/dispatcher.js +21 -1130
- package/dist/relay/rest.d.ts +31 -0
- package/dist/relay/rest.d.ts.map +1 -0
- package/dist/relay/rest.js +85 -0
- package/dist/relay/routing.d.ts +109 -0
- package/dist/relay/routing.d.ts.map +1 -0
- package/dist/relay/routing.js +669 -0
- package/dist/relay/wizard-login.d.ts +17 -0
- package/dist/relay/wizard-login.d.ts.map +1 -0
- package/dist/relay/wizard-login.js +419 -0
- package/dist/sdk/agent-core/agent-loop.d.ts +2 -9
- package/dist/sdk/agent-core/agent-loop.d.ts.map +1 -1
- package/dist/sdk/agent-core/agent-loop.js +17 -291
- package/dist/sdk/agent-core/agent.d.ts +11 -4
- package/dist/sdk/agent-core/agent.d.ts.map +1 -1
- package/dist/sdk/agent-core/agent.js +16 -4
- package/dist/sdk/agent-core/tool-call-registry.d.ts +75 -0
- package/dist/sdk/agent-core/tool-call-registry.d.ts.map +1 -0
- package/dist/sdk/agent-core/tool-call-registry.js +131 -0
- package/dist/sdk/agent-core/tool-execution.d.ts +33 -0
- package/dist/sdk/agent-core/tool-execution.d.ts.map +1 -0
- package/dist/sdk/agent-core/tool-execution.js +399 -0
- package/dist/sdk/agent-core/types.d.ts +15 -4
- package/dist/sdk/agent-core/types.d.ts.map +1 -1
- package/dist/sdk/ai/env-api-keys.js +9 -1
- package/dist/sdk/ai/index.d.ts +3 -0
- package/dist/sdk/ai/index.d.ts.map +1 -1
- package/dist/sdk/ai/index.js +3 -0
- package/dist/sdk/ai/providers/faux.d.ts.map +1 -1
- package/dist/sdk/ai/providers/faux.js +3 -0
- package/dist/sdk/ai/providers/leaked-tool-call-parser.d.ts +39 -6
- package/dist/sdk/ai/providers/leaked-tool-call-parser.d.ts.map +1 -1
- package/dist/sdk/ai/providers/leaked-tool-call-parser.js +159 -18
- package/dist/sdk/ai/providers/openai/reasoning-replay.d.ts +48 -0
- package/dist/sdk/ai/providers/openai/reasoning-replay.d.ts.map +1 -0
- package/dist/sdk/ai/providers/openai/reasoning-replay.js +209 -0
- package/dist/sdk/ai/providers/openai-completions.d.ts.map +1 -1
- package/dist/sdk/ai/providers/openai-completions.js +23 -211
- package/dist/sdk/ai/providers/openrouter-videos.d.ts +3 -0
- package/dist/sdk/ai/providers/openrouter-videos.d.ts.map +1 -0
- package/dist/sdk/ai/providers/openrouter-videos.js +412 -0
- package/dist/sdk/ai/providers/register-builtins.d.ts.map +1 -1
- package/dist/sdk/ai/providers/register-builtins.js +6 -0
- package/dist/sdk/ai/providers/simple-options.d.ts +1 -6
- package/dist/sdk/ai/providers/simple-options.d.ts.map +1 -1
- package/dist/sdk/ai/providers/simple-options.js +0 -22
- package/dist/sdk/ai/providers/transform-messages.d.ts.map +1 -1
- package/dist/sdk/ai/providers/transform-messages.js +52 -1
- package/dist/sdk/ai/types.d.ts +91 -10
- package/dist/sdk/ai/types.d.ts.map +1 -1
- package/dist/sdk/ai/video-models.d.ts +10 -0
- package/dist/sdk/ai/video-models.d.ts.map +1 -0
- package/dist/sdk/ai/video-models.generated.d.ts +440 -0
- package/dist/sdk/ai/video-models.generated.d.ts.map +1 -0
- package/dist/sdk/ai/video-models.generated.js +441 -0
- package/dist/sdk/ai/video-models.js +22 -0
- package/dist/sdk/ai/videos-api-registry.d.ts +14 -0
- package/dist/sdk/ai/videos-api-registry.d.ts.map +1 -0
- package/dist/sdk/ai/videos-api-registry.js +21 -0
- package/dist/sdk/ai/videos.d.ts +4 -0
- package/dist/sdk/ai/videos.d.ts.map +1 -0
- package/dist/sdk/ai/videos.js +13 -0
- package/dist/sdk/coding-agent/core/agent-session.d.ts +8 -0
- package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/agent-session.js +11 -0
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts +6 -118
- package/dist/sdk/coding-agent/core/compaction/compaction.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/compaction/compaction.js +11 -733
- package/dist/sdk/coding-agent/core/compaction/cut-points.d.ts +58 -0
- package/dist/sdk/coding-agent/core/compaction/cut-points.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/cut-points.js +191 -0
- package/dist/sdk/coding-agent/core/compaction/dedupe.d.ts +28 -0
- package/dist/sdk/coding-agent/core/compaction/dedupe.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/dedupe.js +156 -0
- package/dist/sdk/coding-agent/core/compaction/summarize.d.ts +21 -0
- package/dist/sdk/coding-agent/core/compaction/summarize.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/summarize.js +181 -0
- package/dist/sdk/coding-agent/core/compaction/tokens.d.ts +47 -0
- package/dist/sdk/coding-agent/core/compaction/tokens.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/compaction/tokens.js +224 -0
- package/dist/sdk/coding-agent/core/extensions/loader.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/extensions/loader.js +14 -0
- package/dist/sdk/coding-agent/core/extensions/native-extensions.d.ts +26 -0
- package/dist/sdk/coding-agent/core/extensions/native-extensions.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/extensions/native-extensions.js +23 -0
- package/dist/sdk/coding-agent/core/extensions/session-events.d.ts +157 -0
- package/dist/sdk/coding-agent/core/extensions/session-events.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/session-events.js +13 -0
- package/dist/sdk/coding-agent/core/extensions/types.d.ts +10 -367
- package/dist/sdk/coding-agent/core/extensions/types.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/extensions/types.js +2 -10
- package/dist/sdk/coding-agent/core/extensions/ui-types.d.ts +219 -0
- package/dist/sdk/coding-agent/core/extensions/ui-types.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/extensions/ui-types.js +4 -0
- package/dist/sdk/coding-agent/core/messages.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/messages.js +42 -2
- package/dist/sdk/coding-agent/core/package/default-package-manager.d.ts +115 -0
- package/dist/sdk/coding-agent/core/package/default-package-manager.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/package/default-package-manager.js +1184 -0
- package/dist/sdk/coding-agent/core/package/discovery.d.ts +20 -0
- package/dist/sdk/coding-agent/core/package/discovery.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/package/discovery.js +283 -0
- package/dist/sdk/coding-agent/core/package/ignore.d.ts +29 -0
- package/dist/sdk/coding-agent/core/package/ignore.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/package/ignore.js +235 -0
- package/dist/sdk/coding-agent/core/package/types.d.ts +128 -0
- package/dist/sdk/coding-agent/core/package/types.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/package/types.js +18 -0
- package/dist/sdk/coding-agent/core/package/update-check.d.ts +43 -0
- package/dist/sdk/coding-agent/core/package/update-check.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/package/update-check.js +253 -0
- package/dist/sdk/coding-agent/core/package-manager.d.ts +2 -188
- package/dist/sdk/coding-agent/core/package-manager.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/package-manager.js +1 -1940
- package/dist/sdk/coding-agent/core/resource-loader.d.ts +11 -0
- package/dist/sdk/coding-agent/core/resource-loader.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/resource-loader.js +23 -6
- package/dist/sdk/coding-agent/core/sdk.d.ts +24 -2
- package/dist/sdk/coding-agent/core/sdk.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/sdk.js +15 -3
- package/dist/sdk/coding-agent/core/session/migrate.d.ts +18 -0
- package/dist/sdk/coding-agent/core/session/migrate.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/session/migrate.js +78 -0
- package/dist/sdk/coding-agent/core/session/types.d.ts +165 -0
- package/dist/sdk/coding-agent/core/session/types.d.ts.map +1 -0
- package/dist/sdk/coding-agent/core/session/types.js +4 -0
- package/dist/sdk/coding-agent/core/session-manager.d.ts +3 -161
- package/dist/sdk/coding-agent/core/session-manager.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/session-manager.js +4 -72
- package/dist/sdk/coding-agent/core/settings-manager.d.ts +0 -8
- package/dist/sdk/coding-agent/core/settings-manager.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/settings-manager.js +3 -3
- package/dist/sdk/coding-agent/index.d.ts +2 -2
- package/dist/sdk/coding-agent/index.d.ts.map +1 -1
- package/dist/sdk/coding-agent/index.js +1 -1
- package/dist/sdk-public.d.ts +96 -0
- package/dist/sdk-public.d.ts.map +1 -0
- package/dist/sdk-public.js +109 -0
- package/dist/server/agent-bridge/rehydrate.d.ts +2 -2
- package/dist/server/agent-bridge/rehydrate.d.ts.map +1 -1
- package/dist/server/agent-bridge/rehydrate.js +14 -0
- package/dist/server/agent-bridge.d.ts +8 -2
- package/dist/server/agent-bridge.d.ts.map +1 -1
- package/dist/server/agent-bridge.js +25 -2
- package/dist/server/session-stream.d.ts +19 -0
- package/dist/server/session-stream.d.ts.map +1 -1
- package/dist/server/session-stream.js +35 -0
- package/dist/server/wire.d.ts +13 -0
- package/dist/server/wire.d.ts.map +1 -1
- package/package.json +8 -2
- package/dist/generated/parser/lexer.d.ts.map +0 -1
|
@@ -698,6 +698,11 @@ export var PresetSource;
|
|
|
698
698
|
PresetSource["SYSTEM"] = "SYSTEM";
|
|
699
699
|
PresetSource["USER"] = "USER";
|
|
700
700
|
})(PresetSource || (PresetSource = {}));
|
|
701
|
+
export var FollowUpMode;
|
|
702
|
+
(function (FollowUpMode) {
|
|
703
|
+
FollowUpMode["INJECT"] = "INJECT";
|
|
704
|
+
FollowUpMode["QUEUE"] = "QUEUE";
|
|
705
|
+
})(FollowUpMode || (FollowUpMode = {}));
|
|
701
706
|
export var AgentMode;
|
|
702
707
|
(function (AgentMode) {
|
|
703
708
|
AgentMode["SUBAGENT"] = "SUBAGENT";
|
package/dist/mcp/glimpse-ui.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
2
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
3
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
4
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
5
|
+
});
|
|
6
|
+
}
|
|
7
|
+
return path;
|
|
8
|
+
};
|
|
1
9
|
import { existsSync } from "node:fs";
|
|
2
10
|
import { execFileSync } from "node:child_process";
|
|
3
11
|
import { join, dirname } from "node:path";
|
|
@@ -43,7 +51,7 @@ export async function openGlimpseWindow(html, options) {
|
|
|
43
51
|
const modulePath = resolvedBinaryPath
|
|
44
52
|
? join(dirname(resolvedBinaryPath), "glimpse.mjs")
|
|
45
53
|
: "glimpseui";
|
|
46
|
-
const glimpse = await import(modulePath);
|
|
54
|
+
const glimpse = await import(__rewriteRelativeImportExtension(modulePath));
|
|
47
55
|
let active = true;
|
|
48
56
|
const win = glimpse.open(html, {
|
|
49
57
|
width: options.width ?? 900,
|
|
@@ -37,115 +37,22 @@
|
|
|
37
37
|
* - Backend cancels pending REST requests with `code:"timeout"` (30 s)
|
|
38
38
|
* or `code:"machine_offline"` (CLI socket dropped). Both are
|
|
39
39
|
* transparent to this layer — we just respond when we can.
|
|
40
|
+
*
|
|
41
|
+
* Path matching + the REST request handler + the wizard login flow live in
|
|
42
|
+
* sibling modules (`routing.ts`, `rest.ts`, `wizard-login.ts`) and are
|
|
43
|
+
* re-exported below so existing imports from `relay/dispatcher.js` keep
|
|
44
|
+
* working.
|
|
40
45
|
*/
|
|
41
|
-
import type { AutoOptimizeFrame, AutoResearchFrame, CancelTurnFrame, ClientMessageFrame,
|
|
42
|
-
import type { McpExtensionState } from "../mcp/state.js";
|
|
46
|
+
import type { AutoOptimizeFrame, AutoResearchFrame, CancelTurnFrame, ClientMessageFrame, SubscribeFrame, StopToolCallFrame } from "@aexol/relay-protocol";
|
|
43
47
|
import type { SessionStreamManager, Subscriber } from "../server/session-stream.js";
|
|
44
48
|
import type { SessionStore } from "../server/storage.js";
|
|
45
49
|
import { coerceImages, hasImages, MAX_INLINE_IMAGE_BASE64_CHARS } from "../server/image-attachments.js";
|
|
46
|
-
import type { DevProcessRegistry } from "../server/dev-process-registry.js";
|
|
47
50
|
import type { RelayClient } from "./client.js";
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
route: "list_projects" | "create_project" | "update_project" | "delete_project" | "bind_studio" | "unbind_studio" | "get_project_observations" | "list_project_sessions" | "cleanup_project_sessions" | "cleanup_all_sessions" | "create_session" | "get_session" | "get_session_active_agent" | "update_session_active_agent" | "get_session_messages" | "update_session" | "delete_session" | "get_session_memory" | "get_session_memory_details" | "compact_session" | "remember_and_delete_session" | "fork_session" | "list_path_autocomplete" | "list_directory" | "get_home_directory" | "search_project_files" | "enqueue_prompt" | "get_prompt_queue" | "remove_prompt" | "clear_prompt_queue" | "list_mcp_status" | "reload_mcp_config" | "refresh_native_extensions" | "refresh_cloud_agents" | "get_settings" | "put_settings" | "get_agent_settings" | "put_agent_settings" | "get_prompt_mutation_settings" | "put_prompt_mutation_settings" | "wizard_login" | "list_agents" | "list_dev_processes" | "start_dev_process" | "kill_dev_process" | "restart_dev_process" | "scan_dev_servers" | "kill_dev_server";
|
|
54
|
-
id?: string;
|
|
55
|
-
/** Parsed query params, if the path carried a `?...` suffix. */
|
|
56
|
-
query?: URLSearchParams;
|
|
57
|
-
/** For `remove_prompt`: the queue item id extracted from the path. */
|
|
58
|
-
itemId?: string;
|
|
59
|
-
/** For `kill_dev_server`: optional target port from the query string. */
|
|
60
|
-
port?: number;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Inline path matcher. Returns `null` for any path/method combination we
|
|
64
|
-
* don't recognise; the caller turns that into a `404 Unknown route`.
|
|
65
|
-
*
|
|
66
|
-
* Intentionally literal — a regex table would be marginally fancier but
|
|
67
|
-
* also marginally slower and harder to read for ~11 routes.
|
|
68
|
-
*/
|
|
69
|
-
export declare function matchRoute(method: string, path: string): RouteMatch | null;
|
|
70
|
-
/**
|
|
71
|
-
* Best-effort publisher for project/session lifecycle meta events. Bound
|
|
72
|
-
* by `serve.ts` to `relay.send({kind:"meta_event", machineId, event})`;
|
|
73
|
-
* tests pass a recording stub. Always called inside a try/catch by the
|
|
74
|
-
* dispatcher so a publish failure never breaks the REST response — the
|
|
75
|
-
* mutation already succeeded.
|
|
76
|
-
*
|
|
77
|
-
* Omit (`undefined`) to disable publishing entirely (used in the handler
|
|
78
|
-
* unit tests where there's no relay).
|
|
79
|
-
*/
|
|
80
|
-
export type PublishMetaEvent = (event: MetaEvent) => void;
|
|
81
|
-
export interface RestRequestDeps {
|
|
82
|
-
store: SessionStore;
|
|
83
|
-
manager: SessionStreamManager;
|
|
84
|
-
/** Working directory for this machine. Used by settings persistence. Defaults to homedir. */
|
|
85
|
-
cwd?: string;
|
|
86
|
-
/** Agent config dir (`~/.spectral/agent` by default). Passed through to agent-settings persistence. */
|
|
87
|
-
agentDir?: string;
|
|
88
|
-
/**
|
|
89
|
-
* Optional logger for unexpected errors and per-request timing.
|
|
90
|
-
* Defaults to `console`; optional methods are guarded so a minimal
|
|
91
|
-
* `{ error }` logger (used by tests) remains valid.
|
|
92
|
-
*/
|
|
93
|
-
logger?: {
|
|
94
|
-
error?: (...args: unknown[]) => void;
|
|
95
|
-
info?: (...args: unknown[]) => void;
|
|
96
|
-
};
|
|
97
|
-
/**
|
|
98
|
-
* Optional MCP extension state. Passed through by `serve.ts` from the
|
|
99
|
-
* `AgentBridge`. When set, `GET /api/mcp-status` returns the current
|
|
100
|
-
* machine-local MCP snapshot.
|
|
101
|
-
*/
|
|
102
|
-
mcpState?: McpExtensionState;
|
|
103
|
-
/** Machine-level dev process registry. Used by `/api/dev-processes`. */
|
|
104
|
-
devProcessRegistry?: DevProcessRegistry;
|
|
105
|
-
/**
|
|
106
|
-
* Optional meta-event publisher. Invoked AFTER each successful mutation
|
|
107
|
-
* (create/update/delete project, create/update/delete session) so all
|
|
108
|
-
* tabs of all browsers subscribed to this machine refetch. Read paths
|
|
109
|
-
* (`list_*`, `get_*`) never publish.
|
|
110
|
-
*
|
|
111
|
-
* Failure handling: any throw is caught + logged; we never propagate
|
|
112
|
-
* publish failures into the REST response (the SQLite mutation has
|
|
113
|
-
* already committed and the caller deserves the success it asked for).
|
|
114
|
-
*/
|
|
115
|
-
publishMetaEvent?: PublishMetaEvent;
|
|
116
|
-
refreshNativeExtensions?: () => Promise<void>;
|
|
117
|
-
/**
|
|
118
|
-
* Refresh the cloud-agent cache. Returns a result describing whether the
|
|
119
|
-
* backend rejected auth; callers that just need a cache warm may ignore it
|
|
120
|
-
* (the bridge handles auth-rejection separately via onCloudAgentsAuthRejected).
|
|
121
|
-
*/
|
|
122
|
-
refreshCloudAgents?: (teamId: string) => Promise<unknown>;
|
|
123
|
-
startWizardLogin?: () => Promise<WizardLoginResult>;
|
|
124
|
-
}
|
|
125
|
-
export interface WizardLoginResult {
|
|
126
|
-
status: "configured" | "login_url_observed" | "started" | "completed" | "already_running" | "package_unavailable" | "spawn_failed" | "exited";
|
|
127
|
-
packageName: string;
|
|
128
|
-
message: string;
|
|
129
|
-
loginUrl?: string;
|
|
130
|
-
startedAt?: number;
|
|
131
|
-
}
|
|
132
|
-
export declare function startWizardLogin(directory?: string): Promise<WizardLoginResult>;
|
|
133
|
-
/**
|
|
134
|
-
* Dispatch a `rest_request` frame. Always resolves with a
|
|
135
|
-
* `RestResponseFrame` — handler exceptions are caught and translated.
|
|
136
|
-
*
|
|
137
|
-
* Status mapping:
|
|
138
|
-
* - 200: handler returned successfully (body is the handler's return value
|
|
139
|
-
* or `{ ok: true }` for void returns)
|
|
140
|
-
* - 400: `BadRequestError` thrown by handler, OR malformed body for a
|
|
141
|
-
* route that requires one, OR unknown route
|
|
142
|
-
* - 404: `NotFoundError` thrown by handler
|
|
143
|
-
* - 405: route matches but method doesn't (returned as 404 since we don't
|
|
144
|
-
* distinguish — the matcher treats it as "no route", consistent
|
|
145
|
-
* with the original Hono router which also 404'd)
|
|
146
|
-
* - 500: anything else; `error` field carries a sanitized message
|
|
147
|
-
*/
|
|
148
|
-
export declare function handleRestRequest(frame: RestRequestFrame, deps: RestRequestDeps): Promise<RestResponseFrame>;
|
|
51
|
+
export { matchRoute } from "./routing.js";
|
|
52
|
+
export type { PublishMetaEvent, RestRequestDeps } from "./routing.js";
|
|
53
|
+
export { handleRestRequest } from "./rest.js";
|
|
54
|
+
export { startWizardLogin } from "./wizard-login.js";
|
|
55
|
+
export type { WizardLoginResult } from "./wizard-login.js";
|
|
149
56
|
/**
|
|
150
57
|
* Wire-boundary coercion of an `images` payload. Accepts url-hosted
|
|
151
58
|
* attachments (preferred — only the pointer travels over the relay) and
|
|
@@ -217,6 +124,18 @@ export declare function handleCancelTurn(frame: CancelTurnFrame, deps: {
|
|
|
217
124
|
error: (...args: unknown[]) => void;
|
|
218
125
|
};
|
|
219
126
|
}): void;
|
|
127
|
+
export type { StopToolCallFrame };
|
|
128
|
+
/**
|
|
129
|
+
* Dispatch a `stop_tool_call` frame. Stops ONE hung/long-running tool call
|
|
130
|
+
* for the session — that call is aborted, the agent receives a synthesized
|
|
131
|
+
* user-stop tool result, and the turn continues (unlike `cancel_turn`).
|
|
132
|
+
*
|
|
133
|
+
* Guarded: unknown toolCallId → no crash, the manager broadcasts a
|
|
134
|
+
* best-effort `tool_stop_result` info frame.
|
|
135
|
+
*/
|
|
136
|
+
export declare function handleStopToolCall(frame: StopToolCallFrame, deps: {
|
|
137
|
+
manager: SessionStreamManager;
|
|
138
|
+
}): Promise<void>;
|
|
220
139
|
/**
|
|
221
140
|
* Detach every subscriber the dispatcher has attached. Called by
|
|
222
141
|
* `serve.ts` on relay disconnect / shutdown so the underlying spectral
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/relay/dispatcher.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"dispatcher.d.ts","sourceRoot":"","sources":["../../src/relay/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,KAAK,EAEV,oBAAoB,EACpB,UAAU,EACX,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EACL,YAAY,EACZ,SAAS,EACT,6BAA6B,EAC9B,MAAM,gCAAgC,CAAC;AAExC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAS/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAM3D;;;;;;;;;GASG;AACH,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,6BAA6B,EAAE,CAAC;AAMlE,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,oBAAoB,CAAC;IAC9B,2DAA2D;IAC3D,KAAK,EAAE,IAAI,CAAC,WAAW,EAAE,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