agent-director 0.6.2 → 0.6.3

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
@@ -226,6 +226,20 @@ agent-director make-template --name dev --cwd /repos/widget --overwrite
226
226
  await client.makeTemplate({ name: "dev", cwd: "/repos/widget", overwrite: true });
227
227
  ```
228
228
 
229
+ ## Consumption
230
+
231
+ The supported consumption mode is Bun-runtime ESM:
232
+
233
+ ```sh
234
+ bun add agent-director
235
+ ```
236
+
237
+ ```ts
238
+ import { Client } from "agent-director";
239
+ ```
240
+
241
+ The package uses `import.meta.resolve` and `import.meta.url` at runtime to locate the installed `package.json`. Bundling it through webpack or other bundlers that do not support these features is not supported.
242
+
229
243
  ## Versioning
230
244
 
231
245
  The library version equals the agent-director release tag — released in lockstep:
package/dist/index.js CHANGED
@@ -14,6 +14,9 @@ var __export = (target, all) => {
14
14
  });
15
15
  };
16
16
 
17
+ // src/internal/subprocessClient.ts
18
+ import { readFile } from "fs/promises";
19
+
17
20
  // src/internal/platformResolve.ts
18
21
  import { statSync } from "fs";
19
22
  import { fileURLToPath } from "url";
@@ -862,68 +865,21 @@ function throwFromEnvelope(verb, envelope) {
862
865
  }
863
866
  throw new ErrUnknownErrorName(errName, envelope);
864
867
  }
865
- // package.json
866
- var package_default = {
867
- name: "agent-director",
868
- version: "0.6.2",
869
- type: "module",
870
- os: [
871
- "linux",
872
- "darwin"
873
- ],
874
- cpu: [
875
- "x64",
876
- "arm64"
877
- ],
878
- engines: {
879
- bun: ">=1.0.21"
880
- },
881
- files: [
882
- "dist/**/*.js",
883
- "dist/**/*.d.ts",
884
- "!dist/**/*.test.*",
885
- "README.md",
886
- "scripts/postinstall.ts",
887
- "skills/install-agent-director/**"
888
- ],
889
- exports: {
890
- ".": {
891
- import: "./dist/index.js",
892
- types: "./dist/index.d.ts"
893
- }
894
- },
895
- scripts: {
896
- build: "bun run build.ts",
897
- lint: "eslint src/ --ext .ts",
898
- typecheck: "tsc --noEmit --project tsconfig.typecheck.json",
899
- test: "bun test",
900
- smoke: "bun test test/smoke/ test/smoke-invariants.test.ts",
901
- "envelope-diff": "bun test test/envelope-diff.test.ts test/envelope-diff-invariants.test.ts",
902
- "prepare-platforms": "bun run scripts/prepare-platforms.ts",
903
- "stage-skill": "bun run scripts/stage-skill.ts",
904
- prepack: "bun run build && bun run scripts/stage-skill.ts",
905
- postinstall: "bun run scripts/postinstall.ts",
906
- "version-bump-publish": "bun run scripts/version-bump.ts",
907
- prepublishOnly: "bun run scripts/prepublish-guards.ts",
908
- "verify-installed-pkg": "bun run scripts/verify-installed-pkg.ts"
909
- },
910
- optionalDependencies: {
911
- "@agent-director/linux-x64": "^0.6.2",
912
- "@agent-director/darwin-arm64": "^0.6.2"
913
- },
914
- devDependencies: {
915
- typescript: ">=5.2.0",
916
- "bun-types": "latest",
917
- eslint: "^8.0.0",
918
- "@typescript-eslint/parser": "^7.0.0",
919
- "@typescript-eslint/eslint-plugin": "^7.0.0"
920
- }
921
- };
922
868
 
923
869
  // src/internal/subprocessClient.ts
924
870
  var DEFAULT_CALL_TIMEOUT_MS = 30000;
925
871
  var SIGKILL_GRACE_MS = 2000;
926
- var NPM_PACKAGE_VERSION = package_default.version;
872
+ async function loadNpmPackageVersion() {
873
+ try {
874
+ const url = import.meta.resolve("agent-director/package.json");
875
+ const json = await readFile(new URL(url), "utf8");
876
+ return JSON.parse(json).version;
877
+ } catch {
878
+ const url = new URL("../../package.json", import.meta.url);
879
+ const json = await readFile(url, "utf8");
880
+ return JSON.parse(json).version;
881
+ }
882
+ }
927
883
 
928
884
  class SubprocessClient {
929
885
  #cliPathOverride;
@@ -933,6 +889,7 @@ class SubprocessClient {
933
889
  #globalOpts;
934
890
  _handle = null;
935
891
  #tail;
892
+ #npmPkgVersion;
936
893
  constructor(opts) {
937
894
  const rawTimeout = opts.callTimeoutMs ?? DEFAULT_CALL_TIMEOUT_MS;
938
895
  if (rawTimeout <= 0) {
@@ -1127,8 +1084,11 @@ class SubprocessClient {
1127
1084
  }
1128
1085
  async version(params) {
1129
1086
  this.#assertOpen();
1087
+ if (this.#npmPkgVersion === undefined) {
1088
+ this.#npmPkgVersion = await loadNpmPackageVersion();
1089
+ }
1130
1090
  const cliResp = await this.#enqueue("version", params);
1131
- return { ...cliResp, version: NPM_PACKAGE_VERSION };
1091
+ return { ...cliResp, version: this.#npmPkgVersion };
1132
1092
  }
1133
1093
  }
1134
1094
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-director",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "type": "module",
5
5
  "os": [
6
6
  "linux",
@@ -43,8 +43,8 @@
43
43
  "verify-installed-pkg": "bun run scripts/verify-installed-pkg.ts"
44
44
  },
45
45
  "optionalDependencies": {
46
- "@agent-director/linux-x64": "^0.6.2",
47
- "@agent-director/darwin-arm64": "^0.6.2"
46
+ "@agent-director/linux-x64": "^0.6.3",
47
+ "@agent-director/darwin-arm64": "^0.6.3"
48
48
  },
49
49
  "devDependencies": {
50
50
  "typescript": ">=5.2.0",
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: install-agent-director
3
3
  description: Install (or upgrade) agent-director on this machine. Runs the bundled install.sh against the user's ~/ — creates ~/.agent-director/ with the binary, warms up state.db, and injects two persistent `agent-director help` hooks into ~/.claude/settings.json (SessionStart + SessionEnd reason=compact). Use this skill when the user says "install agent-director", "set up agent-director", or "upgrade agent-director on this machine".
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  ---
6
6
 
7
7
  ## When to invoke