@prevalentware/opencode-goal-plugin 0.1.46 → 0.1.47

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.
Files changed (2) hide show
  1. package/dist/server.js +15 -7
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -1353,6 +1353,9 @@ function goalCommandDefinitions(commandName) {
1353
1353
  }
1354
1354
  ];
1355
1355
  }
1356
+ function omitUndefined(value) {
1357
+ return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== undefined));
1358
+ }
1356
1359
  function commandNameFromOptions(options) {
1357
1360
  const name = options?.command_name?.trim() || DEFAULT_COMMAND_NAME;
1358
1361
  if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(name))
@@ -3256,14 +3259,19 @@ async function setupV2(context) {
3256
3259
  cancelScheduledContinuation(input.sessionID);
3257
3260
  clearTurnWatchdog(input.sessionID);
3258
3261
  }
3259
- const stripMention = ({ mention: _mention, ...attachment }) => attachment;
3262
+ let forwardedPrompt = {};
3263
+ if (command.action === "goal") {
3264
+ const stripMention = ({ mention: _mention, ...attachment }) => attachment;
3265
+ const { files, agents, skills, ...promptFields } = input.prompt;
3266
+ forwardedPrompt = {
3267
+ ...omitUndefined(promptFields),
3268
+ ...files ? { files: files.map(stripMention) } : {},
3269
+ ...agents ? { agents: agents.map(stripMention) } : {},
3270
+ ...skills ? { skills: skills.map(stripMention) } : {}
3271
+ };
3272
+ }
3260
3273
  await context.session.prompt({
3261
- ...command.action === "goal" ? {
3262
- ...input.prompt,
3263
- files: input.prompt.files?.map(stripMention),
3264
- agents: input.prompt.agents?.map(stripMention),
3265
- skills: input.prompt.skills?.map(stripMention)
3266
- } : {},
3274
+ ...forwardedPrompt,
3267
3275
  sessionID: input.sessionID,
3268
3276
  text: command.template.replaceAll("$ARGUMENTS", () => input.prompt.text.trim()),
3269
3277
  delivery: input.delivery
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prevalentware/opencode-goal-plugin",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "description": "OpenCode goal plugin that adds Codex-style long-running goal mode, /goal commands, persistence, and TUI status for AI coding agents.",
5
5
  "keywords": [
6
6
  "opencode",