oh-my-opencode 5.0.0-beta.18 → 5.0.0-beta.19
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 +289 -160
- package/dist/cli-node/index.js +289 -160
- package/dist/index.js +324 -176
- package/dist/skills/ast-grep/AGENTS.md +51 -0
- package/dist/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/dist/skills/start-work/SKILL.md +2 -1
- package/dist/skills/ultimate-browsing/SKILL.md +2 -0
- package/dist/skills/ultimate-browsing/references/chrome-stealth.md +2 -0
- package/dist/skills/visual-qa/AGENTS.md +58 -0
- package/dist/tui.js +17 -17
- package/package.json +21 -21
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/AGENTS.md +47 -0
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/codegraph/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/AGENTS.md +9 -0
- package/packages/omo-codex/plugin/components/comment-checker/biome.json +2 -2
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/src/apply-patch.ts +2 -8
- package/packages/omo-codex/plugin/components/comment-checker/src/core.ts +1 -2
- package/packages/omo-codex/plugin/components/comment-checker/src/request-extractor.ts +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/biome.json +2 -2
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/cli.js +1 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/dist/codex-hook.js +1 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/src/codex-hook.ts +1 -5
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/test/codex-hook.test.ts +1 -4
- package/packages/omo-codex/plugin/components/lsp/AGENTS.md +30 -15
- package/packages/omo-codex/plugin/components/lsp/biome.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/daemon-cli-path.js +1 -1
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/codex-hook.ts +1 -1
- package/packages/omo-codex/plugin/components/lsp/src/daemon-cli-path.ts +1 -5
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook-unavailable.test.ts +6 -7
- package/packages/omo-codex/plugin/components/lsp/test/codex-hook.test.ts +1 -2
- package/packages/omo-codex/plugin/components/lsp/test/package-smoke.test.ts +11 -1
- package/packages/omo-codex/plugin/components/rules/AGENTS.md +12 -0
- package/packages/omo-codex/plugin/components/rules/biome.json +2 -2
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +43 -30
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +2 -2
- package/packages/omo-codex/plugin/components/rules/src/config.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/src/persistent-cache.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/src/post-compact-budget.ts +6 -2
- package/packages/omo-codex/plugin/components/rules/src/rules-engine-factory.ts +1 -4
- package/packages/omo-codex/plugin/components/rules/src/static-injection.ts +4 -9
- package/packages/omo-codex/plugin/components/rules/test/bundled-rules.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/dynamic-target-fingerprints.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/engine.test.ts +7 -4
- package/packages/omo-codex/plugin/components/rules/test/finder.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/formatter.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/hephaestus-model-variant.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/matcher.test.ts +2 -3
- package/packages/omo-codex/plugin/components/rules/test/package-smoke.test.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/test/parser.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/post-compact-budget.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/rules-engine-consumption.test.ts +3 -6
- package/packages/omo-codex/plugin/components/rules/test/scanner.test.ts +1 -2
- package/packages/omo-codex/plugin/components/rules/test/sources.test.ts +2 -5
- package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts +1 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/biome.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/AGENTS.md +8 -0
- package/packages/omo-codex/plugin/components/telemetry/biome.json +2 -2
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +237 -99
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +237 -99
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/src/codex-hook.ts +1 -4
- package/packages/omo-codex/plugin/components/telemetry/src/posthog.ts +4 -14
- package/packages/omo-codex/plugin/components/telemetry/src/product-identity.ts +1 -1
- package/packages/omo-codex/plugin/components/telemetry/test/diagnostics.test.ts +2 -5
- package/packages/omo-codex/plugin/components/ultrawork/AGENTS.md +5 -0
- package/packages/omo-codex/plugin/components/ultrawork/biome.json +2 -2
- package/packages/omo-codex/plugin/components/ultrawork/directive.md +7 -1
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/skills/ultrawork/SKILL.md +7 -1
- package/packages/omo-codex/plugin/components/ultrawork/test/codex-hook-trigger-policy.test.ts +9 -1
- package/packages/omo-codex/plugin/components/ulw-loop/AGENTS.md +16 -0
- package/packages/omo-codex/plugin/components/ulw-loop/biome.json +2 -2
- package/packages/omo-codex/plugin/components/ulw-loop/directive.md +7 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/dist/codex-goal-snapshot.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-goal-snapshot.ts +3 -1
- package/packages/omo-codex/plugin/components/ulw-loop/src/codex-hook.ts +3 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/codex-goal-snapshot.test.ts +18 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/package-smoke.test.ts +3 -2
- package/packages/omo-codex/plugin/components/ulw-loop/test/steering.test.ts +8 -5
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +19 -19
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/scripts/AGENTS.md +40 -0
- package/packages/omo-codex/plugin/skills/ast-grep/AGENTS.md +51 -0
- package/packages/omo-codex/plugin/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/packages/omo-codex/plugin/skills/start-work/SKILL.md +2 -1
- package/packages/omo-codex/plugin/skills/ultimate-browsing/SKILL.md +2 -0
- package/packages/omo-codex/plugin/skills/ultimate-browsing/references/chrome-stealth.md +2 -0
- package/packages/omo-codex/plugin/skills/ultrawork/SKILL.md +7 -1
- package/packages/omo-codex/plugin/skills/visual-qa/AGENTS.md +58 -0
- package/packages/omo-codex/plugin/test/AGENTS.md +47 -0
- package/packages/omo-codex/scripts/AGENTS.md +36 -0
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +249 -120
- package/packages/shared-skills/skills/ast-grep/AGENTS.md +51 -0
- package/packages/shared-skills/skills/coding-agent-sessions/AGENTS.md +62 -0
- package/packages/shared-skills/skills/start-work/SKILL.md +2 -1
- package/packages/shared-skills/skills/ultimate-browsing/SKILL.md +2 -0
- package/packages/shared-skills/skills/ultimate-browsing/references/chrome-stealth.md +2 -0
- package/packages/shared-skills/skills/visual-qa/AGENTS.md +58 -0
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
import { dirname } from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
|
-
|
|
4
|
+
import { createEngine, findProjectRoot, findRuleCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
5
5
|
import { configFromEnvironment } from "./config.js";
|
|
6
|
-
import { createEngine } from "@oh-my-opencode/rules-engine/engine";
|
|
7
|
-
import { findRuleCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
8
|
-
import { findProjectRoot } from "@oh-my-opencode/rules-engine/engine";
|
|
9
6
|
|
|
10
7
|
interface RulesEngineFactoryOptions {
|
|
11
8
|
env?: NodeJS.ProcessEnv;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
|
|
2
|
+
import type { Engine, LoadedRule, PiRulesConfig } from "@oh-my-opencode/rules-engine/engine";
|
|
3
|
+
import { isNeverTruncatedRule } from "@oh-my-opencode/rules-engine/engine";
|
|
3
4
|
import type { CodexRulesHookOptions } from "./codex-hook-options.js";
|
|
4
5
|
import { configFromEnvironment } from "./config.js";
|
|
5
6
|
import { withPromptBudget } from "./event-budget.js";
|
|
@@ -7,9 +8,6 @@ import { formatAdditionalContextOutput } from "./hook-output.js";
|
|
|
7
8
|
import { completePostCompactRecovery, hydrateEngineState, persistEngineState } from "./persistent-cache.js";
|
|
8
9
|
import { withPostCompactBudget } from "./post-compact-budget.js";
|
|
9
10
|
import { buildPostCompactReadDirective } from "./post-compact-directive.js";
|
|
10
|
-
import type { Engine } from "@oh-my-opencode/rules-engine/engine";
|
|
11
|
-
import { isNeverTruncatedRule } from "@oh-my-opencode/rules-engine/engine";
|
|
12
|
-
import type { LoadedRule, PiRulesConfig } from "@oh-my-opencode/rules-engine/engine";
|
|
13
11
|
import { createRulesEngine } from "./rules-engine-factory.js";
|
|
14
12
|
import { filterRulesAlreadyInTranscript, filterRulesNotInTranscriptText } from "./transcript-rule-filter.js";
|
|
15
13
|
import type { TranscriptSearchOptions } from "./transcript-search.js";
|
|
@@ -120,10 +118,7 @@ function runPostCompactRecovery(input: PostCompactRecoveryInput): string {
|
|
|
120
118
|
engine.markStaticInjected(rule);
|
|
121
119
|
}
|
|
122
120
|
persistEngineState(engine, input.cachePath, input.channel);
|
|
123
|
-
return formatAdditionalContextOutput(
|
|
124
|
-
input.eventName,
|
|
125
|
-
combineStaticContext(bodyBlock, directive),
|
|
126
|
-
);
|
|
121
|
+
return formatAdditionalContextOutput(input.eventName, combineStaticContext(bodyBlock, directive));
|
|
127
122
|
}
|
|
128
123
|
|
|
129
124
|
function readRecoveryTranscriptText(transcriptPath: string | null): string | null {
|
|
@@ -153,7 +148,7 @@ function recoverDynamicRulePaths(
|
|
|
153
148
|
if (staticRulePaths.has(rulePath)) {
|
|
154
149
|
continue;
|
|
155
150
|
}
|
|
156
|
-
if (transcriptText
|
|
151
|
+
if (transcriptText?.includes(rulePath)) {
|
|
157
152
|
continue;
|
|
158
153
|
}
|
|
159
154
|
if (!existsSync(rulePath)) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { createRuleDiscoveryCache, findRuleCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
4
5
|
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
6
6
|
import {
|
|
7
7
|
type CodexPostCompactInput,
|
|
8
8
|
type CodexSessionStartInput,
|
|
@@ -10,7 +10,6 @@ import {
|
|
|
10
10
|
runSessionStartHook,
|
|
11
11
|
runUserPromptSubmitHook,
|
|
12
12
|
} from "../src/codex-hook.js";
|
|
13
|
-
import { createRuleDiscoveryCache, findRuleCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
14
13
|
|
|
15
14
|
interface FixtureOptions {
|
|
16
15
|
readonly writeProjectDuplicate?: boolean;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import { defaultConfig } from "@oh-my-opencode/rules-engine/engine";
|
|
4
5
|
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
6
6
|
import { fingerprintDynamicTargets } from "../src/dynamic-target-fingerprints.js";
|
|
7
|
-
import { defaultConfig } from "@oh-my-opencode/rules-engine/engine";
|
|
8
7
|
|
|
9
8
|
const tempDirectories: string[] = [];
|
|
10
9
|
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
|
+
import type { RuleCandidate } from "@oh-my-opencode/rules-engine/engine";
|
|
3
|
+
import {
|
|
4
|
+
createEngine,
|
|
5
|
+
defaultConfig,
|
|
6
|
+
matchRule as defaultMatchRule,
|
|
7
|
+
type EngineDeps,
|
|
8
|
+
} from "@oh-my-opencode/rules-engine/engine";
|
|
2
9
|
import { describe, expect, it } from "vitest";
|
|
3
|
-
|
|
4
10
|
import { configFromEnvironment } from "../src/config.js";
|
|
5
|
-
import { createEngine, defaultConfig, type EngineDeps } from "@oh-my-opencode/rules-engine/engine";
|
|
6
|
-
import { matchRule as defaultMatchRule } from "@oh-my-opencode/rules-engine/engine";
|
|
7
|
-
import type { RuleCandidate } from "@oh-my-opencode/rules-engine/engine";
|
|
8
11
|
|
|
9
12
|
const projectRoot = "/tmp/codex-rules-engine";
|
|
10
13
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
6
|
-
import { findRuleCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
7
4
|
import type { RuleCandidate } from "@oh-my-opencode/rules-engine/engine";
|
|
5
|
+
import { findRuleCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
6
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
8
7
|
|
|
9
8
|
const tempDirectories: string[] = [];
|
|
10
9
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
|
|
3
|
-
import { formatDynamicBlock, formatStaticBlock } from "@oh-my-opencode/rules-engine/engine";
|
|
4
1
|
import type { LoadedRule, MatchReason, RuleSource } from "@oh-my-opencode/rules-engine/engine";
|
|
2
|
+
import { formatDynamicBlock, formatStaticBlock } from "@oh-my-opencode/rules-engine/engine";
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
5
4
|
|
|
6
5
|
const FORMAT_OPTIONS = {
|
|
7
6
|
maxRuleChars: 10_000,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { findPluginBundledCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
4
5
|
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
6
6
|
import { type CodexSessionStartInput, runSessionStartHook } from "../src/codex-hook.js";
|
|
7
|
-
import { findPluginBundledCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
8
7
|
|
|
9
8
|
const GPT_55_VARIANT_PATH = "bundled-rules/hephaestus/gpt-5.5.md";
|
|
10
9
|
const GPT_56_VARIANT_PATH = "bundled-rules/hephaestus/gpt-5.6.md";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
|
|
3
|
-
import { matchRule, normalizeGlobs } from "@oh-my-opencode/rules-engine/engine";
|
|
4
1
|
import type { RuleFrontmatter } from "@oh-my-opencode/rules-engine/engine";
|
|
2
|
+
import { matchRule, normalizeGlobs } from "@oh-my-opencode/rules-engine/engine";
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
5
4
|
|
|
6
5
|
function matchFrontmatter(
|
|
7
6
|
frontmatter: RuleFrontmatter,
|
|
@@ -32,7 +32,7 @@ describe("plugin package metadata", () => {
|
|
|
32
32
|
// then
|
|
33
33
|
expect(packageJson.type).toBe("module");
|
|
34
34
|
expect(packageJson.packageManager).toBe("npm@11.12.1");
|
|
35
|
-
expect(packageJson.dependencies ?? {}).toEqual({ picomatch: "^4.0.
|
|
35
|
+
expect(packageJson.dependencies ?? {}).toEqual({ picomatch: "^4.0.7" });
|
|
36
36
|
expect(packageJson.bin["omo-rules"]).toBe("./dist/cli.js");
|
|
37
37
|
expect(packageFiles).toContain("bundled-rules");
|
|
38
38
|
expect(bundledRules).toContain("windows-git-bash.md");
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
|
|
3
1
|
import { parseRule } from "@oh-my-opencode/rules-engine/engine";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
4
3
|
|
|
5
4
|
describe("parseRule", () => {
|
|
6
5
|
it("#given content without frontmatter #when parsing #then body is preserved", () => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
+
import type { PiRulesConfig } from "@oh-my-opencode/rules-engine/engine";
|
|
4
5
|
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
6
6
|
import { withPostCompactBudget } from "../src/post-compact-budget.js";
|
|
7
|
-
import type { PiRulesConfig } from "@oh-my-opencode/rules-engine/engine";
|
|
8
7
|
|
|
9
8
|
const tempDirectories: string[] = [];
|
|
10
9
|
const CONFIG: PiRulesConfig = {
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
6
4
|
import {
|
|
7
5
|
findPluginBundledCandidates,
|
|
8
6
|
matchRule,
|
|
9
7
|
parseRule,
|
|
10
|
-
scanRuleFiles,
|
|
11
8
|
SOURCE_PRIORITY,
|
|
9
|
+
scanRuleFiles,
|
|
12
10
|
} from "@oh-my-opencode/rules-engine/engine";
|
|
11
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
13
12
|
|
|
14
13
|
const tempDirectories: string[] = [];
|
|
15
14
|
|
|
@@ -37,9 +36,7 @@ describe("rules-engine package consumption", () => {
|
|
|
37
36
|
|
|
38
37
|
// then
|
|
39
38
|
expect(SOURCE_PRIORITY.get("plugin-bundled")).toBe(200);
|
|
40
|
-
expect(nonWindowsCandidates.map((candidate) => candidate.relativePath)).toEqual([
|
|
41
|
-
"bundled-rules/hephaestus.md",
|
|
42
|
-
]);
|
|
39
|
+
expect(nonWindowsCandidates.map((candidate) => candidate.relativePath)).toEqual(["bundled-rules/hephaestus.md"]);
|
|
43
40
|
expect(windowsCandidates.map((candidate) => candidate.relativePath)).toEqual([
|
|
44
41
|
"bundled-rules/hephaestus.md",
|
|
45
42
|
"bundled-rules/windows-git-bash.md",
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
-
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
6
4
|
import { scanRuleFiles } from "@oh-my-opencode/rules-engine/engine";
|
|
5
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
7
6
|
|
|
8
7
|
const tempDirectories: string[] = [];
|
|
9
8
|
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
|
|
3
|
-
import { SOURCE_PRIORITY } from "@oh-my-opencode/rules-engine/engine";
|
|
4
|
-
import { defaultConfig } from "@oh-my-opencode/rules-engine/engine";
|
|
5
|
-
import { disabledSourcesFromConfig } from "@oh-my-opencode/rules-engine/engine";
|
|
6
1
|
import type { PiRulesConfig } from "@oh-my-opencode/rules-engine/engine";
|
|
2
|
+
import { defaultConfig, disabledSourcesFromConfig, SOURCE_PRIORITY } from "@oh-my-opencode/rules-engine/engine";
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
7
4
|
|
|
8
5
|
describe("rules source selection", () => {
|
|
9
6
|
it("#given default config #when disabled sources are derived #then opt-out sources stay disabled", () => {
|
package/packages/omo-codex/plugin/components/rules/test/windows-git-bash-bundled-rule.test.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { findPluginBundledCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
4
5
|
import { afterEach, describe, expect, it } from "vitest";
|
|
5
|
-
|
|
6
6
|
import { type CodexSessionStartInput, runSessionStartHook } from "../src/codex-hook.js";
|
|
7
|
-
import { findPluginBundledCandidates } from "@oh-my-opencode/rules-engine/engine";
|
|
8
7
|
|
|
9
8
|
const WINDOWS_RULE_DESCRIPTION = "Windows Git Bash guidance for Codex";
|
|
10
9
|
const WINDOWS_RULE_PATH = "bundled-rules/windows-git-bash.md";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.9/schema.json",
|
|
3
3
|
"linter": {
|
|
4
4
|
"enabled": true,
|
|
5
5
|
"rules": {
|
|
6
|
-
"
|
|
6
|
+
"preset": "recommended",
|
|
7
7
|
"style": {
|
|
8
8
|
"noDefaultExport": "error",
|
|
9
9
|
"noEnum": "error",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"type": "command",
|
|
8
8
|
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook stop",
|
|
9
9
|
"timeout": 10,
|
|
10
|
-
"statusMessage": "(OmO 5.0.0-beta.
|
|
10
|
+
"statusMessage": "(OmO 5.0.0-beta.19) Checking Start-Work Continuation"
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"type": "command",
|
|
20
20
|
"command": "node \"${PLUGIN_ROOT}/components/start-work-continuation/dist/cli.js\" hook subagent-stop",
|
|
21
21
|
"timeout": 10,
|
|
22
|
-
"statusMessage": "(OmO 5.0.0-beta.
|
|
22
|
+
"statusMessage": "(OmO 5.0.0-beta.19) Checking Start-Work Continuation"
|
|
23
23
|
}
|
|
24
24
|
]
|
|
25
25
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"type": "command",
|
|
9
9
|
"command": "node \"${PLUGIN_ROOT}/dist/cli.js\" hook post-tool-use",
|
|
10
10
|
"timeout": 10,
|
|
11
|
-
"statusMessage": "(OmO 5.0.0-beta.
|
|
11
|
+
"statusMessage": "(OmO 5.0.0-beta.19) Checking Thread Title Hygiene"
|
|
12
12
|
}
|
|
13
13
|
]
|
|
14
14
|
}
|
|
@@ -10,6 +10,14 @@ Conventions for human contributors and AI agents working on this component.
|
|
|
10
10
|
- Tabs for indentation. Double quotes for strings.
|
|
11
11
|
- Tests use vitest with `#given .. #when .. #then` descriptions or plain `// given / // when / // then` body comments.
|
|
12
12
|
|
|
13
|
+
## Layout
|
|
14
|
+
|
|
15
|
+
- `src/cli.ts`: SessionStart hook CLI (stdin JSON in, empty stdout out).
|
|
16
|
+
- `src/codex-hook.ts`: `runSessionStartHook` — the single hook handler.
|
|
17
|
+
- `src/posthog.ts`: client construction/capture/shutdown; `DEFAULT_POSTHOG_API_KEY`, `DEFAULT_POSTHOG_HOST`, `getComponentVersion`.
|
|
18
|
+
- `src/product-identity.ts`: the constants that must stay byte-equivalent with `packages/omo-codex/src/telemetry/product-identity.ts`.
|
|
19
|
+
- `hooks/hooks.json`: component-local wiring (twin of the aggregate hook JSON).
|
|
20
|
+
|
|
13
21
|
## Commands
|
|
14
22
|
|
|
15
23
|
- `npm install` - install dependencies.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://biomejs.dev/schemas/2.
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.9/schema.json",
|
|
3
3
|
"linter": {
|
|
4
4
|
"enabled": true,
|
|
5
5
|
"rules": {
|
|
6
|
-
"
|
|
6
|
+
"preset": "recommended",
|
|
7
7
|
"style": {
|
|
8
8
|
"noDefaultExport": "error",
|
|
9
9
|
"noEnum": "error",
|