codiedev 0.9.61 → 0.9.63

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/dist/utils.js +13 -5
  2. package/package.json +2 -2
package/dist/utils.js CHANGED
@@ -1097,7 +1097,7 @@ function installOpenCodeCapturePlugin() {
1097
1097
  const prompt = resolveHookInvocation("discover-codie");
1098
1098
  const source = `// Managed by codiedev connect. Safe to remove and reinstall.\n` +
1099
1099
  `import { spawn, spawnSync } from "node:child_process";\n` +
1100
- `import { mkdir, writeFile } from "node:fs/promises";\n` +
1100
+ `import { mkdirSync, writeFileSync, renameSync } from "node:fs";\n` +
1101
1101
  `import os from "node:os";\n` +
1102
1102
  `import path from "node:path";\n\n` +
1103
1103
  `const START = ${JSON.stringify(start)};\n` +
@@ -1144,7 +1144,11 @@ function installOpenCodeCapturePlugin() {
1144
1144
  ` const prompt = Array.isArray(output?.parts) ? output.parts.filter((part) => part?.type === "text").map((part) => part.text || "").join("\\n") : "";\n` +
1145
1145
  ` const decision = invokeSync(PROMPT, { session_id: id, cwd, prompt });\n` +
1146
1146
  ` const context = decision?.hookSpecificOutput?.additionalContext;\n` +
1147
- ` if (context && Array.isArray(output?.parts)) output.parts.push({ type: "text", text: context });\n` +
1147
+ ` if (context && Array.isArray(output?.parts)) {\n` +
1148
+ ` // Preserve the native part IDs required by current engine schemas.\n` +
1149
+ ` const part = output.parts.find((part) => part?.type === "text" && typeof part.text === "string");\n` +
1150
+ ` if (part) part.text += "\\n\\n" + context;\n` +
1151
+ ` }\n` +
1148
1152
  ` },\n` +
1149
1153
  ` event: async ({ event }) => {\n` +
1150
1154
  ` const id = sessionId(event);\n` +
@@ -1169,13 +1173,17 @@ function installOpenCodeCapturePlugin() {
1169
1173
  ` const last = list.at(-1);\n` +
1170
1174
  ` const fingerprint = String(list.length) + ":" + String(last?.info?.id ?? last?.info?.time?.completed ?? "");\n` +
1171
1175
  ` if (fingerprints.get(id) === fingerprint) return;\n` +
1172
- ` fingerprints.set(id, fingerprint);\n` +
1173
1176
  ` const captureDir = path.join(os.homedir(), ".codiedev", "opencode-captures");\n` +
1174
- ` await mkdir(captureDir, { recursive: true, mode: 0o700 });\n` +
1177
+ ` mkdirSync(captureDir, { recursive: true, mode: 0o700 });\n` +
1175
1178
  ` const safeId = String(id).replace(/[^a-zA-Z0-9._-]/g, "_");\n` +
1176
1179
  ` const transcriptPath = path.join(captureDir, safeId + ".json");\n` +
1177
- ` await writeFile(transcriptPath, JSON.stringify(list), { mode: 0o600 });\n` +
1180
+ ` // The engine may exit as soon as it emits idle. Publish the complete\n` +
1181
+ ` // transcript synchronously so exit finalization never sees a partial file.\n` +
1182
+ ` const temporaryPath = transcriptPath + "." + process.pid + ".tmp";\n` +
1183
+ ` writeFileSync(temporaryPath, JSON.stringify(list), { mode: 0o600 });\n` +
1184
+ ` renameSync(temporaryPath, transcriptPath);\n` +
1178
1185
  ` transcriptPaths.set(id, transcriptPath);\n` +
1186
+ ` fingerprints.set(id, fingerprint);\n` +
1179
1187
  ` dispatch(CAPTURE, { session_id: id, transcript_path: transcriptPath, cwd, workspace_roots: [cwd], launch: LAUNCH });\n` +
1180
1188
  ` } catch {}\n` +
1181
1189
  ` },\n` +
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "codiedev",
3
- "version": "0.9.61",
4
- "description": "Connect Claude Code, Codex, Cursor, OpenCode, or VS Code Copilot to Codiedev for team session capture and artifact collaboration \u2014 and run the governed Codie harness",
3
+ "version": "0.9.63",
4
+ "description": "Connect Claude Code, Codex, Cursor, OpenCode, or VS Code Copilot to Codiedev for team session capture and artifact collaboration — and run the governed Codie harness",
5
5
  "bin": {
6
6
  "codiedev": "dist/cli.js",
7
7
  "codiedev-hook": "dist/hook.js",