@plannotator/opencode 0.27.5 → 0.27.7
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/embedded.js +204 -77
- package/dist/index.js +10 -4
- package/dist/server.js +2 -1
- package/package.json +7 -4
- package/plannotator.html +3 -3
- package/review-editor.html +3 -3
- package/skills/plannotator/SKILL.md +185 -0
- package/skills/plannotator/agents/openai.yaml +9 -0
package/dist/embedded.js
CHANGED
|
@@ -73591,6 +73591,36 @@ var init_claude_agent_sdk = __esm(() => {
|
|
|
73591
73591
|
registerProviderFactory(PROVIDER_NAME, async (config) => new ClaudeAgentSDKProvider(config));
|
|
73592
73592
|
});
|
|
73593
73593
|
|
|
73594
|
+
// ../../packages/ai/providers/child-io.ts
|
|
73595
|
+
function toChildError(err) {
|
|
73596
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
73597
|
+
}
|
|
73598
|
+
function guardChildStreams(proc, label, onFailure) {
|
|
73599
|
+
const report = (stream) => (err) => {
|
|
73600
|
+
onFailure(new Error(`${label} ${stream} failed: ${toChildError(err).message}`));
|
|
73601
|
+
};
|
|
73602
|
+
proc.on("error", report("process"));
|
|
73603
|
+
proc.stdin?.on("error", report("stdin"));
|
|
73604
|
+
proc.stdout?.on("error", report("stdout"));
|
|
73605
|
+
proc.stderr?.on("error", report("stderr"));
|
|
73606
|
+
}
|
|
73607
|
+
function writeChildLine(proc, line, label, onAsyncFailure) {
|
|
73608
|
+
const stdin = proc?.stdin;
|
|
73609
|
+
if (!stdin || stdin.destroyed || stdin.writableEnded) {
|
|
73610
|
+
return new Error(`${label} stdin is closed`);
|
|
73611
|
+
}
|
|
73612
|
+
try {
|
|
73613
|
+
stdin.write(line, (err) => {
|
|
73614
|
+
if (err) {
|
|
73615
|
+
onAsyncFailure(new Error(`${label} stdin write failed: ${toChildError(err).message}`));
|
|
73616
|
+
}
|
|
73617
|
+
});
|
|
73618
|
+
} catch (err) {
|
|
73619
|
+
return new Error(`${label} stdin write failed: ${toChildError(err).message}`);
|
|
73620
|
+
}
|
|
73621
|
+
return null;
|
|
73622
|
+
}
|
|
73623
|
+
|
|
73594
73624
|
// ../../packages/ai/providers/codex-app-server.ts
|
|
73595
73625
|
var exports_codex_app_server = {};
|
|
73596
73626
|
__export(exports_codex_app_server, {
|
|
@@ -73772,6 +73802,7 @@ class CodexAppServerProcess {
|
|
|
73772
73802
|
throw error;
|
|
73773
73803
|
}
|
|
73774
73804
|
this.proc = proc;
|
|
73805
|
+
guardChildStreams(proc, CODEX_PROCESS_LABEL, (error) => this.failProcess(error));
|
|
73775
73806
|
proc.once("exit", () => {
|
|
73776
73807
|
this.handleProcessEnd(new Error("Codex app-server exited unexpectedly"));
|
|
73777
73808
|
});
|
|
@@ -73807,6 +73838,17 @@ class CodexAppServerProcess {
|
|
|
73807
73838
|
}
|
|
73808
73839
|
this.send({ method: "initialized", params: {} });
|
|
73809
73840
|
}
|
|
73841
|
+
failProcess(error) {
|
|
73842
|
+
const proc = this.proc;
|
|
73843
|
+
this.startPromise = null;
|
|
73844
|
+
this.handleProcessEnd(error);
|
|
73845
|
+
if (proc) {
|
|
73846
|
+
try {
|
|
73847
|
+
if (!killWindowsProcessTree(proc.pid))
|
|
73848
|
+
proc.kill();
|
|
73849
|
+
} catch {}
|
|
73850
|
+
}
|
|
73851
|
+
}
|
|
73810
73852
|
handleProcessEnd(error) {
|
|
73811
73853
|
if (!this.proc && this.pendingRequests.size === 0)
|
|
73812
73854
|
return;
|
|
@@ -73870,10 +73912,10 @@ class CodexAppServerProcess {
|
|
|
73870
73912
|
}
|
|
73871
73913
|
}
|
|
73872
73914
|
send(message) {
|
|
73873
|
-
|
|
73874
|
-
|
|
73875
|
-
|
|
73876
|
-
|
|
73915
|
+
const error = writeChildLine(this.proc, `${JSON.stringify(message)}
|
|
73916
|
+
`, CODEX_PROCESS_LABEL, (err) => this.failProcess(err));
|
|
73917
|
+
if (error)
|
|
73918
|
+
this.failProcess(error);
|
|
73877
73919
|
}
|
|
73878
73920
|
sendAndWait(message, timeoutMs = RPC_TIMEOUT_MS) {
|
|
73879
73921
|
const id = ++this.nextId;
|
|
@@ -74028,7 +74070,7 @@ class CodexAppServerProvider {
|
|
|
74028
74070
|
this.sessions.clear();
|
|
74029
74071
|
}
|
|
74030
74072
|
}
|
|
74031
|
-
var PROVIDER_NAME2 = "codex-sdk", DEFAULT_MODEL2 = "gpt-5.6-sol", CLIENT_NAME = "plannotator", IDLE_TIMEOUT_MS, RPC_TIMEOUT_MS = 30000, MODEL_DISCOVERY_TIMEOUT_MS = 6000, CMD_APPROVAL_METHOD = "item/commandExecution/requestApproval", FILE_APPROVAL_METHOD = "item/fileChange/requestApproval", PERMISSIONS_APPROVAL_METHOD = "item/permissions/requestApproval", REASONING_EFFORT_LABELS, CodexAppServerSession;
|
|
74073
|
+
var PROVIDER_NAME2 = "codex-sdk", CODEX_PROCESS_LABEL = "Codex app-server", DEFAULT_MODEL2 = "gpt-5.6-sol", CLIENT_NAME = "plannotator", IDLE_TIMEOUT_MS, RPC_TIMEOUT_MS = 30000, MODEL_DISCOVERY_TIMEOUT_MS = 6000, CMD_APPROVAL_METHOD = "item/commandExecution/requestApproval", FILE_APPROVAL_METHOD = "item/fileChange/requestApproval", PERMISSIONS_APPROVAL_METHOD = "item/permissions/requestApproval", REASONING_EFFORT_LABELS, CodexAppServerSession;
|
|
74032
74074
|
var init_codex_app_server = __esm(() => {
|
|
74033
74075
|
init_base_session();
|
|
74034
74076
|
init_context();
|
|
@@ -74391,7 +74433,7 @@ class PiProcess {
|
|
|
74391
74433
|
cwd,
|
|
74392
74434
|
stdin: "pipe",
|
|
74393
74435
|
stdout: "pipe",
|
|
74394
|
-
stderr: "
|
|
74436
|
+
stderr: "ignore"
|
|
74395
74437
|
});
|
|
74396
74438
|
} catch (err) {
|
|
74397
74439
|
const error = err instanceof Error ? err : new Error(String(err));
|
|
@@ -74404,6 +74446,16 @@ class PiProcess {
|
|
|
74404
74446
|
this.handleProcessEnd(new Error("Pi process exited unexpectedly"));
|
|
74405
74447
|
});
|
|
74406
74448
|
}
|
|
74449
|
+
failProcess(error) {
|
|
74450
|
+
const proc = this.proc;
|
|
74451
|
+
this.handleProcessEnd(error);
|
|
74452
|
+
if (proc) {
|
|
74453
|
+
try {
|
|
74454
|
+
if (!killWindowsProcessTree(proc.pid))
|
|
74455
|
+
proc.kill();
|
|
74456
|
+
} catch {}
|
|
74457
|
+
}
|
|
74458
|
+
}
|
|
74407
74459
|
handleProcessEnd(error) {
|
|
74408
74460
|
if (!this.proc && this.pendingRequests.size === 0)
|
|
74409
74461
|
return;
|
|
@@ -74461,12 +74513,24 @@ class PiProcess {
|
|
|
74461
74513
|
}
|
|
74462
74514
|
}
|
|
74463
74515
|
send(command) {
|
|
74464
|
-
|
|
74516
|
+
const stdin = this.proc?.stdin;
|
|
74517
|
+
if (!stdin || typeof stdin === "number") {
|
|
74518
|
+
this.failProcess(new Error("Pi process stdin is closed"));
|
|
74465
74519
|
return;
|
|
74466
|
-
|
|
74467
|
-
sink
|
|
74520
|
+
}
|
|
74521
|
+
const sink = stdin;
|
|
74522
|
+
try {
|
|
74523
|
+
sink.write(`${JSON.stringify(command)}
|
|
74468
74524
|
`);
|
|
74469
|
-
|
|
74525
|
+
const flushed = sink.flush();
|
|
74526
|
+
if (flushed && typeof flushed.then === "function") {
|
|
74527
|
+
flushed.catch((err) => {
|
|
74528
|
+
this.failProcess(new Error(`Pi process stdin write failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
74529
|
+
});
|
|
74530
|
+
}
|
|
74531
|
+
} catch (err) {
|
|
74532
|
+
this.failProcess(new Error(`Pi process stdin write failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
74533
|
+
}
|
|
74470
74534
|
}
|
|
74471
74535
|
sendAndWait(command) {
|
|
74472
74536
|
const id = `req_${++this.nextId}`;
|
|
@@ -77947,6 +78011,8 @@ function jjCompareTargetRevset(target) {
|
|
|
77947
78011
|
if (remoteBookmark) {
|
|
77948
78012
|
return `remote_bookmarks(exact:${quoteJjString(remoteBookmark.name)}, exact:${quoteJjString(remoteBookmark.remote)})`;
|
|
77949
78013
|
}
|
|
78014
|
+
if (JJ_FULL_COMMIT_ID.test(target))
|
|
78015
|
+
return target;
|
|
77950
78016
|
const localBookmark = parseJjBookmarkName(target);
|
|
77951
78017
|
return localBookmark ? `bookmarks(exact:${quoteJjString(localBookmark)})` : target;
|
|
77952
78018
|
}
|
|
@@ -79113,11 +79179,12 @@ function isBinaryPatchFile(patch, filePath) {
|
|
|
79113
79179
|
}
|
|
79114
79180
|
return false;
|
|
79115
79181
|
}
|
|
79116
|
-
var JJ_TRUNK_REVSET = "trunk()", MAX_REVIEW_FILE_CONTENT_BYTES, MAX_UNTRACKED_DIFF_CONCURRENCY = 4, MAX_UNTRACKED_FINGERPRINT_CONTENT_BYTES, RECENT_COMMIT_LIMIT_DEFAULT = 20, COMMIT_FIELD_SEP = "\x1F", NULL_OBJECT_ID, BOUNDED_DIFF_GIT_CONFIG, WORKTREE_SUB_TYPES, BARE_HEX_SHA_RE, MAX_UNTRACKED_FINGERPRINT_FILES = 20, UNTRACKED_STATUS_OUTPUT_CAP, collapsedUntrackedCwds;
|
|
79182
|
+
var JJ_TRUNK_REVSET = "trunk()", MAX_REVIEW_FILE_CONTENT_BYTES, MAX_UNTRACKED_DIFF_CONCURRENCY = 4, MAX_UNTRACKED_FINGERPRINT_CONTENT_BYTES, JJ_FULL_COMMIT_ID, RECENT_COMMIT_LIMIT_DEFAULT = 20, COMMIT_FIELD_SEP = "\x1F", NULL_OBJECT_ID, BOUNDED_DIFF_GIT_CONFIG, WORKTREE_SUB_TYPES, BARE_HEX_SHA_RE, MAX_UNTRACKED_FINGERPRINT_FILES = 20, UNTRACKED_STATUS_OUTPUT_CAP, collapsedUntrackedCwds;
|
|
79117
79183
|
var init_review_core = __esm(() => {
|
|
79118
79184
|
init_diff_paths2();
|
|
79119
79185
|
MAX_REVIEW_FILE_CONTENT_BYTES = 5 * 1024 * 1024;
|
|
79120
79186
|
MAX_UNTRACKED_FINGERPRINT_CONTENT_BYTES = 1024 * 1024;
|
|
79187
|
+
JJ_FULL_COMMIT_ID = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;
|
|
79121
79188
|
NULL_OBJECT_ID = /^0+$/;
|
|
79122
79189
|
BOUNDED_DIFF_GIT_CONFIG = {
|
|
79123
79190
|
"core.bigFileThreshold": String(MAX_REVIEW_FILE_CONTENT_BYTES)
|
|
@@ -79372,13 +79439,27 @@ async function selectDefaultJjCompareTarget(runtime, cwd) {
|
|
|
79372
79439
|
"log",
|
|
79373
79440
|
"--no-graph",
|
|
79374
79441
|
"-r",
|
|
79375
|
-
|
|
79442
|
+
JJ_LINE_BASE_REVSET,
|
|
79376
79443
|
"-T",
|
|
79377
|
-
|
|
79444
|
+
'json(bookmarks) ++ "\\t" ++ commit_id ++ "\\n"'
|
|
79378
79445
|
], { cwd });
|
|
79379
79446
|
if (result.exitCode !== 0)
|
|
79380
79447
|
return JJ_TRUNK_REVSET;
|
|
79381
|
-
|
|
79448
|
+
const [record] = splitJjTemplateRecords(result.stdout);
|
|
79449
|
+
if (!record)
|
|
79450
|
+
return JJ_TRUNK_REVSET;
|
|
79451
|
+
const fields = splitJjTemplateFields(record);
|
|
79452
|
+
const bookmark = parseJjResolvedBookmarks(fields?.[0] ?? record).find((name) => !isGeneratedPushBookmark(name));
|
|
79453
|
+
if (bookmark)
|
|
79454
|
+
return bookmark;
|
|
79455
|
+
const commitId = fields?.[1]?.trim();
|
|
79456
|
+
if (commitId && !JJ_ROOT_COMMIT_ID.test(commitId))
|
|
79457
|
+
return commitId;
|
|
79458
|
+
return JJ_TRUNK_REVSET;
|
|
79459
|
+
}
|
|
79460
|
+
function isGeneratedPushBookmark(target) {
|
|
79461
|
+
const name = parseRemoteBookmark(target)?.name ?? target;
|
|
79462
|
+
return name.startsWith(JJ_GENERATED_PUSH_BOOKMARK_PREFIX);
|
|
79382
79463
|
}
|
|
79383
79464
|
function parseJjResolvedBookmarks(value) {
|
|
79384
79465
|
try {
|
|
@@ -79545,9 +79626,11 @@ function firstErrorLine(stderr) {
|
|
|
79545
79626
|
return;
|
|
79546
79627
|
return line.length > 200 ? line.slice(0, 200) + "..." : line;
|
|
79547
79628
|
}
|
|
79629
|
+
var JJ_LINE_BASE_REVSET = "latest(fork_point(roots(reachable(@, mutable()))-), 1)", JJ_GENERATED_PUSH_BOOKMARK_PREFIX = "push-", JJ_ROOT_COMMIT_ID;
|
|
79548
79630
|
var init_jj_core = __esm(() => {
|
|
79549
79631
|
init_review_core();
|
|
79550
79632
|
init_review_core();
|
|
79633
|
+
JJ_ROOT_COMMIT_ID = /^0+$/;
|
|
79551
79634
|
});
|
|
79552
79635
|
|
|
79553
79636
|
// ../../packages/shared/gitbutler-core.ts
|
|
@@ -83693,9 +83776,9 @@ function parseCallDiffWorkerResult(value) {
|
|
|
83693
83776
|
if (!isRecord2(value.result) || !Array.isArray(value.result.trees)) {
|
|
83694
83777
|
throw new Error("CallDiff worker response is missing its diff trees.");
|
|
83695
83778
|
}
|
|
83696
|
-
|
|
83697
|
-
|
|
83698
|
-
|
|
83779
|
+
const totalTreeCount = value.result.trees.length;
|
|
83780
|
+
const truncatedTrees = totalTreeCount > MAX_TREES;
|
|
83781
|
+
const boundedTreeCandidates = truncatedTrees ? value.result.trees.slice(0, MAX_TREES) : value.result.trees;
|
|
83699
83782
|
let nodeCount = 0;
|
|
83700
83783
|
const parseNode = (candidate, depth) => {
|
|
83701
83784
|
if (!isRecord2(candidate) || depth > MAX_TREE_DEPTH || ++nodeCount > MAX_NODES) {
|
|
@@ -83727,7 +83810,7 @@ function parseCallDiffWorkerResult(value) {
|
|
|
83727
83810
|
};
|
|
83728
83811
|
};
|
|
83729
83812
|
const raw2 = boundedRaw(value.result.ascii);
|
|
83730
|
-
const trees =
|
|
83813
|
+
const trees = boundedTreeCandidates.map((candidate) => {
|
|
83731
83814
|
if (!isRecord2(candidate))
|
|
83732
83815
|
throw new Error("CallDiff worker returned an invalid tree.");
|
|
83733
83816
|
const entry = boundedString(candidate.entry, "tree entry");
|
|
@@ -83759,6 +83842,12 @@ function parseCallDiffWorkerResult(value) {
|
|
|
83759
83842
|
});
|
|
83760
83843
|
}
|
|
83761
83844
|
}
|
|
83845
|
+
if (truncatedTrees) {
|
|
83846
|
+
diagnostics.push({
|
|
83847
|
+
level: "warning",
|
|
83848
|
+
message: `Showing the first ${MAX_TREES.toLocaleString("en-US")} of ${totalTreeCount.toLocaleString("en-US")} call trees; the rest were truncated to bound the result.`
|
|
83849
|
+
});
|
|
83850
|
+
}
|
|
83762
83851
|
return {
|
|
83763
83852
|
version: boundedString(value.version, "version", 100),
|
|
83764
83853
|
from: boundedString(value.result.from, "from snapshot"),
|
|
@@ -83825,7 +83914,7 @@ function indexCallFlowImpacts(trees) {
|
|
|
83825
83914
|
}
|
|
83826
83915
|
};
|
|
83827
83916
|
}
|
|
83828
|
-
var MAX_TREES =
|
|
83917
|
+
var MAX_TREES = 2000, MAX_NODES = 5000, MAX_TREE_DEPTH = 32, MAX_DIAGNOSTICS = 100, MAX_TEXT_LENGTH = 2000, MAX_RAW_LENGTH;
|
|
83829
83918
|
var init_call_flow_types = __esm(() => {
|
|
83830
83919
|
MAX_RAW_LENGTH = 1024 * 1024;
|
|
83831
83920
|
});
|
|
@@ -105386,7 +105475,7 @@ var init_agent_terminal3 = __esm(() => {
|
|
|
105386
105475
|
init_agent_terminal_runtime();
|
|
105387
105476
|
});
|
|
105388
105477
|
|
|
105389
|
-
// ../../packages/
|
|
105478
|
+
// ../../packages/shared/live-proxy-core.ts
|
|
105390
105479
|
function isLoopbackHostname(hostname) {
|
|
105391
105480
|
const host = hostname.toLowerCase();
|
|
105392
105481
|
if (host === "localhost" || host === "::1" || host === "[::1]")
|
|
@@ -105404,6 +105493,12 @@ function isAllowedProxyHost(hostHeader, port) {
|
|
|
105404
105493
|
function isAllowedProxyOrigin(origin, port) {
|
|
105405
105494
|
return origin === `http://127.0.0.1:${port}` || origin === `http://localhost:${port}` || origin === `http://[::1]:${port}`;
|
|
105406
105495
|
}
|
|
105496
|
+
function isAllowedWsUpgradeOrigin(origin, port) {
|
|
105497
|
+
return origin === null || isAllowedProxyOrigin(origin, port);
|
|
105498
|
+
}
|
|
105499
|
+
function isAllowedBridgeFetchSite(fetchSite) {
|
|
105500
|
+
return !fetchSite || fetchSite === "same-origin" || fetchSite === "none";
|
|
105501
|
+
}
|
|
105407
105502
|
function rewriteLoopbackLocation(location, target, proxyOrigin) {
|
|
105408
105503
|
if (!/^http:\/\//i.test(location))
|
|
105409
105504
|
return null;
|
|
@@ -105426,6 +105521,18 @@ function isDocumentIntentRequest(headers) {
|
|
|
105426
105521
|
const accept = headers.get("accept");
|
|
105427
105522
|
return !!accept && accept.includes("text/html");
|
|
105428
105523
|
}
|
|
105524
|
+
function isHtmlContentType(contentType) {
|
|
105525
|
+
return (contentType ?? "").toLowerCase().includes("text/html");
|
|
105526
|
+
}
|
|
105527
|
+
function buildFrameAncestorsPolicy(editorOrigins) {
|
|
105528
|
+
return `frame-ancestors ${editorOrigins.join(" ")}`;
|
|
105529
|
+
}
|
|
105530
|
+
function applyHtmlFramingHeaders(headers, frameAncestors) {
|
|
105531
|
+
headers.delete("x-frame-options");
|
|
105532
|
+
headers.delete("content-security-policy");
|
|
105533
|
+
headers.delete("content-security-policy-report-only");
|
|
105534
|
+
headers.set("content-security-policy", frameAncestors);
|
|
105535
|
+
}
|
|
105429
105536
|
function createHtmlInjector(injection) {
|
|
105430
105537
|
const encoder2 = new TextEncoder;
|
|
105431
105538
|
const injectionBytes = encoder2.encode(injection);
|
|
@@ -105593,6 +105700,54 @@ function createHtmlInjector(injection) {
|
|
|
105593
105700
|
}
|
|
105594
105701
|
};
|
|
105595
105702
|
}
|
|
105703
|
+
function composeLiveBridgeJs(sources) {
|
|
105704
|
+
return "window.__plannotatorLiveConfig = " + JSON.stringify({
|
|
105705
|
+
live: true,
|
|
105706
|
+
token: sources.token,
|
|
105707
|
+
editorOrigins: sources.editorOrigins,
|
|
105708
|
+
css: sources.annotationCss
|
|
105709
|
+
}) + `;
|
|
105710
|
+
` + sources.bridgeBootstrap + `
|
|
105711
|
+
` + sources.bridgeScript;
|
|
105712
|
+
}
|
|
105713
|
+
function buildLiveEditorOrigins(port) {
|
|
105714
|
+
return [`http://localhost:${port}`, `http://127.0.0.1:${port}`];
|
|
105715
|
+
}
|
|
105716
|
+
function buildLiveAppUrl(proxyPort, targetUrl) {
|
|
105717
|
+
let targetPath = "/";
|
|
105718
|
+
try {
|
|
105719
|
+
const parsedTarget = new URL(targetUrl);
|
|
105720
|
+
targetPath = parsedTarget.pathname + parsedTarget.search;
|
|
105721
|
+
} catch {
|
|
105722
|
+
targetPath = "/";
|
|
105723
|
+
}
|
|
105724
|
+
return `http://localhost:${proxyPort}${targetPath}`;
|
|
105725
|
+
}
|
|
105726
|
+
function liveAppDraftIdentity(targetUrl) {
|
|
105727
|
+
try {
|
|
105728
|
+
const url = new URL(targetUrl);
|
|
105729
|
+
const path3 = url.pathname.replace(/\/+$/, "");
|
|
105730
|
+
return `${url.origin}${path3}${url.search}`;
|
|
105731
|
+
} catch {
|
|
105732
|
+
return targetUrl.trim();
|
|
105733
|
+
}
|
|
105734
|
+
}
|
|
105735
|
+
var LIVE_PROXY_RESERVED_PREFIX = "/__plannotator__/", LIVE_PROXY_BRIDGE_PATH = "/__plannotator__/bridge.js", LIVE_PROXY_BRIDGE_TAG, HOP_BY_HOP_HEADERS, LIVE_PROXY_MAX_PENDING_WS_MESSAGES = 200, HEAD_OPEN = "<head", HEAD_CLOSE = "</head>", COMMENT_OPEN = "<!--", GT2 = 62, LT2 = 60, BANG = 33, QUESTION = 63, HYPHEN = 45, HOLDBACK = 8;
|
|
105736
|
+
var init_live_proxy_core = __esm(() => {
|
|
105737
|
+
LIVE_PROXY_BRIDGE_TAG = `<script src="${LIVE_PROXY_BRIDGE_PATH}"></script>`;
|
|
105738
|
+
HOP_BY_HOP_HEADERS = [
|
|
105739
|
+
"connection",
|
|
105740
|
+
"keep-alive",
|
|
105741
|
+
"proxy-authenticate",
|
|
105742
|
+
"proxy-authorization",
|
|
105743
|
+
"te",
|
|
105744
|
+
"trailer",
|
|
105745
|
+
"transfer-encoding",
|
|
105746
|
+
"upgrade"
|
|
105747
|
+
];
|
|
105748
|
+
});
|
|
105749
|
+
|
|
105750
|
+
// ../../packages/server/live-proxy.ts
|
|
105596
105751
|
function stripHopByHop(headers) {
|
|
105597
105752
|
for (const name of HOP_BY_HOP_HEADERS)
|
|
105598
105753
|
headers.delete(name);
|
|
@@ -105617,7 +105772,7 @@ function startLiveAppProxy(opts) {
|
|
|
105617
105772
|
}
|
|
105618
105773
|
const targetOrigin = target.origin;
|
|
105619
105774
|
const targetHost = target.host;
|
|
105620
|
-
const frameAncestors =
|
|
105775
|
+
const frameAncestors = buildFrameAncestorsPolicy(opts.editorOrigins);
|
|
105621
105776
|
const wsUpstreams = new Set;
|
|
105622
105777
|
let warnedEncodedHtml = false;
|
|
105623
105778
|
const server2 = Bun.serve({
|
|
@@ -105636,8 +105791,7 @@ function startLiveAppProxy(opts) {
|
|
|
105636
105791
|
}
|
|
105637
105792
|
if (url.pathname.startsWith(LIVE_PROXY_RESERVED_PREFIX)) {
|
|
105638
105793
|
if (url.pathname === LIVE_PROXY_BRIDGE_PATH && (req.method === "GET" || req.method === "HEAD")) {
|
|
105639
|
-
|
|
105640
|
-
if (fetchSite && fetchSite !== "same-origin" && fetchSite !== "none") {
|
|
105794
|
+
if (!isAllowedBridgeFetchSite(req.headers.get("sec-fetch-site"))) {
|
|
105641
105795
|
return new Response("Forbidden", { status: 403, headers: { "Content-Type": "text/plain" } });
|
|
105642
105796
|
}
|
|
105643
105797
|
return new Response(req.method === "HEAD" ? null : opts.bridgeJs, {
|
|
@@ -105650,8 +105804,7 @@ function startLiveAppProxy(opts) {
|
|
|
105650
105804
|
return new Response("Not found", { status: 404 });
|
|
105651
105805
|
}
|
|
105652
105806
|
if ((req.headers.get("upgrade") ?? "").toLowerCase() === "websocket") {
|
|
105653
|
-
|
|
105654
|
-
if (wsOrigin !== null && !isAllowedProxyOrigin(wsOrigin, srv.port)) {
|
|
105807
|
+
if (!isAllowedWsUpgradeOrigin(req.headers.get("origin"), srv.port)) {
|
|
105655
105808
|
return new Response("Forbidden", { status: 403, headers: { "Content-Type": "text/plain" } });
|
|
105656
105809
|
}
|
|
105657
105810
|
const upgraded = srv.upgrade(req, {
|
|
@@ -105695,13 +105848,9 @@ function startLiveAppProxy(opts) {
|
|
|
105695
105848
|
if (rewritten !== null)
|
|
105696
105849
|
responseHeaders.set("location", rewritten);
|
|
105697
105850
|
}
|
|
105698
|
-
const
|
|
105699
|
-
const isHtml = contentType.includes("text/html");
|
|
105851
|
+
const isHtml = isHtmlContentType(responseHeaders.get("content-type"));
|
|
105700
105852
|
if (isHtml) {
|
|
105701
|
-
responseHeaders
|
|
105702
|
-
responseHeaders.delete("content-security-policy");
|
|
105703
|
-
responseHeaders.delete("content-security-policy-report-only");
|
|
105704
|
-
responseHeaders.set("content-security-policy", frameAncestors);
|
|
105853
|
+
applyHtmlFramingHeaders(responseHeaders, frameAncestors);
|
|
105705
105854
|
}
|
|
105706
105855
|
const hasEncoding = !!responseHeaders.get("content-encoding");
|
|
105707
105856
|
if (!isHtml || hasEncoding || !upstreamResponse.body) {
|
|
@@ -105790,7 +105939,7 @@ function startLiveAppProxy(opts) {
|
|
|
105790
105939
|
upstream.send(payload);
|
|
105791
105940
|
return;
|
|
105792
105941
|
}
|
|
105793
|
-
if (ws.data.pending.length >=
|
|
105942
|
+
if (ws.data.pending.length >= LIVE_PROXY_MAX_PENDING_WS_MESSAGES) {
|
|
105794
105943
|
ws.close();
|
|
105795
105944
|
if (upstream)
|
|
105796
105945
|
upstream.close();
|
|
@@ -105821,18 +105970,10 @@ function startLiveAppProxy(opts) {
|
|
|
105821
105970
|
}
|
|
105822
105971
|
};
|
|
105823
105972
|
}
|
|
105824
|
-
var LOOPBACK_HOST2 = "127.0.0.1"
|
|
105973
|
+
var LOOPBACK_HOST2 = "127.0.0.1";
|
|
105825
105974
|
var init_live_proxy = __esm(() => {
|
|
105826
|
-
|
|
105827
|
-
|
|
105828
|
-
"keep-alive",
|
|
105829
|
-
"proxy-authenticate",
|
|
105830
|
-
"proxy-authorization",
|
|
105831
|
-
"te",
|
|
105832
|
-
"trailer",
|
|
105833
|
-
"transfer-encoding",
|
|
105834
|
-
"upgrade"
|
|
105835
|
-
];
|
|
105975
|
+
init_live_proxy_core();
|
|
105976
|
+
init_live_proxy_core();
|
|
105836
105977
|
});
|
|
105837
105978
|
|
|
105838
105979
|
// ../../packages/server/annotate.ts
|
|
@@ -105852,15 +105993,6 @@ function runGuardedShutdown(steps, closeListener, log = (message, error) => cons
|
|
|
105852
105993
|
closeListener();
|
|
105853
105994
|
}
|
|
105854
105995
|
}
|
|
105855
|
-
function liveAppDraftIdentity(targetUrl) {
|
|
105856
|
-
try {
|
|
105857
|
-
const url = new URL(targetUrl);
|
|
105858
|
-
const path3 = url.pathname.replace(/\/+$/, "");
|
|
105859
|
-
return `${url.origin}${path3}${url.search}`;
|
|
105860
|
-
} catch {
|
|
105861
|
-
return targetUrl.trim();
|
|
105862
|
-
}
|
|
105863
|
-
}
|
|
105864
105996
|
async function startAnnotateServer(options) {
|
|
105865
105997
|
const {
|
|
105866
105998
|
markdown,
|
|
@@ -106448,31 +106580,19 @@ async function startAnnotateServer(options) {
|
|
|
106448
106580
|
const serverUrl = buildAdvertisedUrl(port);
|
|
106449
106581
|
if (liveApp) {
|
|
106450
106582
|
liveSessionToken = randomBytes2(16).toString("hex");
|
|
106451
|
-
const editorOrigins =
|
|
106452
|
-
`http://localhost:${port}`,
|
|
106453
|
-
`http://127.0.0.1:${port}`
|
|
106454
|
-
];
|
|
106455
|
-
const bridgeJs = "window.__plannotatorLiveConfig = " + JSON.stringify({
|
|
106456
|
-
live: true,
|
|
106457
|
-
token: liveSessionToken,
|
|
106458
|
-
editorOrigins,
|
|
106459
|
-
css: liveApp.annotationCss
|
|
106460
|
-
}) + `;
|
|
106461
|
-
` + liveApp.bridgeBootstrap + `
|
|
106462
|
-
` + liveApp.bridgeScript;
|
|
106583
|
+
const editorOrigins = buildLiveEditorOrigins(port);
|
|
106463
106584
|
liveProxy = startLiveAppProxy({
|
|
106464
106585
|
targetUrl: liveApp.targetUrl,
|
|
106465
106586
|
editorOrigins,
|
|
106466
|
-
bridgeJs
|
|
106587
|
+
bridgeJs: composeLiveBridgeJs({
|
|
106588
|
+
token: liveSessionToken,
|
|
106589
|
+
editorOrigins,
|
|
106590
|
+
annotationCss: liveApp.annotationCss,
|
|
106591
|
+
bridgeBootstrap: liveApp.bridgeBootstrap,
|
|
106592
|
+
bridgeScript: liveApp.bridgeScript
|
|
106593
|
+
})
|
|
106467
106594
|
});
|
|
106468
|
-
|
|
106469
|
-
try {
|
|
106470
|
-
const parsedTarget = new URL(liveApp.targetUrl);
|
|
106471
|
-
targetPath = parsedTarget.pathname + parsedTarget.search;
|
|
106472
|
-
} catch {
|
|
106473
|
-
targetPath = "/";
|
|
106474
|
-
}
|
|
106475
|
-
liveAppUrl = `http://localhost:${liveProxy.port}${targetPath}`;
|
|
106595
|
+
liveAppUrl = buildLiveAppUrl(liveProxy.port, liveApp.targetUrl);
|
|
106476
106596
|
}
|
|
106477
106597
|
warmFileListCache(process.cwd(), "code");
|
|
106478
106598
|
const stop2 = () => {
|
|
@@ -106529,10 +106649,12 @@ var init_annotate = __esm(() => {
|
|
|
106529
106649
|
init_html_assets2();
|
|
106530
106650
|
init_agent_terminal3();
|
|
106531
106651
|
init_live_proxy();
|
|
106652
|
+
init_live_proxy_core();
|
|
106532
106653
|
init_agent_terminal2();
|
|
106533
106654
|
init_remote();
|
|
106534
106655
|
init_browser();
|
|
106535
106656
|
init_shared_handlers();
|
|
106657
|
+
init_live_proxy_core();
|
|
106536
106658
|
});
|
|
106537
106659
|
|
|
106538
106660
|
// ../../packages/shared/at-reference.ts
|
|
@@ -106553,9 +106675,10 @@ var init_at_reference = __esm(() => {
|
|
|
106553
106675
|
});
|
|
106554
106676
|
|
|
106555
106677
|
// ../../packages/shared/annotate-args.ts
|
|
106556
|
-
function parseAnnotateArgs(raw2) {
|
|
106678
|
+
function parseAnnotateArgs(raw2, opts) {
|
|
106557
106679
|
const s10 = (raw2 ?? "").trim();
|
|
106558
|
-
const flags = { gate: false, json: false, hook: false, renderHtml: false, renderMarkdown: false, noJina: false };
|
|
106680
|
+
const flags = { gate: false, json: false, hook: false, renderHtml: false, renderMarkdown: false, noJina: false, app: false, static: false };
|
|
106681
|
+
const flagMap = opts?.liveFlags ? { ...FLAG_MAP, ...LIVE_FLAG_MAP } : { ...FLAG_MAP };
|
|
106559
106682
|
const segments = [];
|
|
106560
106683
|
for (let i7 = 0;i7 < s10.length; ) {
|
|
106561
106684
|
const isWs = /\s/.test(s10[i7]);
|
|
@@ -106569,7 +106692,7 @@ function parseAnnotateArgs(raw2) {
|
|
|
106569
106692
|
const seg = segments[j2];
|
|
106570
106693
|
if (seg.type !== "tok")
|
|
106571
106694
|
continue;
|
|
106572
|
-
const key2 =
|
|
106695
|
+
const key2 = flagMap[seg.text];
|
|
106573
106696
|
if (!key2)
|
|
106574
106697
|
continue;
|
|
106575
106698
|
flags[key2] = true;
|
|
@@ -106585,7 +106708,7 @@ function parseAnnotateArgs(raw2) {
|
|
|
106585
106708
|
flags.gate = true;
|
|
106586
106709
|
return { filePath: stripAtPrefix(rawFilePath), rawFilePath, ...flags };
|
|
106587
106710
|
}
|
|
106588
|
-
var FLAG_MAP;
|
|
106711
|
+
var FLAG_MAP, LIVE_FLAG_MAP;
|
|
106589
106712
|
var init_annotate_args = __esm(() => {
|
|
106590
106713
|
init_at_reference();
|
|
106591
106714
|
init_resolve_file();
|
|
@@ -106597,6 +106720,10 @@ var init_annotate_args = __esm(() => {
|
|
|
106597
106720
|
"--markdown": "renderMarkdown",
|
|
106598
106721
|
"--no-jina": "noJina"
|
|
106599
106722
|
};
|
|
106723
|
+
LIVE_FLAG_MAP = {
|
|
106724
|
+
"--app": "app",
|
|
106725
|
+
"--static": "static"
|
|
106726
|
+
};
|
|
106600
106727
|
});
|
|
106601
106728
|
|
|
106602
106729
|
// ../../packages/shared/annotate-target.ts
|
package/dist/index.js
CHANGED
|
@@ -12886,9 +12886,14 @@ var FLAG_MAP = {
|
|
|
12886
12886
|
"--markdown": "renderMarkdown",
|
|
12887
12887
|
"--no-jina": "noJina"
|
|
12888
12888
|
};
|
|
12889
|
-
|
|
12889
|
+
var LIVE_FLAG_MAP = {
|
|
12890
|
+
"--app": "app",
|
|
12891
|
+
"--static": "static"
|
|
12892
|
+
};
|
|
12893
|
+
function parseAnnotateArgs(raw, opts) {
|
|
12890
12894
|
const s = (raw ?? "").trim();
|
|
12891
|
-
const flags = { gate: false, json: false, hook: false, renderHtml: false, renderMarkdown: false, noJina: false };
|
|
12895
|
+
const flags = { gate: false, json: false, hook: false, renderHtml: false, renderMarkdown: false, noJina: false, app: false, static: false };
|
|
12896
|
+
const flagMap = opts?.liveFlags ? { ...FLAG_MAP, ...LIVE_FLAG_MAP } : { ...FLAG_MAP };
|
|
12892
12897
|
const segments = [];
|
|
12893
12898
|
for (let i = 0;i < s.length; ) {
|
|
12894
12899
|
const isWs = /\s/.test(s[i]);
|
|
@@ -12902,7 +12907,7 @@ function parseAnnotateArgs(raw) {
|
|
|
12902
12907
|
const seg = segments[j];
|
|
12903
12908
|
if (seg.type !== "tok")
|
|
12904
12909
|
continue;
|
|
12905
|
-
const key =
|
|
12910
|
+
const key = flagMap[seg.text];
|
|
12906
12911
|
if (!key)
|
|
12907
12912
|
continue;
|
|
12908
12913
|
flags[key] = true;
|
|
@@ -12935,7 +12940,8 @@ var PLAN_TOOL_NAMES = {
|
|
|
12935
12940
|
"copilot-cli": "exit_plan_mode",
|
|
12936
12941
|
pi: "plannotator_submit_plan",
|
|
12937
12942
|
codex: "ExitPlanMode",
|
|
12938
|
-
"gemini-cli": "exit_plan_mode"
|
|
12943
|
+
"gemini-cli": "exit_plan_mode",
|
|
12944
|
+
"oh-my-pi": "ExitPlanMode"
|
|
12939
12945
|
};
|
|
12940
12946
|
function getPlanToolName(runtime) {
|
|
12941
12947
|
return runtime && PLAN_TOOL_NAMES[runtime] || "ExitPlanMode";
|
package/dist/server.js
CHANGED
|
@@ -433,7 +433,8 @@ var PLAN_TOOL_NAMES = {
|
|
|
433
433
|
"copilot-cli": "exit_plan_mode",
|
|
434
434
|
pi: "plannotator_submit_plan",
|
|
435
435
|
codex: "ExitPlanMode",
|
|
436
|
-
"gemini-cli": "exit_plan_mode"
|
|
436
|
+
"gemini-cli": "exit_plan_mode",
|
|
437
|
+
"oh-my-pi": "ExitPlanMode"
|
|
437
438
|
};
|
|
438
439
|
function getPlanToolName(runtime) {
|
|
439
440
|
return runtime && PLAN_TOOL_NAMES[runtime] || "ExitPlanMode";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plannotator/opencode",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Plannotator plugin for OpenCode - interactive plan review with visual annotation",
|
|
6
6
|
"author": "backnotprop",
|
|
@@ -27,22 +27,25 @@
|
|
|
27
27
|
"exports": {
|
|
28
28
|
".": "./dist/server.js"
|
|
29
29
|
},
|
|
30
|
+
"//files": "skills/ is generated by build:skill from apps/skills/core/plannotator and is gitignored, so the shipped copy cannot drift from the single source.",
|
|
30
31
|
"files": [
|
|
31
32
|
"dist",
|
|
32
33
|
"commands",
|
|
34
|
+
"skills",
|
|
33
35
|
"README.md",
|
|
34
36
|
"plannotator.html",
|
|
35
37
|
"review-editor.html"
|
|
36
38
|
],
|
|
37
39
|
"scripts": {
|
|
38
|
-
"build": "mkdir -p dist && cp ../hook/dist/index.html ./plannotator.html && cp ../review/dist/index.html ./review-editor.html && bun build embedded.ts --outfile dist/embedded.js --target bun --external @opencode-ai/plugin && bun build index.ts --outfile dist/index.js --target node && bun build server.ts --outfile dist/server.js --target node --external @opencode-ai/plugin",
|
|
40
|
+
"build": "bun run build:skill && mkdir -p dist && cp ../hook/dist/index.html ./plannotator.html && cp ../review/dist/index.html ./review-editor.html && bun build embedded.ts --outfile dist/embedded.js --target bun --external @opencode-ai/plugin && bun build index.ts --outfile dist/index.js --target node && bun build server.ts --outfile dist/server.js --target node --external @opencode-ai/plugin",
|
|
41
|
+
"build:skill": "rm -rf skills && mkdir -p skills && cp -R ../skills/core/plannotator skills/plannotator",
|
|
39
42
|
"smoke:v2": "bun fixtures/v2-installed-smoke.ts",
|
|
40
|
-
"postinstall": "mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/opencode/commands && cp ./commands/*.md ${XDG_CONFIG_HOME:-$HOME/.config}/opencode/commands/ 2>/dev/null || true",
|
|
43
|
+
"postinstall": "mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/opencode/commands && cp ./commands/*.md ${XDG_CONFIG_HOME:-$HOME/.config}/opencode/commands/ 2>/dev/null || true; mkdir -p ${XDG_CONFIG_HOME:-$HOME/.config}/opencode/skills/plannotator && cp ./skills/plannotator/SKILL.md ${XDG_CONFIG_HOME:-$HOME/.config}/opencode/skills/plannotator/ 2>/dev/null || true",
|
|
41
44
|
"prepublishOnly": "bun run build"
|
|
42
45
|
},
|
|
43
46
|
"devDependencies": {
|
|
44
47
|
"@opencode-ai/plugin": "0.0.0-next-16775",
|
|
45
|
-
"@plannotator/server": "0.27.
|
|
48
|
+
"@plannotator/server": "0.27.6",
|
|
46
49
|
"@plannotator/shared": "0.0.1"
|
|
47
50
|
},
|
|
48
51
|
"engines": {
|