@plannotator/opencode 0.28.38 → 0.28.39

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.js CHANGED
@@ -12348,6 +12348,11 @@ import { readFile } from "node:fs/promises";
12348
12348
  import path5 from "node:path";
12349
12349
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
12350
12350
 
12351
+ // ../../packages/shared/child-env.ts
12352
+ function isAskAiChild(env = process.env) {
12353
+ return env.PLANNOTATOR_ASK_AI_CHILD === "1";
12354
+ }
12355
+
12351
12356
  // ../../packages/shared/config.ts
12352
12357
  import { join as join2 } from "path";
12353
12358
 
@@ -12510,7 +12515,7 @@ var INBOX_TOOL_ACTIONS = [
12510
12515
  ];
12511
12516
  var INBOX_FILLED_ARGUMENTS = ["project_path", "agent_session", "agent_host", "agent_name"];
12512
12517
  var INBOX_AGENT_PROJECT_PATH = "project_path";
12513
- var INBOX_AGENT_PROJECT_PATH_DESCRIPTION = "The repository or folder this is about; defaults to your working folder.";
12518
+ var INBOX_AGENT_PROJECT_PATH_DESCRIPTION = "The repository or folder this is about; defaults to the folder your session started in. Pass it only when the message is about another repository or folder.";
12514
12519
  function inboxProjectPathShapeRefusal(value) {
12515
12520
  if (typeof value !== "string" || value.trim() === "")
12516
12521
  return "project_path: a folder path (absolute, or relative to your working folder).";
@@ -12521,8 +12526,13 @@ function inboxProjectPathShapeRefusal(value) {
12521
12526
  return null;
12522
12527
  }
12523
12528
  var INBOX_WAKES_META_KEY = "ai.plannotator/inbox-wakes";
12529
+ var INBOX_WORKING_FOLDER_META_KEY = "ai.plannotator/working-folder";
12524
12530
  function inboxToolCallParams(call, options) {
12525
- return { name: call.name, arguments: call.arguments, ...options.wakes ? { _meta: { [INBOX_WAKES_META_KEY]: true } } : {} };
12531
+ const meta = {
12532
+ ...options.wakes ? { [INBOX_WAKES_META_KEY]: true } : {},
12533
+ ...options.workingFolder ? { [INBOX_WORKING_FOLDER_META_KEY]: options.workingFolder } : {}
12534
+ };
12535
+ return { name: call.name, arguments: call.arguments, ...Object.keys(meta).length > 0 ? { _meta: meta } : {} };
12526
12536
  }
12527
12537
  var INBOX_REPLY_TO_CHECK = "Before reply_to into a thread you have not read in this context window, call read_thread with no id and match the subject.";
12528
12538
  var INBOX_REF_LINK_RULE = "A bare #123 links to this project's repository. For an issue or PR in another repo, write owner/repo#123 or its full URL (in a GitLab project, a GitHub one needs its URL).";
@@ -12618,12 +12628,13 @@ function leadOf(description) {
12618
12628
  var INBOX_CHANNEL_RULE = "A decision in the Inbox stays there: when the person writes in the chat, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Ask in the chat only about something new they raised there that needs no pictures or files, or when they ask.";
12619
12629
  var INBOX_SESSION_THREADS_CHANNEL = "Their decisions stay in these threads: when the person writes in the chat, say what waits and link the thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar).";
12620
12630
  var INBOX_USE_RULE = "Use it for a decision only they can make (a :::question block; go on with other work), finished long work (a short summary, files in `attachments`), or when they ask.";
12631
+ var INBOX_THREAD_RULE = "One thread per work stream, unless the person says otherwise.";
12621
12632
  var INBOX_FOLLOW_THROUGH_RULE = "Be proactive about Inbox updates and about replying to the person through the Inbox when you think they would want you to. Don't withhold important updates or decisions, and don't batch updates to send later: proactivity is better than procrastination.";
12622
12633
  var INBOX_SUBAGENT_RULE = "If another agent started you, report to it instead.";
12623
- var INBOX_AGENT_RULES = `${INBOX_USE_RULE} ${INBOX_CHANNEL_RULE} ${INBOX_FOLLOW_THROUGH_RULE} ${INBOX_SUBAGENT_RULE}`;
12624
- var INBOX_TOOL_LEAD = `The Plannotator Inbox on this machine: message the person and get their answer later, without blocking this session. ${INBOX_AGENT_RULES} Set \`action\` to a tool below, with its fields.`;
12634
+ var INBOX_AGENT_RULES = `${INBOX_USE_RULE} ${INBOX_THREAD_RULE} ${INBOX_CHANNEL_RULE} ${INBOX_FOLLOW_THROUGH_RULE} ${INBOX_SUBAGENT_RULE}`;
12635
+ var INBOX_TOOL_LEAD = `The Plannotator Inbox on this machine: message the person, get their answer later; nothing blocks. ${INBOX_AGENT_RULES} Set \`action\` to a tool below, with its fields.`;
12625
12636
  var INBOX_TOOL_WAKE_NOTE = "A reply arrives in this session by itself once it is idle, headed `Plannotator Inbox: <subject> (<reply id>)`: end your turn or keep working; do not call wait_for_reply. To answer it, send_message with reply_to set to that reply id, never one from memory.";
12626
- var INBOX_TOOL_HELP_NOTE = "Every field and the full question syntax: `plannotator inbox --help`.";
12637
+ var INBOX_TOOL_HELP_NOTE = "Every field and question syntax: `plannotator inbox --help`.";
12627
12638
  var INBOX_TOOL_BOARD_OFF_NOTE = "The Board (cards for work that outlasts a reply) is off until the person turns it on; see `plannotator card --help`.";
12628
12639
  var INBOX_AGENT_ACTION_LEADS = {
12629
12640
  send_message: "Message the person (markdown), in your session's open thread (see `thread`).",
@@ -12631,7 +12642,7 @@ var INBOX_AGENT_ACTION_LEADS = {
12631
12642
  resolve_message: "Archive a message's thread, only when nothing in it is left for the person to read or answer.",
12632
12643
  read_thread: 'Read a thread (thread_id); with no id, list your threads (asked_by "anyone": all).',
12633
12644
  search: "Find messages by words, older ones too (read-only).",
12634
- get_guide_brief: "How to write a guided review: method, JSON shape, rules, a worked submit_guide call.",
12645
+ get_guide_brief: "How to write a guided review, with a worked submit_guide call.",
12635
12646
  card: "A Board card for work that outlasts this reply: create it, then move it and say where it is as the work moves."
12636
12647
  };
12637
12648
  var INBOX_AGENT_FIELD_DESCRIPTIONS = {
@@ -12676,8 +12687,8 @@ var INBOX_AGENT_FIELD_DESCRIPTIONS = {
12676
12687
  snapshot: "Instead of guide and patch: a complete Plannotator guide snapshot, as an object or its JSON."
12677
12688
  }
12678
12689
  };
12679
- var INBOX_REMINDER_TEXT = `Plannotator Inbox is on: when you finish long work, or need a decision only the person can make, send it with plannotator_inbox send_message and keep going. ${INBOX_FOLLOW_THROUGH_RULE} Their reply comes back here. A decision in the Inbox stays there: when the person writes here, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Run \`plannotator inbox --help\` for how it works.`;
12680
- var INBOX_REMINDER_TEXT_NO_WAKE = `Plannotator Inbox is on: when you finish long work, or need a decision only the person can make, send it with plannotator_inbox send_message and keep going. ${INBOX_FOLLOW_THROUGH_RULE} Call wait_for_reply when you need their answer. A decision in the Inbox stays there: when the person writes here, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Run \`plannotator inbox --help\` for how it works.`;
12690
+ var INBOX_REMINDER_TEXT = `Plannotator Inbox is on: when you finish long work, or need a decision only the person can make, send it with plannotator_inbox send_message and keep going. ${INBOX_FOLLOW_THROUGH_RULE} ${INBOX_THREAD_RULE} Their reply comes back here. A decision in the Inbox stays there: when the person writes here, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Run \`plannotator inbox --help\` for how it works.`;
12691
+ var INBOX_REMINDER_TEXT_NO_WAKE = `Plannotator Inbox is on: when you finish long work, or need a decision only the person can make, send it with plannotator_inbox send_message and keep going. ${INBOX_FOLLOW_THROUGH_RULE} ${INBOX_THREAD_RULE} Call wait_for_reply when you need their answer. A decision in the Inbox stays there: when the person writes here, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Run \`plannotator inbox --help\` for how it works.`;
12681
12692
  function inboxReminderText(toolName = INBOX_TOOL_NAME, options = {}) {
12682
12693
  const text = options.wakes === false ? INBOX_REMINDER_TEXT_NO_WAKE : INBOX_REMINDER_TEXT;
12683
12694
  return text.replace(INBOX_TOOL_NAME, toolName);
@@ -12688,6 +12699,7 @@ var INBOX_COMMAND_BRIEFING = [
12688
12699
  "The person opened their Plannotator Inbox with /plannotator-inbox and has its address. The Plannotator Inbox is one window on this computer where you leave the person messages, `:::question` blocks they answer with a click, and files. They answer when they can. Nothing blocks: you send, then keep working or end your turn.",
12689
12700
  "",
12690
12701
  `- ${INBOX_USE_RULE}`,
12702
+ `- ${INBOX_THREAD_RULE}`,
12691
12703
  "- Send with a `plannotator_inbox` tool when you have one (it can be listed with a prefix and may need loading through tool search first): `action` `send_message`, with a markdown `body`. Otherwise call `send_message` on the Inbox's MCP server, `plannotator inbox mcp`.",
12692
12704
  "- send_message's result says whether the person's reply arrives in this session by itself. When it does, do not wait or poll for it: end your turn or go on with other work. When it does not, call wait_for_reply when you need the answer.",
12693
12705
  `- ${INBOX_CHANNEL_RULE}`,
@@ -16490,6 +16502,8 @@ async function runPlanReview(input) {
16490
16502
  });
16491
16503
  }
16492
16504
  var PlannotatorPlugin = async (ctx, rawOptions) => {
16505
+ if (isAskAiChild(process.env))
16506
+ return {};
16493
16507
  const workflowOptions = normalizeWorkflowOptions(rawOptions);
16494
16508
  preloadBundledHtml("plannotator.html", (html) => {
16495
16509
  _planHtml = html;
package/dist/server.js CHANGED
@@ -3,6 +3,11 @@ import { existsSync as existsSync9, readFileSync as readFileSync7 } from "node:f
3
3
  import path6 from "node:path";
4
4
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "node:url";
5
5
 
6
+ // ../../packages/shared/child-env.ts
7
+ function isAskAiChild(env = process.env) {
8
+ return env.PLANNOTATOR_ASK_AI_CHILD === "1";
9
+ }
10
+
6
11
  // ../../packages/shared/config.ts
7
12
  import { join as join2 } from "path";
8
13
 
@@ -165,7 +170,7 @@ var INBOX_TOOL_ACTIONS = [
165
170
  ];
166
171
  var INBOX_FILLED_ARGUMENTS = ["project_path", "agent_session", "agent_host", "agent_name"];
167
172
  var INBOX_AGENT_PROJECT_PATH = "project_path";
168
- var INBOX_AGENT_PROJECT_PATH_DESCRIPTION = "The repository or folder this is about; defaults to your working folder.";
173
+ var INBOX_AGENT_PROJECT_PATH_DESCRIPTION = "The repository or folder this is about; defaults to the folder your session started in. Pass it only when the message is about another repository or folder.";
169
174
  function inboxProjectPathShapeRefusal(value) {
170
175
  if (typeof value !== "string" || value.trim() === "")
171
176
  return "project_path: a folder path (absolute, or relative to your working folder).";
@@ -176,8 +181,13 @@ function inboxProjectPathShapeRefusal(value) {
176
181
  return null;
177
182
  }
178
183
  var INBOX_WAKES_META_KEY = "ai.plannotator/inbox-wakes";
184
+ var INBOX_WORKING_FOLDER_META_KEY = "ai.plannotator/working-folder";
179
185
  function inboxToolCallParams(call, options) {
180
- return { name: call.name, arguments: call.arguments, ...options.wakes ? { _meta: { [INBOX_WAKES_META_KEY]: true } } : {} };
186
+ const meta = {
187
+ ...options.wakes ? { [INBOX_WAKES_META_KEY]: true } : {},
188
+ ...options.workingFolder ? { [INBOX_WORKING_FOLDER_META_KEY]: options.workingFolder } : {}
189
+ };
190
+ return { name: call.name, arguments: call.arguments, ...Object.keys(meta).length > 0 ? { _meta: meta } : {} };
181
191
  }
182
192
  var INBOX_REPLY_TO_CHECK = "Before reply_to into a thread you have not read in this context window, call read_thread with no id and match the subject.";
183
193
  var INBOX_REF_LINK_RULE = "A bare #123 links to this project's repository. For an issue or PR in another repo, write owner/repo#123 or its full URL (in a GitLab project, a GitHub one needs its URL).";
@@ -275,12 +285,13 @@ function leadOf(description) {
275
285
  var INBOX_CHANNEL_RULE = "A decision in the Inbox stays there: when the person writes in the chat, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Ask in the chat only about something new they raised there that needs no pictures or files, or when they ask.";
276
286
  var INBOX_SESSION_THREADS_CHANNEL = "Their decisions stay in these threads: when the person writes in the chat, say what waits and link the thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar).";
277
287
  var INBOX_USE_RULE = "Use it for a decision only they can make (a :::question block; go on with other work), finished long work (a short summary, files in `attachments`), or when they ask.";
288
+ var INBOX_THREAD_RULE = "One thread per work stream, unless the person says otherwise.";
278
289
  var INBOX_FOLLOW_THROUGH_RULE = "Be proactive about Inbox updates and about replying to the person through the Inbox when you think they would want you to. Don't withhold important updates or decisions, and don't batch updates to send later: proactivity is better than procrastination.";
279
290
  var INBOX_SUBAGENT_RULE = "If another agent started you, report to it instead.";
280
- var INBOX_AGENT_RULES = `${INBOX_USE_RULE} ${INBOX_CHANNEL_RULE} ${INBOX_FOLLOW_THROUGH_RULE} ${INBOX_SUBAGENT_RULE}`;
281
- var INBOX_TOOL_LEAD = `The Plannotator Inbox on this machine: message the person and get their answer later, without blocking this session. ${INBOX_AGENT_RULES} Set \`action\` to a tool below, with its fields.`;
291
+ var INBOX_AGENT_RULES = `${INBOX_USE_RULE} ${INBOX_THREAD_RULE} ${INBOX_CHANNEL_RULE} ${INBOX_FOLLOW_THROUGH_RULE} ${INBOX_SUBAGENT_RULE}`;
292
+ var INBOX_TOOL_LEAD = `The Plannotator Inbox on this machine: message the person, get their answer later; nothing blocks. ${INBOX_AGENT_RULES} Set \`action\` to a tool below, with its fields.`;
282
293
  var INBOX_TOOL_WAKE_NOTE = "A reply arrives in this session by itself once it is idle, headed `Plannotator Inbox: <subject> (<reply id>)`: end your turn or keep working; do not call wait_for_reply. To answer it, send_message with reply_to set to that reply id, never one from memory.";
283
- var INBOX_TOOL_HELP_NOTE = "Every field and the full question syntax: `plannotator inbox --help`.";
294
+ var INBOX_TOOL_HELP_NOTE = "Every field and question syntax: `plannotator inbox --help`.";
284
295
  var INBOX_TOOL_BOARD_OFF_NOTE = "The Board (cards for work that outlasts a reply) is off until the person turns it on; see `plannotator card --help`.";
285
296
  var INBOX_AGENT_ACTION_LEADS = {
286
297
  send_message: "Message the person (markdown), in your session's open thread (see `thread`).",
@@ -288,7 +299,7 @@ var INBOX_AGENT_ACTION_LEADS = {
288
299
  resolve_message: "Archive a message's thread, only when nothing in it is left for the person to read or answer.",
289
300
  read_thread: 'Read a thread (thread_id); with no id, list your threads (asked_by "anyone": all).',
290
301
  search: "Find messages by words, older ones too (read-only).",
291
- get_guide_brief: "How to write a guided review: method, JSON shape, rules, a worked submit_guide call.",
302
+ get_guide_brief: "How to write a guided review, with a worked submit_guide call.",
292
303
  card: "A Board card for work that outlasts this reply: create it, then move it and say where it is as the work moves."
293
304
  };
294
305
  var INBOX_AGENT_FIELD_DESCRIPTIONS = {
@@ -333,8 +344,8 @@ var INBOX_AGENT_FIELD_DESCRIPTIONS = {
333
344
  snapshot: "Instead of guide and patch: a complete Plannotator guide snapshot, as an object or its JSON."
334
345
  }
335
346
  };
336
- var INBOX_REMINDER_TEXT = `Plannotator Inbox is on: when you finish long work, or need a decision only the person can make, send it with plannotator_inbox send_message and keep going. ${INBOX_FOLLOW_THROUGH_RULE} Their reply comes back here. A decision in the Inbox stays there: when the person writes here, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Run \`plannotator inbox --help\` for how it works.`;
337
- var INBOX_REMINDER_TEXT_NO_WAKE = `Plannotator Inbox is on: when you finish long work, or need a decision only the person can make, send it with plannotator_inbox send_message and keep going. ${INBOX_FOLLOW_THROUGH_RULE} Call wait_for_reply when you need their answer. A decision in the Inbox stays there: when the person writes here, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Run \`plannotator inbox --help\` for how it works.`;
347
+ var INBOX_REMINDER_TEXT = `Plannotator Inbox is on: when you finish long work, or need a decision only the person can make, send it with plannotator_inbox send_message and keep going. ${INBOX_FOLLOW_THROUGH_RULE} ${INBOX_THREAD_RULE} Their reply comes back here. A decision in the Inbox stays there: when the person writes here, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Run \`plannotator inbox --help\` for how it works.`;
348
+ var INBOX_REMINDER_TEXT_NO_WAKE = `Plannotator Inbox is on: when you finish long work, or need a decision only the person can make, send it with plannotator_inbox send_message and keep going. ${INBOX_FOLLOW_THROUGH_RULE} ${INBOX_THREAD_RULE} Call wait_for_reply when you need their answer. A decision in the Inbox stays there: when the person writes here, say what waits and link its thread, but never also ask it in the chat with a blocking question tool (AskUserQuestion or similar). Run \`plannotator inbox --help\` for how it works.`;
338
349
  function inboxReminderText(toolName = INBOX_TOOL_NAME, options = {}) {
339
350
  const text = options.wakes === false ? INBOX_REMINDER_TEXT_NO_WAKE : INBOX_REMINDER_TEXT;
340
351
  return text.replace(INBOX_TOOL_NAME, toolName);
@@ -345,6 +356,7 @@ var INBOX_COMMAND_BRIEFING = [
345
356
  "The person opened their Plannotator Inbox with /plannotator-inbox and has its address. The Plannotator Inbox is one window on this computer where you leave the person messages, `:::question` blocks they answer with a click, and files. They answer when they can. Nothing blocks: you send, then keep working or end your turn.",
346
357
  "",
347
358
  `- ${INBOX_USE_RULE}`,
359
+ `- ${INBOX_THREAD_RULE}`,
348
360
  "- Send with a `plannotator_inbox` tool when you have one (it can be listed with a prefix and may need loading through tool search first): `action` `send_message`, with a markdown `body`. Otherwise call `send_message` on the Inbox's MCP server, `plannotator inbox mcp`.",
349
361
  "- send_message's result says whether the person's reply arrives in this session by itself. When it does, do not wait or poll for it: end your turn or go on with other work. When it does not, call wait_for_reply when you need the answer.",
350
362
  `- ${INBOX_CHANNEL_RULE}`,
@@ -6370,6 +6382,8 @@ var planHtml;
6370
6382
  var serverPlugin = {
6371
6383
  id: "plannotator",
6372
6384
  setup: async (ctx) => {
6385
+ if (isAskAiChild(process.env))
6386
+ return;
6373
6387
  const lifetime = new AbortController;
6374
6388
  const cleanup = () => {
6375
6389
  lifetime.abort();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plannotator/opencode",
3
- "version": "0.28.38",
3
+ "version": "0.28.39",
4
4
  "type": "module",
5
5
  "description": "Plannotator plugin for OpenCode - interactive plan review with visual annotation",
6
6
  "author": "backnotprop",
@@ -50,7 +50,7 @@
50
50
  "@opencode-ai/plugin": "1.19.3",
51
51
  "@opencode/plugin": "2.0.32",
52
52
  "@plannotator/ai": "0.0.1",
53
- "@plannotator/server": "0.28.38",
53
+ "@plannotator/server": "0.28.39",
54
54
  "@plannotator/shared": "0.0.1"
55
55
  },
56
56
  "engines": {