@ycodium-ai/agent-claude 0.2.3799 → 0.2.3904

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.
Files changed (3) hide show
  1. package/README.md +5 -2
  2. package/dist/index.js +51 -19
  3. package/package.json +3 -3
package/README.md CHANGED
@@ -15,8 +15,11 @@ Facts:
15
15
  - Isolation is `CLAUDE_CONFIG_DIR` and, when set, `CLAUDE_SECURESTORAGE_CONFIG_DIR`.
16
16
  `HOME` is never overridden (macOS keychain lookup lives under `$HOME`).
17
17
  - Manifest permission is `{ kind: "executor" }`.
18
- - `SessionStart` reports `session_id` and `transcript_path` through
19
- `thread.metadata.updated.payload.nativeHistory`. The host persists this location on the
18
+ - `UserPromptSubmit` and `SessionStart` report the main session's `session_id` and
19
+ `transcript_path` through `thread.metadata.updated.payload.nativeHistory`, once per path.
20
+ SDK sessions do not call back `SessionStart` on startup or resume (Claude Code 2.1.312),
21
+ so the first prompt of each process records the location; calls carrying `agent_id`
22
+ come from a subagent and are ignored. The host persists this location on the
20
23
  owning session binding and supplies `parentTranscriptPath` to `sessions.openHistory`.
21
24
  The reader derives the subagent path from that transcript and checks its native session
22
25
  and workspace metadata. Bindings without a saved location use the configured projects
package/dist/index.js CHANGED
@@ -25460,29 +25460,40 @@ var makeSessionCallbacks = (deps) => {
25460
25460
  }
25461
25461
  return {};
25462
25462
  };
25463
+ const isNewMainTranscript = (context, hookInput) => hookInput.agent_id === void 0 && hookInput.session_id === context.resumeSessionId && typeof hookInput.transcript_path === "string" && hookInput.transcript_path.length > 0 && hookInput.transcript_path !== context.reportedTranscriptPath;
25464
+ const reportTranscriptPath = async (context, hookInput) => {
25465
+ context.reportedTranscriptPath = hookInput.transcript_path;
25466
+ const stamp = await makeEventStamp();
25467
+ if (context.stopped || context.stopping) return;
25468
+ offerRuntimeEvent(context, {
25469
+ type: "thread.metadata.updated",
25470
+ ...eventHeader(context, stamp),
25471
+ payload: {
25472
+ nativeHistory: {
25473
+ nativeSessionId: hookInput.session_id,
25474
+ transcriptPath: hookInput.transcript_path
25475
+ }
25476
+ },
25477
+ providerRefs: {}
25478
+ });
25479
+ };
25480
+ const handleUserPromptSubmit = async (hookInput) => {
25481
+ sessionContext ??= await waitSessionContext();
25482
+ const context = sessionContext;
25483
+ if (context && !context.stopped && !context.stopping && isNewMainTranscript(context, hookInput))
25484
+ await reportTranscriptPath(context, hookInput);
25485
+ return {};
25486
+ };
25463
25487
  const handleSessionStart = async (hookInput) => {
25464
25488
  sessionContext ??= await waitSessionContext();
25465
25489
  const context = sessionContext;
25466
25490
  if (!context || context.stopped || context.stopping) return {};
25467
- if (hookInput.session_id === context.resumeSessionId && typeof hookInput.transcript_path === "string" && hookInput.transcript_path.length > 0 && hookInput.transcript_path !== context.reportedTranscriptPath) {
25468
- context.reportedTranscriptPath = hookInput.transcript_path;
25469
- const stamp = await makeEventStamp();
25491
+ if (isNewMainTranscript(context, hookInput)) {
25492
+ await reportTranscriptPath(context, hookInput);
25470
25493
  if (context.stopped || context.stopping) return {};
25471
- offerRuntimeEvent(context, {
25472
- type: "thread.metadata.updated",
25473
- ...eventHeader(context, stamp),
25474
- payload: {
25475
- nativeHistory: {
25476
- nativeSessionId: hookInput.session_id,
25477
- transcriptPath: hookInput.transcript_path
25478
- }
25479
- },
25480
- providerRefs: {}
25481
- });
25482
25494
  }
25483
25495
  if (hookInput.source !== "compact" || session.contextAfterCompaction === void 0) return {};
25484
- sessionContext ??= context;
25485
- const compactionId = sessionContext?.compaction?.compactionId;
25496
+ const compactionId = context.compaction?.compactionId;
25486
25497
  if (compactionId === void 0) return {};
25487
25498
  const signal = AbortSignal.timeout(CONTEXT_AFTER_COMPACTION_TIMEOUT_MS);
25488
25499
  const aborted = Promise.withResolvers();
@@ -25776,7 +25787,14 @@ var makeSessionCallbacks = (deps) => {
25776
25787
  });
25777
25788
  };
25778
25789
  const onUserDialog = (request, callbackOptions) => handleResumeDialog(request, callbackOptions);
25779
- return { canUseTool, onUserDialog, handlePostCompact, handlePreCompact, handleSessionStart };
25790
+ return {
25791
+ canUseTool,
25792
+ onUserDialog,
25793
+ handlePostCompact,
25794
+ handlePreCompact,
25795
+ handleSessionStart,
25796
+ handleUserPromptSubmit
25797
+ };
25780
25798
  };
25781
25799
  return { forSession };
25782
25800
  };
@@ -26338,7 +26356,14 @@ var makeStartSession = (deps) => {
26338
26356
  if (timer !== void 0) clearTimeout(timer);
26339
26357
  }
26340
26358
  };
26341
- const { canUseTool, onUserDialog, handlePostCompact, handlePreCompact, handleSessionStart } = sessionCallbacks.forSession({
26359
+ const {
26360
+ canUseTool,
26361
+ onUserDialog,
26362
+ handlePostCompact,
26363
+ handlePreCompact,
26364
+ handleSessionStart,
26365
+ handleUserPromptSubmit
26366
+ } = sessionCallbacks.forSession({
26342
26367
  waitSessionContext,
26343
26368
  pendingApprovals,
26344
26369
  pendingUserInputs,
@@ -26403,6 +26428,13 @@ var makeStartSession = (deps) => {
26403
26428
  ]
26404
26429
  }
26405
26430
  ],
26431
+ UserPromptSubmit: [
26432
+ {
26433
+ hooks: [
26434
+ async (hookInput) => hookInput.hook_event_name === "UserPromptSubmit" ? handleUserPromptSubmit(hookInput) : {}
26435
+ ]
26436
+ }
26437
+ ],
26406
26438
  PostCompact: [
26407
26439
  {
26408
26440
  hooks: [
@@ -29680,7 +29712,7 @@ var executors = [
29680
29712
  ];
29681
29713
  var index_default = definePlugin({
29682
29714
  id: "agent-claude",
29683
- apiVersion: 60,
29715
+ apiVersion: 66,
29684
29716
  executors,
29685
29717
  activate(ctx) {
29686
29718
  ctx.command({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-claude",
3
- "version": "0.2.3799",
3
+ "version": "0.2.3904",
4
4
  "description": "Claude executor: Claude Code CLI via @anthropic-ai/claude-agent-sdk.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -24,9 +24,9 @@
24
24
  "@types/node": "24.12.4",
25
25
  "esbuild": "0.28.1",
26
26
  "vite-plus": "0.2.2",
27
- "@ycodium-ai/plugin-api": "0.2.3799",
28
- "ycodium-jsonl-stream": "0.0.0",
27
+ "@ycodium-ai/plugin-api": "0.2.3904",
29
28
  "ycodium-composer-tokens": "0.0.0",
29
+ "ycodium-jsonl-stream": "0.0.0",
30
30
  "ycodium-executor-testing": "0.0.0"
31
31
  },
32
32
  "ycodium": {