@amykit/plugin-claude 0.7.0 → 0.8.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 +2 -0
- package/dist/ClaudeHarness.d.ts +18 -0
- package/dist/ClaudeHarness.d.ts.map +1 -1
- package/dist/ClaudeHarness.js +22 -2
- package/dist/ClaudeHarness.js.map +1 -1
- package/dist/config.d.ts +5 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +5 -0
- package/dist/config.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +4 -1
- package/dist/plugin.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ plugins:
|
|
|
41
41
|
"@amykit/plugin-claude":
|
|
42
42
|
model: ""
|
|
43
43
|
models: []
|
|
44
|
+
permissionMode: "acceptEdits"
|
|
44
45
|
timeoutMs: 1800000
|
|
45
46
|
```
|
|
46
47
|
|
|
@@ -48,6 +49,7 @@ plugins:
|
|
|
48
49
|
| :-- | :-- | :-- | :-- | :-- |
|
|
49
50
|
| `model` | `string` | no | `""` | passed to the CLI as --model, which is the flag it accepts |
|
|
50
51
|
| `models` | `string[]` | no | `[]` | the model tiers to offer the relay, cheapest first. One agent is contributed per tier, named `claude:<model>`. Empty means a single agent using `model` |
|
|
52
|
+
| `permissionMode` | `string` | no | `acceptEdits` | passed to the CLI as --permission-mode on a run that may write: `acceptEdits`, `auto` or `bypassPermissions`. A read-only run is always `plan` |
|
|
51
53
|
| `timeoutMs` | `number` | no | `1800000` | how long one agent call may run before it is given up on |
|
|
52
54
|
|
|
53
55
|
Every field is checked at boot against the schema this package declares. A key that is
|
package/dist/ClaudeHarness.d.ts
CHANGED
|
@@ -2,8 +2,22 @@ import { AskContext, CommandRunner, Harness, HarnessReply } from "@amykit/core";
|
|
|
2
2
|
export interface ClaudeHarnessConfig {
|
|
3
3
|
/** Passed to the CLI as --model. Omit to use whatever the CLI defaults to. */
|
|
4
4
|
model?: string;
|
|
5
|
+
/** What a run that may write passes as --permission-mode; `acceptEdits` unless set. */
|
|
6
|
+
permissionMode?: WritingMode;
|
|
5
7
|
timeoutMs?: number;
|
|
6
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* The permission modes under which a print-mode run can write.
|
|
11
|
+
*
|
|
12
|
+
* With the user's settings dropped, no allow rule reaches the run, so
|
|
13
|
+
* `default` and `dontAsk` deny every edit and `plan` blocks them: a writing
|
|
14
|
+
* run handed one of those answers and changes nothing.
|
|
15
|
+
* https://code.claude.com/docs/en/permission-modes
|
|
16
|
+
*/
|
|
17
|
+
export declare const WRITING_MODES: readonly ["acceptEdits", "auto", "bypassPermissions"];
|
|
18
|
+
export type WritingMode = (typeof WRITING_MODES)[number];
|
|
19
|
+
/** The configured mode, or why it is refused, naming the setting. */
|
|
20
|
+
export declare function writingMode(value: unknown): WritingMode;
|
|
7
21
|
/**
|
|
8
22
|
* What keeps a run apart from the operator's own Claude.
|
|
9
23
|
*
|
|
@@ -39,6 +53,10 @@ export declare class ClaudeHarness implements Harness {
|
|
|
39
53
|
private readonly config;
|
|
40
54
|
private readonly tmpDir;
|
|
41
55
|
readonly name = "claude";
|
|
56
|
+
/** It is handed a skill by place: a fresh `--add-dir` whose skills link to it. */
|
|
57
|
+
readonly lendsSkill = true;
|
|
58
|
+
/** The operator's own skills, where Claude Code installs them. */
|
|
59
|
+
readonly skillsDirectory: string;
|
|
42
60
|
constructor(runner: CommandRunner, config?: ClaudeHarnessConfig, tmpDir?: string);
|
|
43
61
|
ask(prompt: string, cwd: string, context?: AskContext): Promise<HarnessReply>;
|
|
44
62
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClaudeHarness.d.ts","sourceRoot":"","sources":["../src/ClaudeHarness.ts"],"names":[],"mappings":"AAGA,OAAO,E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CAAE,GAAG,MAAM,GAAG,SAAS,CAW9F;AAED;;;;;;GAMG;AACH,qBAAa,aAAc,YAAW,OAAO;IAQzC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IATzB,QAAQ,CAAC,IAAI,YAAY;IACzB,kFAAkF;IAClF,QAAQ,CAAC,UAAU,QAAQ;IAC3B,kEAAkE;IAClE,QAAQ,CAAC,eAAe,SAAgD;gBAGrD,MAAM,EAAE,aAAa,EACrB,MAAM,GAAE,mBAAwB,EAChC,MAAM,GAAE,MAAoB;IAGzC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,UAAe,GAAG,OAAO,CAAC,YAAY,CAAC;IAgCvF;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO;CAuBhB"}
|
package/dist/ClaudeHarness.js
CHANGED
|
@@ -3,6 +3,22 @@ import os from "node:os";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { costOf, specFor } from "@amykit/model-specs";
|
|
5
5
|
import { parseRun } from "./envelope.js";
|
|
6
|
+
/**
|
|
7
|
+
* The permission modes under which a print-mode run can write.
|
|
8
|
+
*
|
|
9
|
+
* With the user's settings dropped, no allow rule reaches the run, so
|
|
10
|
+
* `default` and `dontAsk` deny every edit and `plan` blocks them: a writing
|
|
11
|
+
* run handed one of those answers and changes nothing.
|
|
12
|
+
* https://code.claude.com/docs/en/permission-modes
|
|
13
|
+
*/
|
|
14
|
+
export const WRITING_MODES = ["acceptEdits", "auto", "bypassPermissions"];
|
|
15
|
+
/** The configured mode, or why it is refused, naming the setting. */
|
|
16
|
+
export function writingMode(value) {
|
|
17
|
+
if (typeof value === "string" && WRITING_MODES.includes(value))
|
|
18
|
+
return value;
|
|
19
|
+
throw new Error(`permissionMode is ${JSON.stringify(value ?? "")}, under which a run cannot write: ` +
|
|
20
|
+
`set it to ${WRITING_MODES.map((mode) => `\`${mode}\``).join(", ")}`);
|
|
21
|
+
}
|
|
6
22
|
/**
|
|
7
23
|
* What keeps a run apart from the operator's own Claude.
|
|
8
24
|
*
|
|
@@ -51,6 +67,10 @@ export class ClaudeHarness {
|
|
|
51
67
|
config;
|
|
52
68
|
tmpDir;
|
|
53
69
|
name = "claude";
|
|
70
|
+
/** It is handed a skill by place: a fresh `--add-dir` whose skills link to it. */
|
|
71
|
+
lendsSkill = true;
|
|
72
|
+
/** The operator's own skills, where Claude Code installs them. */
|
|
73
|
+
skillsDirectory = path.join(os.homedir(), ".claude", "skills");
|
|
54
74
|
constructor(runner, config = {}, tmpDir = os.tmpdir()) {
|
|
55
75
|
this.runner = runner;
|
|
56
76
|
this.config = config;
|
|
@@ -63,8 +83,8 @@ export class ClaudeHarness {
|
|
|
63
83
|
args.push("--model", this.config.model);
|
|
64
84
|
}
|
|
65
85
|
// Plan mode reads and does not edit or run anything, enforced by the CLI.
|
|
66
|
-
|
|
67
|
-
|
|
86
|
+
// A mode is always passed: with no mode a print-mode run may not write.
|
|
87
|
+
args.push("--permission-mode", context.readOnly ? "plan" : (this.config.permissionMode ?? "acceptEdits"));
|
|
68
88
|
args.push(...ISOLATED);
|
|
69
89
|
const lent = context.skill ? lend(this.tmpDir, context.skill) : undefined;
|
|
70
90
|
if (lent)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClaudeHarness.js","sourceRoot":"","sources":["../src/ClaudeHarness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAa,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"ClaudeHarness.js","sourceRoot":"","sources":["../src/ClaudeHarness.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CAAC,EAAE,CAAC;IAClF,CAAC;IAED;;;;;;;OAOG;IACK,OAAO,CAAC,MAAiB,EAAE,SAAiB,EAAE,MAAc;QAClE,IAAI,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC7B,IAAI,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAEnC,IAAI,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAC3C,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACnC,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO,GAAG,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;gBACtC,UAAU,GAAG,UAAU,CAAC;YAC1B,CAAC;QACH,CAAC;QAED,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,OAAO,EAAE,IAAI,CAAC,IAAI;YAClB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,OAAO;YACP,UAAU;YACV,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,SAAS;YAC1C,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE;SAChE,CAAC;IACJ,CAAC;CACF"}
|
package/dist/config.d.ts
CHANGED
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;CAuBD,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -10,6 +10,11 @@ export const configSchema = {
|
|
|
10
10
|
description: "the model tiers to offer the relay, cheapest first. One agent is contributed per tier, named `claude:<model>`. Empty means a single agent using `model`",
|
|
11
11
|
default: [],
|
|
12
12
|
},
|
|
13
|
+
permissionMode: {
|
|
14
|
+
type: "string",
|
|
15
|
+
description: "passed to the CLI as --permission-mode on a run that may write: `acceptEdits`, `auto` or `bypassPermissions`. A read-only run is always `plan`",
|
|
16
|
+
default: "acceptEdits",
|
|
17
|
+
},
|
|
13
18
|
timeoutMs: {
|
|
14
19
|
type: "number",
|
|
15
20
|
description: "how long one agent call may run before it is given up on",
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,4DAA4D;QACzE,OAAO,EAAE,EAAE;KACZ;IACD,MAAM,EAAE;QACN,IAAI,EAAE,UAAU;QAChB,WAAW,EACT,yJAAyJ;QAC3J,OAAO,EAAE,EAAE;KACZ;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,0DAA0D;QACvE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;KACxB;CACqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,KAAK,EAAE;QACL,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,4DAA4D;QACzE,OAAO,EAAE,EAAE;KACZ;IACD,MAAM,EAAE;QACN,IAAI,EAAE,UAAU;QAChB,WAAW,EACT,yJAAyJ;QAC3J,OAAO,EAAE,EAAE;KACZ;IACD,cAAc,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,gJAAgJ;QAClJ,OAAO,EAAE,aAAa;KACvB;IACD,SAAS,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,0DAA0D;QACvE,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI;KACxB;CACqB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { ClaudeHarness, ISOLATED, lend } from "./ClaudeHarness.js";
|
|
2
|
-
export type { ClaudeHarnessConfig } from "./ClaudeHarness.js";
|
|
1
|
+
export { ClaudeHarness, ISOLATED, WRITING_MODES, lend, writingMode } from "./ClaudeHarness.js";
|
|
2
|
+
export type { ClaudeHarnessConfig, WritingMode } from "./ClaudeHarness.js";
|
|
3
3
|
export { classify, modelOf, parseEnvelope, parseRun, tokensOf } from "./envelope.js";
|
|
4
4
|
export type { ClaudeEnvelope, ParsedRun } from "./envelope.js";
|
|
5
5
|
export { configSchema } from "./config.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/F,YAAY,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACrF,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACjE,YAAY,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { ClaudeHarness, ISOLATED, lend } from "./ClaudeHarness.js";
|
|
1
|
+
export { ClaudeHarness, ISOLATED, WRITING_MODES, lend, writingMode } from "./ClaudeHarness.js";
|
|
2
2
|
export { classify, modelOf, parseEnvelope, parseRun, tokensOf } from "./envelope.js";
|
|
3
3
|
export { configSchema } from "./config.js";
|
|
4
4
|
export { plugin } from "./plugin.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/F,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAErF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC"}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,+
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,+BA2BjB,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { definePlugin } from "@amykit/core";
|
|
2
2
|
import { contributeTiers, contributeUsage } from "@amykit/agent-kit";
|
|
3
|
-
import { ClaudeHarness } from "./ClaudeHarness.js";
|
|
3
|
+
import { ClaudeHarness, writingMode } from "./ClaudeHarness.js";
|
|
4
4
|
import { configSchema } from "./config.js";
|
|
5
5
|
import { ClaudeUsageReader } from "./usage.js";
|
|
6
6
|
export const plugin = definePlugin({
|
|
@@ -8,6 +8,8 @@ export const plugin = definePlugin({
|
|
|
8
8
|
configSchema,
|
|
9
9
|
register(registry, ctx) {
|
|
10
10
|
const tiers = ctx.config.models;
|
|
11
|
+
// Refused here, at mount, rather than as a run that answers and edits nothing.
|
|
12
|
+
const permissionMode = writingMode(ctx.config.permissionMode);
|
|
11
13
|
// Contributed rather than mounted as the `agent` port: only one plugin
|
|
12
14
|
// can own a port, and three harnesses that each wanted to be *the* agent
|
|
13
15
|
// would refuse to mount together. The relay composes what is contributed.
|
|
@@ -20,6 +22,7 @@ export const plugin = definePlugin({
|
|
|
20
22
|
models: tiers.length > 0 ? tiers : [(ctx.config.model) || ""],
|
|
21
23
|
make: (model) => new ClaudeHarness(ctx.runner, {
|
|
22
24
|
model: model || undefined,
|
|
25
|
+
permissionMode,
|
|
23
26
|
timeoutMs: ctx.config.timeoutMs,
|
|
24
27
|
}),
|
|
25
28
|
});
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,eAAe,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,SAAS;aAChC,CAAC;SACL,CAAC,CAAC;QACH,eAAe,CAAC,QAAQ,EAAE,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;IACpG,CAAC;CACF,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amykit/plugin-claude",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "The claude CLI as the agent, over its JSON envelope.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"about": "Use it when the agent should be Claude Code, run through the claude CLI. It contributes a harness and a usage reader to agent-relay instead of mounting the agent port itself, so install agent-relay with it, and list codex or hermes-agent too when the relay should have somewhere to fall back. Claude reports what each run cost, so a ceiling in money works without a row in the price table."
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@amykit/agent-kit": "^0.
|
|
35
|
-
"@amykit/core": "^0.
|
|
36
|
-
"@amykit/model-specs": "^0.
|
|
34
|
+
"@amykit/agent-kit": "^0.8.0",
|
|
35
|
+
"@amykit/core": "^0.8.0",
|
|
36
|
+
"@amykit/model-specs": "^0.8.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@amykit/test-fixtures": "^0.1.0"
|