opencode-ultra 0.6.1 → 0.6.2

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
@@ -14932,23 +14932,32 @@ This is NOT about installing other plugins. This is about LEARNING from the ecos
14932
14932
  - **spawn_agent** \u2014 run scout + explore agents in parallel for data gathering
14933
14933
  - **ledger_save** \u2014 persist improvement proposals for future implementation
14934
14934
 
14935
- ## PHASE 1: GATHER (parallel)
14935
+ ## PHASE 1: GATHER (parallel \u2014 BOTH agents MANDATORY)
14936
+
14937
+ You MUST spawn BOTH agents below. Do NOT skip the explore agent.
14938
+
14936
14939
  \`\`\`
14937
14940
  spawn_agent({
14938
14941
  agents: [
14939
14942
  {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"}
14943
+ {agent: "explore", prompt: "Read opencode-ultra's INSTALLED source at ~/.cache/opencode/node_modules/opencode-ultra/. Read these files: src/index.ts, src/tools/spawn-agent.ts, src/tools/ralph-loop.ts, src/tools/evolve-apply.ts, src/hooks/keyword-detector.ts, src/hooks/rules-injector.ts, src/safety/sanitizer.ts, src/safety/trust-score.ts, src/concurrency/pool.ts, src/agents/index.ts, src/categories/index.ts, README.md. For EACH file, list: what it does, what hooks/tools/features it provides, what techniques it uses. Output a structured capability inventory with Yes/No for each feature area.", description: "Self-analysis of opencode-ultra"}
14941
14944
  ]
14942
14945
  })
14943
14946
  \`\`\`
14944
14947
 
14948
+ ## HARD GATE: DO NOT proceed to Phase 2 until BOTH agents return results.
14949
+ If the explore agent fails to find files, try reading from the current project directory or use Grep to locate opencode-ultra source files. You MUST have a concrete list of opencode-ultra's current capabilities before comparing.
14950
+
14945
14951
  ## PHASE 2: COMPARE
14946
- After gathering results, build a structured gap analysis:
14952
+
14953
+ Build a structured gap analysis using BOTH agents' results.
14954
+
14955
+ **CRITICAL**: The "opencode-ultra" column MUST be filled with Yes/No/Partial based on the explore agent's output. NEVER write "TBD" or "unknown" \u2014 if you don't know, re-read the source.
14947
14956
 
14948
14957
  ### Feature Matrix
14949
- | Feature | opencode-ultra | Other plugin(s) | Gap? |
14950
- |---------|---------------|-----------------|------|
14951
- | (feature) | Yes/No | Which plugin has it | Missing / Partial / Covered |
14958
+ | Feature | opencode-ultra (current) | Other plugin(s) | Gap? |
14959
+ |---------|-------------------------|-----------------|------|
14960
+ | (feature) | Yes / No / Partial \u2014 cite which file | Which plugin has it | Missing / Partial / Covered |
14952
14961
 
14953
14962
  Focus on features that are:
14954
14963
  - **Genuinely useful** (not gimmicks)
@@ -14961,11 +14970,12 @@ Focus on features that are:
14961
14970
  - Trivial wrappers or abandoned projects
14962
14971
 
14963
14972
  ## PHASE 3: PROPOSE
14964
- For each identified gap, produce a concrete improvement proposal:
14973
+ For each identified gap (Missing or Partial), produce a concrete improvement proposal:
14965
14974
 
14966
14975
  \`\`\`
14967
14976
  ## Improvement: [Feature Name]
14968
14977
  **Inspiration**: [Plugin name] \u2014 [what it does]
14978
+ **Current state in opencode-ultra**: [what we have now, citing files]
14969
14979
  **Why**: [Why opencode-ultra needs this]
14970
14980
  **How**: [Implementation sketch \u2014 which file to modify, what to add]
14971
14981
  **Effort**: Low / Medium / High
@@ -14987,6 +14997,7 @@ ledger_save({
14987
14997
  - The goal is to make opencode-ultra BETTER, not to install other plugins.
14988
14998
  - Other plugins are REFERENCE MATERIAL \u2014 study their approach, then design our own implementation.
14989
14999
  - Every proposal must include a concrete "How" section with file paths and implementation direction.
15000
+ - The opencode-ultra column in Feature Matrix must NEVER be TBD. Read the source first.
14990
15001
  - Present the final proposals to the user for approval before any implementation.`;
14991
15002
 
14992
15003
  // src/hooks/rules-injector.ts
@@ -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.2",
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",