opencode-pair-autonomy 1.0.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 (128) hide show
  1. package/README.md +90 -0
  2. package/bin/opencode-pair-autonomy.js +20 -0
  3. package/dist/__tests__/comment-guard.test.d.ts +1 -0
  4. package/dist/__tests__/config.test.d.ts +1 -0
  5. package/dist/__tests__/learning.test.d.ts +1 -0
  6. package/dist/__tests__/plan-mode.test.d.ts +1 -0
  7. package/dist/agents.d.ts +2 -0
  8. package/dist/cli.d.ts +1 -0
  9. package/dist/cli.js +15351 -0
  10. package/dist/commands.d.ts +2 -0
  11. package/dist/config.d.ts +3 -0
  12. package/dist/hooks/comment-guard.d.ts +15 -0
  13. package/dist/hooks/file-edited.d.ts +7 -0
  14. package/dist/hooks/index.d.ts +46 -0
  15. package/dist/hooks/post-tool-use.d.ts +5 -0
  16. package/dist/hooks/pre-compact.d.ts +4 -0
  17. package/dist/hooks/pre-tool-use.d.ts +5 -0
  18. package/dist/hooks/prompt-refiner.d.ts +38 -0
  19. package/dist/hooks/runtime.d.ts +91 -0
  20. package/dist/hooks/sdk.d.ts +6 -0
  21. package/dist/hooks/session-end.d.ts +4 -0
  22. package/dist/hooks/session-start.d.ts +19 -0
  23. package/dist/hooks/stop.d.ts +5 -0
  24. package/dist/i18n/index.d.ts +15 -0
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.js +17823 -0
  27. package/dist/installer.d.ts +12 -0
  28. package/dist/learning/analyzer.d.ts +15 -0
  29. package/dist/learning/store.d.ts +4 -0
  30. package/dist/learning/types.d.ts +32 -0
  31. package/dist/mcp.d.ts +4 -0
  32. package/dist/project-facts.d.ts +8 -0
  33. package/dist/prompts/coordinator.d.ts +2 -0
  34. package/dist/prompts/shared.d.ts +5 -0
  35. package/dist/prompts/workers.d.ts +8 -0
  36. package/dist/types.d.ts +81 -0
  37. package/dist/utils.d.ts +6 -0
  38. package/examples/opencode-pair-autonomy.jsonc +35 -0
  39. package/examples/opencode.jsonc +17 -0
  40. package/package.json +103 -0
  41. package/vendor/mcp/pg-mcp/README.md +91 -0
  42. package/vendor/mcp/pg-mcp/config.example.json +26 -0
  43. package/vendor/mcp/pg-mcp/config.json +15 -0
  44. package/vendor/mcp/pg-mcp/package-lock.json +1288 -0
  45. package/vendor/mcp/pg-mcp/package.json +18 -0
  46. package/vendor/mcp/pg-mcp/src/config.js +71 -0
  47. package/vendor/mcp/pg-mcp/src/db.js +85 -0
  48. package/vendor/mcp/pg-mcp/src/index.js +203 -0
  49. package/vendor/mcp/pg-mcp/src/sqlGuard.js +75 -0
  50. package/vendor/mcp/pg-mcp/src/tools.js +89 -0
  51. package/vendor/mcp/ssh-mcp/README.md +46 -0
  52. package/vendor/mcp/ssh-mcp/config.example.json +23 -0
  53. package/vendor/mcp/ssh-mcp/config.json +6 -0
  54. package/vendor/mcp/ssh-mcp/package-lock.json +1142 -0
  55. package/vendor/mcp/ssh-mcp/package.json +18 -0
  56. package/vendor/mcp/ssh-mcp/src/config.js +140 -0
  57. package/vendor/mcp/ssh-mcp/src/index.js +130 -0
  58. package/vendor/mcp/ssh-mcp/src/ssh.js +163 -0
  59. package/vendor/mcp/sudo-mcp/README.md +51 -0
  60. package/vendor/mcp/sudo-mcp/config.example.json +28 -0
  61. package/vendor/mcp/sudo-mcp/config.json +28 -0
  62. package/vendor/mcp/sudo-mcp/package-lock.json +1145 -0
  63. package/vendor/mcp/sudo-mcp/package.json +18 -0
  64. package/vendor/mcp/sudo-mcp/src/config.js +57 -0
  65. package/vendor/mcp/sudo-mcp/src/index.js +267 -0
  66. package/vendor/mcp/sudo-mcp/src/runner.js +168 -0
  67. package/vendor/mcp/web-agent-mcp/package-lock.json +2886 -0
  68. package/vendor/mcp/web-agent-mcp/package.json +28 -0
  69. package/vendor/mcp/web-agent-mcp/src/adapters/cloakbrowser/adapter.ts +335 -0
  70. package/vendor/mcp/web-agent-mcp/src/adapters/cloakbrowser/auth-heuristics.ts +324 -0
  71. package/vendor/mcp/web-agent-mcp/src/adapters/cloakbrowser/launcher.ts +1340 -0
  72. package/vendor/mcp/web-agent-mcp/src/config/env.ts +107 -0
  73. package/vendor/mcp/web-agent-mcp/src/core/action-flow.ts +82 -0
  74. package/vendor/mcp/web-agent-mcp/src/core/artifact-store.ts +109 -0
  75. package/vendor/mcp/web-agent-mcp/src/core/errors.ts +108 -0
  76. package/vendor/mcp/web-agent-mcp/src/core/observation-flow.ts +38 -0
  77. package/vendor/mcp/web-agent-mcp/src/core/policy-engine.ts +113 -0
  78. package/vendor/mcp/web-agent-mcp/src/core/retry-policy.ts +42 -0
  79. package/vendor/mcp/web-agent-mcp/src/core/session-manager.ts +670 -0
  80. package/vendor/mcp/web-agent-mcp/src/core/session-restart-policy.ts +34 -0
  81. package/vendor/mcp/web-agent-mcp/src/core/task-history.ts +97 -0
  82. package/vendor/mcp/web-agent-mcp/src/index.ts +3 -0
  83. package/vendor/mcp/web-agent-mcp/src/schemas/act.ts +167 -0
  84. package/vendor/mcp/web-agent-mcp/src/schemas/common.ts +56 -0
  85. package/vendor/mcp/web-agent-mcp/src/schemas/observe.ts +214 -0
  86. package/vendor/mcp/web-agent-mcp/src/schemas/page.ts +21 -0
  87. package/vendor/mcp/web-agent-mcp/src/schemas/policy.ts +42 -0
  88. package/vendor/mcp/web-agent-mcp/src/schemas/runtime.ts +21 -0
  89. package/vendor/mcp/web-agent-mcp/src/schemas/session.ts +63 -0
  90. package/vendor/mcp/web-agent-mcp/src/server.ts +75 -0
  91. package/vendor/mcp/web-agent-mcp/src/tools/act/click.ts +68 -0
  92. package/vendor/mcp/web-agent-mcp/src/tools/act/drag.ts +57 -0
  93. package/vendor/mcp/web-agent-mcp/src/tools/act/enter-code.ts +78 -0
  94. package/vendor/mcp/web-agent-mcp/src/tools/act/fill.ts +65 -0
  95. package/vendor/mcp/web-agent-mcp/src/tools/act/pinch.ts +58 -0
  96. package/vendor/mcp/web-agent-mcp/src/tools/act/press.ts +67 -0
  97. package/vendor/mcp/web-agent-mcp/src/tools/act/shared.ts +73 -0
  98. package/vendor/mcp/web-agent-mcp/src/tools/act/swipe.ts +59 -0
  99. package/vendor/mcp/web-agent-mcp/src/tools/act/wait-for.ts +56 -0
  100. package/vendor/mcp/web-agent-mcp/src/tools/act/wheel.ts +59 -0
  101. package/vendor/mcp/web-agent-mcp/src/tools/observe/a11y.ts +60 -0
  102. package/vendor/mcp/web-agent-mcp/src/tools/observe/auth-state.ts +92 -0
  103. package/vendor/mcp/web-agent-mcp/src/tools/observe/boxes.ts +66 -0
  104. package/vendor/mcp/web-agent-mcp/src/tools/observe/console.ts +67 -0
  105. package/vendor/mcp/web-agent-mcp/src/tools/observe/dom.ts +60 -0
  106. package/vendor/mcp/web-agent-mcp/src/tools/observe/network.ts +67 -0
  107. package/vendor/mcp/web-agent-mcp/src/tools/observe/page-state.ts +93 -0
  108. package/vendor/mcp/web-agent-mcp/src/tools/observe/screenshot.ts +73 -0
  109. package/vendor/mcp/web-agent-mcp/src/tools/observe/text.ts +70 -0
  110. package/vendor/mcp/web-agent-mcp/src/tools/observe/wait-for-network.ts +70 -0
  111. package/vendor/mcp/web-agent-mcp/src/tools/page/navigate.ts +59 -0
  112. package/vendor/mcp/web-agent-mcp/src/tools/policy/recommend-observation.ts +40 -0
  113. package/vendor/mcp/web-agent-mcp/src/tools/register-tools.ts +55 -0
  114. package/vendor/mcp/web-agent-mcp/src/tools/runtime/evaluate-js.ts +83 -0
  115. package/vendor/mcp/web-agent-mcp/src/tools/session/close.ts +41 -0
  116. package/vendor/mcp/web-agent-mcp/src/tools/session/create.ts +86 -0
  117. package/vendor/mcp/web-agent-mcp/src/tools/session/restart.ts +72 -0
  118. package/vendor/mcp/web-agent-mcp/src/utils/fs.ts +28 -0
  119. package/vendor/mcp/web-agent-mcp/src/utils/ids.ts +9 -0
  120. package/vendor/mcp/web-agent-mcp/src/utils/time.ts +7 -0
  121. package/vendor/mcp/web-agent-mcp/tsconfig.json +22 -0
  122. package/vendor/skills/editorial-technical-ui/SKILL.md +84 -0
  123. package/vendor/skills/figma-console/SKILL.md +839 -0
  124. package/vendor/skills/go-fiber-postgres/SKILL.md +31 -0
  125. package/vendor/skills/opencode-plugin-dev/SKILL.md +31 -0
  126. package/vendor/skills/rust-media-desktop/SKILL.md +30 -0
  127. package/vendor/skills/vue-vite-ui/SKILL.md +31 -0
  128. package/vendor/skills/web-agent-browser/SKILL.md +140 -0
@@ -0,0 +1,12 @@
1
+ export declare function installHarness(options?: {
2
+ fresh?: boolean;
3
+ }): Promise<{
4
+ configPath: string;
5
+ packageJsonPath: string;
6
+ harnessConfigPath: string;
7
+ }>;
8
+ export declare function uninstallHarness(): Promise<{
9
+ configPath: string;
10
+ packageJsonPath: string;
11
+ preservedPaths: string[];
12
+ }>;
@@ -0,0 +1,15 @@
1
+ import type { PersistedSessionSummary, Observation } from "../hooks/runtime";
2
+ import { type ProjectFacts } from "../project-facts";
3
+ import type { LearningEvidence, LearnedPattern } from "./types";
4
+ export declare function promoteLearnedPatterns(params: {
5
+ existing: LearnedPattern[];
6
+ summary: PersistedSessionSummary;
7
+ facts: ProjectFacts;
8
+ observations: Observation[];
9
+ maxPatterns: number;
10
+ }): LearnedPattern[];
11
+ export declare function renderPatternKind(kind: LearnedPattern["kind"]): string;
12
+ export declare function renderPatternHeading(kind: LearnedPattern["kind"]): string;
13
+ export declare function renderPatternEvidence(evidence: LearningEvidence): string;
14
+ export declare function renderInjectedPatterns(patterns: LearnedPattern[], limit: number): string[];
15
+ export declare function getPatternSummary(pattern: LearnedPattern): string;
@@ -0,0 +1,4 @@
1
+ import type { LearningArtifact, LearnedPattern } from "./types";
2
+ export declare function loadLearningArtifact(filePath: string): LearningArtifact;
3
+ export declare function saveLearningArtifact(filePath: string, patterns: LearnedPattern[]): void;
4
+ export declare function saveLearningMarkdown(filePath: string, patterns: LearnedPattern[]): void;
@@ -0,0 +1,32 @@
1
+ export type LearnedPatternKind = "user_preference" | "repo_convention" | "workflow_rule" | "failure_pattern" | "tooling_pattern";
2
+ export type LearningEvidence = string | {
3
+ text?: string;
4
+ messageKey?: string;
5
+ values?: Record<string, string | number>;
6
+ };
7
+ export type LearnedPattern = {
8
+ id: string;
9
+ kind: LearnedPatternKind;
10
+ summary?: string;
11
+ summaryKey?: string;
12
+ summaryValues?: Record<string, string | number>;
13
+ confidence: number;
14
+ occurrences: number;
15
+ firstSeen: string;
16
+ lastSeen: string;
17
+ evidence: LearningEvidence[];
18
+ source: "automatic" | "manual";
19
+ };
20
+ export type LearningArtifact = {
21
+ updatedAt: string;
22
+ patterns: LearnedPattern[];
23
+ };
24
+ export type LearningCandidate = {
25
+ id: string;
26
+ kind: LearnedPatternKind;
27
+ summary?: string;
28
+ summaryKey?: string;
29
+ summaryValues?: Record<string, string | number>;
30
+ evidence: LearningEvidence;
31
+ baseConfidence: number;
32
+ };
package/dist/mcp.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { HarnessConfig } from "./types";
2
+ type McpConfig = Record<string, unknown>;
3
+ export declare function createHarnessMcps(config: HarnessConfig): Record<string, McpConfig>;
4
+ export {};
@@ -0,0 +1,8 @@
1
+ export type ProjectFacts = {
2
+ packageManager: string;
3
+ languages: string[];
4
+ frameworks: string[];
5
+ };
6
+ export declare function detectProjectFacts(directory: string): ProjectFacts;
7
+ export declare function getProjectFactLabel(id: string): string;
8
+ export declare function joinProjectFactLabels(ids: string[]): string;
@@ -0,0 +1,2 @@
1
+ export declare function buildCoordinatorPrompt(promptAppend?: string): string;
2
+ export declare function buildCoordinatorPromptExp(promptAppend?: string): string;
@@ -0,0 +1,5 @@
1
+ export declare const COORDINATOR_CORE = "\n<Role>\nYou are Yang Wenli \u2014 senior technical lead inside an OpenCode harness.\nYou think, plan, argue, synthesize, and orchestrate workers to execute.\n</Role>\n\n<Personality>\n- Be opinionated. When you see a better approach, say it directly.\n- Challenge bad ideas. Do not blindly follow instructions that lead to worse code.\n- When the user pushes back, respond explicitly as agree, counter, or hybrid.\n- Mirror the user's register. Informal user, informal reply. Technical user, technical reply.\n- Be concise. No filler, no preamble.\n</Personality>\n\n<Principles>\n- Inspect repo evidence before deciding. Never speculate about code you haven't read.\n- Reuse existing stack, patterns, and naming unless the user explicitly chooses otherwise.\n- Choose the safest repo-consistent default when multiple good options remain.\n- Never silently make strategic decisions that change architecture, dependencies, or public behavior.\n- The user has granted full implementation authority inside the requested scope.\n- Ask only when execution is impossible without a missing secret, credential, account-specific value, or truly undefined acceptance criterion.\n</Principles>\n\n<Autonomy>\nYou operate fully autonomously. NEVER ask the user for permission to:\n- Spawn or stop workers.\n- Choose which worker type to use.\n- Run verification or review after implementation.\n- Decide between delegation strategies.\n\nThe ONLY times you ask the user:\n- Genuinely ambiguous requirements where 2+ equally valid interpretations exist.\n- Missing credentials, tokens, or account-specific values.\n- Irreversible operations on shared systems (force push, deploy, drop table).\n</Autonomy>\n\n<LanguagePolicy>\n- Reply to the user in their language with CORRECT grammar, spelling, and native characters.\n- If the user writes with typos, slang, or broken grammar, DO NOT mirror their style.\n Always respond in proper, well-formed language regardless of how the user writes.\n- Worker prompts: ALWAYS English. No exceptions.\n- ALL code, variable names, commit messages, PR titles, branch names: English only.\n- Comments: minimal. Only genuinely non-obvious logic. Prefer self-documenting code.\n</LanguagePolicy>\n";
2
+ export declare const WORKER_CORE = "\n<Role>\nYou are a worker inside an OpenCode harness. Execute your assigned task completely.\n</Role>\n\n<Principles>\n- Inspect repo evidence before deciding. Never speculate about code you haven't read.\n- Reuse existing patterns and naming. Do not introduce a \"better\" pattern.\n- Batch independent tool calls in parallel.\n- Do ALL the work, not a sample. If assigned 50 items, process 50 items.\n- When your approach fails, diagnose WHY before switching strategies.\n</Principles>\n\n<CodingDiscipline>\n- Do not add features, files, or infrastructure the task did not ask for.\n- Do not add error handling for scenarios that cannot occur.\n- Do not create helpers or abstractions for one-time operations.\n- Three similar lines of code are better than premature abstraction.\n- Do not add comments to unchanged code. Only comment genuinely non-obvious logic.\n- Prefer self-documenting code. Comments should explain \"why\", never \"what\".\n- Be careful not to introduce OWASP top 10 vulnerabilities.\n- When editing code, preserve surrounding style exactly (indentation, quotes, semicolons).\n- ALWAYS prefer editing existing files over creating new ones.\n</CodingDiscipline>\n\n<ToolGuidance>\n- Read a file before editing it. Edit will fail if you haven't read first.\n- Prefer Edit over Write for modifications. Edit sends only the diff.\n- Prefer dedicated tools over Bash equivalents:\n File search: Glob (not find). Content search: Grep (not grep/rg).\n Read files: Read (not cat/head/tail). Edit files: Edit (not sed/awk).\n Write files: Write (not echo).\n- For git: prefer new commits over amend. Never skip hooks. Never force push without explicit request.\n- For Bash: use absolute paths, avoid cd, quote paths with spaces, chain with && not newlines.\n- Batch independent tool calls in parallel.\n</ToolGuidance>\n\n<BeforeBuilding>\nBEFORE writing ANY new code:\n1. Search for existing implementations: Glob, Grep for the relevant keywords.\n2. Read 2-3 similar files in the same directory to learn the pattern.\n3. If existing implementation found, extend it. Do not rewrite from scratch.\n4. If new approach needed, research constraints FIRST (docs, API limits).\nNEVER propose \"build from scratch\" when existing code might already solve the problem.\n</BeforeBuilding>\n\n<SanityChecks>\nAfter computing any value, verify it makes sense:\n- Percentages: 0-100 range. If > 100, your denominator is wrong.\n- Counts: never negative.\n- Dates: not in the future unless intended.\n- Arrays: check length > 0 before accessing index 0.\nAfter modifying a table or grid:\n- Count headers must equal count data cells per row.\n- Verify every header has corresponding data and vice versa.\n</SanityChecks>\n\n<Reporting>\nWhen done, report concisely:\n- What was done (files changed, commits made).\n- Key findings or decisions.\n- Any blockers, open questions, or concerns.\n- Relevant file paths and line numbers.\nThe coordinator will synthesize your report for the user. Keep it factual and compact.\nIf you cannot proceed, report: \"BLOCKER: {reason}\" so the coordinator can relay to the user.\n</Reporting>\n\n<LanguagePolicy>\n- ALL code, comments, variable names, commit messages MUST be in English.\n- Reports to coordinator in English.\n</LanguagePolicy>\n";
3
+ export declare const RESPONSE_DISCIPLINE = "\n<ResponseStyle>\n- Open with substance, not filler.\n- Keep structure proportional to the task.\n- Do not narrate obvious tool usage.\n- End with a concrete next step or concise result summary.\n- Match the user's brevity. Short question, short answer.\n- Avoid AI-slop phrases: \"Great question!\", \"Certainly!\", \"Let me...\", \"I'd be happy to...\".\n- Do not restate what the user just said. Do not add preamble.\n</ResponseStyle>\n\n<CorrectionProtocol>\nWhen the user corrects you or pushes back:\n- Adapt IMMEDIATELY. Do not defend, justify, or explain why you did it the old way.\n- If corrected twice on the same issue, treat it as a hard constraint for the session.\n- When the user says \"no\" or redirects, stop the current approach entirely.\n- Track scope changes: \"fix this button\" expanding to \"review the whole page\" means the new scope is the real scope.\n</CorrectionProtocol>\n\n<AntiPatterns>\nNEVER do these:\n- Add features, files, CI/CD, tests, or infrastructure the user did not ask for.\n- Suggest technology migrations or wholesale rewrites unprompted.\n- Do a sample of the work instead of all of it.\n- Write credentials or secrets to files.\n- Assume which project, file, or context the user means. If ambiguous, ask.\n</AntiPatterns>\n\n<ResearchAccuracy>\nWhen doing research, calculations, or data lookup:\n- Use REAL data from the web. Do not estimate or hallucinate numbers.\n- Cross-validate claims across multiple sources. If sources disagree, say so.\n</ResearchAccuracy>\n";
4
+ export declare function buildMcpCatalog(): string;
5
+ export declare function withPromptAppend(prompt: string, promptAppend?: string): string;
@@ -0,0 +1,8 @@
1
+ export declare function buildWorkerPrompt(promptAppend?: string): string;
2
+ export declare function buildResearcherPrompt(promptAppend?: string): string;
3
+ export declare function buildReviewerPrompt(promptAppend?: string): string;
4
+ export declare function buildYetAnotherReviewerPrompt(promptAppend?: string): string;
5
+ export declare function buildVerifierPrompt(promptAppend?: string): string;
6
+ export declare function buildRepairPrompt(promptAppend?: string): string;
7
+ export declare function buildUiDeveloperPrompt(promptAppend?: string): string;
8
+ export declare function buildRepoScoutPrompt(promptAppend?: string): string;
@@ -0,0 +1,81 @@
1
+ export type HarnessMode = "coordinator";
2
+ export type PlanModeState = "planning" | "executing";
3
+ export type WorkerType = "thorfinn" | "ginko" | "kaiki" | "odokawa" | "ozen" | "skull-knight" | "paprika" | "rajdhani";
4
+ export type HookProfile = "minimal" | "standard" | "strict";
5
+ export type WslState = {
6
+ enabled: boolean;
7
+ winDrive: string;
8
+ winProjectPath: string;
9
+ };
10
+ export type ResourceMap = {
11
+ sshHosts: string[];
12
+ dbConnections: {
13
+ mariadb: string[];
14
+ postgres: string[];
15
+ };
16
+ projectDocs: string[];
17
+ skills: string[];
18
+ };
19
+ export type McpToggles = {
20
+ context7?: boolean;
21
+ grep_app?: boolean;
22
+ websearch?: boolean;
23
+ fff?: boolean;
24
+ web_agent_mcp?: boolean;
25
+ pg_mcp?: boolean;
26
+ ssh_mcp?: boolean;
27
+ sudo_mcp?: boolean;
28
+ jina?: boolean;
29
+ figma_console?: boolean;
30
+ mariadb?: boolean;
31
+ };
32
+ export type FigmaConsoleConfig = {
33
+ ssh_host?: string;
34
+ };
35
+ export type AgentOverride = {
36
+ model?: string;
37
+ variant?: string;
38
+ description?: string;
39
+ prompt_append?: string;
40
+ };
41
+ export type HarnessConfig = {
42
+ default_mode?: HarnessMode;
43
+ set_default_agent?: boolean;
44
+ commands?: {
45
+ enabled?: boolean;
46
+ };
47
+ credentials?: {
48
+ jina_api_key?: string;
49
+ figma_access_token?: string;
50
+ };
51
+ figma_console?: FigmaConsoleConfig;
52
+ hooks?: {
53
+ profile?: HookProfile;
54
+ comment_guard?: boolean;
55
+ session_start?: boolean;
56
+ pre_tool_use?: boolean;
57
+ post_tool_use?: boolean;
58
+ pre_compact?: boolean;
59
+ stop?: boolean;
60
+ session_end?: boolean;
61
+ file_edited?: boolean;
62
+ prompt_refiner?: boolean;
63
+ };
64
+ memory?: {
65
+ enabled?: boolean;
66
+ directory?: string;
67
+ lookback_days?: number;
68
+ max_injected_chars?: number;
69
+ };
70
+ learning?: {
71
+ enabled?: boolean;
72
+ directory?: string;
73
+ min_observations?: number;
74
+ auto_promote?: boolean;
75
+ max_patterns?: number;
76
+ max_injected_patterns?: number;
77
+ };
78
+ mcps?: McpToggles;
79
+ agents?: Record<string, AgentOverride>;
80
+ };
81
+ export type AgentLike = Record<string, unknown>;
@@ -0,0 +1,6 @@
1
+ export declare function isObject(value: unknown): value is Record<string, unknown>;
2
+ export declare function deepMerge<T>(base: T, override: unknown): T;
3
+ export declare function ensureDir(dirPath: string): void;
4
+ export declare function readJson<T>(filePath: string, fallback: T): T;
5
+ export declare function writeJson(filePath: string, value: unknown): void;
6
+ export declare function readText(filePath: string): string | undefined;
@@ -0,0 +1,35 @@
1
+ {
2
+ "default_mode": "coordinator",
3
+ "set_default_agent": true,
4
+ "hooks": {
5
+ "intent_gate": false,
6
+ "todo_continuation": true,
7
+ "comment_guard": true,
8
+ "flush_queued_prompts": true,
9
+ "todo_continuation_cooldown_ms": 30000
10
+ },
11
+ "mcps": {
12
+ "context7": true,
13
+ "grep_app": true,
14
+ "websearch": true,
15
+ "chrome_devtools": true,
16
+ "pg_mcp": true,
17
+ "ssh_mcp": true,
18
+ "sudo_mcp": true,
19
+ "jina": true
20
+ },
21
+ "agents": {
22
+ "ryo": {
23
+ "variant": "high"
24
+ },
25
+ "shounen-bat": {
26
+ "model": "kimi-for-coding/k2p5"
27
+ },
28
+ "eiri": {
29
+ "model": "kimi-for-coding/k2p5"
30
+ },
31
+ "bondrewd": {
32
+ "model": "kimi-for-coding/k2p5"
33
+ }
34
+ }
35
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ // Reference example for the plugin stack after installation.
3
+ "plugin": [
4
+ "opencode-pair-autonomy",
5
+ "opencode-pty",
6
+ "opencode-notificator",
7
+ "@zenobius/opencode-skillful",
8
+ "file:///ABSOLUTE/PATH/TO/opencode-background-agents-local",
9
+ "@tarquinen/opencode-dcp",
10
+ "@franlol/opencode-md-table-formatter",
11
+ "opencode-anthropic-login-via-cli"
12
+ ],
13
+ "instructions": [
14
+ "~/.config/opencode/plugin/shell-strategy/shell_strategy.md"
15
+ ],
16
+ "default_agent": "pair"
17
+ }
package/package.json ADDED
@@ -0,0 +1,103 @@
1
+ {
2
+ "name": "opencode-pair-autonomy",
3
+ "version": "1.0.0",
4
+ "description": "OpenCode harness with opinionated agent orchestration. One coordinator, eight specialized workers, automatic verify+review pipeline.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "opencode-pair-autonomy": "bin/opencode-pair-autonomy.js"
10
+ },
11
+ "files": [
12
+ "dist",
13
+ "bin",
14
+ "vendor",
15
+ "examples",
16
+ "README.md"
17
+ ],
18
+ "scripts": {
19
+ "build": "bun build src/index.ts --outdir dist --target bun --format esm && bun build src/cli.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly",
20
+ "clean": "rm -rf dist",
21
+ "prepare": "bun run build",
22
+ "typecheck": "tsc --noEmit",
23
+ "test": "bun test"
24
+ },
25
+ "keywords": [
26
+ "opencode",
27
+ "plugin",
28
+ "agent",
29
+ "harness",
30
+ "orchestration",
31
+ "pair-programming"
32
+ ],
33
+ "release": {
34
+ "branches": [
35
+ "main"
36
+ ],
37
+ "plugins": [
38
+ [
39
+ "@semantic-release/commit-analyzer",
40
+ {
41
+ "releaseRules": [
42
+ {
43
+ "type": "refactor",
44
+ "release": "patch"
45
+ },
46
+ {
47
+ "type": "perf",
48
+ "release": "patch"
49
+ },
50
+ {
51
+ "type": "test",
52
+ "release": "patch"
53
+ },
54
+ {
55
+ "type": "chore",
56
+ "scope": "deps",
57
+ "release": "patch"
58
+ }
59
+ ]
60
+ }
61
+ ],
62
+ "@semantic-release/release-notes-generator",
63
+ "@semantic-release/npm",
64
+ [
65
+ "@semantic-release/github",
66
+ {
67
+ "assets": [
68
+ {
69
+ "path": "release-binaries/opencode-pair-autonomy-linux-x64",
70
+ "label": "CLI Binary (Linux x64)"
71
+ },
72
+ {
73
+ "path": "release-binaries/opencode-pair-autonomy-linux-arm64",
74
+ "label": "CLI Binary (Linux ARM64)"
75
+ },
76
+ {
77
+ "path": "release-binaries/opencode-pair-autonomy-darwin-x64",
78
+ "label": "CLI Binary (macOS x64)"
79
+ },
80
+ {
81
+ "path": "release-binaries/opencode-pair-autonomy-darwin-arm64",
82
+ "label": "CLI Binary (macOS ARM64)"
83
+ }
84
+ ]
85
+ }
86
+ ]
87
+ ]
88
+ },
89
+ "repository": {
90
+ "type": "git",
91
+ "url": "git+https://github.com/cemalturkcan/oh-my-pair-code.git"
92
+ },
93
+ "license": "MIT",
94
+ "dependencies": {
95
+ "@opencode-ai/plugin": "latest",
96
+ "jsonc-parser": "^3.3.1",
97
+ "zod": "^4.1.8"
98
+ },
99
+ "devDependencies": {
100
+ "bun-types": "1.3.6",
101
+ "typescript": "^5.7.3"
102
+ }
103
+ }
@@ -0,0 +1,91 @@
1
+ # PostgreSQL MCP Server (stdio)
2
+
3
+ Bu proje, PostgreSQL icin basit bir MCP sunucusu saglar. Iletisim `stdio` uzerinden yapilir ve sorgular salt-okunur sekilde calisir.
4
+
5
+ ## Ozellikler
6
+
7
+ - `config.json` ile birden fazla baglanti tanimi
8
+ - MCP araclari:
9
+ - `list_connections`
10
+ - `list_databases`
11
+ - `list_schemas`
12
+ - `list_tables`
13
+ - `describe_table`
14
+ - `execute_select`
15
+ - Istege bagli `database` parametresi ile tek baglanti uzerinden farkli DB'leri gezebilme
16
+ - Guvenlik kurallari:
17
+ - Yalnizca `SELECT` sorgulari
18
+ - Coklu statement reddi
19
+ - Yazma/DDL anahtar kelimeleri reddi
20
+ - Read-only transaction
21
+ - `statement_timeout` zorlamasi
22
+ - Baglanti bazli satir limiti (`default_row_limit` / `max_row_limit`)
23
+
24
+ ## Kurulum
25
+
26
+ ```bash
27
+ npm install
28
+ ```
29
+
30
+ ## Yapilandirma
31
+
32
+ 1. Ornek dosyayi kopyalayin:
33
+
34
+ ```bash
35
+ cp config.example.json config.json
36
+ ```
37
+
38
+ 2. `config.json` icindeki baglanti bilgilerini guncelleyin.
39
+
40
+ Notlar:
41
+ - Gercek `config.json` dosyasi `.gitignore` ile dislanmistir.
42
+ - Dilerseniz farkli bir yol kullanmak icin `PG_MCP_CONFIG_PATH` degiskenini ayarlayabilirsiniz.
43
+
44
+ ## Calistirma
45
+
46
+ ```bash
47
+ npm start
48
+ ```
49
+
50
+ ## Ornek MCP istemci ayari
51
+
52
+ Asagidaki ornek, MCP istemci konfigine bu sunucuyu eklemek icindir:
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "pg": {
58
+ "command": "node",
59
+ "args": ["/absolute/path/to/pg-mcp/src/index.js"],
60
+ "env": {
61
+ "PG_MCP_CONFIG_PATH": "/absolute/path/to/pg-mcp/config.json"
62
+ }
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ ## Baglanti ayari (ornek)
69
+
70
+ ```json
71
+ {
72
+ "connections": {
73
+ "local": {
74
+ "host": "127.0.0.1",
75
+ "port": 5432,
76
+ "user": "readonly_user",
77
+ "password": "readonly_password",
78
+ "database": "postgres",
79
+ "description": "Root baglanti (DB listesi icin)",
80
+ "statement_timeout_ms": 10000,
81
+ "default_row_limit": 100,
82
+ "max_row_limit": 1000
83
+ }
84
+ }
85
+ }
86
+ ```
87
+
88
+ ## DB gezme akisi
89
+
90
+ 1. `list_databases` ile erisilebilir DB'leri alin.
91
+ 2. `list_schemas` / `list_tables` / `describe_table` / `execute_select` cagrilarinda `database` parametresi gonderin.
@@ -0,0 +1,26 @@
1
+ {
2
+ "connections": {
3
+ "local": {
4
+ "host": "127.0.0.1",
5
+ "port": 5432,
6
+ "user": "readonly_user",
7
+ "password": "readonly_password",
8
+ "database": "app_db",
9
+ "description": "Yerel gelistirme veritabani",
10
+ "statement_timeout_ms": 10000,
11
+ "default_row_limit": 100,
12
+ "max_row_limit": 1000
13
+ },
14
+ "staging": {
15
+ "host": "staging-db.example.com",
16
+ "port": 5432,
17
+ "user": "readonly_staging",
18
+ "password": "staging_password",
19
+ "database": "app_staging",
20
+ "description": "Staging ortami",
21
+ "statement_timeout_ms": 8000,
22
+ "default_row_limit": 50,
23
+ "max_row_limit": 500
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "connections": {
3
+ "local": {
4
+ "host": "127.0.0.1",
5
+ "port": 5432,
6
+ "user": "postgres",
7
+ "password": "",
8
+ "database": "postgres",
9
+ "description": "Local PostgreSQL (read-only expected)",
10
+ "statement_timeout_ms": 10000,
11
+ "default_row_limit": 100,
12
+ "max_row_limit": 1000
13
+ }
14
+ }
15
+ }