@amykit/plugin-claude 0.6.0 → 0.7.1

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 CHANGED
@@ -4,13 +4,25 @@
4
4
 
5
5
  The claude CLI as the agent, over its JSON envelope.
6
6
 
7
- A plugin for [amy](https://github.com/nicolasmelo1/amy). It provides `claude` in the `harness` collection.
7
+ A plugin for [amy](https://github.com/nicolasmelo1/amy). It provides `claude` in the `harness` collection and `Claude` in the `usage` collection.
8
+
9
+ 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.
10
+
11
+ ## What it extends
12
+
13
+ | | |
14
+ | :-- | :-- |
15
+ | Ports | _none_ |
16
+ | Actions | _none_ |
17
+ | Operations | _none_ |
18
+ | Commands | _none_ |
19
+ | Events | _none_ |
20
+ | Environment | `CLAUDE_CODE_OAUTH_TOKEN` |
8
21
 
9
22
  ## Install
10
23
 
11
24
  ```sh
12
- # Add @amykit/plugin-claude to amy.yaml, then install configured plugins:
13
- amy init --install
25
+ amy add @amykit/plugin-claude
14
26
  ```
15
27
 
16
28
  Then name it in `~/.amy/config.yaml`:
@@ -42,9 +54,17 @@ Every field is checked at boot against the schema this package declares. A key t
42
54
  not one of the above is a refusal naming the plugin and the key, not a setting that
43
55
  silently never applied.
44
56
 
57
+ ## Environment
58
+
59
+ This package reads the following, which `amy doctor` checks for you:
60
+
61
+ | Variable | |
62
+ | :-- | :-- |
63
+ | `CLAUDE_CODE_OAUTH_TOKEN` | required at mount |
64
+
45
65
  ## Where the reasoning is
46
66
 
47
- - [Writing a plugin](https://github.com/nicolasmelo1/amy/tree/main/docs/build/write-a-plugin.md)
67
+ - [Writing a plugin](https://github.com/nicolasmelo1/amy/tree/main/docs/guides/write-a-plugin.md)
48
68
  - [Reference: plugins](https://github.com/nicolasmelo1/amy/tree/main/docs/reference/plugins.md)
49
69
  - [Ports and the registry](https://github.com/nicolasmelo1/amy/tree/main/docs/concepts/ports.md)
50
70
 
@@ -1,9 +1,32 @@
1
- import { CommandRunner, Harness, HarnessReply } from "@amykit/core";
1
+ 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
5
  timeoutMs?: number;
6
6
  }
7
+ /**
8
+ * What keeps a run apart from the operator's own Claude.
9
+ *
10
+ * Without these a ticket run read the operator's personal CLAUDE.md, every
11
+ * skill they had installed, their hooks and plugins, and kept a session and
12
+ * an auto-memory under `~/.claude/projects`. The repository's own settings —
13
+ * `project` and `local` — still load: they belong to the code being worked
14
+ * on, not to the person running amy.
15
+ */
16
+ export declare const ISOLATED: readonly ["--setting-sources", "project,local", "--strict-mcp-config", "--no-session-persistence"];
17
+ /**
18
+ * Lends one skill to a run: a fresh directory whose `.claude/skills/<name>`
19
+ * links to where the skill is installed, for `--add-dir`.
20
+ *
21
+ * Dropping the user setting source drops `~/.claude/skills` with it, so the
22
+ * skill a step was addressed to is handed over by place, and nothing else of
23
+ * the operator's comes along. A skill whose directory is gone is not lent,
24
+ * and the run goes ahead without it.
25
+ */
26
+ export declare function lend(tmpDir: string, skill: {
27
+ name: string;
28
+ path: string;
29
+ }): string | undefined;
7
30
  /**
8
31
  * The `claude` CLI, and everything knowable about what a call to it took.
9
32
  *
@@ -14,9 +37,10 @@ export interface ClaudeHarnessConfig {
14
37
  export declare class ClaudeHarness implements Harness {
15
38
  private readonly runner;
16
39
  private readonly config;
40
+ private readonly tmpDir;
17
41
  readonly name = "claude";
18
- constructor(runner: CommandRunner, config?: ClaudeHarnessConfig);
19
- ask(prompt: string, cwd: string): Promise<HarnessReply>;
42
+ constructor(runner: CommandRunner, config?: ClaudeHarnessConfig, tmpDir?: string);
43
+ ask(prompt: string, cwd: string, context?: AskContext): Promise<HarnessReply>;
20
44
  /**
21
45
  * Turns a parsed run into the account the engine logs and the budget spends.
22
46
  *
@@ -1 +1 @@
1
- {"version":3,"file":"ClaudeHarness.d.ts","sourceRoot":"","sources":["../src/ClaudeHarness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI9E,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;GAMG;AACH,qBAAa,aAAc,YAAW,OAAO;IAIzC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAJzB,QAAQ,CAAC,IAAI,YAAY;gBAGN,MAAM,EAAE,aAAa,EACrB,MAAM,GAAE,mBAAwB;IAG7C,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAoB7D;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO;CAuBhB"}
1
+ {"version":3,"file":"ClaudeHarness.d.ts","sourceRoot":"","sources":["../src/ClaudeHarness.ts"],"names":[],"mappings":"AAGA,OAAO,EAAY,UAAU,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAI1F,MAAM,WAAW,mBAAmB;IAClC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,oGAKX,CAAC;AAEX;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,GAAG,SAAS,CAW9F;AAED;;;;;;GAMG;AACH,qBAAa,aAAc,YAAW,OAAO;IAIzC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM;IALzB,QAAQ,CAAC,IAAI,YAAY;gBAGN,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;IA+BvF;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO;CAuBhB"}
@@ -1,5 +1,44 @@
1
+ import fs from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
1
4
  import { costOf, specFor } from "@amykit/model-specs";
2
5
  import { parseRun } from "./envelope.js";
6
+ /**
7
+ * What keeps a run apart from the operator's own Claude.
8
+ *
9
+ * Without these a ticket run read the operator's personal CLAUDE.md, every
10
+ * skill they had installed, their hooks and plugins, and kept a session and
11
+ * an auto-memory under `~/.claude/projects`. The repository's own settings —
12
+ * `project` and `local` — still load: they belong to the code being worked
13
+ * on, not to the person running amy.
14
+ */
15
+ export const ISOLATED = [
16
+ "--setting-sources",
17
+ "project,local",
18
+ "--strict-mcp-config",
19
+ "--no-session-persistence",
20
+ ];
21
+ /**
22
+ * Lends one skill to a run: a fresh directory whose `.claude/skills/<name>`
23
+ * links to where the skill is installed, for `--add-dir`.
24
+ *
25
+ * Dropping the user setting source drops `~/.claude/skills` with it, so the
26
+ * skill a step was addressed to is handed over by place, and nothing else of
27
+ * the operator's comes along. A skill whose directory is gone is not lent,
28
+ * and the run goes ahead without it.
29
+ */
30
+ export function lend(tmpDir, skill) {
31
+ // Absolute, since a link is read from where it lies: a relative skill root
32
+ // would otherwise point inside the lent directory and lend nothing.
33
+ const source = path.resolve(skill.path);
34
+ if (!fs.existsSync(path.join(source, "SKILL.md")))
35
+ return undefined;
36
+ const root = fs.mkdtempSync(path.join(tmpDir, "amy-claude-skill-"));
37
+ const skills = path.join(root, ".claude", "skills");
38
+ fs.mkdirSync(skills, { recursive: true });
39
+ fs.symlinkSync(source, path.join(skills, skill.name), "dir");
40
+ return root;
41
+ }
3
42
  /**
4
43
  * The `claude` CLI, and everything knowable about what a call to it took.
5
44
  *
@@ -10,24 +49,40 @@ import { parseRun } from "./envelope.js";
10
49
  export class ClaudeHarness {
11
50
  runner;
12
51
  config;
52
+ tmpDir;
13
53
  name = "claude";
14
- constructor(runner, config = {}) {
54
+ constructor(runner, config = {}, tmpDir = os.tmpdir()) {
15
55
  this.runner = runner;
16
56
  this.config = config;
57
+ this.tmpDir = tmpDir;
17
58
  }
18
- async ask(prompt, cwd) {
59
+ async ask(prompt, cwd, context = {}) {
19
60
  const asked = this.config.model ?? "";
20
61
  const args = [];
21
62
  if (this.config.model) {
22
63
  args.push("--model", this.config.model);
23
64
  }
65
+ // Plan mode reads and does not edit or run anything, enforced by the CLI.
66
+ if (context.readOnly)
67
+ args.push("--permission-mode", "plan");
68
+ args.push(...ISOLATED);
69
+ const lent = context.skill ? lend(this.tmpDir, context.skill) : undefined;
70
+ if (lent)
71
+ args.push("--add-dir", lent);
24
72
  args.push("--output-format", "json", "-p");
25
73
  const started = Date.now();
26
- const result = await this.runner.run("claude", args, {
27
- cwd,
28
- stdin: prompt,
29
- timeoutMs: this.config.timeoutMs,
30
- });
74
+ let result;
75
+ try {
76
+ result = await this.runner.run("claude", args, {
77
+ cwd,
78
+ stdin: prompt,
79
+ timeoutMs: this.config.timeoutMs,
80
+ });
81
+ }
82
+ finally {
83
+ if (lent)
84
+ fs.rmSync(lent, { recursive: true, force: true });
85
+ }
31
86
  const elapsed = Date.now() - started;
32
87
  const parsed = parseRun(result.stdout, result.ok, asked);
33
88
  return { text: parsed.text, run: this.account(parsed, elapsed, result.stderr) };
@@ -1 +1 @@
1
- {"version":3,"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. */
3
- export declare const configSchema: ConfigSchema;
2
+ export declare const configSchema: {
3
+ model: {
4
+ type: "string";
5
+ description: string;
6
+ default: string;
7
+ };
8
+ models: {
9
+ type: "string[]";
10
+ description: string;
11
+ default: never[];
12
+ };
13
+ timeoutMs: {
14
+ type: "number";
15
+ description: string;
16
+ default: number;
17
+ };
18
+ };
4
19
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,2DAA2D;AAC3D,eAAO,MAAM,YAAY,EAAE,YAiB1B,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAiBD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,2DAA2D;AAC3D,MAAM,CAAC,MAAM,YAAY,GAAiB;IACxC,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;CACF,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,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,7 +1,9 @@
1
- export { ClaudeHarness } from "./ClaudeHarness.js";
1
+ export { ClaudeHarness, ISOLATED, lend } from "./ClaudeHarness.js";
2
2
  export type { ClaudeHarnessConfig } 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";
6
6
  export { plugin } from "./plugin.js";
7
+ export { ClaudeUsageReader, parseClaudeUsage } from "./usage.js";
8
+ export type { ClaudeUsageReaderOptions } from "./usage.js";
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,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"}
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;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,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,5 +1,6 @@
1
- export { ClaudeHarness } from "./ClaudeHarness.js";
1
+ export { ClaudeHarness, ISOLATED, lend } 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";
5
+ export { ClaudeUsageReader, parseClaudeUsage } from "./usage.js";
5
6
  //# sourceMappingURL=index.js.map
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,MAAM,oBAAoB,CAAC;AAEnD,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"}
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;AAEnE,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 CHANGED
@@ -1,3 +1,2 @@
1
- import { Plugin } from "@amykit/core";
2
- export declare const plugin: Plugin;
1
+ export declare const plugin: import("@amykit/core").Plugin;
3
2
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAKtC,eAAO,MAAM,MAAM,EAAE,MAwBpB,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,+BAwBjB,CAAC"}
package/dist/plugin.js CHANGED
@@ -1,9 +1,10 @@
1
- import { contributeTiers } from "@amykit/agent-kit";
1
+ import { definePlugin } from "@amykit/core";
2
+ import { contributeTiers, contributeUsage } from "@amykit/agent-kit";
2
3
  import { ClaudeHarness } from "./ClaudeHarness.js";
3
4
  import { configSchema } from "./config.js";
4
- export const plugin = {
5
+ import { ClaudeUsageReader } from "./usage.js";
6
+ export const plugin = definePlugin({
5
7
  name: "@amykit/plugin-claude",
6
- version: "0.1.0",
7
8
  configSchema,
8
9
  register(registry, ctx) {
9
10
  const tiers = ctx.config.models;
@@ -16,12 +17,13 @@ export const plugin = {
16
17
  // reported beats anything a table could work out, so a missing row
17
18
  // never leaves a ceiling in money with nothing to spend against it.
18
19
  pricesItsOwnRuns: true,
19
- models: tiers.length > 0 ? tiers : [ctx.config.model || ""],
20
+ models: tiers.length > 0 ? tiers : [(ctx.config.model) || ""],
20
21
  make: (model) => new ClaudeHarness(ctx.runner, {
21
22
  model: model || undefined,
22
23
  timeoutMs: ctx.config.timeoutMs,
23
24
  }),
24
25
  });
26
+ contributeUsage(registry, new ClaudeUsageReader(ctx.runner, { timeoutMs: ctx.config.timeoutMs }));
25
27
  },
26
- };
28
+ });
27
29
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,MAAM,CAAC,MAAM,MAAM,GAAW;IAC5B,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,OAAO;IAChB,YAAY;IACZ,QAAQ,CAAC,QAAQ,EAAE,GAAG;QACpB,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,MAAkB,CAAC;QAE5C,uEAAuE;QACvE,yEAAyE;QACzE,0EAA0E;QAC1E,eAAe,CAAC,QAAQ,EAAE;YACxB,OAAO,EAAE,QAAQ;YACjB,gEAAgE;YAChE,mEAAmE;YACnE,oEAAoE;YACpE,gBAAgB,EAAE,IAAI;YACtB,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,GAAG,CAAC,MAAM,CAAC,KAAgB,IAAI,EAAE,CAAC;YACvE,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE,CACd,IAAI,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE;gBAC5B,KAAK,EAAE,KAAK,IAAI,SAAS;gBACzB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,SAAmB;aAC1C,CAAC;SACL,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
1
+ {"version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+1,23 @@
1
+ import { CommandRunner } from "@amykit/core";
2
+ import type { UsageReader, UsageResult } from "@amykit/agent-kit";
3
+ export interface ClaudeUsageReaderOptions {
4
+ readonly timeoutMs?: number;
5
+ readonly token?: () => string | undefined;
6
+ /** Where Claude Code keeps its login off macOS; a test points it elsewhere. */
7
+ readonly credentialsFile?: string;
8
+ /** The platform whose credential store is asked; macOS also has the Keychain. */
9
+ readonly platform?: NodeJS.Platform;
10
+ }
11
+ /** Reads Claude's account windows without asking Claude to run an agent turn. */
12
+ export declare class ClaudeUsageReader implements UsageReader {
13
+ private readonly runner;
14
+ private readonly options;
15
+ readonly label = "Claude";
16
+ constructor(runner: CommandRunner, options?: ClaudeUsageReaderOptions);
17
+ read(): Promise<UsageResult>;
18
+ /** The login Claude Code keeps: the environment, its credentials file, then on macOS the Keychain. */
19
+ private oauthToken;
20
+ }
21
+ /** Normalizes the account endpoint's percentage measurements. */
22
+ export declare function parseClaudeUsage(json: string): UsageResult;
23
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../src/usage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAYlE,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IAC1C,+EAA+E;IAC/E,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;CACrC;AAKD,iFAAiF;AACjF,qBAAa,iBAAkB,YAAW,WAAW;IAIjD,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ1B,QAAQ,CAAC,KAAK,YAAY;gBAGP,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE,wBAA6B;IAGnD,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC;IAsBlC,sGAAsG;YACxF,UAAU;CAazB;AAED,iEAAiE;AACjE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAc1D"}
package/dist/usage.js ADDED
@@ -0,0 +1,92 @@
1
+ import fs from "node:fs";
2
+ import os from "node:os";
3
+ import path from "node:path";
4
+ /** The Keychain item Claude Code writes its login to on macOS. */
5
+ const KEYCHAIN_SERVICE = "Claude Code-credentials";
6
+ /** Reads Claude's account windows without asking Claude to run an agent turn. */
7
+ export class ClaudeUsageReader {
8
+ runner;
9
+ options;
10
+ label = "Claude";
11
+ constructor(runner, options = {}) {
12
+ this.runner = runner;
13
+ this.options = options;
14
+ }
15
+ async read() {
16
+ const token = this.options.token?.() ?? (await this.oauthToken());
17
+ if (!token)
18
+ return { unavailable: "Claude usage is unavailable: no OAuth token is configured" };
19
+ try {
20
+ const result = await this.runner.run("curl", ["--disable", "--fail", "--silent", "--show-error", "--config", "-", "https://api.anthropic.com/api/oauth/usage"], {
21
+ // A curl config on stdin keeps the bearer token out of argv and process listings.
22
+ // The endpoint refuses an OAuth bearer without the beta that enables it.
23
+ stdin: `header = "Authorization: Bearer ${token}"\nheader = "anthropic-beta: oauth-2025-04-20"\n`,
24
+ timeoutMs: this.options.timeoutMs,
25
+ });
26
+ if (!result.ok)
27
+ return { unavailable: "Claude usage is unavailable" };
28
+ return parseClaudeUsage(result.stdout);
29
+ }
30
+ catch {
31
+ return { unavailable: "Claude usage is unavailable" };
32
+ }
33
+ }
34
+ /** The login Claude Code keeps: the environment, its credentials file, then on macOS the Keychain. */
35
+ async oauthToken() {
36
+ if (process.env.CLAUDE_CODE_OAUTH_TOKEN)
37
+ return process.env.CLAUDE_CODE_OAUTH_TOKEN;
38
+ const file = this.options.credentialsFile ?? path.join(os.homedir(), ".claude", ".credentials.json");
39
+ const stored = readCredentials(() => fs.readFileSync(file, "utf8"));
40
+ if (stored || (this.options.platform ?? process.platform) !== "darwin")
41
+ return stored;
42
+ try {
43
+ // Read-only: prints the item's secret, the same JSON the file holds elsewhere.
44
+ const result = await this.runner.run("security", ["find-generic-password", "-s", KEYCHAIN_SERVICE, "-w"], { timeoutMs: this.options.timeoutMs });
45
+ return result.ok ? readCredentials(() => result.stdout) : undefined;
46
+ }
47
+ catch {
48
+ return undefined;
49
+ }
50
+ }
51
+ }
52
+ /** Normalizes the account endpoint's percentage measurements. */
53
+ export function parseClaudeUsage(json) {
54
+ let document;
55
+ try {
56
+ const parsed = JSON.parse(json);
57
+ if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed))
58
+ document = parsed;
59
+ }
60
+ catch {
61
+ return { unavailable: "Claude usage returned invalid JSON" };
62
+ }
63
+ if (!document)
64
+ return { unavailable: "Claude usage returned invalid JSON" };
65
+ const windows = [
66
+ windowOf("five-hour", document.five_hour),
67
+ windowOf("seven-day", document.seven_day),
68
+ ].flatMap((window) => window ? [window] : []);
69
+ return windows.length > 0 ? { windows } : { unavailable: "Claude usage returned no measured windows" };
70
+ }
71
+ function windowOf(label, period) {
72
+ if (!period || typeof period.utilization !== "number" || !Number.isFinite(period.utilization))
73
+ return undefined;
74
+ const resetsAt = typeof period.resets_at === "string" && !Number.isNaN(Date.parse(period.resets_at))
75
+ ? period.resets_at
76
+ : undefined;
77
+ return {
78
+ label,
79
+ usedPercent: Math.max(0, Math.min(100, period.utilization)),
80
+ ...(resetsAt ? { resetsAt } : {}),
81
+ };
82
+ }
83
+ function readCredentials(read) {
84
+ try {
85
+ const credentials = JSON.parse(read());
86
+ return typeof credentials.claudeAiOauth?.accessToken === "string" ? credentials.claudeAiOauth.accessToken : undefined;
87
+ }
88
+ catch {
89
+ return undefined;
90
+ }
91
+ }
92
+ //# sourceMappingURL=usage.js.map
@@ -0,0 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C,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAClC,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,IAAkB;IACzC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAkD,CAAC;QACxF,OAAO,OAAO,WAAW,CAAC,aAAa,EAAE,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS,CAAC;IACxH,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amykit/plugin-claude",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "The claude CLI as the agent, over its JSON envelope.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -27,10 +27,13 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
+ "amy": {
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
+ },
30
33
  "dependencies": {
31
- "@amykit/agent-kit": "^0.6.0",
32
- "@amykit/core": "^0.6.0",
33
- "@amykit/model-specs": "^0.6.0"
34
+ "@amykit/agent-kit": "^0.7.1",
35
+ "@amykit/core": "^0.7.1",
36
+ "@amykit/model-specs": "^0.7.1"
34
37
  },
35
38
  "devDependencies": {
36
39
  "@amykit/test-fixtures": "^0.1.0"