@insitue/capture-core 0.1.0 → 0.2.0
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/dist/index.d.ts +33 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ declare const CAPTURE_SCHEMA_VERSION: 3;
|
|
|
47
47
|
/** Bump when the WS envelope below changes; companion/SDK pin it.
|
|
48
48
|
* v2: agent edit-loop messages (M2). v3: session undo/commit (M3).
|
|
49
49
|
* v4: agent-activity (M6 — live "what it's doing" feedback). */
|
|
50
|
-
declare const PROTOCOL_VERSION:
|
|
50
|
+
declare const PROTOCOL_VERSION: 5;
|
|
51
51
|
interface SourceLoc {
|
|
52
52
|
/** Repo-relative POSIX path, e.g. `components/MainBar.tsx`. */
|
|
53
53
|
file: string;
|
|
@@ -343,9 +343,38 @@ interface AgentSessionCommittedMsg {
|
|
|
343
343
|
commit: string;
|
|
344
344
|
files: string[];
|
|
345
345
|
}
|
|
346
|
+
/** Browser → companion: user clicked Send in the overlay's ASK
|
|
347
|
+
* textbox AND a CLI/MCP subscriber is attached. Companion
|
|
348
|
+
* re-broadcasts as `broadcast-ask` to subscribers and does NOT
|
|
349
|
+
* spawn its own headless agent. */
|
|
350
|
+
interface AgentAskExternalMsg {
|
|
351
|
+
t: "agent-ask-external";
|
|
352
|
+
turnId: string;
|
|
353
|
+
bundleId: string;
|
|
354
|
+
text: string;
|
|
355
|
+
}
|
|
356
|
+
/** Companion → CLI/MCP subscribers: a browser just sent an external
|
|
357
|
+
* ask. Joined with the matching `broadcast-capture` by `bundleId`
|
|
358
|
+
* in the subscriber (the MCP bridge holds picks for a few seconds
|
|
359
|
+
* so the ask catches up). */
|
|
360
|
+
interface BroadcastAskMsg {
|
|
361
|
+
t: "broadcast-ask";
|
|
362
|
+
bundleId: string;
|
|
363
|
+
text: string;
|
|
364
|
+
at: string;
|
|
365
|
+
}
|
|
366
|
+
/** Companion → browser: how many CLI/MCP subscribers are currently
|
|
367
|
+
* attached. Pushed on every connect + disconnect so the overlay
|
|
368
|
+
* can show/hide the "→ claude in terminal" badge and route Send
|
|
369
|
+
* accordingly. count=0 means "no external agent attached — Send
|
|
370
|
+
* goes to the in-overlay headless agent (today's behavior)". */
|
|
371
|
+
interface SubscribersAttachedMsg {
|
|
372
|
+
t: "subscribers-attached";
|
|
373
|
+
count: number;
|
|
374
|
+
}
|
|
346
375
|
/** Client→server messages. */
|
|
347
|
-
type ClientMessage = HelloMsg | PingMsg | CaptureSubmitMsg | AgentTurnMsg | AgentDecisionMsg | AgentCancelMsg | AgentUndoMsg | AgentUndoSessionMsg | AgentCommitSessionMsg;
|
|
376
|
+
type ClientMessage = HelloMsg | PingMsg | CaptureSubmitMsg | AgentTurnMsg | AgentAskExternalMsg | AgentDecisionMsg | AgentCancelMsg | AgentUndoMsg | AgentUndoSessionMsg | AgentCommitSessionMsg;
|
|
348
377
|
/** Server→client messages. */
|
|
349
|
-
type ServerMessage = HelloOkMsg | PongMsg | ErrorMsg | CaptureResolvedMsg | AgentStatusMsg | AgentStreamMsg | ChangesetProposedMsg | ChangesetAppliedMsg | AgentUndoneMsg | AgentSessionUndoneMsg | AgentSessionCommittedMsg;
|
|
378
|
+
type ServerMessage = HelloOkMsg | PongMsg | ErrorMsg | CaptureResolvedMsg | AgentStatusMsg | AgentStreamMsg | ChangesetProposedMsg | ChangesetAppliedMsg | AgentUndoneMsg | AgentSessionUndoneMsg | AgentSessionCommittedMsg | SubscribersAttachedMsg;
|
|
350
379
|
|
|
351
|
-
export { type AgentCancelMsg, type AgentCommitSessionMsg, type AgentDecisionMsg, type AgentErrorCode, type AgentEvent, type AgentSessionCommittedMsg, type AgentSessionUndoneMsg, type AgentStatusMsg, type AgentStreamMsg, type AgentTurnMsg, type AgentUndoMsg, type AgentUndoSessionMsg, type AgentUndoneMsg, CAPTURE_SCHEMA_VERSION, type CaptureBundle, type CaptureCore, type CaptureResolvedMsg, type CaptureSink, type CaptureSubmitMsg, type CaptureTarget, type ChangesetAppliedMsg, type ChangesetProposedMsg, type ClientMessage, type ConsoleEntry, type ErrorMsg, type HelloMsg, type HelloOkMsg, type IssueDraft, IssueTrackerSink, type NetworkEntry, PROTOCOL_VERSION, type PingMsg, type PongMsg, type ProposedEdit, type ResolvedSource, type RuntimeError, type SelectionInput, type SelectionMode, type SerializedNode, type ServerMessage, type SourceConfidence, type SourceLoc, breakpointFor, buildSelector, curateComputedStyles, extractTailwindClasses, resolveTarget, serializeNode, toIssueDraft };
|
|
380
|
+
export { type AgentAskExternalMsg, type AgentCancelMsg, type AgentCommitSessionMsg, type AgentDecisionMsg, type AgentErrorCode, type AgentEvent, type AgentSessionCommittedMsg, type AgentSessionUndoneMsg, type AgentStatusMsg, type AgentStreamMsg, type AgentTurnMsg, type AgentUndoMsg, type AgentUndoSessionMsg, type AgentUndoneMsg, type BroadcastAskMsg, CAPTURE_SCHEMA_VERSION, type CaptureBundle, type CaptureCore, type CaptureResolvedMsg, type CaptureSink, type CaptureSubmitMsg, type CaptureTarget, type ChangesetAppliedMsg, type ChangesetProposedMsg, type ClientMessage, type ConsoleEntry, type ErrorMsg, type HelloMsg, type HelloOkMsg, type IssueDraft, IssueTrackerSink, type NetworkEntry, PROTOCOL_VERSION, type PingMsg, type PongMsg, type ProposedEdit, type ResolvedSource, type RuntimeError, type SelectionInput, type SelectionMode, type SerializedNode, type ServerMessage, type SourceConfidence, type SourceLoc, type SubscribersAttachedMsg, breakpointFor, buildSelector, curateComputedStyles, extractTailwindClasses, resolveTarget, serializeNode, toIssueDraft };
|
package/dist/index.js
CHANGED
|
@@ -188,7 +188,7 @@ function resolveTarget(el) {
|
|
|
188
188
|
|
|
189
189
|
// src/index.ts
|
|
190
190
|
var CAPTURE_SCHEMA_VERSION = 3;
|
|
191
|
-
var PROTOCOL_VERSION =
|
|
191
|
+
var PROTOCOL_VERSION = 5;
|
|
192
192
|
function toIssueDraft(bundle) {
|
|
193
193
|
const t = bundle.target;
|
|
194
194
|
const where = t?.source ? `\`${t.source.file}:${t.source.line}\` (${t.confidence})` : t ? `\`${t.selector}\` (selector-only \u2014 no source resolver)` : "(empty selection)";
|