@frenchtoastman/oh-my-groundcontrol 0.0.15 → 0.0.17

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/cli/index.js CHANGED
@@ -13769,6 +13769,9 @@ var SessionExportConfigSchema = exports_external.object({
13769
13769
  var HashlineEditConfigSchema = exports_external.object({
13770
13770
  enabled: exports_external.boolean().default(true)
13771
13771
  });
13772
+ var DoubleConfirmationConfigSchema = exports_external.object({
13773
+ enabled: exports_external.boolean().default(false)
13774
+ });
13772
13775
  var PluginConfigSchema = exports_external.object({
13773
13776
  preset: exports_external.string().optional(),
13774
13777
  scoringEngineVersion: exports_external.enum(["v1", "v2-shadow", "v2"]).optional(),
@@ -13782,7 +13785,8 @@ var PluginConfigSchema = exports_external.object({
13782
13785
  fallback: FailoverConfigSchema.optional(),
13783
13786
  allowedProviders: exports_external.array(exports_external.string()).optional(),
13784
13787
  sessionExport: SessionExportConfigSchema.optional(),
13785
- hashline_edit: HashlineEditConfigSchema.optional()
13788
+ hashline_edit: HashlineEditConfigSchema.optional(),
13789
+ double_confirmation: DoubleConfirmationConfigSchema.optional()
13786
13790
  });
13787
13791
  // src/config/agent-mcps.ts
13788
13792
  var DEFAULT_AGENT_MCPS = {
@@ -13818,6 +13822,12 @@ var CUSTOM_SKILLS = [
13818
13822
  description: "Repository understanding and hierarchical codemap generation",
13819
13823
  allowedAgents: ["orchestrator", "explorer"],
13820
13824
  sourcePath: "src/skills/cartography"
13825
+ },
13826
+ {
13827
+ name: "analyze",
13828
+ description: "Code review and analysis for uncommitted changes, commits, branches, PRs, or specific files.",
13829
+ allowedAgents: ["*"],
13830
+ sourcePath: "src/skills/analyze"
13821
13831
  }
13822
13832
  ];
13823
13833
  function getCustomSkillsDir() {
@@ -15685,10 +15695,6 @@ function buildDynamicModelPlan(catalog, config2, externalSignals, options) {
15685
15695
  }
15686
15696
  };
15687
15697
  }
15688
- // src/utils/logger.ts
15689
- import * as os from "os";
15690
- import * as path from "path";
15691
- var logFile = path.join(os.tmpdir(), "oh-my-groundcontrol.log");
15692
15698
  // src/utils/env.ts
15693
15699
  function getEnv(name) {
15694
15700
  const bunValue = globalThis.Bun?.env?.[name];
@@ -15941,8 +15947,8 @@ async function getOpenCodeVersion() {
15941
15947
  return null;
15942
15948
  }
15943
15949
  function getOpenCodePath() {
15944
- const path2 = resolveOpenCodePath();
15945
- return path2 === "opencode" ? null : path2;
15950
+ const path = resolveOpenCodePath();
15951
+ return path === "opencode" ? null : path;
15946
15952
  }
15947
15953
 
15948
15954
  // src/cli/opencode-models.ts
@@ -16180,9 +16186,9 @@ async function checkOpenCodeInstalled() {
16180
16186
  return { ok: false };
16181
16187
  }
16182
16188
  const version2 = await getOpenCodeVersion();
16183
- const path2 = getOpenCodePath();
16184
- printSuccess(`OpenCode ${version2 ?? ""} detected${path2 ? ` (${DIM}${path2}${RESET})` : ""}`);
16185
- return { ok: true, version: version2 ?? undefined, path: path2 ?? undefined };
16189
+ const path = getOpenCodePath();
16190
+ printSuccess(`OpenCode ${version2 ?? ""} detected${path ? ` (${DIM}${path}${RESET})` : ""}`);
16191
+ return { ok: true, version: version2 ?? undefined, path: path ?? undefined };
16186
16192
  }
16187
16193
  function handleStepResult(result, successMsg) {
16188
16194
  if (!result.success) {
@@ -161,6 +161,10 @@ export declare const HashlineEditConfigSchema: z.ZodObject<{
161
161
  enabled: z.ZodDefault<z.ZodBoolean>;
162
162
  }, z.core.$strip>;
163
163
  export type HashlineEditConfig = z.infer<typeof HashlineEditConfigSchema>;
164
+ export declare const DoubleConfirmationConfigSchema: z.ZodObject<{
165
+ enabled: z.ZodDefault<z.ZodBoolean>;
166
+ }, z.core.$strip>;
167
+ export type DoubleConfirmationConfig = z.infer<typeof DoubleConfirmationConfigSchema>;
164
168
  export declare const PluginConfigSchema: z.ZodObject<{
165
169
  preset: z.ZodOptional<z.ZodString>;
166
170
  scoringEngineVersion: z.ZodOptional<z.ZodEnum<{
@@ -291,6 +295,9 @@ export declare const PluginConfigSchema: z.ZodObject<{
291
295
  hashline_edit: z.ZodOptional<z.ZodObject<{
292
296
  enabled: z.ZodDefault<z.ZodBoolean>;
293
297
  }, z.core.$strip>>;
298
+ double_confirmation: z.ZodOptional<z.ZodObject<{
299
+ enabled: z.ZodDefault<z.ZodBoolean>;
300
+ }, z.core.$strip>>;
294
301
  }, z.core.$strip>;
295
302
  export type PluginConfig = z.infer<typeof PluginConfigSchema>;
296
303
  export type { AgentName } from './constants';
@@ -0,0 +1,24 @@
1
+ import type { DoubleConfirmationConfig } from '../../config/schema';
2
+ interface ToolExecuteAfterInput {
3
+ tool: string;
4
+ sessionID?: string;
5
+ callID?: string;
6
+ }
7
+ interface ToolExecuteAfterOutput {
8
+ title: string;
9
+ output: unknown;
10
+ metadata: unknown;
11
+ }
12
+ /**
13
+ * Creates the double-confirmation hook.
14
+ *
15
+ * Meta-Harness principle: prevent premature task completion by
16
+ * appending a verification nudge when background/delegated tasks
17
+ * return results. Only fires once per unique call (tracked by callID).
18
+ *
19
+ * Ships disabled by default — enable via config.double_confirmation.enabled.
20
+ */
21
+ export declare function createDoubleConfirmationHook(config?: DoubleConfirmationConfig): {
22
+ 'tool.execute.after': (input: ToolExecuteAfterInput, output: ToolExecuteAfterOutput) => Promise<void>;
23
+ };
24
+ export {};
@@ -1,6 +1,7 @@
1
1
  export type { AutoUpdateCheckerOptions } from './auto-update-checker';
2
2
  export { createAutoUpdateCheckerHook } from './auto-update-checker';
3
3
  export { createDelegateTaskRetryHook } from './delegate-task-retry';
4
+ export { createDoubleConfirmationHook } from './double-confirmation';
4
5
  export { createEditErrorRecoveryHook } from './edit-error-recovery';
5
6
  export { createHashlineReadEnhancerHook } from './hashline-read-enhancer';
6
7
  export { createJsonErrorRecoveryHook } from './json-error-recovery';
package/dist/index.js CHANGED
@@ -3284,6 +3284,12 @@ var CUSTOM_SKILLS = [
3284
3284
  description: "Repository understanding and hierarchical codemap generation",
3285
3285
  allowedAgents: ["orchestrator", "explorer"],
3286
3286
  sourcePath: "src/skills/cartography"
3287
+ },
3288
+ {
3289
+ name: "analyze",
3290
+ description: "Code review and analysis for uncommitted changes, commits, branches, PRs, or specific files.",
3291
+ allowedAgents: ["*"],
3292
+ sourcePath: "src/skills/analyze"
3287
3293
  }
3288
3294
  ];
3289
3295
 
@@ -17101,6 +17107,9 @@ var SessionExportConfigSchema = exports_external.object({
17101
17107
  var HashlineEditConfigSchema = exports_external.object({
17102
17108
  enabled: exports_external.boolean().default(true)
17103
17109
  });
17110
+ var DoubleConfirmationConfigSchema = exports_external.object({
17111
+ enabled: exports_external.boolean().default(false)
17112
+ });
17104
17113
  var PluginConfigSchema = exports_external.object({
17105
17114
  preset: exports_external.string().optional(),
17106
17115
  scoringEngineVersion: exports_external.enum(["v1", "v2-shadow", "v2"]).optional(),
@@ -17114,7 +17123,8 @@ var PluginConfigSchema = exports_external.object({
17114
17123
  fallback: FailoverConfigSchema.optional(),
17115
17124
  allowedProviders: exports_external.array(exports_external.string()).optional(),
17116
17125
  sessionExport: SessionExportConfigSchema.optional(),
17117
- hashline_edit: HashlineEditConfigSchema.optional()
17126
+ hashline_edit: HashlineEditConfigSchema.optional(),
17127
+ double_confirmation: DoubleConfirmationConfigSchema.optional()
17118
17128
  });
17119
17129
 
17120
17130
  // src/config/loader.ts
@@ -21290,13 +21300,13 @@ function getAgentConfigs(config2) {
21290
21300
  import * as fs2 from "fs";
21291
21301
  import * as os2 from "os";
21292
21302
  import * as path2 from "path";
21293
- var logFile = path2.join(os2.tmpdir(), "oh-my-groundcontrol.log");
21303
+ var getLogFile = () => process.env.GROUNDCONTROL_LOG_FILE || path2.join(os2.tmpdir(), "oh-my-groundcontrol.log");
21294
21304
  function log(message, data) {
21295
21305
  try {
21296
21306
  const timestamp = new Date().toISOString();
21297
21307
  const logEntry = `[${timestamp}] ${message} ${data ? JSON.stringify(data) : ""}
21298
21308
  `;
21299
- fs2.appendFileSync(logFile, logEntry);
21309
+ fs2.appendFileSync(getLogFile(), logEntry);
21300
21310
  } catch {}
21301
21311
  }
21302
21312
 
@@ -22745,6 +22755,34 @@ ${buildRetryGuidance(detected)}`;
22745
22755
  }
22746
22756
  };
22747
22757
  }
22758
+ // src/hooks/double-confirmation/index.ts
22759
+ var CONFIRMATION_TOOLS = new Set(["background_task", "task"]);
22760
+ var CONFIRMATION_NUDGE = `
22761
+
22762
+ ---
22763
+ [Verification Required] Before accepting this result, confirm:
22764
+ - Does the result fully address the original request?
22765
+ - Are there any loose ends or incomplete aspects?
22766
+ - Would you request any changes if reviewing this?
22767
+ If satisfied, proceed. If not, re-examine the result.`;
22768
+ function createDoubleConfirmationHook(config2) {
22769
+ const enabled = config2?.enabled ?? false;
22770
+ const confirmedCalls = new Set;
22771
+ return {
22772
+ "tool.execute.after": async (input, output) => {
22773
+ if (!enabled)
22774
+ return;
22775
+ if (!CONFIRMATION_TOOLS.has(input.tool))
22776
+ return;
22777
+ const callKey = input.callID ?? input.sessionID ?? "";
22778
+ if (!callKey || confirmedCalls.has(callKey))
22779
+ return;
22780
+ confirmedCalls.add(callKey);
22781
+ const outputStr = String(output.output ?? "");
22782
+ output.output = outputStr + CONFIRMATION_NUDGE;
22783
+ }
22784
+ };
22785
+ }
22748
22786
  // src/hooks/edit-error-recovery/index.ts
22749
22787
  var EDIT_ERROR_PATTERNS = [
22750
22788
  "oldString and newString must be different",
@@ -22950,7 +22988,9 @@ ${JSON_ERROR_REMINDER}`;
22950
22988
  }
22951
22989
  // src/hooks/phase-reminder/index.ts
22952
22990
  var PHASE_REMINDER = `<reminder>Recall Workflow Rules:
22953
- Understand \u2192 find the best path (delegate based on rules and parallelize independent work) \u2192 execute \u2192 verify.
22991
+ Before acting: <think> \u2014 analyze what you see, what's been accomplished, what still needs to be done.
22992
+ Before executing: <plan> \u2014 describe your next steps and what you expect each to accomplish.
22993
+ Then: execute your plan, verify results, delegate based on rules, parallelize independent work.
22954
22994
  If delegating, launch the specialist in the same turn you mention it.</reminder>`;
22955
22995
  function createPhaseReminderHook() {
22956
22996
  return {
@@ -39159,6 +39199,7 @@ var OhMyOpenCodeLite = async (ctx) => {
39159
39199
  const jsonErrorRecoveryHook = createJsonErrorRecoveryHook(ctx);
39160
39200
  const hashlineReadEnhancerHook = createHashlineReadEnhancerHook(config3.hashline_edit);
39161
39201
  const editErrorRecoveryHook = createEditErrorRecoveryHook();
39202
+ const doubleConfirmationHook = createDoubleConfirmationHook(config3.double_confirmation);
39162
39203
  const hashlineEditEnabled = config3.hashline_edit?.enabled !== false;
39163
39204
  const hashlineEditTool = hashlineEditEnabled ? createHashlineEditTool() : undefined;
39164
39205
  return {
@@ -39268,6 +39309,7 @@ var OhMyOpenCodeLite = async (ctx) => {
39268
39309
  await editErrorRecoveryHook["tool.execute.after"](input, output);
39269
39310
  await hashlineReadEnhancerHook["tool.execute.after"](input, output);
39270
39311
  await postReadNudgeHook["tool.execute.after"](input, output);
39312
+ await doubleConfirmationHook["tool.execute.after"](input, output);
39271
39313
  }
39272
39314
  };
39273
39315
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frenchtoastman/oh-my-groundcontrol",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "An OpenCode plugin for multi-agent orchestration for structured planning with NASA-style guardrails.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: analyze
3
+ description: Code review and analysis for uncommitted changes, commits, branches, PRs, or specific files.
4
+ ---
5
+
6
+ You are a code reviewer. Your job is to review code changes and provide actionable feedback.
7
+
8
+ ---
9
+
10
+ Input: $ARGUMENTS
11
+
12
+ ---
13
+
14
+ ## Determining What to Review
15
+
16
+ Based on the input provided, determine which type of review to perform:
17
+
18
+ 1. **No arguments (default)**: Review all uncommitted changes
19
+ - Run: `git diff` for unstaged changes
20
+ - Run: `git diff --cached` for staged changes
21
+ - Run: `git status --short` to identify untracked (net new) files
22
+
23
+ 2. **Commit hash** (40-char SHA or short hash): Review that specific commit
24
+ - Run: `git show $ARGUMENTS`
25
+
26
+ 3. **Branch name**: Compare current branch to the specified branch
27
+ - Run: `git diff $ARGUMENTS...HEAD`
28
+
29
+ 4. **PR URL or number** (contains "github.com" or "pull" or looks like a PR number): Review the pull request
30
+ - Run: `gh pr view $ARGUMENTS` to get PR context
31
+ - Run: `gh pr diff $ARGUMENTS` to get the diff
32
+
33
+ 5. **File path**: Review a specific file and its recent changes
34
+ - Verify the file exists and is a regular file (not a directory or binary)
35
+ - Read the full file contents
36
+ - Run: `git log --oneline -10 "$ARGUMENTS"` to see recent history
37
+ - Run: `git diff HEAD~5 -- "$ARGUMENTS"` to get recent changes (adjust range based on log output)
38
+ - Review the recent changes in context of the full file
39
+
40
+ If the file does not exist: "File not found: `<path>`. Please check the path and try again."
41
+ If the argument is a directory: "Cannot review a directory. Please provide a specific file path."
42
+
43
+ Use best judgement when processing input.
44
+
45
+ ---
46
+
47
+ ## Gathering Context
48
+
49
+ **Diffs alone are not enough.** After getting the diff, read the entire file(s) being modified to understand the full context. Code that looks wrong in isolation may be correct given surrounding logic—and vice versa.
50
+
51
+ - Use the diff to identify which files changed
52
+ - Use `git status --short` to identify untracked files, then read their full contents
53
+ - Read the full file to understand existing patterns, control flow, and error handling
54
+ - Check for existing style guide or conventions files (CONVENTIONS.md, AGENTS.md, .editorconfig, etc.)
55
+
56
+ ---
57
+
58
+ ## What to Look For
59
+
60
+ **Bugs** - Your primary focus.
61
+ - Logic errors, off-by-one mistakes, incorrect conditionals
62
+ - If-else guards: missing guards, incorrect branching, unreachable code paths
63
+ - Edge cases: null/empty/undefined inputs, error conditions, race conditions
64
+ - Security issues: injection, auth bypass, data exposure
65
+ - Broken error handling that swallows failures, throws unexpectedly or returns error types that are not caught.
66
+
67
+ **Structure** - Does the code fit the codebase?
68
+ - Does it follow existing patterns and conventions?
69
+ - Are there established abstractions it should use but doesn't?
70
+ - Excessive nesting that could be flattened with early returns or extraction
71
+
72
+ **Performance** - Only flag if obviously problematic.
73
+ - O(n^2) on unbounded data, N+1 queries, blocking I/O on hot paths
74
+
75
+ **Behavior Changes** - If a behavioral change is introduced, raise it (especially if it's possibly unintentional).
76
+
77
+ ---
78
+
79
+ ## Before You Flag Something
80
+
81
+ **Be certain.** If you're going to call something a bug, you need to be confident it actually is one.
82
+
83
+ - Only review the changes - do not review pre-existing code that wasn't modified
84
+ - Don't flag something as a bug if you're unsure - investigate first
85
+ - Don't invent hypothetical problems - if an edge case matters, explain the realistic scenario where it breaks
86
+ - If you need more context to be sure, use the tools below to get it
87
+
88
+ **Don't be a zealot about style.** When checking code against conventions:
89
+
90
+ - Verify the code is *actually* in violation. Don't complain about else statements if early returns are already being used correctly.
91
+ - Some "violations" are acceptable when they're the simplest option. A `let` statement is fine if the alternative is convoluted.
92
+ - Excessive nesting is a legitimate concern regardless of other style choices.
93
+ - Don't flag style preferences as issues unless they clearly violate established project conventions.
94
+
95
+ ---
96
+
97
+ ## Tools
98
+
99
+ Use these to inform your review:
100
+
101
+ - **@explorer** - Find how existing code handles similar problems. Check patterns, conventions, and prior art before claiming something doesn't fit.
102
+ - **@librarian** - Verify correct usage of libraries/APIs before flagging something as wrong. Research best practices if you're unsure about a pattern.
103
+ - **@oracle** - Consult on complex architectural decisions, design pattern trade-offs, or systemic concerns that go beyond the immediate diff.
104
+
105
+ If you're uncertain about something and can't verify it with these tools, say "I'm not sure about X" rather than flagging it as a definite issue.
106
+
107
+ ---
108
+
109
+ ## Output
110
+
111
+ 1. If there is a bug, be direct and clear about why it is a bug.
112
+ 2. Clearly communicate severity of issues. Do not overstate severity.
113
+ 3. Critiques should clearly and explicitly communicate the scenarios, environments, or inputs that are necessary for the bug to arise. The comment should immediately indicate that the issue's severity depends on these factors.
114
+ 4. Your tone should be matter-of-fact and not accusatory or overly positive. It should read as a helpful AI assistant suggestion without sounding too much like a human reviewer.
115
+ 5. Write so the reader can quickly understand the issue without reading too closely.
116
+ 6. AVOID flattery, do not give any comments that are not helpful to the reader. Avoid phrasing like "Great job ...", "Thanks for ...".