@shawnowen/comet-mcp 2.4.1 → 2.4.2
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/README.md +12 -1
- package/dist/binding-reaper.d.ts +46 -0
- package/dist/binding-reaper.js +73 -0
- package/dist/http-server.js +121 -0
- package/dist/index.js +310 -6
- package/dist/project-config.d.ts +46 -0
- package/dist/project-config.js +166 -0
- package/dist/tab-groups.d.ts +21 -1
- package/dist/tab-groups.js +184 -0
- package/dist/window-bindings.d.ts +48 -0
- package/dist/window-bindings.js +85 -0
- package/extension/background.js +38 -17
- package/extension/manifest.json +16 -1
- package/extension/perplexity-capability-manifest.json +1181 -0
- package/extension/perplexity-capability-manifest.schema.json +142 -0
- package/extension/session-logic.js +696 -25
- package/extension/session-manager.html +13 -1
- package/extension/sidepanel.css +21 -6
- package/extension/sidepanel.js +598 -68
- package/package.json +1 -1
- package/dist/discovery/capability-entry.d.ts +0 -215
- package/dist/discovery/capability-entry.js +0 -13
- package/dist/discovery/description-template.d.ts +0 -40
- package/dist/discovery/description-template.js +0 -61
- package/dist/discovery/golden-queries.fixture.d.ts +0 -22
- package/dist/discovery/golden-queries.fixture.js +0 -137
- package/dist/discovery/mcp-source.d.ts +0 -38
- package/dist/discovery/mcp-source.js +0 -70
- package/dist/discovery/metadata-completeness.d.ts +0 -48
- package/dist/discovery/metadata-completeness.js +0 -83
- package/dist/discovery/registry.d.ts +0 -35
- package/dist/discovery/registry.js +0 -35
- package/dist/discovery/safety.d.ts +0 -44
- package/dist/discovery/safety.js +0 -59
- package/dist/discovery/schema-validator.d.ts +0 -36
- package/dist/discovery/schema-validator.js +0 -257
- package/dist/discovery/source-error.d.ts +0 -47
- package/dist/discovery/source-error.js +0 -95
- package/dist/discovery/tool-meta.d.ts +0 -41
- package/dist/discovery/tool-meta.js +0 -229
- package/dist/discovery/virtual-tools.d.ts +0 -20
- package/dist/discovery/virtual-tools.js +0 -69
- package/dist/task-thread-aggregator.d.ts +0 -34
- package/dist/task-thread-aggregator.js +0 -480
- package/dist/task-thread-canonical.d.ts +0 -142
- package/dist/task-thread-canonical.js +0 -116
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* source-error.ts
|
|
3
|
-
* SourceError aggregator + stable-format warning emitter (Spec 042, T008).
|
|
4
|
-
*
|
|
5
|
-
* Implements the FR-008a warn-and-continue contract:
|
|
6
|
-
* - Source readers call `aggregateError()` when a source is unavailable.
|
|
7
|
-
* - The registry composer calls `emitSourceWarnings()` once after all sources run.
|
|
8
|
-
* - Output is one-line per missing source, emitted to stderr (R7).
|
|
9
|
-
* - MCP startup never throws because of a missing source.
|
|
10
|
-
*/
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
// Builder helpers
|
|
13
|
-
// ---------------------------------------------------------------------------
|
|
14
|
-
/**
|
|
15
|
-
* Build a SourceError record from a SourceLayer + reason + optional raw error.
|
|
16
|
-
*/
|
|
17
|
-
export function makeSourceError(source, reason, originalError) {
|
|
18
|
-
return { source, reason, originalError };
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Build a SourceError from a caught exception, normalizing the message.
|
|
22
|
-
*/
|
|
23
|
-
export function errorFromException(source, err) {
|
|
24
|
-
const reason = err instanceof Error ? err.message : typeof err === "string" ? err : String(err);
|
|
25
|
-
return makeSourceError(source, reason, err);
|
|
26
|
-
}
|
|
27
|
-
// ---------------------------------------------------------------------------
|
|
28
|
-
// Aggregator
|
|
29
|
-
// ---------------------------------------------------------------------------
|
|
30
|
-
/**
|
|
31
|
-
* In-memory accumulator used by the registry composer during one startup cycle.
|
|
32
|
-
* Not a singleton — callers construct and pass this around so tests can inspect it.
|
|
33
|
-
*/
|
|
34
|
-
export class SourceErrorAggregator {
|
|
35
|
-
_errors = [];
|
|
36
|
-
add(err) {
|
|
37
|
-
this._errors.push(err);
|
|
38
|
-
}
|
|
39
|
-
get errors() {
|
|
40
|
-
return this._errors;
|
|
41
|
-
}
|
|
42
|
-
get hasErrors() {
|
|
43
|
-
return this._errors.length > 0;
|
|
44
|
-
}
|
|
45
|
-
unavailableSources() {
|
|
46
|
-
return [...new Set(this._errors.map((e) => e.source))];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
// ---------------------------------------------------------------------------
|
|
50
|
-
// Stable-format warning emitter (R7)
|
|
51
|
-
// ---------------------------------------------------------------------------
|
|
52
|
-
/**
|
|
53
|
-
* Emit one warning line per SourceError to stderr.
|
|
54
|
-
* Format: [comet-discovery] WARN source=<layer> reason=<reason>
|
|
55
|
-
*
|
|
56
|
-
* This format is stable across versions so external log parsers can key on it.
|
|
57
|
-
* Full JSON details are emitted only when COMET_DISCOVERY_VERBOSE=1.
|
|
58
|
-
*/
|
|
59
|
-
export function emitSourceWarnings(errors) {
|
|
60
|
-
if (errors.length === 0)
|
|
61
|
-
return;
|
|
62
|
-
for (const err of errors) {
|
|
63
|
-
const line = `[comet-discovery] WARN source=${err.source} reason=${sanitize(err.reason)}`;
|
|
64
|
-
process.stderr.write(line + "\n");
|
|
65
|
-
if (process.env.COMET_DISCOVERY_VERBOSE === "1") {
|
|
66
|
-
const detail = {
|
|
67
|
-
source: err.source,
|
|
68
|
-
reason: err.reason,
|
|
69
|
-
error: err.originalError instanceof Error
|
|
70
|
-
? { message: err.originalError.message, stack: err.originalError.stack }
|
|
71
|
-
: err.originalError,
|
|
72
|
-
};
|
|
73
|
-
process.stderr.write("[comet-discovery] VERBOSE " + JSON.stringify(detail) + "\n");
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Emit a session-start warning when the registry is incomplete.
|
|
79
|
-
* Called by index.ts after composeRegistry(); format matches DriftReport.status.
|
|
80
|
-
*/
|
|
81
|
-
export function emitSessionStartWarning(unavailable) {
|
|
82
|
-
if (unavailable.length === 0)
|
|
83
|
-
return;
|
|
84
|
-
const sources = unavailable.map((u) => u.source).join(", ");
|
|
85
|
-
process.stderr.write(`[comet-discovery] WARN session-start: incomplete registry — unavailable sources: ${sources}. ` +
|
|
86
|
-
`Run COMET_DISCOVERY_VERBOSE=1 for details.\n`);
|
|
87
|
-
}
|
|
88
|
-
// ---------------------------------------------------------------------------
|
|
89
|
-
// Helpers
|
|
90
|
-
// ---------------------------------------------------------------------------
|
|
91
|
-
/** Strip newlines and truncate long reason strings for single-line stderr. */
|
|
92
|
-
function sanitize(s) {
|
|
93
|
-
return s.replace(/[\r\n]+/g, " ").slice(0, 200);
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=source-error.js.map
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tool-meta.ts
|
|
3
|
-
* Discovery metadata catalog for the 25 native Comet MCP tools (Spec 042, T024).
|
|
4
|
-
*
|
|
5
|
-
* Each entry provides the discovery-layer fields that are NOT present in the
|
|
6
|
-
* existing TOOLS array in index.ts: canonicalId, safety, preconditions,
|
|
7
|
-
* intentKeywords, and a description following the R10 template.
|
|
8
|
-
*
|
|
9
|
-
* AUTHORITATIVE SOURCES:
|
|
10
|
-
* - Safety classes: docs/TOOL-SAFETY-REFERENCE.md
|
|
11
|
-
* - Preconditions: same doc, safety class descriptions
|
|
12
|
-
*
|
|
13
|
-
* This file is the single source of truth for native-tool discovery metadata.
|
|
14
|
-
* When a new tool is added to TOOLS in index.ts, add a matching entry here.
|
|
15
|
-
*/
|
|
16
|
-
import type { SafetyClass, Precondition } from "./capability-entry.js";
|
|
17
|
-
export interface ToolMeta {
|
|
18
|
-
/** Must match the `name` field in the TOOLS array in index.ts */
|
|
19
|
-
toolName: string;
|
|
20
|
-
/** Shared canonicalId used for dedup grouping across layers */
|
|
21
|
-
canonicalId: string;
|
|
22
|
-
/** Safety class — from docs/TOOL-SAFETY-REFERENCE.md */
|
|
23
|
-
safety: SafetyClass;
|
|
24
|
-
/** Prerequisites before calling this tool */
|
|
25
|
-
preconditions: Precondition[];
|
|
26
|
-
/**
|
|
27
|
-
* At least 3 lowercase keywords for ToolSearch ranking.
|
|
28
|
-
* Think: what would an agent type to find this tool?
|
|
29
|
-
*/
|
|
30
|
-
intentKeywords: string[];
|
|
31
|
-
/** R10 description template: "<verb> <object> [<modifier>]. Source: mcp. Safety: <class>." */
|
|
32
|
-
description: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Discovery metadata for the 25 native MCP tools.
|
|
36
|
-
* Order matches the TOOLS array in index.ts for readability.
|
|
37
|
-
*/
|
|
38
|
-
export declare const TOOL_META: ToolMeta[];
|
|
39
|
-
/** Lookup map: toolName → ToolMeta */
|
|
40
|
-
export declare const TOOL_META_MAP: ReadonlyMap<string, ToolMeta>;
|
|
41
|
-
//# sourceMappingURL=tool-meta.d.ts.map
|
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* tool-meta.ts
|
|
3
|
-
* Discovery metadata catalog for the 25 native Comet MCP tools (Spec 042, T024).
|
|
4
|
-
*
|
|
5
|
-
* Each entry provides the discovery-layer fields that are NOT present in the
|
|
6
|
-
* existing TOOLS array in index.ts: canonicalId, safety, preconditions,
|
|
7
|
-
* intentKeywords, and a description following the R10 template.
|
|
8
|
-
*
|
|
9
|
-
* AUTHORITATIVE SOURCES:
|
|
10
|
-
* - Safety classes: docs/TOOL-SAFETY-REFERENCE.md
|
|
11
|
-
* - Preconditions: same doc, safety class descriptions
|
|
12
|
-
*
|
|
13
|
-
* This file is the single source of truth for native-tool discovery metadata.
|
|
14
|
-
* When a new tool is added to TOOLS in index.ts, add a matching entry here.
|
|
15
|
-
*/
|
|
16
|
-
// CDP session precondition (reused across SESSION tools)
|
|
17
|
-
const CDP_SESSION = {
|
|
18
|
-
kind: "cdp_session",
|
|
19
|
-
note: "Requires an active Comet CDP session — call comet_connect first",
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Discovery metadata for the 25 native MCP tools.
|
|
23
|
-
* Order matches the TOOLS array in index.ts for readability.
|
|
24
|
-
*/
|
|
25
|
-
export const TOOL_META = [
|
|
26
|
-
{
|
|
27
|
-
toolName: "comet_connect",
|
|
28
|
-
canonicalId: "comet-connect",
|
|
29
|
-
safety: "SESSION",
|
|
30
|
-
preconditions: [],
|
|
31
|
-
intentKeywords: ["connect", "start session", "browser", "tab group", "agent session", "open browser"],
|
|
32
|
-
description: "Connect to the Comet browser and create a new tab group for this agent session. Source: mcp. Safety: SESSION.",
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
toolName: "comet_ask",
|
|
36
|
-
canonicalId: "comet-ask",
|
|
37
|
-
safety: "SESSION",
|
|
38
|
-
preconditions: [CDP_SESSION],
|
|
39
|
-
intentKeywords: ["ask", "prompt", "perplexity", "research", "ai", "question", "sidecar"],
|
|
40
|
-
description: "Send a prompt to Comet/Perplexity AI and wait for the complete response. Source: mcp. Safety: SESSION.",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
toolName: "comet_poll",
|
|
44
|
-
canonicalId: "comet-poll",
|
|
45
|
-
safety: "SESSION",
|
|
46
|
-
preconditions: [CDP_SESSION],
|
|
47
|
-
intentKeywords: ["poll", "status", "progress", "monitor", "check", "agentic task"],
|
|
48
|
-
description: "Check agent status and progress in the current session. Source: mcp. Safety: SESSION.",
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
toolName: "comet_stop",
|
|
52
|
-
canonicalId: "comet-stop",
|
|
53
|
-
safety: "CAUTION",
|
|
54
|
-
preconditions: [CDP_SESSION],
|
|
55
|
-
intentKeywords: ["stop", "cancel", "abort", "terminate", "halt"],
|
|
56
|
-
description: "Stop the current agent task if it is going off track. CAUTION: terminates the running task — only use on YOUR OWN session. Source: mcp. Safety: CAUTION.",
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
toolName: "comet_screenshot",
|
|
60
|
-
canonicalId: "comet-screenshot",
|
|
61
|
-
safety: "SESSION",
|
|
62
|
-
preconditions: [CDP_SESSION],
|
|
63
|
-
intentKeywords: ["screenshot", "capture", "image", "png", "visual", "photo"],
|
|
64
|
-
description: "Capture a screenshot of the current page in this agent's tab. Source: mcp. Safety: SESSION.",
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
toolName: "comet_mode",
|
|
68
|
-
canonicalId: "comet-mode",
|
|
69
|
-
safety: "SESSION",
|
|
70
|
-
preconditions: [CDP_SESSION],
|
|
71
|
-
intentKeywords: ["mode", "perplexity mode", "search mode", "focus", "writing", "coding"],
|
|
72
|
-
description: "Get or set the Perplexity search mode in this agent's tab. Source: mcp. Safety: SESSION.",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
toolName: "comet_tab_groups",
|
|
76
|
-
canonicalId: "comet-tab-groups",
|
|
77
|
-
safety: "SESSION",
|
|
78
|
-
preconditions: [CDP_SESSION],
|
|
79
|
-
intentKeywords: ["tab group", "tabs", "list groups", "create group", "archive", "restore", "save group"],
|
|
80
|
-
description: "Manage Chrome tab groups — list, create, update, archive, restore, and delete groups. Source: mcp. Safety: SESSION.",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
toolName: "comet_shortcut",
|
|
84
|
-
canonicalId: "comet-shortcut",
|
|
85
|
-
safety: "SESSION",
|
|
86
|
-
preconditions: [CDP_SESSION],
|
|
87
|
-
intentKeywords: ["shortcut", "query shortcut", "quick command", "template", "macro"],
|
|
88
|
-
description: "Trigger a query shortcut in this agent's Perplexity tab. Source: mcp. Safety: SESSION.",
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
toolName: "comet_read_page",
|
|
92
|
-
canonicalId: "comet-read-page",
|
|
93
|
-
safety: "SESSION",
|
|
94
|
-
preconditions: [CDP_SESSION],
|
|
95
|
-
intentKeywords: ["read page", "extract text", "page content", "dom tree", "accessibility tree", "markdown"],
|
|
96
|
-
description: "Extract text, links, or DOM tree from the current page in this agent's tab. Source: mcp. Safety: SESSION.",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
toolName: "comet_interact",
|
|
100
|
-
canonicalId: "comet-interact",
|
|
101
|
-
safety: "SESSION",
|
|
102
|
-
preconditions: [CDP_SESSION],
|
|
103
|
-
intentKeywords: ["interact", "click", "type", "fill form", "input", "button", "element", "action"],
|
|
104
|
-
description: "Execute click, type, scroll, and fill-form actions on the current page. Source: mcp. Safety: SESSION.",
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
toolName: "comet_navigate",
|
|
108
|
-
canonicalId: "comet-navigate",
|
|
109
|
-
safety: "SESSION",
|
|
110
|
-
preconditions: [CDP_SESSION],
|
|
111
|
-
intentKeywords: ["navigate", "go to", "open url", "browse", "load page", "visit"],
|
|
112
|
-
description: "Navigate this agent's tab to a specified URL. Source: mcp. Safety: SESSION.",
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
toolName: "comet_wait_for_idle",
|
|
116
|
-
canonicalId: "comet-wait-for-idle",
|
|
117
|
-
safety: "SESSION",
|
|
118
|
-
preconditions: [CDP_SESSION],
|
|
119
|
-
intentKeywords: ["wait", "idle", "network idle", "page load", "settle", "ready"],
|
|
120
|
-
description: "Wait for this agent's tab to finish loading and reach a network-idle state. Source: mcp. Safety: SESSION.",
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
toolName: "comet_lifecycle_start",
|
|
124
|
-
canonicalId: "comet-lifecycle-start",
|
|
125
|
-
safety: "SESSION",
|
|
126
|
-
preconditions: [{ kind: "task_thread", note: "A task thread ID must be registered before calling" }],
|
|
127
|
-
intentKeywords: ["lifecycle start", "start task", "begin run", "dispatch agent", "register lifecycle"],
|
|
128
|
-
description: "Register the start of a lifecycle run for a task thread with the Command Center. Source: mcp. Safety: SESSION.",
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
toolName: "comet_lifecycle_complete",
|
|
132
|
-
canonicalId: "comet-lifecycle-complete",
|
|
133
|
-
safety: "SESSION",
|
|
134
|
-
preconditions: [{ kind: "task_thread", note: "A started lifecycle run must exist for the task thread" }],
|
|
135
|
-
intentKeywords: ["lifecycle complete", "finish task", "complete run", "mark done", "task success"],
|
|
136
|
-
description: "Mark a lifecycle run as successfully completed with the Command Center. Source: mcp. Safety: SESSION.",
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
toolName: "comet_lifecycle_abort",
|
|
140
|
-
canonicalId: "comet-lifecycle-abort",
|
|
141
|
-
safety: "SESSION",
|
|
142
|
-
preconditions: [{ kind: "task_thread", note: "A started lifecycle run must exist for the task thread" }],
|
|
143
|
-
intentKeywords: ["lifecycle abort", "abort task", "cancel run", "task failed", "terminate lifecycle"],
|
|
144
|
-
description: "Abort a lifecycle run and record the reason with the Command Center. Source: mcp. Safety: SESSION.",
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
toolName: "comet_lifecycle_update",
|
|
148
|
-
canonicalId: "comet-lifecycle-update",
|
|
149
|
-
safety: "SESSION",
|
|
150
|
-
preconditions: [{ kind: "task_thread", note: "A started lifecycle run must exist for the task thread" }],
|
|
151
|
-
intentKeywords: ["lifecycle update", "update status", "progress update", "task status update"],
|
|
152
|
-
description: "Send a status update or progress event for an active lifecycle run. Source: mcp. Safety: SESSION.",
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
toolName: "comet_task_status",
|
|
156
|
-
canonicalId: "comet-task-status",
|
|
157
|
-
safety: "SAFE",
|
|
158
|
-
preconditions: [],
|
|
159
|
-
intentKeywords: ["task status", "task thread", "orchestrator", "equabot", "agent status", "running tasks"],
|
|
160
|
-
description: "Get the current status of Equabot task threads and orchestrator agents. Source: mcp. Safety: SAFE.",
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
toolName: "comet_delegate",
|
|
164
|
-
canonicalId: "comet-delegate",
|
|
165
|
-
safety: "CAUTION",
|
|
166
|
-
preconditions: [{ kind: "task_group", note: "COMET_TASK_GROUP must be set for the calling agent" }],
|
|
167
|
-
intentKeywords: ["delegate", "spawn agent", "sub-agent", "dispatch task", "equabot", "multi-agent"],
|
|
168
|
-
description: "Delegate a task to an Equabot sub-agent. CAUTION: spawns a new agent process — ensure you own the task thread before delegating. Source: mcp. Safety: CAUTION.",
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
toolName: "comet_observe",
|
|
172
|
-
canonicalId: "comet-observe",
|
|
173
|
-
safety: "SAFE",
|
|
174
|
-
preconditions: [],
|
|
175
|
-
intentKeywords: ["observe", "snapshot", "health check", "agents", "tab groups", "browser status", "overview"],
|
|
176
|
-
description: "Observe the browser environment — health, snapshot, status, or detail view of tab groups and agents. Source: mcp. Safety: SAFE.",
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
toolName: "comet_peek",
|
|
180
|
-
canonicalId: "comet-peek",
|
|
181
|
-
safety: "SAFE",
|
|
182
|
-
preconditions: [],
|
|
183
|
-
intentKeywords: ["peek", "inspect tab", "tab info", "read other tab", "screenshot other", "cross-agent observe"],
|
|
184
|
-
description: "Peek at any browser tab — get info, screenshot, or page text without affecting the tab. Source: mcp. Safety: SAFE.",
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
toolName: "comet_pdf",
|
|
188
|
-
canonicalId: "comet-pdf",
|
|
189
|
-
safety: "SESSION",
|
|
190
|
-
preconditions: [CDP_SESSION],
|
|
191
|
-
intentKeywords: ["pdf", "print", "save page", "generate pdf", "document", "export"],
|
|
192
|
-
description: "Generate a PDF of the current page in this agent's tab. Source: mcp. Safety: SESSION.",
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
toolName: "comet_scrape",
|
|
196
|
-
canonicalId: "comet-scrape",
|
|
197
|
-
safety: "SESSION",
|
|
198
|
-
preconditions: [CDP_SESSION],
|
|
199
|
-
intentKeywords: ["scrape", "extract", "structured data", "table", "list", "parse page", "data extraction"],
|
|
200
|
-
description: "Extract structured data (tables, lists, forms) from the current page. Source: mcp. Safety: SESSION.",
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
toolName: "comet_network",
|
|
204
|
-
canonicalId: "comet-network",
|
|
205
|
-
safety: "SESSION",
|
|
206
|
-
preconditions: [CDP_SESSION],
|
|
207
|
-
intentKeywords: ["network", "requests", "api calls", "xhr", "fetch", "capture traffic", "network log"],
|
|
208
|
-
description: "Capture and inspect network requests from the current page. Source: mcp. Safety: SESSION.",
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
toolName: "comet_automate",
|
|
212
|
-
canonicalId: "comet-automate",
|
|
213
|
-
safety: "SESSION",
|
|
214
|
-
preconditions: [CDP_SESSION],
|
|
215
|
-
intentKeywords: ["automate", "workflow", "multi-step", "automation", "sequence", "playbook"],
|
|
216
|
-
description: "Run a multi-step automation workflow in this agent's tab following a defined playbook. Source: mcp. Safety: SESSION.",
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
toolName: "comet_domain",
|
|
220
|
-
canonicalId: "comet-domain",
|
|
221
|
-
safety: "SESSION",
|
|
222
|
-
preconditions: [CDP_SESSION],
|
|
223
|
-
intentKeywords: ["domain", "quickbooks", "mercury", "github", "google", "salt", "auth", "login"],
|
|
224
|
-
description: "Route to a domain-specific playbook for authenticated sites (QBO, Mercury, GitHub, Google, SALT). Source: mcp. Safety: SESSION.",
|
|
225
|
-
},
|
|
226
|
-
];
|
|
227
|
-
/** Lookup map: toolName → ToolMeta */
|
|
228
|
-
export const TOOL_META_MAP = new Map(TOOL_META.map((m) => [m.toolName, m]));
|
|
229
|
-
//# sourceMappingURL=tool-meta.js.map
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* virtual-tools.ts
|
|
3
|
-
* Virtual MCP tool emitter for the Comet Discovery Layer (Spec 042, T011/T022/T034/T035/T045).
|
|
4
|
-
*
|
|
5
|
-
* T011: Stub (proved the integration point compiled).
|
|
6
|
-
* T022: Emit pass-through McpToolDefinition for recommended native entries.
|
|
7
|
-
* T034: Inject description-template output into the description field.
|
|
8
|
-
* T035: Append preconditions block to each tool description.
|
|
9
|
-
* T045: Handle plugin guide + extension dispatch (US3, future).
|
|
10
|
-
*/
|
|
11
|
-
import type { CapabilityEntry, McpToolDefinition } from "./capability-entry.js";
|
|
12
|
-
/**
|
|
13
|
-
* Emit McpToolDefinition objects for every non-humanOnly recommended entry.
|
|
14
|
-
*
|
|
15
|
-
* T022: native pass-through — uses the original argsSchema so the tool
|
|
16
|
-
* contract is byte-identical to the pre-discovery registration (FR-009).
|
|
17
|
-
* T045: plugin guide and extension dispatch (not yet implemented).
|
|
18
|
-
*/
|
|
19
|
-
export declare function emitVirtualTools(entries: CapabilityEntry[]): McpToolDefinition[];
|
|
20
|
-
//# sourceMappingURL=virtual-tools.d.ts.map
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* virtual-tools.ts
|
|
3
|
-
* Virtual MCP tool emitter for the Comet Discovery Layer (Spec 042, T011/T022/T034/T035/T045).
|
|
4
|
-
*
|
|
5
|
-
* T011: Stub (proved the integration point compiled).
|
|
6
|
-
* T022: Emit pass-through McpToolDefinition for recommended native entries.
|
|
7
|
-
* T034: Inject description-template output into the description field.
|
|
8
|
-
* T035: Append preconditions block to each tool description.
|
|
9
|
-
* T045: Handle plugin guide + extension dispatch (US3, future).
|
|
10
|
-
*/
|
|
11
|
-
import { CAUTION_MULTI_AGENT_CLAUSE } from "./description-template.js";
|
|
12
|
-
// ── Precondition → human-readable bullet ─────────────────────────────────────
|
|
13
|
-
function preconditionText(p) {
|
|
14
|
-
switch (p.kind) {
|
|
15
|
-
case "cdp_session": return p.note;
|
|
16
|
-
case "profile": return `Requires --profile ${p.value}`;
|
|
17
|
-
case "task_group": return p.note;
|
|
18
|
-
case "task_thread": return p.note;
|
|
19
|
-
case "free": return p.note;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function buildPreconditionsBlock(preconditions) {
|
|
23
|
-
if (preconditions.length === 0)
|
|
24
|
-
return "";
|
|
25
|
-
const bullets = preconditions.map((p) => `- ${preconditionText(p)}`).join("\n");
|
|
26
|
-
return `\n\nPreconditions:\n${bullets}`;
|
|
27
|
-
}
|
|
28
|
-
// ── Description builder ───────────────────────────────────────────────────────
|
|
29
|
-
function buildDescription(entry) {
|
|
30
|
-
let desc = entry.description;
|
|
31
|
-
// For CAUTION tools, ensure the canonical multi-agent clause is present.
|
|
32
|
-
// (It should already be in tool-meta.ts descriptions, but this is a safety net.)
|
|
33
|
-
if (entry.safety === "CAUTION" && !desc.includes("CAUTION:")) {
|
|
34
|
-
desc += " " + CAUTION_MULTI_AGENT_CLAUSE;
|
|
35
|
-
}
|
|
36
|
-
// T035: append preconditions block
|
|
37
|
-
desc += buildPreconditionsBlock(entry.preconditions);
|
|
38
|
-
return desc.slice(0, 1000); // hard cap for MCP clients
|
|
39
|
-
}
|
|
40
|
-
// ── Main emitter ──────────────────────────────────────────────────────────────
|
|
41
|
-
/**
|
|
42
|
-
* Emit McpToolDefinition objects for every non-humanOnly recommended entry.
|
|
43
|
-
*
|
|
44
|
-
* T022: native pass-through — uses the original argsSchema so the tool
|
|
45
|
-
* contract is byte-identical to the pre-discovery registration (FR-009).
|
|
46
|
-
* T045: plugin guide and extension dispatch (not yet implemented).
|
|
47
|
-
*/
|
|
48
|
-
export function emitVirtualTools(entries) {
|
|
49
|
-
const tools = [];
|
|
50
|
-
for (const entry of entries) {
|
|
51
|
-
// Skip human-only entries — they have no agent-reachable entry point
|
|
52
|
-
if (entry.humanOnly)
|
|
53
|
-
continue;
|
|
54
|
-
// Only emit the recommended entry per group (suppressed entries are not tools)
|
|
55
|
-
if (!entry.recommended)
|
|
56
|
-
continue;
|
|
57
|
-
if (entry.invocation.kind === "native") {
|
|
58
|
-
// T022: pass-through — same name and args schema as the native tool (FR-009)
|
|
59
|
-
tools.push({
|
|
60
|
-
name: entry.name,
|
|
61
|
-
description: buildDescription(entry),
|
|
62
|
-
inputSchema: entry.argsSchema,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
// TODO T045: "guide" and "cdp"/"filesystem"/"cli" invocation kinds
|
|
66
|
-
}
|
|
67
|
-
return tools;
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=virtual-tools.js.map
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Task Thread Aggregator — Phase A
|
|
3
|
-
*
|
|
4
|
-
* Reads all 5 local layers (lifecycle JSONL, session manifest, archive store,
|
|
5
|
-
* snapshots, alert log) and synthesises a CanonicalTaskThread for each known
|
|
6
|
-
* taskThreadId. Exposes the TaskThreadProvider interface so Phase B can swap
|
|
7
|
-
* the implementation for an equa-taskthreads core API client without touching
|
|
8
|
-
* any consumers (FR-040).
|
|
9
|
-
*
|
|
10
|
-
* Spec: specs/041-task-thread-sync/spec.md
|
|
11
|
-
* Plan: specs/041-task-thread-sync/plan.md §Layer Aggregator
|
|
12
|
-
*/
|
|
13
|
-
import { CanonicalStatus, CanonicalTaskThread } from "./task-thread-canonical.js";
|
|
14
|
-
/**
|
|
15
|
-
* The single interface all HTTP route handlers and extension-facing code depends
|
|
16
|
-
* on. Phase B replaces the LocalTaskThreadAggregator with a CoreAPITaskThreadProvider
|
|
17
|
-
* without changing any consumer code.
|
|
18
|
-
*/
|
|
19
|
-
export interface TaskThreadProvider {
|
|
20
|
-
listAll(): Promise<CanonicalTaskThread[]>;
|
|
21
|
-
get(id: string): Promise<CanonicalTaskThread | null>;
|
|
22
|
-
executeTransition(id: string, action: string, reason?: string): Promise<{
|
|
23
|
-
newStatus: CanonicalStatus;
|
|
24
|
-
}>;
|
|
25
|
-
}
|
|
26
|
-
export declare class LocalTaskThreadAggregator implements TaskThreadProvider {
|
|
27
|
-
listAll(): Promise<CanonicalTaskThread[]>;
|
|
28
|
-
get(id: string): Promise<CanonicalTaskThread | null>;
|
|
29
|
-
executeTransition(id: string, action: string, reason?: string): Promise<{
|
|
30
|
-
newStatus: CanonicalStatus;
|
|
31
|
-
}>;
|
|
32
|
-
}
|
|
33
|
-
export declare const aggregator: TaskThreadProvider;
|
|
34
|
-
//# sourceMappingURL=task-thread-aggregator.d.ts.map
|