@intutic/cli 1.3.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/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/cli.d.ts +14 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +348 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/benchmark.d.ts +31 -0
- package/dist/commands/benchmark.d.ts.map +1 -0
- package/dist/commands/benchmark.js +211 -0
- package/dist/commands/benchmark.js.map +1 -0
- package/dist/commands/budget.d.ts +7 -0
- package/dist/commands/budget.d.ts.map +1 -0
- package/dist/commands/budget.js +68 -0
- package/dist/commands/budget.js.map +1 -0
- package/dist/commands/budgetCompatibility.test.d.ts +2 -0
- package/dist/commands/budgetCompatibility.test.d.ts.map +1 -0
- package/dist/commands/budgetCompatibility.test.js +19 -0
- package/dist/commands/budgetCompatibility.test.js.map +1 -0
- package/dist/commands/connect.d.ts +20 -0
- package/dist/commands/connect.d.ts.map +1 -0
- package/dist/commands/connect.js +1010 -0
- package/dist/commands/connect.js.map +1 -0
- package/dist/commands/doctor.d.ts +23 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +429 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/enterprise-install.d.ts +36 -0
- package/dist/commands/enterprise-install.d.ts.map +1 -0
- package/dist/commands/enterprise-install.js +289 -0
- package/dist/commands/enterprise-install.js.map +1 -0
- package/dist/commands/eval.d.ts +13 -0
- package/dist/commands/eval.d.ts.map +1 -0
- package/dist/commands/eval.js +67 -0
- package/dist/commands/eval.js.map +1 -0
- package/dist/commands/exec.d.ts +34 -0
- package/dist/commands/exec.d.ts.map +1 -0
- package/dist/commands/exec.js +114 -0
- package/dist/commands/exec.js.map +1 -0
- package/dist/commands/exec.test.d.ts +2 -0
- package/dist/commands/exec.test.d.ts.map +1 -0
- package/dist/commands/exec.test.js +29 -0
- package/dist/commands/exec.test.js.map +1 -0
- package/dist/commands/export.d.ts +21 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +116 -0
- package/dist/commands/export.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 +110 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/install-daemon.d.ts +61 -0
- package/dist/commands/install-daemon.d.ts.map +1 -0
- package/dist/commands/install-daemon.js +696 -0
- package/dist/commands/install-daemon.js.map +1 -0
- package/dist/commands/install-daemon.test.d.ts +2 -0
- package/dist/commands/install-daemon.test.d.ts.map +1 -0
- package/dist/commands/install-daemon.test.js +93 -0
- package/dist/commands/install-daemon.test.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/mdm.d.ts +23 -0
- package/dist/commands/mdm.d.ts.map +1 -0
- package/dist/commands/mdm.js +134 -0
- package/dist/commands/mdm.js.map +1 -0
- package/dist/commands/policy.d.ts +19 -0
- package/dist/commands/policy.d.ts.map +1 -0
- package/dist/commands/policy.js +232 -0
- package/dist/commands/policy.js.map +1 -0
- package/dist/commands/prompt.d.ts +11 -0
- package/dist/commands/prompt.d.ts.map +1 -0
- package/dist/commands/prompt.js +71 -0
- package/dist/commands/prompt.js.map +1 -0
- package/dist/commands/skill.d.ts +31 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +349 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/sop-audit.d.ts +17 -0
- package/dist/commands/sop-audit.d.ts.map +1 -0
- package/dist/commands/sop-audit.js +136 -0
- package/dist/commands/sop-audit.js.map +1 -0
- package/dist/commands/sops.d.ts +4 -0
- package/dist/commands/sops.d.ts.map +1 -0
- package/dist/commands/sops.js +88 -0
- package/dist/commands/sops.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 +107 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/syncContext.d.ts +18 -0
- package/dist/commands/syncContext.d.ts.map +1 -0
- package/dist/commands/syncContext.js +37 -0
- package/dist/commands/syncContext.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/keychain.d.ts +28 -0
- package/dist/config/keychain.d.ts.map +1 -0
- package/dist/config/keychain.js +98 -0
- package/dist/config/keychain.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 +93 -0
- package/dist/config/store.js.map +1 -0
- package/dist/harness/aider.d.ts +13 -0
- package/dist/harness/aider.d.ts.map +1 -0
- package/dist/harness/aider.js +48 -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/claudeDesktop.d.ts +18 -0
- package/dist/harness/claudeDesktop.d.ts.map +1 -0
- package/dist/harness/claudeDesktop.js +69 -0
- package/dist/harness/claudeDesktop.js.map +1 -0
- package/dist/harness/cline.d.ts +13 -0
- package/dist/harness/cline.d.ts.map +1 -0
- package/dist/harness/cline.js +75 -0
- package/dist/harness/cline.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 +86 -0
- package/dist/harness/codex.js.map +1 -0
- package/dist/harness/continue.d.ts +14 -0
- package/dist/harness/continue.d.ts.map +1 -0
- package/dist/harness/continue.js +97 -0
- package/dist/harness/continue.js.map +1 -0
- package/dist/harness/cursor.d.ts +14 -0
- package/dist/harness/cursor.d.ts.map +1 -0
- package/dist/harness/cursor.js +65 -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 +81 -0
- package/dist/harness/detector.js.map +1 -0
- package/dist/harness/githubCopilot.d.ts +12 -0
- package/dist/harness/githubCopilot.d.ts.map +1 -0
- package/dist/harness/githubCopilot.js +54 -0
- package/dist/harness/githubCopilot.js.map +1 -0
- package/dist/harness/goose.d.ts +13 -0
- package/dist/harness/goose.d.ts.map +1 -0
- package/dist/harness/goose.js +45 -0
- package/dist/harness/goose.js.map +1 -0
- package/dist/harness/hermes.d.ts +12 -0
- package/dist/harness/hermes.d.ts.map +1 -0
- package/dist/harness/hermes.js +51 -0
- package/dist/harness/hermes.js.map +1 -0
- package/dist/harness/n8n.d.ts +17 -0
- package/dist/harness/n8n.d.ts.map +1 -0
- package/dist/harness/n8n.js +125 -0
- package/dist/harness/n8n.js.map +1 -0
- package/dist/harness/openWebUI.d.ts +13 -0
- package/dist/harness/openWebUI.d.ts.map +1 -0
- package/dist/harness/openWebUI.js +25 -0
- package/dist/harness/openWebUI.js.map +1 -0
- package/dist/harness/openclaw.d.ts +12 -0
- package/dist/harness/openclaw.d.ts.map +1 -0
- package/dist/harness/openclaw.js +51 -0
- package/dist/harness/openclaw.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 +67 -0
- package/dist/harness/openhands.js.map +1 -0
- package/dist/harness/pi.d.ts +12 -0
- package/dist/harness/pi.d.ts.map +1 -0
- package/dist/harness/pi.js +51 -0
- package/dist/harness/pi.js.map +1 -0
- package/dist/harness/rooCode.d.ts +14 -0
- package/dist/harness/rooCode.d.ts.map +1 -0
- package/dist/harness/rooCode.js +77 -0
- package/dist/harness/rooCode.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 +32 -0
- package/dist/harness/types.js.map +1 -0
- package/dist/harness/vscodeSettingsWriter.d.ts +40 -0
- package/dist/harness/vscodeSettingsWriter.d.ts.map +1 -0
- package/dist/harness/vscodeSettingsWriter.js +116 -0
- package/dist/harness/vscodeSettingsWriter.js.map +1 -0
- package/dist/harness/windsurf.d.ts +14 -0
- package/dist/harness/windsurf.d.ts.map +1 -0
- package/dist/harness/windsurf.js +64 -0
- package/dist/harness/windsurf.js.map +1 -0
- package/dist/lib/api.d.ts +48 -0
- package/dist/lib/api.d.ts.map +1 -0
- package/dist/lib/api.js +128 -0
- package/dist/lib/api.js.map +1 -0
- package/dist/lib/envInjector.d.ts +24 -0
- package/dist/lib/envInjector.d.ts.map +1 -0
- package/dist/lib/envInjector.js +149 -0
- package/dist/lib/envInjector.js.map +1 -0
- package/dist/lib/envInjector.test.d.ts +2 -0
- package/dist/lib/envInjector.test.d.ts.map +1 -0
- package/dist/lib/envInjector.test.js +32 -0
- package/dist/lib/envInjector.test.js.map +1 -0
- package/dist/lib/gitHooks.d.ts +19 -0
- package/dist/lib/gitHooks.d.ts.map +1 -0
- package/dist/lib/gitHooks.js +58 -0
- package/dist/lib/gitHooks.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/dist/lib/onboarding.d.ts +10 -0
- package/dist/lib/onboarding.d.ts.map +1 -0
- package/dist/lib/onboarding.js +178 -0
- package/dist/lib/onboarding.js.map +1 -0
- package/dist/lib/process.d.ts +53 -0
- package/dist/lib/process.d.ts.map +1 -0
- package/dist/lib/process.js +181 -0
- package/dist/lib/process.js.map +1 -0
- package/dist/lib/process.test.d.ts +2 -0
- package/dist/lib/process.test.d.ts.map +1 -0
- package/dist/lib/process.test.js +44 -0
- package/dist/lib/process.test.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* goose.ts — Goose adapter (full implementation).
|
|
3
|
+
*
|
|
4
|
+
* Detects the Goose CLI agent, writes SOP rules, injects the Intutic
|
|
5
|
+
* governance plugin (PreToolUse hooks + immutable flags), and merges
|
|
6
|
+
* the proxy URL into ~/.config/goose/config.yaml.
|
|
7
|
+
*
|
|
8
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { access } from 'node:fs/promises';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
import { homedir } from 'node:os';
|
|
14
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
15
|
+
import { hashFile } from '../lib/hash.js';
|
|
16
|
+
import { writeGooseHooks } from '@intutic/sync-daemon/harness/gooseHooks';
|
|
17
|
+
const CONFIG_FILE = '.config/goose/config.yaml';
|
|
18
|
+
const GOOSE_CONFIG = join(homedir(), CONFIG_FILE);
|
|
19
|
+
export const gooseAdapter = {
|
|
20
|
+
type: HarnessType.GOOSE,
|
|
21
|
+
configFileName: CONFIG_FILE,
|
|
22
|
+
async detect(_workspaceRoot) {
|
|
23
|
+
try {
|
|
24
|
+
await access(GOOSE_CONFIG);
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
async writeConfig(_workspaceRoot, sops, proxyUrl) {
|
|
32
|
+
// Write governance plugin + config proxy URL (gooseHooks handles both)
|
|
33
|
+
await writeGooseHooks(proxyUrl);
|
|
34
|
+
return GOOSE_CONFIG;
|
|
35
|
+
},
|
|
36
|
+
async readCurrentHash(_workspaceRoot) {
|
|
37
|
+
try {
|
|
38
|
+
return await hashFile(GOOSE_CONFIG);
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=goose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goose.js","sourceRoot":"","sources":["../../src/harness/goose.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,MAAM,EAA4B,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,IAAI,EAAW,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAEzE,MAAM,WAAW,GAAG,2BAA2B,CAAA;AAC/C,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,CAAC,CAAA;AAEjD,MAAM,CAAC,MAAM,YAAY,GAAoB;IAC3C,IAAI,EAAE,WAAW,CAAC,KAAK;IACvB,cAAc,EAAE,WAAW;IAE3B,KAAK,CAAC,MAAM,CAAC,cAAsB;QACjC,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,YAAY,CAAC,CAAA;YAC1B,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,cAAsB,EAAE,IAAoB,EAAE,QAAgB;QAC9E,uEAAuE;QACvE,MAAM,eAAe,CAAC,QAAQ,CAAC,CAAA;QAC/B,OAAO,YAAY,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,cAAsB;QAC1C,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,YAAY,CAAC,CAAA;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hermes.ts — Hermes adapter.
|
|
3
|
+
*
|
|
4
|
+
* Detects Hermes presence and invokes the sync-daemon hooks compiler
|
|
5
|
+
* to inject Intutic pre-tool use gates.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { IHarnessAdapter } from './types.js';
|
|
11
|
+
export declare const hermesAdapter: IHarnessAdapter;
|
|
12
|
+
//# sourceMappingURL=hermes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../src/harness/hermes.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAOjD,eAAO,MAAM,aAAa,EAAE,eA+B3B,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* hermes.ts — Hermes adapter.
|
|
3
|
+
*
|
|
4
|
+
* Detects Hermes presence and invokes the sync-daemon hooks compiler
|
|
5
|
+
* to inject Intutic pre-tool use gates.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { access } from 'node:fs/promises';
|
|
12
|
+
import { existsSync } from 'node:fs';
|
|
13
|
+
import { homedir } from 'node:os';
|
|
14
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
15
|
+
import { hashFile } from '../lib/hash.js';
|
|
16
|
+
import { loadCredentials } from '../config/store.js';
|
|
17
|
+
import { writeHermesHooks } from '@intutic/sync-daemon';
|
|
18
|
+
const CONFIG_FILE = '.hermes/config.yaml';
|
|
19
|
+
export const hermesAdapter = {
|
|
20
|
+
type: HarnessType.HERMES,
|
|
21
|
+
configFileName: CONFIG_FILE,
|
|
22
|
+
async detect(workspaceRoot) {
|
|
23
|
+
const globalHermes = join(homedir(), '.hermes');
|
|
24
|
+
const localHermes = join(workspaceRoot, CONFIG_FILE);
|
|
25
|
+
try {
|
|
26
|
+
if (existsSync(globalHermes))
|
|
27
|
+
return true;
|
|
28
|
+
await access(localHermes);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
async writeConfig(workspaceRoot, _sops, proxyUrl) {
|
|
36
|
+
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
37
|
+
const creds = await loadCredentials();
|
|
38
|
+
const workspaceId = creds?.workspaceId || 'local';
|
|
39
|
+
await writeHermesHooks(workspaceRoot, proxyUrl, workspaceId);
|
|
40
|
+
return filePath;
|
|
41
|
+
},
|
|
42
|
+
async readCurrentHash(workspaceRoot) {
|
|
43
|
+
try {
|
|
44
|
+
return await hashFile(join(workspaceRoot, CONFIG_FILE));
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|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AK,GAAG,MAAM,eAAe,EAAE,CAAA;QACrC,MAAM,WAAW,GAAG,KAAK,EAAE,WAAW,IAAI,OAAO,CAAA;QACjD,MAAM,gBAAgB,CAAC,aAAa,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;QAC5D,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,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* n8n adapter — Real-time REST parameter sync.
|
|
3
|
+
*
|
|
4
|
+
* Interacts with n8n workflow management API (GET/PUT /api/v1/workflows)
|
|
5
|
+
* to inject Intutic proxy URL and SOP governance rules as workflow variables.
|
|
6
|
+
*
|
|
7
|
+
* Supports local n8n instances by falling back to unauthenticated requests
|
|
8
|
+
* if N8N_API_TOKEN is not provided.
|
|
9
|
+
*
|
|
10
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
11
|
+
* Tech Debt: TD-037 — n8n API Adapter
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
import type { IHarnessAdapter } from './types.js';
|
|
16
|
+
export declare const n8nAdapter: IHarnessAdapter;
|
|
17
|
+
//# sourceMappingURL=n8n.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n8n.d.ts","sourceRoot":"","sources":["../../src/harness/n8n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAkBjD,eAAO,MAAM,UAAU,EAAE,eAuGxB,CAAA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* n8n adapter — Real-time REST parameter sync.
|
|
3
|
+
*
|
|
4
|
+
* Interacts with n8n workflow management API (GET/PUT /api/v1/workflows)
|
|
5
|
+
* to inject Intutic proxy URL and SOP governance rules as workflow variables.
|
|
6
|
+
*
|
|
7
|
+
* Supports local n8n instances by falling back to unauthenticated requests
|
|
8
|
+
* if N8N_API_TOKEN is not provided.
|
|
9
|
+
*
|
|
10
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
11
|
+
* Tech Debt: TD-037 — n8n API Adapter
|
|
12
|
+
*
|
|
13
|
+
* @module
|
|
14
|
+
*/
|
|
15
|
+
import { createHash } from 'node:crypto';
|
|
16
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
17
|
+
// Format SOPs for n8n parameters
|
|
18
|
+
function buildSopsMarkdown(sops) {
|
|
19
|
+
if (sops.length === 0)
|
|
20
|
+
return '';
|
|
21
|
+
return sops.map((sop) => `## ${sop.title}\n\n${sop.content}`).join('\n\n---\n\n') + '\n';
|
|
22
|
+
}
|
|
23
|
+
function getHeaders() {
|
|
24
|
+
const headers = {
|
|
25
|
+
'Content-Type': 'application/json',
|
|
26
|
+
};
|
|
27
|
+
if (process.env.N8N_API_TOKEN) {
|
|
28
|
+
headers['X-N8N-API-KEY'] = process.env.N8N_API_TOKEN;
|
|
29
|
+
}
|
|
30
|
+
return headers;
|
|
31
|
+
}
|
|
32
|
+
export const n8nAdapter = {
|
|
33
|
+
type: HarnessType.N8N,
|
|
34
|
+
configFileName: '',
|
|
35
|
+
async detect(_workspaceRoot) {
|
|
36
|
+
const n8nUrl = process.env.N8N_URL || 'http://localhost:5678';
|
|
37
|
+
try {
|
|
38
|
+
const res = await fetch(`${n8nUrl}/api/v1/health`, { signal: AbortSignal.timeout(1000) });
|
|
39
|
+
return res.status === 200 || res.status === 401 || res.status === 403;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return !!process.env.N8N_API_TOKEN;
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
async writeConfig(_workspaceRoot, sops, proxyUrl) {
|
|
46
|
+
const n8nUrl = process.env.N8N_URL || 'http://localhost:5678';
|
|
47
|
+
const sopsMarkdown = buildSopsMarkdown(sops);
|
|
48
|
+
try {
|
|
49
|
+
// 1. Get list of workflows
|
|
50
|
+
const listRes = await fetch(`${n8nUrl}/api/v1/workflows`, {
|
|
51
|
+
headers: getHeaders(),
|
|
52
|
+
signal: AbortSignal.timeout(5000),
|
|
53
|
+
});
|
|
54
|
+
if (!listRes.ok) {
|
|
55
|
+
throw new Error(`Failed to list workflows: ${listRes.statusText}`);
|
|
56
|
+
}
|
|
57
|
+
const listData = (await listRes.json());
|
|
58
|
+
const workflows = listData.data || [];
|
|
59
|
+
if (workflows.length === 0) {
|
|
60
|
+
return 'n8n:no_workflows';
|
|
61
|
+
}
|
|
62
|
+
// 2. Inject parameters into variables of each workflow
|
|
63
|
+
for (const w of workflows) {
|
|
64
|
+
const detailRes = await fetch(`${n8nUrl}/api/v1/workflows/${w.id}`, {
|
|
65
|
+
headers: getHeaders(),
|
|
66
|
+
signal: AbortSignal.timeout(5000),
|
|
67
|
+
});
|
|
68
|
+
if (!detailRes.ok)
|
|
69
|
+
continue;
|
|
70
|
+
const detail = (await detailRes.json());
|
|
71
|
+
const settings = detail.settings || {};
|
|
72
|
+
const variables = settings.variables || {};
|
|
73
|
+
// Inject Intutic values
|
|
74
|
+
variables.intutic_proxy_url = proxyUrl;
|
|
75
|
+
variables.intutic_governance_rules = sopsMarkdown;
|
|
76
|
+
settings.variables = variables;
|
|
77
|
+
detail.settings = settings;
|
|
78
|
+
// Save updated workflow
|
|
79
|
+
await fetch(`${n8nUrl}/api/v1/workflows/${w.id}`, {
|
|
80
|
+
method: 'PUT',
|
|
81
|
+
headers: getHeaders(),
|
|
82
|
+
body: JSON.stringify(detail),
|
|
83
|
+
signal: AbortSignal.timeout(5000),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
return `n8n:${workflows.length}_workflows`;
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
console.warn(`[n8n-adapter] failed to sync parameters:`, err);
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
async readCurrentHash(_workspaceRoot) {
|
|
94
|
+
const n8nUrl = process.env.N8N_URL || 'http://localhost:5678';
|
|
95
|
+
try {
|
|
96
|
+
const listRes = await fetch(`${n8nUrl}/api/v1/workflows`, {
|
|
97
|
+
headers: getHeaders(),
|
|
98
|
+
signal: AbortSignal.timeout(3000),
|
|
99
|
+
});
|
|
100
|
+
if (!listRes.ok)
|
|
101
|
+
return null;
|
|
102
|
+
const listData = (await listRes.json());
|
|
103
|
+
const workflows = listData.data || [];
|
|
104
|
+
if (workflows.length === 0)
|
|
105
|
+
return null;
|
|
106
|
+
// Fetch the first workflow's variables to compute the hash
|
|
107
|
+
const firstId = workflows[0].id;
|
|
108
|
+
const detailRes = await fetch(`${n8nUrl}/api/v1/workflows/${firstId}`, {
|
|
109
|
+
headers: getHeaders(),
|
|
110
|
+
signal: AbortSignal.timeout(3000),
|
|
111
|
+
});
|
|
112
|
+
if (!detailRes.ok)
|
|
113
|
+
return null;
|
|
114
|
+
const detail = (await detailRes.json());
|
|
115
|
+
const rules = detail.settings?.variables?.intutic_governance_rules || '';
|
|
116
|
+
if (!rules)
|
|
117
|
+
return null;
|
|
118
|
+
return createHash('sha256').update(rules, 'utf-8').digest('hex');
|
|
119
|
+
}
|
|
120
|
+
catch {
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=n8n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n8n.js","sourceRoot":"","sources":["../../src/harness/n8n.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,WAAW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AAK,CAAC;gBAAE,OAAO,IAAI,CAAA;YAEvC,2DAA2D;YAC3D,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;YAC/B,MAAM,SAAS,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,qBAAqB,OAAO,EAAE,EAAE;gBACrE,OAAO,EAAE,UAAU,EAAE;gBACrB,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC;aAClC,CAAC,CAAA;YAEF,IAAI,CAAC,SAAS,CAAC,EAAE;gBAAE,OAAO,IAAI,CAAA;YAE9B,MAAM,MAAM,GAAG,CAAC,MAAM,SAAS,CAAC,IAAI,EAAE,CAAQ,CAAA;YAC9C,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,wBAAwB,IAAI,EAAE,CAAA;YACxE,IAAI,CAAC,KAAK;gBAAE,OAAO,IAAI,CAAA;YAEvB,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QAClE,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenWebUI adapter — detection-only stub for the OpenWebUI interface.
|
|
3
|
+
*
|
|
4
|
+
* OpenWebUI is a Docker-based service and cannot be reliably detected
|
|
5
|
+
* via filesystem checks. Detection always returns false; the harness
|
|
6
|
+
* can be manually enabled via CLI flags or org config.
|
|
7
|
+
*
|
|
8
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import type { IHarnessAdapter } from './types.js';
|
|
12
|
+
export declare const openWebUIAdapter: IHarnessAdapter;
|
|
13
|
+
//# sourceMappingURL=openWebUI.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openWebUI.d.ts","sourceRoot":"","sources":["../../src/harness/openWebUI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,gBAAgB,EAAE,eAe9B,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenWebUI adapter — detection-only stub for the OpenWebUI interface.
|
|
3
|
+
*
|
|
4
|
+
* OpenWebUI is a Docker-based service and cannot be reliably detected
|
|
5
|
+
* via filesystem checks. Detection always returns false; the harness
|
|
6
|
+
* can be manually enabled via CLI flags or org config.
|
|
7
|
+
*
|
|
8
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
9
|
+
* @module
|
|
10
|
+
*/
|
|
11
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
12
|
+
export const openWebUIAdapter = {
|
|
13
|
+
type: HarnessType.OPEN_WEBUI,
|
|
14
|
+
configFileName: '',
|
|
15
|
+
async detect(_workspaceRoot) {
|
|
16
|
+
return false;
|
|
17
|
+
},
|
|
18
|
+
async writeConfig() {
|
|
19
|
+
return null;
|
|
20
|
+
},
|
|
21
|
+
async readCurrentHash() {
|
|
22
|
+
return null;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=openWebUI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openWebUI.js","sourceRoot":"","sources":["../../src/harness/openWebUI.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,IAAI,EAAE,WAAW,CAAC,UAAU;IAC5B,cAAc,EAAE,EAAE;IAElB,KAAK,CAAC,MAAM,CAAC,cAAsB;QACjC,OAAO,KAAK,CAAA;IACd,CAAC;IAED,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAA;IACb,CAAC;IAED,KAAK,CAAC,eAAe;QACnB,OAAO,IAAI,CAAA;IACb,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* openclaw.ts — OpenClaw adapter.
|
|
3
|
+
*
|
|
4
|
+
* Detects OpenClaw presence and invokes the sync-daemon hooks compiler
|
|
5
|
+
* to inject Intutic pre-tool use gates.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { IHarnessAdapter } from './types.js';
|
|
11
|
+
export declare const openclawAdapter: IHarnessAdapter;
|
|
12
|
+
//# sourceMappingURL=openclaw.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openclaw.d.ts","sourceRoot":"","sources":["../../src/harness/openclaw.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAOjD,eAAO,MAAM,eAAe,EAAE,eA+B7B,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* openclaw.ts — OpenClaw adapter.
|
|
3
|
+
*
|
|
4
|
+
* Detects OpenClaw presence and invokes the sync-daemon hooks compiler
|
|
5
|
+
* to inject Intutic pre-tool use gates.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { access } from 'node:fs/promises';
|
|
12
|
+
import { existsSync } from 'node:fs';
|
|
13
|
+
import { homedir } from 'node:os';
|
|
14
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
15
|
+
import { hashFile } from '../lib/hash.js';
|
|
16
|
+
import { loadCredentials } from '../config/store.js';
|
|
17
|
+
import { writeOpenclawHooks } from '@intutic/sync-daemon';
|
|
18
|
+
const CONFIG_FILE = '.openclaw/openclaw.json';
|
|
19
|
+
export const openclawAdapter = {
|
|
20
|
+
type: HarnessType.OPENCLAW,
|
|
21
|
+
configFileName: CONFIG_FILE,
|
|
22
|
+
async detect(workspaceRoot) {
|
|
23
|
+
const globalOpenclaw = join(homedir(), '.openclaw');
|
|
24
|
+
const localOpenclaw = join(workspaceRoot, CONFIG_FILE);
|
|
25
|
+
try {
|
|
26
|
+
if (existsSync(globalOpenclaw))
|
|
27
|
+
return true;
|
|
28
|
+
await access(localOpenclaw);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
async writeConfig(workspaceRoot, _sops, proxyUrl) {
|
|
36
|
+
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
37
|
+
const creds = await loadCredentials();
|
|
38
|
+
const workspaceId = creds?.workspaceId || 'local';
|
|
39
|
+
await writeOpenclawHooks(workspaceRoot, proxyUrl, workspaceId);
|
|
40
|
+
return filePath;
|
|
41
|
+
},
|
|
42
|
+
async readCurrentHash(workspaceRoot) {
|
|
43
|
+
try {
|
|
44
|
+
return await hashFile(join(workspaceRoot, CONFIG_FILE));
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=openclaw.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openclaw.js","sourceRoot":"","sources":["../../src/harness/openclaw.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAA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C,CAAC,CAAA;QACzD,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;CACF,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* openhands.ts — OpenHands adapter (full implementation with hooks + llm.base_url).
|
|
3
|
+
*
|
|
4
|
+
* Writes SOP content into config.toml, injects PreToolUse hooks via
|
|
5
|
+
* .openhands/hooks.json, and writes llm.base_url into the [llm] section.
|
|
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;AAOjD,eAAO,MAAM,gBAAgB,EAAE,eAuD9B,CAAA"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* openhands.ts — OpenHands adapter (full implementation with hooks + llm.base_url).
|
|
3
|
+
*
|
|
4
|
+
* Writes SOP content into config.toml, injects PreToolUse hooks via
|
|
5
|
+
* .openhands/hooks.json, and writes llm.base_url into the [llm] section.
|
|
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
|
+
import { writeOpenHandsHooks } from '@intutic/sync-daemon/harness/openhandsHooks';
|
|
16
|
+
const CONFIG_FILE = 'config.toml';
|
|
17
|
+
export const openhandsAdapter = {
|
|
18
|
+
type: HarnessType.OPENHANDS,
|
|
19
|
+
configFileName: CONFIG_FILE,
|
|
20
|
+
async detect(workspaceRoot) {
|
|
21
|
+
try {
|
|
22
|
+
await access(join(workspaceRoot, CONFIG_FILE));
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
async writeConfig(workspaceRoot, sops, proxyUrl) {
|
|
30
|
+
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
31
|
+
const tmpPath = filePath + '.intutic-tmp';
|
|
32
|
+
const instructions = sops.length > 0
|
|
33
|
+
? sops.map((sop) => `## ${sop.title}\n\n${sop.content}`).join('\n\n---\n\n')
|
|
34
|
+
: '# Intutic governance active — no SOP rules configured yet.';
|
|
35
|
+
// TOML — [intutic] section for SOP text + [llm] for proxy base_url
|
|
36
|
+
const toml = [
|
|
37
|
+
'# Intutic Governance Rules (auto-generated)',
|
|
38
|
+
'# DO NOT EDIT — managed by intutic sync daemon',
|
|
39
|
+
`# Last sync: ${newIso()}`,
|
|
40
|
+
'',
|
|
41
|
+
'[intutic]',
|
|
42
|
+
`proxy_url = "${proxyUrl}"`,
|
|
43
|
+
'instructions = """',
|
|
44
|
+
instructions,
|
|
45
|
+
'"""',
|
|
46
|
+
'',
|
|
47
|
+
'[llm]',
|
|
48
|
+
`base_url = "${proxyUrl}"`,
|
|
49
|
+
'',
|
|
50
|
+
].join('\n');
|
|
51
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
52
|
+
await writeFile(tmpPath, toml, 'utf-8');
|
|
53
|
+
await rename(tmpPath, filePath);
|
|
54
|
+
// Inject .openhands/hooks.json PreToolUse hook
|
|
55
|
+
await writeOpenHandsHooks(workspaceRoot, proxyUrl);
|
|
56
|
+
return filePath;
|
|
57
|
+
},
|
|
58
|
+
async readCurrentHash(workspaceRoot) {
|
|
59
|
+
try {
|
|
60
|
+
return await hashFile(join(workspaceRoot, CONFIG_FILE));
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=openhands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openhands.js","sourceRoot":"","sources":["../../src/harness/openhands.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,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6CAA6C,CAAA;AAEjF,MAAM,WAAW,GAAG,aAAa,CAAA;AAEjC,MAAM,CAAC,MAAM,gBAAgB,GAAoB;IAC/C,IAAI,EAAE,WAAW,CAAC,SAAS;IAC3B,cAAc,EAAE,WAAW;IAE3B,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,CAAA;YAC9C,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,aAAqB,EAAE,IAAoB,EAAE,QAAgB;QAC7E,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;QACjD,MAAM,OAAO,GAAG,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okes the sync-daemon hooks compiler
|
|
5
|
+
* to inject Intutic pre-tool use gates.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import type { IHarnessAdapter } from './types.js';
|
|
11
|
+
export declare const piAdapter: IHarnessAdapter;
|
|
12
|
+
//# sourceMappingURL=pi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pi.d.ts","sourceRoot":"","sources":["../../src/harness/pi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAOjD,eAAO,MAAM,SAAS,EAAE,eA+BvB,CAAA"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* pi.ts — Pi adapter.
|
|
3
|
+
*
|
|
4
|
+
* Detects Pi presence and invokes the sync-daemon hooks compiler
|
|
5
|
+
* to inject Intutic pre-tool use gates.
|
|
6
|
+
*
|
|
7
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
import { join } from 'node:path';
|
|
11
|
+
import { access } from 'node:fs/promises';
|
|
12
|
+
import { existsSync } from 'node:fs';
|
|
13
|
+
import { homedir } from 'node:os';
|
|
14
|
+
import { HarnessType } from '@intutic/shared-types';
|
|
15
|
+
import { hashFile } from '../lib/hash.js';
|
|
16
|
+
import { loadCredentials } from '../config/store.js';
|
|
17
|
+
import { writePiHooks } from '@intutic/sync-daemon';
|
|
18
|
+
const CONFIG_FILE = '.pi/hooks.json';
|
|
19
|
+
export const piAdapter = {
|
|
20
|
+
type: HarnessType.PI,
|
|
21
|
+
configFileName: CONFIG_FILE,
|
|
22
|
+
async detect(workspaceRoot) {
|
|
23
|
+
const globalPi = join(homedir(), '.pi');
|
|
24
|
+
const localPi = join(workspaceRoot, CONFIG_FILE);
|
|
25
|
+
try {
|
|
26
|
+
if (existsSync(globalPi))
|
|
27
|
+
return true;
|
|
28
|
+
await access(localPi);
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
return false;
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
async writeConfig(workspaceRoot, _sops, proxyUrl) {
|
|
36
|
+
const filePath = join(workspaceRoot, CONFIG_FILE);
|
|
37
|
+
const creds = await loadCredentials();
|
|
38
|
+
const workspaceId = creds?.workspaceId || 'local';
|
|
39
|
+
await writePiHooks(workspaceRoot, proxyUrl, workspaceId);
|
|
40
|
+
return filePath;
|
|
41
|
+
},
|
|
42
|
+
async readCurrentHash(workspaceRoot) {
|
|
43
|
+
try {
|
|
44
|
+
return await hashFile(join(workspaceRoot, CONFIG_FILE));
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return null;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=pi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pi.js","sourceRoot":"","sources":["../../src/harness/pi.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGnD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD,MAAM,WAAW,GAAG,gBAAgB,CAAA;AAEpC,MAAM,CAAC,MAAM,SAAS,GAAoB;IACxC,IAAI,EAAE,WAAW,CAAC,EAAE;IACpB,cAAc,EAAE,WAAW;IAE3B,KAAK,CAAC,MAAM,CAAC,aAAqB;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAA;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;QAChD,IAAI,CAAC;YACH,IAAI,UAAU,CAAC,QAAQ,CAAC;gBAAE,OAAO,IAAI,CAAA;YACrC,MAAM,MAAM,CAAC,OAAO,CAAC,CAAA;YACrB,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC;IAED,KAAK,CAAC,WAAW,CAAC,aAAqB,EAAE,KAAqB,EAAE,QAAgB;QAC9E,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAA;QACjD,MAAM,KAAK,GAAG,MAAM,eAAe,EAAE,CAAA;QACrC,MAAM,WAAW,GAAG,KAAK,EAAE,WAAW,IAAI,OAAO,CAAA;QACjD,MAAM,YAAY,CAAC,aAAa,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAA;QACxD,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,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* rooCode.ts — Roo Code adapter (full implementation).
|
|
3
|
+
*
|
|
4
|
+
* Detects the Roo Code VS Code extension, writes Intutic governance rules
|
|
5
|
+
* as .roorules, and configures the proxy base URL via VS Code settings +
|
|
6
|
+
* .env.intutic sidecar. Roo Code's notification hooks are not yet blocking
|
|
7
|
+
* so we rely on proxy (Vector B) and drift guard (Vector C).
|
|
8
|
+
*
|
|
9
|
+
* HLD §3.14 — Harness Onboarding Matrix
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
import type { IHarnessAdapter } from './types.js';
|
|
13
|
+
export declare const rooCodeAdapter: IHarnessAdapter;
|
|
14
|
+
//# sourceMappingURL=rooCode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rooCode.d.ts","sourceRoot":"","sources":["../../src/harness/rooCode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAOjD,eAAO,MAAM,cAAc,EAAE,eA6D5B,CAAA"}
|