@deepstrike/core 0.1.11 → 0.1.13

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/index.d.ts +40 -4
  2. package/package.json +8 -8
package/index.d.ts CHANGED
@@ -116,15 +116,33 @@ export interface SkillMetadata {
116
116
  effort?: number
117
117
  estimatedTokens: number
118
118
  }
119
+ /**
120
+ * Structured context for a provider call — emitted with `kind === "call_llm"`.
121
+ * Separates system configuration from the conversation transcript so providers
122
+ * can map each field to their own API contract without role-filtering.
123
+ */
124
+ export interface RenderedContext {
125
+ /**
126
+ * Combined system text: system partition + dashboard (when non-empty).
127
+ * Anthropic → `system` param · OpenAI → `messages[0]` system role ·
128
+ * Gemini → `systemInstruction`.
129
+ */
130
+ systemText: string
131
+ /**
132
+ * Strictly alternating user / assistant / tool turns.
133
+ * Working-partition signals are already folded into the first user turn.
134
+ */
135
+ turns: Array<Message>
136
+ }
119
137
  /**
120
138
  * Discriminated union. Inspect `kind`:
121
- * - `"call_llm"` → `messages`, `tools` (includes `skill` meta-tool when skills are registered)
139
+ * - `"call_llm"` → `context` (RenderedContext), `tools`
122
140
  * - `"execute_tools"` → `calls`
123
141
  * - `"done"` → `result`
124
142
  */
125
143
  export interface LoopAction {
126
144
  kind: string
127
- messages?: Array<Message>
145
+ context?: RenderedContext
128
146
  tools?: Array<ToolSchema>
129
147
  calls?: Array<ToolCall>
130
148
  result?: LoopResult
@@ -132,11 +150,14 @@ export interface LoopAction {
132
150
  /**
133
151
  * Discriminated union for observations:
134
152
  * - `"compressed"` → `action`, `rho_after`
153
+ * - `"renewed"` → `sprint`
135
154
  */
136
155
  export interface LoopObservation {
137
156
  kind: string
138
157
  action?: string
139
158
  rhoAfter?: number
159
+ /** Sprint number after renewal. Set when `kind === "renewed"`. */
160
+ sprint?: number
140
161
  }
141
162
  /**
142
163
  * Format a VerificationContract as a markdown string suitable for injection
@@ -248,7 +269,7 @@ export declare class ContextEngine {
248
269
  * Returns tokens saved.
249
270
  */
250
271
  compress(): number
251
- render(): Array<Message>
272
+ render(): RenderedContext
252
273
  /**
253
274
  * Replace the available-skills set with frontmatter-only metadata.
254
275
  * The kernel will auto-inject the `skill` meta-tool into every `CallLLM` action.
@@ -284,6 +305,11 @@ export declare class LoopStateMachine {
284
305
  * `tokens` is a caller-supplied estimate; pass at least 1.
285
306
  */
286
307
  addMemoryMessage(content: string, tokens: number): void
308
+ /**
309
+ * Pre-populate the history partition with a prior transcript message.
310
+ * Must be called before `start`.
311
+ */
312
+ addHistoryMessage(message: Message, tokens: number): void
287
313
  /**
288
314
  * Inject a VerificationContract into the system partition.
289
315
  * The contract is formatted as markdown and pushed to the `system` partition
@@ -301,7 +327,17 @@ export declare class LoopStateMachine {
301
327
  pressure(): number
302
328
  /** Drain observations emitted during the most recent feed call. */
303
329
  takeObservations(): Array<LoopObservation>
304
- render(): Array<Message>
330
+ /**
331
+ * Pre-populate history with messages from a prior session.
332
+ * Call before `start()` to restore conversational continuity across runs.
333
+ */
334
+ preloadHistory(messages: Array<Message>): void
335
+ /**
336
+ * Return only messages added during the current run (since the last `preload_history`
337
+ * or construction). Use this to persist the session delta to `SessionStore.saveSession`.
338
+ */
339
+ drainNewMessages(): Array<Message>
340
+ render(): RenderedContext
305
341
  }
306
342
  export declare class SignalRouter {
307
343
  constructor(maxQueueSize: number)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deepstrike/core",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "DeepStrike kernel — pre-built native addon",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -23,12 +23,12 @@
23
23
  ]
24
24
  },
25
25
  "optionalDependencies": {
26
- "@deepstrike/core-darwin-arm64": "0.1.11",
27
- "@deepstrike/core-darwin-x64": "0.1.11",
28
- "@deepstrike/core-linux-arm64-gnu": "0.1.11",
29
- "@deepstrike/core-linux-arm64-musl": "0.1.11",
30
- "@deepstrike/core-linux-x64-gnu": "0.1.11",
31
- "@deepstrike/core-linux-x64-musl": "0.1.11",
32
- "@deepstrike/core-win32-x64-msvc": "0.1.11"
26
+ "@deepstrike/core-darwin-arm64": "0.1.13",
27
+ "@deepstrike/core-darwin-x64": "0.1.13",
28
+ "@deepstrike/core-linux-arm64-gnu": "0.1.13",
29
+ "@deepstrike/core-linux-arm64-musl": "0.1.13",
30
+ "@deepstrike/core-linux-x64-gnu": "0.1.13",
31
+ "@deepstrike/core-linux-x64-musl": "0.1.13",
32
+ "@deepstrike/core-win32-x64-msvc": "0.1.13"
33
33
  }
34
34
  }