@openagentpack/sdk 0.3.0-beta-fb9e73b-20260721 → 0.3.0-beta-e537ab3-20260722
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/index.d.ts +54 -1
- package/dist/index.js +567 -124
- package/dist/session-events.js +21 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -142,6 +142,8 @@ interface AgentDecl {
|
|
|
142
142
|
skills?: AgentSkillDecl[];
|
|
143
143
|
vault?: string;
|
|
144
144
|
memory_stores?: string[];
|
|
145
|
+
/** Resources mounted into every managed session created for this agent. */
|
|
146
|
+
resources?: SessionResourceDecl[];
|
|
145
147
|
multiagent?: MultiagentDecl;
|
|
146
148
|
metadata?: Record<string, string>;
|
|
147
149
|
/** Provider-specific remote materialization. Omitted means the existing managed Agent resource. */
|
|
@@ -170,6 +172,8 @@ interface AgentSkillRefDecl {
|
|
|
170
172
|
}
|
|
171
173
|
interface AgentToolsDecl {
|
|
172
174
|
builtin: string[];
|
|
175
|
+
/** Permission inherited by every enabled builtin without an explicit override. */
|
|
176
|
+
default_permission?: "allow" | "ask";
|
|
173
177
|
mcp?: AgentMcpToolkitDecl[];
|
|
174
178
|
permissions?: Record<string, "allow" | "ask">;
|
|
175
179
|
}
|
|
@@ -206,8 +210,16 @@ interface DeploymentDecl {
|
|
|
206
210
|
description?: string;
|
|
207
211
|
provider?: ProviderName;
|
|
208
212
|
metadata?: Record<string, string>;
|
|
213
|
+
/** Qoder-only deployment-level variables copied into each created session. */
|
|
214
|
+
environment_variables?: string;
|
|
209
215
|
}
|
|
210
216
|
type DeploymentResourceDecl = DeploymentFileResource | DeploymentMemoryStoreResource | DeploymentGithubRepoResource;
|
|
217
|
+
/** Provider-neutral resources that can be attached directly when a session is created. */
|
|
218
|
+
interface SessionGithubRepoResourceDecl extends Omit<DeploymentGithubRepoResource, "authorization_token"> {
|
|
219
|
+
/** Required for private repositories; interpolate this value from an environment variable. */
|
|
220
|
+
authorization_token: string;
|
|
221
|
+
}
|
|
222
|
+
type SessionResourceDecl = SessionGithubRepoResourceDecl;
|
|
211
223
|
interface DeploymentFileResource {
|
|
212
224
|
type: "file";
|
|
213
225
|
file_id?: string;
|
|
@@ -388,9 +400,22 @@ interface SessionFileResource {
|
|
|
388
400
|
file_id: string;
|
|
389
401
|
mount_path: string;
|
|
390
402
|
}
|
|
403
|
+
interface SessionGithubRepositoryResource {
|
|
404
|
+
type: "github_repository";
|
|
405
|
+
url: string;
|
|
406
|
+
checkout?: {
|
|
407
|
+
branch?: string;
|
|
408
|
+
commit?: string;
|
|
409
|
+
};
|
|
410
|
+
mount_path?: string;
|
|
411
|
+
authorization_token: string;
|
|
412
|
+
}
|
|
413
|
+
type SessionResource = SessionGithubRepositoryResource;
|
|
391
414
|
interface CommonSessionBindings {
|
|
392
415
|
/** Uploaded files to mount in the session sandbox. */
|
|
393
416
|
files?: SessionFileResource[];
|
|
417
|
+
/** Provider-neutral resources to mount when the session is created. */
|
|
418
|
+
resources?: SessionResource[];
|
|
394
419
|
title?: string;
|
|
395
420
|
metadata?: Record<string, string>;
|
|
396
421
|
}
|
|
@@ -574,6 +599,20 @@ interface DeploymentInfo$1 {
|
|
|
574
599
|
};
|
|
575
600
|
attributes?: Record<string, unknown>;
|
|
576
601
|
}
|
|
602
|
+
interface DeploymentListFilter {
|
|
603
|
+
agent_id?: string;
|
|
604
|
+
status?: "active" | "paused";
|
|
605
|
+
include_archived?: boolean;
|
|
606
|
+
limit?: number;
|
|
607
|
+
page?: string;
|
|
608
|
+
created_at_gte?: string;
|
|
609
|
+
created_at_lte?: string;
|
|
610
|
+
}
|
|
611
|
+
interface DeploymentListResult {
|
|
612
|
+
deployments: DeploymentInfo$1[];
|
|
613
|
+
has_more: boolean;
|
|
614
|
+
next_page?: string;
|
|
615
|
+
}
|
|
577
616
|
interface ProviderAdapter {
|
|
578
617
|
readonly name: string;
|
|
579
618
|
/**
|
|
@@ -650,6 +689,9 @@ interface ProviderAdapter {
|
|
|
650
689
|
deleteDeployment(id: string): Promise<void>;
|
|
651
690
|
runDeployment(ctx: DeploymentContext): Promise<DeploymentRunResult$1>;
|
|
652
691
|
getDeployment(ctx: DeploymentContext): Promise<DeploymentInfo$1>;
|
|
692
|
+
listDeployments?(filter?: DeploymentListFilter): Promise<DeploymentListResult>;
|
|
693
|
+
pauseDeployment?(ctx: DeploymentContext): Promise<DeploymentInfo$1>;
|
|
694
|
+
unpauseDeployment?(ctx: DeploymentContext): Promise<DeploymentInfo$1>;
|
|
653
695
|
uploadFile(filePath: string, options?: {
|
|
654
696
|
name?: string;
|
|
655
697
|
purpose?: string;
|
|
@@ -956,6 +998,9 @@ declare function migrateConfig(opts: MigrateOptions): Promise<MigrateResult>;
|
|
|
956
998
|
interface DeploymentRunAdapter {
|
|
957
999
|
runDeployment(ctx: DeploymentContext): Promise<DeploymentRunResult$1>;
|
|
958
1000
|
getDeployment(ctx: DeploymentContext): Promise<DeploymentInfo$1>;
|
|
1001
|
+
listDeployments?(filter?: DeploymentListFilter): Promise<DeploymentListResult>;
|
|
1002
|
+
pauseDeployment?(ctx: DeploymentContext): Promise<DeploymentInfo$1>;
|
|
1003
|
+
unpauseDeployment?(ctx: DeploymentContext): Promise<DeploymentInfo$1>;
|
|
959
1004
|
}
|
|
960
1005
|
|
|
961
1006
|
interface DeploymentSummary {
|
|
@@ -1006,9 +1051,11 @@ interface DeploymentRun {
|
|
|
1006
1051
|
provider: string;
|
|
1007
1052
|
result: DeploymentRunResult;
|
|
1008
1053
|
}
|
|
1054
|
+
declare function listRemoteDeploymentsForContext(ctx: ProjectRuntimeContext, provider: string, filter?: DeploymentListFilter): Promise<DeploymentListResult>;
|
|
1009
1055
|
declare function listDeploymentsForContext(ctx: ProjectRuntimeContext, providerFilter?: string): DeploymentSummary[];
|
|
1010
1056
|
declare function getDeploymentDetailsForContext(ctx: ProjectRuntimeContext, name: string, adapter?: Pick<DeploymentRunAdapter, "getDeployment">, resolvedProvider?: string): Promise<DeploymentDetail>;
|
|
1011
1057
|
declare function runDeploymentForContext(ctx: ProjectRuntimeContext, name: string, adapter?: Pick<DeploymentRunAdapter, "runDeployment">, resolvedProvider?: string): Promise<DeploymentRun>;
|
|
1058
|
+
declare function pauseDeploymentForContext(ctx: ProjectRuntimeContext, name: string, paused: boolean, resolvedProvider?: string): Promise<DeploymentInfo$1>;
|
|
1012
1059
|
declare function getDeploymentRuntimeProviderForContext(ctx: ProjectRuntimeContext, name: string, overrideProvider?: string): string;
|
|
1013
1060
|
|
|
1014
1061
|
type DestroyResourceStatus = "success" | "failed" | "blocked" | "skipped";
|
|
@@ -1224,6 +1271,8 @@ interface SessionCreateOptions {
|
|
|
1224
1271
|
fileId: string;
|
|
1225
1272
|
mountPath: string;
|
|
1226
1273
|
}[];
|
|
1274
|
+
/** Explicit resources override the resources declared on the agent. */
|
|
1275
|
+
resources?: SessionResourceDecl[];
|
|
1227
1276
|
title?: string;
|
|
1228
1277
|
provider?: string;
|
|
1229
1278
|
metadata?: Record<string, string>;
|
|
@@ -1335,12 +1384,16 @@ declare function streamSessionEvents(ctx: ProjectRuntimeContext, sessionId: stri
|
|
|
1335
1384
|
interface MountedFile {
|
|
1336
1385
|
mount_path: string;
|
|
1337
1386
|
}
|
|
1387
|
+
/** Resolve the provider path used for a mounted Git repository. */
|
|
1388
|
+
declare function resolveRepositoryMountPath(provider: string, resource: SessionGithubRepositoryResource): string;
|
|
1338
1389
|
/** Prepend the file-mount hint to a prompt. Returns the prompt unchanged when there are no files. */
|
|
1339
1390
|
declare function prependFileHint(prompt: string, files: MountedFile[] | undefined, provider: string): string;
|
|
1340
1391
|
/** 将 prompt 内 ⟦file:mountPath⟧ 占位符替换为 provider 感知的真实 sandbox 路径 */
|
|
1341
1392
|
declare function rewriteFileMentions(prompt: string, provider: string): string;
|
|
1342
1393
|
/** 发送给 provider 前统一处理:先替换 mention 占位符,再 prepend 文件 hint */
|
|
1343
1394
|
declare function preparePromptForProvider(prompt: string, files: MountedFile[] | undefined, provider: string): string;
|
|
1395
|
+
/** Prepare only the first user message for a newly created Session. */
|
|
1396
|
+
declare function prepareInitialSessionPrompt(prompt: string, bindings: SessionBindings, provider: string): string;
|
|
1344
1397
|
|
|
1345
1398
|
/**
|
|
1346
1399
|
* Resolve a provider's config block from environment variables (actual values, not
|
|
@@ -1408,4 +1461,4 @@ declare class LocalFileStateBackend implements StateBackend {
|
|
|
1408
1461
|
/** Normalize a skill zip and extract its entries to SkillFile[]. */
|
|
1409
1462
|
declare function extractSkillZipFiles(raw: Buffer): Promise<SkillFile[]>;
|
|
1410
1463
|
|
|
1411
|
-
export { AGENTS_CONFIG_PROVIDERS, AGENTS_PROVIDER_FIELDS, type AgentBuildInput, AgentDefinition, type AgentMcpBuildInput, type AgentSkillBuildInput, AgentSyncRun, AgentWithReadiness, type BackendRuntimeInput, type BatchCreateMemoryInput, type BatchCreateMemoryResult, CloudAgent, CloudEnvironment, CloudVault, type CollectedSessionEvents, type CreateMemoryInput, type CreateMemoryStoreInput, type DestroyResourceResult, type DestructivePolicy, Diagnostic, type IStateManager, type LoadedProjectConfig, LocalFileStateBackend, type MemoryInfo, type MemoryListItem, type MemoryListOptions, type MemoryPage, type MemoryPrefixInfo, type MemoryProviderCapabilities, type MemoryStoreInfo, type MemoryStoreListOptions, type MemoryVersionInfo, type MemoryVersionListOptions, type MigrateOptions, type MigrateResult, PlannedAction, type ProjectRuntimeContext, type ProviderConfig, type ProviderConfigProvider, ProviderFileInfo, ProviderSessionEvent, type ProviderSessionInfo, type ProviderSkillInfo, type ResolvedProjectConfig, type ResourceActionResult, ResourceAddress, type ResourceExecutionResult, type ResourcePlanResult, type ResourceRefreshResult, type ResourceRuntimeOptions, type ResourceState, type ResourceSyncRun, ResourceType, type RuntimeFeedbackEvent, type RuntimeFeedbackSink, type SecretPlaceholder, type SkillFile, StateManager, type StateScope, type SyncProjectOptions, type SyncProjectResult, type UpdateMemoryInput, type UpdateMemoryStoreInput, UserError, type ValidateProjectConfigOptions, applyProviderConfigToEnv, archiveCloudAgent, archiveMemoryStore, areRuntimeCredentialsReady, batchCreateMemories, bootstrapRuntimeCredentials, bootstrapRuntimeCredentialsSync, buildAgentDecl, collectConfigReferences, createCloudEnvironment, createCloudVault, createMemory, createMemoryStore, createProjectRuntime, createSessionForAgent, createSkillFromFileId, decideDestructive, deleteCloudEnvironment, deleteCloudVault, deleteFile, deleteMemory, deleteMemoryStore, deleteSession, deleteSkill, destroyPlannedProjectResources, executePlannedProject, extractSkillZipFiles, getAgent, getDeploymentDetailsForContext, getDeploymentRuntimeProviderForContext, getFileDownloadUrl, getFileInfo, getMemory, getMemoryProviderCapabilities, getMemoryStore, getMemoryVersion, getSession, getSkillInfo, importResource, isTerminalSessionStatus, listAgentsWithReadiness, listCloudAgents, listCloudEnvironments, listCloudVaults, listDeploymentsForContext, listFiles, listMemories, listMemoryStores, listMemoryVersions, listProviderModelsForContext, listProviderNames, listSessionEvents, listSessionSummaries, listSkills, loadDotEnv, loadProviderConfigIntoEnv, loadProviderConfigIntoEnvSync, migrateConfig, parseStateAddress, planDestroyProjectContext, planProjectContext, preparePromptForProvider, prependFileHint, providerConfigPath, readProjectRuntime, redactMemoryVersion, resolveActiveProvider, resolveProjectConfig, resolveProjectConfigFromObject, resolveProviderConfigFromEnv, resolveSessionProvider, resolveSyncProvider, rewriteFileMentions, runDeploymentForContext, sendSessionMessagePolling, sendSessionMessageStreaming, startSessionRun, startSessionRunPolling, streamSessionEvents, syncAgentResourcesWithStateBackend, syncProjectResourcesWithStateBackend, syncProviderResourcesFromContext, syncProviderResourcesFromEnv, updateMemory, updateMemoryStore, uploadFile, validateProjectConfig, writeProjectRuntime };
|
|
1464
|
+
export { AGENTS_CONFIG_PROVIDERS, AGENTS_PROVIDER_FIELDS, type AgentBuildInput, AgentDefinition, type AgentMcpBuildInput, type AgentSkillBuildInput, AgentSyncRun, AgentWithReadiness, type BackendRuntimeInput, type BatchCreateMemoryInput, type BatchCreateMemoryResult, CloudAgent, CloudEnvironment, CloudVault, type CollectedSessionEvents, type CreateMemoryInput, type CreateMemoryStoreInput, type DeploymentListFilter, type DeploymentListResult, type DestroyResourceResult, type DestructivePolicy, Diagnostic, type IStateManager, type LoadedProjectConfig, LocalFileStateBackend, type MemoryInfo, type MemoryListItem, type MemoryListOptions, type MemoryPage, type MemoryPrefixInfo, type MemoryProviderCapabilities, type MemoryStoreInfo, type MemoryStoreListOptions, type MemoryVersionInfo, type MemoryVersionListOptions, type MigrateOptions, type MigrateResult, PlannedAction, type ProjectRuntimeContext, type ProviderConfig, type ProviderConfigProvider, ProviderFileInfo, ProviderSessionEvent, type ProviderSessionInfo, type ProviderSkillInfo, type ResolvedProjectConfig, type ResourceActionResult, ResourceAddress, type ResourceExecutionResult, type ResourcePlanResult, type ResourceRefreshResult, type ResourceRuntimeOptions, type ResourceState, type ResourceSyncRun, ResourceType, type RuntimeFeedbackEvent, type RuntimeFeedbackSink, type SecretPlaceholder, type SkillFile, StateManager, type StateScope, type SyncProjectOptions, type SyncProjectResult, type UpdateMemoryInput, type UpdateMemoryStoreInput, UserError, type ValidateProjectConfigOptions, applyProviderConfigToEnv, archiveCloudAgent, archiveMemoryStore, areRuntimeCredentialsReady, batchCreateMemories, bootstrapRuntimeCredentials, bootstrapRuntimeCredentialsSync, buildAgentDecl, collectConfigReferences, createCloudEnvironment, createCloudVault, createMemory, createMemoryStore, createProjectRuntime, createSessionForAgent, createSkillFromFileId, decideDestructive, deleteCloudEnvironment, deleteCloudVault, deleteFile, deleteMemory, deleteMemoryStore, deleteSession, deleteSkill, destroyPlannedProjectResources, executePlannedProject, extractSkillZipFiles, getAgent, getDeploymentDetailsForContext, getDeploymentRuntimeProviderForContext, getFileDownloadUrl, getFileInfo, getMemory, getMemoryProviderCapabilities, getMemoryStore, getMemoryVersion, getSession, getSkillInfo, importResource, isTerminalSessionStatus, listAgentsWithReadiness, listCloudAgents, listCloudEnvironments, listCloudVaults, listDeploymentsForContext, listFiles, listMemories, listMemoryStores, listMemoryVersions, listProviderModelsForContext, listProviderNames, listRemoteDeploymentsForContext, listSessionEvents, listSessionSummaries, listSkills, loadDotEnv, loadProviderConfigIntoEnv, loadProviderConfigIntoEnvSync, migrateConfig, parseStateAddress, pauseDeploymentForContext, planDestroyProjectContext, planProjectContext, prepareInitialSessionPrompt, preparePromptForProvider, prependFileHint, providerConfigPath, readProjectRuntime, redactMemoryVersion, resolveActiveProvider, resolveProjectConfig, resolveProjectConfigFromObject, resolveProviderConfigFromEnv, resolveRepositoryMountPath, resolveSessionProvider, resolveSyncProvider, rewriteFileMentions, runDeploymentForContext, sendSessionMessagePolling, sendSessionMessageStreaming, startSessionRun, startSessionRunPolling, streamSessionEvents, syncAgentResourcesWithStateBackend, syncProjectResourcesWithStateBackend, syncProviderResourcesFromContext, syncProviderResourcesFromEnv, updateMemory, updateMemoryStore, uploadFile, validateProjectConfig, writeProjectRuntime };
|