@vincemakes/kiso-runtime 1.0.1 → 1.1.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/agent.d.ts CHANGED
@@ -62,6 +62,7 @@ export interface AgentDefinition {
62
62
  * loop's policy chain. */
63
63
  readonly extensions?: readonly KisoExtension[];
64
64
  }
65
+ /** @deprecated the canonical name is `Agent` (root export, 1.1.0); this alias is removed in the next major. */
65
66
  export declare class AgentRuntime {
66
67
  #private;
67
68
  constructor(definition: AgentDefinition);
package/dist/agent.js CHANGED
@@ -13,6 +13,7 @@
13
13
  */
14
14
  import { EventLog, ToolRegistry } from "@vincemakes/kiso-core";
15
15
  import { AgentSession } from "./session.js";
16
+ /** @deprecated the canonical name is `Agent` (root export, 1.1.0); this alias is removed in the next major. */
16
17
  export class AgentRuntime {
17
18
  #definition;
18
19
  #registry;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,31 @@
1
- export * from "./agent.js";
2
- export * from "./session.js";
3
- export * from "./run.js";
4
- export * from "./recovery.js";
5
- export * from "./compose.js";
6
- export * from "./summarize.js";
7
- export * from "./store.js";
8
- export * from "./lock-adapter.js";
9
- export * from "./ledger.js";
10
- export * from "./extensions.js";
11
- export * from "./trust.js";
1
+ /**
2
+ * The SDK surface — the curated root manifest (S1, 2026-08-12).
3
+ *
4
+ * Every name here is a review-approved contract: adding or removing one
5
+ * WITHOUT the ritual (the review's sign-off + a public-surface.json
6
+ * refresh) turns the public-surface gate red. See docs/sdk.md for the
7
+ * contract, the aliases, and what deliberately lives behind the
8
+ * first-party door.
9
+ *
10
+ * What is NOT here is not the SDK. The recovery / compose / summarize /
11
+ * lock-adapter machinery and buildAdapter live behind "./internal"
12
+ * (unstable, first-party only — see internal.ts).
13
+ *
14
+ * Canonical names: Agent = AgentRuntime, Session = AgentSession. The old
15
+ * names are deprecated aliases, removed in the next major (additive,
16
+ * ADR-0051 Amendment 1 — release rounds move the cli minor).
17
+ */
18
+ export { AgentRuntime, AgentRuntime as Agent, createAgent } from "./agent.js";
19
+ export type { AgentDefinition, PermissionPolicy, PermissionRule } from "./agent.js";
20
+ export { AgentSession, AgentSession as Session } from "./session.js";
21
+ export { PoisonedSessionError, ResumeBlockedError } from "./session.js";
22
+ export type { ApprovalRequest, CompactInfo, SessionConfig, SummarizeResult } from "./session.js";
23
+ export { Run } from "./run.js";
24
+ export { SessionStore, StaleWriterError, StoreCorruptionError } from "./store.js";
25
+ export type { Event, SessionMeta, StoreRecord } from "./store.js";
26
+ export { disposeExtensions, loadExtensions, loadProjectExtensions } from "./extensions.js";
27
+ export type { KisoExtension } from "./extensions.js";
28
+ export { executionForCallId, executionLedger } from "./ledger.js";
29
+ export type { ExecutionRecord, ExecutionStatus } from "./ledger.js";
30
+ export { kisoHome, projectArtifacts, recordTrust, trustFor } from "./trust.js";
31
+ export type { ProjectArtifact, ProjectArtifacts, TrustDecision, TrustRecord } from "./trust.js";
package/dist/index.js CHANGED
@@ -1,11 +1,32 @@
1
- export * from "./agent.js";
2
- export * from "./session.js";
3
- export * from "./run.js";
4
- export * from "./recovery.js";
5
- export * from "./compose.js";
6
- export * from "./summarize.js";
7
- export * from "./store.js";
8
- export * from "./lock-adapter.js";
9
- export * from "./ledger.js";
10
- export * from "./extensions.js";
11
- export * from "./trust.js";
1
+ /**
2
+ * The SDK surface — the curated root manifest (S1, 2026-08-12).
3
+ *
4
+ * Every name here is a review-approved contract: adding or removing one
5
+ * WITHOUT the ritual (the review's sign-off + a public-surface.json
6
+ * refresh) turns the public-surface gate red. See docs/sdk.md for the
7
+ * contract, the aliases, and what deliberately lives behind the
8
+ * first-party door.
9
+ *
10
+ * What is NOT here is not the SDK. The recovery / compose / summarize /
11
+ * lock-adapter machinery and buildAdapter live behind "./internal"
12
+ * (unstable, first-party only — see internal.ts).
13
+ *
14
+ * Canonical names: Agent = AgentRuntime, Session = AgentSession. The old
15
+ * names are deprecated aliases, removed in the next major (additive,
16
+ * ADR-0051 Amendment 1 — release rounds move the cli minor).
17
+ */
18
+ // agent
19
+ export { AgentRuntime, AgentRuntime as Agent, createAgent } from "./agent.js";
20
+ // session
21
+ export { AgentSession, AgentSession as Session } from "./session.js";
22
+ export { PoisonedSessionError, ResumeBlockedError } from "./session.js";
23
+ // run
24
+ export { Run } from "./run.js";
25
+ // store
26
+ export { SessionStore, StaleWriterError, StoreCorruptionError } from "./store.js";
27
+ // extensions
28
+ export { disposeExtensions, loadExtensions, loadProjectExtensions } from "./extensions.js";
29
+ // ledger
30
+ export { executionForCallId, executionLedger } from "./ledger.js";
31
+ // trust
32
+ export { kisoHome, projectArtifacts, recordTrust, trustFor } from "./trust.js";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The FIRST-PARTY door — NOT part of the public SDK contract (S1,
3
+ * 2026-08-12, adjudicated).
4
+ *
5
+ * Unstable: anything here can move or vanish in any release without a
6
+ * major bump. External consumers must import the curated root
7
+ * (index.ts); this file exists for the in-repo consumers (apps/cli,
8
+ * extensions, tests) that need machinery the SDK deliberately does not
9
+ * expose — the recovery / compose / summarize / lock-adapter internals
10
+ * and buildAdapter.
11
+ *
12
+ * This is today's pre-S1 index.ts verbatim: removing the door would be a
13
+ * breaking change for the first-party consumers mid-migration.
14
+ */
15
+ export * from "./agent.js";
16
+ export * from "./session.js";
17
+ export * from "./run.js";
18
+ export * from "./recovery.js";
19
+ export * from "./compose.js";
20
+ export * from "./summarize.js";
21
+ export * from "./store.js";
22
+ export * from "./lock-adapter.js";
23
+ export * from "./ledger.js";
24
+ export * from "./extensions.js";
25
+ export * from "./trust.js";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The FIRST-PARTY door — NOT part of the public SDK contract (S1,
3
+ * 2026-08-12, adjudicated).
4
+ *
5
+ * Unstable: anything here can move or vanish in any release without a
6
+ * major bump. External consumers must import the curated root
7
+ * (index.ts); this file exists for the in-repo consumers (apps/cli,
8
+ * extensions, tests) that need machinery the SDK deliberately does not
9
+ * expose — the recovery / compose / summarize / lock-adapter internals
10
+ * and buildAdapter.
11
+ *
12
+ * This is today's pre-S1 index.ts verbatim: removing the door would be a
13
+ * breaking change for the first-party consumers mid-migration.
14
+ */
15
+ export * from "./agent.js";
16
+ export * from "./session.js";
17
+ export * from "./run.js";
18
+ export * from "./recovery.js";
19
+ export * from "./compose.js";
20
+ export * from "./summarize.js";
21
+ export * from "./store.js";
22
+ export * from "./lock-adapter.js";
23
+ export * from "./ledger.js";
24
+ export * from "./extensions.js";
25
+ export * from "./trust.js";
@@ -91,6 +91,15 @@ export class LockUnavailableError extends Error {
91
91
  * pre-amendment behavior — alive, the fail-safe refusal (prefer a false
92
92
  * refusal over a double-write). Live-process semantics and the PID-reuse
93
93
  * rules do not move: a live foreign writer is still refused.
94
+ *
95
+ * ADR-0050 Amendment 2 (Finding R-I-p-3): the state letters are matched
96
+ * ANYWHERE in the state string, not as the first character. The
97
+ * exit-path linger's ps output is "?E" — the first character is the
98
+ * no-controlling-terminal marker "?", with the E sitting AFTER it — so
99
+ * first-character matching judged the finding's own documented shape
100
+ * alive. The ps state alphabet (macOS + Linux) has no flag letters
101
+ * "E"/"Z": an occurrence anywhere is the process-state code, and the
102
+ * holder is dead.
94
103
  */
95
104
  function isAlive(pid) {
96
105
  try {
@@ -100,12 +109,16 @@ function isAlive(pid) {
100
109
  return err.code === "EPERM";
101
110
  }
102
111
  const state = processState(pid);
103
- return state !== "E" && state !== "Z";
112
+ // A null state (probe failure) keeps the pre-amendment behavior —
113
+ // judged alive, the fail-safe refusal.
114
+ return state === null || (!state.includes("E") && !state.includes("Z"));
104
115
  }
105
116
  /**
106
- * The process state via `ps -o state= -p <pid>` (macOS/Linux). The
107
- * state is the FIRST character (a multi-char string like "Ss+" is a
108
- * combined flag set). An empty or unreadable state the process
117
+ * The process state via `ps -o state= -p <pid>` (macOS/Linux) — the
118
+ * whole state string (a multi-char string like "Ss+" or "?E" is a
119
+ * combined flag set; the E/Z process-state codes may sit after the "?"
120
+ * no-tty marker or other flag letters, so the matching in isAlive scans
121
+ * the whole string). An empty or unreadable state — the process
109
122
  * vanished between the kill and the probe, or ps itself failed —
110
123
  * returns null; isAlive's fail-safe branch then judges the holder alive
111
124
  * (the pre-amendment behavior).
@@ -113,7 +126,7 @@ function isAlive(pid) {
113
126
  function processState(pid) {
114
127
  try {
115
128
  const state = execFileSync("ps", ["-o", "state=", "-p", String(pid)], { encoding: "utf8" }).trim();
116
- return state.length > 0 ? (state[0] ?? null) : null;
129
+ return state.length > 0 ? state : null;
117
130
  }
118
131
  catch {
119
132
  return null;
package/dist/session.d.ts CHANGED
@@ -71,6 +71,7 @@ export interface CompactInfo {
71
71
  /** The covered content's estimated tokens (the chars/4 proxy). */
72
72
  readonly tokens: number;
73
73
  }
74
+ /** @deprecated the canonical name is `Session` (root export, 1.1.0); this alias is removed in the next major. */
74
75
  export declare class AgentSession {
75
76
  #private;
76
77
  readonly id: string;
package/dist/session.js CHANGED
@@ -54,6 +54,7 @@ export class ResumeBlockedError extends Error {
54
54
  this.uncertain = uncertain;
55
55
  }
56
56
  }
57
+ /** @deprecated the canonical name is `Session` (root export, 1.1.0); this alias is removed in the next major. */
57
58
  export class AgentSession {
58
59
  id;
59
60
  log;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincemakes/kiso-runtime",
3
- "version": "1.0.1",
3
+ "version": "1.1.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",
@@ -8,6 +8,10 @@
8
8
  ".": {
9
9
  "types": "./dist/index.d.ts",
10
10
  "default": "./dist/index.js"
11
+ },
12
+ "./internal": {
13
+ "types": "./dist/internal.d.ts",
14
+ "default": "./dist/internal.js"
11
15
  }
12
16
  },
13
17
  "files": [