@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,116 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical Task Thread Types & Status Rule Set — Phase A
|
|
3
|
-
*
|
|
4
|
-
* AUTHORITATIVE LOCATION (FR-004): This file is the single source of truth
|
|
5
|
-
* for the Phase A canonical status vocabulary, conflict-resolution precedence,
|
|
6
|
-
* and valid lifecycle transition rules for the Comet browser surface worktree.
|
|
7
|
-
*
|
|
8
|
-
* In Phase B this document MUST link to or be replaced by the canonical rule
|
|
9
|
-
* from equa-taskthreads spec 003 (core API).
|
|
10
|
-
*
|
|
11
|
-
* Spec: specs/041-task-thread-sync/spec.md
|
|
12
|
-
* Plan: specs/041-task-thread-sync/plan.md §Canonical Status Rule Set
|
|
13
|
-
*/
|
|
14
|
-
/** Terminal statuses — once set by the lifecycle layer, cannot revert (FR-008) */
|
|
15
|
-
export const TERMINAL_STATUSES = new Set(["Completed", "Aborted", "Archived"]);
|
|
16
|
-
export function isTerminal(status) {
|
|
17
|
-
return TERMINAL_STATUSES.has(status);
|
|
18
|
-
}
|
|
19
|
-
// ─── State Machine — Valid Transitions (FR-017, FR-019) ──────────────────────
|
|
20
|
-
/**
|
|
21
|
-
* Maps each canonical status to the set of write actions the user may invoke
|
|
22
|
-
* from that state. The extension renders exactly these buttons (FR-017).
|
|
23
|
-
*
|
|
24
|
-
* Action names match the payload `action` field for POST /api/task-threads/:id/transition.
|
|
25
|
-
*/
|
|
26
|
-
export const VALID_TRANSITIONS = {
|
|
27
|
-
Dispatched: ["Start", "Abort"],
|
|
28
|
-
Running: ["Pause", "Mark Complete", "Abort"],
|
|
29
|
-
Paused: ["Resume", "Abort"],
|
|
30
|
-
Completed: ["Archive"],
|
|
31
|
-
Aborted: ["Archive"],
|
|
32
|
-
Archived: [], // terminal — no further transitions
|
|
33
|
-
};
|
|
34
|
-
// ─── Canonical Status Resolver (FR-002, FR-006–FR-009) ───────────────────────
|
|
35
|
-
/**
|
|
36
|
-
* Derives exactly one canonical status from the union of underlying layer states.
|
|
37
|
-
*
|
|
38
|
-
* Precedence (FR-006, FR-007):
|
|
39
|
-
* 1. Lifecycle layer (highest authority — Lifecycle wins)
|
|
40
|
-
* 2. Snapshot layer
|
|
41
|
-
* 3. Session manifest layer
|
|
42
|
-
* 4. Archive layer
|
|
43
|
-
* 5. Alert log layer
|
|
44
|
-
* 6. Unknown → Archived (safe display fallback)
|
|
45
|
-
*
|
|
46
|
-
* Terminal states (Completed, Aborted, Archived) are sticky once set by
|
|
47
|
-
* the lifecycle layer (FR-008).
|
|
48
|
-
*/
|
|
49
|
-
export function resolveCanonicalStatus(layers) {
|
|
50
|
-
// 1. Lifecycle layer — highest authority
|
|
51
|
-
if (layers.lifecycle !== null) {
|
|
52
|
-
switch (layers.lifecycle) {
|
|
53
|
-
case "started": return "Running";
|
|
54
|
-
case "dispatched": return "Dispatched";
|
|
55
|
-
case "paused": return "Paused";
|
|
56
|
-
case "completed": return "Completed"; // terminal — sticky
|
|
57
|
-
case "aborted": return "Aborted"; // terminal — sticky
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// 2. Snapshot layer
|
|
61
|
-
if (layers.snapshot !== null) {
|
|
62
|
-
switch (layers.snapshot) {
|
|
63
|
-
case "success": return "Completed";
|
|
64
|
-
case "failed":
|
|
65
|
-
case "abandoned": return "Aborted";
|
|
66
|
-
case "in-progress": return "Running";
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
// 3. Session manifest layer
|
|
70
|
-
if (layers.sessionManifest !== null) {
|
|
71
|
-
switch (layers.sessionManifest) {
|
|
72
|
-
case "active":
|
|
73
|
-
case "disconnecting": return "Running";
|
|
74
|
-
case "orphaned": return "Aborted"; // agent dead, no explicit transition
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
// 4. Archive layer
|
|
78
|
-
if (layers.archive !== null) {
|
|
79
|
-
switch (layers.archive) {
|
|
80
|
-
case "archived":
|
|
81
|
-
case "saved": return "Archived";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
// 5. Alert log layer
|
|
85
|
-
if (layers.alertLog !== null) {
|
|
86
|
-
if (layers.alertLog === "ORPHAN_DETECTED" || layers.alertLog === "ORPHAN_REAPED") {
|
|
87
|
-
return "Aborted";
|
|
88
|
-
}
|
|
89
|
-
// Other alert types — fallthrough to Archived as safe default
|
|
90
|
-
}
|
|
91
|
-
// 6. No layer has a record — safe display fallback
|
|
92
|
-
return "Archived";
|
|
93
|
-
}
|
|
94
|
-
// ─── Transition Validation (FR-019) ──────────────────────────────────────────
|
|
95
|
-
export class InvalidTransitionError extends Error {
|
|
96
|
-
fromStatus;
|
|
97
|
-
action;
|
|
98
|
-
constructor(fromStatus, action) {
|
|
99
|
-
super(`Action "${action}" is not valid from status "${fromStatus}". ` +
|
|
100
|
-
`Valid actions: ${VALID_TRANSITIONS[fromStatus].join(", ") || "none"}.`);
|
|
101
|
-
this.fromStatus = fromStatus;
|
|
102
|
-
this.action = action;
|
|
103
|
-
this.name = "InvalidTransitionError";
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Throws InvalidTransitionError if the action is not valid from the given status.
|
|
108
|
-
* Does NOT perform the transition — call this before executing any write.
|
|
109
|
-
*/
|
|
110
|
-
export function assertValidTransition(status, action) {
|
|
111
|
-
const allowed = VALID_TRANSITIONS[status];
|
|
112
|
-
if (!allowed.includes(action)) {
|
|
113
|
-
throw new InvalidTransitionError(status, action);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=task-thread-canonical.js.map
|