inplan 0.3.7 → 0.3.9
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/app/main/index.cjs
CHANGED
|
@@ -95,6 +95,9 @@ var CONTROL_LOG_VERSION = 1;
|
|
|
95
95
|
var LogEventType = {
|
|
96
96
|
EditorPid: "editor_pid",
|
|
97
97
|
ModeChanged: "mode_changed",
|
|
98
|
+
CommentCreated: "comment_created",
|
|
99
|
+
CommentModified: "comment_modified",
|
|
100
|
+
CommentDeleted: "comment_deleted",
|
|
98
101
|
DocumentEdited: "document_edited",
|
|
99
102
|
TurnEnded: "turn_ended",
|
|
100
103
|
AgentRevised: "agent_revised",
|
|
@@ -886,9 +889,10 @@ class Session {
|
|
|
886
889
|
console.warn("inplan: could not read the pending proposal for review dispatch:", e);
|
|
887
890
|
});
|
|
888
891
|
}
|
|
892
|
+
const isAgentFileChange = (e) => e.actor === "agent" && (e.type === LogEventType.DocumentEdited || e.type === LogEventType.CommentCreated || e.type === LogEventType.CommentModified || e.type === LogEventType.CommentDeleted);
|
|
889
893
|
let applied;
|
|
890
894
|
for (let i = entries.length - 1; i >= 0 && !applied; i--) {
|
|
891
|
-
if (entries[i]
|
|
895
|
+
if (isAgentFileChange(entries[i])) applied = entries[i];
|
|
892
896
|
}
|
|
893
897
|
if (applied && node_fs.existsSync(this.paths.file)) {
|
|
894
898
|
const via = applied.payload?.via;
|
|
@@ -47467,6 +47467,7 @@ function App(props = {}) {
|
|
|
47467
47467
|
}
|
|
47468
47468
|
),
|
|
47469
47469
|
draftPendingModel !== null && bodyEmpty && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ap-banner", role: "status", children: [
|
|
47470
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ap-spinner-sm", "aria-hidden": "true" }),
|
|
47470
47471
|
t2("banner.draftPending", { model: draftPendingModel }),
|
|
47471
47472
|
" ",
|
|
47472
47473
|
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { className: "ap-link", onClick: () => setDraftPendingModel(null), children: t2("banner.dismiss") })
|
|
@@ -45,6 +45,7 @@ body {
|
|
|
45
45
|
/* Centred, with a spinner: the old top-left grey "Loading…" read as an empty document. */
|
|
46
46
|
.ap-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; height: 100vh; height: 100dvh; color: var(--muted); }
|
|
47
47
|
.ap-spinner { width: 28px; height: 28px; border: 3px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: ap-spin 0.8s linear infinite; }
|
|
48
|
+
.ap-spinner-sm { width: 14px; height: 14px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: ap-spin 0.8s linear infinite; flex-shrink: 0; }
|
|
48
49
|
@keyframes ap-spin { to { transform: rotate(360deg); } }
|
|
49
50
|
@media (prefers-reduced-motion: reduce) { .ap-spinner { animation-duration: 2.4s; } }
|
|
50
51
|
|
package/app/renderer/index.html
CHANGED
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
content="default-src 'self'; style-src 'self' 'unsafe-inline'; script-src 'self' inplan-plugin:; img-src 'self' file: https:; connect-src 'self' inplan-plugin: ws://127.0.0.1:* ws://localhost:*; frame-src https://inplan.ai http://127.0.0.1:* http://localhost:*"
|
|
22
22
|
/>
|
|
23
23
|
<title>inplan</title>
|
|
24
|
-
<script type="module" crossorigin src="./assets/index-
|
|
25
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
24
|
+
<script type="module" crossorigin src="./assets/index-BXB1lexl.js"></script>
|
|
25
|
+
<link rel="stylesheet" crossorigin href="./assets/index-RtdWGNC5.css">
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
|
28
28
|
<div id="root"></div>
|
package/bin/cli.js
CHANGED
|
@@ -4037,10 +4037,20 @@ async function relayText(file, text) {
|
|
|
4037
4037
|
} catch {
|
|
4038
4038
|
}
|
|
4039
4039
|
}
|
|
4040
|
+
function relayStatus(obj, hookMode) {
|
|
4041
|
+
if (!hookMode) {
|
|
4042
|
+
output(obj);
|
|
4043
|
+
return;
|
|
4044
|
+
}
|
|
4045
|
+
process.stdout.write("{}\n");
|
|
4046
|
+
if (process.env.INPLAN_RELAY_DEBUG === "1") process.stderr.write(`inplan: relay ${JSON.stringify(obj)}
|
|
4047
|
+
`);
|
|
4048
|
+
}
|
|
4040
4049
|
async function doRelay(args) {
|
|
4050
|
+
const hookMode = args.some((a) => a === "--hook" || a.startsWith("--hook="));
|
|
4041
4051
|
const file = activeDocForCwd(process.cwd());
|
|
4042
4052
|
if (!file) {
|
|
4043
|
-
|
|
4053
|
+
relayStatus({ status: "relay_skipped", reason: "no_active_doc" }, hookMode);
|
|
4044
4054
|
return;
|
|
4045
4055
|
}
|
|
4046
4056
|
const hook = getFlag(args, "hook");
|
|
@@ -4060,11 +4070,11 @@ async function doRelay(args) {
|
|
|
4060
4070
|
}
|
|
4061
4071
|
const clean = notes.map((n) => n.trim().slice(0, 2e3)).filter(Boolean);
|
|
4062
4072
|
if (clean.length === 0) {
|
|
4063
|
-
|
|
4073
|
+
relayStatus({ status: "relay_skipped", reason: "no_text" }, hookMode);
|
|
4064
4074
|
return;
|
|
4065
4075
|
}
|
|
4066
4076
|
for (const n of clean) await relayText(file, n);
|
|
4067
|
-
|
|
4077
|
+
relayStatus({ status: "relayed", count: clean.length }, hookMode);
|
|
4068
4078
|
}
|
|
4069
4079
|
function skillTargets() {
|
|
4070
4080
|
const home = homedir7();
|
|
@@ -4824,6 +4834,13 @@ async function main() {
|
|
|
4824
4834
|
mayResolve: hasFlag(args, "may-resolve")
|
|
4825
4835
|
});
|
|
4826
4836
|
writeFileSync10(file, nextText);
|
|
4837
|
+
const p = docPaths(file);
|
|
4838
|
+
mkdirSync10(p.controlDir, { recursive: true });
|
|
4839
|
+
await new FsControlChannel(p).append({
|
|
4840
|
+
actor: "agent",
|
|
4841
|
+
type: LogEventType.CommentCreated,
|
|
4842
|
+
payload: { id: comment.id }
|
|
4843
|
+
});
|
|
4827
4844
|
output({ status: "commented", id: comment.id, date: comment.date, author: comment.author });
|
|
4828
4845
|
} catch (err) {
|
|
4829
4846
|
if (err instanceof AddCommentError) {
|