@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shawnowen/comet-mcp",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "MCP Server that gives Claude Code superpowers with Perplexity Comet browser - agentic web browsing, deep research, and real-time monitoring",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* capability-entry.ts
|
|
3
|
-
* Core type definitions for the Comet Discovery Layer (Spec 042).
|
|
4
|
-
* All types are derived from data-model.md and capability-entry.schema.json.
|
|
5
|
-
* No runtime logic — pure type declarations + tagged unions.
|
|
6
|
-
*/
|
|
7
|
-
/** Which canonical source owns a capability entry. */
|
|
8
|
-
export type SourceLayer = "mcp" | "plugin" | "extension";
|
|
9
|
-
/** Rank order for dedup: plugin (3) > extension (2) > mcp (1). */
|
|
10
|
-
export declare const SOURCE_LAYER_RANK: Record<SourceLayer, number>;
|
|
11
|
-
/**
|
|
12
|
-
* Safety classification — reused verbatim from docs/TOOL-SAFETY-REFERENCE.md.
|
|
13
|
-
* No default, no UNKNOWN class. Every capability must have exactly one.
|
|
14
|
-
*
|
|
15
|
-
* SAFE — Read-only, zero side effects, no session required.
|
|
16
|
-
* SESSION — Requires an active Comet CDP session; scoped to the calling agent's tab group.
|
|
17
|
-
* CAUTION — Cross-session side effects possible; requires explicit multi-agent awareness.
|
|
18
|
-
*/
|
|
19
|
-
export type SafetyClass = "SAFE" | "SESSION" | "CAUTION";
|
|
20
|
-
export type Precondition = {
|
|
21
|
-
kind: "cdp_session";
|
|
22
|
-
note: string;
|
|
23
|
-
} | {
|
|
24
|
-
kind: "profile";
|
|
25
|
-
value: "oe" | "moon";
|
|
26
|
-
} | {
|
|
27
|
-
kind: "task_group";
|
|
28
|
-
note: string;
|
|
29
|
-
} | {
|
|
30
|
-
kind: "task_thread";
|
|
31
|
-
note: string;
|
|
32
|
-
} | {
|
|
33
|
-
kind: "free";
|
|
34
|
-
note: string;
|
|
35
|
-
};
|
|
36
|
-
export type Invocation = {
|
|
37
|
-
kind: "native";
|
|
38
|
-
/** Name of the existing MCP tool — pass-through, no behavior change (FR-009). */
|
|
39
|
-
toolName: string;
|
|
40
|
-
} | {
|
|
41
|
-
kind: "guide";
|
|
42
|
-
/** Claude Code Skill name (e.g. "comet-browse"). */
|
|
43
|
-
skill: string;
|
|
44
|
-
/** Args to pass to Skill(). */
|
|
45
|
-
normalizedArgs: Record<string, unknown>;
|
|
46
|
-
/** Human hint: "Invoke via Skill('comet-browse') with these args." */
|
|
47
|
-
nextStepHint: string;
|
|
48
|
-
} | {
|
|
49
|
-
kind: "cdp";
|
|
50
|
-
/** Chrome DevTools Protocol method string. */
|
|
51
|
-
method: string;
|
|
52
|
-
params?: Record<string, unknown>;
|
|
53
|
-
} | {
|
|
54
|
-
kind: "filesystem";
|
|
55
|
-
path: string;
|
|
56
|
-
mode: "read" | "signal";
|
|
57
|
-
} | {
|
|
58
|
-
kind: "cli";
|
|
59
|
-
command: string;
|
|
60
|
-
args: string[];
|
|
61
|
-
};
|
|
62
|
-
/**
|
|
63
|
-
* One CapabilityEntry per source-side definition.
|
|
64
|
-
* A plugin command that wraps a native MCP tool produces TWO entries sharing a canonicalId.
|
|
65
|
-
*/
|
|
66
|
-
export interface CapabilityEntry {
|
|
67
|
-
/**
|
|
68
|
-
* Globally unique tool-facing identifier.
|
|
69
|
-
* Native: existing tool name (e.g. "comet_screenshot").
|
|
70
|
-
* Plugin: "plugin_<slug>".
|
|
71
|
-
* Extension: "ext_<slug>".
|
|
72
|
-
* Regex: /^[a-z][a-z0-9_]{2,63}$/
|
|
73
|
-
*/
|
|
74
|
-
name: string;
|
|
75
|
-
/** Which canonical source owns this entry. */
|
|
76
|
-
sourceLayer: SourceLayer;
|
|
77
|
-
/**
|
|
78
|
-
* Repo-relative path + optional #fragment pointing to the canonical definition.
|
|
79
|
-
* e.g. "comet-mcp/src/index.ts#tool_comet_screenshot"
|
|
80
|
-
*/
|
|
81
|
-
sourcePath: string;
|
|
82
|
-
/**
|
|
83
|
-
* Shared identity key for dedup grouping across layers.
|
|
84
|
-
* Entries sharing a canonicalId form a CapabilityGroup.
|
|
85
|
-
* Regex: /^[a-z][a-z0-9_-]{2,63}$/
|
|
86
|
-
*/
|
|
87
|
-
canonicalId: string;
|
|
88
|
-
/**
|
|
89
|
-
* Human-readable verb-phrase description.
|
|
90
|
-
* Template: "<verb> <object> [<modifier>]. Source: <layer>. Safety: <class>."
|
|
91
|
-
* Min 24 chars, max 400 chars.
|
|
92
|
-
*/
|
|
93
|
-
description: string;
|
|
94
|
-
/**
|
|
95
|
-
* At least 3 lowercase keywords capturing common search intents.
|
|
96
|
-
* Drives natural-language ToolSearch ranking (FR-006, SC-002).
|
|
97
|
-
*/
|
|
98
|
-
intentKeywords: string[];
|
|
99
|
-
/**
|
|
100
|
-
* Safety class — must be set; no default.
|
|
101
|
-
* Reused verbatim from docs/TOOL-SAFETY-REFERENCE.md.
|
|
102
|
-
*/
|
|
103
|
-
safety: SafetyClass;
|
|
104
|
-
/**
|
|
105
|
-
* Prerequisites the agent must satisfy before calling this tool.
|
|
106
|
-
* May be empty array, never missing.
|
|
107
|
-
*/
|
|
108
|
-
preconditions: Precondition[];
|
|
109
|
-
/**
|
|
110
|
-
* JSON Schema draft 2020-12 fragment for the tool's arguments.
|
|
111
|
-
* Empty schema `{ type: "object", properties: {} }` is valid.
|
|
112
|
-
*/
|
|
113
|
-
argsSchema: Record<string, unknown>;
|
|
114
|
-
/**
|
|
115
|
-
* True iff this capability has no agent-reachable programmatic entry point
|
|
116
|
-
* and is deliberately excluded from virtual-tool registration.
|
|
117
|
-
* MUST be accompanied by a matching HumanOnlyException.
|
|
118
|
-
*/
|
|
119
|
-
humanOnly: boolean;
|
|
120
|
-
/** Determines what the virtual MCP tool body returns or dispatches. */
|
|
121
|
-
invocation: Invocation;
|
|
122
|
-
/**
|
|
123
|
-
* The `name` of the paired entry in this entry's CapabilityGroup, or null for singletons.
|
|
124
|
-
*/
|
|
125
|
-
crossRef: string | null;
|
|
126
|
-
/**
|
|
127
|
-
* True for the highest-layer entry in a group (plugin > extension > mcp).
|
|
128
|
-
* Singletons are always recommended: true.
|
|
129
|
-
*/
|
|
130
|
-
recommended: boolean;
|
|
131
|
-
/** For non-recommended entries: "lower-level". For recommended: null. */
|
|
132
|
-
alternativeLabel: "lower-level" | null;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Transient collection of CapabilityEntry instances sharing a canonicalId.
|
|
136
|
-
* Emits exactly one "recommended" virtual tool and up to one "alternative (lower-level)".
|
|
137
|
-
*/
|
|
138
|
-
export interface CapabilityGroup {
|
|
139
|
-
canonicalId: string;
|
|
140
|
-
/** Highest-layer member (plugin > extension > mcp). */
|
|
141
|
-
recommendedEntry: CapabilityEntry;
|
|
142
|
-
/** Lowest-layer member when distinct from recommendedEntry. null for singletons. */
|
|
143
|
-
alternativeEntry: CapabilityEntry | null;
|
|
144
|
-
/**
|
|
145
|
-
* Intermediate members NOT registered as virtual tools.
|
|
146
|
-
* Still listed for traceability under the recommended entry's alternates.
|
|
147
|
-
*/
|
|
148
|
-
suppressedEntries: CapabilityEntry[];
|
|
149
|
-
}
|
|
150
|
-
export interface HumanOnlyException {
|
|
151
|
-
/** Must equal the canonicalId of a capability with humanOnly: true. */
|
|
152
|
-
name: string;
|
|
153
|
-
/** Why no programmatic entry point exists. Min 24 chars. */
|
|
154
|
-
reason: string;
|
|
155
|
-
/** GitHub handle (@username) or team (@org/team). */
|
|
156
|
-
owner: string;
|
|
157
|
-
/** Plan to make this capability agent-accessible, or null if genuinely blocked. */
|
|
158
|
-
enhancementPath: string | null;
|
|
159
|
-
/** ISO 8601 date string. Staleness warning fires if older than 90 days. */
|
|
160
|
-
lastReviewed: string;
|
|
161
|
-
}
|
|
162
|
-
export interface SourceError {
|
|
163
|
-
/** Which source layer failed. */
|
|
164
|
-
source: SourceLayer;
|
|
165
|
-
/** Human-readable reason. */
|
|
166
|
-
reason: string;
|
|
167
|
-
/** Original error, if any. */
|
|
168
|
-
originalError?: unknown;
|
|
169
|
-
}
|
|
170
|
-
export type DriftStatus = "pass" | "warn" | "fail";
|
|
171
|
-
export interface DriftReport {
|
|
172
|
-
generatedAt: string;
|
|
173
|
-
emittedBy: "ci" | "session-start";
|
|
174
|
-
available: SourceLayer[];
|
|
175
|
-
unavailable: Array<{
|
|
176
|
-
source: SourceLayer;
|
|
177
|
-
reason: string;
|
|
178
|
-
}>;
|
|
179
|
-
capabilityCount: number;
|
|
180
|
-
virtualToolCount: number;
|
|
181
|
-
/** canonicalIds in canonical source but missing from registry → hard failure. */
|
|
182
|
-
missingFromRegistry: string[];
|
|
183
|
-
/** Virtual tool names in registry with no canonical source → hard failure. */
|
|
184
|
-
extrasInRegistry: string[];
|
|
185
|
-
/** Entry names missing safety field → hard failure. */
|
|
186
|
-
safetyGaps: string[];
|
|
187
|
-
/** humanOnly: true capabilities lacking a matching exception → hard failure. */
|
|
188
|
-
humanOnlyDangling: string[];
|
|
189
|
-
/** Exception names that don't resolve to any humanOnly: true capability → hard failure. */
|
|
190
|
-
exceptionsDangling: string[];
|
|
191
|
-
/** Exceptions with lastReviewed older than review window → warning only. */
|
|
192
|
-
exceptionsStale: string[];
|
|
193
|
-
status: DriftStatus;
|
|
194
|
-
}
|
|
195
|
-
export interface GoldenQueryResult {
|
|
196
|
-
query: string;
|
|
197
|
-
expectedCanonicalId: string;
|
|
198
|
-
top5Names: string[];
|
|
199
|
-
hit: boolean;
|
|
200
|
-
}
|
|
201
|
-
export interface CoverageReport {
|
|
202
|
-
sources: Record<SourceLayer, number>;
|
|
203
|
-
totalCapabilities: number;
|
|
204
|
-
coverageRatio: number;
|
|
205
|
-
goldenQueries: GoldenQueryResult[];
|
|
206
|
-
top5HitRate: number;
|
|
207
|
-
metadataCompleteness: number;
|
|
208
|
-
}
|
|
209
|
-
/** Minimal MCP tool definition shape accepted by the comet-mcp Server. */
|
|
210
|
-
export interface McpToolDefinition {
|
|
211
|
-
name: string;
|
|
212
|
-
description: string;
|
|
213
|
-
inputSchema: Record<string, unknown>;
|
|
214
|
-
}
|
|
215
|
-
//# sourceMappingURL=capability-entry.d.ts.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* capability-entry.ts
|
|
3
|
-
* Core type definitions for the Comet Discovery Layer (Spec 042).
|
|
4
|
-
* All types are derived from data-model.md and capability-entry.schema.json.
|
|
5
|
-
* No runtime logic — pure type declarations + tagged unions.
|
|
6
|
-
*/
|
|
7
|
-
/** Rank order for dedup: plugin (3) > extension (2) > mcp (1). */
|
|
8
|
-
export const SOURCE_LAYER_RANK = {
|
|
9
|
-
plugin: 3,
|
|
10
|
-
extension: 2,
|
|
11
|
-
mcp: 1,
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=capability-entry.js.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* description-template.ts
|
|
3
|
-
* R10 description template renderer (Spec 042, T031).
|
|
4
|
-
*
|
|
5
|
-
* Produces consistent, searchable descriptions for virtual MCP tool entries.
|
|
6
|
-
* Format: "<verb> <object> [<modifier>]. Source: <layer>. Safety: <class>. [multi-agent clause for CAUTION]"
|
|
7
|
-
*
|
|
8
|
-
* Constraints (from spec):
|
|
9
|
-
* - Min 24 chars, max 400 chars
|
|
10
|
-
* - CAUTION entries MUST include the cross-session warning phrase
|
|
11
|
-
*/
|
|
12
|
-
import type { SafetyClass, SourceLayer } from "./capability-entry.js";
|
|
13
|
-
export declare const CAUTION_MULTI_AGENT_CLAUSE: string;
|
|
14
|
-
export interface DescriptionOptions {
|
|
15
|
-
/** Short verb phrase: e.g. "Capture a screenshot" */
|
|
16
|
-
verbPhrase: string;
|
|
17
|
-
/** Optional modifier appended after verbPhrase: e.g. "in this agent's tab" */
|
|
18
|
-
modifier?: string;
|
|
19
|
-
/** Source layer — appended as "Source: <layer>." */
|
|
20
|
-
sourceLayer: SourceLayer;
|
|
21
|
-
/** Safety class — appended as "Safety: <class>." */
|
|
22
|
-
safety: SafetyClass;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Render the R10 description for a capability entry.
|
|
26
|
-
* Returns a string between MIN_LENGTH and MAX_LENGTH characters.
|
|
27
|
-
* Throws if the rendered string is outside those bounds.
|
|
28
|
-
*/
|
|
29
|
-
export declare function renderDescription(opts: DescriptionOptions): string;
|
|
30
|
-
/**
|
|
31
|
-
* Safe version — returns the string if valid, or an error-annotated fallback.
|
|
32
|
-
* Used when the verbPhrase is untrusted (e.g. from plugin YAML frontmatter).
|
|
33
|
-
*/
|
|
34
|
-
export declare function renderDescriptionSafe(opts: DescriptionOptions, fallback?: string): string;
|
|
35
|
-
/**
|
|
36
|
-
* Render a CAUTION description with the mandatory multi-agent clause.
|
|
37
|
-
* Convenience wrapper for T033.
|
|
38
|
-
*/
|
|
39
|
-
export declare function renderCautionDescription(verbPhrase: string, sourceLayer: SourceLayer, modifier?: string): string;
|
|
40
|
-
//# sourceMappingURL=description-template.d.ts.map
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* description-template.ts
|
|
3
|
-
* R10 description template renderer (Spec 042, T031).
|
|
4
|
-
*
|
|
5
|
-
* Produces consistent, searchable descriptions for virtual MCP tool entries.
|
|
6
|
-
* Format: "<verb> <object> [<modifier>]. Source: <layer>. Safety: <class>. [multi-agent clause for CAUTION]"
|
|
7
|
-
*
|
|
8
|
-
* Constraints (from spec):
|
|
9
|
-
* - Min 24 chars, max 400 chars
|
|
10
|
-
* - CAUTION entries MUST include the cross-session warning phrase
|
|
11
|
-
*/
|
|
12
|
-
// Canonical cross-session warning for CAUTION tools.
|
|
13
|
-
// Must appear verbatim in every CAUTION entry description (tested in T029).
|
|
14
|
-
export const CAUTION_MULTI_AGENT_CLAUSE = "CAUTION: may have cross-session side effects — only use on your own session and tab group. " +
|
|
15
|
-
"Never close or modify browser resources you did not create.";
|
|
16
|
-
const MIN_LENGTH = 24;
|
|
17
|
-
const MAX_LENGTH = 400;
|
|
18
|
-
/**
|
|
19
|
-
* Render the R10 description for a capability entry.
|
|
20
|
-
* Returns a string between MIN_LENGTH and MAX_LENGTH characters.
|
|
21
|
-
* Throws if the rendered string is outside those bounds.
|
|
22
|
-
*/
|
|
23
|
-
export function renderDescription(opts) {
|
|
24
|
-
const { verbPhrase, modifier, sourceLayer, safety } = opts;
|
|
25
|
-
let text = verbPhrase.trimEnd();
|
|
26
|
-
if (modifier)
|
|
27
|
-
text += " " + modifier.trim();
|
|
28
|
-
text += ". ";
|
|
29
|
-
text += `Source: ${sourceLayer}. Safety: ${safety}.`;
|
|
30
|
-
if (safety === "CAUTION") {
|
|
31
|
-
text += " " + CAUTION_MULTI_AGENT_CLAUSE;
|
|
32
|
-
}
|
|
33
|
-
if (text.length < MIN_LENGTH) {
|
|
34
|
-
throw new RangeError(`Description too short (${text.length} < ${MIN_LENGTH}): "${text}"`);
|
|
35
|
-
}
|
|
36
|
-
if (text.length > MAX_LENGTH) {
|
|
37
|
-
throw new RangeError(`Description too long (${text.length} > ${MAX_LENGTH}): "${text.slice(0, 80)}…"`);
|
|
38
|
-
}
|
|
39
|
-
return text;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Safe version — returns the string if valid, or an error-annotated fallback.
|
|
43
|
-
* Used when the verbPhrase is untrusted (e.g. from plugin YAML frontmatter).
|
|
44
|
-
*/
|
|
45
|
-
export function renderDescriptionSafe(opts, fallback) {
|
|
46
|
-
try {
|
|
47
|
-
return renderDescription(opts);
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
const fb = fallback ?? `${opts.verbPhrase}. Source: ${opts.sourceLayer}. Safety: ${opts.safety}.`;
|
|
51
|
-
return fb.slice(0, MAX_LENGTH);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Render a CAUTION description with the mandatory multi-agent clause.
|
|
56
|
-
* Convenience wrapper for T033.
|
|
57
|
-
*/
|
|
58
|
-
export function renderCautionDescription(verbPhrase, sourceLayer, modifier) {
|
|
59
|
-
return renderDescription({ verbPhrase, modifier, sourceLayer, safety: "CAUTION" });
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=description-template.js.map
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* golden-queries.fixture.ts
|
|
3
|
-
* Hand-picked golden query set for US1 ToolSearch ranking tests (Spec 042, T025).
|
|
4
|
-
*
|
|
5
|
-
* Each entry describes a natural-language query an agent might issue plus the
|
|
6
|
-
* canonical tool name expected to appear in the top 5 ToolSearch results.
|
|
7
|
-
*
|
|
8
|
-
* Coverage targets: SC-002 (≥ 95% top-5 hit rate = 19/20 queries must hit).
|
|
9
|
-
* At least one query per safety class and per major capability area.
|
|
10
|
-
*/
|
|
11
|
-
export interface GoldenQuery {
|
|
12
|
-
/** Natural language query the agent would type into ToolSearch */
|
|
13
|
-
query: string;
|
|
14
|
-
/** canonicalId of the entry that must appear in the top-5 results */
|
|
15
|
-
expectedCanonicalId: string;
|
|
16
|
-
/** Expected tool name for direct assertion */
|
|
17
|
-
expectedToolName: string;
|
|
18
|
-
/** Human note explaining why this query should resolve to this tool */
|
|
19
|
-
note: string;
|
|
20
|
-
}
|
|
21
|
-
export declare const GOLDEN_QUERIES: GoldenQuery[];
|
|
22
|
-
//# sourceMappingURL=golden-queries.fixture.d.ts.map
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* golden-queries.fixture.ts
|
|
3
|
-
* Hand-picked golden query set for US1 ToolSearch ranking tests (Spec 042, T025).
|
|
4
|
-
*
|
|
5
|
-
* Each entry describes a natural-language query an agent might issue plus the
|
|
6
|
-
* canonical tool name expected to appear in the top 5 ToolSearch results.
|
|
7
|
-
*
|
|
8
|
-
* Coverage targets: SC-002 (≥ 95% top-5 hit rate = 19/20 queries must hit).
|
|
9
|
-
* At least one query per safety class and per major capability area.
|
|
10
|
-
*/
|
|
11
|
-
export const GOLDEN_QUERIES = [
|
|
12
|
-
// ── Observation / SAFE tools ─────────────────────────────────────────────
|
|
13
|
-
{
|
|
14
|
-
query: "observe browser status",
|
|
15
|
-
expectedCanonicalId: "comet-observe",
|
|
16
|
-
expectedToolName: "comet_observe",
|
|
17
|
-
note: "Primary observation tool — should rank #1 for status queries",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
query: "health check browser extension",
|
|
21
|
-
expectedCanonicalId: "comet-observe",
|
|
22
|
-
expectedToolName: "comet_observe",
|
|
23
|
-
note: "Health check is a sub-action of comet_observe",
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
query: "peek at another agent tab",
|
|
27
|
-
expectedCanonicalId: "comet-peek",
|
|
28
|
-
expectedToolName: "comet_peek",
|
|
29
|
-
note: "Cross-agent read-only inspection without affecting the tab",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
query: "inspect tab screenshot cross agent",
|
|
33
|
-
expectedCanonicalId: "comet-peek",
|
|
34
|
-
expectedToolName: "comet_peek",
|
|
35
|
-
note: "comet_peek action=screenshot for another agent's tab",
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
query: "list all tab groups",
|
|
39
|
-
expectedCanonicalId: "comet-tab-groups",
|
|
40
|
-
expectedToolName: "comet_tab_groups",
|
|
41
|
-
note: "Tab group management including list action",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
query: "equabot task thread running agents",
|
|
45
|
-
expectedCanonicalId: "comet-task-status",
|
|
46
|
-
expectedToolName: "comet_task_status",
|
|
47
|
-
note: "SAFE status overview tool for orchestrator agents",
|
|
48
|
-
},
|
|
49
|
-
// ── Session tools (SESSION class) ────────────────────────────────────────
|
|
50
|
-
{
|
|
51
|
-
query: "connect to Comet browser start session",
|
|
52
|
-
expectedCanonicalId: "comet-connect",
|
|
53
|
-
expectedToolName: "comet_connect",
|
|
54
|
-
note: "Entry-point for all browser work — must rank first for connect queries",
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
query: "take a screenshot of current page",
|
|
58
|
-
expectedCanonicalId: "comet-screenshot",
|
|
59
|
-
expectedToolName: "comet_screenshot",
|
|
60
|
-
note: "Explicit screenshot request in the session context",
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
query: "full page screenshot dark mode",
|
|
64
|
-
expectedCanonicalId: "comet-screenshot",
|
|
65
|
-
expectedToolName: "comet_screenshot",
|
|
66
|
-
note: "Natural-language screenshot variant — must appear in top 5",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
query: "navigate to url open page",
|
|
70
|
-
expectedCanonicalId: "comet-navigate",
|
|
71
|
-
expectedToolName: "comet_navigate",
|
|
72
|
-
note: "Explicit navigate request",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
query: "read page content extract text markdown",
|
|
76
|
-
expectedCanonicalId: "comet-read-page",
|
|
77
|
-
expectedToolName: "comet_read_page",
|
|
78
|
-
note: "Content extraction from the current tab",
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
query: "click button fill form interact",
|
|
82
|
-
expectedCanonicalId: "comet-interact",
|
|
83
|
-
expectedToolName: "comet_interact",
|
|
84
|
-
note: "DOM interaction — click/type/fill queries",
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
query: "ask perplexity research question ai",
|
|
88
|
-
expectedCanonicalId: "comet-ask",
|
|
89
|
-
expectedToolName: "comet_ask",
|
|
90
|
-
note: "Primary research/AI-prompt tool",
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
query: "generate pdf print page document",
|
|
94
|
-
expectedCanonicalId: "comet-pdf",
|
|
95
|
-
expectedToolName: "comet_pdf",
|
|
96
|
-
note: "PDF export from current tab",
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
query: "scrape extract table structured data",
|
|
100
|
-
expectedCanonicalId: "comet-scrape",
|
|
101
|
-
expectedToolName: "comet_scrape",
|
|
102
|
-
note: "Structured data extraction",
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
query: "capture network requests api traffic",
|
|
106
|
-
expectedCanonicalId: "comet-network",
|
|
107
|
-
expectedToolName: "comet_network",
|
|
108
|
-
note: "Network request monitoring",
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
query: "run automation workflow multi step",
|
|
112
|
-
expectedCanonicalId: "comet-automate",
|
|
113
|
-
expectedToolName: "comet_automate",
|
|
114
|
-
note: "Multi-step automation playbook",
|
|
115
|
-
},
|
|
116
|
-
// ── Lifecycle tools ───────────────────────────────────────────────────────
|
|
117
|
-
{
|
|
118
|
-
query: "start task thread lifecycle register run",
|
|
119
|
-
expectedCanonicalId: "comet-lifecycle-start",
|
|
120
|
-
expectedToolName: "comet_lifecycle_start",
|
|
121
|
-
note: "Lifecycle start — agent registers a new task run",
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
query: "mark task complete finish run",
|
|
125
|
-
expectedCanonicalId: "comet-lifecycle-complete",
|
|
126
|
-
expectedToolName: "comet_lifecycle_complete",
|
|
127
|
-
note: "Terminal lifecycle action for success",
|
|
128
|
-
},
|
|
129
|
-
// ── CAUTION tools ─────────────────────────────────────────────────────────
|
|
130
|
-
{
|
|
131
|
-
query: "delegate task spawn sub-agent equabot",
|
|
132
|
-
expectedCanonicalId: "comet-delegate",
|
|
133
|
-
expectedToolName: "comet_delegate",
|
|
134
|
-
note: "CAUTION: spawns a new agent — must appear with the CAUTION warning",
|
|
135
|
-
},
|
|
136
|
-
];
|
|
137
|
-
//# sourceMappingURL=golden-queries.fixture.js.map
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mcp-source.ts
|
|
3
|
-
* MCP source reader for the Comet Discovery Layer (Spec 042, T020).
|
|
4
|
-
*
|
|
5
|
-
* Reads the native tool metadata catalog (tool-meta.ts) and the TOOLS
|
|
6
|
-
* array from the running MCP server (imported via tool-registry.ts to
|
|
7
|
-
* avoid circular imports), then produces CapabilityEntry[] with
|
|
8
|
-
* sourceLayer: "mcp" for every registered native tool.
|
|
9
|
-
*
|
|
10
|
-
* Tools in the TOOLS array that have no matching entry in TOOL_META_MAP
|
|
11
|
-
* are skipped with a SourceError (warn-and-continue, FR-008a).
|
|
12
|
-
*/
|
|
13
|
-
import type { CapabilityEntry, SourceError } from "./capability-entry.js";
|
|
14
|
-
/**
|
|
15
|
-
* Minimal shape of a native MCP tool definition.
|
|
16
|
-
* Matches the Tool type in index.ts without importing it (avoids circular dep).
|
|
17
|
-
*/
|
|
18
|
-
interface NativeTool {
|
|
19
|
-
name: string;
|
|
20
|
-
description?: string;
|
|
21
|
-
inputSchema: Record<string, unknown>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Read the native MCP tool source and return CapabilityEntry[].
|
|
25
|
-
*
|
|
26
|
-
* Accepts the TOOLS array as an argument so tests can inject fixtures
|
|
27
|
-
* without touching index.ts (FR-009).
|
|
28
|
-
*
|
|
29
|
-
* @param tools The TOOLS array from index.ts (or a fixture subset for tests).
|
|
30
|
-
* @returns { entries, errors } — entries for every tool in TOOL_META_MAP;
|
|
31
|
-
* errors for tools missing from the catalog.
|
|
32
|
-
*/
|
|
33
|
-
export declare function readMcpSource(tools: NativeTool[]): {
|
|
34
|
-
entries: CapabilityEntry[];
|
|
35
|
-
errors: SourceError[];
|
|
36
|
-
};
|
|
37
|
-
export {};
|
|
38
|
-
//# sourceMappingURL=mcp-source.d.ts.map
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* mcp-source.ts
|
|
3
|
-
* MCP source reader for the Comet Discovery Layer (Spec 042, T020).
|
|
4
|
-
*
|
|
5
|
-
* Reads the native tool metadata catalog (tool-meta.ts) and the TOOLS
|
|
6
|
-
* array from the running MCP server (imported via tool-registry.ts to
|
|
7
|
-
* avoid circular imports), then produces CapabilityEntry[] with
|
|
8
|
-
* sourceLayer: "mcp" for every registered native tool.
|
|
9
|
-
*
|
|
10
|
-
* Tools in the TOOLS array that have no matching entry in TOOL_META_MAP
|
|
11
|
-
* are skipped with a SourceError (warn-and-continue, FR-008a).
|
|
12
|
-
*/
|
|
13
|
-
import { errorFromException } from "./source-error.js";
|
|
14
|
-
import { assertSafety } from "./safety.js";
|
|
15
|
-
import { TOOL_META_MAP } from "./tool-meta.js";
|
|
16
|
-
// ---------------------------------------------------------------------------
|
|
17
|
-
// Source reader
|
|
18
|
-
// ---------------------------------------------------------------------------
|
|
19
|
-
/**
|
|
20
|
-
* Read the native MCP tool source and return CapabilityEntry[].
|
|
21
|
-
*
|
|
22
|
-
* Accepts the TOOLS array as an argument so tests can inject fixtures
|
|
23
|
-
* without touching index.ts (FR-009).
|
|
24
|
-
*
|
|
25
|
-
* @param tools The TOOLS array from index.ts (or a fixture subset for tests).
|
|
26
|
-
* @returns { entries, errors } — entries for every tool in TOOL_META_MAP;
|
|
27
|
-
* errors for tools missing from the catalog.
|
|
28
|
-
*/
|
|
29
|
-
export function readMcpSource(tools) {
|
|
30
|
-
const entries = [];
|
|
31
|
-
const errors = [];
|
|
32
|
-
for (const tool of tools) {
|
|
33
|
-
const meta = TOOL_META_MAP.get(tool.name);
|
|
34
|
-
if (!meta) {
|
|
35
|
-
errors.push({
|
|
36
|
-
source: "mcp",
|
|
37
|
-
reason: `Tool "${tool.name}" has no entry in TOOL_META_MAP — add one to tool-meta.ts`,
|
|
38
|
-
});
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
// Validate safety class (should always pass for hand-authored catalog)
|
|
42
|
-
let safety;
|
|
43
|
-
try {
|
|
44
|
-
safety = assertSafety(meta.safety, tool.name);
|
|
45
|
-
}
|
|
46
|
-
catch (err) {
|
|
47
|
-
errors.push(errorFromException("mcp", err));
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
const entry = {
|
|
51
|
-
name: tool.name,
|
|
52
|
-
sourceLayer: "mcp",
|
|
53
|
-
sourcePath: `comet-mcp/src/index.ts#tool_${tool.name}`,
|
|
54
|
-
canonicalId: meta.canonicalId,
|
|
55
|
-
description: meta.description,
|
|
56
|
-
intentKeywords: meta.intentKeywords,
|
|
57
|
-
safety,
|
|
58
|
-
preconditions: meta.preconditions,
|
|
59
|
-
argsSchema: tool.inputSchema,
|
|
60
|
-
humanOnly: false,
|
|
61
|
-
invocation: { kind: "native", toolName: tool.name },
|
|
62
|
-
crossRef: null, // singletons until dedup.ts runs (T043)
|
|
63
|
-
recommended: true, // all native entries are recommended until dedup.ts runs
|
|
64
|
-
alternativeLabel: null,
|
|
65
|
-
};
|
|
66
|
-
entries.push(entry);
|
|
67
|
-
}
|
|
68
|
-
return { entries, errors };
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=mcp-source.js.map
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* metadata-completeness.ts
|
|
3
|
-
* Metadata completeness validator for the Comet Discovery Layer (Spec 042, T032).
|
|
4
|
-
*
|
|
5
|
-
* Walks a CapabilityEntry[] and returns a MetadataCompletenessReport with:
|
|
6
|
-
* - completeness ratio (1.0 = SC-003 satisfied)
|
|
7
|
-
* - per-entry gap list for drift-check and test assertion
|
|
8
|
-
*
|
|
9
|
-
* Used by:
|
|
10
|
-
* - metadata-completeness.test.ts (T028)
|
|
11
|
-
* - coverage.ts (US4, T054) for DriftReport.safetyGaps
|
|
12
|
-
*/
|
|
13
|
-
import type { CapabilityEntry } from "./capability-entry.js";
|
|
14
|
-
export interface MetadataGap {
|
|
15
|
-
/** Entry name (tool name / plugin slug / extension slug). */
|
|
16
|
-
name: string;
|
|
17
|
-
/** Which field is incomplete. */
|
|
18
|
-
field: "safety" | "sourceLayer" | "preconditions" | "description" | "canonicalId" | "intentKeywords";
|
|
19
|
-
/** Human-readable reason. */
|
|
20
|
-
reason: string;
|
|
21
|
-
}
|
|
22
|
-
export interface MetadataCompletenessReport {
|
|
23
|
-
/**
|
|
24
|
-
* Ratio of entries with zero gaps to total entries.
|
|
25
|
-
* 0.0 (all entries gapped) to 1.0 (all entries complete).
|
|
26
|
-
* 1.0 = SC-003 satisfied.
|
|
27
|
-
*/
|
|
28
|
-
completeness: number;
|
|
29
|
-
/** All gaps found across all entries. */
|
|
30
|
-
gaps: MetadataGap[];
|
|
31
|
-
/** How many entries were checked. */
|
|
32
|
-
totalChecked: number;
|
|
33
|
-
/** How many entries had zero gaps. */
|
|
34
|
-
totalComplete: number;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Validate metadata completeness for a list of CapabilityEntry objects.
|
|
38
|
-
* Returns the completeness ratio and all gaps found.
|
|
39
|
-
*
|
|
40
|
-
* @param entries The composed registry entries to validate.
|
|
41
|
-
*/
|
|
42
|
-
export declare function checkMetadataCompleteness(entries: CapabilityEntry[]): MetadataCompletenessReport;
|
|
43
|
-
/**
|
|
44
|
-
* Returns the names of entries missing their safety classification.
|
|
45
|
-
* Used by coverage.ts to populate DriftReport.safetyGaps.
|
|
46
|
-
*/
|
|
47
|
-
export declare function getSafetyGaps(entries: CapabilityEntry[]): string[];
|
|
48
|
-
//# sourceMappingURL=metadata-completeness.d.ts.map
|