@vincemakes/kiso-runtime 0.32.2 → 0.34.0

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/dist/profile.js CHANGED
@@ -57,7 +57,11 @@ export function writeProfile(root, sessionId, profile) {
57
57
  const tmpDir = mkdtempSync(join(root, ".meta-"));
58
58
  const tmp = join(tmpDir, "meta.json");
59
59
  try {
60
- writeFileSync(tmp, `${JSON.stringify({ profile }, null, "\t")}\n`);
60
+ // DF-0322-F1: 0600 on the file kiso CREATES. The mode rides the temp
61
+ // because rename preserves it, and rename is the only path by which
62
+ // this file comes into existence. Existing files are not migrated —
63
+ // R6's choice, kept.
64
+ writeFileSync(tmp, `${JSON.stringify({ profile }, null, "\t")}\n`, { mode: 0o600 });
61
65
  const fd = openSync(tmp, "r");
62
66
  try {
63
67
  fsyncSync(fd);
package/dist/session.js CHANGED
@@ -485,8 +485,8 @@ export class AgentSession {
485
485
  try {
486
486
  const canonical = canonicalizeUsageForModel(binding.model, binding.baseUrl, binding.provider ?? "adapter", usage);
487
487
  const line = JSON.stringify({ kind: "summary", canonical }) + "\n";
488
- mkdirSync(join(this.#store.root, "traces"), { recursive: true });
489
- appendFileSync(join(this.#store.root, "traces", `${this.id}.jsonl`), line);
488
+ mkdirSync(join(this.#store.root, "traces"), { recursive: true, mode: 0o700 }); // DF-0322-F1
489
+ appendFileSync(join(this.#store.root, "traces", `${this.id}.jsonl`), line, { mode: 0o600 });
490
490
  }
491
491
  catch (err) {
492
492
  console.error(`[kiso] summary usage ledger degraded (${err instanceof Error ? err.message : String(err)}); the summary call's cost is not recorded`);
@@ -55,7 +55,7 @@ export class TraceWriter {
55
55
  if (this.#degraded)
56
56
  return;
57
57
  try {
58
- mkdirSync(join(this.#root, "traces"), { recursive: true });
58
+ mkdirSync(join(this.#root, "traces"), { recursive: true, mode: 0o700 }); // DF-0322-F1
59
59
  const fresh = !existsSync(this.#path);
60
60
  if (this.#crashDetect()) {
61
61
  this.#writeSync([
@@ -129,7 +129,11 @@ export class TraceWriter {
129
129
  if (lines.length === 0)
130
130
  return;
131
131
  try {
132
- appendFileSync(this.#path, `${lines.map((l) => JSON.stringify(l)).join("\n")}\n`);
132
+ // DF-0322-F1: the mode applies when THIS call creates the file, and
133
+ // it is the only call that ever does — nothing truncates the ledger
134
+ // into existence first (the R6b trap, where an earlier writeFileSync
135
+ // made the append's mode a no-op).
136
+ appendFileSync(this.#path, `${lines.map((l) => JSON.stringify(l)).join("\n")}\n`, { mode: 0o600 });
133
137
  }
134
138
  catch (err) {
135
139
  this.#degrade(err);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-runtime",
3
- "version": "0.32.2",
3
+ "version": "0.34.0",
4
4
  "description": "kiso runtime — durable multi-turn agent sessions: AgentDefinition, AgentRuntime, AgentSession, Run, append-only JSONL store.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -25,12 +25,12 @@
25
25
  "test": "vitest run"
26
26
  },
27
27
  "dependencies": {
28
- "@vincemakes/kiso-core": "0.32.2"
28
+ "@vincemakes/kiso-core": "0.34.0"
29
29
  },
30
30
  "peerDependencies": {
31
- "@vincemakes/kiso-provider-anthropic": "0.32.2",
32
- "@vincemakes/kiso-provider-openai": "0.32.2",
33
- "@vincemakes/kiso-provider-openai-responses": "0.32.2"
31
+ "@vincemakes/kiso-provider-anthropic": "0.34.0",
32
+ "@vincemakes/kiso-provider-openai": "0.34.0",
33
+ "@vincemakes/kiso-provider-openai-responses": "0.34.0"
34
34
  },
35
35
  "peerDependenciesMeta": {
36
36
  "@vincemakes/kiso-provider-anthropic": {
@@ -44,7 +44,7 @@
44
44
  }
45
45
  },
46
46
  "devDependencies": {
47
- "@vincemakes/kiso-evals": "0.32.2",
47
+ "@vincemakes/kiso-evals": "0.34.0",
48
48
  "@types/node": "^26.1.2",
49
49
  "typescript": "^5.7.2",
50
50
  "vitest": "^3.0.0"