@intutic/cli 0.1.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.
- package/README.md +107 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +92 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/connect.d.ts +18 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +154 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +84 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/login.d.ts +14 -0
- package/dist/commands/login.d.ts.map +1 -0
- package/dist/commands/login.js +121 -0
- package/dist/commands/login.js.map +1 -0
- package/dist/commands/logout.d.ts +8 -0
- package/dist/commands/logout.d.ts.map +1 -0
- package/dist/commands/logout.js +13 -0
- package/dist/commands/logout.js.map +1 -0
- package/dist/commands/status.d.ts +11 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +55 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/traces.d.ts +32 -0
- package/dist/commands/traces.d.ts.map +1 -0
- package/dist/commands/traces.js +207 -0
- package/dist/commands/traces.js.map +1 -0
- package/dist/commands/whoami.d.ts +12 -0
- package/dist/commands/whoami.d.ts.map +1 -0
- package/dist/commands/whoami.js +34 -0
- package/dist/commands/whoami.js.map +1 -0
- package/dist/config/paths.d.ts +30 -0
- package/dist/config/paths.d.ts.map +1 -0
- package/dist/config/paths.js +53 -0
- package/dist/config/paths.js.map +1 -0
- package/dist/config/store.d.ts +25 -0
- package/dist/config/store.d.ts.map +1 -0
- package/dist/config/store.js +69 -0
- package/dist/config/store.js.map +1 -0
- package/dist/harness/aider.d.ts +12 -0
- package/dist/harness/aider.d.ts.map +1 -0
- package/dist/harness/aider.js +62 -0
- package/dist/harness/aider.js.map +1 -0
- package/dist/harness/antigravity.d.ts +12 -0
- package/dist/harness/antigravity.d.ts.map +1 -0
- package/dist/harness/antigravity.js +69 -0
- package/dist/harness/antigravity.js.map +1 -0
- package/dist/harness/base.d.ts +20 -0
- package/dist/harness/base.d.ts.map +1 -0
- package/dist/harness/base.js +73 -0
- package/dist/harness/base.js.map +1 -0
- package/dist/harness/claudeCode.d.ts +2 -0
- package/dist/harness/claudeCode.d.ts.map +1 -0
- package/dist/harness/claudeCode.js +9 -0
- package/dist/harness/claudeCode.js.map +1 -0
- package/dist/harness/codex.d.ts +13 -0
- package/dist/harness/codex.d.ts.map +1 -0
- package/dist/harness/codex.js +74 -0
- package/dist/harness/codex.js.map +1 -0
- package/dist/harness/cursor.d.ts +2 -0
- package/dist/harness/cursor.d.ts.map +1 -0
- package/dist/harness/cursor.js +9 -0
- package/dist/harness/cursor.js.map +1 -0
- package/dist/harness/detector.d.ts +29 -0
- package/dist/harness/detector.d.ts.map +1 -0
- package/dist/harness/detector.js +61 -0
- package/dist/harness/detector.js.map +1 -0
- package/dist/harness/n8n.d.ts +13 -0
- package/dist/harness/n8n.d.ts.map +1 -0
- package/dist/harness/n8n.js +30 -0
- package/dist/harness/n8n.js.map +1 -0
- package/dist/harness/openhands.d.ts +12 -0
- package/dist/harness/openhands.d.ts.map +1 -0
- package/dist/harness/openhands.js +63 -0
- package/dist/harness/openhands.js.map +1 -0
- package/dist/harness/types.d.ts +30 -0
- package/dist/harness/types.d.ts.map +1 -0
- package/dist/harness/types.js +25 -0
- package/dist/harness/types.js.map +1 -0
- package/dist/harness/windsurf.d.ts +2 -0
- package/dist/harness/windsurf.d.ts.map +1 -0
- package/dist/harness/windsurf.js +9 -0
- package/dist/harness/windsurf.js.map +1 -0
- package/dist/lib/api.d.ts +44 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +55 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/hash.d.ts +11 -0
- package/dist/lib/hash.d.ts.map +1 -0
- package/dist/lib/hash.js +18 -0
- package/dist/lib/hash.js.map +1 -0
- package/dist/lib/logger.d.ts +18 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/logger.js +33 -0
- package/dist/lib/logger.js.map +1 -0
- package/package.json +31 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aider.d.ts","sourceRoot":"","sources":["../../src/harness/aider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAMjD,eAAO,MAAM,YAAY,EAAE,eAgD1B,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Aider adapter — .aider.conf.yml
|
|
3
|
+
*
|
|
4
|
+
* Writes SOP content into the extra-instructions field of the
|
|
5
|
+
* Aider YAML config file.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { join, dirname } from 'node:path';
|
|
11
|
+
import { access, writeFile, rename, mkdir } from 'node:fs/promises';
|
|
12
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
13
|
+
import { hashFile } from '../lib/hash.js';
|
|
14
|
+
import { newIso } from '@intutic/id';
|
|
15
|
+
const CONFIG_FILE = '.aider.conf.yml';
|
|
16
|
+
export const aiderAdapter = {
|
|
17
|
+
type: HarnessType.AIDER,
|
|
18
|
+
configFileName: CONFIG_FILE,
|
|
19
|
+
async detect(workspaceRoot) {
|
|
20
|
+
try {
|
|
21
|
+
await access(join(workspaceRoot, CONFIG_FILE));
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
async writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
29
|
+
if (sops.length === 0)
|
|
30
|
+
return null;
|
|
31
|
+
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
32
|
+
const tmpPath = filePath + '.intutic-tmp';
|
|
33
|
+
const instructions = sops
|
|
34
|
+
.map((sop) => `## ${sop.title}\n\n${sop.content}`)
|
|
35
|
+
.join('\n\n---\n\n');
|
|
36
|
+
// YAML format — extra-instructions is a multi-line string
|
|
37
|
+
const yaml = [
|
|
38
|
+
'# Intutic Governance Rules (auto-generated)',
|
|
39
|
+
'# DO NOT EDIT — managed by intutic sync daemon',
|
|
40
|
+
`# Last sync: ${newIso()}`,
|
|
41
|
+
'',
|
|
42
|
+
`# Proxy URL: ${proxyUrl}`,
|
|
43
|
+
'',
|
|
44
|
+
'extra-instructions: |',
|
|
45
|
+
...instructions.split('\n').map((line) => ` ${line}`),
|
|
46
|
+
'',
|
|
47
|
+
].join('\n');
|
|
48
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
49
|
+
await writeFile(tmpPath, yaml, 'utf-8');
|
|
50
|
+
await rename(tmpPath, filePath);
|
|
51
|
+
return filePath;
|
|
52
|
+
},
|
|
53
|
+
async readCurrentHash(workspaceRoot) {
|
|
54
|
+
try {
|
|
55
|
+
return await hashFile(join(workspaceRoot, CONFIG_FILE));
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=aider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aider.js","sourceRoot":"","sources":["../../src/harness/aider.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,M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CAAC,CAAA;QACnD,MAAM,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;QACvC,MAAM,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;QAC/B,OAAO,QAAQ,CAAA;IACjB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,aAAqB;QACzC,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAA;QACzD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Antigravity adapter — .gemini/settings.json
|
|
3
|
+
*
|
|
4
|
+
* Merges SOP content into the customInstructions field of the
|
|
5
|
+
* Gemini settings JSON file.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { IHarnessAdapter } from './types.js';
|
|
11
|
+
export declare const antigravityAdapter: IHarnessAdapter;
|
|
12
|
+
//# sourceMappingURL=antigravity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antigravity.d.ts","sourceRoot":"","sources":["../../src/harness/antigravity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAMjD,eAAO,MAAM,kBAAkB,EAAE,eAsDhC,CAAA"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Antigravity adapter — .gemini/settings.json
|
|
3
|
+
*
|
|
4
|
+
* Merges SOP content into the customInstructions field of the
|
|
5
|
+
* Gemini settings JSON file.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { access, readFile, writeFile, rename, mkdir } from 'node:fs/promises';
|
|
12
|
+
import { dirname } from 'node:path';
|
|
13
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
14
|
+
import { hashFile } from '../lib/hash.js';
|
|
15
|
+
import { newIso } from '@intutic/id';
|
|
16
|
+
const CONFIG_FILE = '.gemini/settings.json';
|
|
17
|
+
export const antigravityAdapter = {
|
|
18
|
+
type: HarnessType.ANTIGRAVITY,
|
|
19
|
+
configFileName: CONFIG_FILE,
|
|
20
|
+
async detect(workspaceRoot) {
|
|
21
|
+
try {
|
|
22
|
+
await access(join(workspaceRoot, '.gemini'));
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
async writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
30
|
+
if (sops.length === 0)
|
|
31
|
+
return null;
|
|
32
|
+
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
33
|
+
const tmpPath = filePath + '.intutic-tmp';
|
|
34
|
+
// Read existing settings or start fresh
|
|
35
|
+
let settings = {};
|
|
36
|
+
try {
|
|
37
|
+
const existing = await readFile(filePath, 'utf-8');
|
|
38
|
+
settings = JSON.parse(existing);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
// No existing file — start fresh
|
|
42
|
+
}
|
|
43
|
+
// Merge governance instructions
|
|
44
|
+
const instructions = sops
|
|
45
|
+
.map((sop) => `## ${sop.title}\n\n${sop.content}`)
|
|
46
|
+
.join('\n\n---\n\n');
|
|
47
|
+
settings.customInstructions = [
|
|
48
|
+
'# Intutic Governance Rules (auto-generated)',
|
|
49
|
+
`# DO NOT EDIT — managed by intutic sync daemon`,
|
|
50
|
+
`# Last sync: ${newIso()}`,
|
|
51
|
+
`# Proxy URL: ${proxyUrl}`,
|
|
52
|
+
'',
|
|
53
|
+
instructions,
|
|
54
|
+
].join('\n');
|
|
55
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
56
|
+
await writeFile(tmpPath, JSON.stringify(settings, null, 2) + '\n', 'utf-8');
|
|
57
|
+
await rename(tmpPath, filePath);
|
|
58
|
+
return filePath;
|
|
59
|
+
},
|
|
60
|
+
async readCurrentHash(workspaceRoot) {
|
|
61
|
+
try {
|
|
62
|
+
return await hashFile(join(workspaceRoot, CONFIG_FILE));
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=antigravity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"antigravity.js","sourceRoot":"","sources":["../../src/harness/antigravity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,WAAW,GAAG,uBAAuB,CAAA;AAE3C,MAAM,CAAC,MAAM,kBAAkB,GAAoB;IACjD,IAAI,EAAE,WAAW,CAAC,WAAW;IAC7B,cAAc,EAAE,WAAW;IAE3B,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC,CAAA;YAC5C,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC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CAAC,eAAe,CAAC,aAAqB;QACzC,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAA;QACzD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base adapter — shared logic for file-write harnesses.
|
|
3
|
+
*
|
|
4
|
+
* Cursor, Claude Code, Windsurf, and Aider all follow the same
|
|
5
|
+
* pattern: detect by file existence, write markdown/text, hash file.
|
|
6
|
+
*
|
|
7
|
+
* LLD #8 — Sync Daemon / CLI
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { HarnessType, SyncSopEntry } from '@intutic/shared-types';
|
|
11
|
+
import type { IHarnessAdapter } from './types.js';
|
|
12
|
+
/** Build markdown content from SOPs (Cursor, Claude Code, Windsurf). */
|
|
13
|
+
export declare function buildMarkdownContent(sops: SyncSopEntry[], proxyUrl: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Create a file-based harness adapter for markdown-style config files.
|
|
16
|
+
*
|
|
17
|
+
* Used by: Cursor (.cursorrules), Claude Code (CLAUDE.md), Windsurf (.windsurfrules)
|
|
18
|
+
*/
|
|
19
|
+
export declare function createMarkdownAdapter(type: HarnessType, configFileName: string): IHarnessAdapter;
|
|
20
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/harness/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAejD,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAOnF;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,WAAW,EACjB,cAAc,EAAE,MAAM,GACrB,eAAe,CAiCjB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base adapter — shared logic for file-write harnesses.
|
|
3
|
+
*
|
|
4
|
+
* Cursor, Claude Code, Windsurf, and Aider all follow the same
|
|
5
|
+
* pattern: detect by file existence, write markdown/text, hash file.
|
|
6
|
+
*
|
|
7
|
+
* LLD #8 — Sync Daemon / CLI
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { access, writeFile, rename, mkdir } from 'node:fs/promises';
|
|
12
|
+
import { dirname } from 'node:path';
|
|
13
|
+
import { hashFile } from '../lib/hash.js';
|
|
14
|
+
import { newIso } from '@intutic/id';
|
|
15
|
+
/** Header prepended to all governance config files. */
|
|
16
|
+
function buildHeader() {
|
|
17
|
+
return [
|
|
18
|
+
'# Intutic Governance Rules (auto-generated)',
|
|
19
|
+
'# DO NOT EDIT — managed by intutic sync daemon',
|
|
20
|
+
`# Last sync: ${newIso()}`,
|
|
21
|
+
'',
|
|
22
|
+
'',
|
|
23
|
+
].join('\n');
|
|
24
|
+
}
|
|
25
|
+
/** Build markdown content from SOPs (Cursor, Claude Code, Windsurf). */
|
|
26
|
+
export function buildMarkdownContent(sops, proxyUrl) {
|
|
27
|
+
const header = buildHeader();
|
|
28
|
+
const proxySection = `> **Proxy URL:** \`${proxyUrl}\`\n\n`;
|
|
29
|
+
const sopSections = sops
|
|
30
|
+
.map((sop) => `## ${sop.title}\n\n${sop.content}`)
|
|
31
|
+
.join('\n\n---\n\n');
|
|
32
|
+
return header + proxySection + sopSections + '\n';
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create a file-based harness adapter for markdown-style config files.
|
|
36
|
+
*
|
|
37
|
+
* Used by: Cursor (.cursorrules), Claude Code (CLAUDE.md), Windsurf (.windsurfrules)
|
|
38
|
+
*/
|
|
39
|
+
export function createMarkdownAdapter(type, configFileName) {
|
|
40
|
+
return {
|
|
41
|
+
type,
|
|
42
|
+
configFileName,
|
|
43
|
+
async detect(workspaceRoot) {
|
|
44
|
+
try {
|
|
45
|
+
await access(join(workspaceRoot, configFileName));
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
async writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
53
|
+
if (sops.length === 0)
|
|
54
|
+
return null;
|
|
55
|
+
const filePath = join(workspaceRoot, configFileName);
|
|
56
|
+
const tmpPath = filePath + '.intutic-tmp';
|
|
57
|
+
const content = buildMarkdownContent(sops, proxyUrl);
|
|
58
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
59
|
+
await writeFile(tmpPath, content, 'utf-8');
|
|
60
|
+
await rename(tmpPath, filePath);
|
|
61
|
+
return filePath;
|
|
62
|
+
},
|
|
63
|
+
async readCurrentHash(workspaceRoot) {
|
|
64
|
+
try {
|
|
65
|
+
return await hashFile(join(workspaceRoot, configFileName));
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/harness/base.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAY,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAGnC,OAAO,EAAE,QAAQ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G,cAAc,CAAA;YACzC,MAAM,OAAO,GAAG,oBAAoB,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;YACpD,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;YACnD,MAAM,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;YAC1C,MAAM,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;YAC/B,OAAO,QAAQ,CAAA;QACjB,CAAC;QAED,KAAK,CAAC,eAAe,CAAC,aAAqB;YACzC,IAAI,CAAC;gBACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC,CAAA;YAC5D,CAAC;YAAC,MAAM,CAAC;gBACP,OAAO,IAAI,CAAA;YACb,CAAC;QACH,CAAC;KACF,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claudeCode.d.ts","sourceRoot":"","sources":["../../src/harness/claudeCode.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,iBAAiB,sCAA8D,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Claude Code adapter — CLAUDE.md
|
|
3
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
7
|
+
import { createMarkdownAdapter } from './base.js';
|
|
8
|
+
export const claudeCodeAdapter = createMarkdownAdapter(HarnessType.CLAUDE_CODE, 'CLAUDE.md');
|
|
9
|
+
//# sourceMappingURL=claudeCode.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claudeCode.js","sourceRoot":"","sources":["../../src/harness/claudeCode.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,WAAW,CAAC,WAAW,EAAE,WAAW,CAAC,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex adapter — .env.intutic
|
|
3
|
+
*
|
|
4
|
+
* Codex uses environment variables for configuration. Since we can't
|
|
5
|
+
* inject env vars into a running process, we write a .env.intutic file
|
|
6
|
+
* with proxy URL variables that Codex can source.
|
|
7
|
+
*
|
|
8
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { IHarnessAdapter } from './types.js';
|
|
12
|
+
export declare const codexAdapter: IHarnessAdapter;
|
|
13
|
+
//# sourceMappingURL=codex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../src/harness/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAMjD,eAAO,MAAM,YAAY,EAAE,eAwD1B,CAAA"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Codex adapter — .env.intutic
|
|
3
|
+
*
|
|
4
|
+
* Codex uses environment variables for configuration. Since we can't
|
|
5
|
+
* inject env vars into a running process, we write a .env.intutic file
|
|
6
|
+
* with proxy URL variables that Codex can source.
|
|
7
|
+
*
|
|
8
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { join, dirname } from 'node:path';
|
|
12
|
+
import { writeFile, rename, mkdir } from 'node:fs/promises';
|
|
13
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
14
|
+
import { hashFile } from '../lib/hash.js';
|
|
15
|
+
import { newIso } from '@intutic/id';
|
|
16
|
+
const CONFIG_FILE = '.env.intutic';
|
|
17
|
+
export const codexAdapter = {
|
|
18
|
+
type: HarnessType.CODEX,
|
|
19
|
+
configFileName: CONFIG_FILE,
|
|
20
|
+
async detect(_workspaceRoot) {
|
|
21
|
+
// Codex detection: check for CODEX_HOME env var or codex in PATH
|
|
22
|
+
if (process.env.CODEX_HOME)
|
|
23
|
+
return true;
|
|
24
|
+
// Basic PATH check
|
|
25
|
+
const pathDirs = (process.env.PATH ?? '').split(process.platform === 'win32' ? ';' : ':');
|
|
26
|
+
try {
|
|
27
|
+
const { accessSync } = await import('node:fs');
|
|
28
|
+
for (const dir of pathDirs) {
|
|
29
|
+
try {
|
|
30
|
+
accessSync(join(dir, 'codex'));
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
// Not in this dir
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Fallback — not detected
|
|
40
|
+
}
|
|
41
|
+
return false;
|
|
42
|
+
},
|
|
43
|
+
async writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
44
|
+
if (sops.length === 0)
|
|
45
|
+
return null;
|
|
46
|
+
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
47
|
+
const tmpPath = filePath + '.intutic-tmp';
|
|
48
|
+
const envContent = [
|
|
49
|
+
'# Intutic Governance Rules (auto-generated)',
|
|
50
|
+
'# DO NOT EDIT — managed by intutic sync daemon',
|
|
51
|
+
`# Last sync: ${newIso()}`,
|
|
52
|
+
'# Source this file: source .env.intutic',
|
|
53
|
+
'',
|
|
54
|
+
`ANTHROPIC_BASE_URL=${proxyUrl}`,
|
|
55
|
+
`OPENAI_BASE_URL=${proxyUrl}`,
|
|
56
|
+
`INTUTIC_PROXY_URL=${proxyUrl}`,
|
|
57
|
+
`INTUTIC_SOP_COUNT=${sops.length}`,
|
|
58
|
+
'',
|
|
59
|
+
].join('\n');
|
|
60
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
61
|
+
await writeFile(tmpPath, envContent, 'utf-8');
|
|
62
|
+
await rename(tmpPath, filePath);
|
|
63
|
+
return filePath;
|
|
64
|
+
},
|
|
65
|
+
async readCurrentHash(workspaceRoot) {
|
|
66
|
+
try {
|
|
67
|
+
return await hashFile(join(workspaceRoot, CONFIG_FILE));
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=codex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../../src/harness/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,MAAM,WAAW,GAAG,cAAc,CAAA;AAElC,MAAM,CAAC,MAAM,YAAY,GAAoB;IAC3C,IAAI,EAAE,WAAW,CAAC,KAAK;IACvB,cAAc,EAAE,WAAW;IAE3B,KAAK,CAAC,MAAM,CAAC,cAAsB;QACjC,iEAAiE;QACjE,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU;YAAE,OAAO,IAAI,CAAA;QACvC,mBAAmB;QACnB,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QACzF,IAAI,CA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ACzC,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAA;QACzD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../src/harness/cursor.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,aAAa,sCAA4D,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor adapter — .cursorrules
|
|
3
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
7
|
+
import { createMarkdownAdapter } from './base.js';
|
|
8
|
+
export const cursorAdapter = createMarkdownAdapter(HarnessType.CURSOR, '.cursorrules');
|
|
9
|
+
//# sourceMappingURL=cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../src/harness/cursor.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAEjD,MAAM,CAAC,MAAM,aAAa,GAAG,qBAAqB,CAAC,WAAW,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Harness detector — auto-detect which AI harnesses are present.
|
|
3
|
+
*
|
|
4
|
+
* Instantiates all 8 adapters and checks each for presence in
|
|
5
|
+
* the workspace. Returns a DetectedHarness array for reporting.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* LLD #8 — Sync Daemon / CLI
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { DetectedHarness } from '@intutic/shared-types';
|
|
12
|
+
import type { IHarnessAdapter } from './types.js';
|
|
13
|
+
/** All registered harness adapters. */
|
|
14
|
+
export declare const ALL_ADAPTERS: IHarnessAdapter[];
|
|
15
|
+
/**
|
|
16
|
+
* Detect which harnesses are present in a workspace.
|
|
17
|
+
*
|
|
18
|
+
* @param workspaceRoot - Absolute path to workspace root
|
|
19
|
+
* @returns Array of DetectedHarness results
|
|
20
|
+
*/
|
|
21
|
+
export declare function detectHarnesses(workspaceRoot: string): Promise<DetectedHarness[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Get adapter for a specific harness type.
|
|
24
|
+
*
|
|
25
|
+
* @param type - Harness type to look up
|
|
26
|
+
* @returns The adapter, or undefined if not found
|
|
27
|
+
*/
|
|
28
|
+
export declare function getAdapter(type: string): IHarnessAdapter | undefined;
|
|
29
|
+
//# sourceMappingURL=detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.d.ts","sourceRoot":"","sources":["../../src/harness/detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAWjD,uCAAuC;AACvC,eAAO,MAAM,YAAY,EAAE,eAAe,EASzC,CAAA;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAgBvF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAEpE"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Harness detector — auto-detect which AI harnesses are present.
|
|
3
|
+
*
|
|
4
|
+
* Instantiates all 8 adapters and checks each for presence in
|
|
5
|
+
* the workspace. Returns a DetectedHarness array for reporting.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* LLD #8 — Sync Daemon / CLI
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { cursorAdapter } from './cursor.js';
|
|
12
|
+
import { claudeCodeAdapter } from './claudeCode.js';
|
|
13
|
+
import { antigravityAdapter } from './antigravity.js';
|
|
14
|
+
import { windsurfAdapter } from './windsurf.js';
|
|
15
|
+
import { aiderAdapter } from './aider.js';
|
|
16
|
+
import { openhandsAdapter } from './openhands.js';
|
|
17
|
+
import { codexAdapter } from './codex.js';
|
|
18
|
+
import { n8nAdapter } from './n8n.js';
|
|
19
|
+
import { join } from 'node:path';
|
|
20
|
+
/** All registered harness adapters. */
|
|
21
|
+
export const ALL_ADAPTERS = [
|
|
22
|
+
cursorAdapter,
|
|
23
|
+
claudeCodeAdapter,
|
|
24
|
+
antigravityAdapter,
|
|
25
|
+
windsurfAdapter,
|
|
26
|
+
aiderAdapter,
|
|
27
|
+
openhandsAdapter,
|
|
28
|
+
codexAdapter,
|
|
29
|
+
n8nAdapter,
|
|
30
|
+
];
|
|
31
|
+
/**
|
|
32
|
+
* Detect which harnesses are present in a workspace.
|
|
33
|
+
*
|
|
34
|
+
* @param workspaceRoot - Absolute path to workspace root
|
|
35
|
+
* @returns Array of DetectedHarness results
|
|
36
|
+
*/
|
|
37
|
+
export async function detectHarnesses(workspaceRoot) {
|
|
38
|
+
const results = [];
|
|
39
|
+
for (const adapter of ALL_ADAPTERS) {
|
|
40
|
+
const detected = await adapter.detect(workspaceRoot);
|
|
41
|
+
results.push({
|
|
42
|
+
type: adapter.type,
|
|
43
|
+
configPath: adapter.configFileName
|
|
44
|
+
? join(workspaceRoot, adapter.configFileName)
|
|
45
|
+
: '',
|
|
46
|
+
detected,
|
|
47
|
+
lastWriteAt: null,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
return results;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get adapter for a specific harness type.
|
|
54
|
+
*
|
|
55
|
+
* @param type - Harness type to look up
|
|
56
|
+
* @returns The adapter, or undefined if not found
|
|
57
|
+
*/
|
|
58
|
+
export function getAdapter(type) {
|
|
59
|
+
return ALL_ADAPTERS.find((a) => a.type === type);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detector.js","sourceRoot":"","sources":["../../src/harness/detector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,uCAAuC;AACvC,MAAM,CAAC,MAAM,YAAY,GAAsB;IAC7C,aAAa;IACb,iBAAiB;IACjB,kBAAkB;IAClB,eAAe;IACf,YAAY;IACZ,gBAAgB;IAChB,YAAY;IACZ,UAAU;CACX,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,aAAqB;IACzD,MAAM,OAAO,GAAsB,EAAE,CAAA;IAErC,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,CAAC;QACnC,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;QACpD,OAAO,CAAC,IAAI,CAAC;YACX,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,UAAU,EAAE,OAAO,CAAC,cAAc;gBAChC,CAAC,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,cAAc,CAAC;gBAC7C,CAAC,CAAC,EAAE;YACN,QAAQ;YACR,WAAW,EAAE,IAAI;SAClB,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAA;AAClD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* n8n adapter — STUB (Phase 2)
|
|
3
|
+
*
|
|
4
|
+
* n8n requires API calls to the n8n instance to inject workflow
|
|
5
|
+
* parameters, not file writes. Deferred to Phase 2.
|
|
6
|
+
*
|
|
7
|
+
* Tech Debt: TD-037 — n8n API Adapter
|
|
8
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { IHarnessAdapter } from './types.js';
|
|
12
|
+
export declare const n8nAdapter: IHarnessAdapter;
|
|
13
|
+
//# sourceMappingURL=n8n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n8n.d.ts","sourceRoot":"","sources":["../../src/harness/n8n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,UAAU,EAAE,eAoBxB,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* n8n adapter — STUB (Phase 2)
|
|
3
|
+
*
|
|
4
|
+
* n8n requires API calls to the n8n instance to inject workflow
|
|
5
|
+
* parameters, not file writes. Deferred to Phase 2.
|
|
6
|
+
*
|
|
7
|
+
* Tech Debt: TD-037 — n8n API Adapter
|
|
8
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
12
|
+
export const n8nAdapter = {
|
|
13
|
+
type: HarnessType.N8N,
|
|
14
|
+
configFileName: '',
|
|
15
|
+
async detect(_workspaceRoot) {
|
|
16
|
+
// Phase 2 — TD-037: n8n API adapter
|
|
17
|
+
// Detection would check for n8n instance URL in config or running process
|
|
18
|
+
return false;
|
|
19
|
+
},
|
|
20
|
+
async writeConfig(_workspaceRoot, _sops, _proxyUrl) {
|
|
21
|
+
// Phase 2 — TD-037: n8n API adapter
|
|
22
|
+
// Would call n8n REST API to set workflow parameters
|
|
23
|
+
return null;
|
|
24
|
+
},
|
|
25
|
+
async readCurrentHash(_workspaceRoot) {
|
|
26
|
+
// Phase 2 — TD-037: n8n API adapter
|
|
27
|
+
return null;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=n8n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n8n.js","sourceRoot":"","sources":["../../src/harness/n8n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAInD,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC,IAAI,EAAE,WAAW,CAAC,GAAG;IACrB,cAAc,EAAE,EAAE;IAElB,KAAK,CAAC,MAAM,CAAC,cAAsB;QACjC,oCAAoC;QACpC,0EAA0E;QAC1E,OAAO,KAAK,CAAA;IACd,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,cAAsB,EAAE,KAAqB,EAAE,SAAiB;QAChF,oCAAoC;QACpC,qDAAqD;QACrD,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,cAAsB;QAC1C,oCAAoC;QACpC,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenHands adapter — config.toml
|
|
3
|
+
*
|
|
4
|
+
* Writes SOP content into a [intutic] section of the
|
|
5
|
+
* OpenHands TOML config file.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { IHarnessAdapter } from './types.js';
|
|
11
|
+
export declare const openhandsAdapter: IHarnessAdapter;
|
|
12
|
+
//# sourceMappingURL=openhands.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openhands.d.ts","sourceRoot":"","sources":["../../src/harness/openhands.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAMjD,eAAO,MAAM,gBAAgB,EAAE,eAiD9B,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenHands adapter — config.toml
|
|
3
|
+
*
|
|
4
|
+
* Writes SOP content into a [intutic] section of the
|
|
5
|
+
* OpenHands TOML config file.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { join, dirname } from 'node:path';
|
|
11
|
+
import { access, writeFile, rename, mkdir } from 'node:fs/promises';
|
|
12
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
13
|
+
import { hashFile } from '../lib/hash.js';
|
|
14
|
+
import { newIso } from '@intutic/id';
|
|
15
|
+
const CONFIG_FILE = 'config.toml';
|
|
16
|
+
export const openhandsAdapter = {
|
|
17
|
+
type: HarnessType.OPENHANDS,
|
|
18
|
+
configFileName: CONFIG_FILE,
|
|
19
|
+
async detect(workspaceRoot) {
|
|
20
|
+
try {
|
|
21
|
+
await access(join(workspaceRoot, CONFIG_FILE));
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
async writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
29
|
+
if (sops.length === 0)
|
|
30
|
+
return null;
|
|
31
|
+
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
32
|
+
const tmpPath = filePath + '.intutic-tmp';
|
|
33
|
+
const instructions = sops
|
|
34
|
+
.map((sop) => `## ${sop.title}\n\n${sop.content}`)
|
|
35
|
+
.join('\n\n---\n\n');
|
|
36
|
+
// TOML format — [intutic] section with multi-line string
|
|
37
|
+
const toml = [
|
|
38
|
+
'# Intutic Governance Rules (auto-generated)',
|
|
39
|
+
'# DO NOT EDIT — managed by intutic sync daemon',
|
|
40
|
+
`# Last sync: ${newIso()}`,
|
|
41
|
+
'',
|
|
42
|
+
'[intutic]',
|
|
43
|
+
`proxy_url = "${proxyUrl}"`,
|
|
44
|
+
'instructions = """',
|
|
45
|
+
instructions,
|
|
46
|
+
'"""',
|
|
47
|
+
'',
|
|
48
|
+
].join('\n');
|
|
49
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
50
|
+
await writeFile(tmpPath, toml, 'utf-8');
|
|
51
|
+
await rename(tmpPath, filePath);
|
|
52
|
+
return filePath;
|
|
53
|
+
},
|
|
54
|
+
async readCurrentHash(workspaceRoot) {
|
|
55
|
+
try {
|
|
56
|
+
return await hashFile(join(workspaceRoot, CONFIG_FILE));
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=openhands.js.map
|