@noetic-tools/types 1.3.0 → 2.0.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.
@@ -1,8 +1,8 @@
1
1
  /** @public Lifecycle states for a detached (background) execution. */
2
2
  declare const DetachedStatus: {
3
- readonly Running: "running";
4
- readonly Completed: "completed";
5
- readonly Failed: "failed";
3
+ readonly Running: 'running';
4
+ readonly Completed: 'completed';
5
+ readonly Failed: 'failed';
6
6
  };
7
7
  type DetachedStatus = (typeof DetachedStatus)[keyof typeof DetachedStatus];
8
8
  /** @public Handle returned by `detachedSpawn`, used to poll or await a background execution. */
@@ -113,6 +113,21 @@ export interface StorageAdapter {
113
113
  set<T>(key: string, value: T): Promise<void>;
114
114
  delete(key: string): Promise<void>;
115
115
  list(prefix: string): Promise<string[]>;
116
+ /**
117
+ * Batch read. Anything that lists a prefix and then reads each key is an N+1 —
118
+ * one round trip per key on a network- or database-backed adapter, which is
119
+ * exactly what a resume path cannot afford. Implement this and the round trips
120
+ * collapse to one.
121
+ *
122
+ * Optional so existing adapters keep working: callers MUST NOT depend on it
123
+ * directly — go through `storageGetMany`, which falls back to a parallel
124
+ * `get` sweep when a backend has not implemented it.
125
+ *
126
+ * Keys with no stored value are ABSENT from the returned map. The map is never
127
+ * sparse-with-nulls, so `map.size < keys.length` is the normal way to see that
128
+ * something was missing.
129
+ */
130
+ getMany?<T>(keys: string[]): Promise<Map<string, T>>;
116
131
  }
117
132
  /** @public Scope-namespaced storage interface provided to memory layer init hooks. */
118
133
  export interface ScopedStorage {
@@ -120,6 +135,13 @@ export interface ScopedStorage {
120
135
  set<T>(key: string, value: T): Promise<void>;
121
136
  delete(key: string): Promise<void>;
122
137
  list(prefix?: string): Promise<string[]>;
138
+ /**
139
+ * Batch read, always available — the scoped wrapper supplies the fallback so a
140
+ * layer never has to check. Returned keys are scope-relative (the namespace
141
+ * prefix is stripped, as with `list`), and missing keys are absent rather than
142
+ * null.
143
+ */
144
+ getMany<T>(keys: string[]): Promise<Map<string, T>>;
123
145
  }
124
146
  /** @public Parameters passed to a memory layer's `init` hook. */
125
147
  export interface InitParams {
@@ -173,6 +195,13 @@ export interface ReturnParams<TState> {
173
195
  childLog: ItemLog;
174
196
  parentState: TState;
175
197
  result: unknown;
198
+ /**
199
+ * The child's execution context — the same one passed to `onSpawn`. Layers
200
+ * that merge artifacts from several concurrent children (fan-out) use
201
+ * `childCtx.executionId` to namespace the child's contribution instead of
202
+ * letting the last child to return silently overwrite its siblings.
203
+ */
204
+ childCtx: ExecutionContext;
176
205
  }
177
206
  /** @public Value returned by a memory layer's `onReturn` hook with the merged parent state. */
178
207
  export interface ReturnResult<TState> {
@@ -28,10 +28,10 @@ import type { SubprocessAdapter } from './subprocess-adapter.js';
28
28
  * @public
29
29
  */
30
30
  export declare const SubHarnessKind: {
31
- readonly ClaudeCode: "claude-code";
32
- readonly Codex: "codex";
33
- readonly Opencode: "opencode";
34
- readonly Pi: "pi";
31
+ readonly ClaudeCode: 'claude-code';
32
+ readonly Codex: 'codex';
33
+ readonly Opencode: 'opencode';
34
+ readonly Pi: 'pi';
35
35
  };
36
36
  /** @public Union of all harness step kinds. */
37
37
  export type SubHarnessKind = (typeof SubHarnessKind)[keyof typeof SubHarnessKind];
@@ -107,9 +107,9 @@ export declare const SubHarnessStreamPartSchema: z.ZodDiscriminatedUnion<[z.ZodO
107
107
  }, z.core.$strip>, z.ZodObject<{
108
108
  type: z.ZodLiteral<"finish">;
109
109
  finishReason: z.ZodEnum<{
110
+ aborted: "aborted";
110
111
  error: "error";
111
112
  length: "length";
112
- aborted: "aborted";
113
113
  stop: "stop";
114
114
  "tool-calls": "tool-calls";
115
115
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noetic-tools/types",
3
- "version": "1.3.0",
3
+ "version": "2.0.0",
4
4
  "type": "module",
5
5
  "description": "Foundational type contracts and primitives shared across the Noetic framework (items, LLM config, adapters, steering, errors).",
6
6
  "license": "Apache-2.0",