@datagusto/cli 0.0.0-stage → 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/LICENSE +21 -0
- package/README.md +186 -2
- package/bin/run.js +5 -0
- package/dist/adapters/claude-code.d.ts +47 -0
- package/dist/adapters/claude-code.js +533 -0
- package/dist/adapters/claude-code.js.map +1 -0
- package/dist/adapters/claude-settings.d.ts +29 -0
- package/dist/adapters/claude-settings.js +115 -0
- package/dist/adapters/claude-settings.js.map +1 -0
- package/dist/adapters/index.d.ts +10 -0
- package/dist/adapters/index.js +37 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/kiro-agent.d.ts +29 -0
- package/dist/adapters/kiro-agent.js +124 -0
- package/dist/adapters/kiro-agent.js.map +1 -0
- package/dist/adapters/kiro.d.ts +24 -0
- package/dist/adapters/kiro.js +740 -0
- package/dist/adapters/kiro.js.map +1 -0
- package/dist/adapters/types.d.ts +79 -0
- package/dist/adapters/types.js +14 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/api/client.d.ts +36 -0
- package/dist/api/client.js +85 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/errors.d.ts +4 -0
- package/dist/api/errors.js +25 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/commands/remove.d.ts +13 -0
- package/dist/commands/remove.js +59 -0
- package/dist/commands/remove.js.map +1 -0
- package/dist/commands/setup.d.ts +16 -0
- package/dist/commands/setup.js +114 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/status.d.ts +7 -0
- package/dist/commands/status.js +53 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/display.d.ts +2 -0
- package/dist/display.js +8 -0
- package/dist/display.js.map +1 -0
- package/dist/fs/atomic.d.ts +17 -0
- package/dist/fs/atomic.js +41 -0
- package/dist/fs/atomic.js.map +1 -0
- package/dist/key-input.d.ts +24 -0
- package/dist/key-input.js +96 -0
- package/dist/key-input.js.map +1 -0
- package/dist/state/installs.d.ts +24 -0
- package/dist/state/installs.js +110 -0
- package/dist/state/installs.js.map +1 -0
- package/dist/vendor.d.ts +16 -0
- package/dist/vendor.js +60 -0
- package/dist/vendor.js.map +1 -0
- package/package.json +57 -4
- package/vendor/claude_code/.claude-plugin/plugin.json +55 -0
- package/vendor/claude_code/README.md +267 -0
- package/vendor/claude_code/dist/api-client.js +82 -0
- package/vendor/claude_code/dist/builtin-tools.generated.js +33 -0
- package/vendor/claude_code/dist/extractors.js +201 -0
- package/vendor/claude_code/dist/index.js +695 -0
- package/vendor/claude_code/dist/monitoring.js +66 -0
- package/vendor/claude_code/dist/state.js +71 -0
- package/vendor/claude_code/dist/types.js +5 -0
- package/vendor/claude_code/hooks/hooks.json +25 -0
- package/vendor/claude_code/package.json +26 -0
- package/vendor/kiro/.kiro/agents/kiro_default.json +20 -0
- package/vendor/kiro/.kiro/hooks/datagusto-post-tool-use.json +10 -0
- package/vendor/kiro/.kiro/hooks/datagusto-pre-tool-use.json +10 -0
- package/vendor/kiro/.kiro/hooks/datagusto-session-start.json +10 -0
- package/vendor/kiro/.kiro/hooks/datagusto-stop.json +10 -0
- package/vendor/kiro/.kiro/hooks/datagusto-user-prompt-submit.json +10 -0
- package/vendor/kiro/dist/api-client.js +82 -0
- package/vendor/kiro/dist/builtin-tools.generated.js +87 -0
- package/vendor/kiro/dist/engine.js +65 -0
- package/vendor/kiro/dist/extractors.js +201 -0
- package/vendor/kiro/dist/index.js +735 -0
- package/vendor/kiro/dist/monitoring.js +66 -0
- package/vendor/kiro/dist/state.js +71 -0
- package/vendor/kiro/dist/types.js +5 -0
- package/vendor/kiro/package.json +25 -0
- package/vendor/manifest.json +42 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// dg CLI - hook entries in ~/.claude/settings.json
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
//
|
|
5
|
+
// The hooks the plugin declares in hooks/hooks.json are merged into the
|
|
6
|
+
// user's settings, which is how Claude Code gets to run them. This file
|
|
7
|
+
// belongs to the user, so (ADR-0003 TR-5):
|
|
8
|
+
//
|
|
9
|
+
// - a file that isn't valid JSON is never rewritten
|
|
10
|
+
// - only entries whose command points into a dg-owned folder are added or
|
|
11
|
+
// removed; everything else is written back as it was read
|
|
12
|
+
// - a symlinked settings.json (dotfile managers) is written through, not
|
|
13
|
+
// replaced, and the file keeps its mode
|
|
14
|
+
import { readFile, realpath, stat } from "node:fs/promises";
|
|
15
|
+
import { dirname } from "node:path";
|
|
16
|
+
import { ensureDir, writeFileAtomic } from "../fs/atomic.js";
|
|
17
|
+
import { AdapterError } from "./types.js";
|
|
18
|
+
export async function readSettings(path) {
|
|
19
|
+
let realPath;
|
|
20
|
+
try {
|
|
21
|
+
realPath = await realpath(path);
|
|
22
|
+
}
|
|
23
|
+
catch (err) {
|
|
24
|
+
if (err.code !== "ENOENT")
|
|
25
|
+
throw err;
|
|
26
|
+
return { path, realPath: path, exists: false, mode: 0o644, data: {} };
|
|
27
|
+
}
|
|
28
|
+
const raw = await readFile(realPath, "utf8");
|
|
29
|
+
let data = {};
|
|
30
|
+
if (raw.trim() !== "") {
|
|
31
|
+
try {
|
|
32
|
+
data = JSON.parse(raw);
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
throw new AdapterError(`${path} isn't valid JSON, so dg won't edit it. Fix the file (Claude Code's /doctor can help), then run this again.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
39
|
+
throw new AdapterError(`${path} isn't a JSON object, so dg won't edit it. Fix the file, then run this again.`);
|
|
40
|
+
}
|
|
41
|
+
hooksOf(data, path); // validate the shape up front
|
|
42
|
+
return { path, realPath, exists: true, mode: (await stat(realPath)).mode & 0o777, data: data };
|
|
43
|
+
}
|
|
44
|
+
export async function writeSettings(file) {
|
|
45
|
+
// ~/.claude belongs to Claude Code; create it if needed but don't chmod it.
|
|
46
|
+
if (!file.exists)
|
|
47
|
+
await ensureDirLoose(dirname(file.realPath));
|
|
48
|
+
await writeFileAtomic(file.realPath, JSON.stringify(file.data, null, 2) + "\n", { mode: file.mode });
|
|
49
|
+
}
|
|
50
|
+
/** Remove every handler whose command `isOurs`; returns how many went. */
|
|
51
|
+
export function removeHooks(file, isOurs) {
|
|
52
|
+
const hooks = hooksOf(file.data, file.path);
|
|
53
|
+
if (!hooks)
|
|
54
|
+
return 0;
|
|
55
|
+
let removed = 0;
|
|
56
|
+
for (const [event, groups] of Object.entries(hooks)) {
|
|
57
|
+
const kept = [];
|
|
58
|
+
for (const group of groups) {
|
|
59
|
+
const handlers = group.hooks.filter((h) => !(typeof h.command === "string" && isOurs(h.command)));
|
|
60
|
+
removed += group.hooks.length - handlers.length;
|
|
61
|
+
// Drop a group only if we emptied it; leave the user's own empty groups.
|
|
62
|
+
if (handlers.length > 0 || group.hooks.length === 0)
|
|
63
|
+
kept.push({ ...group, hooks: handlers });
|
|
64
|
+
}
|
|
65
|
+
if (kept.length > 0)
|
|
66
|
+
hooks[event] = kept;
|
|
67
|
+
else
|
|
68
|
+
delete hooks[event];
|
|
69
|
+
}
|
|
70
|
+
if (removed > 0 && Object.keys(hooks).length === 0)
|
|
71
|
+
delete file.data.hooks;
|
|
72
|
+
return removed;
|
|
73
|
+
}
|
|
74
|
+
/** Append `add`'s matcher groups after whatever each event already has. */
|
|
75
|
+
export function addHooks(file, add) {
|
|
76
|
+
const hooks = hooksOf(file.data, file.path) ?? {};
|
|
77
|
+
for (const [event, groups] of Object.entries(add)) {
|
|
78
|
+
hooks[event] = [...(hooks[event] ?? []), ...groups];
|
|
79
|
+
}
|
|
80
|
+
file.data.hooks = hooks;
|
|
81
|
+
}
|
|
82
|
+
/** Events that have at least one handler whose command `isOurs`. */
|
|
83
|
+
export function eventsWithHooks(file, isOurs) {
|
|
84
|
+
const hooks = hooksOf(file.data, file.path) ?? {};
|
|
85
|
+
return Object.keys(hooks).filter((event) => hooks[event].some((g) => g.hooks.some((h) => typeof h.command === "string" && isOurs(h.command))));
|
|
86
|
+
}
|
|
87
|
+
// -- Internal helpers ---------------------------------------------------------
|
|
88
|
+
function hooksOf(data, path) {
|
|
89
|
+
const hooks = data.hooks;
|
|
90
|
+
if (hooks === undefined)
|
|
91
|
+
return undefined;
|
|
92
|
+
const bad = () => new AdapterError(`The "hooks" section of ${path} isn't in the format Claude Code expects, so dg won't edit it.`);
|
|
93
|
+
if (typeof hooks !== "object" || hooks === null || Array.isArray(hooks))
|
|
94
|
+
throw bad();
|
|
95
|
+
for (const groups of Object.values(hooks)) {
|
|
96
|
+
if (!Array.isArray(groups))
|
|
97
|
+
throw bad();
|
|
98
|
+
for (const g of groups) {
|
|
99
|
+
if (typeof g !== "object" || g === null || !Array.isArray(g.hooks))
|
|
100
|
+
throw bad();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return hooks;
|
|
104
|
+
}
|
|
105
|
+
async function ensureDirLoose(dir) {
|
|
106
|
+
try {
|
|
107
|
+
if ((await stat(dir)).isDirectory())
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
// missing: create below
|
|
112
|
+
}
|
|
113
|
+
await ensureDir(dir, 0o755);
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=claude-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claude-settings.js","sourceRoot":"","sources":["../../src/adapters/claude-settings.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,mDAAmD;AACnD,8EAA8E;AAC9E,EAAE;AACF,wEAAwE;AACxE,wEAAwE;AACxE,2CAA2C;AAC3C,EAAE;AACF,sDAAsD;AACtD,4EAA4E;AAC5E,8DAA8D;AAC9D,2EAA2E;AAC3E,4CAA4C;AAE5C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,M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AC;IAAC,MAAM,CAAC;QACP,wBAAwB;IAC1B,CAAC;IACD,MAAM,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AdapterContext, AgentAdapter, AgentName } from "./types.js";
|
|
2
|
+
/** The adapter for `agent`, or undefined if it isn't built yet. */
|
|
3
|
+
export declare function getAdapter(agent: AgentName): AgentAdapter | undefined;
|
|
4
|
+
export declare function notSupportedYet(agent: AgentName): string;
|
|
5
|
+
export declare function adapterContext(cliVersion: string, workspace?: string): AdapterContext;
|
|
6
|
+
/**
|
|
7
|
+
* `--workspace` (default: the current directory) as an absolute path with
|
|
8
|
+
* symlinks resolved, so the ledger has one entry per folder.
|
|
9
|
+
*/
|
|
10
|
+
export declare function resolveWorkspace(flag: string | undefined): Promise<string>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { realpath } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { defaultVendorDir } from "../vendor.js";
|
|
5
|
+
import { ClaudeCodeAdapter } from "./claude-code.js";
|
|
6
|
+
import { KiroAdapter } from "./kiro.js";
|
|
7
|
+
/** The adapter for `agent`, or undefined if it isn't built yet. */
|
|
8
|
+
export function getAdapter(agent) {
|
|
9
|
+
switch (agent) {
|
|
10
|
+
case "claude-code":
|
|
11
|
+
return new ClaudeCodeAdapter();
|
|
12
|
+
case "kiro":
|
|
13
|
+
return new KiroAdapter();
|
|
14
|
+
case "codex":
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function notSupportedYet(agent) {
|
|
19
|
+
return `Connecting ${agent} isn't supported yet; it's coming in a later release. Today dg can connect: claude-code, kiro.`;
|
|
20
|
+
}
|
|
21
|
+
export function adapterContext(cliVersion, workspace) {
|
|
22
|
+
return { homeDir: homedir(), workspace, cliVersion, vendorDir: defaultVendorDir(), env: process.env };
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `--workspace` (default: the current directory) as an absolute path with
|
|
26
|
+
* symlinks resolved, so the ledger has one entry per folder.
|
|
27
|
+
*/
|
|
28
|
+
export async function resolveWorkspace(flag) {
|
|
29
|
+
const dir = resolve(flag ?? process.cwd());
|
|
30
|
+
try {
|
|
31
|
+
return await realpath(dir);
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return dir; // missing: detect() explains
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapters/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGxC,mEAAmE;AACnE,MAAM,UAAU,UAAU,CAAC,KAAgB;IACzC,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,aAAa;YAChB,OAAO,IAAI,iBAAiB,EAAE,CAAC;QACjC,KAAK,MAAM;YACT,OAAO,IAAI,WAAW,EAAE,CAAC;QAC3B,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,KAAgB;IAC9C,OAAO,cAAc,KAAK,gGAAgG,CAAC;AAC7H,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,UAAkB,EAAE,SAAkB;IACnE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC;AACxG,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,IAAwB;IAC7D,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;IAC3C,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC,CAAC,6BAA6B;IAC3C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** `hooks` in an agent config: event → hook entries. */
|
|
2
|
+
export type AgentHooks = Record<string, AgentHook[]>;
|
|
3
|
+
export interface AgentHook {
|
|
4
|
+
command?: unknown;
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
}
|
|
7
|
+
export interface AgentFile {
|
|
8
|
+
/** The path as given. */
|
|
9
|
+
path: string;
|
|
10
|
+
/** Where writes go: the symlink target if `path` is a symlink. */
|
|
11
|
+
realPath: string;
|
|
12
|
+
exists: boolean;
|
|
13
|
+
mode: number;
|
|
14
|
+
/** sha256 of the file as read; undefined when it doesn't exist. */
|
|
15
|
+
hash?: string;
|
|
16
|
+
data: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
export declare function hashText(text: string): string;
|
|
19
|
+
export declare function serializeAgent(data: Record<string, unknown>): string;
|
|
20
|
+
export declare function readAgentFile(path: string): Promise<AgentFile>;
|
|
21
|
+
export declare function writeAgentFile(file: AgentFile, text: string): Promise<void>;
|
|
22
|
+
/** Remove every entry whose command `isOurs`; returns how many went. */
|
|
23
|
+
export declare function removeAgentHooks(data: Record<string, unknown>, isOurs: (command: string) => boolean, path?: string): number;
|
|
24
|
+
/** Append `add`'s entries after whatever each event already has. */
|
|
25
|
+
export declare function addAgentHooks(data: Record<string, unknown>, add: AgentHooks, path?: string): void;
|
|
26
|
+
/** Events that have at least one entry whose command `isOurs`. */
|
|
27
|
+
export declare function eventsWithAgentHooks(data: Record<string, unknown>, isOurs: (command: string) => boolean, path?: string): string[];
|
|
28
|
+
/** The `hooks` of a config dg bundles; throws if it has none. */
|
|
29
|
+
export declare function agentHooks(data: Record<string, unknown>, path: string): AgentHooks;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// dg CLI - hook entries in a Kiro agent config (.kiro/agents/kiro_default.json)
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
//
|
|
5
|
+
// Kiro CLI's default engine doesn't read .kiro/hooks/. It takes hooks from
|
|
6
|
+
// the config of the agent a session runs, and a workspace file named after
|
|
7
|
+
// the built-in default agent takes that agent's place. So the plugin's hooks
|
|
8
|
+
// go into <workspace>/.kiro/agents/kiro_default.json:
|
|
9
|
+
//
|
|
10
|
+
// "hooks": { "preToolUse": [{ "command": "node dist/index.js", … }], … }
|
|
11
|
+
//
|
|
12
|
+
// When that file is already there it belongs to the user (ADR-0003 TR-5),
|
|
13
|
+
// and is treated like Claude Code's settings.json (see claude-settings.ts):
|
|
14
|
+
//
|
|
15
|
+
// - a file that isn't valid JSON is never rewritten
|
|
16
|
+
// - only entries that run the plugin's command are added or removed;
|
|
17
|
+
// everything else is written back as it was read
|
|
18
|
+
// - a symlinked file is written through, not replaced, and keeps its mode
|
|
19
|
+
import { createHash } from "node:crypto";
|
|
20
|
+
import { readFile, realpath, stat } from "node:fs/promises";
|
|
21
|
+
import { writeFileAtomic } from "../fs/atomic.js";
|
|
22
|
+
import { AdapterError } from "./types.js";
|
|
23
|
+
export function hashText(text) {
|
|
24
|
+
return createHash("sha256").update(text, "utf8").digest("hex");
|
|
25
|
+
}
|
|
26
|
+
export function serializeAgent(data) {
|
|
27
|
+
return JSON.stringify(data, null, 2) + "\n";
|
|
28
|
+
}
|
|
29
|
+
export async function readAgentFile(path) {
|
|
30
|
+
let realPath;
|
|
31
|
+
try {
|
|
32
|
+
realPath = await realpath(path);
|
|
33
|
+
}
|
|
34
|
+
catch (err) {
|
|
35
|
+
const code = err.code;
|
|
36
|
+
if (code === "ENOTDIR") {
|
|
37
|
+
throw new AdapterError(`${path} can't be created because one of its parent folders is a file. Move that file away, then run this again.`);
|
|
38
|
+
}
|
|
39
|
+
if (code !== "ENOENT")
|
|
40
|
+
throw err;
|
|
41
|
+
return { path, realPath: path, exists: false, mode: 0o644, data: {} };
|
|
42
|
+
}
|
|
43
|
+
const raw = await readFile(realPath, "utf8");
|
|
44
|
+
let data;
|
|
45
|
+
try {
|
|
46
|
+
data = JSON.parse(raw);
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
throw new AdapterError(`${path} isn't valid JSON, so dg won't edit it. Fix the file (\`kiro-cli agent validate --path ${path}\` shows what's wrong), then run this again.`);
|
|
50
|
+
}
|
|
51
|
+
if (typeof data !== "object" || data === null || Array.isArray(data)) {
|
|
52
|
+
throw new AdapterError(`${path} isn't a JSON object, so dg won't edit it. Fix the file, then run this again.`);
|
|
53
|
+
}
|
|
54
|
+
hooksOf(data, path); // validate the shape up front
|
|
55
|
+
return {
|
|
56
|
+
path,
|
|
57
|
+
realPath,
|
|
58
|
+
exists: true,
|
|
59
|
+
mode: (await stat(realPath)).mode & 0o777,
|
|
60
|
+
hash: hashText(raw),
|
|
61
|
+
data: data,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export async function writeAgentFile(file, text) {
|
|
65
|
+
await writeFileAtomic(file.realPath, text, { mode: file.mode });
|
|
66
|
+
}
|
|
67
|
+
/** Remove every entry whose command `isOurs`; returns how many went. */
|
|
68
|
+
export function removeAgentHooks(data, isOurs, path = "") {
|
|
69
|
+
const hooks = hooksOf(data, path);
|
|
70
|
+
if (!hooks)
|
|
71
|
+
return 0;
|
|
72
|
+
let removed = 0;
|
|
73
|
+
for (const [event, entries] of Object.entries(hooks)) {
|
|
74
|
+
const kept = entries.filter((h) => !(typeof h.command === "string" && isOurs(h.command)));
|
|
75
|
+
removed += entries.length - kept.length;
|
|
76
|
+
// Drop an event only if we emptied it; leave the user's own empty lists.
|
|
77
|
+
if (kept.length > 0 || entries.length === 0)
|
|
78
|
+
hooks[event] = kept;
|
|
79
|
+
else
|
|
80
|
+
delete hooks[event];
|
|
81
|
+
}
|
|
82
|
+
if (removed > 0 && Object.keys(hooks).length === 0)
|
|
83
|
+
delete data.hooks;
|
|
84
|
+
return removed;
|
|
85
|
+
}
|
|
86
|
+
/** Append `add`'s entries after whatever each event already has. */
|
|
87
|
+
export function addAgentHooks(data, add, path = "") {
|
|
88
|
+
const hooks = hooksOf(data, path) ?? {};
|
|
89
|
+
for (const [event, entries] of Object.entries(add)) {
|
|
90
|
+
hooks[event] = [...(hooks[event] ?? []), ...entries.map((e) => ({ ...e }))];
|
|
91
|
+
}
|
|
92
|
+
data.hooks = hooks;
|
|
93
|
+
}
|
|
94
|
+
/** Events that have at least one entry whose command `isOurs`. */
|
|
95
|
+
export function eventsWithAgentHooks(data, isOurs, path = "") {
|
|
96
|
+
const hooks = hooksOf(data, path) ?? {};
|
|
97
|
+
return Object.keys(hooks).filter((event) => hooks[event].some((h) => typeof h.command === "string" && isOurs(h.command)));
|
|
98
|
+
}
|
|
99
|
+
/** The `hooks` of a config dg bundles; throws if it has none. */
|
|
100
|
+
export function agentHooks(data, path) {
|
|
101
|
+
const hooks = hooksOf(data, path);
|
|
102
|
+
if (!hooks || Object.keys(hooks).length === 0)
|
|
103
|
+
throw new AdapterError(`${path} has no hooks.`);
|
|
104
|
+
return hooks;
|
|
105
|
+
}
|
|
106
|
+
// -- Internal helpers ---------------------------------------------------------
|
|
107
|
+
function hooksOf(data, path) {
|
|
108
|
+
const hooks = data.hooks;
|
|
109
|
+
if (hooks === undefined)
|
|
110
|
+
return undefined;
|
|
111
|
+
const bad = () => new AdapterError(`The "hooks" section of ${path} isn't in the format Kiro expects, so dg won't edit it.`);
|
|
112
|
+
if (typeof hooks !== "object" || hooks === null || Array.isArray(hooks))
|
|
113
|
+
throw bad();
|
|
114
|
+
for (const entries of Object.values(hooks)) {
|
|
115
|
+
if (!Array.isArray(entries))
|
|
116
|
+
throw bad();
|
|
117
|
+
for (const e of entries) {
|
|
118
|
+
if (typeof e !== "object" || e === null || Array.isArray(e))
|
|
119
|
+
throw bad();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return hooks;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=kiro-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kiro-agent.js","sourceRoot":"","sources":["../../src/adapters/kiro-agent.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AAC9E,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,6EAA6E;AAC7E,sDAAsD;AACtD,EAAE;AACF,2EAA2E;AAC3E,EAAE;AACF,0EAA0E;AAC1E,4EAA4E;AAC5E,EAAE;AACF,sDAAsD;AACtD,uEAAuE;AACvE,qDAAqD;AACrD,4EAA4E;AAE5E,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAsB1C,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAA6B;IAC1D,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;AAC9C,CAAC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KAAK,CAAC;QAAE,MAAM,IAAI,YAAY,CAAC,GAAG,IAAI,gBAAgB,CAAC,CAAC;IAC/F,OAAO,KAAK,CAAC;AACf,CAAC;AAED,gFAAgF;AAEhF,SAAS,OAAO,CAAC,IAA6B,EAAE,IAAY;IAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IACzB,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,MAAM,GAAG,GAAG,GAAG,EAAE,CAAC,IAAI,YAAY,CAAC,0BAA0B,IAAI,yDAAyD,CAAC,CAAC;IAC5H,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,MAAM,GAAG,EAAE,CAAC;IACrF,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;YAAE,MAAM,GAAG,EAAE,CAAC;QACzC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACxB,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBAAE,MAAM,GAAG,EAAE,CAAC;QAC3E,CAAC;IACH,CAAC;IACD,OAAO,KAAmB,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ApiResult, type WhoamiResponse } from "../api/client.js";
|
|
2
|
+
import type { InstallRecord } from "../state/installs.js";
|
|
3
|
+
import { type AdapterContext, type AgentAdapter, type ClearResult, type DetectResult, type DoctorReport, type InstallPlan, type PluginConnection } from "./types.js";
|
|
4
|
+
export interface KiroAdapterDeps {
|
|
5
|
+
whoami?: (serverUrl: string, apiKey: string) => Promise<ApiResult<WhoamiResponse>>;
|
|
6
|
+
/** Whether git ignores `file` in `workspace`; undefined if that can't be told. */
|
|
7
|
+
gitIgnores?: (workspace: string, file: string, env: NodeJS.ProcessEnv) => Promise<boolean | undefined>;
|
|
8
|
+
}
|
|
9
|
+
export declare class KiroAdapter implements AgentAdapter {
|
|
10
|
+
readonly name: "kiro";
|
|
11
|
+
readonly displayName = "Kiro";
|
|
12
|
+
readonly perWorkspace = true;
|
|
13
|
+
private readonly whoami;
|
|
14
|
+
private readonly gitIgnores;
|
|
15
|
+
constructor(deps?: KiroAdapterDeps);
|
|
16
|
+
detect(ctx: AdapterContext): Promise<DetectResult>;
|
|
17
|
+
preflight(ctx: AdapterContext): Promise<void>;
|
|
18
|
+
plan(ctx: AdapterContext, _conn: PluginConnection): Promise<InstallPlan>;
|
|
19
|
+
apply(ctx: AdapterContext, _plan: InstallPlan, conn: PluginConnection): Promise<InstallRecord>;
|
|
20
|
+
clear(ctx: AdapterContext, record: InstallRecord): Promise<ClearResult>;
|
|
21
|
+
doctor(ctx: AdapterContext, record: InstallRecord): Promise<DoctorReport>;
|
|
22
|
+
installedServerUrl(ctx: AdapterContext): Promise<string | undefined>;
|
|
23
|
+
nextSteps(ctx: AdapterContext): string[];
|
|
24
|
+
}
|