agent-shim 14.12.1 → 14.12.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
@@ -78,7 +78,7 @@ Every top-level entry in `~/.claude` is classified into one of five categories,
78
78
  | `secret` | **Never** — hardcoded, cannot be overridden by any configuration layer | `.credentials.json`, `backups`, `settings.json.bak*` |
79
79
  | `runtime` | No | `daemon*`, `.git*`, `.DS_Store`, `mcp-needs-auth-cache.json`, `codex-quota.json`, `file-transfers`, `shell-snapshots`, `statsig`, `telemetry`, `stats-cache.json`, `usage-data`, `ide`, `cache`, `scheduled_tasks.lock`, `policy-limits.json*`, `remote-settings.json*`, `state` |
80
80
  | `history` | Yes | `projects`, `sessions`, `session-env`, `teams`, `tasks`, `todos`, `history.jsonl`, `transcripts`, `paste-cache`, `file-history`, `plans`, `workflows`, `jobs`, `debug`, `downloads`, `chrome` |
81
- | `knowledge` | Yes | `skills`, `agents`, `rules`, `memory`, `commands`, `plugins`, `hooks`, `AGENTS.md`, `CLAUDE.md`, `README.md` |
81
+ | `knowledge` | Yes | `skills`, `output-styles`, `agents`, `rules`, `memory`, `commands`, `plugins`, `hooks`, `AGENTS.md`, `CLAUDE.md`, `README.md` |
82
82
  | `settings` | Yes | `settings.json`, `settings.local.json` |
83
83
 
84
84
  Sharing composes through a cascade (shipped defaults, then a user-global override, then the active configuration profile, then directory rules for `$PWD`, shallowest to deepest); a specific path override always outranks a category default regardless of which layer set it. A committed `.agent-shim.json` at a project's root makes this portable: anyone who clones the repo and runs `claude` inside it gets the same isolation rules with no local setup.
package/dist/cli.cjs CHANGED
@@ -34357,6 +34357,7 @@ var init_categories_default = __esm({
34357
34357
  ],
34358
34358
  knowledge: [
34359
34359
  "skills",
34360
+ "output-styles",
34360
34361
  "agents",
34361
34362
  "rules",
34362
34363
  "memory",
@@ -76443,7 +76444,7 @@ var init_package = __esm({
76443
76444
  "package.json"() {
76444
76445
  package_default = {
76445
76446
  name: "agent-shim",
76446
- version: "14.12.1",
76447
+ version: "14.12.3",
76447
76448
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
76448
76449
  license: "MIT",
76449
76450
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -155848,6 +155849,16 @@ function parseJsonObject5(body) {
155848
155849
  }
155849
155850
  return isRecord22(parsed) ? parsed : void 0;
155850
155851
  }
155852
+ function internalEventOf(event, newUuid, now) {
155853
+ if (!isRecord22(event) || !isRecord22(event.payload)) {
155854
+ return void 0;
155855
+ }
155856
+ const eventType = nonEmptyString4(event.payload, "type");
155857
+ return eventType === void 0 ? void 0 : { eventId: newUuid(), eventType, payload: event.payload, isCompaction: event.is_compaction === true, agentId: nonEmptyString4(event, "session_agent_id"), createdAt: new Date(now()).toISOString() };
155858
+ }
155859
+ function internalEventRow(event) {
155860
+ return { event_id: event.eventId, event_type: event.eventType, payload: event.payload, is_compaction: event.isCompaction, created_at: event.createdAt, ...event.agentId === void 0 ? {} : { session_agent_id: event.agentId } };
155861
+ }
155851
155862
  function mintWorkerJwt(randomToken, issuedAt) {
155852
155863
  const encode3 = (value3) => Buffer.from(JSON.stringify(value3), "utf8").toString("base64url");
155853
155864
  const header = encode3({ alg: "HS256", typ: "JWT" });
@@ -156164,25 +156175,22 @@ data: ${JSON.stringify(envelope2)}
156164
156175
  return;
156165
156176
  }
156166
156177
  const events = body?.events;
156167
- if (!Array.isArray(events)) {
156168
- await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "an internal event batch is an array" } });
156178
+ const posted = Array.isArray(events) ? events : void 0;
156179
+ const filed = posted?.map((event) => internalEventOf(event, deps.newUuid, deps.now)).filter((event) => event !== void 0);
156180
+ if (filed === void 0 || filed.length !== posted?.length) {
156181
+ await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "an internal event batch is an array of events, each carrying one typed payload object" } });
156169
156182
  return;
156170
156183
  }
156171
- for (const event of events) {
156172
- if (isRecord22(event)) {
156173
- session.internalEvents.push({ eventId: deps.newUuid(), body: event });
156174
- }
156175
- }
156184
+ session.internalEvents.push(...filed);
156176
156185
  await answerJson2(response, HTTP_STATUS.ok, {});
156177
156186
  return;
156178
156187
  }
156179
156188
  if (workerTail === "internal-events" && method === "GET") {
156180
156189
  const query = new URL(request7.url, "http://127.0.0.1").searchParams;
156181
- if (query.get("session_agent_id") !== null || query.get("subagents") !== null) {
156182
- await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "this surface keeps one internal-events channel per session, so an agent-scoped read has no subset to serve" } });
156183
- return;
156184
- }
156185
- const page = pageOfRcChannel(request7.url, session.internalEvents, (event) => event.eventId, (event) => ({ event_id: event.eventId, payload: event.body }));
156190
+ const agentId = query.get("session_agent_id");
156191
+ const everyAgent = query.get("subagents") !== null;
156192
+ const rows = session.internalEvents.filter((event) => agentId !== null ? event.agentId === agentId : event.agentId !== void 0 === everyAgent);
156193
+ const page = pageOfRcChannel(request7.url, rows, (event) => event.eventId, internalEventRow);
156186
156194
  if ("error" in page) {
156187
156195
  const anchorUnknown = query.get("after_event_id") !== null && page.error.startsWith("the anchor names an event id");
156188
156196
  await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: anchorUnknown ? "after_event_id_not_found" : "invalid_request_error", message: page.error } });
package/dist/index.cjs CHANGED
@@ -81,6 +81,7 @@ var init_categories_default = __esm({
81
81
  ],
82
82
  knowledge: [
83
83
  "skills",
84
+ "output-styles",
84
85
  "agents",
85
86
  "rules",
86
87
  "memory",
@@ -15209,7 +15210,7 @@ var init_package = __esm({
15209
15210
  "package.json"() {
15210
15211
  package_default = {
15211
15212
  name: "agent-shim",
15212
- version: "14.12.1",
15213
+ version: "14.12.3",
15213
15214
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
15214
15215
  license: "MIT",
15215
15216
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -27938,6 +27939,16 @@ function parseJsonObject5(body) {
27938
27939
  }
27939
27940
  return isRecord16(parsed) ? parsed : void 0;
27940
27941
  }
27942
+ function internalEventOf(event, newUuid, now) {
27943
+ if (!isRecord16(event) || !isRecord16(event.payload)) {
27944
+ return void 0;
27945
+ }
27946
+ const eventType = nonEmptyString4(event.payload, "type");
27947
+ return eventType === void 0 ? void 0 : { eventId: newUuid(), eventType, payload: event.payload, isCompaction: event.is_compaction === true, agentId: nonEmptyString4(event, "session_agent_id"), createdAt: new Date(now()).toISOString() };
27948
+ }
27949
+ function internalEventRow(event) {
27950
+ return { event_id: event.eventId, event_type: event.eventType, payload: event.payload, is_compaction: event.isCompaction, created_at: event.createdAt, ...event.agentId === void 0 ? {} : { session_agent_id: event.agentId } };
27951
+ }
27941
27952
  function mintWorkerJwt(randomToken, issuedAt) {
27942
27953
  const encode = (value) => Buffer.from(JSON.stringify(value), "utf8").toString("base64url");
27943
27954
  const header = encode({ alg: "HS256", typ: "JWT" });
@@ -28254,25 +28265,22 @@ data: ${JSON.stringify(envelope)}
28254
28265
  return;
28255
28266
  }
28256
28267
  const events = body?.events;
28257
- if (!Array.isArray(events)) {
28258
- await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "an internal event batch is an array" } });
28268
+ const posted = Array.isArray(events) ? events : void 0;
28269
+ const filed = posted?.map((event) => internalEventOf(event, deps.newUuid, deps.now)).filter((event) => event !== void 0);
28270
+ if (filed === void 0 || filed.length !== posted?.length) {
28271
+ await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "an internal event batch is an array of events, each carrying one typed payload object" } });
28259
28272
  return;
28260
28273
  }
28261
- for (const event of events) {
28262
- if (isRecord16(event)) {
28263
- session.internalEvents.push({ eventId: deps.newUuid(), body: event });
28264
- }
28265
- }
28274
+ session.internalEvents.push(...filed);
28266
28275
  await answerJson2(response, HTTP_STATUS.ok, {});
28267
28276
  return;
28268
28277
  }
28269
28278
  if (workerTail === "internal-events" && method === "GET") {
28270
28279
  const query = new URL(request4.url, "http://127.0.0.1").searchParams;
28271
- if (query.get("session_agent_id") !== null || query.get("subagents") !== null) {
28272
- await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "this surface keeps one internal-events channel per session, so an agent-scoped read has no subset to serve" } });
28273
- return;
28274
- }
28275
- const page = pageOfRcChannel(request4.url, session.internalEvents, (event) => event.eventId, (event) => ({ event_id: event.eventId, payload: event.body }));
28280
+ const agentId = query.get("session_agent_id");
28281
+ const everyAgent = query.get("subagents") !== null;
28282
+ const rows = session.internalEvents.filter((event) => agentId !== null ? event.agentId === agentId : event.agentId !== void 0 === everyAgent);
28283
+ const page = pageOfRcChannel(request4.url, rows, (event) => event.eventId, internalEventRow);
28276
28284
  if ("error" in page) {
28277
28285
  const anchorUnknown = query.get("after_event_id") !== null && page.error.startsWith("the anchor names an event id");
28278
28286
  await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: anchorUnknown ? "after_event_id_not_found" : "invalid_request_error", message: page.error } });
package/dist/index.mjs CHANGED
@@ -59,6 +59,7 @@ var init_categories_default = __esm({
59
59
  ],
60
60
  knowledge: [
61
61
  "skills",
62
+ "output-styles",
62
63
  "agents",
63
64
  "rules",
64
65
  "memory",
@@ -15180,7 +15181,7 @@ var init_package = __esm({
15180
15181
  "package.json"() {
15181
15182
  package_default = {
15182
15183
  name: "agent-shim",
15183
- version: "14.12.1",
15184
+ version: "14.12.3",
15184
15185
  description: "A profile manager and launcher for Claude Code that lets one person run multiple logins from one machine while controlling what gets shared between them.",
15185
15186
  license: "MIT",
15186
15187
  author: "Joseph Mearman <joseph@mearman.co.uk>",
@@ -27485,6 +27486,16 @@ function parseJsonObject5(body) {
27485
27486
  }
27486
27487
  return isRecord16(parsed) ? parsed : void 0;
27487
27488
  }
27489
+ function internalEventOf(event, newUuid, now) {
27490
+ if (!isRecord16(event) || !isRecord16(event.payload)) {
27491
+ return void 0;
27492
+ }
27493
+ const eventType = nonEmptyString4(event.payload, "type");
27494
+ return eventType === void 0 ? void 0 : { eventId: newUuid(), eventType, payload: event.payload, isCompaction: event.is_compaction === true, agentId: nonEmptyString4(event, "session_agent_id"), createdAt: new Date(now()).toISOString() };
27495
+ }
27496
+ function internalEventRow(event) {
27497
+ return { event_id: event.eventId, event_type: event.eventType, payload: event.payload, is_compaction: event.isCompaction, created_at: event.createdAt, ...event.agentId === void 0 ? {} : { session_agent_id: event.agentId } };
27498
+ }
27488
27499
  function mintWorkerJwt(randomToken, issuedAt) {
27489
27500
  const encode = (value) => Buffer.from(JSON.stringify(value), "utf8").toString("base64url");
27490
27501
  const header = encode({ alg: "HS256", typ: "JWT" });
@@ -27801,25 +27812,22 @@ data: ${JSON.stringify(envelope)}
27801
27812
  return;
27802
27813
  }
27803
27814
  const events = body?.events;
27804
- if (!Array.isArray(events)) {
27805
- await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "an internal event batch is an array" } });
27815
+ const posted = Array.isArray(events) ? events : void 0;
27816
+ const filed = posted?.map((event) => internalEventOf(event, deps.newUuid, deps.now)).filter((event) => event !== void 0);
27817
+ if (filed === void 0 || filed.length !== posted?.length) {
27818
+ await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "an internal event batch is an array of events, each carrying one typed payload object" } });
27806
27819
  return;
27807
27820
  }
27808
- for (const event of events) {
27809
- if (isRecord16(event)) {
27810
- session.internalEvents.push({ eventId: deps.newUuid(), body: event });
27811
- }
27812
- }
27821
+ session.internalEvents.push(...filed);
27813
27822
  await answerJson2(response, HTTP_STATUS.ok, {});
27814
27823
  return;
27815
27824
  }
27816
27825
  if (workerTail === "internal-events" && method === "GET") {
27817
27826
  const query = new URL(request4.url, "http://127.0.0.1").searchParams;
27818
- if (query.get("session_agent_id") !== null || query.get("subagents") !== null) {
27819
- await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: "invalid_request_error", message: "this surface keeps one internal-events channel per session, so an agent-scoped read has no subset to serve" } });
27820
- return;
27821
- }
27822
- const page = pageOfRcChannel(request4.url, session.internalEvents, (event) => event.eventId, (event) => ({ event_id: event.eventId, payload: event.body }));
27827
+ const agentId = query.get("session_agent_id");
27828
+ const everyAgent = query.get("subagents") !== null;
27829
+ const rows = session.internalEvents.filter((event) => agentId !== null ? event.agentId === agentId : event.agentId !== void 0 === everyAgent);
27830
+ const page = pageOfRcChannel(request4.url, rows, (event) => event.eventId, internalEventRow);
27823
27831
  if ("error" in page) {
27824
27832
  const anchorUnknown = query.get("after_event_id") !== null && page.error.startsWith("the anchor names an event id");
27825
27833
  await answerJson2(response, HTTP_STATUS.badRequest, { type: "error", error: { type: anchorUnknown ? "after_event_id_not_found" : "invalid_request_error", message: page.error } });