agent-afk 5.308.3 → 5.308.5
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/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/anthropic-direct/query/retry-context.d.ts +1 -1
- package/dist/agent/providers/index.d.ts +1 -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/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/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/types/config-types.d.ts +1 -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.mjs +359 -364
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +271 -185
- package/dist/telegram.mjs +190 -189
- package/dist/utils/abort.d.ts +11 -0
- package/dist/web-server/session-owner.d.ts +1 -0
- package/package.json +3 -3
|
@@ -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';
|
|
@@ -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
|
}
|
|
@@ -10,7 +10,7 @@ export interface RetryTierContext {
|
|
|
10
10
|
readonly tokenRefresher: (() => Promise<Anthropic | null>) | undefined;
|
|
11
11
|
getClient(): Anthropic;
|
|
12
12
|
getClientToken(): string | undefined;
|
|
13
|
-
rotateHeaders(runInput: Pick<RunTurnInput, 'effort' | 'fastMode'>): Record<string, string>;
|
|
13
|
+
rotateHeaders(runInput: Pick<RunTurnInput, 'effort' | 'fastMode' | 'thinkingBlockBinding'>): Record<string, string>;
|
|
14
14
|
forceClientRefresh(): Promise<{
|
|
15
15
|
accountId: string;
|
|
16
16
|
oldAccountId: string;
|
|
@@ -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,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[]>;
|
|
@@ -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 {};
|
|
@@ -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>;
|
|
@@ -38,6 +38,7 @@ export interface BuildChildConfigArgs {
|
|
|
38
38
|
traceWriter?: TraceSink;
|
|
39
39
|
workspaceStore?: import('../../workspace/index.js').WorkspaceStore;
|
|
40
40
|
delegationBudget?: import('../../tools/delegation-budget.js').DelegationBudget;
|
|
41
|
+
hookRegistry?: import('../../hooks.js').HookRegistry;
|
|
41
42
|
parentRootSessionId?: string;
|
|
42
43
|
createChildExecutor: (ctx: SubagentExecutorContext) => SubagentExecutor;
|
|
43
44
|
}
|
|
@@ -12,6 +12,7 @@ import type { Surface } from '../../awareness/types.js';
|
|
|
12
12
|
import type { TraceSink } from '../../trace/index.js';
|
|
13
13
|
import type { InboundAttachmentReader } from '../../content/attachment-registry.js';
|
|
14
14
|
import type { DelegationBudget } from '../delegation-budget.js';
|
|
15
|
+
import type { HookRegistry } from '../../hooks.js';
|
|
15
16
|
import type { QueuedNoteClaim } from '../subagent/queued-note.js';
|
|
16
17
|
import type { PromotedSubagentInfo } from '../subagent/foreground-promotion.js';
|
|
17
18
|
export type { PromotedSubagentInfo, QueuedNoteClaim };
|
|
@@ -35,6 +36,7 @@ export interface SubagentExecutorContext {
|
|
|
35
36
|
traceWriter?: TraceSink;
|
|
36
37
|
workspaceStore?: import('../../workspace/index.js').WorkspaceStore;
|
|
37
38
|
delegationBudget?: DelegationBudget;
|
|
39
|
+
hookRegistry?: HookRegistry;
|
|
38
40
|
allowedTools?: string[];
|
|
39
41
|
readOnlyBash?: boolean;
|
|
40
42
|
nestedAgentAllowlist?: readonly string[];
|
|
@@ -88,6 +88,7 @@ export interface AgentConfig {
|
|
|
88
88
|
drainSubagents?: (reason: string) => Promise<unknown>;
|
|
89
89
|
isSubagentFork?: true;
|
|
90
90
|
provider?: ModelProvider;
|
|
91
|
+
executors?: import('../session/session-executors.js').SessionExecutors;
|
|
91
92
|
providerFactory?: (model: string | undefined) => ModelProvider;
|
|
92
93
|
maxBudgetUsd?: number;
|
|
93
94
|
taskBudget?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ProviderRouteHints } from '../agent/providers/index.js';
|
|
2
2
|
import type { AgentModelInput, ThinkingConfig, EffortLevel } from '../agent/types.js';
|
|
3
3
|
import type { GrantManager } from './slash/commands/allow-dir.js';
|
|
4
4
|
export { composeSystemPrompt, loadConfigSystemPrompt, loadSystemPrompt, OPERATOR_CONFIG_HEADER, resolveBaseSystemPrompt, } from './system-prompt.js';
|
|
@@ -9,7 +9,7 @@ export declare function getCodexApiKey(): string | undefined;
|
|
|
9
9
|
export declare function getApiKeyForModel(model: string | undefined, hints?: ProviderRouteHints): string | undefined;
|
|
10
10
|
export declare function explicitProviderHints(provider: string | undefined): ProviderRouteHints | undefined;
|
|
11
11
|
export declare function getModel(): AgentModelInput;
|
|
12
|
-
export
|
|
12
|
+
export { getDefaultSubagentModel } from '../agent/session/default-subagent-model.js';
|
|
13
13
|
export declare function parseThinking(raw: string | undefined): ThinkingConfig | undefined;
|
|
14
14
|
export declare function parseEffort(raw: string | undefined): EffortLevel | undefined;
|
|
15
15
|
export declare function getThinking(): ThinkingConfig | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SkillInvocation } from '../preflight/index.js';
|
|
2
|
+
import type { SlashContext } from '../types.js';
|
|
3
|
+
export declare function invokeSkillPreflight(skillName: string, rawArgs: string, source: SkillInvocation['source'], ctx: SlashContext): Promise<string | undefined>;
|