opencode-ultra 0.6.1 → 0.6.3

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/config.d.ts CHANGED
@@ -69,6 +69,10 @@ declare const PluginConfigSchema: z.ZodObject<{
69
69
  maxEnforcements: z.ZodOptional<z.ZodNumber>;
70
70
  }, z.core.$strip>>;
71
71
  mcp_api_keys: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
72
+ safety: z.ZodOptional<z.ZodObject<{
73
+ maxTotalSpawned: z.ZodOptional<z.ZodNumber>;
74
+ agentTimeoutMs: z.ZodOptional<z.ZodNumber>;
75
+ }, z.core.$strip>>;
72
76
  }, z.core.$loose>;
73
77
  export type PluginConfig = z.infer<typeof PluginConfigSchema>;
74
78
  export declare function parsePluginConfig(raw: unknown): PluginConfig;
package/dist/index.js CHANGED
@@ -14923,71 +14923,86 @@ SYNTHESIZE findings before proceeding.`;
14923
14923
  var THINK_MESSAGE = `Extended thinking enabled. Take your time to reason thoroughly.`;
14924
14924
  var EVOLVE_MESSAGE = `[evolve-mode] SELF-IMPROVEMENT CYCLE ACTIVATED.
14925
14925
 
14926
+ ## CRITICAL PATH: opencode-ultra source location
14927
+ opencode-ultra is INSTALLED as a plugin. Its source is at:
14928
+ **~/.cache/opencode/node_modules/opencode-ultra/**
14929
+ NOT in the working directory. You must read from this path.
14930
+
14926
14931
  ## MISSION
14927
- Discover what other OpenCode plugins do well, compare with opencode-ultra's current capabilities, and propose concrete improvements to opencode-ultra itself.
14932
+ Compare opencode-ultra's ACTUAL current capabilities (read from source) with other OpenCode plugins, then propose concrete improvements.
14928
14933
 
14929
14934
  This is NOT about installing other plugins. This is about LEARNING from the ecosystem and making opencode-ultra better.
14930
14935
 
14931
- ## TOOLS AVAILABLE
14932
- - **spawn_agent** \u2014 run scout + explore agents in parallel for data gathering
14933
- - **ledger_save** \u2014 persist improvement proposals for future implementation
14936
+ ## PHASE 1: SELF-ANALYSIS (DO THIS FIRST \u2014 before anything else)
14937
+
14938
+ Before researching other plugins, you MUST understand what opencode-ultra already has.
14939
+ Read these files yourself using Read/Grep/Glob (do NOT spawn an agent for this \u2014 you can read directly):
14940
+
14941
+ 1. ~/.cache/opencode/node_modules/opencode-ultra/README.md
14942
+ 2. ~/.cache/opencode/node_modules/opencode-ultra/dist/index.js (search for tool names, hook names)
14943
+
14944
+ Or use Glob to list: ~/.cache/opencode/node_modules/opencode-ultra/**/*.ts
14945
+
14946
+ From the README and source, build this inventory:
14947
+ - Tools provided: (list each tool name and what it does)
14948
+ - Hooks used: (list each hook and its purpose)
14949
+ - Agents defined: (list each agent, its model, its role)
14950
+ - Safety features: (sanitizer, trust score, spawn limits, etc.)
14951
+ - Other features: (concurrency, categories, keyword detection, etc.)
14952
+
14953
+ **STOP and verify**: You must have a concrete capability list before proceeding. If you cannot read the files, try: ls ~/.cache/opencode/node_modules/opencode-ultra/
14954
+
14955
+ ## PHASE 2: ECOSYSTEM RESEARCH (parallel with spawn_agent)
14934
14956
 
14935
- ## PHASE 1: GATHER (parallel)
14957
+ Now research what other plugins offer:
14936
14958
  \`\`\`
14937
14959
  spawn_agent({
14938
14960
  agents: [
14939
- {agent: "scout", prompt: "Search npm and GitHub for OpenCode 1.2.x plugins. For EACH plugin, analyze: what features does it provide? What hooks, tools, or techniques does it use? Focus on UNIQUE capabilities that are genuinely useful. Return a structured feature inventory per plugin.", description: "Ecosystem feature scan"},
14940
- {agent: "explore", prompt: "Read opencode-ultra's source: src/index.ts, src/tools/*.ts, src/hooks/*.ts, src/safety/*.ts, src/agents/index.ts, README.md. Catalog every feature, tool, hook, and capability. Be exhaustive.", description: "Self-analysis"}
14961
+ {agent: "scout", prompt: "Search npm and GitHub for OpenCode 1.2.x plugins. For EACH interesting plugin: what features does it provide? What hooks, tools, or techniques does it use? Focus on UNIQUE capabilities. Return a structured feature inventory per plugin.", description: "Ecosystem scan"},
14962
+ {agent: "librarian", prompt: "Search for OpenCode plugin best practices, architectural patterns, and advanced techniques. Look at oh-my-opencode, opencode-supermemory, opencode-dcp, opencode-rate-limit-fallback, opencode-worktree, opencode-mad. What patterns do they share? What's unique?", description: "Plugin patterns research"}
14941
14963
  ]
14942
14964
  })
14943
14965
  \`\`\`
14944
14966
 
14945
- ## PHASE 2: COMPARE
14946
- After gathering results, build a structured gap analysis:
14967
+ ## PHASE 3: COMPARE
14968
+
14969
+ Build a Feature Matrix using YOUR self-analysis (Phase 1) and agent results (Phase 2).
14970
+
14971
+ **RULE**: The "opencode-ultra" column MUST contain Yes/No/Partial with the specific file or feature name. NEVER write "TBD", "unknown", or "\u4E0D\u660E". You read the source yourself \u2014 you know the answer.
14947
14972
 
14948
- ### Feature Matrix
14949
14973
  | Feature | opencode-ultra | Other plugin(s) | Gap? |
14950
14974
  |---------|---------------|-----------------|------|
14951
- | (feature) | Yes/No | Which plugin has it | Missing / Partial / Covered |
14952
-
14953
- Focus on features that are:
14954
- - **Genuinely useful** (not gimmicks)
14955
- - **Feasible to implement** (not requiring external infrastructure)
14956
- - **Complementary** to existing capabilities (not duplicate)
14975
+ | Multi-agent orchestration | Yes \u2014 spawn_agent tool | oh-my-opencode, MAD | Covered |
14976
+ | (example) | No | opencode-dcp | Missing |
14977
+ | (example) | Partial \u2014 basic in sanitizer.ts | envsitter-guard | Partial |
14957
14978
 
14958
- ### What to IGNORE
14959
- - Auth plugins (opencode-antigravity-auth etc.) \u2014 domain-specific, not relevant
14960
- - oh-my-opencode features we already ported \u2014 mark as "Covered"
14961
- - Trivial wrappers or abandoned projects
14979
+ ## PHASE 4: PROPOSE
14962
14980
 
14963
- ## PHASE 3: PROPOSE
14964
- For each identified gap, produce a concrete improvement proposal:
14981
+ For each Missing or Partial gap, propose a concrete improvement:
14965
14982
 
14966
- \`\`\`
14967
14983
  ## Improvement: [Feature Name]
14968
14984
  **Inspiration**: [Plugin name] \u2014 [what it does]
14969
- **Why**: [Why opencode-ultra needs this]
14970
- **How**: [Implementation sketch \u2014 which file to modify, what to add]
14985
+ **Current state**: [what opencode-ultra has now, citing specific files/tools]
14986
+ **Why**: [concrete benefit]
14987
+ **How**: [which file to modify, what to add \u2014 be specific]
14971
14988
  **Effort**: Low / Medium / High
14972
- **Priority**: P0 (critical) / P1 (important) / P2 (nice-to-have)
14973
- \`\`\`
14989
+ **Priority**: P0 / P1 / P2
14974
14990
 
14975
- Sort proposals by Priority then Effort (P0-Low first, P2-High last).
14991
+ Sort by Priority then Effort.
14976
14992
 
14977
- ## PHASE 4: SAVE
14978
- Save the full analysis to the continuity ledger:
14993
+ ## PHASE 5: SAVE
14979
14994
  \`\`\`
14980
14995
  ledger_save({
14981
14996
  name: "evolve-scan-YYYY-MM-DD",
14982
- content: "# Evolve Scan Results\\n\\n## Feature Matrix\\n...\\n## Improvement Proposals\\n..."
14997
+ content: "# Evolve Scan Results\\n\\n## Current Capabilities\\n...\\n## Feature Matrix\\n...\\n## Proposals\\n..."
14983
14998
  })
14984
14999
  \`\`\`
14985
15000
 
14986
- ## IMPORTANT
14987
- - The goal is to make opencode-ultra BETTER, not to install other plugins.
14988
- - Other plugins are REFERENCE MATERIAL \u2014 study their approach, then design our own implementation.
14989
- - Every proposal must include a concrete "How" section with file paths and implementation direction.
14990
- - Present the final proposals to the user for approval before any implementation.`;
15001
+ ## RULES
15002
+ - Read opencode-ultra source YOURSELF first. Do not delegate self-analysis to a sub-agent.
15003
+ - The Feature Matrix must reflect what you actually read. No guessing.
15004
+ - Proposals must cite specific opencode-ultra files for the "How" section.
15005
+ - Present proposals to user for approval before implementation.`;
14991
15006
 
14992
15007
  // src/hooks/rules-injector.ts
14993
15008
  import * as fs2 from "fs";
@@ -0,0 +1,2 @@
1
+ export { sanitizeAgentOutput, sanitizeSpawnResult, type SanitizeResult } from "./sanitizer";
2
+ export { computeTrustScore, isTyposquatSuspect, formatTrustTable, type PackageMetadata, type TrustScoreResult, type TrustFactor, } from "./trust-score";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Prompt injection sanitizer — strips common injection patterns from agent outputs.
3
+ * Applied at the boundary where sub-agent results re-enter the orchestrator's context.
4
+ */
5
+ export interface SanitizeResult {
6
+ text: string;
7
+ flagged: boolean;
8
+ warnings: string[];
9
+ }
10
+ /**
11
+ * Sanitize text from agent outputs to prevent prompt injection.
12
+ * Returns the cleaned text plus any warnings.
13
+ */
14
+ export declare function sanitizeAgentOutput(text: string): SanitizeResult;
15
+ /**
16
+ * Apply sanitizer to a spawn_agent result string.
17
+ * Adds a warning banner if injection was detected.
18
+ */
19
+ export declare function sanitizeSpawnResult(result: string): string;
@@ -0,0 +1,51 @@
1
+ /**
2
+ * Trust Score — evaluates npm packages for reliability and safety.
3
+ * Used by evolve mode to rank plugin recommendations.
4
+ *
5
+ * Score 0–100:
6
+ * 90–100 HIGH trust (well-maintained, popular, verified)
7
+ * 70–89 MEDIUM trust (decent maintenance, some usage)
8
+ * 40–69 LOW trust (stale, low usage, or missing metadata)
9
+ * 0–39 RISKY (abandoned, typosquat suspect, no repo)
10
+ */
11
+ export interface PackageMetadata {
12
+ name: string;
13
+ version?: string;
14
+ description?: string;
15
+ license?: string;
16
+ /** ISO date string of last publish */
17
+ lastPublished?: string;
18
+ /** Weekly npm downloads */
19
+ weeklyDownloads?: number;
20
+ /** GitHub stars (0 if no repo) */
21
+ stars?: number;
22
+ /** GitHub repo URL */
23
+ repository?: string;
24
+ /** Whether the package has a README */
25
+ hasReadme?: boolean;
26
+ /** Number of maintainers */
27
+ maintainerCount?: number;
28
+ /** Number of dependencies */
29
+ dependencyCount?: number;
30
+ }
31
+ export interface TrustScoreResult {
32
+ score: number;
33
+ level: "high" | "medium" | "low" | "risky";
34
+ factors: TrustFactor[];
35
+ summary: string;
36
+ }
37
+ export interface TrustFactor {
38
+ name: string;
39
+ score: number;
40
+ maxScore: number;
41
+ detail: string;
42
+ }
43
+ export declare function computeTrustScore(meta: PackageMetadata): TrustScoreResult;
44
+ export declare function isTyposquatSuspect(name: string): boolean;
45
+ /**
46
+ * Format trust scores as a markdown table for evolve output.
47
+ */
48
+ export declare function formatTrustTable(results: Array<{
49
+ meta: PackageMetadata;
50
+ score: TrustScoreResult;
51
+ }>): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-ultra",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Lightweight OpenCode 1.2.x plugin — ultrawork mode, multi-agent orchestration, rules injection",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",