@deepagents/context 3.0.1 → 4.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.
- package/README.md +94 -4
- package/dist/browser.js +88 -146
- package/dist/browser.js.map +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1085 -687
- package/dist/index.js.map +4 -4
- package/dist/lib/agent.d.ts.map +1 -1
- package/dist/lib/chain-summary.d.ts +1 -0
- package/dist/lib/chain-summary.d.ts.map +1 -1
- package/dist/lib/chat.d.ts.map +1 -1
- package/dist/lib/engine.d.ts +51 -1
- package/dist/lib/engine.d.ts.map +1 -1
- package/dist/lib/fragments/message/user.d.ts +89 -95
- package/dist/lib/fragments/message/user.d.ts.map +1 -1
- package/dist/lib/fragments/reminders/once.d.ts +22 -0
- package/dist/lib/fragments/reminders/once.d.ts.map +1 -0
- package/dist/lib/fragments/reminders/turn-predicates.d.ts +1 -1
- package/dist/lib/fragments/reminders/turn-predicates.d.ts.map +1 -1
- package/dist/lib/sandbox/agent-os-sandbox.d.ts.map +1 -1
- package/dist/lib/sandbox/bash-tool.d.ts +9 -4
- package/dist/lib/sandbox/bash-tool.d.ts.map +1 -1
- package/dist/lib/sandbox/daytona-sandbox.d.ts.map +1 -1
- package/dist/lib/sandbox/docker-sandbox.d.ts +43 -0
- package/dist/lib/sandbox/docker-sandbox.d.ts.map +1 -1
- package/dist/lib/sandbox/index.d.ts +2 -1
- package/dist/lib/sandbox/index.d.ts.map +1 -1
- package/dist/lib/sandbox/installers/bin.d.ts.map +1 -1
- package/dist/lib/sandbox/installers/index.d.ts +7 -7
- package/dist/lib/sandbox/installers/index.d.ts.map +1 -1
- package/dist/lib/sandbox/installers/installer.d.ts +0 -5
- package/dist/lib/sandbox/installers/installer.d.ts.map +1 -1
- package/dist/lib/sandbox/installers/url-binary.d.ts.map +1 -1
- package/dist/lib/sandbox/shell-quote.d.ts +10 -0
- package/dist/lib/sandbox/shell-quote.d.ts.map +1 -0
- package/dist/lib/sandbox/strace/file-change.d.ts +21 -0
- package/dist/lib/sandbox/strace/file-change.d.ts.map +1 -0
- package/dist/lib/sandbox/strace/file-changes.d.ts +66 -0
- package/dist/lib/sandbox/strace/file-changes.d.ts.map +1 -0
- package/dist/lib/sandbox/strace/index.d.ts +89 -0
- package/dist/lib/sandbox/strace/index.d.ts.map +1 -0
- package/dist/lib/sandbox/strace/index.js +285 -0
- package/dist/lib/sandbox/strace/index.js.map +7 -0
- package/dist/lib/sandbox/types.d.ts +6 -9
- package/dist/lib/sandbox/types.d.ts.map +1 -1
- package/dist/lib/sandbox/virtual-sandbox.d.ts.map +1 -1
- package/dist/lib/save/reminder-eval.d.ts +19 -0
- package/dist/lib/save/reminder-eval.d.ts.map +1 -0
- package/dist/lib/save/save-pipeline.d.ts +1 -7
- package/dist/lib/save/save-pipeline.d.ts.map +1 -1
- package/dist/lib/skills/skill-reminder.d.ts +2 -2
- package/dist/lib/skills/skill-reminder.d.ts.map +1 -1
- package/package.json +7 -2
- package/dist/lib/sandbox/file-events.d.ts +0 -42
- package/dist/lib/sandbox/file-events.d.ts.map +0 -1
- package/dist/lib/save/reminder-target-handler.d.ts +0 -36
- package/dist/lib/save/reminder-target-handler.d.ts.map +0 -1
- package/dist/lib/save/tool-output-target-handler.d.ts +0 -7
- package/dist/lib/save/tool-output-target-handler.d.ts.map +0 -1
- package/dist/lib/save/user-target-handler.d.ts +0 -7
- package/dist/lib/save/user-target-handler.d.ts.map +0 -1
package/dist/lib/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/lib/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,MAAM,EACN,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,IAAI,EACT,KAAK,UAAU,EACf,KAAK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CAAC,EAAE,GAAG,EACtB,MAAM,CAAC,EAAE;QACP,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,SAAS,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;KAC3E,GACA,OAAO,CACR,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CACpE,CAAC;CACH;AAED,wBAAgB,gBAAgB,CAAC,OAAO,SAAS,cAAc,EAC7D,OAAO,EAAE,uBAAuB,CAAC,OAAO,CAAC,GACxC,sBAAsB,CAAC,OAAO,CAAC,CAoFjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain-summary.d.ts","sourceRoot":"","sources":["../../src/lib/chain-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"chain-summary.d.ts","sourceRoot":"","sources":["../../src/lib/chain-summary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,oBAAoB,CAAC,EAAE,SAAS,CAAC;IACjC,qBAAqB,CAAC,EAAE,SAAS,EAAE,CAAC;IACpC,YAAY,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED,qBAAa,mBAAmB;;IAS9B,YAAY,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAyCpC,aAAa,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAQ9C,KAAK,IAAI,YAAY;CAWtB"}
|
package/dist/lib/chat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/lib/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAExB,KAAK,OAAO,EACZ,KAAK,SAAS,EAGf,MAAM,IAAI,CAAC;AAEZ,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/lib/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAExB,KAAK,OAAO,EACZ,KAAK,SAAS,EAGf,MAAM,IAAI,CAAC;AAEZ,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,MAAM,WAAW,aAAa,CAAC,GAAG;IAChC,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,CACJ,gBAAgB,EAAE,GAAG,EACrB,MAAM,CAAC,EAAE;QACP,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,SAAS,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,GACA,OAAO,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;CAC9C;AAED,MAAM,MAAM,mBAAmB,GAAG,WAAW,CAC3C,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CACrE,CAAC,iBAAiB,CAAC,CAAC;AAErB,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,mBAAmB,CAUvE,CAAC;AAEF,MAAM,WAAW,WAAW,CAAC,GAAG;IAC9B,gBAAgB,CAAC,EAAE,GAAG,CAAC;IACvB,SAAS,CAAC,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;IAC1E,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAC;IACrC,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,sBAAsB,CAAC,EAAE,CACvB,OAAO,EAAE,SAAS,KAEhB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,SAAS,GACT,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,IAAI,CAAC,GAAG,EAC5B,KAAK,EAAE,aAAa,CAAC,GAAG,CAAC,EACzB,OAAO,GAAE,WAAW,CAAC,GAAG,CAAM,iIA8E/B"}
|
package/dist/lib/engine.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LanguageModelUsage, type UIMessage } from 'ai';
|
|
1
|
+
import { type LanguageModelUsage, type PrepareStepFunction, type Tool, type UIMessage } from 'ai';
|
|
2
2
|
import { type EstimateResult } from './estimate.ts';
|
|
3
3
|
import { type ChatMessage, type ContextFragment } from './fragments.ts';
|
|
4
4
|
import type { Models } from './models.generated.ts';
|
|
@@ -214,6 +214,56 @@ export declare class ContextEngine {
|
|
|
214
214
|
save(options?: {
|
|
215
215
|
branch?: boolean;
|
|
216
216
|
}): Promise<SaveResult>;
|
|
217
|
+
/**
|
|
218
|
+
* Build the `prepareStep` hook that injects steer reminders mid-loop.
|
|
219
|
+
*
|
|
220
|
+
* Semantics are "inject once, persist": when a steer reminder's predicate
|
|
221
|
+
* fires (only after the model has produced ≥1 step with content — the mid-loop
|
|
222
|
+
* gate), its `<system-reminder>` user message is spliced into the model prompt
|
|
223
|
+
* at the step boundary where it fired AND re-spliced on every subsequent step,
|
|
224
|
+
* so the model keeps seeing it for the rest of the loop.
|
|
225
|
+
*
|
|
226
|
+
* Firing is edge-triggered with a post-fire re-sample: each fire resets the
|
|
227
|
+
* elapsed reference (`lastSyntheticAt`), then the config is immediately
|
|
228
|
+
* re-evaluated against the reset context — self-resetting predicates like
|
|
229
|
+
* `elapsedExceeds` read false and re-arm (so they recur every N within one
|
|
230
|
+
* stream), while constant predicates like `everyNTurns` read true and disarm
|
|
231
|
+
* (so they fire once per stream). Any later false sample re-arms a config.
|
|
232
|
+
* All state is closure-local (a fresh SteerSession per call), so overlapping
|
|
233
|
+
* streams / guardrail retries never share a cursor.
|
|
234
|
+
*
|
|
235
|
+
* The session is also consumed by writeAssistantSegment, which carves the
|
|
236
|
+
* streamed assistant message into the matching `[assistant, steer, assistant]`
|
|
237
|
+
* split — so the stored chain reproduces exactly the prompt the model saw
|
|
238
|
+
* (store/prompt parity).
|
|
239
|
+
*/
|
|
240
|
+
createSteerPrepareStep<TOOLS extends Record<string, Tool> = Record<string, Tool>>(): PrepareStepFunction<TOOLS>;
|
|
241
|
+
/**
|
|
242
|
+
* Persist the streamed assistant message, carving it into the steer split when
|
|
243
|
+
* steer reminders fired this turn.
|
|
244
|
+
*
|
|
245
|
+
* Called from chat()'s onStepFinish/onFinish (and the guardrail path) with the
|
|
246
|
+
* cumulative response message. Segment boundaries come from the `step-start`
|
|
247
|
+
* markers in the message itself — no cross-track store read — so the carve is
|
|
248
|
+
* race-free. Idempotent: finalized segments keep stable ids; the open segment
|
|
249
|
+
* is updated in place. With no active steer it degrades to a plain in-place
|
|
250
|
+
* write of the whole message to the reserved head.
|
|
251
|
+
*/
|
|
252
|
+
writeAssistantSegment(message: UIMessage): Promise<void>;
|
|
253
|
+
/**
|
|
254
|
+
* Evaluate `target: 'tool-output'` reminders against a tool's raw result and
|
|
255
|
+
* return the (possibly wrapped) output.
|
|
256
|
+
*
|
|
257
|
+
* Called by the agent's tool wrapper right after each `execute()` resolves —
|
|
258
|
+
* upstream of both the model and the store, so the next model step and the
|
|
259
|
+
* persisted chain see the exact same wrapped value (store/prompt parity).
|
|
260
|
+
*
|
|
261
|
+
* Returns the output unchanged when no tool-output reminder fires. Without a
|
|
262
|
+
* persisted user message there is no turn context to evaluate against
|
|
263
|
+
* (e.g. asTool forks that set a pending user without saving), so the output
|
|
264
|
+
* passes through untouched.
|
|
265
|
+
*/
|
|
266
|
+
applyToolOutputReminders(output: unknown): Promise<unknown>;
|
|
217
267
|
/**
|
|
218
268
|
* Estimate token count and cost for the full context.
|
|
219
269
|
*
|
package/dist/lib/engine.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/lib/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/lib/engine.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,mBAAmB,EACxB,KAAK,IAAI,EACT,KAAK,SAAS,EAIf,MAAM,IAAI,CAAC;AAGZ,OAAO,EACL,KAAK,cAAc,EAGpB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EAKrB,MAAM,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E,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAe3D;;;;;;;;;;;;;;;;;;OAkBG;IACU,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAyB9D;;;;;;;;;;;;;;;OAeG;IACU,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAcvD;;;;;;;;;;;;;;OAcG;IACU,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACU,GAAG,IAAI,OAAO,CAAC,UAAU,CAAC;IAUvC;;;;;;;;;;;;OAYG;IACU,UAAU,CACrB,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,GAAG,UAAU,CAAC,CAAC,GAC3D,OAAO,CAAC,IAAI,CAAC;IAmBhB;;;;;;;;;;;;OAYG;IACU,UAAU,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBjE;;;;;;;OAOG;IACI,WAAW,IAAI,IAAI;IAI1B;;;;;;;;OAQG;IACI,IAAI,IAAI,aAAa;IAU5B;;;;;;;;;;;;;;;OAeG;IACI,cAAc;;;IAcrB;;;;;;;;;;;;;;;;;;OAkBG;IACU,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;CA0CtE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LanguageModelUsage, type
|
|
1
|
+
import { type LanguageModelUsage, type UIMessage } from 'ai';
|
|
2
2
|
import { type ContextFragment, type MessageFragment } from '../../fragments.ts';
|
|
3
3
|
import type { StoredChatData } from '../../store/store.ts';
|
|
4
4
|
export interface ReminderContext {
|
|
@@ -33,24 +33,52 @@ export interface WhenContext {
|
|
|
33
33
|
messageCount: number;
|
|
34
34
|
lastAssistantMessage?: UIMessage;
|
|
35
35
|
lastAssistantMessages?: UIMessage[];
|
|
36
|
+
/**
|
|
37
|
+
* Ids that a fire-once latch has already fired for in this conversation
|
|
38
|
+
* (persisted synth onceIds ∪ this stream's fires). Populated only during
|
|
39
|
+
* steer evaluation; `once(id)` reads it to suppress a second fire.
|
|
40
|
+
*/
|
|
41
|
+
firedOnceIds?: ReadonlySet<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Per-evaluation buffer that `once(id)` appends to when consulted and not yet
|
|
44
|
+
* fired. The engine commits these ids — to the session and the synth — only
|
|
45
|
+
* if the whole reminder fires. One fresh collector per config evaluation.
|
|
46
|
+
*/
|
|
47
|
+
onceCollector?: Set<string>;
|
|
36
48
|
}
|
|
49
|
+
/**
|
|
50
|
+
* The engine-level slice of `WhenContext` — everything that does not depend on a
|
|
51
|
+
* specific carrier message. Callers add `content`/`currentMessage`/the
|
|
52
|
+
* last-assistant fields once they have located the message being evaluated.
|
|
53
|
+
*/
|
|
54
|
+
export type BaseWhenCtx = Omit<WhenContext, 'content' | 'currentMessage' | 'lastAssistantMessage' | 'lastAssistantMessages'>;
|
|
37
55
|
export type WhenPredicate = (ctx: WhenContext) => boolean | Promise<boolean>;
|
|
38
|
-
export type ReminderTarget = 'user' | 'tool-output';
|
|
39
|
-
export interface
|
|
56
|
+
export type ReminderTarget = 'user' | 'tool-output' | 'steer';
|
|
57
|
+
export interface SyntheticSteerMetadata {
|
|
58
|
+
source: 'steer-reminder';
|
|
59
|
+
firedAt: number;
|
|
60
|
+
onceIds?: string[];
|
|
61
|
+
}
|
|
62
|
+
export interface ReminderOptions {
|
|
63
|
+
/**
|
|
64
|
+
* Predicate gating when the reminder fires. Optional for `target: 'user'`
|
|
65
|
+
* (omit ⇒ always fires; pair with `once(id)` for one-time); required for
|
|
66
|
+
* `steer` / `tool-output`, where a trigger-less reminder is meaningless.
|
|
67
|
+
*/
|
|
68
|
+
when?: WhenPredicate;
|
|
40
69
|
asPart?: boolean;
|
|
41
|
-
target?:
|
|
70
|
+
target?: ReminderTarget;
|
|
42
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* A resolved reminder ready to bake into a user message. Internal to the save
|
|
74
|
+
* fold — callers declare reminders with {@link reminder} + `engine.set()`.
|
|
75
|
+
*/
|
|
43
76
|
export interface UserReminder {
|
|
44
77
|
text: SyncReminderText;
|
|
45
78
|
asPart: boolean;
|
|
46
79
|
target: 'user';
|
|
47
80
|
metadata?: Record<string, unknown>;
|
|
48
81
|
}
|
|
49
|
-
export interface ConditionalReminderOptions {
|
|
50
|
-
when: WhenPredicate;
|
|
51
|
-
asPart?: boolean;
|
|
52
|
-
target?: ReminderTarget;
|
|
53
|
-
}
|
|
54
82
|
export interface ConditionalReminder {
|
|
55
83
|
text: ReminderText;
|
|
56
84
|
when: WhenPredicate;
|
|
@@ -69,18 +97,20 @@ export interface UserReminderMetadata {
|
|
|
69
97
|
partIndex: number;
|
|
70
98
|
start: number;
|
|
71
99
|
end: number;
|
|
72
|
-
mode: 'inline' | 'part'
|
|
100
|
+
mode: 'inline' | 'part';
|
|
73
101
|
}
|
|
74
102
|
export type ReminderRange = {
|
|
75
103
|
partIndex: number;
|
|
76
104
|
start: number;
|
|
77
105
|
end: number;
|
|
78
106
|
};
|
|
79
|
-
type OutputAvailableToolPart = ToolUIPart & {
|
|
80
|
-
state: 'output-available';
|
|
81
|
-
output: unknown;
|
|
82
|
-
};
|
|
83
107
|
export declare function getReminderRanges(metadata: Record<string, unknown> | undefined): ReminderRange[];
|
|
108
|
+
/**
|
|
109
|
+
* Once-ids latched by `once()`-gated reminders folded into this user message.
|
|
110
|
+
* Persisted so a fresh engine re-reads them (the durable suppression record for
|
|
111
|
+
* user-target `once()`, mirroring synthetic steer messages).
|
|
112
|
+
*/
|
|
113
|
+
export declare function getReminderOnceIds(message: UIMessage): string[];
|
|
84
114
|
export declare function stripTextByRanges(text: string, ranges: Array<{
|
|
85
115
|
start: number;
|
|
86
116
|
end: number;
|
|
@@ -113,103 +143,67 @@ export declare function applyReminderToMessage(message: UIMessage, item: {
|
|
|
113
143
|
asPart: boolean;
|
|
114
144
|
metadata?: Record<string, unknown>;
|
|
115
145
|
}, ctx: ReminderContext): UserReminderMetadata | null;
|
|
116
|
-
export declare function findSingleOutputAvailableToolPart(message: UIMessage): {
|
|
117
|
-
partIndex: number;
|
|
118
|
-
part: OutputAvailableToolPart;
|
|
119
|
-
} | null;
|
|
120
|
-
export declare function applyToolOutputRemindersToMessage(message: UIMessage, reminders: Array<{
|
|
121
|
-
text: string;
|
|
122
|
-
metadata?: Record<string, unknown>;
|
|
123
|
-
}>): UserReminderMetadata[];
|
|
124
|
-
export declare function mergeReminderMetadata(message: UIMessage, addedReminders: UserReminderMetadata[]): void;
|
|
125
146
|
/**
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* Injects reminder text inline as `<system-reminder>...</system-reminder>`.
|
|
147
|
+
* Wrap a tool's raw `execute()` result with fired reminder texts.
|
|
129
148
|
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
149
|
+
* Applied at the tool-execution boundary — before the AI SDK hands the result
|
|
150
|
+
* back to the model — so the wrapped value flows identically into the next
|
|
151
|
+
* model step and the persisted chain. The envelope shape is uniform regardless
|
|
152
|
+
* of the output type, which lets `stripReminders` undo it structurally without
|
|
153
|
+
* metadata bookkeeping.
|
|
132
154
|
*/
|
|
133
|
-
export declare function
|
|
155
|
+
export declare function applyRemindersToToolOutput(output: unknown, texts: string[]): unknown;
|
|
156
|
+
export declare function mergeReminderMetadata(message: UIMessage, addedReminders: UserReminderMetadata[]): void;
|
|
134
157
|
/**
|
|
135
|
-
* Create a
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
158
|
+
* Create a reminder fragment, set on the engine via `engine.set()`. The engine
|
|
159
|
+
* folds it into the model's view when its `when` fires: `user` reminders bake a
|
|
160
|
+
* `<system-reminder>` into the last user message at save; `steer` injects mid-
|
|
161
|
+
* loop; `tool-output` wraps the tool result. Text may be a string, a `(ctx) =>
|
|
162
|
+
* string` factory (self-gates by returning `''`), or a context fragment.
|
|
139
163
|
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
164
|
+
* For `target: 'user'`, `when` is optional — omit it for an always-on
|
|
165
|
+
* instruction, or pass `once(id)` for a one-time reminder. `steer` and
|
|
166
|
+
* `tool-output` require a `when` trigger.
|
|
142
167
|
*
|
|
143
168
|
* @example
|
|
144
169
|
* ```ts
|
|
145
|
-
* engine.set(
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* );
|
|
170
|
+
* engine.set(reminder('Keep responses concise')); // user, always
|
|
171
|
+
* engine.set(reminder('Welcome!', { when: once('welcome') })); // user, one-time
|
|
172
|
+
* engine.set(reminder('RECAP', { when: everyNTurns(3), target: 'steer' }));
|
|
149
173
|
* ```
|
|
150
174
|
*/
|
|
151
|
-
export declare function reminder(
|
|
175
|
+
export declare function reminder(textOrFragment: ReminderText | ContextFragment, options?: ReminderOptions): ContextFragment;
|
|
152
176
|
/**
|
|
153
|
-
* Create
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
* @param fragment - A context fragment to render as reminder text
|
|
159
|
-
* @param options - Reminder representation options
|
|
160
|
-
*
|
|
161
|
-
* @example
|
|
162
|
-
* ```ts
|
|
163
|
-
* context.set(
|
|
164
|
-
* user('hello', reminder(workflow({ task: 'Error recovery', steps: ['Check logs'] }))),
|
|
165
|
-
* );
|
|
166
|
-
* ```
|
|
177
|
+
* Create a user message fragment. Message fragments are separated from regular
|
|
178
|
+
* fragments during resolve(). Reminders are NOT attached here — declare them
|
|
179
|
+
* with `reminder(..., { target: 'user' })` and `engine.set()`; the engine folds
|
|
180
|
+
* them into the last user message at save time.
|
|
167
181
|
*/
|
|
168
|
-
export declare function
|
|
182
|
+
export declare function user(content: string | (UIMessage & {
|
|
183
|
+
role: 'user';
|
|
184
|
+
})): MessageFragment;
|
|
169
185
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* @param fragment - A context fragment to render as reminder text
|
|
176
|
-
* @param options - Must include a `when` predicate
|
|
177
|
-
*
|
|
178
|
-
* @example
|
|
179
|
-
* ```ts
|
|
180
|
-
* engine.set(
|
|
181
|
-
* reminder(
|
|
182
|
-
* workflow({ task: 'Error recovery', steps: ['Check logs', 'Fix query'] }),
|
|
183
|
-
* { when: contentIncludes(['error', 'fail']) },
|
|
184
|
-
* ),
|
|
185
|
-
* user('my query failed'),
|
|
186
|
-
* );
|
|
187
|
-
* ```
|
|
186
|
+
* Bake resolved user reminders into a message in place: append each as a
|
|
187
|
+
* `<system-reminder>` (inline or as its own part) and record the ranges in
|
|
188
|
+
* `metadata.reminders` so `stripReminders` can reverse it. The save fold is the
|
|
189
|
+
* only caller — user reminders are declared on the engine, not on `user()`.
|
|
188
190
|
*/
|
|
189
|
-
export declare function
|
|
191
|
+
export declare function applyUserRemindersToMessage(message: UIMessage, reminders: UserReminder[]): void;
|
|
190
192
|
/**
|
|
191
|
-
*
|
|
192
|
-
* Message fragments are separated from regular fragments during resolve().
|
|
193
|
+
* Build the hidden synthetic user message injected mid-loop for steer reminders.
|
|
193
194
|
*
|
|
194
|
-
*
|
|
195
|
-
* `<system-reminder
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
* @param content - The message content
|
|
201
|
-
* @param reminders - Optional hidden/system reminders
|
|
202
|
-
*
|
|
203
|
-
* @example
|
|
204
|
-
* ```ts
|
|
205
|
-
* context.set(user('Hello')); // Plain user message
|
|
206
|
-
* context.set(
|
|
207
|
-
* user('Deploy this', reminder('Ask for confirmation before destructive actions')),
|
|
208
|
-
* );
|
|
209
|
-
* ```
|
|
195
|
+
* Multiple reminder texts that fire at the same step boundary are folded into a
|
|
196
|
+
* single user message (one `<system-reminder>` text part each) so the model
|
|
197
|
+
* never sees two consecutive user messages — which providers like Anthropic
|
|
198
|
+
* reject. The `metadata.synthetic` marker lets the chain summary, title
|
|
199
|
+
* generation, and `stripReminders` treat these as non-conversational.
|
|
210
200
|
*/
|
|
211
|
-
export declare function
|
|
201
|
+
export declare function synthesizeSteerUserMessage(text: string | string[], firedAt: number, onceIds?: string[]): UIMessage & {
|
|
212
202
|
role: 'user';
|
|
213
|
-
}
|
|
214
|
-
export {
|
|
203
|
+
};
|
|
204
|
+
export declare function isSyntheticSteerMessage(message: UIMessage): message is UIMessage & {
|
|
205
|
+
metadata: {
|
|
206
|
+
synthetic: SyntheticSteerMetadata;
|
|
207
|
+
};
|
|
208
|
+
};
|
|
215
209
|
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/lib/fragments/message/user.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../src/lib/fragments/message/user.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,SAAS,EAGf,MAAM,IAAI,CAAC;AAEZ,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EAErB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAG3D,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,cAAc,CAAC,EAAE,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAA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AAI,EAAE,MAAM,CAAA;CAAE,CAkB9B;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,SAAS,GACjB,OAAO,IAAI,SAAS,GAAG;IACxB,QAAQ,EAAE;QAAE,SAAS,EAAE,sBAAsB,CAAA;KAAE,CAAC;CACjD,CAMA"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { WhenPredicate } from '../message/user.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Durable fire-once latch, composed into a steer reminder's `when`.
|
|
4
|
+
*
|
|
5
|
+
* Two effects, both on `ctx` and nothing else:
|
|
6
|
+
* - READ: returns false once `id` has fired in this conversation (the persisted
|
|
7
|
+
* synth carries the id, so suppression survives restarts).
|
|
8
|
+
* - INTENT: while not-yet-fired, appends `id` to `ctx.onceCollector` — "latch
|
|
9
|
+
* this if the whole reminder fires". The actual commit is the engine's, gated
|
|
10
|
+
* on the reminder firing, so order inside `and`/`or` never matters and a
|
|
11
|
+
* short-circuited evaluation (where `once` is never reached) latches nothing.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* reminder('recap', {
|
|
16
|
+
* when: and(elapsedExceeds(40 * 60_000), once('recap')),
|
|
17
|
+
* target: 'steer',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function once(id: string): WhenPredicate;
|
|
22
|
+
//# sourceMappingURL=once.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"once.d.ts","sourceRoot":"","sources":["../../../../src/lib/fragments/reminders/once.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,CAkB9C"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { WhenPredicate } from '../message/user.ts';
|
|
2
2
|
export declare function everyNTurns(n: number): WhenPredicate;
|
|
3
|
-
export declare function
|
|
3
|
+
export declare function first(): WhenPredicate;
|
|
4
4
|
export declare function firstN(n: number): WhenPredicate;
|
|
5
5
|
export declare function afterTurn(n: number): WhenPredicate;
|
|
6
6
|
//# sourceMappingURL=turn-predicates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-predicates.d.ts","sourceRoot":"","sources":["../../../../src/lib/fragments/reminders/turn-predicates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAEpD;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"turn-predicates.d.ts","sourceRoot":"","sources":["../../../../src/lib/fragments/reminders/turn-predicates.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAEpD;AAED,wBAAgB,KAAK,IAAI,aAAa,CAErC;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAE/C;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,aAAa,CAElD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-os-sandbox.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/agent-os-sandbox.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,iBAAiB,EAIlB,MAAM,YAAY,CAAC;AA8BpB,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,wBAAyB,SAAQ,mBAAmB;gBACnD,KAAK,CAAC,EAAE,KAAK;CAO1B;AAED,qBAAa,oBAAqB,SAAQ,mBAAmB;gBAC/C,OAAO,EAAE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;KAAE,CAAC,CAAC;IACtE,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;IACrB,gDAAgD;IAChD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAwFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,iBAAiB,CAAC,CAqH5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,iBAAiB,CAAC,CAAC,EACvC,OAAO,EAAE,qBAAqB,EAC9B,EAAE,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,GAC7C,OAAO,CAAC,CAAC,CAAC,CAOZ"}
|
|
@@ -15,16 +15,21 @@ export interface CreateBashToolWithSkillsOptions extends Omit<CreateBashToolOpti
|
|
|
15
15
|
*/
|
|
16
16
|
skills?: SkillUploadInput[];
|
|
17
17
|
/**
|
|
18
|
-
* Working directory
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* Working directory passed to upstream `bash-tool`. Defaults to `/workspace`.
|
|
19
|
+
* File-change tracking is no longer wired here — compose
|
|
20
|
+
* `withStraceFileChanges(backend, { destination, onFileChanges })` on the
|
|
21
|
+
* backend yourself and pass the result as `sandbox`.
|
|
21
22
|
*/
|
|
22
23
|
destination?: string;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
26
|
* Composes an `AgentSandbox` from a backend by layering decorators:
|
|
26
27
|
*
|
|
27
|
-
* backend →
|
|
28
|
+
* backend → withBashExceptionCatch → withAbortSignal
|
|
29
|
+
*
|
|
30
|
+
* File-change tracking is not composed here — a caller that wants it wraps the
|
|
31
|
+
* backend with `withStraceFileChanges` first, so the tracer sits innermost
|
|
32
|
+
* (backend → withStraceFileChanges → withBashExceptionCatch → withAbortSignal).
|
|
28
33
|
*
|
|
29
34
|
* The composed sandbox is handed to upstream `bash-tool`; upstream's
|
|
30
35
|
* internal `bash` / `readFile` / `writeFile` tools therefore close over
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bash-tool.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/bash-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"bash-tool.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/bash-tool.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,qBAAqB,EAE3B,MAAM,WAAW,CAAC;AAMnB,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAEjB,MAAM,YAAY,CAAC;AA+BpB,MAAM,WAAW,+BAAgC,SAAQ,IAAI,CAC3D,qBAAqB,EACrB,SAAS,CACV;IACC;;;;;OAKG;IACH,OAAO,EAAE,iBAAiB,CAAC;IAC3B;;;;OAIG;IACH,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC5B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,YAAY,CAAC,CAwHvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daytona-sandbox.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/daytona-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,OAAO,EAER,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"daytona-sandbox.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/daytona-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,OAAO,EAER,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EACV,iBAAiB,EAKlB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AAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAK3C;AAED,qBAAa,oBAAqB,SAAQ,mBAAmB;gBAC/C,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAI3C;AAED,qBAAa,mBAAoB,SAAQ,mBAAmB;gBAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAI3C;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,iBAAiB,CAAC,CAyB5B"}
|
|
@@ -77,12 +77,29 @@ export interface RuntimeSandboxOptions {
|
|
|
77
77
|
* - A non-empty array: appended verbatim, overriding the image `CMD`.
|
|
78
78
|
*/
|
|
79
79
|
command?: readonly string[] | null;
|
|
80
|
+
/**
|
|
81
|
+
* Extra `--security-opt` values for `docker run`. Each entry becomes one
|
|
82
|
+
* `--security-opt <value>` — e.g. `['seccomp=/path/profile.json']` to apply a
|
|
83
|
+
* custom seccomp profile (denying a syscall), or `['no-new-privileges']`.
|
|
84
|
+
*/
|
|
85
|
+
securityOpt?: string[];
|
|
86
|
+
/**
|
|
87
|
+
* `--platform` for `docker run` (e.g. `'linux/amd64'`). Runs the container
|
|
88
|
+
* under that platform — emulated when it differs from the host arch.
|
|
89
|
+
*/
|
|
90
|
+
platform?: string;
|
|
80
91
|
}
|
|
81
92
|
export interface DockerfileSandboxOptions {
|
|
82
93
|
/** Inline Dockerfile content (contains `\n`) or a path. */
|
|
83
94
|
dockerfile: string;
|
|
84
95
|
/** Build context directory (default: `'.'`). */
|
|
85
96
|
context?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Stream `docker build` output to the parent stdio instead of buffering it.
|
|
99
|
+
* A Dockerfile build (e.g. `npm ci` + a project build) can take minutes and
|
|
100
|
+
* otherwise runs silently. Default `false`.
|
|
101
|
+
*/
|
|
102
|
+
showBuildLogs?: boolean;
|
|
86
103
|
volumes?: DockerSandboxVolume[];
|
|
87
104
|
resources?: DockerResources;
|
|
88
105
|
env?: Record<string, string>;
|
|
@@ -96,6 +113,18 @@ export interface DockerfileSandboxOptions {
|
|
|
96
113
|
* - A non-empty array: appended verbatim, overriding the image `CMD`.
|
|
97
114
|
*/
|
|
98
115
|
command?: readonly string[] | null;
|
|
116
|
+
/**
|
|
117
|
+
* Extra `--security-opt` values for `docker run`. Each entry becomes one
|
|
118
|
+
* `--security-opt <value>` — e.g. `['seccomp=/path/profile.json']` to apply a
|
|
119
|
+
* custom seccomp profile (denying a syscall), or `['no-new-privileges']`.
|
|
120
|
+
*/
|
|
121
|
+
securityOpt?: string[];
|
|
122
|
+
/**
|
|
123
|
+
* `--platform` for `docker build` and `docker run` (e.g. `'linux/amd64'`).
|
|
124
|
+
* Builds and runs under that platform — emulated when it differs from the
|
|
125
|
+
* host arch. Folded into the image-build cache key.
|
|
126
|
+
*/
|
|
127
|
+
platform?: string;
|
|
99
128
|
}
|
|
100
129
|
export interface ComposeSandboxOptions {
|
|
101
130
|
compose: string;
|
|
@@ -116,6 +145,10 @@ export interface DockerSandboxStrategyArgs {
|
|
|
116
145
|
name?: StableContainerName;
|
|
117
146
|
/** See {@link RuntimeSandboxOptions.command}. */
|
|
118
147
|
command?: readonly string[] | null;
|
|
148
|
+
/** See {@link RuntimeSandboxOptions.securityOpt}. */
|
|
149
|
+
securityOpt?: string[];
|
|
150
|
+
/** See {@link RuntimeSandboxOptions.platform}. */
|
|
151
|
+
platform?: string;
|
|
119
152
|
}
|
|
120
153
|
/**
|
|
121
154
|
* Template Method base for sandbox creation strategies. Subclasses choose
|
|
@@ -129,6 +162,8 @@ export declare abstract class DockerSandboxStrategy {
|
|
|
129
162
|
protected env: Record<string, string>;
|
|
130
163
|
protected name?: StableContainerName;
|
|
131
164
|
protected command?: readonly string[] | null;
|
|
165
|
+
protected securityOpt: string[];
|
|
166
|
+
protected platform?: string;
|
|
132
167
|
private createdVolumes;
|
|
133
168
|
constructor(args?: DockerSandboxStrategyArgs);
|
|
134
169
|
create(): Promise<DisposableSandbox>;
|
|
@@ -192,6 +227,7 @@ export declare class RuntimeStrategy extends DockerSandboxStrategy {
|
|
|
192
227
|
export interface DockerfileStrategyArgs extends DockerSandboxStrategyArgs {
|
|
193
228
|
dockerfile: string;
|
|
194
229
|
context?: string;
|
|
230
|
+
showBuildLogs?: boolean;
|
|
195
231
|
}
|
|
196
232
|
/**
|
|
197
233
|
* Builds a custom image from a Dockerfile (with content-hash caching).
|
|
@@ -201,6 +237,7 @@ export declare class DockerfileStrategy extends DockerSandboxStrategy {
|
|
|
201
237
|
private imageTag;
|
|
202
238
|
private dockerfile;
|
|
203
239
|
private dockerContext;
|
|
240
|
+
private showBuildLogs;
|
|
204
241
|
constructor(args: DockerfileStrategyArgs);
|
|
205
242
|
private computeImageTag;
|
|
206
243
|
private isInlineDockerfile;
|
|
@@ -208,6 +245,12 @@ export declare class DockerfileStrategy extends DockerSandboxStrategy {
|
|
|
208
245
|
protected configure(): Promise<void>;
|
|
209
246
|
private imageExists;
|
|
210
247
|
private buildImage;
|
|
248
|
+
/**
|
|
249
|
+
* Run a build command with stdio inherited so its output streams live to the
|
|
250
|
+
* parent terminal. On failure the build error is already on screen; the
|
|
251
|
+
* rejection just carries the exit code.
|
|
252
|
+
*/
|
|
253
|
+
private runStreamed;
|
|
211
254
|
}
|
|
212
255
|
export interface ComposeStrategyArgs {
|
|
213
256
|
compose: string;
|