@vincemakes/kiso-runtime 0.42.0 → 0.42.1

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/compose.d.ts CHANGED
@@ -43,7 +43,8 @@ export declare function composeToolTable(registry: ToolRegistry, rules?: ToolRul
43
43
  * No appends → the base passes through byte-identical.
44
44
  */
45
45
  /** An extension's append as text: a string as is, a function evaluated
46
- * NOW (0.42.0 — the per-run seam; call this once per composition). */
46
+ * NOW (0.42.0 — call this once per attempt). 0.42.1 (#14): a function
47
+ * may answer undefined — no append this attempt, no separator. */
47
48
  export declare function appendOf(extension: KisoExtension): string | undefined;
48
49
  export declare function composeSystemPrompt(base: string | undefined, extensions: readonly KisoExtension[]): string | undefined;
49
50
  /** The base and the append texts, \n\n-joined; no appends → the base as is. */
package/dist/compose.js CHANGED
@@ -4,10 +4,13 @@
4
4
  * hook composition (the existing come first), and the loop's microcompact config lookup.
5
5
  */
6
6
  export function runBasePrompt(systemPrompt, registry, rules = [], table = "on") {
7
+ // 0.42.1 (the products' request #15): "" composes as ABSENT — never a
8
+ // bare separator ahead of the table or the appends.
9
+ const base = systemPrompt === "" ? undefined : systemPrompt;
7
10
  if (table === "off")
8
- return systemPrompt;
11
+ return base;
9
12
  const toolTable = composeToolTable(registry, rules);
10
- return toolTable === "" ? systemPrompt : systemPrompt === undefined ? toolTable : `${systemPrompt}\n\n${toolTable}`;
13
+ return toolTable === "" ? base : base === undefined ? toolTable : `${base}\n\n${toolTable}`;
11
14
  }
12
15
  /** The table, or "" when the registry is empty (no vocabulary, no tools). */
13
16
  export function composeToolTable(registry, rules = []) {
@@ -36,7 +39,8 @@ export function composeToolTable(registry, rules = []) {
36
39
  * No appends → the base passes through byte-identical.
37
40
  */
38
41
  /** An extension's append as text: a string as is, a function evaluated
39
- * NOW (0.42.0 — the per-run seam; call this once per composition). */
42
+ * NOW (0.42.0 — call this once per attempt). 0.42.1 (#14): a function
43
+ * may answer undefined — no append this attempt, no separator. */
40
44
  export function appendOf(extension) {
41
45
  const append = extension.systemPrompt?.append;
42
46
  return typeof append === "function" ? append() : append;
@@ -49,9 +53,10 @@ export function composeSystemPrompt(base, extensions) {
49
53
  }
50
54
  /** The base and the append texts, \n\n-joined; no appends → the base as is. */
51
55
  export function joinPrompt(base, appends) {
56
+ const head = base === "" ? undefined : base; // 0.42.1 (#15): "" is absent
52
57
  if (appends.length === 0)
53
- return base;
54
- return base === undefined ? appends.join("\n\n") : `${base}\n\n${appends.join("\n\n")}`;
58
+ return head;
59
+ return head === undefined ? appends.join("\n\n") : `${head}\n\n${appends.join("\n\n")}`;
55
60
  }
56
61
  /** 0.42.0: the OUTERMOST adapter layer — `compose` runs exactly once per
57
62
  * provider attempt (a retry is a new attempt) and its result is the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-runtime",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "description": "kiso runtime \u2014 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.42.0"
28
+ "@vincemakes/kiso-core": "0.42.1"
29
29
  },
30
30
  "peerDependencies": {
31
- "@vincemakes/kiso-provider-anthropic": "0.42.0",
32
- "@vincemakes/kiso-provider-openai": "0.42.0",
33
- "@vincemakes/kiso-provider-openai-responses": "0.42.0"
31
+ "@vincemakes/kiso-provider-anthropic": "0.42.1",
32
+ "@vincemakes/kiso-provider-openai": "0.42.1",
33
+ "@vincemakes/kiso-provider-openai-responses": "0.42.1"
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.42.0",
47
+ "@vincemakes/kiso-evals": "0.42.1",
48
48
  "@types/node": "^26.1.2",
49
49
  "typescript": "^5.7.2",
50
50
  "vitest": "^3.0.0"