agent-afk 5.308.4 → 5.308.6
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/dist/agent/awareness/types.d.ts +1 -1
- package/dist/agent/background-registry.d.ts +0 -1
- package/dist/agent/background-registry.mark-terminal.d.ts +29 -0
- package/dist/agent/daemon/gates.d.ts +1 -1
- package/dist/agent/daemon/schedule-store.d.ts +5 -1
- package/dist/agent/daemon/scheduler.d.ts +2 -1
- package/dist/agent/daemon/scheduler.execute-agent-task.d.ts +3 -1
- package/dist/agent/daemon/scheduler.overlap-guard.d.ts +2 -0
- package/dist/agent/daemon/scheduler.runat-gate.d.ts +13 -0
- package/dist/agent/daemon/session-spawn.d.ts +3 -0
- package/dist/agent/daemon/triggers.d.ts +2 -0
- package/dist/agent/mcp/index.d.ts +1 -6
- package/dist/agent/memory/memory-store.schema.d.ts +0 -1
- package/dist/agent/outcomes/verification-patterns.d.ts +1 -0
- package/dist/agent/providers/anthropic-direct/query/prompt-assembly.d.ts +2 -1
- package/dist/agent/providers/index.d.ts +1 -0
- package/dist/agent/providers/openai-compatible/index.d.ts +2 -31
- package/dist/agent/providers/openai-compatible/index.options.d.ts +31 -0
- package/dist/agent/providers/openai-compatible/system-prompt-wiring.d.ts +2 -1
- package/dist/agent/providers/shared/supported-commands.d.ts +6 -1
- package/dist/agent/providers/shared/transient-retry.d.ts +1 -0
- package/dist/agent/providers/xai/oauth-http.d.ts +1 -0
- package/dist/agent/session/agent-session.executors.d.ts +12 -0
- package/dist/agent/session/create-wired-executors.d.ts +20 -0
- package/dist/agent/session/default-subagent-model.d.ts +2 -0
- package/dist/agent/session/deferred-parent-proxy.d.ts +7 -0
- package/dist/agent/session/sdk-surface-warning.d.ts +7 -0
- package/dist/agent/session/session-executors.d.ts +32 -0
- package/dist/agent/session/wire-executors.d.ts +5 -0
- package/dist/agent/session/wire-executors.scope.d.ts +10 -0
- package/dist/agent/subagent.abort-wiring.d.ts +1 -0
- package/dist/agent/subagent.drain.d.ts +11 -0
- package/dist/agent/tools/compose-executor.context.d.ts +29 -0
- package/dist/agent/tools/compose-executor.d.ts +2 -28
- package/dist/agent/tools/compose-executor.wave-manifest.d.ts +14 -0
- package/dist/agent/tools/nesting.d.ts +3 -1
- package/dist/agent/tools/skill-bridge.d.ts +2 -0
- package/dist/agent/tools/skill-executor/allowlist.d.ts +2 -0
- package/dist/agent/tools/skill-executor/types.d.ts +3 -0
- package/dist/agent/tools/skill-executor.d.ts +5 -0
- package/dist/agent/tools/subagent/child-config.d.ts +1 -0
- package/dist/agent/tools/subagent-executor/types.d.ts +2 -0
- package/dist/agent/tools/subagent-executor.d.ts +2 -2
- package/dist/agent/tools/subagent-executor.execute-once.d.ts +22 -0
- package/dist/agent/tools/subagent-executor.execute-once.helpers.d.ts +103 -0
- package/dist/agent/types/config-types.d.ts +1 -0
- package/dist/cli/commands/config-command.env.d.ts +2 -0
- package/dist/cli/commands/interactive/bootstrap-session-builder.d.ts +9 -0
- package/dist/cli/commands/marketplace.subcommands.d.ts +14 -0
- package/dist/cli/config/json-tier-parse.interactive.d.ts +4 -0
- package/dist/cli/config/json-tier-parse.telegram.d.ts +4 -0
- package/dist/cli/shared-helpers.d.ts +2 -2
- package/dist/cli/slash/_lib/run-skill-preflight.d.ts +3 -0
- package/dist/cli/slash/commands/info.mcp.d.ts +2 -0
- package/dist/cli.mjs +385 -390
- package/dist/improve/schemas.d.ts +2 -2
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +271 -185
- package/dist/telegram.mjs +200 -199
- package/dist/utils/abort.d.ts +11 -0
- package/dist/web-server/session-owner.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CompactUsageEntry } from '../usage/usage-formatter.js';
|
|
2
2
|
import type { SubagentOutcomeSummaryEntry } from '../../insights/aggregators/subagent-outcomes.js';
|
|
3
|
-
export type Surface = 'cli' | 'repl' | 'daemon' | 'telegram' | 'subagent' | 'web' | 'unknown';
|
|
3
|
+
export type Surface = 'cli' | 'repl' | 'daemon' | 'telegram' | 'subagent' | 'web' | 'sdk' | 'unknown';
|
|
4
4
|
export type PhaseRole = 'read-only' | 'read-write';
|
|
5
5
|
export type SubagentStatusLiteValue = 'idle' | 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
6
6
|
export type BgJobStatus = 'running' | 'completed' | 'failed' | 'cancelled';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { BgJobLogWriter, BgJobMeta } from './bg-job-log.js';
|
|
2
|
+
import type { SubagentResult, SubagentStatus } from './subagent.js';
|
|
3
|
+
import type { TraceSink } from './trace/index.js';
|
|
4
|
+
import type { BackgroundJobStatus } from './background-registry.types.js';
|
|
5
|
+
export interface MarkTerminalJob {
|
|
6
|
+
jobId: string;
|
|
7
|
+
subagentId: string;
|
|
8
|
+
status: BackgroundJobStatus;
|
|
9
|
+
startedAt: number;
|
|
10
|
+
endedAt?: number;
|
|
11
|
+
result?: SubagentResult;
|
|
12
|
+
provenance: 'user' | 'model';
|
|
13
|
+
parentSessionId?: string;
|
|
14
|
+
cancelSource?: 'explicit' | 'cascade';
|
|
15
|
+
modelCancelReason?: string;
|
|
16
|
+
transcriptTail: string;
|
|
17
|
+
touchedFiles: string[];
|
|
18
|
+
handle: {
|
|
19
|
+
teardown(): Promise<void>;
|
|
20
|
+
cancel(): Promise<void>;
|
|
21
|
+
};
|
|
22
|
+
settle: (r: SubagentResult) => void;
|
|
23
|
+
onCleanup?: () => Promise<void>;
|
|
24
|
+
onSettled?: () => void;
|
|
25
|
+
}
|
|
26
|
+
export declare function statusFromResult(s: SubagentStatus): BackgroundJobStatus;
|
|
27
|
+
export declare function appendTranscript(job: MarkTerminalJob, chunk: string): void;
|
|
28
|
+
export declare function recordTouched(job: MarkTerminalJob, rawInput: unknown): void;
|
|
29
|
+
export declare function markTerminalImpl(job: MarkTerminalJob, result: SubagentResult, emit: (job: MarkTerminalJob) => void, evict: (jobId: string) => void, traceWriter: TraceSink | undefined, writer?: BgJobLogWriter, openMeta?: BgJobMeta): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const DEFAULT_SESSIONSTART_COOLDOWN_MS: number;
|
|
2
|
-
export type SessionStartSkipReason = 'cooldown' | 'overlap' | 'budget-over' | 'telemetry-unwritable';
|
|
2
|
+
export type SessionStartSkipReason = 'cooldown' | 'overlap' | 'budget-over' | 'telemetry-unwritable' | 'expired' | 'not-yet';
|
|
3
3
|
export interface GateDecision {
|
|
4
4
|
fire: boolean;
|
|
5
5
|
skipReason?: SessionStartSkipReason;
|
|
@@ -12,6 +12,8 @@ export interface ScheduledTaskConfig {
|
|
|
12
12
|
notifyChat?: number | string;
|
|
13
13
|
maxAttempts?: number;
|
|
14
14
|
retryDelayMs?: number;
|
|
15
|
+
runAt?: string;
|
|
16
|
+
expiresAt?: string;
|
|
15
17
|
createdAt: string;
|
|
16
18
|
updatedAt: string;
|
|
17
19
|
}
|
|
@@ -20,8 +22,10 @@ export declare function saveSchedules(configs: ScheduledTaskConfig[], path?: str
|
|
|
20
22
|
export declare function addSchedule(config: Omit<ScheduledTaskConfig, 'id' | 'createdAt' | 'updatedAt'>, path?: string): ScheduledTaskConfig;
|
|
21
23
|
export declare function removeSchedule(id: string, path?: string): boolean;
|
|
22
24
|
export declare function getSchedule(id: string, path?: string): ScheduledTaskConfig | undefined;
|
|
23
|
-
export type SchedulePatch = Partial<Omit<ScheduledTaskConfig, 'id' | 'createdAt' | 'updatedAt' | 'cwd'>> & {
|
|
25
|
+
export type SchedulePatch = Partial<Omit<ScheduledTaskConfig, 'id' | 'createdAt' | 'updatedAt' | 'cwd' | 'runAt' | 'expiresAt'>> & {
|
|
24
26
|
cwd?: string | null;
|
|
27
|
+
runAt?: string | null;
|
|
28
|
+
expiresAt?: string | null;
|
|
25
29
|
};
|
|
26
30
|
export declare function updateSchedule(id: string, patch: SchedulePatch, path?: string): ScheduledTaskConfig | undefined;
|
|
27
31
|
export declare function toggleScheduleEnabled(id: string, enabled: boolean, path?: string): ScheduledTaskConfig | undefined;
|
|
@@ -28,7 +28,7 @@ export interface SchedulerOptions {
|
|
|
28
28
|
retrySleep?: (ms: number, signal: AbortSignal) => Promise<void>;
|
|
29
29
|
}
|
|
30
30
|
export type TelemetryTrigger = 'cron' | 'sessionstart' | 'pull';
|
|
31
|
-
type TelemetryStatus = 'success' | 'error' | 'skipped';
|
|
31
|
+
type TelemetryStatus = 'success' | 'error' | 'skipped' | 'blocked';
|
|
32
32
|
export interface TelemetryRecord {
|
|
33
33
|
taskId: string;
|
|
34
34
|
command: string;
|
|
@@ -43,6 +43,7 @@ export interface TelemetryRecord {
|
|
|
43
43
|
name?: string;
|
|
44
44
|
doneUnverified?: boolean;
|
|
45
45
|
attempts?: number;
|
|
46
|
+
gateBlocks?: number;
|
|
46
47
|
}
|
|
47
48
|
export interface TaskCompletionDetails {
|
|
48
49
|
responseText?: string;
|
|
@@ -29,7 +29,9 @@ export interface AgentTaskContext {
|
|
|
29
29
|
queueDir: string;
|
|
30
30
|
idleDetector: IdleDetector;
|
|
31
31
|
now: () => number;
|
|
32
|
-
spawnSession: (task: ScheduledTask, trigger: TelemetryTrigger
|
|
32
|
+
spawnSession: (task: ScheduledTask, trigger: TelemetryTrigger, gateBlockCounter?: {
|
|
33
|
+
count: number;
|
|
34
|
+
}) => Promise<{
|
|
33
35
|
session: AgentSession;
|
|
34
36
|
memoryStore: MemoryStore;
|
|
35
37
|
stateStore: StateStore;
|
|
@@ -6,6 +6,8 @@ export declare function makeOverlapSkipRecord(task: ScheduledTask, trigger: Tele
|
|
|
6
6
|
export declare function makeBudgetSkipRecord(task: ScheduledTask, trigger: TelemetryTrigger, nowMs: number, skip: BudgetGateSkip): TelemetryRecord;
|
|
7
7
|
export declare function makeTelemetryUnwritableSkipRecord(task: ScheduledTask, nowMs: number, errorDescription: string): TelemetryRecord;
|
|
8
8
|
export declare function makeSessionStartSkipRecord(task: ScheduledTask, decision: GateDecision, nowMs: number): TelemetryRecord;
|
|
9
|
+
export declare function makeExpiredSkipRecord(task: ScheduledTask, trigger: TelemetryTrigger, nowMs: number): TelemetryRecord;
|
|
10
|
+
export declare function makeNotYetSkipRecord(task: ScheduledTask, trigger: TelemetryTrigger, nowMs: number): TelemetryRecord;
|
|
9
11
|
export declare class OverlapAlertLatch {
|
|
10
12
|
private readonly alerted;
|
|
11
13
|
shouldAlert(taskId: string): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ScheduledTask } from './triggers.js';
|
|
2
|
+
import type { TelemetryRecord, TelemetryTrigger } from './scheduler.js';
|
|
3
|
+
export type RunAtGateResult = {
|
|
4
|
+
kind: 'pass';
|
|
5
|
+
} | {
|
|
6
|
+
kind: 'not-yet';
|
|
7
|
+
record: TelemetryRecord;
|
|
8
|
+
} | {
|
|
9
|
+
kind: 'expired';
|
|
10
|
+
record: TelemetryRecord;
|
|
11
|
+
};
|
|
12
|
+
export declare function evaluateRunAtGate(task: ScheduledTask, trigger: TelemetryTrigger, nowMs: number): RunAtGateResult;
|
|
13
|
+
export declare function applyAutoDisable(taskId: string, unregister: (id: string) => void): void;
|
|
@@ -9,6 +9,9 @@ export interface DaemonSpawnOptions {
|
|
|
9
9
|
sessionFactory?: (config: AgentConfig, ownedTraceWriter?: TraceWriter) => AgentSession;
|
|
10
10
|
trigger?: 'cron' | 'sessionstart' | 'pull';
|
|
11
11
|
taskCwd?: string;
|
|
12
|
+
gateBlockCounter?: {
|
|
13
|
+
count: number;
|
|
14
|
+
};
|
|
12
15
|
}
|
|
13
16
|
export declare function daemonTraceLabel(taskId: string): string;
|
|
14
17
|
export declare function _resetDaemonDefaultCwdCache(): void;
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
export type { McpServerConfig, McpClientState, McpClientStatus, McpTransportType, } from './types.js';
|
|
2
|
-
export { McpClient, type McpClientConnectResult } from './client.js';
|
|
3
2
|
export { McpManager, type McpManagerInitOptions } from './manager.js';
|
|
4
|
-
export { loadMcpConfig,
|
|
5
|
-
export { buildMcpToolName, isMcpToolName, buildMcpNameRegistry, sanitizeNameSegment, type McpNameRegistry, } from './naming.js';
|
|
6
|
-
export { expandEnvString, expandEnvRecord, type EnvExpansionResult } from './env.js';
|
|
7
|
-
export { createTransport, expandHeaders, type CreateTransportResult, } from './transport.js';
|
|
8
|
-
export { KeychainOAuthProvider, readOauthPending, clearOauthPending, type KeychainBackend, type OauthPendingEntry, } from './oauth.js';
|
|
3
|
+
export { loadMcpConfig, getMcpConfigPath, type LoadedMcpConfig, type LoadMcpConfigOptions, type McpConfigFile, } from './config-loader.js';
|
|
@@ -2,4 +2,3 @@ import type BetterSqlite3 from 'better-sqlite3';
|
|
|
2
2
|
export declare const SCHEMA_VERSION = 5;
|
|
3
3
|
export declare const SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS sessions (\n session_id TEXT PRIMARY KEY,\n surface TEXT NOT NULL,\n started_at TEXT NOT NULL,\n ended_at TEXT,\n summary TEXT,\n tools_used TEXT NOT NULL DEFAULT '[]',\n outcome TEXT,\n token_count INTEGER,\n cost_usd REAL,\n -- v3: execution role 'main' | 'subagent'. Nullable (NULL on pre-v3 rows).\n -- Listed last to match the position ALTER TABLE ADD COLUMN appends it on\n -- migrated databases, so fresh and migrated DBs share one column order.\n actor TEXT\n);\n\nCREATE TABLE IF NOT EXISTS facts (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n session_id TEXT,\n created_at TEXT NOT NULL,\n category TEXT NOT NULL CHECK(category IN ('preference', 'convention', 'decision', 'learning')),\n content TEXT NOT NULL,\n source_surface TEXT NOT NULL DEFAULT 'cli',\n superseded_by INTEGER REFERENCES facts(id),\n confidence REAL NOT NULL DEFAULT 1.0,\n access_count INTEGER NOT NULL DEFAULT 0,\n last_accessed TEXT,\n -- v4: provenance citation backing a codebase fact (file:line, commit SHA,\n -- trace-event id). Nullable (NULL on pre-v4 rows and uncited writes).\n -- Listed last to match the position ALTER TABLE ADD COLUMN appends it on\n -- migrated databases, so fresh and migrated DBs share one column order.\n evidence TEXT\n);\n\nCREATE VIRTUAL TABLE IF NOT EXISTS facts_fts USING fts5(\n content,\n category,\n content=facts,\n content_rowid=id,\n tokenize='porter'\n);\n\nCREATE TRIGGER IF NOT EXISTS facts_ai AFTER INSERT ON facts BEGIN\n INSERT INTO facts_fts(rowid, content, category) VALUES (new.id, new.content, new.category);\nEND;\n\nCREATE TRIGGER IF NOT EXISTS facts_ad AFTER DELETE ON facts BEGIN\n INSERT INTO facts_fts(facts_fts, rowid, content, category) VALUES ('delete', old.id, old.content, old.category);\nEND;\n\nCREATE TABLE IF NOT EXISTS memory_metadata (key TEXT PRIMARY KEY, value TEXT NOT NULL);\n\nCREATE TRIGGER IF NOT EXISTS facts_au AFTER UPDATE OF content, category ON facts BEGIN\n INSERT INTO facts_fts(facts_fts, rowid, content, category) VALUES ('delete', old.id, old.content, old.category);\n INSERT INTO facts_fts(rowid, content, category) VALUES (new.id, new.content, new.category);\nEND;\n\nCREATE INDEX IF NOT EXISTS idx_sessions_started_at ON sessions(started_at DESC);\nCREATE INDEX IF NOT EXISTS idx_facts_session_id ON facts(session_id);\n\n-- v2: Fingerprint uniqueness for WAL replay. The four-field key (content,\n-- created_at, session_id, category) is the stable identity used by supersede\n-- WAL entries to locate rows across crash+restart cycles. Without a UNIQUE\n-- constraint, same-ms duplicate inserts make .get() return an arbitrary row.\n-- NULL session_id is coerced to the empty string so it participates in the\n-- uniqueness check (SQLite treats NULLs as distinct in UNIQUE indexes).\nCREATE UNIQUE INDEX IF NOT EXISTS idx_facts_fingerprint\n ON facts(content, created_at, COALESCE(session_id, ''), category);\n";
|
|
4
4
|
export declare function runMigrations(db: BetterSqlite3.Database, existingVersion: number): void;
|
|
5
|
-
export declare function enableWalMode(db: BetterSqlite3.Database): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const RESULT_TAIL_CHARS = 240;
|
|
2
2
|
export declare const VERIFICATION_PATTERNS: RegExp[];
|
|
3
3
|
export declare function isVerificationCommand(input: string): boolean;
|
|
4
|
+
export declare function buildVerificationResultTail(toolName: string, input: string, rawContent: string, tailPreview?: string[]): string | undefined;
|
|
4
5
|
export declare function parseVerificationSummary(tail: string): 'pass' | 'fail' | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AgentConfig } from '../../../types/config-types.js';
|
|
2
2
|
import type { RuntimeStateSource } from '../../../awareness/index.js';
|
|
3
|
+
import type { SkillExecutor } from '../../../tools/skill-executor.js';
|
|
3
4
|
import { type StableSystemParts } from './system-prompt.js';
|
|
4
5
|
export interface PromptAssemblyArgs {
|
|
5
6
|
config: AgentConfig;
|
|
@@ -8,7 +9,7 @@ export interface PromptAssemblyArgs {
|
|
|
8
9
|
readOnlyMemory: boolean;
|
|
9
10
|
readOnlyState?: boolean;
|
|
10
11
|
workspaceEnabled: boolean;
|
|
11
|
-
|
|
12
|
+
skillExecutor?: SkillExecutor;
|
|
12
13
|
runtimeStateSource: RuntimeStateSource;
|
|
13
14
|
userSystem: string | null;
|
|
14
15
|
}
|
|
@@ -11,6 +11,7 @@ export declare function providerForModel(model: string | undefined, hints?: Prov
|
|
|
11
11
|
export declare function resolveProvider(model: string | undefined, hints?: ProviderRouteHints, opts?: {
|
|
12
12
|
customTools?: import('../tools/custom-tool.js').CustomToolDef[];
|
|
13
13
|
canUseTool?: import('../types/sdk-types.js').CanUseTool;
|
|
14
|
+
executors?: import('../session/session-executors.js').ProviderExecutorOpts;
|
|
14
15
|
}): ModelProvider;
|
|
15
16
|
export { anthropicDirectProvider };
|
|
16
17
|
export { AnthropicDirectProvider } from './anthropic-direct/index.js';
|
|
@@ -1,35 +1,6 @@
|
|
|
1
1
|
import type { ModelProvider, ProviderQuery, ProviderQueryArgs, ProviderCompleteArgs } from '../../provider.js';
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
import type { SkillExecutor } from '../../tools/skill-executor.js';
|
|
5
|
-
import type { ComposeExecutor } from '../../tools/compose-executor.js';
|
|
6
|
-
import type { ToolPermissionConfig } from '../../tools/permissions.js';
|
|
7
|
-
import type { CanUseTool } from '../../types/sdk-types.js';
|
|
8
|
-
import type { ToolDispatcher } from '../anthropic-direct/tool-dispatcher.js';
|
|
9
|
-
import { MemoryStore } from '../../memory/index.js';
|
|
10
|
-
import { WorkspaceStore } from '../../workspace/index.js';
|
|
11
|
-
import { StateStore } from '../../state/state-store.js';
|
|
12
|
-
import { type ChildSessionOptions } from './index.child-session.js';
|
|
13
|
-
export interface OpenAICompatibleProviderOptions extends ChildSessionOptions {
|
|
14
|
-
baseURL?: string;
|
|
15
|
-
defaultHeaders?: Record<string, string>;
|
|
16
|
-
hookRegistry?: HookRegistry;
|
|
17
|
-
permissions?: ToolPermissionConfig;
|
|
18
|
-
canUseTool?: CanUseTool;
|
|
19
|
-
subagentExecutor?: SubagentExecutor;
|
|
20
|
-
skillExecutor?: SkillExecutor;
|
|
21
|
-
composeExecutor?: ComposeExecutor;
|
|
22
|
-
memoryStore?: MemoryStore;
|
|
23
|
-
workspaceStore?: WorkspaceStore;
|
|
24
|
-
stateStore?: StateStore;
|
|
25
|
-
surface?: string;
|
|
26
|
-
readOnlyMemory?: boolean;
|
|
27
|
-
readOnlyBash?: boolean;
|
|
28
|
-
tools?: ToolDispatcher;
|
|
29
|
-
mcpManager?: import('../../mcp/index.js').McpManager;
|
|
30
|
-
customTools?: import('../../tools/custom-tool.js').CustomToolDef[];
|
|
31
|
-
fastModeController?: import('../../fast-mode.js').FastModeController;
|
|
32
|
-
}
|
|
2
|
+
import { type OpenAICompatibleProviderOptions } from './index.options.js';
|
|
3
|
+
export type { OpenAICompatibleProviderOptions } from './index.options.js';
|
|
33
4
|
export declare class OpenAICompatibleProvider implements ModelProvider {
|
|
34
5
|
readonly name = "openai-compatible";
|
|
35
6
|
private readonly providerOpts;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { HookRegistry } from '../../hooks.js';
|
|
2
|
+
import type { SubagentExecutor } from '../../tools/subagent-executor.js';
|
|
3
|
+
import type { SkillExecutor } from '../../tools/skill-executor.js';
|
|
4
|
+
import type { ComposeExecutor } from '../../tools/compose-executor.js';
|
|
5
|
+
import type { ToolPermissionConfig } from '../../tools/permissions.js';
|
|
6
|
+
import type { CanUseTool } from '../../types/sdk-types.js';
|
|
7
|
+
import type { ToolDispatcher } from '../anthropic-direct/tool-dispatcher.js';
|
|
8
|
+
import { MemoryStore } from '../../memory/index.js';
|
|
9
|
+
import { WorkspaceStore } from '../../workspace/index.js';
|
|
10
|
+
import { StateStore } from '../../state/state-store.js';
|
|
11
|
+
import type { ChildSessionOptions } from './index.child-session.js';
|
|
12
|
+
export interface OpenAICompatibleProviderOptions extends ChildSessionOptions {
|
|
13
|
+
baseURL?: string;
|
|
14
|
+
defaultHeaders?: Record<string, string>;
|
|
15
|
+
hookRegistry?: HookRegistry;
|
|
16
|
+
permissions?: ToolPermissionConfig;
|
|
17
|
+
canUseTool?: CanUseTool;
|
|
18
|
+
subagentExecutor?: SubagentExecutor;
|
|
19
|
+
skillExecutor?: SkillExecutor;
|
|
20
|
+
composeExecutor?: ComposeExecutor;
|
|
21
|
+
memoryStore?: MemoryStore;
|
|
22
|
+
workspaceStore?: WorkspaceStore;
|
|
23
|
+
stateStore?: StateStore;
|
|
24
|
+
surface?: string;
|
|
25
|
+
readOnlyMemory?: boolean;
|
|
26
|
+
readOnlyBash?: boolean;
|
|
27
|
+
tools?: ToolDispatcher;
|
|
28
|
+
mcpManager?: import('../../mcp/index.js').McpManager;
|
|
29
|
+
customTools?: import('../../tools/custom-tool.js').CustomToolDef[];
|
|
30
|
+
fastModeController?: import('../../fast-mode.js').FastModeController;
|
|
31
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { AgentConfig } from '../../types/config-types.js';
|
|
2
2
|
import type { RuntimeStateSource } from '../../awareness/index.js';
|
|
3
|
+
import type { SkillExecutor } from '../../tools/skill-executor.js';
|
|
3
4
|
export interface SystemPromptWiringArgs {
|
|
4
5
|
config: AgentConfig;
|
|
5
|
-
|
|
6
|
+
skillExecutor?: SkillExecutor;
|
|
6
7
|
hasWorkspaceStore: boolean;
|
|
7
8
|
readOnlyMemory: boolean | undefined;
|
|
8
9
|
readOnlyState: boolean | undefined;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { ProviderCommandInfo } from '../../provider.js';
|
|
2
|
-
|
|
2
|
+
import type { SdkPluginConfig } from '../../types/sdk-types.js';
|
|
3
|
+
export interface SupportedCommandsScope {
|
|
4
|
+
pluginConfigs?: SdkPluginConfig[];
|
|
5
|
+
skillAllowlist?: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function collectSupportedCommands(scope?: SupportedCommandsScope): Promise<ProviderCommandInfo[]>;
|
|
@@ -16,5 +16,6 @@ export interface TransientRetryOpts {
|
|
|
16
16
|
onExhausted?: (info: RetryInfo) => void;
|
|
17
17
|
sleep?: (ms: number, signal: AbortSignal) => Promise<void>;
|
|
18
18
|
}
|
|
19
|
+
export declare function isTransientOauthOrg403(err: unknown): boolean;
|
|
19
20
|
export declare function isTransientError(err: unknown): boolean;
|
|
20
21
|
export declare function withTransientRetry<T>(attempt: () => Promise<T>, opts?: TransientRetryOpts): Promise<T>;
|
|
@@ -20,4 +20,5 @@ export declare function safeText(res: Response): Promise<string>;
|
|
|
20
20
|
export declare function clearOidcCache(): void;
|
|
21
21
|
export declare function discoverXaiOidc(deps?: OAuthHttpDeps): Promise<XaiOidcDiscovery>;
|
|
22
22
|
export declare function discoverXaiOidcCached(deps?: OAuthHttpDeps): Promise<XaiOidcDiscovery>;
|
|
23
|
+
export declare function postOAuthForm(url: string, params: Record<string, string>, errPrefix: string, fetchFn?: FetchFn): Promise<Record<string, unknown>>;
|
|
23
24
|
export declare function tokenResponseToBundle(json: Record<string, unknown>, nowSeconds?: () => number, fallbackRefresh?: string): XaiTokenBundle | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AgentConfig } from '../types.js';
|
|
2
|
+
import type { SessionExecutorsBindTarget } from './session-executors.js';
|
|
3
|
+
import type { AccountingAccumulator } from './accounting-accumulator.js';
|
|
4
|
+
export declare function bindSessionExecutors(config: AgentConfig, session: SessionExecutorsBindTarget): void;
|
|
5
|
+
type SubagentUsage = {
|
|
6
|
+
inputTokens?: number;
|
|
7
|
+
outputTokens?: number;
|
|
8
|
+
cacheReadTokens?: number;
|
|
9
|
+
cacheCreationTokens?: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function recordSubagentCompletionInTree(accounting: AccountingAccumulator, config: AgentConfig, abortController: AbortController, usage: SubagentUsage | undefined, costUsd: number | undefined): void;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type SessionExecutors } from './session-executors.js';
|
|
2
|
+
import type { AgentConfig } from '../types.js';
|
|
3
|
+
import type { HookRegistry } from '../hooks.js';
|
|
4
|
+
import type { SdkPluginConfig } from '../types/sdk-types.js';
|
|
5
|
+
import type { TraceSink } from '../trace/writer.js';
|
|
6
|
+
export interface CreateWiredExecutorsOptions {
|
|
7
|
+
agent?: boolean;
|
|
8
|
+
skill?: boolean | readonly string[];
|
|
9
|
+
compose?: boolean;
|
|
10
|
+
pluginConfigs?: SdkPluginConfig[];
|
|
11
|
+
hookRegistry?: HookRegistry;
|
|
12
|
+
unattended?: boolean;
|
|
13
|
+
warn?: (msg: string) => void;
|
|
14
|
+
traceWriter?: TraceSink;
|
|
15
|
+
}
|
|
16
|
+
export interface CreatedWiredExecutors {
|
|
17
|
+
executors: SessionExecutors;
|
|
18
|
+
dispose(): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
export declare function createWiredExecutors(config: AgentConfig, opts?: CreateWiredExecutorsOptions): CreatedWiredExecutors;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { AgentSession } from './agent-session.js';
|
|
2
|
+
import type { SubagentExecutorContext } from '../tools/subagent-executor.js';
|
|
3
|
+
export interface DeferredParentProxy {
|
|
4
|
+
proxy: SubagentExecutorContext['parentSession'];
|
|
5
|
+
bind: (session: AgentSession) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function makeDeferredParentProxy(): DeferredParentProxy;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import type { AgentConfig } from '../types.js';
|
|
1
2
|
import type { SessionMetadata } from '../types/session-types.js';
|
|
3
|
+
export declare function resolveSurfaceInputs(config: Pick<AgentConfig, 'executors' | 'provider' | 'providerFactory' | 'isSubagentFork' | 'parentSessionId'>, metadata: Pick<SessionMetadata, 'skills' | 'tools'>): {
|
|
4
|
+
skills: string[];
|
|
5
|
+
tools: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function warnReducedSurfaceOnTurn(config: Parameters<typeof resolveSurfaceInputs>[0]): void;
|
|
8
|
+
export declare function resetReducedSurfaceWarningForTests(): void;
|
|
2
9
|
export declare function isReducedToolSurface(metadata: Pick<SessionMetadata, 'skills' | 'tools'>): boolean;
|
|
3
10
|
export declare function emitReducedSurfaceWarning(metadata: Pick<SessionMetadata, 'skills' | 'tools'>): void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SubagentExecutor } from '../tools/subagent-executor.js';
|
|
2
|
+
import type { SkillExecutor } from '../tools/skill-executor.js';
|
|
3
|
+
import type { ComposeExecutor } from '../tools/compose-executor.js';
|
|
4
|
+
import type { HookRegistry } from '../hooks.js';
|
|
5
|
+
import type { MessageJournal } from '../journal/index.js';
|
|
6
|
+
import type { InputStreamRef } from '../types/permission-types.js';
|
|
7
|
+
export interface SessionExecutorsBindTarget {
|
|
8
|
+
readonly sessionId: string | undefined;
|
|
9
|
+
readonly abortSignal: AbortSignal;
|
|
10
|
+
readonly hookRegistry: HookRegistry | undefined;
|
|
11
|
+
readonly messageJournal: MessageJournal | undefined;
|
|
12
|
+
getInputStreamRef(): Pick<InputStreamRef, 'pushUserMessage' | 'queueFrameworkContext'>;
|
|
13
|
+
recordSubagentCompletion(usage?: {
|
|
14
|
+
inputTokens?: number;
|
|
15
|
+
outputTokens?: number;
|
|
16
|
+
cacheReadTokens?: number;
|
|
17
|
+
cacheCreationTokens?: number;
|
|
18
|
+
}, costUsd?: number): void;
|
|
19
|
+
}
|
|
20
|
+
export interface SessionExecutors {
|
|
21
|
+
readonly subagentExecutor?: SubagentExecutor;
|
|
22
|
+
readonly skillExecutor?: SkillExecutor;
|
|
23
|
+
readonly composeExecutor?: ComposeExecutor;
|
|
24
|
+
bind(session: SessionExecutorsBindTarget): void;
|
|
25
|
+
drain(reason: string): Promise<unknown>;
|
|
26
|
+
}
|
|
27
|
+
export type ProviderExecutorOpts = Pick<SessionExecutors, 'subagentExecutor' | 'skillExecutor' | 'composeExecutor'>;
|
|
28
|
+
export declare function providerExecutorOpts(executors: ProviderExecutorOpts | undefined): ProviderExecutorOpts;
|
|
29
|
+
export declare function createSessionBindSlot(): {
|
|
30
|
+
bind(session: SessionExecutorsBindTarget): void;
|
|
31
|
+
get(): SessionExecutorsBindTarget | undefined;
|
|
32
|
+
};
|
|
@@ -8,6 +8,8 @@ import type { TraceSink } from '../trace/writer.js';
|
|
|
8
8
|
import type { Surface } from '../awareness/types.js';
|
|
9
9
|
import type { AgentModelInput } from '../types.js';
|
|
10
10
|
import type { WorkspaceStore } from '../workspace/index.js';
|
|
11
|
+
import type { SdkPluginConfig } from '../types/sdk-types.js';
|
|
12
|
+
import type { HookRegistry } from '../hooks.js';
|
|
11
13
|
export interface WireExecutorsOptions {
|
|
12
14
|
surface: Surface;
|
|
13
15
|
parentSession: SubagentExecutorContext['parentSession'];
|
|
@@ -31,6 +33,9 @@ export interface WireExecutorsOptions {
|
|
|
31
33
|
agentRegistryWarn?: (message: string) => void;
|
|
32
34
|
workspaceStore?: WorkspaceStore;
|
|
33
35
|
sessionLabel?: string;
|
|
36
|
+
pluginConfigs?: SdkPluginConfig[];
|
|
37
|
+
skillAllowlist?: readonly string[];
|
|
38
|
+
hookRegistry?: HookRegistry;
|
|
34
39
|
}
|
|
35
40
|
export interface WiredExecutors {
|
|
36
41
|
rootManager: SubagentManager;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HookRegistry } from '../hooks.js';
|
|
2
|
+
import type { SdkPluginConfig } from '../types/sdk-types.js';
|
|
3
|
+
interface ScopeOptions {
|
|
4
|
+
pluginConfigs?: SdkPluginConfig[];
|
|
5
|
+
skillAllowlist?: readonly string[];
|
|
6
|
+
hookRegistry?: HookRegistry;
|
|
7
|
+
}
|
|
8
|
+
export declare function hookRegistryOpt(opts: Pick<ScopeOptions, 'hookRegistry'>): Pick<ScopeOptions, 'hookRegistry'>;
|
|
9
|
+
export declare function skillScopeOpts(opts: ScopeOptions): ScopeOptions;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function wireParentAbortSignal(parentSignal: AbortSignal, rootController: AbortController): void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AbortOrigin } from './trace/index.js';
|
|
2
|
+
import type { AbortGraph } from './abort-graph.js';
|
|
3
|
+
import { SUBAGENT_DRAIN_TIMEOUT_MS } from './subagent/constants.js';
|
|
4
|
+
export interface DrainHandle {
|
|
5
|
+
cancel(): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export declare function abortAllAndDrainImpl(active: ReadonlyMap<string, DrainHandle>, abortGraph: AbortGraph, rootId: string, reason: unknown, origin: AbortOrigin, timeoutMs: number, rearm: boolean, doRearm: () => void): Promise<{
|
|
8
|
+
drained: number;
|
|
9
|
+
timedOut: boolean;
|
|
10
|
+
}>;
|
|
11
|
+
export { SUBAGENT_DRAIN_TIMEOUT_MS };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AgentModelInput, IAgentSession } from '../types.js';
|
|
2
|
+
import type { Surface } from '../awareness/types.js';
|
|
3
|
+
import type { WorkspaceStore } from '../workspace/index.js';
|
|
4
|
+
import type { TraceSink } from '../trace/index.js';
|
|
5
|
+
import type { ReadScopeInputs } from '../subagent-read-scope.js';
|
|
6
|
+
import type { AgentRegistry } from '../agents/index.js';
|
|
7
|
+
import type { InboundAttachmentReader } from '../content/attachment-registry.js';
|
|
8
|
+
export interface ComposeExecutorContext {
|
|
9
|
+
parentSession: Pick<IAgentSession, 'sessionId' | 'abortSignal'> & import('../subagent/fork-types.js').JournalParent;
|
|
10
|
+
defaultModel?: AgentModelInput;
|
|
11
|
+
defaultSubagentModel: AgentModelInput;
|
|
12
|
+
apiKey?: string;
|
|
13
|
+
resolveApiKeyForModel?: (model: string) => string | undefined;
|
|
14
|
+
baseUrl?: string;
|
|
15
|
+
openaiBaseUrl?: string;
|
|
16
|
+
systemPrompt: string;
|
|
17
|
+
cwd?: string;
|
|
18
|
+
traceWriter?: TraceSink;
|
|
19
|
+
surface?: Surface;
|
|
20
|
+
depth?: number;
|
|
21
|
+
maxDepth?: number;
|
|
22
|
+
getReadScopeInputs?: () => ReadScopeInputs;
|
|
23
|
+
workspaceStore?: WorkspaceStore;
|
|
24
|
+
agentRegistry?: AgentRegistry;
|
|
25
|
+
delegationBudget?: import('./delegation-budget.js').DelegationBudget;
|
|
26
|
+
inboundAttachmentRegistry?: InboundAttachmentReader;
|
|
27
|
+
onSubagentSucceeded?: (usage: import('../subagent/result.js').SubagentTrace['usage'], costUsd: number | undefined) => void;
|
|
28
|
+
credentialModel?: AgentModelInput;
|
|
29
|
+
}
|
|
@@ -1,36 +1,10 @@
|
|
|
1
|
-
import { type ReadScopeInputs } from '../subagent-read-scope.js';
|
|
2
|
-
import type { AgentModelInput, IAgentSession } from '../types.js';
|
|
3
|
-
import type { Surface } from '../awareness/types.js';
|
|
4
|
-
import type { WorkspaceStore } from '../workspace/index.js';
|
|
5
1
|
import type { TraceSink } from '../trace/index.js';
|
|
6
2
|
import type { ToolCall, ToolResult } from './types.js';
|
|
3
|
+
import { type ComposeExecutorContext } from './compose-executor.context.js';
|
|
4
|
+
export type { ComposeExecutorContext } from './compose-executor.context.js';
|
|
7
5
|
import { cleanupComposeSpills } from './compose-executor.format.js';
|
|
8
6
|
export { cleanupComposeSpills };
|
|
9
|
-
import type { InboundAttachmentReader } from '../content/attachment-registry.js';
|
|
10
|
-
import type { AgentRegistry } from '../agents/index.js';
|
|
11
7
|
import type { DetachableToolRegistry } from './detach-registry.js';
|
|
12
|
-
export interface ComposeExecutorContext {
|
|
13
|
-
parentSession: Pick<IAgentSession, 'sessionId' | 'abortSignal'> & import('../subagent/fork-types.js').JournalParent;
|
|
14
|
-
defaultModel?: AgentModelInput;
|
|
15
|
-
defaultSubagentModel: AgentModelInput;
|
|
16
|
-
apiKey?: string;
|
|
17
|
-
resolveApiKeyForModel?: (model: string) => string | undefined;
|
|
18
|
-
baseUrl?: string;
|
|
19
|
-
openaiBaseUrl?: string;
|
|
20
|
-
systemPrompt: string;
|
|
21
|
-
cwd?: string;
|
|
22
|
-
traceWriter?: TraceSink;
|
|
23
|
-
surface?: Surface;
|
|
24
|
-
depth?: number;
|
|
25
|
-
maxDepth?: number;
|
|
26
|
-
getReadScopeInputs?: () => ReadScopeInputs;
|
|
27
|
-
workspaceStore?: WorkspaceStore;
|
|
28
|
-
agentRegistry?: AgentRegistry;
|
|
29
|
-
delegationBudget?: import('./delegation-budget.js').DelegationBudget;
|
|
30
|
-
inboundAttachmentRegistry?: InboundAttachmentReader;
|
|
31
|
-
onSubagentSucceeded?: (usage: import('../subagent/result.js').SubagentTrace['usage'], costUsd: number | undefined) => void;
|
|
32
|
-
credentialModel?: AgentModelInput;
|
|
33
|
-
}
|
|
34
8
|
export declare class ComposeExecutor {
|
|
35
9
|
private readonly ctx;
|
|
36
10
|
private currentCwd;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComposeInput } from './compose-input-parse.js';
|
|
2
|
+
import type { AgentModelInput } from '../types.js';
|
|
3
|
+
import type { AgentRegistry } from '../agents/index.js';
|
|
4
|
+
export interface BuildComposeWaveManifestArgs {
|
|
5
|
+
parsed: ComposeInput;
|
|
6
|
+
dagNodeCount: number;
|
|
7
|
+
depth: number | undefined;
|
|
8
|
+
currentCwd: string | undefined;
|
|
9
|
+
defaultModel: AgentModelInput | undefined;
|
|
10
|
+
defaultSubagentModel: AgentModelInput;
|
|
11
|
+
parentSessionId: string | undefined;
|
|
12
|
+
agentRegistry: AgentRegistry | undefined;
|
|
13
|
+
}
|
|
14
|
+
export declare function buildComposeWaveManifest(args: BuildComposeWaveManifestArgs): string | undefined;
|
|
@@ -10,6 +10,8 @@ import type { SubagentExecutor } from './subagent-executor.js';
|
|
|
10
10
|
import type { TraceSink } from '../trace/index.js';
|
|
11
11
|
import type { BackgroundAgentRegistry } from '../background-registry.js';
|
|
12
12
|
import type { AgentRegistry } from '../agents/types.js';
|
|
13
|
+
import type { SdkPluginConfig } from '../types/sdk-types.js';
|
|
14
|
+
import type { HookRegistry } from '../hooks.js';
|
|
13
15
|
export declare const DEFAULT_MAX_NESTING_DEPTH = 3;
|
|
14
16
|
export declare const MAX_NESTING_DEPTH_CEILING = 6;
|
|
15
17
|
export declare function resolveMaxNestingDepth(): number;
|
|
@@ -39,7 +41,7 @@ export interface BuildComposeNodeProviderOpts {
|
|
|
39
41
|
canUseTool?: CanUseTool;
|
|
40
42
|
}
|
|
41
43
|
export declare function buildComposeNodeProvider(model: AgentModelInput | undefined, workspaceStore: WorkspaceStore | undefined, opts?: BuildComposeNodeProviderOpts): ModelProvider;
|
|
42
|
-
export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceSink, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry, openaiBaseUrl?: string, xaiBaseUrl?: string, workspaceStore?: WorkspaceStore, delegationBudget?: import('./delegation-budget.js').DelegationBudget): (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string, inheritedReadScope?: ReadScopeInputs, skillDispatchName?: string, journalParent?: JournalParent, rootSessionId?: string) => SkillExecutor;
|
|
44
|
+
export declare function createChildSkillExecutorFactory(defaultModel: AgentModelInput, apiKey: string | undefined, childProviderFactory: (args: ChildProviderFactoryArgs) => ModelProvider, baseUrl?: string, traceWriter?: TraceSink, backgroundRegistry?: BackgroundAgentRegistry, cwd?: string, resolveApiKeyForModel?: (model: string) => string | undefined, surface?: Surface, defaultSubagentModel?: AgentModelInput, agentRegistry?: AgentRegistry, openaiBaseUrl?: string, xaiBaseUrl?: string, workspaceStore?: WorkspaceStore, delegationBudget?: import('./delegation-budget.js').DelegationBudget, pluginConfigs?: SdkPluginConfig[], skillAllowlist?: readonly string[], hookRegistry?: HookRegistry): (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string, inheritedReadScope?: ReadScopeInputs, skillDispatchName?: string, journalParent?: JournalParent, rootSessionId?: string) => SkillExecutor;
|
|
43
45
|
export type PhaseRole = 'read-only' | 'read-write';
|
|
44
46
|
export declare function buildSkillRestrictedProvider(allowedTools: string[], model: AgentModelInput | undefined, readOnlyBash?: boolean, openaiBaseUrl?: string, workspaceStore?: WorkspaceStore): ModelProvider;
|
|
45
47
|
export declare function buildPhaseRestrictedProvider(_role: 'read-only', model: AgentModelInput | undefined): ModelProvider;
|
|
@@ -17,6 +17,8 @@ export interface CollectSkillEntriesOptions {
|
|
|
17
17
|
}
|
|
18
18
|
export interface BuildSkillManifestOptions extends CollectSkillEntriesOptions {
|
|
19
19
|
excludeName?: string;
|
|
20
|
+
pluginConfigs?: SdkPluginConfig[];
|
|
21
|
+
skillAllowlist?: readonly string[];
|
|
20
22
|
}
|
|
21
23
|
export declare function collectSkillEntries(pluginConfigs?: SdkPluginConfig[], opts?: CollectSkillEntriesOptions): SkillManifestEntry[];
|
|
22
24
|
export interface PluginSkillBody {
|
|
@@ -3,6 +3,7 @@ import type { ModelProvider } from '../../provider.js';
|
|
|
3
3
|
import type { TraceSink } from '../../trace/index.js';
|
|
4
4
|
import type { BackgroundAgentRegistry } from '../../background-registry.js';
|
|
5
5
|
import type { SdkPluginConfig } from '../../types/sdk-types.js';
|
|
6
|
+
import type { HookRegistry } from '../../hooks.js';
|
|
6
7
|
import type { ChildProviderFactoryArgs } from '../nesting.js';
|
|
7
8
|
import type { Surface } from '../../awareness/types.js';
|
|
8
9
|
import type { ReadScopeInputs } from '../../subagent-read-scope.js';
|
|
@@ -19,6 +20,8 @@ export interface SkillExecutorContext {
|
|
|
19
20
|
openaiBaseUrl?: string;
|
|
20
21
|
xaiBaseUrl?: string;
|
|
21
22
|
pluginConfigs?: SdkPluginConfig[];
|
|
23
|
+
skillAllowlist?: readonly string[];
|
|
24
|
+
hookRegistry?: HookRegistry;
|
|
22
25
|
depth?: number;
|
|
23
26
|
maxDepth?: number;
|
|
24
27
|
childProviderFactory?: (args: ChildProviderFactoryArgs) => ModelProvider;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ToolCall, ToolResult } from './types.js';
|
|
2
2
|
import type { TraceSink } from '../trace/index.js';
|
|
3
3
|
import type { SkillExecutorContext } from './skill-executor/types.js';
|
|
4
|
+
import type { SdkPluginConfig } from '../types/sdk-types.js';
|
|
4
5
|
export type { SkillExecutorContext } from './skill-executor/types.js';
|
|
5
6
|
export declare class SkillExecutor {
|
|
6
7
|
private readonly ctx;
|
|
@@ -8,6 +9,10 @@ export declare class SkillExecutor {
|
|
|
8
9
|
private currentCwd;
|
|
9
10
|
constructor(ctx: SkillExecutorContext);
|
|
10
11
|
setCwd(cwd: string): void;
|
|
12
|
+
getManifestScope(): {
|
|
13
|
+
pluginConfigs?: SdkPluginConfig[];
|
|
14
|
+
skillAllowlist?: readonly string[];
|
|
15
|
+
};
|
|
11
16
|
setTraceWriter(writer: TraceSink | undefined): void;
|
|
12
17
|
private internals;
|
|
13
18
|
execute(call: ToolCall): Promise<ToolResult>;
|