@rowan-agent/agent 0.17.0 → 0.19.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 +12 -3
- package/dist/index.d.ts +326 -210
- package/dist/index.js +1368 -461
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _rowan_agent_models from '@rowan-agent/models';
|
|
2
|
-
import { LlmContentPart, ModelRef, ContentBlock, ModelConfig, StreamFn } from '@rowan-agent/models';
|
|
3
|
-
export { ModelConfig, ModelRef, StreamFn, ThinkingLevel } from '@rowan-agent/models';
|
|
2
|
+
import { LlmContentPart, ModelRef, ContentBlock, ScopeRef, ToolKind, ToolAnnotations, ToolCallStatus, ToolProgress, ToolCallContent, ToolCallLocation, JsonValue as JsonValue$1, JsonObject as JsonObject$1, ModelConfig, StreamFn, ThinkingLevel, ToolCall as ToolCall$1, ToolCallUpdate } from '@rowan-agent/models';
|
|
3
|
+
export { ModelConfig, ModelRef, ProviderCallContext, ProviderConfig, ProviderModelConfig, ProviderStreamFn, ScopeRef, StreamFn, ThinkingLevel, ToolAnnotations, ToolCall, ToolCallContent, ToolCallLocation, ToolCallOptions, ToolCallOutcome, ToolCallStatus, ToolCallUpdate, ToolDefinitionSummary, ToolKind, ToolProgress } from '@rowan-agent/models';
|
|
4
4
|
import Type from 'typebox';
|
|
5
5
|
|
|
6
6
|
type AgentMessage = {
|
|
@@ -53,6 +53,8 @@ type ToolResult = {
|
|
|
53
53
|
ok: boolean;
|
|
54
54
|
content: unknown;
|
|
55
55
|
error?: string;
|
|
56
|
+
structuredContent?: unknown;
|
|
57
|
+
isError?: boolean;
|
|
56
58
|
};
|
|
57
59
|
|
|
58
60
|
type PhaseRegistrySelection = Readonly<{
|
|
@@ -206,15 +208,11 @@ type PhaseMessageManager = {
|
|
|
206
208
|
discard(messageId: string): void;
|
|
207
209
|
};
|
|
208
210
|
|
|
209
|
-
type
|
|
210
|
-
kind:
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
} | {
|
|
215
|
-
kind: "project";
|
|
216
|
-
teamId: string;
|
|
217
|
-
projectId: string;
|
|
211
|
+
type HostContribution = {
|
|
212
|
+
readonly kind: string;
|
|
213
|
+
readonly id: string;
|
|
214
|
+
} & {
|
|
215
|
+
readonly [key: string]: JsonValue;
|
|
218
216
|
};
|
|
219
217
|
interface ExtensionStateStore {
|
|
220
218
|
get(key: string): Promise<JsonValue | undefined>;
|
|
@@ -227,6 +225,9 @@ interface ExtensionHost {
|
|
|
227
225
|
getAgentState(extensionId: string, agentId: string, key: string): Promise<JsonValue | undefined> | JsonValue | undefined;
|
|
228
226
|
setAgentState(extensionId: string, agentId: string, key: string, value: JsonValue): Promise<void> | void;
|
|
229
227
|
deleteAgentState(extensionId: string, agentId: string, key: string): Promise<void> | void;
|
|
228
|
+
getGlobalState(extensionId: string, key: string): Promise<JsonValue | undefined> | JsonValue | undefined;
|
|
229
|
+
setGlobalState(extensionId: string, key: string, value: JsonValue): Promise<void> | void;
|
|
230
|
+
deleteGlobalState(extensionId: string, key: string): Promise<void> | void;
|
|
230
231
|
}
|
|
231
232
|
type ExtensionToolContribution = {
|
|
232
233
|
kind: "tool";
|
|
@@ -248,11 +249,11 @@ interface SourceInfo {
|
|
|
248
249
|
/** Register a Phase by directory path or Phase object; PHASE.md and direct child Skills are loaded atomically when a path is supplied. */
|
|
249
250
|
type PhaseRegistration = string | Phase;
|
|
250
251
|
/**
|
|
251
|
-
* Tool definition for registering LLM-callable tools via `api.
|
|
252
|
+
* Tool definition for registering LLM-callable tools via `api.tools.register()`.
|
|
252
253
|
*
|
|
253
254
|
* @example
|
|
254
255
|
* ```typescript
|
|
255
|
-
* api.
|
|
256
|
+
* api.tools.register({
|
|
256
257
|
* name: "search_docs",
|
|
257
258
|
* description: "Search documentation",
|
|
258
259
|
* parameters: { type: "object", properties: { query: { type: "string" } } },
|
|
@@ -273,24 +274,31 @@ interface ToolDefinition {
|
|
|
273
274
|
promptSnippet?: string;
|
|
274
275
|
/** Optional: additional guidelines appended to system prompt */
|
|
275
276
|
promptGuidelines?: string[];
|
|
277
|
+
kind?: ToolKind;
|
|
278
|
+
annotations?: ToolAnnotations;
|
|
279
|
+
_meta?: JsonObject;
|
|
280
|
+
present?: (call: {
|
|
281
|
+
status: ToolCallStatus;
|
|
282
|
+
args: JsonValue;
|
|
283
|
+
progress?: ToolProgress;
|
|
284
|
+
result?: ToolExecutionResult;
|
|
285
|
+
}) => {
|
|
286
|
+
title?: string;
|
|
287
|
+
content?: ToolCallContent[];
|
|
288
|
+
locations?: ToolCallLocation[];
|
|
289
|
+
_meta?: JsonObject;
|
|
290
|
+
} | undefined | void | Promise<{
|
|
291
|
+
title?: string;
|
|
292
|
+
content?: ToolCallContent[];
|
|
293
|
+
locations?: ToolCallLocation[];
|
|
294
|
+
_meta?: JsonObject;
|
|
295
|
+
} | undefined | void>;
|
|
276
296
|
/** Execute the tool */
|
|
277
|
-
execute: (args: unknown, context: ToolInvocationContext, signal?: AbortSignal) => Promise<ToolExecutionResult
|
|
297
|
+
execute: (args: unknown, context: ToolInvocationContext, signal?: AbortSignal) => Promise<ToolExecutionResult>;
|
|
278
298
|
/** Optional: per-tool execution mode override */
|
|
279
299
|
executionMode?: "sequential" | "parallel";
|
|
280
300
|
}
|
|
281
|
-
|
|
282
|
-
* Result from tool execution.
|
|
283
|
-
*/
|
|
284
|
-
interface ToolExecutionResult$1 {
|
|
285
|
-
/** Content blocks to return to the LLM */
|
|
286
|
-
content: Array<{
|
|
287
|
-
type: string;
|
|
288
|
-
text?: string;
|
|
289
|
-
[key: string]: unknown;
|
|
290
|
-
}>;
|
|
291
|
-
/** Whether this is an error result */
|
|
292
|
-
isError?: boolean;
|
|
293
|
-
}
|
|
301
|
+
|
|
294
302
|
/**
|
|
295
303
|
* Registered tool with source metadata.
|
|
296
304
|
*/
|
|
@@ -417,7 +425,7 @@ interface EventBus {
|
|
|
417
425
|
*
|
|
418
426
|
* @example
|
|
419
427
|
* ```typescript
|
|
420
|
-
* api.on("before_tool_call", (event, ctx) => {
|
|
428
|
+
* api.hooks.on("before_tool_call", (event, ctx) => {
|
|
421
429
|
* console.log(`cwd: ${ctx.cwd}`);
|
|
422
430
|
* if (ctx.isIdle()) { ... }
|
|
423
431
|
* });
|
|
@@ -502,15 +510,18 @@ interface ExtensionUtils {
|
|
|
502
510
|
* ```
|
|
503
511
|
*/
|
|
504
512
|
interface ExtensionAPI {
|
|
505
|
-
/**
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
513
|
+
/** Hook events — subscribe or unsubscribe. */
|
|
514
|
+
hooks: {
|
|
515
|
+
/**
|
|
516
|
+
* Subscribe to a hook event.
|
|
517
|
+
*
|
|
518
|
+
* @param eventType - Hook type, e.g. "before_tool_call"
|
|
519
|
+
* @param handler - Hook handler, can return result to modify behavior
|
|
520
|
+
*/
|
|
521
|
+
on<K extends HookEventType>(eventType: K, handler: HookHandler<K>): void;
|
|
522
|
+
/** Unsubscribe from a hook event. */
|
|
523
|
+
off<K extends HookEventType>(eventType: K, handler: HookHandler<K>): void;
|
|
524
|
+
};
|
|
514
525
|
/** Extension configuration — read own layered config or listen for changes. */
|
|
515
526
|
config: {
|
|
516
527
|
/** Get the extension's own effective configuration block. */
|
|
@@ -518,15 +529,17 @@ interface ExtensionAPI {
|
|
|
518
529
|
/** Listen for configuration changes for a scope. */
|
|
519
530
|
changed(handler: (scope: ScopeRef) => void): void;
|
|
520
531
|
};
|
|
521
|
-
/** Extension state — scoped to run (in-memory) or agent (durable). */
|
|
532
|
+
/** Extension state — scoped to run (in-memory) or agent (durable) or global (durable). */
|
|
522
533
|
state: {
|
|
523
534
|
/** Run-scoped in-memory state; dropped when the Run ends. */
|
|
524
535
|
run(runId: string): ExtensionStateStore;
|
|
525
536
|
/** Agent-scoped durable state; persisted with the Agent record. */
|
|
526
537
|
agent(agentId: string): ExtensionStateStore;
|
|
538
|
+
/** Extension-scoped durable state; survives process restarts. */
|
|
539
|
+
global(): ExtensionStateStore;
|
|
527
540
|
};
|
|
528
541
|
/** Tool capabilities — register and unregister custom tools. */
|
|
529
|
-
|
|
542
|
+
tools: {
|
|
530
543
|
/** Register a custom LLM-callable tool. */
|
|
531
544
|
register(tool: ToolDefinition): void;
|
|
532
545
|
/** Unregister a previously registered tool by name. */
|
|
@@ -537,20 +550,15 @@ interface ExtensionAPI {
|
|
|
537
550
|
/** Contribute a capability to the host. Returns a disposer to remove the contribution. */
|
|
538
551
|
contribute(contribution: ExtensionCapabilityContribution): () => void;
|
|
539
552
|
};
|
|
540
|
-
/**
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
utils: ExtensionUtils;
|
|
548
|
-
/** Runtime context — cwd, signal, exec, message access, etc. */
|
|
549
|
-
context: ExtensionContext;
|
|
550
|
-
/** Shared event bus for inter-extension communication. */
|
|
551
|
-
events: EventBus;
|
|
553
|
+
/** Model provider registration. */
|
|
554
|
+
providers: {
|
|
555
|
+
/** Register a model provider. Registering with an existing id replaces it. */
|
|
556
|
+
register(config: _rowan_agent_models.ProviderConfig): void;
|
|
557
|
+
/** Unregister a model provider by id. */
|
|
558
|
+
unregister(id: string): void;
|
|
559
|
+
};
|
|
552
560
|
/** Phase execution capabilities — provides Phase In/Out, phase identity, phase routing, and registration. */
|
|
553
|
-
|
|
561
|
+
phases: {
|
|
554
562
|
/** Register a Phase directory bundle or Phase object. */
|
|
555
563
|
register(phase: PhaseRegistration): Promise<void>;
|
|
556
564
|
/** Unregister a previously registered phase by name. */
|
|
@@ -569,11 +577,20 @@ interface ExtensionAPI {
|
|
|
569
577
|
getNextPhase(): string | undefined;
|
|
570
578
|
/** Get the message set by setMessage */
|
|
571
579
|
getMessage(): string | undefined;
|
|
572
|
-
/** Phase Settings contributions registered by the Phase extension. */
|
|
573
|
-
settings: {
|
|
574
|
-
register(provider: PhaseSettingsProvider): void;
|
|
575
|
-
};
|
|
576
580
|
};
|
|
581
|
+
/** Declarative host contributions. */
|
|
582
|
+
host: {
|
|
583
|
+
/** Contribute a declarative declaration to the host. Returns a disposer to remove the contribution. */
|
|
584
|
+
contribute<T extends HostContribution>(contribution: T): () => void;
|
|
585
|
+
};
|
|
586
|
+
/** Extension manifest from package.json `rowan` field. */
|
|
587
|
+
manifest?: ExtensionManifest;
|
|
588
|
+
/** Utility functions. */
|
|
589
|
+
utils: ExtensionUtils;
|
|
590
|
+
/** Runtime context — cwd, signal, exec, message access, etc. */
|
|
591
|
+
context: ExtensionContext;
|
|
592
|
+
/** Shared event bus for inter-extension communication. */
|
|
593
|
+
events: EventBus;
|
|
577
594
|
}
|
|
578
595
|
/**
|
|
579
596
|
* Extension factory function.
|
|
@@ -586,10 +603,12 @@ type ExtensionFactory = (api: ExtensionAPI) => ExtensionFactoryResult | Promise<
|
|
|
586
603
|
declare class InMemoryExtensionHost implements ExtensionHost {
|
|
587
604
|
private readonly configs;
|
|
588
605
|
private readonly agentState;
|
|
606
|
+
private readonly globalState;
|
|
589
607
|
private readonly listeners;
|
|
590
608
|
constructor(options?: {
|
|
591
609
|
configs?: Record<string, Record<string, JsonObject>>;
|
|
592
610
|
agentState?: Record<string, Record<string, Record<string, JsonValue>>>;
|
|
611
|
+
globalState?: Record<string, Record<string, JsonValue>>;
|
|
593
612
|
});
|
|
594
613
|
setConfig(extensionId: string, config: JsonObject | null, scope?: ScopeRef): void;
|
|
595
614
|
getConfig(extensionId: string, scope?: ScopeRef): JsonObject | null;
|
|
@@ -598,6 +617,9 @@ declare class InMemoryExtensionHost implements ExtensionHost {
|
|
|
598
617
|
getAgentState(extensionId: string, agentId: string, key: string): JsonValue | undefined;
|
|
599
618
|
setAgentState(extensionId: string, agentId: string, key: string, value: JsonValue): void;
|
|
600
619
|
deleteAgentState(extensionId: string, agentId: string, key: string): void;
|
|
620
|
+
getGlobalState(extensionId: string, key: string): JsonValue | undefined;
|
|
621
|
+
setGlobalState(extensionId: string, key: string, value: JsonValue): void;
|
|
622
|
+
deleteGlobalState(extensionId: string, key: string): void;
|
|
601
623
|
}
|
|
602
624
|
|
|
603
625
|
/**
|
|
@@ -664,6 +686,7 @@ declare class ExtensionRunner {
|
|
|
664
686
|
private bound;
|
|
665
687
|
private readonly errorListeners;
|
|
666
688
|
private readonly capabilityListeners;
|
|
689
|
+
private readonly hostContributionListeners;
|
|
667
690
|
/** Current agent context — set by the agent before each phase */
|
|
668
691
|
currentContext?: AgentContext;
|
|
669
692
|
constructor(options?: ExtensionRunnerOptions);
|
|
@@ -729,6 +752,18 @@ declare class ExtensionRunner {
|
|
|
729
752
|
* Returns an unsubscribe function.
|
|
730
753
|
*/
|
|
731
754
|
onCapabilitiesChanged(listener: (capabilities: readonly ExtensionCapability[]) => void): () => void;
|
|
755
|
+
/** Get all contributed host elements across all extensions. */
|
|
756
|
+
getHostContributions(): readonly HostContribution[];
|
|
757
|
+
/**
|
|
758
|
+
* Subscribe to host contribution changes (contributions added, removed, or extensions disposed).
|
|
759
|
+
* Returns an unsubscribe function.
|
|
760
|
+
*/
|
|
761
|
+
onHostContributionsChanged(listener: (contributions: readonly HostContribution[]) => void): () => void;
|
|
762
|
+
triggerUiAction(event: {
|
|
763
|
+
contributionId: string;
|
|
764
|
+
actionId: string;
|
|
765
|
+
scope?: ScopeRef;
|
|
766
|
+
}): void;
|
|
732
767
|
getPhase(name: string): Phase | undefined;
|
|
733
768
|
getPhases(): Phase[];
|
|
734
769
|
createPhaseRegistry(input?: {
|
|
@@ -798,6 +833,8 @@ declare class ExtensionRunner {
|
|
|
798
833
|
private unregisterTool;
|
|
799
834
|
private contributeCapability;
|
|
800
835
|
private notifyCapabilitiesChanged;
|
|
836
|
+
private contributeToHost;
|
|
837
|
+
private notifyHostContributionsChanged;
|
|
801
838
|
private registerPhase;
|
|
802
839
|
private registerPhaseDefinition;
|
|
803
840
|
private unregisterPhase;
|
|
@@ -811,6 +848,40 @@ declare class ExtensionRunner {
|
|
|
811
848
|
private disposeExtension;
|
|
812
849
|
}
|
|
813
850
|
|
|
851
|
+
type ToolCallPresentationInput = Readonly<{
|
|
852
|
+
status: ToolCallStatus;
|
|
853
|
+
args: JsonValue$1;
|
|
854
|
+
progress?: ToolProgress;
|
|
855
|
+
result?: ToolExecutionResult;
|
|
856
|
+
}>;
|
|
857
|
+
type ToolCallPresentationOutput = {
|
|
858
|
+
title?: string;
|
|
859
|
+
content?: ToolCallContent[];
|
|
860
|
+
locations?: ToolCallLocation[];
|
|
861
|
+
_meta?: JsonObject$1;
|
|
862
|
+
};
|
|
863
|
+
type ToolCallMergeTarget = {
|
|
864
|
+
title?: string;
|
|
865
|
+
kind?: ToolKind;
|
|
866
|
+
status?: ToolCallStatus;
|
|
867
|
+
locations?: ToolCallLocation[];
|
|
868
|
+
content?: ToolCallContent[];
|
|
869
|
+
rawInput?: JsonValue$1;
|
|
870
|
+
rawOutput?: JsonValue$1;
|
|
871
|
+
_meta?: JsonObject$1;
|
|
872
|
+
};
|
|
873
|
+
type ToolCallMergePatch = {
|
|
874
|
+
title?: string;
|
|
875
|
+
kind?: ToolKind;
|
|
876
|
+
status?: ToolCallStatus;
|
|
877
|
+
locations?: ToolCallLocation[];
|
|
878
|
+
content?: ToolCallContent[];
|
|
879
|
+
rawInput?: JsonValue$1;
|
|
880
|
+
rawOutput?: JsonValue$1;
|
|
881
|
+
_meta?: JsonObject$1;
|
|
882
|
+
};
|
|
883
|
+
declare function mergeToolCall<T extends ToolCallMergeTarget>(target: T, patch: ToolCallMergePatch): T;
|
|
884
|
+
|
|
814
885
|
type ExtensionContribution = LoadedExtension;
|
|
815
886
|
type ExtensionLoadInput = LoadInput<ExtensionContribution>;
|
|
816
887
|
type ExtensionActivationError = Readonly<{
|
|
@@ -911,6 +982,7 @@ declare function isConfigurationSnapshot(config: AgentConfiguration | Configurat
|
|
|
911
982
|
type UserInput = string | Readonly<{
|
|
912
983
|
content: UserContent;
|
|
913
984
|
metadata?: Metadata;
|
|
985
|
+
thinkingLevel?: ThinkingLevel;
|
|
914
986
|
}>;
|
|
915
987
|
type HistorySeed = readonly Message[];
|
|
916
988
|
type ContextStatus = Readonly<{
|
|
@@ -950,11 +1022,12 @@ type ToolCallContext = Readonly<{
|
|
|
950
1022
|
providerToolCallId?: string;
|
|
951
1023
|
scope?: ScopeRef;
|
|
952
1024
|
turn?: JsonObject;
|
|
953
|
-
reportProgress(progress:
|
|
1025
|
+
reportProgress(progress: ToolProgress): void;
|
|
954
1026
|
}>;
|
|
955
1027
|
type ToolInvocationContext = ToolCallContext & Readonly<{
|
|
956
1028
|
interaction: RunInteractionDriver;
|
|
957
1029
|
}>;
|
|
1030
|
+
|
|
958
1031
|
type Tool$1 = Readonly<{
|
|
959
1032
|
name: string;
|
|
960
1033
|
/** Rowan-owned Core Tool; Core Tools bypass Definition/Phase filtering. */
|
|
@@ -963,6 +1036,20 @@ type Tool$1 = Readonly<{
|
|
|
963
1036
|
parameters: Type.TSchema;
|
|
964
1037
|
promptSnippet?: string;
|
|
965
1038
|
promptGuidelines?: readonly string[];
|
|
1039
|
+
kind?: ToolKind;
|
|
1040
|
+
annotations?: ToolAnnotations;
|
|
1041
|
+
_meta?: JsonObject;
|
|
1042
|
+
present?(call: ToolCallPresentationInput): {
|
|
1043
|
+
title?: string;
|
|
1044
|
+
content?: ToolCallContent[];
|
|
1045
|
+
locations?: ToolCallLocation[];
|
|
1046
|
+
_meta?: JsonObject;
|
|
1047
|
+
} | undefined | void | Promise<{
|
|
1048
|
+
title?: string;
|
|
1049
|
+
content?: ToolCallContent[];
|
|
1050
|
+
locations?: ToolCallLocation[];
|
|
1051
|
+
_meta?: JsonObject;
|
|
1052
|
+
} | undefined | void>;
|
|
966
1053
|
execute(args: JsonValue, context: ToolInvocationContext, signal: AbortSignal): Promise<ToolExecutionResult>;
|
|
967
1054
|
}>;
|
|
968
1055
|
type ContextCandidate = Readonly<{
|
|
@@ -1041,6 +1128,11 @@ type ToolCallReservation = Readonly<{
|
|
|
1041
1128
|
name: string;
|
|
1042
1129
|
args: JsonValue;
|
|
1043
1130
|
toolCallId?: ToolCallId;
|
|
1131
|
+
title?: string;
|
|
1132
|
+
kind?: ToolKind;
|
|
1133
|
+
locations?: ToolCallLocation[];
|
|
1134
|
+
content?: ToolCallContent[];
|
|
1135
|
+
_meta?: JsonObject;
|
|
1044
1136
|
}>;
|
|
1045
1137
|
type ToolCommit = Readonly<{
|
|
1046
1138
|
run: RunRecord;
|
|
@@ -1062,6 +1154,8 @@ type RunRecord = Readonly<{
|
|
|
1062
1154
|
revision: number;
|
|
1063
1155
|
state: RunState;
|
|
1064
1156
|
input: UserInput;
|
|
1157
|
+
scope?: ScopeRef;
|
|
1158
|
+
cwd?: string;
|
|
1065
1159
|
initialMessageId?: MessageId;
|
|
1066
1160
|
invalidatedBy?: Readonly<{
|
|
1067
1161
|
messageId: MessageId;
|
|
@@ -1125,6 +1219,8 @@ type RunSnapshotBase = Readonly<{
|
|
|
1125
1219
|
agentSequence: number;
|
|
1126
1220
|
revision: number;
|
|
1127
1221
|
input: UserInput;
|
|
1222
|
+
scope?: ScopeRef;
|
|
1223
|
+
cwd?: string;
|
|
1128
1224
|
metadata?: Metadata;
|
|
1129
1225
|
/** Effective entry Phase payload the Run started with (defaults filled). */
|
|
1130
1226
|
phasePayload?: JsonValue;
|
|
@@ -1139,6 +1235,7 @@ type RunSnapshotBase = Readonly<{
|
|
|
1139
1235
|
type RunSnapshot = RunSnapshotBase & (Readonly<{
|
|
1140
1236
|
state: "queued" | "running";
|
|
1141
1237
|
currentPhaseId?: string;
|
|
1238
|
+
interactions?: readonly RunInteraction[];
|
|
1142
1239
|
}> | Readonly<{
|
|
1143
1240
|
state: "input_required";
|
|
1144
1241
|
interactions: readonly RunInteraction[];
|
|
@@ -1235,6 +1332,8 @@ interface OwnedStore {
|
|
|
1235
1332
|
agentId: AgentId;
|
|
1236
1333
|
input: UserInput;
|
|
1237
1334
|
metadata?: Metadata;
|
|
1335
|
+
scope?: ScopeRef;
|
|
1336
|
+
cwd?: string;
|
|
1238
1337
|
phasePayload?: JsonValue;
|
|
1239
1338
|
entryPhases?: readonly EntryPhaseSpec[];
|
|
1240
1339
|
pinnedConfigToken?: ConfigToken;
|
|
@@ -1300,6 +1399,11 @@ interface OwnedStore {
|
|
|
1300
1399
|
args: JsonValue;
|
|
1301
1400
|
toolCallId?: ToolCallId;
|
|
1302
1401
|
providerToolCallId?: string;
|
|
1402
|
+
title?: string;
|
|
1403
|
+
kind?: ToolKind;
|
|
1404
|
+
locations?: ToolCallLocation[];
|
|
1405
|
+
content?: ToolCallContent[];
|
|
1406
|
+
_meta?: JsonObject;
|
|
1303
1407
|
}): Promise<ToolCommit>;
|
|
1304
1408
|
reserveToolCalls(input: {
|
|
1305
1409
|
runId: RunId;
|
|
@@ -1315,6 +1419,11 @@ interface OwnedStore {
|
|
|
1315
1419
|
execution: ExecutionToken;
|
|
1316
1420
|
expectedRevision: number;
|
|
1317
1421
|
toolCallId: ToolCallId;
|
|
1422
|
+
title?: string;
|
|
1423
|
+
kind?: ToolKind;
|
|
1424
|
+
locations?: ToolCallLocation[];
|
|
1425
|
+
content?: ToolCallContent[];
|
|
1426
|
+
_meta?: JsonObject;
|
|
1318
1427
|
}): Promise<ToolCommit>;
|
|
1319
1428
|
suspendToolCall(input: {
|
|
1320
1429
|
runId: RunId;
|
|
@@ -1330,6 +1439,12 @@ interface OwnedStore {
|
|
|
1330
1439
|
result: ToolExecutionResult;
|
|
1331
1440
|
state: "completed" | "failed" | "indeterminate";
|
|
1332
1441
|
reason?: string;
|
|
1442
|
+
title?: string;
|
|
1443
|
+
kind?: ToolKind;
|
|
1444
|
+
content?: ToolCallContent[];
|
|
1445
|
+
locations?: ToolCallLocation[];
|
|
1446
|
+
rawOutput?: JsonValue;
|
|
1447
|
+
_meta?: JsonObject;
|
|
1333
1448
|
}): Promise<ToolCommit>;
|
|
1334
1449
|
cancelRun(input: {
|
|
1335
1450
|
runId: RunId;
|
|
@@ -1337,6 +1452,12 @@ interface OwnedStore {
|
|
|
1337
1452
|
reason?: string;
|
|
1338
1453
|
output?: AssistantMessage;
|
|
1339
1454
|
}): Promise<RunRecord>;
|
|
1455
|
+
recordToolCall(input: {
|
|
1456
|
+
runId: RunId;
|
|
1457
|
+
execution?: ExecutionToken;
|
|
1458
|
+
update: ToolCall$1 | ToolCallUpdate;
|
|
1459
|
+
external?: boolean;
|
|
1460
|
+
}): Promise<DurableRunEvent>;
|
|
1340
1461
|
snapshotRun(runId: RunId): Promise<RunSnapshot>;
|
|
1341
1462
|
history(agentId: AgentId): Promise<readonly Message[]>;
|
|
1342
1463
|
listAgents(): Promise<readonly AgentRecord[]>;
|
|
@@ -1428,6 +1549,8 @@ interface AgentRuntime$1 {
|
|
|
1428
1549
|
start(agentId: AgentId, input: UserInput, options: {
|
|
1429
1550
|
idempotencyKey: string;
|
|
1430
1551
|
metadata?: Metadata;
|
|
1552
|
+
scope?: ScopeRef;
|
|
1553
|
+
cwd?: string;
|
|
1431
1554
|
phasePayload?: JsonValue;
|
|
1432
1555
|
entryPhases?: ReadonlyArray<EntryPhaseSpec>;
|
|
1433
1556
|
}): Promise<AgentRun>;
|
|
@@ -1463,6 +1586,13 @@ interface AgentRuntime$1 {
|
|
|
1463
1586
|
}): Promise<DurableConsumer>;
|
|
1464
1587
|
listCapabilities(): readonly ExtensionCapability[];
|
|
1465
1588
|
onCapabilitiesChanged(listener: (capabilities: readonly ExtensionCapability[]) => void): () => void;
|
|
1589
|
+
listHostContributions(): readonly HostContribution[];
|
|
1590
|
+
onHostContributionsChanged(listener: (contributions: readonly HostContribution[]) => void): () => void;
|
|
1591
|
+
triggerUiAction(event: {
|
|
1592
|
+
contributionId: string;
|
|
1593
|
+
actionId: string;
|
|
1594
|
+
scope?: ScopeRef;
|
|
1595
|
+
}): void;
|
|
1466
1596
|
close(): Promise<void>;
|
|
1467
1597
|
}
|
|
1468
1598
|
type ConsumerRegistration = Readonly<{
|
|
@@ -1565,7 +1695,7 @@ type RunInteractionDriver = Readonly<{
|
|
|
1565
1695
|
}>;
|
|
1566
1696
|
declare class RunInteractionCancelledError extends Error {
|
|
1567
1697
|
readonly code: "run_interaction_cancelled";
|
|
1568
|
-
constructor();
|
|
1698
|
+
constructor(message?: string);
|
|
1569
1699
|
}
|
|
1570
1700
|
declare class RunInteractionBoundary extends Error {
|
|
1571
1701
|
readonly state: ExecutionState;
|
|
@@ -1620,10 +1750,20 @@ type ToolUseContent = Readonly<{
|
|
|
1620
1750
|
type ToolExecutionResult = Readonly<{
|
|
1621
1751
|
ok: true;
|
|
1622
1752
|
content: JsonValue;
|
|
1753
|
+
structuredContent?: JsonValue;
|
|
1754
|
+
isError?: boolean;
|
|
1623
1755
|
}> | Readonly<{
|
|
1624
1756
|
ok: false;
|
|
1625
1757
|
content: JsonValue;
|
|
1626
1758
|
error: string;
|
|
1759
|
+
structuredContent?: JsonValue;
|
|
1760
|
+
isError?: boolean;
|
|
1761
|
+
}> | Readonly<{
|
|
1762
|
+
content: readonly ContentBlock[];
|
|
1763
|
+
structuredContent?: JsonValue;
|
|
1764
|
+
isError?: boolean;
|
|
1765
|
+
ok?: boolean;
|
|
1766
|
+
error?: string;
|
|
1627
1767
|
}>;
|
|
1628
1768
|
type DurableToolResult = Readonly<{
|
|
1629
1769
|
toolCallId: ToolCallId;
|
|
@@ -1729,43 +1869,24 @@ type QueuedRunFailure = Extract<RunFailure, {
|
|
|
1729
1869
|
type RunningRunFailure = Extract<RunFailure, {
|
|
1730
1870
|
code: "runtime_interrupted" | "tool_indeterminate" | "execution_failed";
|
|
1731
1871
|
}>;
|
|
1732
|
-
type ToolCallState =
|
|
1733
|
-
type
|
|
1872
|
+
type ToolCallState = ToolCallStatus;
|
|
1873
|
+
type ToolCallSnapshot = ToolCall$1 & Readonly<{
|
|
1734
1874
|
id: ToolCallId;
|
|
1735
|
-
providerToolCallId
|
|
1736
|
-
agentId
|
|
1737
|
-
runId
|
|
1738
|
-
executionId
|
|
1739
|
-
requestMessageId
|
|
1740
|
-
name
|
|
1741
|
-
args
|
|
1742
|
-
|
|
1743
|
-
|
|
1875
|
+
providerToolCallId?: string;
|
|
1876
|
+
agentId?: AgentId;
|
|
1877
|
+
runId?: RunId;
|
|
1878
|
+
executionId?: ExecutionId;
|
|
1879
|
+
requestMessageId?: MessageId;
|
|
1880
|
+
name?: string;
|
|
1881
|
+
args?: JsonValue;
|
|
1882
|
+
state?: ToolCallStatus;
|
|
1883
|
+
result?: DurableToolResult;
|
|
1884
|
+
resultMessageId?: MessageId;
|
|
1885
|
+
reason?: string;
|
|
1886
|
+
external?: boolean;
|
|
1887
|
+
createdAt?: string;
|
|
1888
|
+
updatedAt?: string;
|
|
1744
1889
|
}>;
|
|
1745
|
-
type ToolCallSnapshot = ToolCallSnapshotBase & (Readonly<{
|
|
1746
|
-
state: "pending";
|
|
1747
|
-
}> | Readonly<{
|
|
1748
|
-
state: "running";
|
|
1749
|
-
}> | Readonly<{
|
|
1750
|
-
state: "completed";
|
|
1751
|
-
result: DurableToolResult & Readonly<{
|
|
1752
|
-
ok: true;
|
|
1753
|
-
}>;
|
|
1754
|
-
resultMessageId: MessageId;
|
|
1755
|
-
}> | Readonly<{
|
|
1756
|
-
state: "failed";
|
|
1757
|
-
result: DurableToolResult & Readonly<{
|
|
1758
|
-
ok: false;
|
|
1759
|
-
}>;
|
|
1760
|
-
resultMessageId: MessageId;
|
|
1761
|
-
}> | Readonly<{
|
|
1762
|
-
state: "indeterminate";
|
|
1763
|
-
result: DurableToolResult & Readonly<{
|
|
1764
|
-
ok: false;
|
|
1765
|
-
}>;
|
|
1766
|
-
resultMessageId: MessageId;
|
|
1767
|
-
reason: string;
|
|
1768
|
-
}>);
|
|
1769
1890
|
type DurableEventBase = Readonly<{
|
|
1770
1891
|
id: EventId;
|
|
1771
1892
|
schemaVersion: 1;
|
|
@@ -1837,80 +1958,29 @@ type RunStateChanged = DurableEventBase & (Readonly<{
|
|
|
1837
1958
|
to: "cancelled";
|
|
1838
1959
|
reason?: string;
|
|
1839
1960
|
}>);
|
|
1840
|
-
type ToolStateChanged = DurableEventBase &
|
|
1841
|
-
kind: "tool_state_changed";
|
|
1842
|
-
transition: Readonly<{
|
|
1843
|
-
from: null;
|
|
1844
|
-
to: "pending";
|
|
1845
|
-
}>;
|
|
1846
|
-
toolCall: Extract<ToolCallSnapshot, {
|
|
1847
|
-
state: "pending";
|
|
1848
|
-
}>;
|
|
1849
|
-
}> | Readonly<{
|
|
1850
|
-
kind: "tool_state_changed";
|
|
1851
|
-
transition: Readonly<{
|
|
1852
|
-
from: "pending";
|
|
1853
|
-
to: "running";
|
|
1854
|
-
}>;
|
|
1855
|
-
toolCall: Extract<ToolCallSnapshot, {
|
|
1856
|
-
state: "running";
|
|
1857
|
-
}>;
|
|
1858
|
-
}> | Readonly<{
|
|
1961
|
+
type ToolStateChanged = (DurableEventBase & Readonly<{
|
|
1859
1962
|
kind: "tool_state_changed";
|
|
1860
1963
|
transition: Readonly<{
|
|
1861
|
-
from:
|
|
1862
|
-
to:
|
|
1863
|
-
}>;
|
|
1864
|
-
toolCall: Extract<ToolCallSnapshot, {
|
|
1865
|
-
state: "failed";
|
|
1964
|
+
from: ToolCallStatus | null;
|
|
1965
|
+
to: ToolCallStatus;
|
|
1866
1966
|
}>;
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
from: "running";
|
|
1871
|
-
to: "pending";
|
|
1872
|
-
}>;
|
|
1873
|
-
toolCall: Extract<ToolCallSnapshot, {
|
|
1874
|
-
state: "pending";
|
|
1875
|
-
}>;
|
|
1876
|
-
}> | Readonly<{
|
|
1877
|
-
kind: "tool_state_changed";
|
|
1878
|
-
transition: Readonly<{
|
|
1879
|
-
from: "running";
|
|
1880
|
-
to: "pending";
|
|
1881
|
-
}>;
|
|
1882
|
-
toolCall: Extract<ToolCallSnapshot, {
|
|
1883
|
-
state: "pending";
|
|
1884
|
-
}>;
|
|
1885
|
-
}> | Readonly<{
|
|
1886
|
-
kind: "tool_state_changed";
|
|
1887
|
-
transition: Readonly<{
|
|
1888
|
-
from: "running";
|
|
1889
|
-
to: "completed";
|
|
1890
|
-
}>;
|
|
1891
|
-
toolCall: Extract<ToolCallSnapshot, {
|
|
1892
|
-
state: "completed";
|
|
1893
|
-
}>;
|
|
1894
|
-
}> | Readonly<{
|
|
1895
|
-
kind: "tool_state_changed";
|
|
1896
|
-
transition: Readonly<{
|
|
1897
|
-
from: "running";
|
|
1898
|
-
to: "failed";
|
|
1899
|
-
}>;
|
|
1900
|
-
toolCall: Extract<ToolCallSnapshot, {
|
|
1901
|
-
state: "failed";
|
|
1902
|
-
}>;
|
|
1903
|
-
}> | Readonly<{
|
|
1967
|
+
toolCall: ToolCall$1;
|
|
1968
|
+
external?: boolean;
|
|
1969
|
+
}>) | Readonly<{
|
|
1904
1970
|
kind: "tool_state_changed";
|
|
1971
|
+
durability: "transient";
|
|
1972
|
+
runId: RunId;
|
|
1973
|
+
executionId?: ExecutionId;
|
|
1905
1974
|
transition: Readonly<{
|
|
1906
|
-
from:
|
|
1907
|
-
to:
|
|
1908
|
-
}>;
|
|
1909
|
-
toolCall: Extract<ToolCallSnapshot, {
|
|
1910
|
-
state: "indeterminate";
|
|
1975
|
+
from: ToolCallStatus | null;
|
|
1976
|
+
to: ToolCallStatus;
|
|
1911
1977
|
}>;
|
|
1912
|
-
|
|
1913
|
-
|
|
1978
|
+
toolCall: ToolCall$1 | ToolCallUpdate;
|
|
1979
|
+
external?: boolean;
|
|
1980
|
+
}>;
|
|
1981
|
+
type DurableRunEvent = PhaseEntered | MessageCommitted | MessageRevised | RunStateChanged | Extract<ToolStateChanged, {
|
|
1982
|
+
durability: "durable";
|
|
1983
|
+
}>;
|
|
1914
1984
|
type MessageDelta = Readonly<{
|
|
1915
1985
|
kind: "message_delta";
|
|
1916
1986
|
durability: "transient";
|
|
@@ -1941,14 +2011,6 @@ type ToolCallDelta = Readonly<{
|
|
|
1941
2011
|
arguments: string;
|
|
1942
2012
|
args: JsonValue | undefined;
|
|
1943
2013
|
}>;
|
|
1944
|
-
type ToolProgress = Readonly<{
|
|
1945
|
-
kind: "tool_progress";
|
|
1946
|
-
durability: "transient";
|
|
1947
|
-
runId: RunId;
|
|
1948
|
-
executionId: ExecutionId;
|
|
1949
|
-
toolCallId: ToolCallId;
|
|
1950
|
-
progress: JsonValue;
|
|
1951
|
-
}>;
|
|
1952
2014
|
type PhaseStatusEvent = Readonly<{
|
|
1953
2015
|
kind: "phase_status";
|
|
1954
2016
|
durability: "transient";
|
|
@@ -1967,7 +2029,9 @@ type ModelRetry = Readonly<{
|
|
|
1967
2029
|
delayMs: number;
|
|
1968
2030
|
error: string;
|
|
1969
2031
|
}>;
|
|
1970
|
-
type RunEvent = DurableRunEvent | MessageDelta | ThinkingDelta | ToolCallDelta |
|
|
2032
|
+
type RunEvent = DurableRunEvent | MessageDelta | ThinkingDelta | ToolCallDelta | PhaseStatusEvent | ModelRetry | Extract<ToolStateChanged, {
|
|
2033
|
+
durability: "transient";
|
|
2034
|
+
}>;
|
|
1971
2035
|
|
|
1972
2036
|
type PhaseStatusState = "running" | "completed";
|
|
1973
2037
|
/** Normalized status event exposed to Runtime consumers. */
|
|
@@ -2029,6 +2093,8 @@ type PhaseExecutionIdentity = Readonly<{
|
|
|
2029
2093
|
/** Opaque metadata captured at the durable boundary; Rowan does not decode it. */
|
|
2030
2094
|
agentMetadata?: Readonly<Record<string, unknown>>;
|
|
2031
2095
|
runMetadata?: Readonly<Record<string, unknown>>;
|
|
2096
|
+
scope?: _rowan_agent_models.ScopeRef;
|
|
2097
|
+
cwd?: string;
|
|
2032
2098
|
}>;
|
|
2033
2099
|
/** Everything a phase needs to execute */
|
|
2034
2100
|
interface PhaseContext {
|
|
@@ -2051,24 +2117,24 @@ interface PhaseContext {
|
|
|
2051
2117
|
}
|
|
2052
2118
|
/** JSON-safe structural defaults declared by a Phase's `input` mapping. */
|
|
2053
2119
|
type PhaseInput = Readonly<Record<string, JsonValue>>;
|
|
2054
|
-
/** JSON-safe option metadata exposed
|
|
2055
|
-
interface
|
|
2120
|
+
/** JSON-safe option metadata exposed to a host Settings surface. */
|
|
2121
|
+
interface SettingsOption {
|
|
2056
2122
|
value: string;
|
|
2057
2123
|
label: string;
|
|
2058
2124
|
description?: string;
|
|
2059
2125
|
disabled?: boolean;
|
|
2060
2126
|
}
|
|
2061
|
-
interface
|
|
2127
|
+
interface SettingsBadge {
|
|
2062
2128
|
label: string;
|
|
2063
2129
|
tone?: "neutral" | "success" | "review" | "danger";
|
|
2064
2130
|
}
|
|
2065
|
-
interface
|
|
2131
|
+
interface SettingsItem {
|
|
2066
2132
|
id: string;
|
|
2067
2133
|
title: string;
|
|
2068
2134
|
description?: string;
|
|
2069
|
-
badges?: readonly
|
|
2135
|
+
badges?: readonly SettingsBadge[];
|
|
2070
2136
|
}
|
|
2071
|
-
type
|
|
2137
|
+
type SettingsControl = {
|
|
2072
2138
|
type: "boolean";
|
|
2073
2139
|
path: string;
|
|
2074
2140
|
label: string;
|
|
@@ -2088,7 +2154,7 @@ type PhaseSettingsControl = {
|
|
|
2088
2154
|
path: string;
|
|
2089
2155
|
label: string;
|
|
2090
2156
|
description?: string;
|
|
2091
|
-
options: readonly
|
|
2157
|
+
options: readonly SettingsOption[];
|
|
2092
2158
|
} | {
|
|
2093
2159
|
type: "text";
|
|
2094
2160
|
path: string;
|
|
@@ -2102,32 +2168,26 @@ type PhaseSettingsControl = {
|
|
|
2102
2168
|
path: string;
|
|
2103
2169
|
label: string;
|
|
2104
2170
|
description?: string;
|
|
2105
|
-
items: readonly
|
|
2106
|
-
fields: readonly
|
|
2171
|
+
items: readonly SettingsItem[];
|
|
2172
|
+
fields: readonly SettingsControl[];
|
|
2107
2173
|
add?: {
|
|
2108
2174
|
label: string;
|
|
2109
2175
|
idLabel?: string;
|
|
2110
|
-
fields: readonly
|
|
2176
|
+
fields: readonly SettingsControl[];
|
|
2111
2177
|
};
|
|
2112
2178
|
removeLabel?: string;
|
|
2113
2179
|
};
|
|
2114
|
-
interface
|
|
2180
|
+
interface SettingsSection {
|
|
2115
2181
|
id: string;
|
|
2116
2182
|
title: string;
|
|
2117
2183
|
description?: string;
|
|
2118
|
-
controls: readonly
|
|
2184
|
+
controls: readonly SettingsControl[];
|
|
2119
2185
|
}
|
|
2120
|
-
/** Declarative, host-neutral Settings surface
|
|
2121
|
-
interface
|
|
2186
|
+
/** Declarative, host-neutral Settings surface. */
|
|
2187
|
+
interface SettingsDefinition {
|
|
2122
2188
|
description?: string;
|
|
2123
|
-
sections: readonly
|
|
2189
|
+
sections: readonly SettingsSection[];
|
|
2124
2190
|
}
|
|
2125
|
-
/** Host context is intentionally opaque beyond the effective configuration. */
|
|
2126
|
-
interface PhaseSettingsContext {
|
|
2127
|
-
configuration: Readonly<Record<string, unknown>>;
|
|
2128
|
-
metadata?: Readonly<Record<string, unknown>>;
|
|
2129
|
-
}
|
|
2130
|
-
type PhaseSettingsProvider = (context: PhaseSettingsContext) => PhaseSettingsDefinition | Promise<PhaseSettingsDefinition>;
|
|
2131
2191
|
/**
|
|
2132
2192
|
* Loaded Phase object
|
|
2133
2193
|
*/
|
|
@@ -2293,6 +2353,7 @@ type Tool<TArgs = unknown> = {
|
|
|
2293
2353
|
promptGuidelines?: string[];
|
|
2294
2354
|
/** Whether this tool can run concurrently with others. Default: "parallel". */
|
|
2295
2355
|
executionMode?: ToolExecutionMode;
|
|
2356
|
+
_meta?: JsonObject$1;
|
|
2296
2357
|
execute(args: TArgs, context: ToolContext, signal?: AbortSignal): Promise<ToolResult>;
|
|
2297
2358
|
};
|
|
2298
2359
|
/** Context snapshot passed into the low-level agent loop. */
|
|
@@ -2307,6 +2368,7 @@ type AgentContext = {
|
|
|
2307
2368
|
skills: Skill[];
|
|
2308
2369
|
/** Custom phases for this run. Agent normalizes this with the built-in default phase. */
|
|
2309
2370
|
phases?: PhaseRegistry;
|
|
2371
|
+
cwd?: string;
|
|
2310
2372
|
};
|
|
2311
2373
|
|
|
2312
2374
|
/**
|
|
@@ -2339,6 +2401,7 @@ declare class AgentRuntime implements AgentRuntime$1 {
|
|
|
2339
2401
|
readonly host: ExtensionHost;
|
|
2340
2402
|
private readonly resources;
|
|
2341
2403
|
private readonly startedRuns;
|
|
2404
|
+
private readonly liveInteractions;
|
|
2342
2405
|
private heartbeat?;
|
|
2343
2406
|
private pumping;
|
|
2344
2407
|
private closed;
|
|
@@ -2394,6 +2457,8 @@ declare class AgentRuntime implements AgentRuntime$1 {
|
|
|
2394
2457
|
start(agentId: AgentId, input: UserInput, options: {
|
|
2395
2458
|
idempotencyKey: string;
|
|
2396
2459
|
metadata?: Metadata;
|
|
2460
|
+
scope?: ScopeRef;
|
|
2461
|
+
cwd?: string;
|
|
2397
2462
|
phasePayload?: JsonValue;
|
|
2398
2463
|
entryPhases?: ReadonlyArray<EntryPhaseSpec>;
|
|
2399
2464
|
}): Promise<AgentRun>;
|
|
@@ -2420,6 +2485,14 @@ declare class AgentRuntime implements AgentRuntime$1 {
|
|
|
2420
2485
|
}): Promise<DurableConsumer>;
|
|
2421
2486
|
listCapabilities(): readonly ExtensionCapability[];
|
|
2422
2487
|
onCapabilitiesChanged(listener: (capabilities: readonly ExtensionCapability[]) => void): () => void;
|
|
2488
|
+
listHostContributions(): readonly HostContribution[];
|
|
2489
|
+
onHostContributionsChanged(listener: (contributions: readonly HostContribution[]) => void): () => void;
|
|
2490
|
+
triggerUiAction(event: {
|
|
2491
|
+
contributionId: string;
|
|
2492
|
+
actionId: string;
|
|
2493
|
+
scope?: ScopeRef;
|
|
2494
|
+
}): void;
|
|
2495
|
+
private liveInteract;
|
|
2423
2496
|
close(): Promise<void>;
|
|
2424
2497
|
snapshot(runId: RunId): Promise<RunSnapshot>;
|
|
2425
2498
|
history(agentId: AgentId): Promise<readonly Message[]>;
|
|
@@ -2435,6 +2508,7 @@ declare class AgentRuntime implements AgentRuntime$1 {
|
|
|
2435
2508
|
private resolveContextWindow;
|
|
2436
2509
|
private executeTool;
|
|
2437
2510
|
private executeToolBatch;
|
|
2511
|
+
private executeAndCommitTool;
|
|
2438
2512
|
private foldToolInteractionRecords;
|
|
2439
2513
|
private requireAgent;
|
|
2440
2514
|
private archiveDirFor;
|
|
@@ -2460,14 +2534,24 @@ type StoredAgent = Mutable<AgentRecord>;
|
|
|
2460
2534
|
type StoredRun = Mutable<RunRecord>;
|
|
2461
2535
|
type StoredToolCall = {
|
|
2462
2536
|
id: ToolCallId;
|
|
2463
|
-
providerToolCallId
|
|
2537
|
+
providerToolCallId?: string;
|
|
2464
2538
|
agentId: AgentId;
|
|
2465
2539
|
runId: RunId;
|
|
2466
|
-
executionId
|
|
2467
|
-
requestMessageId
|
|
2468
|
-
name
|
|
2469
|
-
args
|
|
2470
|
-
state
|
|
2540
|
+
executionId?: ExecutionId;
|
|
2541
|
+
requestMessageId?: MessageId;
|
|
2542
|
+
name?: string;
|
|
2543
|
+
args?: JsonValue;
|
|
2544
|
+
state?: ToolCallState;
|
|
2545
|
+
toolCallId: string;
|
|
2546
|
+
title: string;
|
|
2547
|
+
kind: ToolKind;
|
|
2548
|
+
status: ToolCallStatus;
|
|
2549
|
+
content?: ToolCallContent[];
|
|
2550
|
+
locations?: ToolCallLocation[];
|
|
2551
|
+
rawInput?: JsonValue;
|
|
2552
|
+
rawOutput?: JsonValue;
|
|
2553
|
+
_meta?: JsonObject;
|
|
2554
|
+
external?: boolean;
|
|
2471
2555
|
result?: DurableToolResult;
|
|
2472
2556
|
resultMessageId?: MessageId;
|
|
2473
2557
|
reason?: string;
|
|
@@ -2586,6 +2670,8 @@ declare class InMemoryStore implements DurableStore {
|
|
|
2586
2670
|
agentId: AgentId;
|
|
2587
2671
|
input: UserInput;
|
|
2588
2672
|
metadata?: Metadata;
|
|
2673
|
+
scope?: ScopeRef;
|
|
2674
|
+
cwd?: string;
|
|
2589
2675
|
phasePayload?: JsonValue;
|
|
2590
2676
|
entryPhases?: readonly EntryPhaseSpec[];
|
|
2591
2677
|
pinnedConfigToken?: ConfigToken;
|
|
@@ -2661,6 +2747,11 @@ declare class InMemoryStore implements DurableStore {
|
|
|
2661
2747
|
execution: ExecutionToken;
|
|
2662
2748
|
expectedRevision: number;
|
|
2663
2749
|
toolCallId: ToolCallId;
|
|
2750
|
+
title?: string;
|
|
2751
|
+
kind?: ToolKind;
|
|
2752
|
+
locations?: ToolCallLocation[];
|
|
2753
|
+
content?: ToolCallContent[];
|
|
2754
|
+
_meta?: JsonObject;
|
|
2664
2755
|
}): ToolCommit;
|
|
2665
2756
|
suspendToolCall(lease: OwnerLease, input: {
|
|
2666
2757
|
runId: RunId;
|
|
@@ -2676,6 +2767,12 @@ declare class InMemoryStore implements DurableStore {
|
|
|
2676
2767
|
result: ToolExecutionResult;
|
|
2677
2768
|
state: "completed" | "failed" | "indeterminate";
|
|
2678
2769
|
reason?: string;
|
|
2770
|
+
title?: string;
|
|
2771
|
+
kind?: ToolKind;
|
|
2772
|
+
content?: ToolCallContent[];
|
|
2773
|
+
locations?: ToolCallLocation[];
|
|
2774
|
+
rawOutput?: JsonValue;
|
|
2775
|
+
_meta?: JsonObject;
|
|
2679
2776
|
}): ToolCommit;
|
|
2680
2777
|
commitOutcome(lease: OwnerLease, input: {
|
|
2681
2778
|
runId: RunId;
|
|
@@ -2691,6 +2788,12 @@ declare class InMemoryStore implements DurableStore {
|
|
|
2691
2788
|
reason?: string;
|
|
2692
2789
|
output?: AssistantMessage;
|
|
2693
2790
|
}): RunRecord;
|
|
2791
|
+
recordToolCall(lease: OwnerLease, input: {
|
|
2792
|
+
runId: RunId;
|
|
2793
|
+
execution?: ExecutionToken;
|
|
2794
|
+
update: ToolCall$1 | ToolCallUpdate;
|
|
2795
|
+
external?: boolean;
|
|
2796
|
+
}): DurableRunEvent;
|
|
2694
2797
|
snapshotRun(lease: OwnerLease, runId: RunId): RunSnapshot;
|
|
2695
2798
|
listAgents(lease: OwnerLease): readonly AgentRecord[];
|
|
2696
2799
|
listRuns(lease: OwnerLease, input?: {
|
|
@@ -2817,6 +2920,8 @@ declare class SqliteStore implements DurableStore {
|
|
|
2817
2920
|
agentId: AgentId;
|
|
2818
2921
|
input: UserInput;
|
|
2819
2922
|
metadata?: Metadata;
|
|
2923
|
+
scope?: ScopeRef;
|
|
2924
|
+
cwd?: string;
|
|
2820
2925
|
phasePayload?: JsonValue;
|
|
2821
2926
|
entryPhases?: readonly EntryPhaseSpec[];
|
|
2822
2927
|
pinnedConfigToken?: ConfigToken;
|
|
@@ -2884,18 +2989,18 @@ declare class SqliteStore implements DurableStore {
|
|
|
2884
2989
|
args: JsonValue;
|
|
2885
2990
|
toolCallId?: ToolCallId;
|
|
2886
2991
|
providerToolCallId?: string;
|
|
2992
|
+
title?: string;
|
|
2993
|
+
kind?: ToolKind;
|
|
2994
|
+
locations?: ToolCallLocation[];
|
|
2995
|
+
content?: ToolCallContent[];
|
|
2996
|
+
_meta?: JsonObject;
|
|
2887
2997
|
}): Promise<ToolCommit>;
|
|
2888
2998
|
reserveToolCalls(lease: OwnerLease, input: {
|
|
2889
2999
|
runId: RunId;
|
|
2890
3000
|
execution: ExecutionToken;
|
|
2891
3001
|
expectedRevision: number;
|
|
2892
3002
|
requestMessageId: MessageId;
|
|
2893
|
-
calls: readonly
|
|
2894
|
-
providerToolCallId: string;
|
|
2895
|
-
name: string;
|
|
2896
|
-
args: JsonValue;
|
|
2897
|
-
toolCallId?: ToolCallId;
|
|
2898
|
-
}>[];
|
|
3003
|
+
calls: readonly ToolCallReservation[];
|
|
2899
3004
|
contentBlocks?: readonly ContentBlock[];
|
|
2900
3005
|
}): Promise<ToolBatchCommit>;
|
|
2901
3006
|
startToolCall(lease: OwnerLease, input: {
|
|
@@ -2903,6 +3008,11 @@ declare class SqliteStore implements DurableStore {
|
|
|
2903
3008
|
execution: ExecutionToken;
|
|
2904
3009
|
expectedRevision: number;
|
|
2905
3010
|
toolCallId: ToolCallId;
|
|
3011
|
+
title?: string;
|
|
3012
|
+
kind?: ToolKind;
|
|
3013
|
+
locations?: ToolCallLocation[];
|
|
3014
|
+
content?: ToolCallContent[];
|
|
3015
|
+
_meta?: JsonObject;
|
|
2906
3016
|
}): Promise<ToolCommit>;
|
|
2907
3017
|
suspendToolCall(lease: OwnerLease, input: {
|
|
2908
3018
|
runId: RunId;
|
|
@@ -2918,6 +3028,12 @@ declare class SqliteStore implements DurableStore {
|
|
|
2918
3028
|
result: ToolExecutionResult;
|
|
2919
3029
|
state: "completed" | "failed" | "indeterminate";
|
|
2920
3030
|
reason?: string;
|
|
3031
|
+
title?: string;
|
|
3032
|
+
kind?: ToolKind;
|
|
3033
|
+
content?: ToolCallContent[];
|
|
3034
|
+
locations?: ToolCallLocation[];
|
|
3035
|
+
rawOutput?: JsonValue;
|
|
3036
|
+
_meta?: JsonObject;
|
|
2921
3037
|
}): Promise<ToolCommit>;
|
|
2922
3038
|
cancelRun(lease: OwnerLease, input: {
|
|
2923
3039
|
runId: RunId;
|
|
@@ -2925,6 +3041,12 @@ declare class SqliteStore implements DurableStore {
|
|
|
2925
3041
|
reason?: string;
|
|
2926
3042
|
output?: AssistantMessage;
|
|
2927
3043
|
}): Promise<RunRecord>;
|
|
3044
|
+
recordToolCall(lease: OwnerLease, input: {
|
|
3045
|
+
runId: RunId;
|
|
3046
|
+
execution?: ExecutionToken;
|
|
3047
|
+
update: ToolCall$1 | ToolCallUpdate;
|
|
3048
|
+
external?: boolean;
|
|
3049
|
+
}): Promise<DurableRunEvent>;
|
|
2928
3050
|
snapshotRun(lease: OwnerLease, runId: RunId): Promise<RunSnapshot>;
|
|
2929
3051
|
history(lease: OwnerLease, agentId: AgentId): Promise<readonly Message[]>;
|
|
2930
3052
|
listAgents(lease: OwnerLease): Promise<readonly AgentRecord[]>;
|
|
@@ -3117,12 +3239,6 @@ declare function loadSkills(targetPath: string): Promise<Skill[]>;
|
|
|
3117
3239
|
* If a directory is provided, the loader reads its PHASE.md.
|
|
3118
3240
|
*/
|
|
3119
3241
|
declare function loadPhase(targetPath: string): Promise<Phase>;
|
|
3120
|
-
/**
|
|
3121
|
-
* Collect and evaluate the Settings provider registered through the Phase's
|
|
3122
|
-
* ExtensionAPI namespace. Settings discovery never reads a direct module
|
|
3123
|
-
* export; the Phase contributes through `api.phase.settings.register()`.
|
|
3124
|
-
*/
|
|
3125
|
-
declare function loadPhaseSettings(phase: Phase, context: PhaseSettingsContext): Promise<PhaseSettingsDefinition | undefined>;
|
|
3126
3242
|
/**
|
|
3127
3243
|
* Load all phases from the target directory.
|
|
3128
3244
|
*
|
|
@@ -3176,4 +3292,4 @@ declare function parseFrontmatter<T = Record<string, unknown>>(raw: string): Fro
|
|
|
3176
3292
|
|
|
3177
3293
|
declare function createCoreTools(input?: CoreToolContext): Tool$1[];
|
|
3178
3294
|
|
|
3179
|
-
export { type AfterToolCall, type AgentConfiguration, type AgentDefinition, type AgentId, type AgentListCursor, type AgentRecord, type AgentRun, AgentRuntime, type AgentRuntimeOptions, type AgentSummary, type AnyRuntimeError, type AssistantContent, type AssistantMessage, type BeforeToolCall, COMPACT_PHASE_ID, type ConfigProvider, type ConfigPutResult, type ConfigResolution, type ConfigToken, type ConfigurationSnapshot, type ContextCandidate, type ContextCompactionRecord, type ContextStatus, type CoreToolContext, DEFAULT_PHASE_ID, type DefinitionLayer, type DurableConsumer, type DurableRunEvent, type DurableStore, type DurableToolResult, type EntryPhaseSpec, type EventCursor, type EventId, type ExecutionCheckpoint, type ExecutionId, type ExecutionToken, type ExtensionAPI, type ExtensionActivationError, type ExtensionActivationResult, type ExtensionCapability, type ExtensionCapabilityContribution, type ExtensionContribution, type ExtensionDisposer, type ExtensionFactory, type ExtensionFactoryResult, type ExtensionHost, ExtensionLifetimeError, type ExtensionLifetimeErrorCode, type ExtensionLoadInput, type ExtensionStateStore, type ExtensionToolContribution, type FrontmatterResult, type HistorySeed, type HookEvent, type HookEventType, type HookHandler, InMemoryConfigProvider, InMemoryExtensionHost, InMemoryStore, type InteractionRecord, type InvocationCatalogEntry, type InvocationSource, type JsonObject, type JsonPrimitive, type JsonValue, type LoadExtensionsResult, type LoadInput, type LoadResult, type LoadedExtension, type Message, type MessageBase, type MessageCommitted, type MessageContent, type MessageDelta, type MessageId, type MessageRevised, type MessageRevisionResult, type Metadata, type ModelRetry, type OpaqueId, type Outcome, type OwnerLease, type OwnerToken, type Page, type Phase, type PhaseContext, type PhaseContribution, type PhaseExecution, type PhaseExecutionIdentity, type PhaseInput, type PhaseInvocation, type PhaseMessageManager, type PhaseOutput, type PhaseRegistry, type PhaseRegistrySelection, type
|
|
3295
|
+
export { type AfterToolCall, type AgentConfiguration, type AgentDefinition, type AgentId, type AgentListCursor, type AgentRecord, type AgentRun, AgentRuntime, type AgentRuntimeOptions, type AgentSummary, type AnyRuntimeError, type AssistantContent, type AssistantMessage, type BeforeToolCall, COMPACT_PHASE_ID, type ConfigProvider, type ConfigPutResult, type ConfigResolution, type ConfigToken, type ConfigurationSnapshot, type ContextCandidate, type ContextCompactionRecord, type ContextStatus, type CoreToolContext, DEFAULT_PHASE_ID, type DefinitionLayer, type DurableConsumer, type DurableRunEvent, type DurableStore, type DurableToolResult, type EntryPhaseSpec, type EventCursor, type EventId, type ExecutionCheckpoint, type ExecutionId, type ExecutionToken, type ExtensionAPI, type ExtensionActivationError, type ExtensionActivationResult, type ExtensionCapability, type ExtensionCapabilityContribution, type ExtensionContribution, type ExtensionDisposer, type ExtensionFactory, type ExtensionFactoryResult, type ExtensionHost, ExtensionLifetimeError, type ExtensionLifetimeErrorCode, type ExtensionLoadInput, type ExtensionStateStore, type ExtensionToolContribution, type FrontmatterResult, type HistorySeed, type HookEvent, type HookEventType, type HookHandler, type HostContribution, InMemoryConfigProvider, InMemoryExtensionHost, InMemoryStore, type InteractionRecord, type InvocationCatalogEntry, type InvocationSource, type JsonObject, type JsonPrimitive, type JsonValue, type LoadExtensionsResult, type LoadInput, type LoadResult, type LoadedExtension, type Message, type MessageBase, type MessageCommitted, type MessageContent, type MessageDelta, type MessageId, type MessageRevised, type MessageRevisionResult, type Metadata, type ModelRetry, type OpaqueId, type Outcome, type OwnerLease, type OwnerToken, type Page, type Phase, type PhaseContext, type PhaseContribution, type PhaseExecution, type PhaseExecutionIdentity, type PhaseInput, type PhaseInvocation, type PhaseMessageManager, type PhaseOutput, type PhaseRegistry, type PhaseRegistrySelection, type PhaseState, type PhaseStatus, type PhaseStatusState, type ResolvedResourceView, type ResourceDiagnostic, type ResourceKind, type ResourceRef, ResourceRegistry, ResourceRegistryError, type ResourceRegistryErrorCode, type ResourceSourceId, type ResourceView, type RetentionResult, type RunBoundary, type RunClaim, type RunEndEvent, type RunEvent, type RunFailure, type RunId, type RunInteraction, RunInteractionBoundary, RunInteractionCancelledError, type RunInteractionDriver, type RunInteractionKind, type RunInteractionRequest, type RunInteractionState, type RunInteractionStatus, type RunListCursor, type RunRecord, type RunSnapshot, type RunStartEvent, type RunState, type RunStateChanged, type RunSummary, RuntimeBootstrapRegistry, RuntimeError, type RuntimeErrorCode, type RuntimeErrorDetails, RuntimeExtensionLifetime, STOP_PHASE_ID, type SettingsBadge, type SettingsControl, type SettingsDefinition, type SettingsItem, type SettingsOption, type SettingsSection, type Skill, SqliteStore, type TextContent, type ThinkingContent, type ThinkingDelta, type Tool$1 as Tool, type ToolCallContext, type ToolCallDelta, type ToolCallId, type ToolCallPresentationInput, type ToolCallPresentationOutput, type ToolCallSnapshot, type ToolCallState, type ToolContribution, type ToolDefinition, type ToolExecutionResult, type ToolInvocationContext, type ToolMessage, type ToolMessageContent, type ToolResultContent, type ToolStateChanged, type ToolUseContent, type UserContent, type UserInput, type UserMessage, type WithdrawnUserInput, brandConfigToken, createCompactPhase, createCorePhases, createCoreTools, createDefaultPhase, createStopPhase, isConfigurationSnapshot, isRuntimeError, loadExtensionsFromPath as loadExtensions, loadPhase, loadPhases, loadSkill, loadSkills, mergeToolCall, parseAgentDefinition, parseFrontmatter, resolveConfigurationSnapshot };
|