@skj1724/oh-my-opencode 3.18.27 → 3.18.28

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 (132) hide show
  1. package/README.ja.md +16 -16
  2. package/README.ko.md +16 -16
  3. package/README.md +19 -19
  4. package/README.ru.md +8 -8
  5. package/README.zh-cn.md +16 -16
  6. package/bin/oh-my-opencode.js +4 -2
  7. package/bin/platform.js +2 -2
  8. package/bin/platform.test.ts +25 -0
  9. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-16.d.ts +1 -0
  10. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-17.d.ts +1 -0
  11. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-18.d.ts +1 -0
  12. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-19.d.ts +1 -0
  13. package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-20.d.ts +1 -0
  14. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-01.d.ts +1 -0
  15. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-02.d.ts +1 -0
  16. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-03.d.ts +1 -0
  17. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-04.d.ts +1 -0
  18. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-05.d.ts +1 -0
  19. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-06.d.ts +1 -0
  20. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-07.d.ts +1 -0
  21. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-08.d.ts +1 -0
  22. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-09.d.ts +1 -0
  23. package/dist/__tests__/perf/fixtures/in-tree/src/app/file-10.d.ts +1 -0
  24. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-11.d.ts +1 -0
  25. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-12.d.ts +1 -0
  26. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-13.d.ts +1 -0
  27. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-14.d.ts +1 -0
  28. package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-15.d.ts +1 -0
  29. package/dist/agents/atlas/agent.d.ts +2 -3
  30. package/dist/agents/atlas/default-prompt-sections.d.ts +6 -6
  31. package/dist/agents/atlas/gemini-prompt-sections.d.ts +6 -6
  32. package/dist/agents/atlas/gpt-prompt-sections.d.ts +6 -6
  33. package/dist/agents/atlas/prompt-section-builder.d.ts +3 -3
  34. package/dist/agents/builtin-agents/atlas-agent.d.ts +0 -2
  35. package/dist/agents/builtin-agents/environment-context.d.ts +0 -1
  36. package/dist/agents/builtin-agents/general-agents.d.ts +0 -1
  37. package/dist/agents/builtin-agents/hephaestus-agent.d.ts +0 -1
  38. package/dist/agents/builtin-agents/sisyphus-agent.d.ts +0 -1
  39. package/dist/agents/builtin-agents.d.ts +1 -1
  40. package/dist/agents/dynamic-agent-category-skills-guide.d.ts +1 -1
  41. package/dist/agents/dynamic-agent-core-sections.d.ts +14 -9
  42. package/dist/agents/dynamic-agent-policy-sections.d.ts +5 -5
  43. package/dist/agents/dynamic-agent-tool-categorization.d.ts +1 -1
  44. package/dist/agents/env-context.d.ts +7 -1
  45. package/dist/agents/hephaestus/agent.d.ts +2 -2
  46. package/dist/agents/hephaestus/gpt-5-3-codex.d.ts +9 -9
  47. package/dist/agents/hephaestus/gpt-5-4.d.ts +18 -18
  48. package/dist/agents/hephaestus/gpt-5-5.d.ts +13 -0
  49. package/dist/agents/hephaestus/gpt.d.ts +1 -1
  50. package/dist/agents/metis.d.ts +9 -9
  51. package/dist/agents/momus.d.ts +10 -11
  52. package/dist/agents/prometheus/behavioral-summary.d.ts +3 -3
  53. package/dist/agents/prometheus/gemini.d.ts +7 -7
  54. package/dist/agents/prometheus/gpt.d.ts +6 -6
  55. package/dist/agents/prometheus/high-accuracy-mode.d.ts +3 -3
  56. package/dist/agents/prometheus/identity-constraints.d.ts +3 -4
  57. package/dist/agents/prometheus/interview-mode.d.ts +3 -3
  58. package/dist/agents/prometheus/plan-generation.d.ts +4 -4
  59. package/dist/agents/prometheus/plan-template.d.ts +4 -4
  60. package/dist/agents/prometheus/system-prompt.d.ts +11 -11
  61. package/dist/agents/sisyphus/default.d.ts +3 -3
  62. package/dist/agents/sisyphus/gemini.d.ts +10 -10
  63. package/dist/agents/sisyphus/gpt-5-4.d.ts +18 -18
  64. package/dist/agents/sisyphus/gpt-5-5.d.ts +18 -0
  65. package/dist/agents/sisyphus/index.d.ts +1 -0
  66. package/dist/agents/sisyphus-junior/agent.d.ts +2 -2
  67. package/dist/agents/sisyphus-junior/default.d.ts +5 -5
  68. package/dist/agents/sisyphus-junior/gemini.d.ts +6 -6
  69. package/dist/agents/sisyphus-junior/gpt-5-3-codex.d.ts +4 -4
  70. package/dist/agents/sisyphus-junior/gpt-5-4.d.ts +7 -7
  71. package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +12 -0
  72. package/dist/agents/sisyphus-junior/gpt.d.ts +5 -5
  73. package/dist/agents/sisyphus-junior/index.d.ts +1 -0
  74. package/dist/agents/sisyphus.d.ts +2 -3
  75. package/dist/agents/types.d.ts +2 -1
  76. package/dist/cli/index.js +2360 -3399
  77. package/dist/config/schema/agent-overrides.d.ts +0 -15
  78. package/dist/config/schema/commands.d.ts +0 -2
  79. package/dist/config/schema/oh-my-opencode-config.d.ts +0 -19
  80. package/dist/features/background-agent/concurrency.d.ts +1 -1
  81. package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
  82. package/dist/features/builtin-commands/templates/ralph-loop.d.ts +3 -3
  83. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
  84. package/dist/features/builtin-commands/templates/remove-ai-slops.d.ts +1 -1
  85. package/dist/features/builtin-commands/types.d.ts +1 -2
  86. package/dist/features/builtin-skills/skills/git-master-sections/commit-workflow.d.ts +1 -1
  87. package/dist/hooks/atlas/system-reminder-templates.d.ts +6 -6
  88. package/dist/hooks/auto-update-checker/constants.d.ts +1 -1
  89. package/dist/hooks/compaction-context-injector/compaction-context-prompt.d.ts +1 -1
  90. package/dist/hooks/keyword-detector/analyze/default.d.ts +8 -8
  91. package/dist/hooks/keyword-detector/search/default.d.ts +8 -8
  92. package/dist/hooks/keyword-detector/ultrawork/default.d.ts +6 -6
  93. package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +12 -12
  94. package/dist/hooks/keyword-detector/ultrawork/gpt.d.ts +7 -7
  95. package/dist/hooks/keyword-detector/ultrawork/planner.d.ts +3 -3
  96. package/dist/hooks/prometheus-md-only/constants.d.ts +2 -2
  97. package/dist/hooks/todo-continuation-enforcer/constants.d.ts +1 -1
  98. package/dist/hooks/tool-output-truncator.d.ts +0 -6
  99. package/dist/index.js +9793 -10923
  100. package/dist/oh-my-opencode.schema.json +3 -57
  101. package/dist/plugin-handlers/prometheus-agent-config-builder.d.ts +1 -5
  102. package/dist/shared/logger.d.ts +0 -1
  103. package/dist/shared/model-capabilities/supplemental-entries.d.ts +2 -0
  104. package/dist/shared/plugin-identity.d.ts +4 -4
  105. package/dist/shared/system-directive.d.ts +1 -2
  106. package/dist/tools/ast-grep/pattern-hints.d.ts +4 -0
  107. package/dist/tools/ast-grep/tool-descriptions.d.ts +3 -0
  108. package/dist/tools/call-omo-agent/constants.d.ts +1 -1
  109. package/dist/tools/delegate-task/prompt-builder.d.ts +2 -2
  110. package/dist/tools/index.d.ts +1 -1
  111. package/dist/tools/interactive-bash/index.d.ts +2 -2
  112. package/dist/tools/interactive-bash/tools.d.ts +0 -1
  113. package/package.json +104 -99
  114. package/postinstall.mjs +133 -35
  115. package/dist/agents/load-prompt-template.d.ts +0 -1
  116. package/dist/agents/prompts-zh/index.d.ts +0 -16
  117. package/dist/agents/types/language.d.ts +0 -3
  118. package/dist/config/schema/i18n.d.ts +0 -21
  119. package/dist/features/builtin-commands/templates/open-plan.d.ts +0 -1
  120. package/src/agents/prompts-zh/atlas.md +0 -657
  121. package/src/agents/prompts-zh/explore.md +0 -85
  122. package/src/agents/prompts-zh/general-agents.md +0 -401
  123. package/src/agents/prompts-zh/hephaestus.md +0 -391
  124. package/src/agents/prompts-zh/index.ts +0 -17
  125. package/src/agents/prompts-zh/librarian.md +0 -282
  126. package/src/agents/prompts-zh/metis.md +0 -284
  127. package/src/agents/prompts-zh/momus.md +0 -181
  128. package/src/agents/prompts-zh/multimodal-looker.md +0 -40
  129. package/src/agents/prompts-zh/oracle.md +0 -206
  130. package/src/agents/prompts-zh/prometheus.md +0 -1327
  131. package/src/agents/prompts-zh/sisyphus-junior.md +0 -29
  132. package/src/agents/prompts-zh/sisyphus.md +0 -387
package/postinstall.mjs CHANGED
@@ -1,35 +1,133 @@
1
- // postinstall.mjs
2
- // Runs after npm install - verifies OpenCode is installed
3
-
4
- import { execSync } from "node:child_process";
5
-
6
- const MIN_OPENCODE_VERSION = "1.4.0";
7
-
8
- function parseVersion(version) {
9
- return version.replace(/^v/, "").split("-")[0].split(".").map((n) => Number.parseInt(n, 10) || 0);
10
- }
11
-
12
- function compareVersions(current, minimum) {
13
- const a = parseVersion(current);
14
- const b = parseVersion(minimum);
15
- const len = Math.max(a.length, b.length);
16
- for (let i = 0; i < len; i++) {
17
- if ((a[i] ?? 0) > (b[i] ?? 0)) return true;
18
- if ((a[i] ?? 0) < (b[i] ?? 0)) return false;
19
- }
20
- return true;
21
- }
22
-
23
- function main() {
24
- try {
25
- const version = execSync("opencode --version", { encoding: "utf-8", stdio: ["pipe", "pipe", "ignore"] }).trim();
26
- if (!compareVersions(version, MIN_OPENCODE_VERSION)) {
27
- console.warn(`oh-my-opencode requires OpenCode >= ${MIN_OPENCODE_VERSION} (detected: ${version})`);
28
- }
29
- } catch {
30
- // OpenCode not found - OK, plugin can still be installed
31
- }
32
- console.log("oh-my-openagent installed");
33
- }
34
-
35
- main();
1
+ // postinstall.mjs
2
+ // Runs after npm install to verify platform binary is available
3
+
4
+ import { readFileSync } from "node:fs";
5
+ import { createRequire } from "node:module";
6
+ import { getPlatformPackageCandidates, getBinaryPath } from "./bin/platform.js";
7
+
8
+ const require = createRequire(import.meta.url);
9
+
10
+ const MIN_OPENCODE_VERSION = "1.4.0";
11
+
12
+ /**
13
+ * Parse version string into numeric parts
14
+ * @param {string} version
15
+ * @returns {number[]}
16
+ */
17
+ function parseVersion(version) {
18
+ return version
19
+ .replace(/^v/, "")
20
+ .split("-")[0]
21
+ .split(".")
22
+ .map((part) => Number.parseInt(part, 10) || 0);
23
+ }
24
+
25
+ /**
26
+ * Compare two version strings
27
+ * @param {string} current
28
+ * @param {string} minimum
29
+ * @returns {boolean} true if current >= minimum
30
+ */
31
+ function compareVersions(current, minimum) {
32
+ const currentParts = parseVersion(current);
33
+ const minimumParts = parseVersion(minimum);
34
+ const length = Math.max(currentParts.length, minimumParts.length);
35
+
36
+ for (let index = 0; index < length; index++) {
37
+ const currentPart = currentParts[index] ?? 0;
38
+ const minimumPart = minimumParts[index] ?? 0;
39
+ if (currentPart > minimumPart) return true;
40
+ if (currentPart < minimumPart) return false;
41
+ }
42
+
43
+ return true;
44
+ }
45
+
46
+ /**
47
+ * Check if opencode version meets minimum requirement
48
+ * @returns {{ok: boolean, version: string | null}}
49
+ */
50
+ function checkOpenCodeVersion() {
51
+ try {
52
+ const result = require("child_process").execSync("opencode --version", {
53
+ encoding: "utf-8",
54
+ stdio: ["pipe", "pipe", "ignore"],
55
+ });
56
+ const version = result.trim();
57
+ const ok = compareVersions(version, MIN_OPENCODE_VERSION);
58
+ return { ok, version };
59
+ } catch {
60
+ return { ok: true, version: null };
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Detect libc family on Linux
66
+ */
67
+ function getLibcFamily() {
68
+ if (process.platform !== "linux") {
69
+ return undefined;
70
+ }
71
+
72
+ try {
73
+ const detectLibc = require("detect-libc");
74
+ return detectLibc.familySync();
75
+ } catch {
76
+ return null;
77
+ }
78
+ }
79
+
80
+ function getPackageBaseName() {
81
+ try {
82
+ const packageJson = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8"));
83
+ return packageJson.name || "oh-my-opencode";
84
+ } catch {
85
+ return "oh-my-opencode";
86
+ }
87
+ }
88
+
89
+ function main() {
90
+ const { platform, arch } = process;
91
+ const libcFamily = getLibcFamily();
92
+ const packageBaseName = getPackageBaseName();
93
+
94
+ // Check opencode version requirement
95
+ const versionCheck = checkOpenCodeVersion();
96
+ if (versionCheck.version && !versionCheck.ok) {
97
+ console.warn(`⚠ oh-my-opencode requires OpenCode >= ${MIN_OPENCODE_VERSION}`);
98
+ console.warn(` Detected: ${versionCheck.version}`);
99
+ console.warn(` Please update OpenCode to avoid compatibility issues.`);
100
+ }
101
+
102
+ try {
103
+ const packageCandidates = getPlatformPackageCandidates({
104
+ platform,
105
+ arch,
106
+ libcFamily,
107
+ packageBaseName,
108
+ });
109
+
110
+ const resolvedPackage = packageCandidates.find((pkg) => {
111
+ try {
112
+ require.resolve(getBinaryPath(pkg, platform));
113
+ return true;
114
+ } catch {
115
+ return false;
116
+ }
117
+ });
118
+
119
+ if (!resolvedPackage) {
120
+ throw new Error(
121
+ `No platform binary package installed. Tried: ${packageCandidates.join(", ")}`
122
+ );
123
+ }
124
+
125
+ console.log(`✓ oh-my-opencode binary installed for ${platform}-${arch} (${resolvedPackage})`);
126
+ } catch (error) {
127
+ console.warn(`⚠ oh-my-opencode: ${error.message}`);
128
+ console.warn(` The CLI may not work on this platform.`);
129
+ // Don't fail installation - let user try anyway
130
+ }
131
+ }
132
+
133
+ main();
@@ -1 +0,0 @@
1
- export declare function loadPromptTemplate(language: string, agentName: string): string | null;
@@ -1,16 +0,0 @@
1
- export declare const CHINESE_PROMPTS: {
2
- readonly sisyphus: "file://./src/agents/prompts-zh/sisyphus.md";
3
- readonly hephaestus: "file://./src/agents/prompts-zh/hephaestus.md";
4
- readonly prometheus: "file://./src/agents/prompts-zh/prometheus.md";
5
- readonly atlas: "file://./src/agents/prompts-zh/atlas.md";
6
- readonly oracle: "file://./src/agents/prompts-zh/oracle.md";
7
- readonly metis: "file://./src/agents/prompts-zh/metis.md";
8
- readonly momus: "file://./src/agents/prompts-zh/momus.md";
9
- readonly "sisyphus-junior": "file://./src/agents/prompts-zh/sisyphus-junior.md";
10
- readonly general: {
11
- readonly librarian: "file://./src/agents/prompts-zh/librarian.md";
12
- readonly explore: "file://./src/agents/prompts-zh/explore.md";
13
- readonly "multimodal-looker": "file://./src/agents/prompts-zh/multimodal-looker.md";
14
- };
15
- };
16
- export type ChinesePromptKey = keyof typeof CHINESE_PROMPTS;
@@ -1,3 +0,0 @@
1
- export type SupportedLanguage = "zh-CN" | "zh-TW" | "en-US" | "ja-JP" | "ko-KR" | "fr-FR" | "de-DE" | "es-ES" | "pt-BR" | "ru-RU" | "vi-VN" | "th-TH" | "id-ID" | "ms-MY" | "hi-IN" | "ar-SA" | "he-IL";
2
- export declare function isZhLanguage(lang?: string): boolean;
3
- export declare function isEnLanguage(lang?: string): boolean;
@@ -1,21 +0,0 @@
1
- import { z } from "zod";
2
- /**
3
- * Internationalization configuration for agent interaction language.
4
- *
5
- * Controls the language used for agent prompts and thinking output guidance.
6
- * When set, agents will be instructed to respond in the specified language.
7
- *
8
- * Supported values: IETF BCP 47 format (e.g., "zh-CN", "en-US", "ja-JP", "ko-KR")
9
- *
10
- * @example
11
- * // In ~/.config/opencode/oh-my-opencode.jsonc
12
- * {
13
- * "i18n": {
14
- * "language": "zh-CN"
15
- * }
16
- * }
17
- */
18
- export declare const I18nConfigSchema: z.ZodObject<{
19
- language: z.ZodOptional<z.ZodString>;
20
- }, z.core.$strip>;
21
- export type I18nConfig = z.infer<typeof I18nConfigSchema>;
@@ -1 +0,0 @@
1
- export declare const OPEN_PLAN_TEMPLATE = "You are executing the /open-plan command.\n\n## ARGUMENTS\n\n- `/open-plan [plan-name]`\n - `plan-name` (optional): name of the plan to open. If omitted, opens the active plan from boulder.json.\n\n## WHAT TO DO\n\n1. **Check if a plan name argument was provided**:\n - If `$ARGUMENTS` is not empty \u2192 use it as the plan name\n - If `$ARGUMENTS` is empty \u2192 read `.sisyphus/boulder.json` to find `active_plan`\n\n2. **Find the plan file**:\n - If plan-name was provided:\n - Construct path as `.sisyphus/plans/{plan-name}.md` (append .md if not already present)\n - If file exists at that path \u2192 use it\n - If file doesn't exist \u2192 output error and stop\n - If using active_plan from boulder.json:\n - If `active_plan` field exists and is not empty \u2192 use it\n - If no active plan (file doesn't exist, or `active_plan` is null/empty) \u2192 output error and stop\n\n3. **Output the /editor command**:\n Output exactly the following format (replace with actual path):\n `/editor <plan_path>`\n\n## ERROR HANDLING\n\nIf a plan name was provided but the file doesn't exist:\n```\nNo plan found at \".sisyphus/plans/{plan-name}.md\". Use /start-work to create a plan first.\n```\n\nIf no plan name was provided and no active plan exists:\n```\nNo active plan. Use /start-work to set a plan first.\n```\n\n## EXAMPLE\n\nExample 1 - Opening active plan (no argument):\nIf `.sisyphus/boulder.json` contains:\n```json\n{\n \"active_plan\": \"C:/projects/myproject/.sisyphus/plans/my-feature.md\",\n \"plan_name\": \"my-feature\"\n}\n```\n\nOutput:\n`/editor C:/projects/myproject/.sisyphus/plans/my-feature.md`\n\nExample 2 - Opening specific plan (with argument \"my-feature\"):\nIf `my-feature.md` exists at `.sisyphus/plans/my-feature.md`:\n\nOutput:\n`/editor C:/projects/myproject/.sisyphus/plans/my-feature.md`";