@theokit/sdk 2.28.0 → 2.29.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/CHANGELOG.md +24 -0
- package/dist/a2a/index.cjs +373 -17
- package/dist/a2a/index.cjs.map +1 -1
- package/dist/a2a/index.js +373 -17
- package/dist/a2a/index.js.map +1 -1
- package/dist/{cron-BR1NCSk1.d.cts → cron-COSAehOL.d.ts} +110 -3
- package/dist/{cron-DgEQCJ2i.d.ts → cron-yJoNUZxe.d.cts} +110 -3
- package/dist/cron.cjs +914 -508
- package/dist/cron.cjs.map +1 -1
- package/dist/cron.d.cts +2 -2
- package/dist/cron.d.ts +2 -2
- package/dist/cron.js +915 -509
- package/dist/cron.js.map +1 -1
- package/dist/{errors-CbY3pxY7.d.ts → errors-BxMIlgLP.d.ts} +1 -1
- package/dist/{errors-DLMNb4Ka.d.cts → errors-tP-8O-hR.d.cts} +1 -1
- package/dist/errors.d.cts +2 -2
- package/dist/eval.cjs +914 -508
- package/dist/eval.cjs.map +1 -1
- package/dist/eval.js +915 -509
- package/dist/eval.js.map +1 -1
- package/dist/index.cjs +973 -570
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -7
- package/dist/index.d.ts +13 -7
- package/dist/index.js +972 -568
- package/dist/index.js.map +1 -1
- package/dist/internal/persistence/conversation-storage-fs.d.cts +4 -0
- package/dist/internal/persistence/conversation-storage-fs.d.ts +4 -0
- package/dist/internal/persistence/conversation-storage-memory.d.cts +4 -0
- package/dist/internal/persistence/conversation-storage-memory.d.ts +4 -0
- package/dist/internal/persistence/objective-coerce.d.cts +9 -0
- package/dist/internal/persistence/objective-coerce.d.ts +9 -0
- package/dist/internal/runtime/lifecycle/wrap-completion-check-run.d.ts +30 -0
- package/dist/internal/runtime/local-agent/local-agent-goal-extensions.d.ts +80 -0
- package/dist/internal/runtime/objective/objective-store.d.ts +33 -0
- package/dist/{run-CdWiihyU.d.cts → run-q_P0vHlY.d.cts} +71 -2
- package/dist/{run-CdWiihyU.d.ts → run-q_P0vHlY.d.ts} +71 -2
- package/dist/types/agent.d.ts +32 -1
- package/dist/types/conversation-storage.d.ts +23 -0
- package/dist/types/goal-events.d.ts +7 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/objective.d.ts +45 -0
- package/dist/types/run-events.d.ts +12 -1
- package/dist/types/run.d.ts +58 -0
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomTool, M as ModelSelection,
|
|
1
|
+
import { C as CustomTool, M as ModelSelection, a7 as SDKUserMessage, a9 as SendOptions, b as Run, G as GenerateOptions, l as GenerateRunResult, V as RunToCompletionOptions, W as RunToCompletionResult, S as SDKMessage, ag as StreamToCompletionResult, a as McpServerConfig, P as Processor } from './run-q_P0vHlY.js';
|
|
2
2
|
import * as zod from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -139,6 +139,13 @@ interface GoalOptions {
|
|
|
139
139
|
judgeApiKey?: string;
|
|
140
140
|
/** Optional subgoals fed to the judge prompt. */
|
|
141
141
|
subgoals?: string[];
|
|
142
|
+
/**
|
|
143
|
+
* SE33 (ADR 0012) — resolve the goal from the durable thread-scoped
|
|
144
|
+
* objective when `runUntil()` is called with NO explicit goal. Also the
|
|
145
|
+
* key the loop writes `runsUsed` / `status` progress back to. Ignored when
|
|
146
|
+
* an explicit goal is passed (that path stays ephemeral).
|
|
147
|
+
*/
|
|
148
|
+
threadId?: string;
|
|
142
149
|
/**
|
|
143
150
|
* Cancel mid-loop via `AbortController.signal`. The generator yields
|
|
144
151
|
* a `status_change: paused` event and returns at the next turn
|
|
@@ -570,6 +577,52 @@ interface BudgetTracker {
|
|
|
570
577
|
nextIteration?(): void;
|
|
571
578
|
}
|
|
572
579
|
|
|
580
|
+
/**
|
|
581
|
+
* SE33 — the durable, thread-scoped objective (Mastra Goals parity, durable half).
|
|
582
|
+
*
|
|
583
|
+
* The SDK's `runUntil` goal loop (ADRs D115-D121) is per-call/transient. SE33
|
|
584
|
+
* persists an objective in conversation storage (via the optional
|
|
585
|
+
* `getObjectiveRecord`/`setObjectiveRecord` adapter methods) so it survives
|
|
586
|
+
* reloads, is managed via `Agent` methods, and is read by `runUntil` when no
|
|
587
|
+
* explicit goal is passed. See ADR 0012.
|
|
588
|
+
*
|
|
589
|
+
* @public
|
|
590
|
+
*/
|
|
591
|
+
/** Lifecycle status of a durable objective (ADR 0012 D2). */
|
|
592
|
+
type ObjectiveStatus = "active" | "done" | "paused";
|
|
593
|
+
/**
|
|
594
|
+
* The per-objective override subset of goal options. Precedence (ADR 0012 D3):
|
|
595
|
+
* these `record.options` → the agent's standing `goal` config → built-in default.
|
|
596
|
+
* The `judgeModel` is the activation switch — with no judge resolved, the
|
|
597
|
+
* standing objective is inert (no scoring, no budget consumed).
|
|
598
|
+
*/
|
|
599
|
+
interface DurableGoalOptions {
|
|
600
|
+
/** Max judge-gated turns before the loop stops (default 20 — the `runUntil` default). */
|
|
601
|
+
readonly maxRuns?: number;
|
|
602
|
+
/** Judge model identifier (e.g. `"openai/gpt-4o-mini"`). Absent ⇒ inherit from agent `goal` config. */
|
|
603
|
+
readonly judgeModel?: string;
|
|
604
|
+
/** Optional extra judge instruction appended to the default judge prompt. */
|
|
605
|
+
readonly prompt?: string;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* A persisted objective record. Stored under the caller's `threadId` (the
|
|
609
|
+
* conversation key). `_schemaVersion` mirrors {@link import("./workflow.js").WorkflowSnapshot}
|
|
610
|
+
* for future migration (ADR 0012 D2).
|
|
611
|
+
*/
|
|
612
|
+
interface ObjectiveRecord {
|
|
613
|
+
readonly _schemaVersion: 1;
|
|
614
|
+
readonly objective: string;
|
|
615
|
+
readonly options?: DurableGoalOptions;
|
|
616
|
+
readonly status: ObjectiveStatus;
|
|
617
|
+
readonly runsUsed: number;
|
|
618
|
+
}
|
|
619
|
+
/** The standing `goal` config on an agent (ADR 0012 D3). Read when a durable objective is set. */
|
|
620
|
+
interface AgentGoalConfig {
|
|
621
|
+
readonly judgeModel?: string;
|
|
622
|
+
readonly maxRuns?: number;
|
|
623
|
+
readonly prompt?: string;
|
|
624
|
+
}
|
|
625
|
+
|
|
573
626
|
/**
|
|
574
627
|
* Pluggable persistence for conversation history (Production-Readiness #1, ADRs D303-D306).
|
|
575
628
|
*
|
|
@@ -581,6 +634,7 @@ interface BudgetTracker {
|
|
|
581
634
|
*
|
|
582
635
|
* @public
|
|
583
636
|
*/
|
|
637
|
+
|
|
584
638
|
/**
|
|
585
639
|
* Persisted message envelope used by {@link ConversationStorageAdapter}.
|
|
586
640
|
*
|
|
@@ -712,6 +766,28 @@ interface ConversationStorageAdapter {
|
|
|
712
766
|
* lazily. Adapters that cannot store side metadata MAY omit this.
|
|
713
767
|
*/
|
|
714
768
|
setSessionMeta?(conversationId: string, patch: SessionMetaPatch): Promise<void>;
|
|
769
|
+
/**
|
|
770
|
+
* SE33 — optional: read the durable {@link ObjectiveRecord} for a conversation
|
|
771
|
+
* (the thread-scoped goal). Absent ⇒ the agent's objective methods no-op
|
|
772
|
+
* (typed degradation, same contract as `getSessionMeta`). ADR 0012 D1.
|
|
773
|
+
*/
|
|
774
|
+
getObjectiveRecord?(conversationId: string): Promise<ObjectiveRecord | undefined>;
|
|
775
|
+
/**
|
|
776
|
+
* SE33 — optional: write (or, with `record: null`, CLEAR) the durable
|
|
777
|
+
* objective for a conversation. MUST create the record lazily. Adapters that
|
|
778
|
+
* cannot store side state MAY omit this. ADR 0012 D1.
|
|
779
|
+
*/
|
|
780
|
+
setObjectiveRecord?(conversationId: string, record: ObjectiveRecord | null): Promise<void>;
|
|
781
|
+
/**
|
|
782
|
+
* SE33 — optional: ATOMIC read-modify-write of the durable objective. `mutate`
|
|
783
|
+
* receives the current record (or `undefined`) and returns the next record, or
|
|
784
|
+
* `null` to clear, or `undefined` to leave it unchanged. The whole get→mutate→set
|
|
785
|
+
* MUST run under the adapter's own concurrency guard (the FS adapter holds its
|
|
786
|
+
* file lock across the read AND the write) so concurrent progress write-backs
|
|
787
|
+
* on one thread cannot drop turns (TOCTOU). Adapters that omit it fall back to a
|
|
788
|
+
* non-atomic `getObjectiveRecord` + `setObjectiveRecord` pair. ADR 0012 D1.
|
|
789
|
+
*/
|
|
790
|
+
updateObjectiveRecord?(conversationId: string, mutate: (current: ObjectiveRecord | undefined) => ObjectiveRecord | null | undefined): Promise<void>;
|
|
715
791
|
/**
|
|
716
792
|
* Optional: dispose underlying handles (close DB pool, etc.).
|
|
717
793
|
* MUST be safe to call multiple times.
|
|
@@ -1502,6 +1578,14 @@ interface AgentOptions {
|
|
|
1502
1578
|
outputProcessors?: readonly Processor[];
|
|
1503
1579
|
/** Memory configuration. Persists durable facts; auto-recalled on send. */
|
|
1504
1580
|
memory?: MemorySettings;
|
|
1581
|
+
/**
|
|
1582
|
+
* SE33 — standing goal config for a DURABLE, thread-scoped objective (Mastra
|
|
1583
|
+
* Goals parity). Read when a durable objective (`setObjective`) is set: the
|
|
1584
|
+
* per-objective values take precedence over this config, which takes
|
|
1585
|
+
* precedence over the built-in defaults. The judge is the activation switch —
|
|
1586
|
+
* with no `judgeModel` resolved, a standing objective is inert. ADR 0012.
|
|
1587
|
+
*/
|
|
1588
|
+
goal?: AgentGoalConfig;
|
|
1505
1589
|
/**
|
|
1506
1590
|
* Inline custom tools. Local runtime only — cloud agents reject any non-empty
|
|
1507
1591
|
* `tools` array. Handlers are not persisted; pass them again on resume.
|
|
@@ -1801,7 +1885,30 @@ interface SDKAgent {
|
|
|
1801
1885
|
*
|
|
1802
1886
|
* @public
|
|
1803
1887
|
*/
|
|
1804
|
-
runUntil?(goal
|
|
1888
|
+
runUntil?(goal?: string, options?: GoalOptions): RunUntilIterator;
|
|
1889
|
+
/**
|
|
1890
|
+
* SE33 — set a DURABLE, thread-scoped objective persisted via the
|
|
1891
|
+
* conversation storage (survives reload). Read by `runUntil()` when no
|
|
1892
|
+
* explicit goal is passed. `threadId` is REQUIRED (the durability key); the
|
|
1893
|
+
* call no-ops when the run is not memory-backed (the storage adapter omits the
|
|
1894
|
+
* optional objective methods). Throws `ConfigurationError` on `maxRuns <= 0`.
|
|
1895
|
+
* ADR 0012.
|
|
1896
|
+
*/
|
|
1897
|
+
setObjective?(objective: string, opts: {
|
|
1898
|
+
threadId: string;
|
|
1899
|
+
} & DurableGoalOptions): Promise<void>;
|
|
1900
|
+
/** SE33 — read the durable objective record for a thread (or `undefined`). */
|
|
1901
|
+
getObjective?(opts: {
|
|
1902
|
+
threadId: string;
|
|
1903
|
+
}): Promise<ObjectiveRecord | undefined>;
|
|
1904
|
+
/** SE33 — merge options into the active objective (only provided fields change; no-op if unset). */
|
|
1905
|
+
updateObjectiveOptions?(opts: {
|
|
1906
|
+
threadId: string;
|
|
1907
|
+
} & DurableGoalOptions): Promise<void>;
|
|
1908
|
+
/** SE33 — drop the durable objective for a thread. */
|
|
1909
|
+
clearObjective?(opts: {
|
|
1910
|
+
threadId: string;
|
|
1911
|
+
}): Promise<void>;
|
|
1805
1912
|
/**
|
|
1806
1913
|
* Fork a short-lived sub-agent with parent's credentials + system
|
|
1807
1914
|
* prompt byte-identical (ADR D112 — cache hit) and a restricted tool
|
|
@@ -2219,4 +2326,4 @@ declare class Cron {
|
|
|
2219
2326
|
static status(_options?: CronStartOptions): Promise<CronSchedulerStatus>;
|
|
2220
2327
|
}
|
|
2221
2328
|
|
|
2222
|
-
export { type
|
|
2329
|
+
export { type CronRunOptions as $, type AgentOptions as A, type BudgetTracker as B, type CloudOptions as C, type BudgetTotal as D, type BudgetUsageEvent as E, type CloudEnv as F, type GetAgentOptions as G, type CloudRepo as H, type InlineSkill as I, type ContextBudget as J, type ContextManagerKind as K, type LocalOptions as L, type MemorySettings as M, type ContextSnapshot as N, type ObjectiveRecord as O, type ProviderRoutingSettings as P, type ContextSource as Q, type ContextSourceStatus as R, type SystemPromptResolver as S, type CreateSkillSpec as T, Cron as U, type CronCreateOptions as V, type CronGetOptions as W, type CronJob as X, type CronJobStatus as Y, type CronListOptions as Z, type CronOperationOptions as _, type AgentDefinition as a, type CronRuntime as a0, type CronSchedulerStatus as a1, type CronStartOptions as a2, type DurableGoalOptions as a3, type GoalEvent as a4, type GoalOptions as a5, type GoalResult as a6, type HookName as a7, type InvalidateCacheOptions as a8, type MemoryAdapter as a9, type SDKProvidersManager as aA, type SettingSource as aB, type SkillsResolver as aC, type SkillsResolverContext as aD, type SystemPromptContext as aE, type SystemPromptMemoryFact as aF, type SystemPromptSkillRef as aG, type TelemetrySettings as aH, createSkill as aI, definePlugin as aJ, type MemoryAdapterCapabilities as aa, type MemoryContext as ab, type MemoryFact as ac, type MemoryProviderHandle as ad, type MemoryProviderInitOptions as ae, type MemoryRevision as af, type MemoryToolSchema as ag, type MemoryTurnMessage as ah, type ObjectiveStatus as ai, type PersonalityPreset as aj, type PluginContext as ak, type PostAssistantReplyContext as al, type PreToolCallContext as am, type PreUserSendContext as an, type PreUserSendResult as ao, type ProviderCapability as ap, type ProviderRoute as aq, type RecordSessionSummaryArgs as ar, type ResolvedProviderRoute as as, type RunUntilIterator as at, type SDKAgentPlugins as au, type SDKAgentSkillDetail as av, type SDKAgentSkills as aw, type SDKArtifact as ax, type SDKContextManager as ay, type SDKPluginMetadata as az, type ContextSettings as b, type PluginsSettings as c, type SkillsSettings as d, type SDKAgent as e, type ListAgentsOptions as f, type ListResult as g, type SDKAgentInfo as h, type ListRunsOptions as i, type GetRunOptions as j, type AgentOperationOptions as k, type ProviderProfile as l, type Plugin as m, type ConversationStorageAdapter as n, type StoredMessage as o, type SessionMeta as p, type SessionMetaPatch as q, type MemoryProvider as r, type MemoryId as s, type PreToolCallDecision as t, type SDKProvider as u, type ActiveMemoryPassArgs as v, type ActiveMemoryPassResult as w, type AgentGoalConfig as x, type AgentMemory as y, type BudgetCheck as z };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CustomTool, M as ModelSelection,
|
|
1
|
+
import { C as CustomTool, M as ModelSelection, a7 as SDKUserMessage, a9 as SendOptions, b as Run, G as GenerateOptions, l as GenerateRunResult, V as RunToCompletionOptions, W as RunToCompletionResult, S as SDKMessage, ag as StreamToCompletionResult, a as McpServerConfig, P as Processor } from './run-q_P0vHlY.cjs';
|
|
2
2
|
import * as zod from 'zod';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -139,6 +139,13 @@ interface GoalOptions {
|
|
|
139
139
|
judgeApiKey?: string;
|
|
140
140
|
/** Optional subgoals fed to the judge prompt. */
|
|
141
141
|
subgoals?: string[];
|
|
142
|
+
/**
|
|
143
|
+
* SE33 (ADR 0012) — resolve the goal from the durable thread-scoped
|
|
144
|
+
* objective when `runUntil()` is called with NO explicit goal. Also the
|
|
145
|
+
* key the loop writes `runsUsed` / `status` progress back to. Ignored when
|
|
146
|
+
* an explicit goal is passed (that path stays ephemeral).
|
|
147
|
+
*/
|
|
148
|
+
threadId?: string;
|
|
142
149
|
/**
|
|
143
150
|
* Cancel mid-loop via `AbortController.signal`. The generator yields
|
|
144
151
|
* a `status_change: paused` event and returns at the next turn
|
|
@@ -570,6 +577,52 @@ interface BudgetTracker {
|
|
|
570
577
|
nextIteration?(): void;
|
|
571
578
|
}
|
|
572
579
|
|
|
580
|
+
/**
|
|
581
|
+
* SE33 — the durable, thread-scoped objective (Mastra Goals parity, durable half).
|
|
582
|
+
*
|
|
583
|
+
* The SDK's `runUntil` goal loop (ADRs D115-D121) is per-call/transient. SE33
|
|
584
|
+
* persists an objective in conversation storage (via the optional
|
|
585
|
+
* `getObjectiveRecord`/`setObjectiveRecord` adapter methods) so it survives
|
|
586
|
+
* reloads, is managed via `Agent` methods, and is read by `runUntil` when no
|
|
587
|
+
* explicit goal is passed. See ADR 0012.
|
|
588
|
+
*
|
|
589
|
+
* @public
|
|
590
|
+
*/
|
|
591
|
+
/** Lifecycle status of a durable objective (ADR 0012 D2). */
|
|
592
|
+
type ObjectiveStatus = "active" | "done" | "paused";
|
|
593
|
+
/**
|
|
594
|
+
* The per-objective override subset of goal options. Precedence (ADR 0012 D3):
|
|
595
|
+
* these `record.options` → the agent's standing `goal` config → built-in default.
|
|
596
|
+
* The `judgeModel` is the activation switch — with no judge resolved, the
|
|
597
|
+
* standing objective is inert (no scoring, no budget consumed).
|
|
598
|
+
*/
|
|
599
|
+
interface DurableGoalOptions {
|
|
600
|
+
/** Max judge-gated turns before the loop stops (default 20 — the `runUntil` default). */
|
|
601
|
+
readonly maxRuns?: number;
|
|
602
|
+
/** Judge model identifier (e.g. `"openai/gpt-4o-mini"`). Absent ⇒ inherit from agent `goal` config. */
|
|
603
|
+
readonly judgeModel?: string;
|
|
604
|
+
/** Optional extra judge instruction appended to the default judge prompt. */
|
|
605
|
+
readonly prompt?: string;
|
|
606
|
+
}
|
|
607
|
+
/**
|
|
608
|
+
* A persisted objective record. Stored under the caller's `threadId` (the
|
|
609
|
+
* conversation key). `_schemaVersion` mirrors {@link import("./workflow.js").WorkflowSnapshot}
|
|
610
|
+
* for future migration (ADR 0012 D2).
|
|
611
|
+
*/
|
|
612
|
+
interface ObjectiveRecord {
|
|
613
|
+
readonly _schemaVersion: 1;
|
|
614
|
+
readonly objective: string;
|
|
615
|
+
readonly options?: DurableGoalOptions;
|
|
616
|
+
readonly status: ObjectiveStatus;
|
|
617
|
+
readonly runsUsed: number;
|
|
618
|
+
}
|
|
619
|
+
/** The standing `goal` config on an agent (ADR 0012 D3). Read when a durable objective is set. */
|
|
620
|
+
interface AgentGoalConfig {
|
|
621
|
+
readonly judgeModel?: string;
|
|
622
|
+
readonly maxRuns?: number;
|
|
623
|
+
readonly prompt?: string;
|
|
624
|
+
}
|
|
625
|
+
|
|
573
626
|
/**
|
|
574
627
|
* Pluggable persistence for conversation history (Production-Readiness #1, ADRs D303-D306).
|
|
575
628
|
*
|
|
@@ -581,6 +634,7 @@ interface BudgetTracker {
|
|
|
581
634
|
*
|
|
582
635
|
* @public
|
|
583
636
|
*/
|
|
637
|
+
|
|
584
638
|
/**
|
|
585
639
|
* Persisted message envelope used by {@link ConversationStorageAdapter}.
|
|
586
640
|
*
|
|
@@ -712,6 +766,28 @@ interface ConversationStorageAdapter {
|
|
|
712
766
|
* lazily. Adapters that cannot store side metadata MAY omit this.
|
|
713
767
|
*/
|
|
714
768
|
setSessionMeta?(conversationId: string, patch: SessionMetaPatch): Promise<void>;
|
|
769
|
+
/**
|
|
770
|
+
* SE33 — optional: read the durable {@link ObjectiveRecord} for a conversation
|
|
771
|
+
* (the thread-scoped goal). Absent ⇒ the agent's objective methods no-op
|
|
772
|
+
* (typed degradation, same contract as `getSessionMeta`). ADR 0012 D1.
|
|
773
|
+
*/
|
|
774
|
+
getObjectiveRecord?(conversationId: string): Promise<ObjectiveRecord | undefined>;
|
|
775
|
+
/**
|
|
776
|
+
* SE33 — optional: write (or, with `record: null`, CLEAR) the durable
|
|
777
|
+
* objective for a conversation. MUST create the record lazily. Adapters that
|
|
778
|
+
* cannot store side state MAY omit this. ADR 0012 D1.
|
|
779
|
+
*/
|
|
780
|
+
setObjectiveRecord?(conversationId: string, record: ObjectiveRecord | null): Promise<void>;
|
|
781
|
+
/**
|
|
782
|
+
* SE33 — optional: ATOMIC read-modify-write of the durable objective. `mutate`
|
|
783
|
+
* receives the current record (or `undefined`) and returns the next record, or
|
|
784
|
+
* `null` to clear, or `undefined` to leave it unchanged. The whole get→mutate→set
|
|
785
|
+
* MUST run under the adapter's own concurrency guard (the FS adapter holds its
|
|
786
|
+
* file lock across the read AND the write) so concurrent progress write-backs
|
|
787
|
+
* on one thread cannot drop turns (TOCTOU). Adapters that omit it fall back to a
|
|
788
|
+
* non-atomic `getObjectiveRecord` + `setObjectiveRecord` pair. ADR 0012 D1.
|
|
789
|
+
*/
|
|
790
|
+
updateObjectiveRecord?(conversationId: string, mutate: (current: ObjectiveRecord | undefined) => ObjectiveRecord | null | undefined): Promise<void>;
|
|
715
791
|
/**
|
|
716
792
|
* Optional: dispose underlying handles (close DB pool, etc.).
|
|
717
793
|
* MUST be safe to call multiple times.
|
|
@@ -1502,6 +1578,14 @@ interface AgentOptions {
|
|
|
1502
1578
|
outputProcessors?: readonly Processor[];
|
|
1503
1579
|
/** Memory configuration. Persists durable facts; auto-recalled on send. */
|
|
1504
1580
|
memory?: MemorySettings;
|
|
1581
|
+
/**
|
|
1582
|
+
* SE33 — standing goal config for a DURABLE, thread-scoped objective (Mastra
|
|
1583
|
+
* Goals parity). Read when a durable objective (`setObjective`) is set: the
|
|
1584
|
+
* per-objective values take precedence over this config, which takes
|
|
1585
|
+
* precedence over the built-in defaults. The judge is the activation switch —
|
|
1586
|
+
* with no `judgeModel` resolved, a standing objective is inert. ADR 0012.
|
|
1587
|
+
*/
|
|
1588
|
+
goal?: AgentGoalConfig;
|
|
1505
1589
|
/**
|
|
1506
1590
|
* Inline custom tools. Local runtime only — cloud agents reject any non-empty
|
|
1507
1591
|
* `tools` array. Handlers are not persisted; pass them again on resume.
|
|
@@ -1801,7 +1885,30 @@ interface SDKAgent {
|
|
|
1801
1885
|
*
|
|
1802
1886
|
* @public
|
|
1803
1887
|
*/
|
|
1804
|
-
runUntil?(goal
|
|
1888
|
+
runUntil?(goal?: string, options?: GoalOptions): RunUntilIterator;
|
|
1889
|
+
/**
|
|
1890
|
+
* SE33 — set a DURABLE, thread-scoped objective persisted via the
|
|
1891
|
+
* conversation storage (survives reload). Read by `runUntil()` when no
|
|
1892
|
+
* explicit goal is passed. `threadId` is REQUIRED (the durability key); the
|
|
1893
|
+
* call no-ops when the run is not memory-backed (the storage adapter omits the
|
|
1894
|
+
* optional objective methods). Throws `ConfigurationError` on `maxRuns <= 0`.
|
|
1895
|
+
* ADR 0012.
|
|
1896
|
+
*/
|
|
1897
|
+
setObjective?(objective: string, opts: {
|
|
1898
|
+
threadId: string;
|
|
1899
|
+
} & DurableGoalOptions): Promise<void>;
|
|
1900
|
+
/** SE33 — read the durable objective record for a thread (or `undefined`). */
|
|
1901
|
+
getObjective?(opts: {
|
|
1902
|
+
threadId: string;
|
|
1903
|
+
}): Promise<ObjectiveRecord | undefined>;
|
|
1904
|
+
/** SE33 — merge options into the active objective (only provided fields change; no-op if unset). */
|
|
1905
|
+
updateObjectiveOptions?(opts: {
|
|
1906
|
+
threadId: string;
|
|
1907
|
+
} & DurableGoalOptions): Promise<void>;
|
|
1908
|
+
/** SE33 — drop the durable objective for a thread. */
|
|
1909
|
+
clearObjective?(opts: {
|
|
1910
|
+
threadId: string;
|
|
1911
|
+
}): Promise<void>;
|
|
1805
1912
|
/**
|
|
1806
1913
|
* Fork a short-lived sub-agent with parent's credentials + system
|
|
1807
1914
|
* prompt byte-identical (ADR D112 — cache hit) and a restricted tool
|
|
@@ -2219,4 +2326,4 @@ declare class Cron {
|
|
|
2219
2326
|
static status(_options?: CronStartOptions): Promise<CronSchedulerStatus>;
|
|
2220
2327
|
}
|
|
2221
2328
|
|
|
2222
|
-
export { type
|
|
2329
|
+
export { type CronRunOptions as $, type AgentOptions as A, type BudgetTracker as B, type CloudOptions as C, type BudgetTotal as D, type BudgetUsageEvent as E, type CloudEnv as F, type GetAgentOptions as G, type CloudRepo as H, type InlineSkill as I, type ContextBudget as J, type ContextManagerKind as K, type LocalOptions as L, type MemorySettings as M, type ContextSnapshot as N, type ObjectiveRecord as O, type ProviderRoutingSettings as P, type ContextSource as Q, type ContextSourceStatus as R, type SystemPromptResolver as S, type CreateSkillSpec as T, Cron as U, type CronCreateOptions as V, type CronGetOptions as W, type CronJob as X, type CronJobStatus as Y, type CronListOptions as Z, type CronOperationOptions as _, type AgentDefinition as a, type CronRuntime as a0, type CronSchedulerStatus as a1, type CronStartOptions as a2, type DurableGoalOptions as a3, type GoalEvent as a4, type GoalOptions as a5, type GoalResult as a6, type HookName as a7, type InvalidateCacheOptions as a8, type MemoryAdapter as a9, type SDKProvidersManager as aA, type SettingSource as aB, type SkillsResolver as aC, type SkillsResolverContext as aD, type SystemPromptContext as aE, type SystemPromptMemoryFact as aF, type SystemPromptSkillRef as aG, type TelemetrySettings as aH, createSkill as aI, definePlugin as aJ, type MemoryAdapterCapabilities as aa, type MemoryContext as ab, type MemoryFact as ac, type MemoryProviderHandle as ad, type MemoryProviderInitOptions as ae, type MemoryRevision as af, type MemoryToolSchema as ag, type MemoryTurnMessage as ah, type ObjectiveStatus as ai, type PersonalityPreset as aj, type PluginContext as ak, type PostAssistantReplyContext as al, type PreToolCallContext as am, type PreUserSendContext as an, type PreUserSendResult as ao, type ProviderCapability as ap, type ProviderRoute as aq, type RecordSessionSummaryArgs as ar, type ResolvedProviderRoute as as, type RunUntilIterator as at, type SDKAgentPlugins as au, type SDKAgentSkillDetail as av, type SDKAgentSkills as aw, type SDKArtifact as ax, type SDKContextManager as ay, type SDKPluginMetadata as az, type ContextSettings as b, type PluginsSettings as c, type SkillsSettings as d, type SDKAgent as e, type ListAgentsOptions as f, type ListResult as g, type SDKAgentInfo as h, type ListRunsOptions as i, type GetRunOptions as j, type AgentOperationOptions as k, type ProviderProfile as l, type Plugin as m, type ConversationStorageAdapter as n, type StoredMessage as o, type SessionMeta as p, type SessionMetaPatch as q, type MemoryProvider as r, type MemoryId as s, type PreToolCallDecision as t, type SDKProvider as u, type ActiveMemoryPassArgs as v, type ActiveMemoryPassResult as w, type AgentGoalConfig as x, type AgentMemory as y, type BudgetCheck as z };
|