@mandible-ai/mandible 0.3.9 → 0.3.10

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 (41) hide show
  1. package/dist/src/hosts/docker.d.ts +5 -0
  2. package/dist/src/hosts/docker.d.ts.map +1 -1
  3. package/dist/src/hosts/docker.js +37 -0
  4. package/dist/src/hosts/docker.js.map +1 -1
  5. package/package.json +1 -1
  6. package/dist/examples/code-pipeline/colonies.d.ts +0 -10
  7. package/dist/examples/code-pipeline/colonies.d.ts.map +0 -1
  8. package/dist/examples/code-pipeline/colonies.js +0 -112
  9. package/dist/examples/code-pipeline/colonies.js.map +0 -1
  10. package/dist/examples/code-pipeline/docker.d.ts +0 -3
  11. package/dist/examples/code-pipeline/docker.d.ts.map +0 -1
  12. package/dist/examples/code-pipeline/docker.js +0 -63
  13. package/dist/examples/code-pipeline/docker.js.map +0 -1
  14. package/dist/examples/code-pipeline/index.d.ts +0 -3
  15. package/dist/examples/code-pipeline/index.d.ts.map +0 -1
  16. package/dist/examples/code-pipeline/index.js +0 -45
  17. package/dist/examples/code-pipeline/index.js.map +0 -1
  18. package/dist/examples/code-pipeline/with-providers.d.ts +0 -3
  19. package/dist/examples/code-pipeline/with-providers.d.ts.map +0 -1
  20. package/dist/examples/code-pipeline/with-providers.js +0 -190
  21. package/dist/examples/code-pipeline/with-providers.js.map +0 -1
  22. package/dist/examples/github-colony/mandible.config.d.ts +0 -2
  23. package/dist/examples/github-colony/mandible.config.d.ts.map +0 -1
  24. package/dist/examples/github-colony/mandible.config.js +0 -55
  25. package/dist/examples/github-colony/mandible.config.js.map +0 -1
  26. package/dist/examples/repo-maintenance/fixer.d.ts +0 -87
  27. package/dist/examples/repo-maintenance/fixer.d.ts.map +0 -1
  28. package/dist/examples/repo-maintenance/fixer.js +0 -224
  29. package/dist/examples/repo-maintenance/fixer.js.map +0 -1
  30. package/dist/examples/repo-maintenance/mandible.config.d.ts +0 -2
  31. package/dist/examples/repo-maintenance/mandible.config.d.ts.map +0 -1
  32. package/dist/examples/repo-maintenance/mandible.config.js +0 -34
  33. package/dist/examples/repo-maintenance/mandible.config.js.map +0 -1
  34. package/dist/examples/repo-maintenance/scout.d.ts +0 -46
  35. package/dist/examples/repo-maintenance/scout.d.ts.map +0 -1
  36. package/dist/examples/repo-maintenance/scout.js +0 -170
  37. package/dist/examples/repo-maintenance/scout.js.map +0 -1
  38. package/dist/examples/repo-maintenance/seed.d.ts +0 -3
  39. package/dist/examples/repo-maintenance/seed.d.ts.map +0 -1
  40. package/dist/examples/repo-maintenance/seed.js +0 -151
  41. package/dist/examples/repo-maintenance/seed.js.map +0 -1
@@ -1,55 +0,0 @@
1
- // PURPOSE: GitHub colony example — Golem tablets as stigmergy signals
2
- // PURPOSE: Run: GITHUB_TOKEN=ghp_... npx tsx examples/github-colony/mandible.config.ts
3
- import { mandible } from '../../src/dsl/mandible.js';
4
- import { GitHubEnvironment } from '../../src/environments/github/index.js';
5
- // ----------------------------------------------------------
6
- // Config from environment variables
7
- // ----------------------------------------------------------
8
- const OWNER = process.env.GITHUB_OWNER ?? 'your-org';
9
- const REPO = process.env.GITHUB_REPO ?? 'your-repo';
10
- const POLL_INTERVAL = 30_000;
11
- if (!process.env.GITHUB_TOKEN) {
12
- console.error('\n GITHUB_TOKEN is required.');
13
- console.error(' Usage: GITHUB_TOKEN=ghp_... npx tsx examples/github-colony/mandible.config.ts\n');
14
- process.exit(1);
15
- }
16
- // ----------------------------------------------------------
17
- // Environment — GitHub IS the stigmergy substrate
18
- // ----------------------------------------------------------
19
- const env = new GitHubEnvironment({
20
- owner: OWNER,
21
- repo: REPO,
22
- pollInterval: POLL_INTERVAL,
23
- labels: ['golem'],
24
- allowWithdraw: false,
25
- decayRate: 0.001,
26
- });
27
- // ----------------------------------------------------------
28
- // Start colonies via mandible DSL
29
- // ----------------------------------------------------------
30
- const host = await mandible('github-colony')
31
- .environment(env)
32
- // Observer colony — senses golem tablets, logs them
33
- .colony('golem', c => c
34
- .sense('golem:*', { minConcentration: 0.05 })
35
- .do('log-tablet', async (signal, ctx) => {
36
- const payload = signal.payload;
37
- ctx.log(`[${signal.meta.concentration.toFixed(2)}] #${payload.number} ${payload.title}`);
38
- })
39
- .concurrency(1)
40
- .claim('none')
41
- .poll(POLL_INTERVAL))
42
- // Watcher colony — senses all issue types for dashboard visibility
43
- .colony('issue-watcher', c => c
44
- .sense('issue:*', { minConcentration: 0.05 })
45
- .do('log-issue', async (signal, ctx) => {
46
- const payload = signal.payload;
47
- ctx.log(`[${signal.meta.concentration.toFixed(2)}] #${payload.number} ${payload.title}`);
48
- })
49
- .concurrency(1)
50
- .claim('none')
51
- .poll(POLL_INTERVAL))
52
- .start();
53
- console.log(`Started ${host.colonies.length} colonies (id: ${host.metadata.id})`);
54
- await host.dashboard({ port: 4040 });
55
- //# sourceMappingURL=mandible.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mandible.config.js","sourceRoot":"","sources":["../../../examples/github-colony/mandible.config.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,uFAAuF;AAEvF,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAG3E,6DAA6D;AAC7D,oCAAoC;AACpC,6DAA6D;AAE7D,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,UAAU,CAAC;AACrD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,WAAW,CAAC;AACpD,MAAM,aAAa,GAAG,MAAM,CAAC;AAE7B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC9B,OAAO,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAC/C,OAAO,CAAC,KAAK,CAAC,mFAAmF,CAAC,CAAC;IACnG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AA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AC,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,OAAO,CAAC,MAAM,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;AAC3F,CAAC,CAAC;KACD,WAAW,CAAC,CAAC,CAAC;KACd,KAAK,CAAC,MAAM,CAAC;KACb,IAAI,CAAC,aAAa,CAAC,CACrB;KACA,KAAK,EAAE,CAAC;AAEX,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,QAAQ,CAAC,MAAM,kBAAkB,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;AAClF,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC"}
@@ -1,87 +0,0 @@
1
- import type { BedrockConfig } from '../../src/providers/types.js';
2
- import type { ColonyBuilder } from '../../src/dsl/builder.js';
3
- /** Input: what the Fixer senses (from Scout or GitHub) */
4
- export interface IssuePayload {
5
- category: string;
6
- severity: string;
7
- title: string;
8
- description: string;
9
- files: string[];
10
- suggested_fix?: string;
11
- previous_feedback?: string;
12
- }
13
- /** Output: what the Fixer deposits on success */
14
- export interface FixProposedPayload {
15
- issue_title: string;
16
- branch: string;
17
- diff_summary: string;
18
- files_changed: string[];
19
- tests_passed: boolean;
20
- confidence: 'high' | 'medium' | 'low';
21
- }
22
- /** Output: what the Fixer deposits on failure */
23
- export interface FixFailedPayload {
24
- issue_title: string;
25
- reason: string;
26
- attempted_approach?: string;
27
- }
28
- export interface FixerColonyOptions {
29
- /** Signal types to sense. Defaults to ['issue:detected']. */
30
- senseTypes?: string | string[];
31
- /** Model to use. Defaults to 'claude-sonnet-4-5-20250929'. */
32
- model?: string;
33
- /** Max budget per fix in USD. Defaults to 3.00. */
34
- maxBudgetUsd?: number;
35
- /** Max conversation turns. Defaults to 80. */
36
- maxTurns?: number;
37
- /** Allowed tools. Defaults to write-capable tools. */
38
- allowedTools?: string[];
39
- /** Disallowed tools. Defaults to []. */
40
- disallowedTools?: string[];
41
- /** Max concurrent fix attempts. Defaults to 2. */
42
- concurrency?: number;
43
- /** Claim lease duration in ms. Defaults to 600_000 (10 min). */
44
- claimLeaseDuration?: number;
45
- /** Route through AWS Bedrock instead of direct Anthropic API. */
46
- bedrock?: BedrockConfig;
47
- }
48
- /**
49
- * Returns a colony configurator for use with the mandible() DSL.
50
- *
51
- * @example
52
- * await mandible('repo-maintenance')
53
- * .environment(env)
54
- * .colony('fixer', configureFixer(repoRoot))
55
- * .start();
56
- */
57
- export declare function configureFixer(repoRoot: string, options?: FixerColonyOptions): (c: ColonyBuilder) => ColonyBuilder<Record<string, unknown>>;
58
- interface ParsedFixerSuccess {
59
- status: 'success';
60
- issue_title: string;
61
- branch: string;
62
- diff_summary: string;
63
- files_changed: string[];
64
- tests_passed: boolean;
65
- confidence: 'high' | 'medium' | 'low';
66
- reason?: undefined;
67
- attempted_approach?: undefined;
68
- }
69
- interface ParsedFixerFailure {
70
- status: 'failure';
71
- issue_title: string;
72
- reason: string;
73
- attempted_approach?: string;
74
- branch?: undefined;
75
- diff_summary?: undefined;
76
- files_changed?: undefined;
77
- tests_passed?: undefined;
78
- confidence?: undefined;
79
- }
80
- export type ParsedFixerOutput = ParsedFixerSuccess | ParsedFixerFailure;
81
- /**
82
- * Extracts JSON result from the agent's markdown-formatted output.
83
- * Looks for a ```json code block, parses it, and validates the shape.
84
- */
85
- export declare function parseFixerOutput(text: string): ParsedFixerOutput;
86
- export {};
87
- //# sourceMappingURL=fixer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixer.d.ts","sourceRoot":"","sources":["../../../examples/repo-maintenance/fixer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA8B,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAO9D,0DAA0D;AAC1D,MAAM,WAAW,YAAY;IAC3B,QAAQ,EA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AAE,kBAAuB,IAgBxB,GAAG,aAAa,4CA6IzB;AAMD,UAAU,kBAAkB;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,kBAAkB,CAAC,EAAE,SAAS,CAAC;CAChC;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB;AAED,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAExE;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CA0EhE"}
@@ -1,224 +0,0 @@
1
- // PURPOSE: Fixer colony — claims issue:detected signals and attempts to fix them using a Claude agent.
2
- // PURPOSE: Deposits fix:proposed on success or fix:failed on failure.
3
- import { withClaudeCode } from '../../src/providers/claude-code.js';
4
- // ----------------------------------------------------------
5
- // Fixer colony configurator
6
- // ----------------------------------------------------------
7
- /**
8
- * Returns a colony configurator for use with the mandible() DSL.
9
- *
10
- * @example
11
- * await mandible('repo-maintenance')
12
- * .environment(env)
13
- * .colony('fixer', configureFixer(repoRoot))
14
- * .start();
15
- */
16
- export function configureFixer(repoRoot, options = {}) {
17
- const { senseTypes = 'issue:detected', model = 'claude-sonnet-4-5-20250929', maxBudgetUsd = 3.00, maxTurns = 80, allowedTools = ['Read', 'Edit', 'Write', 'Bash', 'Glob', 'Grep'], disallowedTools = [], concurrency = 2, claimLeaseDuration = 600_000, bedrock, } = options;
18
- const types = Array.isArray(senseTypes) ? senseTypes : [senseTypes];
19
- return (c) => {
20
- for (const t of types) {
21
- c = c.sense(t, { unclaimed: true });
22
- }
23
- return c
24
- .do('fix-issue', withClaudeCode({
25
- model,
26
- systemPrompt: [
27
- 'You are a Fixer agent in a repo-maintenance colony.',
28
- 'Your job is to claim a detected issue and produce a minimal, correct fix.',
29
- '',
30
- 'Workflow:',
31
- '1. Create a branch named `mandible/fix-{category}-{short-hash}` from the current HEAD.',
32
- ' Use the first 6 chars of a random hex string for the short hash.',
33
- '2. Analyze the issue description and affected files.',
34
- '3. Make the MINIMAL change needed to resolve the issue.',
35
- '4. Run tests (`npm test` or `npx vitest run`) to verify the fix does not break anything.',
36
- '5. Output a JSON result block (see below).',
37
- '',
38
- 'Constraints:',
39
- '- Do NOT merge to main. Only work on the fix branch.',
40
- '- Do NOT make changes beyond what is needed for this specific issue.',
41
- '- If a previous_feedback field is present, it means a prior fix attempt was rejected.',
42
- ' Use that feedback to improve your approach.',
43
- '- If you cannot fix the issue, output a failure result instead.',
44
- '',
45
- 'Output format — wrap in a ```json code block:',
46
- '```json',
47
- '{',
48
- ' "status": "success",',
49
- ' "issue_title": "Short title of the issue",',
50
- ' "branch": "mandible/fix-category-abc123",',
51
- ' "diff_summary": "What changed and why",',
52
- ' "files_changed": ["file1.ts", "file2.ts"],',
53
- ' "tests_passed": true,',
54
- ' "confidence": "high"',
55
- '}',
56
- '```',
57
- '',
58
- 'On failure:',
59
- '```json',
60
- '{',
61
- ' "status": "failure",',
62
- ' "issue_title": "Short title of the issue",',
63
- ' "reason": "Why the fix could not be applied",',
64
- ' "attempted_approach": "What was tried"',
65
- '}',
66
- '```',
67
- ].join('\n'),
68
- prompt: (signal) => {
69
- const p = signal.payload;
70
- const lines = [
71
- '## Fix Request',
72
- '',
73
- `**Category:** ${p.category ?? 'unknown'}`,
74
- `**Severity:** ${p.severity ?? 'medium'}`,
75
- `**Title:** ${p.title ?? 'Untitled issue'}`,
76
- '',
77
- '### Description',
78
- String(p.description ?? 'No description provided.'),
79
- '',
80
- ];
81
- const files = p.files;
82
- if (files && files.length > 0) {
83
- lines.push('### Affected Files');
84
- for (const f of files) {
85
- lines.push(`- ${f}`);
86
- }
87
- lines.push('');
88
- }
89
- if (p.suggested_fix) {
90
- lines.push('### Suggested Fix');
91
- lines.push(String(p.suggested_fix));
92
- lines.push('');
93
- }
94
- if (p.previous_feedback) {
95
- lines.push('### Previous Feedback (from rejected attempt)');
96
- lines.push(String(p.previous_feedback));
97
- lines.push('');
98
- lines.push('Use this feedback to improve your fix approach.');
99
- lines.push('');
100
- }
101
- lines.push('Apply the fix, run tests, and output the JSON result block.');
102
- return lines.join('\n');
103
- },
104
- allowedTools,
105
- disallowedTools,
106
- workingDirectory: repoRoot,
107
- maxBudgetUsd,
108
- maxTurns,
109
- bedrock,
110
- output: (result, signal) => {
111
- const parsed = parseFixerOutput(result.text);
112
- const issuePayload = signal.payload;
113
- const issueTitle = String(issuePayload.title ?? 'Unknown issue');
114
- if (parsed.status === 'failure') {
115
- return [{
116
- type: 'fix:failed',
117
- payload: {
118
- issue_title: parsed.issue_title || issueTitle,
119
- reason: parsed.reason || 'Agent did not produce a valid result',
120
- attempted_approach: parsed.attempted_approach,
121
- costUsd: result.costUsd,
122
- durationMs: result.durationMs,
123
- },
124
- tags: ['failure'],
125
- }];
126
- }
127
- return [{
128
- type: 'fix:proposed',
129
- payload: {
130
- issue_title: parsed.issue_title || issueTitle,
131
- branch: parsed.branch || 'unknown',
132
- diff_summary: parsed.diff_summary || '',
133
- files_changed: parsed.files_changed || [],
134
- tests_passed: parsed.tests_passed ?? false,
135
- confidence: parsed.confidence || 'low',
136
- costUsd: result.costUsd,
137
- durationMs: result.durationMs,
138
- },
139
- tags: [parsed.confidence || 'low', parsed.tests_passed ? 'tests-pass' : 'tests-fail'],
140
- }];
141
- },
142
- autoWithdraw: true,
143
- }))
144
- .concurrency(concurrency)
145
- .claim('lease', claimLeaseDuration)
146
- .poll(3000);
147
- };
148
- }
149
- /**
150
- * Extracts JSON result from the agent's markdown-formatted output.
151
- * Looks for a ```json code block, parses it, and validates the shape.
152
- */
153
- export function parseFixerOutput(text) {
154
- if (!text) {
155
- return {
156
- status: 'failure',
157
- issue_title: '',
158
- reason: 'Empty agent output',
159
- };
160
- }
161
- // Try to find a JSON code block
162
- const codeBlockMatch = text.match(/```(?:json)?\s*\n?([\s\S]*?)\n?```/);
163
- const jsonStr = codeBlockMatch ? codeBlockMatch[1].trim() : text.trim();
164
- let parsed;
165
- try {
166
- parsed = JSON.parse(jsonStr);
167
- }
168
- catch {
169
- // Try to find an object in the text
170
- const objectMatch = jsonStr.match(/\{[\s\S]*\}/);
171
- if (objectMatch) {
172
- try {
173
- parsed = JSON.parse(objectMatch[0]);
174
- }
175
- catch {
176
- return {
177
- status: 'failure',
178
- issue_title: '',
179
- reason: 'Could not parse agent output as JSON',
180
- };
181
- }
182
- }
183
- else {
184
- return {
185
- status: 'failure',
186
- issue_title: '',
187
- reason: 'Could not parse agent output as JSON',
188
- };
189
- }
190
- }
191
- if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
192
- return {
193
- status: 'failure',
194
- issue_title: '',
195
- reason: 'Agent output is not a JSON object',
196
- };
197
- }
198
- const obj = parsed;
199
- // Check for explicit failure
200
- if (obj.status === 'failure') {
201
- return {
202
- status: 'failure',
203
- issue_title: typeof obj.issue_title === 'string' ? obj.issue_title : '',
204
- reason: typeof obj.reason === 'string' ? obj.reason : 'Unknown failure',
205
- ...(typeof obj.attempted_approach === 'string' ? { attempted_approach: obj.attempted_approach } : {}),
206
- };
207
- }
208
- // Treat as success — validate and normalize
209
- const validConfidences = new Set(['high', 'medium', 'low']);
210
- return {
211
- status: 'success',
212
- issue_title: typeof obj.issue_title === 'string' ? obj.issue_title : '',
213
- branch: typeof obj.branch === 'string' ? obj.branch : '',
214
- diff_summary: typeof obj.diff_summary === 'string' ? obj.diff_summary : '',
215
- files_changed: Array.isArray(obj.files_changed)
216
- ? obj.files_changed.filter((f) => typeof f === 'string')
217
- : [],
218
- tests_passed: typeof obj.tests_passed === 'boolean' ? obj.tests_passed : false,
219
- confidence: validConfidences.has(obj.confidence)
220
- ? obj.confidence
221
- : 'low',
222
- };
223
- }
224
- //# sourceMappingURL=fixer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fixer.js","sourceRoot":"","sources":["../../../examples/repo-maintenance/fixer.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,sEAAsE;AAKtE,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AA2DpE,6DAA6D;AAC7D,4BAA4B;AAC5B,6DAA6D;AAE7D;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAC5B,QAAgB,EAChB,UAA8B,EAAE;IAEhC,MAAM,EACJ,UAAU,GAAG,gBAAgB,EAC7B,KAAK,GAAG,4BAA4B,EACpC,YAAY,GAAG,IAAI,EACnB,QAAQ,GAAG,EAAE,EACb,YAAY,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAChE,eAAe,GAAG,EAAE,EACpB,WAAW,GAAG,CAAC,EACf,kBAAkB,GAAG,OAAO,EAC5B,OAAO,GACR,GAAG,OAAO,CAAC;IAEZ,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAEpE,OAAO,CAAC,CAAgB,EAAE,EAAE;QAC1B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;YACtB,CAAC,GAAG,CAAC,CAAC,KAA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AAO,CAAC,GAAG,CAAC,aAAa,CAAC;YAC7C,CAAC,CAAE,GAAG,CAAC,aAA2B,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;YACpF,CAAC,CAAC,EAAE;QACN,YAAY,EAAE,OAAO,GAAG,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK;QAC9E,UAAU,EAAE,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAoB,CAAC;YACxD,CAAC,CAAE,GAAG,CAAC,UAAwC;YAC/C,CAAC,CAAC,KAAK;KACV,CAAC;AACJ,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=mandible.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mandible.config.d.ts","sourceRoot":"","sources":["../../../examples/repo-maintenance/mandible.config.ts"],"names":[],"mappings":""}
@@ -1,34 +0,0 @@
1
- // PURPOSE: Repo-maintenance example — Scout + Fixer colonies.
2
- // PURPOSE: Run: npx tsx examples/repo-maintenance/mandible.config.ts
3
- import { resolve } from 'node:path';
4
- import { rm, mkdir } from 'node:fs/promises';
5
- import { mandible } from '../../src/dsl/mandible.js';
6
- import { FilesystemEnvironment } from '../../src/environments/filesystem/index.js';
7
- import { configureScout } from './scout.js';
8
- import { configureFixer } from './fixer.js';
9
- const ENV_ROOT = resolve('/tmp/mandible-repo-maintenance');
10
- const TARGET_REPO = resolve(process.env.TARGET_REPO ?? process.cwd());
11
- // Clean slate on startup
12
- await rm(ENV_ROOT, { recursive: true, force: true });
13
- await mkdir(ENV_ROOT, { recursive: true });
14
- const env = new FilesystemEnvironment({ root: ENV_ROOT, name: 'repo-maintenance' });
15
- // ── Start colonies via mandible DSL ───────────────────────
16
- const host = await mandible('repo-maintenance')
17
- .environment(env)
18
- .colony('scout', configureScout(TARGET_REPO))
19
- .colony('fixer', configureFixer(TARGET_REPO))
20
- .start();
21
- console.log(`Started ${host.colonies.length} colonies (id: ${host.metadata.id})`);
22
- // ── Seed scan trigger after a short delay ─────────────────
23
- setTimeout(async () => {
24
- await env.deposit({
25
- type: 'scan:trigger',
26
- payload: {
27
- scope: 'full',
28
- triggered_by: 'dashboard',
29
- },
30
- meta: { deposited_by: 'seed', ttl: 10 * 60_000 },
31
- });
32
- }, 2000);
33
- await host.dashboard({ port: 4040 });
34
- //# sourceMappingURL=mandible.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"mandible.config.js","sourceRoot":"","sources":["../../../examples/repo-maintenance/mandible.config.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,qEAAqE;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,QAAQ,GAAG,OAAO,CAAC,gCAAgC,CAAC,CAAC;AAC3D,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAEtE,yBAAyB;AACzB,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AACrD,MAAM,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AAE3C,MAAM,GAAG,GAAG,IAAI,qBAAqB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,CAAC;AAEpF,6DAA6D;AAE7D,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,kBAAkB,CAAC;KAC5C,WAAW,CAAC,GAAG,CAAC;KAChB,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;KAC5C,MAAM,CAAC,OAAO,EAAE,cAAc,CAAC,WAAW,CAAC,CAAC;KAC5C,KAAK,EAAE,CAAC;AAEX,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,QAAQ,CAAC,MAAM,kBAAkB,IAAI,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;AAElF,6DAA6D;AAE7D,UAAU,CAAC,KAAK,IAAI,EAAE;IACpB,MAAM,GAAG,CAAC,OAAO,CAAC;QAChB,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;YACb,YAAY,EAAE,WAAW;SAC1B;QACD,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,MAAM,EAAE;KACjD,CAAC,CAAC;AACL,CAAC,EAAE,IAAI,CAAC,CAAC;AAET,MAAM,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC"}
@@ -1,46 +0,0 @@
1
- import type { BedrockConfig } from '../../src/providers/types.js';
2
- import type { ColonyBuilder } from '../../src/dsl/builder.js';
3
- export interface ScanTriggerPayload {
4
- scope: 'full' | 'incremental';
5
- triggered_by: string;
6
- }
7
- export interface IssueDetectedPayload {
8
- category: 'dependency' | 'dead-code' | 'test-coverage' | 'security' | 'style' | 'stale-todo' | 'other';
9
- severity: 'low' | 'medium' | 'high' | 'critical';
10
- title: string;
11
- description: string;
12
- files: string[];
13
- suggested_fix?: string;
14
- }
15
- export interface ScoutColonyOptions {
16
- /** Signal types to sense. Defaults to ['scan:trigger']. */
17
- senseTypes?: string | string[];
18
- /** Model to use. Defaults to 'claude-sonnet-4-5-20250929'. */
19
- model?: string;
20
- /** Max budget per scan in USD. Defaults to 0.50. */
21
- maxBudgetUsd?: number;
22
- /** Max conversation turns. Defaults to 50. */
23
- maxTurns?: number;
24
- /** Allowed tools. Defaults to read-only tools. */
25
- allowedTools?: string[];
26
- /** Disallowed tools. Defaults to ['Edit', 'Write']. */
27
- disallowedTools?: string[];
28
- /** Route through AWS Bedrock instead of direct Anthropic API. */
29
- bedrock?: BedrockConfig;
30
- }
31
- /**
32
- * Returns a colony configurator for use with the mandible() DSL.
33
- *
34
- * @example
35
- * await mandible('repo-maintenance')
36
- * .environment(env)
37
- * .colony('scout', configureScout(repoRoot))
38
- * .start();
39
- */
40
- export declare function configureScout(repoRoot: string, options?: ScoutColonyOptions): (c: ColonyBuilder) => ColonyBuilder<Record<string, unknown>>;
41
- /**
42
- * Extracts JSON issue array from the agent's markdown-formatted output.
43
- * Looks for a ```json code block, parses it, and validates the shape.
44
- */
45
- export declare function parseScoutOutput(text: string): IssueDetectedPayload[];
46
- //# sourceMappingURL=scout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scout.d.ts","sourceRoot":"","sources":["../../../examples/repo-maintenance/scout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAA8B,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAO9D,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,GAAG,aAAa,CAAC;IAC9B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,YAAY,GAAG,WAAW,GAAG,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAC;IACvG,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,EAA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