@yhong91/vibetime 0.1.50 → 0.1.51

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 (2) hide show
  1. package/bin/vibetime.mjs +95 -1
  2. package/package.json +1 -1
package/bin/vibetime.mjs CHANGED
@@ -2047,7 +2047,7 @@ function claudeStyleFileMetrics(tool, input) {
2047
2047
  }
2048
2048
 
2049
2049
  // src/lib/constants.ts
2050
- var PACKAGE_VERSION = true ? "0.1.50" : "0.1.1";
2050
+ var PACKAGE_VERSION = true ? "0.1.51" : "0.1.1";
2051
2051
  var DEFAULT_API_URL = "http://121.196.224.82:3001";
2052
2052
  var DEFAULT_BACKFILL_BATCH_SIZE = 50;
2053
2053
  var DEFAULT_BACKFILL_BATCH_BYTES = 800 * 1024;
@@ -8533,6 +8533,41 @@ async function parseQoderCnSessionFile(filePath, options) {
8533
8533
  }
8534
8534
  pendingTools.delete(pending.id);
8535
8535
  }
8536
+ const attachedPrompt = extractQoderAttachedPrompt(qoderCnToolResultItems(message)[0]?.content);
8537
+ if (attachedPrompt) {
8538
+ const prompt = qoderCnTextStats(attachedPrompt);
8539
+ state.closeTurn(ts, lineNumber, topType);
8540
+ state.currentTurnId = stringField(raw, "uuid") || stringField(raw, "promptId") || `turn_${createStableHash([sessionId, lineNumber]).slice(0, 24)}`;
8541
+ state.currentTurnStartedAt = ts;
8542
+ state.currentTurnLastEventAt = ts;
8543
+ push(baseQoderCnEvent({
8544
+ ts,
8545
+ type: "turn.started",
8546
+ sessionId,
8547
+ turnId: state.currentTurnId,
8548
+ cwd,
8549
+ project,
8550
+ model,
8551
+ confidence: "derived"
8552
+ }), lineNumber, topType, "attached_prompt");
8553
+ push(baseQoderCnEvent({
8554
+ ts,
8555
+ type: "prompt.submitted",
8556
+ sessionId,
8557
+ turnId: state.currentTurnId,
8558
+ cwd,
8559
+ project,
8560
+ model,
8561
+ confidence: "exact",
8562
+ metrics: {
8563
+ prompts: 1,
8564
+ promptChars: prompt.chars
8565
+ },
8566
+ refs: stringRefs({
8567
+ promptHash: prompt.hash
8568
+ })
8569
+ }), lineNumber, topType, "attached_prompt");
8570
+ }
8536
8571
  continue;
8537
8572
  }
8538
8573
  if (topType === "user") {
@@ -8874,6 +8909,30 @@ function isNoisePrompt(text) {
8874
8909
  }
8875
8910
  return false;
8876
8911
  }
8912
+ function extractQoderAttachedPrompt(content) {
8913
+ let text;
8914
+ if (typeof content === "string") {
8915
+ text = content;
8916
+ } else if (Array.isArray(content)) {
8917
+ text = content.filter((it) => isPlainObject(it) && it.type === "text").map((it) => stringField(it, "text")).join("\n");
8918
+ } else {
8919
+ return void 0;
8920
+ }
8921
+ if (!text.includes("aicoding-text-field") || !text.includes("text-field-content")) {
8922
+ return void 0;
8923
+ }
8924
+ const fenceStart = text.indexOf("```");
8925
+ if (fenceStart === -1) {
8926
+ return void 0;
8927
+ }
8928
+ const afterFence = text.slice(fenceStart + 3);
8929
+ const fenceEnd = afterFence.indexOf("```");
8930
+ if (fenceEnd === -1) {
8931
+ return void 0;
8932
+ }
8933
+ const inner = afterFence.slice(0, fenceEnd);
8934
+ return inner.split("\n").map((line) => line.replace(/^\s*\d+->/, "")).join("\n").trim() || void 0;
8935
+ }
8877
8936
  async function qoderCnProjectContextFromLines(filePath, lines, options, configDir2) {
8878
8937
  const { projectName: projectDir, sessionId } = parseQoderCnPaths(filePath);
8879
8938
  const isSubagent = filePath.includes(`${path17.sep}subagents${path17.sep}`);
@@ -9353,6 +9412,41 @@ async function parseQoderSessionFile(filePath, options) {
9353
9412
  }
9354
9413
  pendingTools.delete(pending.id);
9355
9414
  }
9415
+ const attachedPrompt = extractQoderAttachedPrompt(qoderToolResultItems(message)[0]?.content);
9416
+ if (attachedPrompt) {
9417
+ const prompt = qoderTextStats(attachedPrompt);
9418
+ state.closeTurn(ts, lineNumber, topType);
9419
+ state.currentTurnId = stringField(raw, "uuid") || stringField(raw, "promptId") || `turn_${createStableHash([sessionId, lineNumber]).slice(0, 24)}`;
9420
+ state.currentTurnStartedAt = ts;
9421
+ state.currentTurnLastEventAt = ts;
9422
+ push(baseQoderEvent({
9423
+ ts,
9424
+ type: "turn.started",
9425
+ sessionId,
9426
+ turnId: state.currentTurnId,
9427
+ cwd,
9428
+ project,
9429
+ model,
9430
+ confidence: "derived"
9431
+ }), lineNumber, topType, "attached_prompt");
9432
+ push(baseQoderEvent({
9433
+ ts,
9434
+ type: "prompt.submitted",
9435
+ sessionId,
9436
+ turnId: state.currentTurnId,
9437
+ cwd,
9438
+ project,
9439
+ model,
9440
+ confidence: "exact",
9441
+ metrics: {
9442
+ prompts: 1,
9443
+ promptChars: prompt.chars
9444
+ },
9445
+ refs: stringRefs({
9446
+ promptHash: prompt.hash
9447
+ })
9448
+ }), lineNumber, topType, "attached_prompt");
9449
+ }
9356
9450
  continue;
9357
9451
  }
9358
9452
  if (topType === "user") {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@yhong91/vibetime",
3
3
  "type": "module",
4
- "version": "0.1.50",
4
+ "version": "0.1.51",
5
5
  "description": "vibetime CLI — install AI-agent hooks (Claude Code, Codex, OpenCode, Pi) and report activity to vibetime.",
6
6
  "license": "MIT",
7
7
  "publishConfig": {