opencode-matrixx 2.1.0 → 2.2.0

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 (163) hide show
  1. package/README.md +129 -18
  2. package/dist/agents/builtin-agents/model-resolution.d.ts +1 -1
  3. package/dist/agents/index.d.ts +1 -1
  4. package/dist/agents/merovingian.d.ts +2 -2
  5. package/dist/config/index.d.ts +2 -2
  6. package/dist/config/schema/agent-names.d.ts +3 -17
  7. package/dist/config/schema/assembly.d.ts +13 -0
  8. package/dist/config/schema/categories.d.ts +0 -1
  9. package/dist/config/schema/commands.d.ts +4 -0
  10. package/dist/config/schema/hooks.d.ts +0 -1
  11. package/dist/config/schema/matrixx-config.d.ts +16 -1
  12. package/dist/config/schema/security.d.ts +0 -5
  13. package/dist/config/schema.d.ts +1 -0
  14. package/dist/features/assembly-state/index.d.ts +1 -0
  15. package/dist/features/assembly-state/manager.d.ts +6 -0
  16. package/dist/features/background-agent/error-helpers.d.ts +6 -0
  17. package/dist/features/background-agent/manager.d.ts +6 -8
  18. package/dist/features/background-agent/message-dir.d.ts +5 -0
  19. package/dist/features/background-agent/notification-builder.d.ts +17 -0
  20. package/dist/features/builtin-commands/templates/assembly.d.ts +1 -0
  21. package/dist/features/builtin-commands/templates/research.d.ts +1 -0
  22. package/dist/features/builtin-commands/templates/ultrawork.d.ts +1 -0
  23. package/dist/features/builtin-commands/types.d.ts +1 -1
  24. package/dist/features/builtin-skills/skills/index.d.ts +2 -0
  25. package/dist/features/builtin-skills/skills/remove-ai-slops.d.ts +2 -0
  26. package/dist/features/builtin-skills/skills/ulw-research.d.ts +2 -0
  27. package/dist/features/claude-code-command-loader/loader.d.ts +0 -1
  28. package/dist/features/hook-message-injector/injector.d.ts +1 -2
  29. package/dist/features/tmux-subagent/index.d.ts +0 -2
  30. package/dist/features/ultrawork-state/index.d.ts +1 -0
  31. package/dist/features/ultrawork-state/manager.d.ts +6 -0
  32. package/dist/hooks/auto-update-checker/cache.d.ts +0 -2
  33. package/dist/hooks/auto-update-checker/index.d.ts +1 -1
  34. package/dist/hooks/interactive-bash-session/parser.d.ts +0 -6
  35. package/dist/index.js +1824 -539
  36. package/dist/shared/index.d.ts +1 -0
  37. package/dist/shared/model-resolution-pipeline.d.ts +1 -24
  38. package/dist/shared/model-resolution-types.d.ts +1 -0
  39. package/dist/shared/model-resolver.d.ts +4 -2
  40. package/dist/shared/opencode-config-dir.d.ts +1 -2
  41. package/dist/shared/session-directory-resolver.d.ts +0 -6
  42. package/dist/shared/tool-guards.d.ts +16 -0
  43. package/dist/tools/assembly/assembly-executor.d.ts +17 -0
  44. package/dist/tools/assembly/constants.d.ts +6 -0
  45. package/dist/tools/assembly/index.d.ts +2 -0
  46. package/dist/tools/assembly/provider-selector.d.ts +3 -0
  47. package/dist/tools/assembly/synthesizer.d.ts +3 -0
  48. package/dist/tools/assembly/tool-description.d.ts +2 -0
  49. package/dist/tools/assembly/tools.d.ts +10 -0
  50. package/dist/tools/assembly/types.d.ts +25 -0
  51. package/dist/tools/assembly/voter-spawner.d.ts +3 -0
  52. package/dist/tools/handoff/constants.d.ts +0 -3
  53. package/dist/tools/index.d.ts +1 -0
  54. package/package.json +4 -29
  55. package/bin/matrixx.js +0 -80
  56. package/bin/platform.js +0 -38
  57. package/bin/platform.test.ts +0 -148
  58. package/dist/cli/cli-installer.d.ts +0 -2
  59. package/dist/cli/cli-program.d.ts +0 -1
  60. package/dist/cli/config-manager/add-plugin-to-opencode-config.d.ts +0 -2
  61. package/dist/cli/config-manager/add-provider-config.d.ts +0 -2
  62. package/dist/cli/config-manager/antigravity-provider-configuration.d.ts +0 -122
  63. package/dist/cli/config-manager/auth-plugins.d.ts +0 -3
  64. package/dist/cli/config-manager/bun-install.d.ts +0 -7
  65. package/dist/cli/config-manager/config-context.d.ts +0 -13
  66. package/dist/cli/config-manager/deep-merge-record.d.ts +0 -1
  67. package/dist/cli/config-manager/detect-current-config.d.ts +0 -2
  68. package/dist/cli/config-manager/ensure-config-directory-exists.d.ts +0 -1
  69. package/dist/cli/config-manager/format-error-with-suggestion.d.ts +0 -1
  70. package/dist/cli/config-manager/generate-matrixx-config.d.ts +0 -2
  71. package/dist/cli/config-manager/jsonc-provider-editor.d.ts +0 -1
  72. package/dist/cli/config-manager/npm-dist-tags.d.ts +0 -7
  73. package/dist/cli/config-manager/opencode-binary.d.ts +0 -2
  74. package/dist/cli/config-manager/opencode-config-format.d.ts +0 -6
  75. package/dist/cli/config-manager/parse-opencode-config-file.d.ts +0 -10
  76. package/dist/cli/config-manager/plugin-name-with-version.d.ts +0 -1
  77. package/dist/cli/config-manager/write-matrixx-config.d.ts +0 -2
  78. package/dist/cli/config-manager.d.ts +0 -14
  79. package/dist/cli/doctor/checks/config.d.ts +0 -2
  80. package/dist/cli/doctor/checks/dependencies.d.ts +0 -4
  81. package/dist/cli/doctor/checks/index.d.ts +0 -7
  82. package/dist/cli/doctor/checks/model-resolution-cache.d.ts +0 -2
  83. package/dist/cli/doctor/checks/model-resolution-config.d.ts +0 -2
  84. package/dist/cli/doctor/checks/model-resolution-details.d.ts +0 -6
  85. package/dist/cli/doctor/checks/model-resolution-effective-model.d.ts +0 -3
  86. package/dist/cli/doctor/checks/model-resolution-types.d.ts +0 -37
  87. package/dist/cli/doctor/checks/model-resolution-variant.d.ts +0 -5
  88. package/dist/cli/doctor/checks/model-resolution.d.ts +0 -6
  89. package/dist/cli/doctor/checks/system-binary.d.ts +0 -8
  90. package/dist/cli/doctor/checks/system-loaded-version.d.ts +0 -10
  91. package/dist/cli/doctor/checks/system-plugin.d.ts +0 -15
  92. package/dist/cli/doctor/checks/system.d.ts +0 -3
  93. package/dist/cli/doctor/checks/tools-gh.d.ts +0 -11
  94. package/dist/cli/doctor/checks/tools-lsp.d.ts +0 -6
  95. package/dist/cli/doctor/checks/tools-mcp.d.ts +0 -3
  96. package/dist/cli/doctor/checks/tools.d.ts +0 -3
  97. package/dist/cli/doctor/constants.d.ts +0 -31
  98. package/dist/cli/doctor/format-default.d.ts +0 -2
  99. package/dist/cli/doctor/format-shared.d.ts +0 -6
  100. package/dist/cli/doctor/format-status.d.ts +0 -2
  101. package/dist/cli/doctor/format-verbose.d.ts +0 -2
  102. package/dist/cli/doctor/formatter.d.ts +0 -3
  103. package/dist/cli/doctor/index.d.ts +0 -5
  104. package/dist/cli/doctor/runner.d.ts +0 -5
  105. package/dist/cli/doctor/types.d.ts +0 -96
  106. package/dist/cli/fallback-chain-resolution.d.ts +0 -10
  107. package/dist/cli/get-local-version/formatter.d.ts +0 -3
  108. package/dist/cli/get-local-version/get-local-version.d.ts +0 -2
  109. package/dist/cli/get-local-version/index.d.ts +0 -2
  110. package/dist/cli/get-local-version/types.d.ts +0 -13
  111. package/dist/cli/index.d.ts +0 -2
  112. package/dist/cli/index.js +0 -30691
  113. package/dist/cli/install-validators.d.ts +0 -31
  114. package/dist/cli/install.d.ts +0 -2
  115. package/dist/cli/mcp-oauth/index.d.ts +0 -6
  116. package/dist/cli/mcp-oauth/login.d.ts +0 -7
  117. package/dist/cli/mcp-oauth/logout.d.ts +0 -5
  118. package/dist/cli/mcp-oauth/status.d.ts +0 -1
  119. package/dist/cli/model-fallback-types.d.ts +0 -25
  120. package/dist/cli/model-fallback.d.ts +0 -4
  121. package/dist/cli/provider-availability.d.ts +0 -4
  122. package/dist/cli/provider-model-id-transform.d.ts +0 -1
  123. package/dist/cli/run/agent-resolver.d.ts +0 -5
  124. package/dist/cli/run/completion.d.ts +0 -2
  125. package/dist/cli/run/event-formatting.d.ts +0 -3
  126. package/dist/cli/run/event-handlers.d.ts +0 -10
  127. package/dist/cli/run/event-state.d.ts +0 -13
  128. package/dist/cli/run/event-stream-processor.d.ts +0 -3
  129. package/dist/cli/run/events.d.ts +0 -4
  130. package/dist/cli/run/index.d.ts +0 -9
  131. package/dist/cli/run/json-output.d.ts +0 -12
  132. package/dist/cli/run/on-complete-hook.d.ts +0 -7
  133. package/dist/cli/run/opencode-bin-path.d.ts +0 -3
  134. package/dist/cli/run/opencode-binary-resolver.d.ts +0 -4
  135. package/dist/cli/run/poll-for-completion.d.ts +0 -9
  136. package/dist/cli/run/runner.d.ts +0 -5
  137. package/dist/cli/run/server-connection.d.ts +0 -6
  138. package/dist/cli/run/session-resolver.d.ts +0 -6
  139. package/dist/cli/run/types.d.ts +0 -119
  140. package/dist/cli/tui-install-prompts.d.ts +0 -2
  141. package/dist/cli/tui-installer.d.ts +0 -2
  142. package/dist/cli/types.d.ts +0 -36
  143. package/dist/features/background-agent/background-task-notification-template.d.ts +0 -11
  144. package/dist/features/background-agent/opencode-client.d.ts +0 -2
  145. package/dist/features/background-agent/task-poller.d.ts +0 -21
  146. package/dist/features/claude-tasks/index.d.ts +0 -3
  147. package/dist/features/claude-tasks/session-storage.d.ts +0 -10
  148. package/dist/features/mcp-oauth/index.d.ts +0 -3
  149. package/dist/features/mcp-oauth/schema.d.ts +0 -5
  150. package/dist/features/run-continuation-state/constants.d.ts +0 -1
  151. package/dist/features/run-continuation-state/index.d.ts +0 -3
  152. package/dist/features/run-continuation-state/storage.d.ts +0 -6
  153. package/dist/features/run-continuation-state/types.d.ts +0 -13
  154. package/dist/features/tmux-subagent/cleanup.d.ts +0 -1
  155. package/dist/features/tmux-subagent/polling.d.ts +0 -1
  156. package/dist/hooks/session-recovery/recover-empty-content-message-sdk.d.ts +0 -13
  157. package/dist/hooks/task-reminder/hook.d.ts +0 -19
  158. package/dist/hooks/task-reminder/index.d.ts +0 -1
  159. package/dist/tools/delegate-agent/background-agent-executor.d.ts +0 -5
  160. package/dist/tools/delegate-agent/message-storage-directory.d.ts +0 -1
  161. package/dist/tools/delegate-agent/subagent-session-creator.d.ts +0 -10
  162. package/dist/tools/delegate-agent/tool-context-with-metadata.d.ts +0 -10
  163. package/postinstall.mjs +0 -43
@@ -45,6 +45,7 @@ export * from "./shell-env";
45
45
  export * from "./system-directive";
46
46
  export * from "./tmux";
47
47
  export * from "./token-cache";
48
+ export * from "./tool-guards";
48
49
  export * from "./transcript-path";
49
50
  export * from "./truncate-description";
50
51
  export * from "./zip-extractor";
@@ -1,25 +1,2 @@
1
- import type { FallbackEntry } from "./model-requirements";
2
- export type ModelResolutionRequest = {
3
- intent?: {
4
- uiSelectedModel?: string;
5
- userModel?: string;
6
- categoryDefaultModel?: string;
7
- };
8
- constraints: {
9
- availableModels: Set<string>;
10
- connectedProviders?: string[] | null;
11
- };
12
- policy?: {
13
- fallbackChain?: FallbackEntry[];
14
- systemDefaultModel?: string;
15
- };
16
- };
17
- export type ModelResolutionProvenance = "override" | "category-default" | "provider-fallback" | "system-default";
18
- export type ModelResolutionResult = {
19
- model: string;
20
- provenance: ModelResolutionProvenance;
21
- variant?: string;
22
- attempted?: string[];
23
- reason?: string;
24
- };
1
+ import type { ModelResolutionRequest, ModelResolutionResult } from "./model-resolution-types";
25
2
  export declare function resolveModelPipeline(request: ModelResolutionRequest): ModelResolutionResult | undefined;
@@ -7,6 +7,7 @@ export type ModelResolutionRequest = {
7
7
  };
8
8
  constraints: {
9
9
  availableModels: Set<string>;
10
+ connectedProviders?: string[];
10
11
  };
11
12
  policy?: {
12
13
  fallbackChain?: FallbackEntry[];
@@ -1,13 +1,15 @@
1
1
  import type { FallbackEntry } from "./model-requirements";
2
+ import type { ModelResolutionProvenance } from "./model-resolution-types";
2
3
  export type ModelResolutionInput = {
3
4
  userModel?: string;
4
5
  inheritedModel?: string;
5
6
  systemDefault?: string;
6
7
  };
7
- export type ModelSource = "override" | "category-default" | "provider-fallback" | "system-default";
8
+ /** @deprecated Use ModelResolutionProvenance from model-resolution-types.ts */
9
+ export type ModelSource = ModelResolutionProvenance;
8
10
  export type ModelResolutionResult = {
9
11
  model: string;
10
- source: ModelSource;
12
+ source: ModelResolutionProvenance;
11
13
  variant?: string;
12
14
  };
13
15
  export type ExtendedModelResolutionInput = {
@@ -1,8 +1,7 @@
1
- import type { OpenCodeBinaryType, OpenCodeConfigDirOptions, OpenCodeConfigPaths } from "./opencode-config-dir-types";
1
+ import type { OpenCodeConfigDirOptions, OpenCodeConfigPaths } from "./opencode-config-dir-types";
2
2
  export type { OpenCodeBinaryType, OpenCodeConfigDirOptions, OpenCodeConfigPaths, } from "./opencode-config-dir-types";
3
3
  export declare const TAURI_APP_IDENTIFIER = "ai.opencode.desktop";
4
4
  export declare const TAURI_APP_IDENTIFIER_DEV = "ai.opencode.desktop.dev";
5
5
  export declare function isDevBuild(version: string | null | undefined): boolean;
6
6
  export declare function getOpenCodeConfigDir(options: OpenCodeConfigDirOptions): string;
7
7
  export declare function getOpenCodeConfigPaths(options: OpenCodeConfigDirOptions): OpenCodeConfigPaths;
8
- export declare function detectExistingConfigDir(binary: OpenCodeBinaryType, version?: string | null): string | null;
@@ -1,7 +1 @@
1
1
  export declare function isWindowsAppDataDirectory(directory: string): boolean;
2
- export declare function resolveSessionDirectory(options: {
3
- parentDirectory: string | null | undefined;
4
- fallbackDirectory: string;
5
- platform?: NodeJS.Platform;
6
- currentWorkingDirectory?: string;
7
- }): string;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Shared tool name guard functions.
3
+ * Used by multiple hooks to check tool types (read/write).
4
+ */
5
+ /**
6
+ * Check if a tool name represents a read operation.
7
+ * @param toolName - The tool name to check (case-insensitive)
8
+ * @returns true if the tool is a read tool
9
+ */
10
+ export declare function isReadTool(toolName: string): boolean;
11
+ /**
12
+ * Check if a tool name represents a write operation.
13
+ * @param toolName - The tool name to check (case-insensitive)
14
+ * @returns true if the tool is a write tool
15
+ */
16
+ export declare function isWriteTool(toolName: string): boolean;
@@ -0,0 +1,17 @@
1
+ import type { AssemblyConfig } from "../../config/schema/assembly";
2
+ import type { BackgroundManager } from "../../features/background-agent/manager";
3
+ import type { AssemblyArgs, SynthesisResult, VoterResult } from "./types";
4
+ export interface AssemblyExecutorInput {
5
+ manager: BackgroundManager;
6
+ args: AssemblyArgs;
7
+ config: AssemblyConfig | undefined;
8
+ sessionID: string;
9
+ messageID: string;
10
+ }
11
+ export interface AssemblyOutput {
12
+ question: string;
13
+ voters: VoterResult[];
14
+ rounds: SynthesisResult[];
15
+ finalConsensus: string;
16
+ }
17
+ export declare function executeAssembly(input: AssemblyExecutorInput): Promise<AssemblyOutput>;
@@ -0,0 +1,6 @@
1
+ import type { ProviderModel } from "./types";
2
+ export declare const DEFAULT_VOTERS = 3;
3
+ export declare const DEFAULT_ROUNDS = 2;
4
+ export declare const VOTER_TIMEOUT_MS = 120000;
5
+ export declare const POLL_INTERVAL_MS = 1000;
6
+ export declare const DEFAULT_PROVIDERS: ProviderModel[];
@@ -0,0 +1,2 @@
1
+ export type { AssemblyToolOptions } from "./tools";
2
+ export { createAssemblyTool } from "./tools";
@@ -0,0 +1,3 @@
1
+ import type { AssemblyConfig } from "../../config/schema/assembly";
2
+ import type { ProviderModel } from "./types";
3
+ export declare function selectProviders(count: number, modelsOverride: string[] | undefined, config: AssemblyConfig | undefined): ProviderModel[];
@@ -0,0 +1,3 @@
1
+ import type { BackgroundManager } from "../../features/background-agent/manager";
2
+ import type { SynthesisResult, VoterResult } from "./types";
3
+ export declare function synthesizeResults(manager: BackgroundManager, question: string, voterResults: VoterResult[], round: number, parentSessionID: string, parentMessageID: string): Promise<SynthesisResult>;
@@ -0,0 +1,2 @@
1
+ /** Assembly tool description for LLM consumption */
2
+ export declare const TOOL_DESCRIPTION = "\nSpawns multiple AI agents (voters) with different model providers to independently analyze a question or decision, then synthesizes their reasoning into a unified consensus.\n\n## When to use\n- Making critical decisions that benefit from multiple perspectives\n- Evaluating complex tradeoffs where bias reduction matters\n- Validating architectural choices through multi-model reasoning\n- When you need confidence scoring on analysis\n\n## How it works\n1. **Voter selection**: Auto-selects N models from configured providers (or use your override)\n2. **Independent voting**: Each voter independently analyzes the question\n3. **Synthesis**: All voter outputs are fed to a synthesis round that identifies agreement, disagreement, and confidence\n4. **Multi-round**: Optionally repeat synthesis for deeper convergence\n\n## Output format\nReturns a structured consensus with:\n- Unified answer/conclusion\n- Confidence level (high/medium/low)\n- Key disagreements between voters\n- Per-voter reasoning traces\n";
@@ -0,0 +1,10 @@
1
+ import { type ToolDefinition } from "@opencode-ai/plugin";
2
+ import type { AssemblyConfig } from "../../config/schema/assembly";
3
+ import type { BackgroundManager } from "../../features/background-agent/manager";
4
+ export interface AssemblyToolOptions {
5
+ manager: BackgroundManager;
6
+ pluginConfig?: {
7
+ assembly?: AssemblyConfig;
8
+ };
9
+ }
10
+ export declare function createAssemblyTool(options: AssemblyToolOptions): ToolDefinition;
@@ -0,0 +1,25 @@
1
+ import { z } from "zod";
2
+ export declare const AssemblyArgsSchema: z.ZodObject<{
3
+ question: z.ZodString;
4
+ voters: z.ZodOptional<z.ZodNumber>;
5
+ rounds: z.ZodOptional<z.ZodNumber>;
6
+ models: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
+ }, z.core.$strip>;
8
+ export type AssemblyArgs = z.infer<typeof AssemblyArgsSchema>;
9
+ export interface VoterResult {
10
+ voterIndex: number;
11
+ modelLabel: string;
12
+ reasoning: string;
13
+ status: "completed" | "error" | "timeout";
14
+ error?: string;
15
+ }
16
+ export interface SynthesisResult {
17
+ round: number;
18
+ consensus: string;
19
+ confidence: "high" | "medium" | "low";
20
+ disagreements: string[];
21
+ }
22
+ export interface ProviderModel {
23
+ providerID: string;
24
+ modelID: string;
25
+ }
@@ -0,0 +1,3 @@
1
+ import type { BackgroundManager } from "../../features/background-agent/manager";
2
+ import type { ProviderModel, VoterResult } from "./types";
3
+ export declare function spawnVoters(manager: BackgroundManager, question: string, providers: ProviderModel[], parentSessionID: string, parentMessageID: string): Promise<VoterResult[]>;
@@ -12,6 +12,3 @@ export declare const MAX_GIT_OUTPUT_BYTES = 4096;
12
12
  export declare const GIT_COMMAND_TIMEOUT_MS = 5000;
13
13
  /** Sentinel used when we cannot resolve git metadata for the working dir. */
14
14
  export declare const UNKNOWN_GIT_SHA = "unknown";
15
- /** Canonical list of supported actions (kept in sync with the zod enum). */
16
- export declare const HANDOFF_ACTIONS: readonly ["create", "read", "list", "archive"];
17
- export type HandoffAction = (typeof HANDOFF_ACTIONS)[number];
@@ -13,6 +13,7 @@ export { lspManager };
13
13
  import type { PluginInput, ToolDefinition } from "@opencode-ai/plugin";
14
14
  import type { BackgroundManager } from "../features/background-agent";
15
15
  type OpencodeClient = PluginInput["client"];
16
+ export { createAssemblyTool } from "./assembly";
16
17
  export { createDelegateAgent } from "./delegate-agent";
17
18
  export { createDelegateTask } from "./delegate-task";
18
19
  export { createHashlineEditTool } from "./hashline-edit";
package/package.json CHANGED
@@ -1,17 +1,12 @@
1
1
  {
2
2
  "name": "opencode-matrixx",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
8
- "bin": {
9
- "matrixx": "./bin/matrixx.js"
10
- },
11
8
  "files": [
12
- "dist",
13
- "bin",
14
- "postinstall.mjs"
9
+ "dist"
15
10
  ],
16
11
  "exports": {
17
12
  ".": {
@@ -21,12 +16,9 @@
21
16
  "./schema.json": "./dist/matrixx.schema.json"
22
17
  },
23
18
  "scripts": {
24
- "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun build src/cli/index.ts --outdir dist/cli --target bun --format esm --external @ast-grep/napi && bun run build:schema",
25
- "build:all": "bun run build && bun run build:binaries",
26
- "build:binaries": "bun run script/build-binaries.ts",
19
+ "build": "bun build src/index.ts --outdir dist --target bun --format esm --external @ast-grep/napi && tsc --emitDeclarationOnly && bun run build:schema",
27
20
  "build:schema": "bun run script/build-schema.ts",
28
21
  "clean": "rm -rf dist",
29
- "postinstall": "node postinstall.mjs",
30
22
  "prepublishOnly": "bun run clean && bun run build",
31
23
  "typecheck": "tsc --noEmit",
32
24
  "lint": "biome check src/",
@@ -51,10 +43,7 @@
51
43
  "vibe-coding",
52
44
  "agentic",
53
45
  "autonomous-agents",
54
- "developer-tools",
55
- "typescript",
56
- "plugin",
57
- "cli"
46
+ "plugin"
58
47
  ],
59
48
  "author": "klpanagi",
60
49
  "license": "SUL-1.0",
@@ -69,17 +58,12 @@
69
58
  "dependencies": {
70
59
  "@ast-grep/cli": "^0.40.0",
71
60
  "@ast-grep/napi": "^0.40.0",
72
- "@clack/prompts": "^0.11.0",
73
61
  "@code-yeongyu/comment-checker": "^0.6.1",
74
62
  "@modelcontextprotocol/sdk": "^1.25.1",
75
63
  "@opencode-ai/plugin": "1.3.15",
76
64
  "@opencode-ai/sdk": "1.3.15",
77
- "commander": "^14.0.2",
78
- "detect-libc": "^2.0.0",
79
65
  "js-yaml": "^4.1.1",
80
66
  "jsonc-parser": "^3.3.1",
81
- "opencode-matrixx": ".",
82
- "picocolors": "^1.1.1",
83
67
  "picomatch": "^4.0.2",
84
68
  "vscode-jsonrpc": "^8.2.0",
85
69
  "zod": "^4.1.8"
@@ -91,15 +75,6 @@
91
75
  "bun-types": "1.3.6",
92
76
  "typescript": "^5.7.3"
93
77
  },
94
- "optionalDependencies": {
95
- "opencode-matrixx-darwin-arm64": "2.1.0",
96
- "opencode-matrixx-darwin-x64": "2.1.0",
97
- "opencode-matrixx-linux-arm64": "2.1.0",
98
- "opencode-matrixx-linux-arm64-musl": "2.1.0",
99
- "opencode-matrixx-linux-x64": "2.1.0",
100
- "opencode-matrixx-linux-x64-musl": "2.1.0",
101
- "opencode-matrixx-windows-x64": "2.1.0"
102
- },
103
78
  "trustedDependencies": [
104
79
  "@ast-grep/cli",
105
80
  "@ast-grep/napi",
package/bin/matrixx.js DELETED
@@ -1,80 +0,0 @@
1
- #!/usr/bin/env node
2
- // bin/matrixx.js
3
- // Wrapper script that detects platform and spawns the correct binary
4
-
5
- import { spawnSync } from "node:child_process";
6
- import { createRequire } from "node:module";
7
- import { getPlatformPackage, getBinaryPath } from "./platform.js";
8
-
9
- const require = createRequire(import.meta.url);
10
-
11
- /**
12
- * Detect libc family on Linux
13
- * @returns {string | null} 'glibc', 'musl', or null if detection fails
14
- */
15
- function getLibcFamily() {
16
- if (process.platform !== "linux") {
17
- return undefined; // Not needed on non-Linux
18
- }
19
-
20
- try {
21
- const detectLibc = require("detect-libc");
22
- return detectLibc.familySync();
23
- } catch {
24
- // detect-libc not available
25
- return null;
26
- }
27
- }
28
-
29
- function main() {
30
- const { platform, arch } = process;
31
- const libcFamily = getLibcFamily();
32
-
33
- // Get platform package name
34
- let pkg;
35
- try {
36
- pkg = getPlatformPackage({ platform, arch, libcFamily });
37
- } catch (error) {
38
- console.error(`\nmatrixx: ${error.message}\n`);
39
- process.exit(1);
40
- }
41
-
42
- // Resolve binary path
43
- const binRelPath = getBinaryPath(pkg, platform);
44
-
45
- let binPath;
46
- try {
47
- binPath = require.resolve(binRelPath);
48
- } catch {
49
- console.error(`\nmatrixx: Platform binary not installed.`);
50
- console.error(`\nYour platform: ${platform}-${arch}${libcFamily === "musl" ? "-musl" : ""}`);
51
- console.error(`Expected package: ${pkg}`);
52
- console.error(`\nTo fix, run:`);
53
- console.error(` npm install ${pkg}\n`);
54
- process.exit(1);
55
- }
56
-
57
- // Spawn the binary
58
- const result = spawnSync(binPath, process.argv.slice(2), {
59
- stdio: "inherit",
60
- });
61
-
62
- // Handle spawn errors
63
- if (result.error) {
64
- console.error(`\nmatrixx: Failed to execute binary.`);
65
- console.error(`Error: ${result.error.message}\n`);
66
- process.exit(2);
67
- }
68
-
69
- // Handle signals
70
- if (result.signal) {
71
- const signalNum = result.signal === "SIGTERM" ? 15 :
72
- result.signal === "SIGKILL" ? 9 :
73
- result.signal === "SIGINT" ? 2 : 1;
74
- process.exit(128 + signalNum);
75
- }
76
-
77
- process.exit(result.status ?? 1);
78
- }
79
-
80
- main();
package/bin/platform.js DELETED
@@ -1,38 +0,0 @@
1
- // bin/platform.js
2
- // Shared platform detection module - used by wrapper and postinstall
3
-
4
- /**
5
- * Get the platform-specific package name
6
- * @param {{ platform: string, arch: string, libcFamily?: string | null }} options
7
- * @returns {string} Package name like "opencode-matrixx-darwin-arm64"
8
- * @throws {Error} If libc cannot be detected on Linux
9
- */
10
- export function getPlatformPackage({ platform, arch, libcFamily }) {
11
- let suffix = "";
12
- if (platform === "linux") {
13
- if (libcFamily === null || libcFamily === undefined) {
14
- throw new Error(
15
- "Could not detect libc on Linux. " +
16
- "Please ensure detect-libc is installed or report this issue."
17
- );
18
- }
19
- if (libcFamily === "musl") {
20
- suffix = "-musl";
21
- }
22
- }
23
-
24
- // Map platform names: win32 -> windows (for package name)
25
- const os = platform === "win32" ? "windows" : platform;
26
- return `opencode-matrixx-${os}-${arch}${suffix}`;
27
- }
28
-
29
- /**
30
- * Get the path to the binary within a platform package
31
- * @param {string} pkg Package name
32
- * @param {string} platform Process platform
33
- * @returns {string} Relative path like "opencode-matrixx-darwin-arm64/bin/matrixx"
34
- */
35
- export function getBinaryPath(pkg, platform) {
36
- const ext = platform === "win32" ? ".exe" : "";
37
- return `${pkg}/bin/matrixx${ext}`;
38
- }
@@ -1,148 +0,0 @@
1
- // bin/platform.test.ts
2
- import { describe, expect, test } from "bun:test";
3
- import { getPlatformPackage, getBinaryPath } from "./platform.js";
4
-
5
- describe("getPlatformPackage", () => {
6
- // #region Darwin platforms
7
- test("returns darwin-arm64 for macOS ARM64", () => {
8
- // #given macOS ARM64 platform
9
- const input = { platform: "darwin", arch: "arm64" };
10
-
11
- // #when getting platform package
12
- const result = getPlatformPackage(input);
13
-
14
- // #then returns correct package name
15
- expect(result).toBe("opencode-matrixx-darwin-arm64");
16
- });
17
-
18
- test("returns darwin-x64 for macOS Intel", () => {
19
- // #given macOS x64 platform
20
- const input = { platform: "darwin", arch: "x64" };
21
-
22
- // #when getting platform package
23
- const result = getPlatformPackage(input);
24
-
25
- // #then returns correct package name
26
- expect(result).toBe("opencode-matrixx-darwin-x64");
27
- });
28
- // #endregion
29
-
30
- // #region Linux glibc platforms
31
- test("returns linux-x64 for Linux x64 with glibc", () => {
32
- // #given Linux x64 with glibc
33
- const input = { platform: "linux", arch: "x64", libcFamily: "glibc" };
34
-
35
- // #when getting platform package
36
- const result = getPlatformPackage(input);
37
-
38
- // #then returns correct package name
39
- expect(result).toBe("opencode-matrixx-linux-x64");
40
- });
41
-
42
- test("returns linux-arm64 for Linux ARM64 with glibc", () => {
43
- // #given Linux ARM64 with glibc
44
- const input = { platform: "linux", arch: "arm64", libcFamily: "glibc" };
45
-
46
- // #when getting platform package
47
- const result = getPlatformPackage(input);
48
-
49
- // #then returns correct package name
50
- expect(result).toBe("opencode-matrixx-linux-arm64");
51
- });
52
- // #endregion
53
-
54
- // #region Linux musl platforms
55
- test("returns linux-x64-musl for Alpine x64", () => {
56
- // #given Linux x64 with musl (Alpine)
57
- const input = { platform: "linux", arch: "x64", libcFamily: "musl" };
58
-
59
- // #when getting platform package
60
- const result = getPlatformPackage(input);
61
-
62
- // #then returns correct package name with musl suffix
63
- expect(result).toBe("opencode-matrixx-linux-x64-musl");
64
- });
65
-
66
- test("returns linux-arm64-musl for Alpine ARM64", () => {
67
- // #given Linux ARM64 with musl (Alpine)
68
- const input = { platform: "linux", arch: "arm64", libcFamily: "musl" };
69
-
70
- // #when getting platform package
71
- const result = getPlatformPackage(input);
72
-
73
- // #then returns correct package name with musl suffix
74
- expect(result).toBe("opencode-matrixx-linux-arm64-musl");
75
- });
76
- // #endregion
77
-
78
- // #region Windows platform
79
- test("returns windows-x64 for Windows", () => {
80
- // #given Windows x64 platform (win32 is Node's platform name)
81
- const input = { platform: "win32", arch: "x64" };
82
-
83
- // #when getting platform package
84
- const result = getPlatformPackage(input);
85
-
86
- // #then returns correct package name with 'windows' not 'win32'
87
- expect(result).toBe("opencode-matrixx-windows-x64");
88
- });
89
- // #endregion
90
-
91
- // #region Error cases
92
- test("throws error for Linux with null libcFamily", () => {
93
- // #given Linux platform with null libc detection
94
- const input = { platform: "linux", arch: "x64", libcFamily: null };
95
-
96
- // #when getting platform package
97
- // #then throws descriptive error
98
- expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
99
- });
100
-
101
- test("throws error for Linux with undefined libcFamily", () => {
102
- // #given Linux platform with undefined libc
103
- const input = { platform: "linux", arch: "x64", libcFamily: undefined };
104
-
105
- // #when getting platform package
106
- // #then throws descriptive error
107
- expect(() => getPlatformPackage(input)).toThrow("Could not detect libc");
108
- });
109
- // #endregion
110
- });
111
-
112
- describe("getBinaryPath", () => {
113
- test("returns path without .exe for Unix platforms", () => {
114
- // #given Unix platform package
115
- const pkg = "opencode-matrixx-darwin-arm64";
116
- const platform = "darwin";
117
-
118
- // #when getting binary path
119
- const result = getBinaryPath(pkg, platform);
120
-
121
- // #then returns path without extension
122
- expect(result).toBe("opencode-matrixx-darwin-arm64/bin/matrixx");
123
- });
124
-
125
- test("returns path with .exe for Windows", () => {
126
- // #given Windows platform package
127
- const pkg = "opencode-matrixx-windows-x64";
128
- const platform = "win32";
129
-
130
- // #when getting binary path
131
- const result = getBinaryPath(pkg, platform);
132
-
133
- // #then returns path with .exe extension
134
- expect(result).toBe("opencode-matrixx-windows-x64/bin/matrixx.exe");
135
- });
136
-
137
- test("returns path without .exe for Linux", () => {
138
- // #given Linux platform package
139
- const pkg = "opencode-matrixx-linux-x64";
140
- const platform = "linux";
141
-
142
- // #when getting binary path
143
- const result = getBinaryPath(pkg, platform);
144
-
145
- // #then returns path without extension
146
- expect(result).toBe("opencode-matrixx-linux-x64/bin/matrixx");
147
- });
148
- });
@@ -1,2 +0,0 @@
1
- import type { InstallArgs } from "./types";
2
- export declare function runCliInstaller(args: InstallArgs, version: string): Promise<number>;
@@ -1 +0,0 @@
1
- export declare function runCli(): void;
@@ -1,2 +0,0 @@
1
- import type { ConfigMergeResult } from "../types";
2
- export declare function addPluginToOpenCodeConfig(currentVersion: string): Promise<ConfigMergeResult>;
@@ -1,2 +0,0 @@
1
- import type { ConfigMergeResult, InstallConfig } from "../types";
2
- export declare function addProviderConfig(config: InstallConfig): ConfigMergeResult;