pilotswarm-sdk 0.1.3
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-loader.d.ts +61 -0
- package/dist/agent-loader.d.ts.map +1 -0
- package/dist/agent-loader.js +212 -0
- package/dist/agent-loader.js.map +1 -0
- package/dist/artifact-tools.d.ts +31 -0
- package/dist/artifact-tools.d.ts.map +1 -0
- package/dist/artifact-tools.js +190 -0
- package/dist/artifact-tools.js.map +1 -0
- package/dist/blob-store.d.ts +73 -0
- package/dist/blob-store.d.ts.map +1 -0
- package/dist/blob-store.js +220 -0
- package/dist/blob-store.js.map +1 -0
- package/dist/client.d.ts +159 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +676 -0
- package/dist/client.js.map +1 -0
- package/dist/cms.d.ts +129 -0
- package/dist/cms.d.ts.map +1 -0
- package/dist/cms.js +313 -0
- package/dist/cms.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/managed-session.d.ts +70 -0
- package/dist/managed-session.d.ts.map +1 -0
- package/dist/managed-session.js +717 -0
- package/dist/managed-session.js.map +1 -0
- package/dist/management-client.d.ts +171 -0
- package/dist/management-client.d.ts.map +1 -0
- package/dist/management-client.js +401 -0
- package/dist/management-client.js.map +1 -0
- package/dist/mcp-loader.d.ts +50 -0
- package/dist/mcp-loader.d.ts.map +1 -0
- package/dist/mcp-loader.js +83 -0
- package/dist/mcp-loader.js.map +1 -0
- package/dist/model-providers.d.ts +143 -0
- package/dist/model-providers.d.ts.map +1 -0
- package/dist/model-providers.js +228 -0
- package/dist/model-providers.js.map +1 -0
- package/dist/orchestration-registry.d.ts +7 -0
- package/dist/orchestration-registry.d.ts.map +1 -0
- package/dist/orchestration-registry.js +49 -0
- package/dist/orchestration-registry.js.map +1 -0
- package/dist/orchestration.d.ts +36 -0
- package/dist/orchestration.d.ts.map +1 -0
- package/dist/orchestration.js +1357 -0
- package/dist/orchestration.js.map +1 -0
- package/dist/orchestration_1_0_0.d.ts +20 -0
- package/dist/orchestration_1_0_0.d.ts.map +1 -0
- package/dist/orchestration_1_0_0.js +497 -0
- package/dist/orchestration_1_0_0.js.map +1 -0
- package/dist/orchestration_1_0_1.d.ts +19 -0
- package/dist/orchestration_1_0_1.d.ts.map +1 -0
- package/dist/orchestration_1_0_1.js +546 -0
- package/dist/orchestration_1_0_1.js.map +1 -0
- package/dist/orchestration_1_0_10.d.ts +36 -0
- package/dist/orchestration_1_0_10.d.ts.map +1 -0
- package/dist/orchestration_1_0_10.js +1253 -0
- package/dist/orchestration_1_0_10.js.map +1 -0
- package/dist/orchestration_1_0_11.d.ts +36 -0
- package/dist/orchestration_1_0_11.d.ts.map +1 -0
- package/dist/orchestration_1_0_11.js +1255 -0
- package/dist/orchestration_1_0_11.js.map +1 -0
- package/dist/orchestration_1_0_12.d.ts +36 -0
- package/dist/orchestration_1_0_12.d.ts.map +1 -0
- package/dist/orchestration_1_0_12.js +1250 -0
- package/dist/orchestration_1_0_12.js.map +1 -0
- package/dist/orchestration_1_0_13.d.ts +36 -0
- package/dist/orchestration_1_0_13.d.ts.map +1 -0
- package/dist/orchestration_1_0_13.js +1260 -0
- package/dist/orchestration_1_0_13.js.map +1 -0
- package/dist/orchestration_1_0_14.d.ts +36 -0
- package/dist/orchestration_1_0_14.d.ts.map +1 -0
- package/dist/orchestration_1_0_14.js +1258 -0
- package/dist/orchestration_1_0_14.js.map +1 -0
- package/dist/orchestration_1_0_15.d.ts +36 -0
- package/dist/orchestration_1_0_15.d.ts.map +1 -0
- package/dist/orchestration_1_0_15.js +1266 -0
- package/dist/orchestration_1_0_15.js.map +1 -0
- package/dist/orchestration_1_0_16.d.ts +36 -0
- package/dist/orchestration_1_0_16.d.ts.map +1 -0
- package/dist/orchestration_1_0_16.js +1275 -0
- package/dist/orchestration_1_0_16.js.map +1 -0
- package/dist/orchestration_1_0_17.d.ts +36 -0
- package/dist/orchestration_1_0_17.d.ts.map +1 -0
- package/dist/orchestration_1_0_17.js +1314 -0
- package/dist/orchestration_1_0_17.js.map +1 -0
- package/dist/orchestration_1_0_18.d.ts +36 -0
- package/dist/orchestration_1_0_18.d.ts.map +1 -0
- package/dist/orchestration_1_0_18.js +1328 -0
- package/dist/orchestration_1_0_18.js.map +1 -0
- package/dist/orchestration_1_0_19.d.ts +36 -0
- package/dist/orchestration_1_0_19.d.ts.map +1 -0
- package/dist/orchestration_1_0_19.js +1324 -0
- package/dist/orchestration_1_0_19.js.map +1 -0
- package/dist/orchestration_1_0_2.d.ts +19 -0
- package/dist/orchestration_1_0_2.d.ts.map +1 -0
- package/dist/orchestration_1_0_2.js +749 -0
- package/dist/orchestration_1_0_2.js.map +1 -0
- package/dist/orchestration_1_0_20.d.ts +36 -0
- package/dist/orchestration_1_0_20.d.ts.map +1 -0
- package/dist/orchestration_1_0_20.js +1347 -0
- package/dist/orchestration_1_0_20.js.map +1 -0
- package/dist/orchestration_1_0_3.d.ts +19 -0
- package/dist/orchestration_1_0_3.d.ts.map +1 -0
- package/dist/orchestration_1_0_3.js +826 -0
- package/dist/orchestration_1_0_3.js.map +1 -0
- package/dist/orchestration_1_0_4.d.ts +19 -0
- package/dist/orchestration_1_0_4.d.ts.map +1 -0
- package/dist/orchestration_1_0_4.js +1020 -0
- package/dist/orchestration_1_0_4.js.map +1 -0
- package/dist/orchestration_1_0_5.d.ts +19 -0
- package/dist/orchestration_1_0_5.d.ts.map +1 -0
- package/dist/orchestration_1_0_5.js +1027 -0
- package/dist/orchestration_1_0_5.js.map +1 -0
- package/dist/orchestration_1_0_6.d.ts +19 -0
- package/dist/orchestration_1_0_6.d.ts.map +1 -0
- package/dist/orchestration_1_0_6.js +1034 -0
- package/dist/orchestration_1_0_6.js.map +1 -0
- package/dist/orchestration_1_0_7.d.ts +19 -0
- package/dist/orchestration_1_0_7.d.ts.map +1 -0
- package/dist/orchestration_1_0_7.js +1085 -0
- package/dist/orchestration_1_0_7.js.map +1 -0
- package/dist/orchestration_1_0_8.d.ts +36 -0
- package/dist/orchestration_1_0_8.d.ts.map +1 -0
- package/dist/orchestration_1_0_8.js +1106 -0
- package/dist/orchestration_1_0_8.js.map +1 -0
- package/dist/orchestration_1_0_9.d.ts +36 -0
- package/dist/orchestration_1_0_9.d.ts.map +1 -0
- package/dist/orchestration_1_0_9.js +1207 -0
- package/dist/orchestration_1_0_9.js.map +1 -0
- package/dist/prompt-layering.d.ts +16 -0
- package/dist/prompt-layering.d.ts.map +1 -0
- package/dist/prompt-layering.js +60 -0
- package/dist/prompt-layering.js.map +1 -0
- package/dist/resourcemgr-tools.d.ts +27 -0
- package/dist/resourcemgr-tools.d.ts.map +1 -0
- package/dist/resourcemgr-tools.js +638 -0
- package/dist/resourcemgr-tools.js.map +1 -0
- package/dist/session-dumper.d.ts +26 -0
- package/dist/session-dumper.d.ts.map +1 -0
- package/dist/session-dumper.js +272 -0
- package/dist/session-dumper.js.map +1 -0
- package/dist/session-manager.d.ts +152 -0
- package/dist/session-manager.d.ts.map +1 -0
- package/dist/session-manager.js +493 -0
- package/dist/session-manager.js.map +1 -0
- package/dist/session-proxy.d.ts +68 -0
- package/dist/session-proxy.d.ts.map +1 -0
- package/dist/session-proxy.js +665 -0
- package/dist/session-proxy.js.map +1 -0
- package/dist/session-store.d.ts +35 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/session-store.js +88 -0
- package/dist/session-store.js.map +1 -0
- package/dist/skills.d.ts +31 -0
- package/dist/skills.d.ts.map +1 -0
- package/dist/skills.js +93 -0
- package/dist/skills.js.map +1 -0
- package/dist/sweeper-tools.d.ts +28 -0
- package/dist/sweeper-tools.d.ts.map +1 -0
- package/dist/sweeper-tools.js +332 -0
- package/dist/sweeper-tools.js.map +1 -0
- package/dist/types.d.ts +498 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/worker.d.ts +128 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +562 -0
- package/dist/worker.js.map +1 -0
- package/package.json +74 -0
- package/plugins/mgmt/agents/pilotswarm.agent.md +59 -0
- package/plugins/mgmt/agents/resourcemgr.agent.md +111 -0
- package/plugins/mgmt/agents/sweeper.agent.md +67 -0
- package/plugins/mgmt/skills/resourcemgr/SKILL.md +41 -0
- package/plugins/mgmt/skills/resourcemgr/tools.json +1 -0
- package/plugins/mgmt/skills/sweeper/SKILL.md +44 -0
- package/plugins/mgmt/skills/sweeper/tools.json +1 -0
- package/plugins/system/agents/default.agent.md +58 -0
- package/plugins/system/skills/durable-timers/SKILL.md +39 -0
- package/plugins/system/skills/sub-agents/SKILL.md +75 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP config loader — reads .mcp.json files from plugin directories.
|
|
3
|
+
*
|
|
4
|
+
* File format (matches @github/copilot-sdk MCPServerConfig):
|
|
5
|
+
*
|
|
6
|
+
* {
|
|
7
|
+
* "my-server": {
|
|
8
|
+
* "command": "node",
|
|
9
|
+
* "args": ["server.js"],
|
|
10
|
+
* "tools": ["*"]
|
|
11
|
+
* },
|
|
12
|
+
* "remote-api": {
|
|
13
|
+
* "type": "http",
|
|
14
|
+
* "url": "https://api.example.com/mcp",
|
|
15
|
+
* "tools": ["query"],
|
|
16
|
+
* "headers": { "Authorization": "Bearer ${MCP_TOKEN}" }
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* Environment variable references like `${VAR}` in string values
|
|
21
|
+
* are expanded at load time.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
/** Matches @github/copilot-sdk MCPServerConfig union. */
|
|
26
|
+
export type MCPServerConfig = MCPLocalServerConfig | MCPRemoteServerConfig;
|
|
27
|
+
export interface MCPLocalServerConfig {
|
|
28
|
+
type?: "local" | "stdio";
|
|
29
|
+
command: string;
|
|
30
|
+
args: string[];
|
|
31
|
+
tools: string[];
|
|
32
|
+
env?: Record<string, string>;
|
|
33
|
+
cwd?: string;
|
|
34
|
+
timeout?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface MCPRemoteServerConfig {
|
|
37
|
+
type: "http" | "sse";
|
|
38
|
+
url: string;
|
|
39
|
+
tools: string[];
|
|
40
|
+
headers?: Record<string, string>;
|
|
41
|
+
timeout?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Load MCP server config from a `.mcp.json` file in a plugin directory.
|
|
45
|
+
*
|
|
46
|
+
* @param pluginDir - Path to the plugin directory (looks for `.mcp.json` at root).
|
|
47
|
+
* @returns Record of server name → config. Empty record if no `.mcp.json` found.
|
|
48
|
+
*/
|
|
49
|
+
export declare function loadMcpConfig(pluginDir: string): Record<string, MCPServerConfig>;
|
|
50
|
+
//# sourceMappingURL=mcp-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-loader.d.ts","sourceRoot":"","sources":["../src/mcp-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAOH,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAE3E,MAAM,WAAW,oBAAoB;IACjC,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAyBD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAgChF"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP config loader — reads .mcp.json files from plugin directories.
|
|
3
|
+
*
|
|
4
|
+
* File format (matches @github/copilot-sdk MCPServerConfig):
|
|
5
|
+
*
|
|
6
|
+
* {
|
|
7
|
+
* "my-server": {
|
|
8
|
+
* "command": "node",
|
|
9
|
+
* "args": ["server.js"],
|
|
10
|
+
* "tools": ["*"]
|
|
11
|
+
* },
|
|
12
|
+
* "remote-api": {
|
|
13
|
+
* "type": "http",
|
|
14
|
+
* "url": "https://api.example.com/mcp",
|
|
15
|
+
* "tools": ["query"],
|
|
16
|
+
* "headers": { "Authorization": "Bearer ${MCP_TOKEN}" }
|
|
17
|
+
* }
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* Environment variable references like `${VAR}` in string values
|
|
21
|
+
* are expanded at load time.
|
|
22
|
+
*
|
|
23
|
+
* @module
|
|
24
|
+
*/
|
|
25
|
+
import fs from "node:fs";
|
|
26
|
+
import path from "node:path";
|
|
27
|
+
// ─── Env Expansion ──────────────────────────────────────────────
|
|
28
|
+
/** Expand `${VAR}` references in a string using process.env. */
|
|
29
|
+
function expandEnv(value) {
|
|
30
|
+
return value.replace(/\$\{(\w+)\}/g, (_, name) => process.env[name] ?? "");
|
|
31
|
+
}
|
|
32
|
+
/** Recursively expand env vars in all string values of an object. */
|
|
33
|
+
function expandEnvDeep(obj) {
|
|
34
|
+
if (typeof obj === "string")
|
|
35
|
+
return expandEnv(obj);
|
|
36
|
+
if (Array.isArray(obj))
|
|
37
|
+
return obj.map(expandEnvDeep);
|
|
38
|
+
if (obj && typeof obj === "object") {
|
|
39
|
+
const result = {};
|
|
40
|
+
for (const [key, value] of Object.entries(obj)) {
|
|
41
|
+
result[key] = expandEnvDeep(value);
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
// ─── Loader ─────────────────────────────────────────────────────
|
|
48
|
+
/**
|
|
49
|
+
* Load MCP server config from a `.mcp.json` file in a plugin directory.
|
|
50
|
+
*
|
|
51
|
+
* @param pluginDir - Path to the plugin directory (looks for `.mcp.json` at root).
|
|
52
|
+
* @returns Record of server name → config. Empty record if no `.mcp.json` found.
|
|
53
|
+
*/
|
|
54
|
+
export function loadMcpConfig(pluginDir) {
|
|
55
|
+
const absDir = path.resolve(pluginDir);
|
|
56
|
+
const mcpPath = path.join(absDir, ".mcp.json");
|
|
57
|
+
if (!fs.existsSync(mcpPath)) {
|
|
58
|
+
return {};
|
|
59
|
+
}
|
|
60
|
+
try {
|
|
61
|
+
const raw = fs.readFileSync(mcpPath, "utf-8");
|
|
62
|
+
const parsed = JSON.parse(raw);
|
|
63
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
|
|
64
|
+
console.warn(`[mcp-loader] Invalid .mcp.json in ${absDir}: expected object`);
|
|
65
|
+
return {};
|
|
66
|
+
}
|
|
67
|
+
// Expand env vars and validate each entry
|
|
68
|
+
const result = {};
|
|
69
|
+
for (const [name, config] of Object.entries(parsed)) {
|
|
70
|
+
if (typeof config !== "object" || config === null) {
|
|
71
|
+
console.warn(`[mcp-loader] Skipping MCP server "${name}": invalid config`);
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
result[name] = expandEnvDeep(config);
|
|
75
|
+
}
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
catch (err) {
|
|
79
|
+
console.warn(`[mcp-loader] Failed to parse .mcp.json in ${absDir}: ${err.message}`);
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
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a `model_providers.json` file that defines multiple LLM providers
|
|
5
|
+
* (GitHub Copilot, Azure OpenAI, OpenAI, Anthropic, local/Ollama) each with
|
|
6
|
+
* their own endpoints, API keys, and available models.
|
|
7
|
+
*
|
|
8
|
+
* Models are identified by normalized strings: `provider:model`
|
|
9
|
+
* (e.g. `github-copilot:claude-opus-4`, `azure-openai:gpt-4.1-mini`).
|
|
10
|
+
*
|
|
11
|
+
* Secrets use the `env:VAR_NAME` syntax to reference environment variables
|
|
12
|
+
* so keys stay in `.env` files while provider config stays in JSON.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
/** A model entry within a provider. */
|
|
17
|
+
export interface ModelEntry {
|
|
18
|
+
/** Model name (deployment name for Azure). */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Short description of when to use this model. */
|
|
21
|
+
description?: string;
|
|
22
|
+
/** Relative cost tier. */
|
|
23
|
+
cost?: "low" | "medium" | "high";
|
|
24
|
+
}
|
|
25
|
+
/** A single provider entry in model_providers.json. */
|
|
26
|
+
export interface ModelProviderConfig {
|
|
27
|
+
/** Unique identifier for this provider (e.g. "azure-openai", "github-copilot"). */
|
|
28
|
+
id: string;
|
|
29
|
+
/** Provider type. */
|
|
30
|
+
type: "github" | "azure" | "openai" | "anthropic";
|
|
31
|
+
/**
|
|
32
|
+
* GitHub token (type=github only). Supports `env:VAR_NAME` syntax.
|
|
33
|
+
* When type=github, the SDK uses the Copilot API — no baseUrl needed.
|
|
34
|
+
*/
|
|
35
|
+
githubToken?: string;
|
|
36
|
+
/**
|
|
37
|
+
* API endpoint URL. Required for non-github providers.
|
|
38
|
+
* For Azure: base URL without /deployments/ (e.g. https://resource.openai.azure.com/openai)
|
|
39
|
+
* For OpenAI: https://api.openai.com/v1
|
|
40
|
+
* For Anthropic: https://api.anthropic.com
|
|
41
|
+
*/
|
|
42
|
+
baseUrl?: string;
|
|
43
|
+
/** API key. Supports `env:VAR_NAME` syntax. */
|
|
44
|
+
apiKey?: string;
|
|
45
|
+
/** Azure API version (type=azure only). Defaults to "2024-10-21". */
|
|
46
|
+
apiVersion?: string;
|
|
47
|
+
/** Available models. Can be plain strings (legacy) or ModelEntry objects with descriptions. */
|
|
48
|
+
models: (string | ModelEntry)[];
|
|
49
|
+
}
|
|
50
|
+
/** Top-level model_providers.json schema. */
|
|
51
|
+
export interface ModelProvidersFile {
|
|
52
|
+
providers: ModelProviderConfig[];
|
|
53
|
+
/** Default model in `provider:model` format. */
|
|
54
|
+
defaultModel?: string;
|
|
55
|
+
}
|
|
56
|
+
/** A fully-resolved model descriptor for display and selection. */
|
|
57
|
+
export interface ModelDescriptor {
|
|
58
|
+
/** Normalized ID: `provider:model` */
|
|
59
|
+
qualifiedName: string;
|
|
60
|
+
/** Raw model name (for SDK config). */
|
|
61
|
+
modelName: string;
|
|
62
|
+
/** Provider ID. */
|
|
63
|
+
providerId: string;
|
|
64
|
+
/** Provider type. */
|
|
65
|
+
providerType: "github" | "azure" | "openai" | "anthropic";
|
|
66
|
+
/** Short description of when to use this model. */
|
|
67
|
+
description?: string;
|
|
68
|
+
/** Relative cost tier. */
|
|
69
|
+
cost?: "low" | "medium" | "high";
|
|
70
|
+
}
|
|
71
|
+
/** Resolved provider info for a specific model — ready to use. */
|
|
72
|
+
export interface ResolvedProvider {
|
|
73
|
+
/** The provider ID from model_providers.json. */
|
|
74
|
+
providerId: string;
|
|
75
|
+
/** Provider type. */
|
|
76
|
+
type: "github" | "azure" | "openai" | "anthropic";
|
|
77
|
+
/** Raw model name (for SDK config). */
|
|
78
|
+
modelName: string;
|
|
79
|
+
/** Resolved GitHub token (type=github only). */
|
|
80
|
+
githubToken?: string;
|
|
81
|
+
/**
|
|
82
|
+
* Copilot SDK ProviderConfig — passed to SessionConfig.provider.
|
|
83
|
+
* Undefined for type=github (uses githubToken instead).
|
|
84
|
+
*/
|
|
85
|
+
sdkProvider?: {
|
|
86
|
+
type: "openai" | "azure" | "anthropic";
|
|
87
|
+
baseUrl: string;
|
|
88
|
+
apiKey?: string;
|
|
89
|
+
azure?: {
|
|
90
|
+
apiVersion?: string;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* ModelProviderRegistry — loaded once at worker startup.
|
|
96
|
+
* Maps normalized `provider:model` strings to their provider configs.
|
|
97
|
+
*/
|
|
98
|
+
export declare class ModelProviderRegistry {
|
|
99
|
+
private providers;
|
|
100
|
+
/** Qualified name → ModelDescriptor */
|
|
101
|
+
private descriptors;
|
|
102
|
+
/** Qualified name → ModelProviderConfig */
|
|
103
|
+
private qualifiedToProvider;
|
|
104
|
+
/** Bare model name → first matching qualified name (for backwards compat). */
|
|
105
|
+
private bareToQualified;
|
|
106
|
+
private _defaultModel;
|
|
107
|
+
private _allDescriptors;
|
|
108
|
+
constructor(config: ModelProvidersFile);
|
|
109
|
+
/** Default model in `provider:model` format. */
|
|
110
|
+
get defaultModel(): string | undefined;
|
|
111
|
+
/** All model descriptors across all providers. */
|
|
112
|
+
get allModels(): ModelDescriptor[];
|
|
113
|
+
/** All provider configs. */
|
|
114
|
+
get allProviders(): ModelProviderConfig[];
|
|
115
|
+
/**
|
|
116
|
+
* Normalize a model reference to `provider:model` format.
|
|
117
|
+
* Accepts: `provider:model`, bare `model`, or undefined (→ default).
|
|
118
|
+
*/
|
|
119
|
+
normalize(ref?: string): string | undefined;
|
|
120
|
+
/** Get the ModelDescriptor for a model reference. */
|
|
121
|
+
getDescriptor(ref?: string): ModelDescriptor | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Resolve the provider for a model reference.
|
|
124
|
+
* Accepts `provider:model` or bare `model` name.
|
|
125
|
+
*/
|
|
126
|
+
resolve(ref?: string): ResolvedProvider | undefined;
|
|
127
|
+
/** Check if a model reference (qualified or bare) is known. */
|
|
128
|
+
hasModel(ref: string): boolean;
|
|
129
|
+
/** Get models grouped by provider, for display. */
|
|
130
|
+
getModelsByProvider(): Array<{
|
|
131
|
+
providerId: string;
|
|
132
|
+
type: string;
|
|
133
|
+
models: ModelDescriptor[];
|
|
134
|
+
}>;
|
|
135
|
+
/** Get a summary of all models suitable for LLM tool consumption. */
|
|
136
|
+
getModelSummaryForLLM(): string;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Load a model_providers.json file.
|
|
140
|
+
* Falls back to building a config from env vars for backwards compatibility.
|
|
141
|
+
*/
|
|
142
|
+
export declare function loadModelProviders(filePath?: string): ModelProviderRegistry | null;
|
|
143
|
+
//# sourceMappingURL=model-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-providers.d.ts","sourceRoot":"","sources":["../src/model-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAOH,uCAAuC;AACvC,MAAM,WAAW,UAAU;IACvB,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0BAA0B;IAC1B,IAAI,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;CACpC;AAED,uDAAuD;AACvD,MAAM,WAAW,mBAAmB;IAChC,mFAAmF;IACnF,EAAE,EAAE,MAAM,CAAC;IACX,qBAAqB;IACrB,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,GAAG,WAAW,CAAC;IAClD;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,MAAM,EAAE,CAAC,MAAM,GAAG,UAAU,CAAC,EAAE,CAAC;CACnC;AAED,6CAA6C;AAC7C,MAAM,WAAW,kBAAkB;IAC/B,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,gDAAgD;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E,kBAAkB;IAkCtC,gDAAgD;IAChD,IAAI,YAAY,IAAI,MAAM,GAAG,SAAS,CAErC;IAED,kDAAkD;IAClD,IAAI,SAAS,IAAI,eAAe,EAAE,CAEjC;IAED,4BAA4B;IAC5B,IAAI,YAAY,IAAI,mBAAmB,EAAE,CAExC;IAED;;;OAGG;IACH,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQ3C,qDAAqD;IACrD,aAAa,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAKxD;;;OAGG;IACH,OAAO,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS;IAuCnD,+DAA+D;IAC/D,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAI9B,mDAAmD;IACnD,mBAAmB,IAAI,KAAK,CAAC;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,eAAe,EAAE,CAAA;KAAE,CAAC;IAQ7F,qEAAqE;IACrE,qBAAqB,IAAI,MAAM;CAalC;AAID;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,qBAAqB,GAAG,IAAI,CAuBlF"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model provider registry — loads and resolves multi-provider LLM configuration.
|
|
3
|
+
*
|
|
4
|
+
* Reads a `model_providers.json` file that defines multiple LLM providers
|
|
5
|
+
* (GitHub Copilot, Azure OpenAI, OpenAI, Anthropic, local/Ollama) each with
|
|
6
|
+
* their own endpoints, API keys, and available models.
|
|
7
|
+
*
|
|
8
|
+
* Models are identified by normalized strings: `provider:model`
|
|
9
|
+
* (e.g. `github-copilot:claude-opus-4`, `azure-openai:gpt-4.1-mini`).
|
|
10
|
+
*
|
|
11
|
+
* Secrets use the `env:VAR_NAME` syntax to reference environment variables
|
|
12
|
+
* so keys stay in `.env` files while provider config stays in JSON.
|
|
13
|
+
*
|
|
14
|
+
* @module
|
|
15
|
+
*/
|
|
16
|
+
import fs from "node:fs";
|
|
17
|
+
import path from "node:path";
|
|
18
|
+
// ─── Registry ────────────────────────────────────────────────────
|
|
19
|
+
/**
|
|
20
|
+
* ModelProviderRegistry — loaded once at worker startup.
|
|
21
|
+
* Maps normalized `provider:model` strings to their provider configs.
|
|
22
|
+
*/
|
|
23
|
+
export class ModelProviderRegistry {
|
|
24
|
+
providers;
|
|
25
|
+
/** Qualified name → ModelDescriptor */
|
|
26
|
+
descriptors = new Map();
|
|
27
|
+
/** Qualified name → ModelProviderConfig */
|
|
28
|
+
qualifiedToProvider = new Map();
|
|
29
|
+
/** Bare model name → first matching qualified name (for backwards compat). */
|
|
30
|
+
bareToQualified = new Map();
|
|
31
|
+
_defaultModel;
|
|
32
|
+
_allDescriptors = [];
|
|
33
|
+
constructor(config) {
|
|
34
|
+
this.providers = config.providers;
|
|
35
|
+
this._defaultModel = config.defaultModel;
|
|
36
|
+
// Build lookups
|
|
37
|
+
for (const p of this.providers) {
|
|
38
|
+
for (const m of p.models) {
|
|
39
|
+
const entry = typeof m === "string" ? { name: m } : m;
|
|
40
|
+
const qualified = `${p.id}:${entry.name}`;
|
|
41
|
+
const desc = {
|
|
42
|
+
qualifiedName: qualified,
|
|
43
|
+
modelName: entry.name,
|
|
44
|
+
providerId: p.id,
|
|
45
|
+
providerType: p.type,
|
|
46
|
+
description: entry.description,
|
|
47
|
+
cost: entry.cost,
|
|
48
|
+
};
|
|
49
|
+
this.descriptors.set(qualified, desc);
|
|
50
|
+
this.qualifiedToProvider.set(qualified, p);
|
|
51
|
+
this._allDescriptors.push(desc);
|
|
52
|
+
// First provider to register a bare name wins
|
|
53
|
+
if (!this.bareToQualified.has(entry.name)) {
|
|
54
|
+
this.bareToQualified.set(entry.name, qualified);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// If no defaultModel, use first model of first provider
|
|
59
|
+
if (!this._defaultModel && this._allDescriptors.length > 0) {
|
|
60
|
+
this._defaultModel = this._allDescriptors[0].qualifiedName;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Default model in `provider:model` format. */
|
|
64
|
+
get defaultModel() {
|
|
65
|
+
return this._defaultModel;
|
|
66
|
+
}
|
|
67
|
+
/** All model descriptors across all providers. */
|
|
68
|
+
get allModels() {
|
|
69
|
+
return [...this._allDescriptors];
|
|
70
|
+
}
|
|
71
|
+
/** All provider configs. */
|
|
72
|
+
get allProviders() {
|
|
73
|
+
return [...this.providers];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Normalize a model reference to `provider:model` format.
|
|
77
|
+
* Accepts: `provider:model`, bare `model`, or undefined (→ default).
|
|
78
|
+
*/
|
|
79
|
+
normalize(ref) {
|
|
80
|
+
if (!ref)
|
|
81
|
+
return this._defaultModel;
|
|
82
|
+
if (ref.includes(":") && this.descriptors.has(ref))
|
|
83
|
+
return ref;
|
|
84
|
+
const qualified = this.bareToQualified.get(ref);
|
|
85
|
+
if (qualified)
|
|
86
|
+
return qualified;
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
/** Get the ModelDescriptor for a model reference. */
|
|
90
|
+
getDescriptor(ref) {
|
|
91
|
+
const q = this.normalize(ref);
|
|
92
|
+
return q ? this.descriptors.get(q) : undefined;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Resolve the provider for a model reference.
|
|
96
|
+
* Accepts `provider:model` or bare `model` name.
|
|
97
|
+
*/
|
|
98
|
+
resolve(ref) {
|
|
99
|
+
const q = this.normalize(ref);
|
|
100
|
+
if (!q)
|
|
101
|
+
return undefined;
|
|
102
|
+
const provider = this.qualifiedToProvider.get(q);
|
|
103
|
+
const desc = this.descriptors.get(q);
|
|
104
|
+
if (!provider || !desc)
|
|
105
|
+
return undefined;
|
|
106
|
+
if (provider.type === "github") {
|
|
107
|
+
return {
|
|
108
|
+
providerId: provider.id,
|
|
109
|
+
type: "github",
|
|
110
|
+
modelName: desc.modelName,
|
|
111
|
+
githubToken: resolveEnvValue(provider.githubToken),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
const baseUrl = provider.baseUrl;
|
|
115
|
+
if (!baseUrl)
|
|
116
|
+
return undefined;
|
|
117
|
+
const resolvedUrl = provider.type === "azure" && !baseUrl.includes("/deployments/")
|
|
118
|
+
? `${baseUrl.replace(/\/+$/, "")}/deployments/${desc.modelName}`
|
|
119
|
+
: baseUrl;
|
|
120
|
+
return {
|
|
121
|
+
providerId: provider.id,
|
|
122
|
+
type: provider.type,
|
|
123
|
+
modelName: desc.modelName,
|
|
124
|
+
sdkProvider: {
|
|
125
|
+
type: provider.type,
|
|
126
|
+
baseUrl: resolvedUrl,
|
|
127
|
+
apiKey: resolveEnvValue(provider.apiKey),
|
|
128
|
+
...(provider.type === "azure" && {
|
|
129
|
+
azure: { apiVersion: provider.apiVersion || "2024-10-21" },
|
|
130
|
+
}),
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
/** Check if a model reference (qualified or bare) is known. */
|
|
135
|
+
hasModel(ref) {
|
|
136
|
+
return this.normalize(ref) !== undefined;
|
|
137
|
+
}
|
|
138
|
+
/** Get models grouped by provider, for display. */
|
|
139
|
+
getModelsByProvider() {
|
|
140
|
+
return this.providers.map(p => ({
|
|
141
|
+
providerId: p.id,
|
|
142
|
+
type: p.type,
|
|
143
|
+
models: this._allDescriptors.filter(d => d.providerId === p.id),
|
|
144
|
+
}));
|
|
145
|
+
}
|
|
146
|
+
/** Get a summary of all models suitable for LLM tool consumption. */
|
|
147
|
+
getModelSummaryForLLM() {
|
|
148
|
+
const lines = ["Available models (use the qualified name to select):"];
|
|
149
|
+
for (const group of this.getModelsByProvider()) {
|
|
150
|
+
lines.push(`\n## ${group.providerId} (${group.type})`);
|
|
151
|
+
for (const m of group.models) {
|
|
152
|
+
const costLabel = m.cost ? ` [cost: ${m.cost}]` : "";
|
|
153
|
+
const desc = m.description ? ` — ${m.description}` : "";
|
|
154
|
+
lines.push(`- ${m.qualifiedName}${costLabel}${desc}`);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
lines.push(`\nDefault: ${this._defaultModel || "none"}`);
|
|
158
|
+
return lines.join("\n");
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// ─── Loader ──────────────────────────────────────────────────────
|
|
162
|
+
/**
|
|
163
|
+
* Load a model_providers.json file.
|
|
164
|
+
* Falls back to building a config from env vars for backwards compatibility.
|
|
165
|
+
*/
|
|
166
|
+
export function loadModelProviders(filePath) {
|
|
167
|
+
if (filePath && fs.existsSync(filePath)) {
|
|
168
|
+
const raw = fs.readFileSync(filePath, "utf-8");
|
|
169
|
+
return new ModelProviderRegistry(JSON.parse(raw));
|
|
170
|
+
}
|
|
171
|
+
const searchPaths = [
|
|
172
|
+
".model_providers.json",
|
|
173
|
+
path.join(process.cwd(), ".model_providers.json"),
|
|
174
|
+
"/app/.model_providers.json",
|
|
175
|
+
// Legacy fallback
|
|
176
|
+
"model_providers.json",
|
|
177
|
+
path.join(process.cwd(), "model_providers.json"),
|
|
178
|
+
"/app/model_providers.json",
|
|
179
|
+
];
|
|
180
|
+
for (const p of searchPaths) {
|
|
181
|
+
if (fs.existsSync(p)) {
|
|
182
|
+
const raw = fs.readFileSync(p, "utf-8");
|
|
183
|
+
return new ModelProviderRegistry(JSON.parse(raw));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return buildFromEnv();
|
|
187
|
+
}
|
|
188
|
+
/** Build a ModelProviderRegistry from legacy env vars. */
|
|
189
|
+
function buildFromEnv() {
|
|
190
|
+
const providers = [];
|
|
191
|
+
if (process.env.LLM_ENDPOINT) {
|
|
192
|
+
const type = (process.env.LLM_PROVIDER_TYPE || "openai");
|
|
193
|
+
const modelNames = process.env.LLM_MODELS
|
|
194
|
+
? process.env.LLM_MODELS.split(",").map(m => m.trim()).filter(Boolean)
|
|
195
|
+
: process.env.COPILOT_MODEL ? [process.env.COPILOT_MODEL] : [];
|
|
196
|
+
if (modelNames.length > 0) {
|
|
197
|
+
providers.push({
|
|
198
|
+
id: `env-${type}`,
|
|
199
|
+
type,
|
|
200
|
+
baseUrl: process.env.LLM_ENDPOINT,
|
|
201
|
+
apiKey: process.env.LLM_API_KEY ? `env:LLM_API_KEY` : undefined,
|
|
202
|
+
...(type === "azure" && { apiVersion: process.env.LLM_API_VERSION || "2024-10-21" }),
|
|
203
|
+
models: modelNames,
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (process.env.GITHUB_TOKEN) {
|
|
208
|
+
providers.push({
|
|
209
|
+
id: "github-copilot",
|
|
210
|
+
type: "github",
|
|
211
|
+
githubToken: "env:GITHUB_TOKEN",
|
|
212
|
+
models: ["claude-opus-4.6", "claude-sonnet-4.6", "gpt-4o"],
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
if (providers.length === 0)
|
|
216
|
+
return null;
|
|
217
|
+
return new ModelProviderRegistry({ providers });
|
|
218
|
+
}
|
|
219
|
+
// ─── Helpers ─────────────────────────────────────────────────────
|
|
220
|
+
function resolveEnvValue(value) {
|
|
221
|
+
if (!value)
|
|
222
|
+
return undefined;
|
|
223
|
+
if (value.startsWith("env:")) {
|
|
224
|
+
return process.env[value.slice(4)] || undefined;
|
|
225
|
+
}
|
|
226
|
+
return value;
|
|
227
|
+
}
|
|
228
|
+
//# sourceMappingURL=model-providers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-providers.js","sourceRoot":"","sources":["../src/model-providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAqF7B,oEAAoE;AAEpE;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IACtB,SAAS,CA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SAC7D,CAAC,CAAC;IACP,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACxC,OAAO,IAAI,qBAAqB,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,oEAAoE;AAEpE,SAAS,eAAe,CAAC,KAAc;IACnC,IAAI,CAAC,KAAK;QAAE,OAAO,SAAS,CAAC;IAC7B,IAAI,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const DURABLE_SESSION_ORCHESTRATION_NAME = "durable-session-v2";
|
|
2
|
+
export declare const DURABLE_SESSION_LATEST_VERSION = "1.0.21";
|
|
3
|
+
export declare const DURABLE_SESSION_ORCHESTRATION_REGISTRY: ReadonlyArray<{
|
|
4
|
+
version: string;
|
|
5
|
+
handler: any;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=orchestration-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestration-registry.d.ts","sourceRoot":"","sources":["../src/orchestration-registry.ts"],"names":[],"mappings":"AA0BA,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,8BAA8B,WAAgC,CAAC;AAE5E,eAAO,MAAM,sCAAsC,EAAE,aAAa,CAAC;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,GAAG,CAAC;CAChB,CAuBA,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { durableSessionOrchestration_1_0_0 } from "./orchestration_1_0_0.js";
|
|
2
|
+
import { durableSessionOrchestration_1_0_1 } from "./orchestration_1_0_1.js";
|
|
3
|
+
import { durableSessionOrchestration_1_0_2 } from "./orchestration_1_0_2.js";
|
|
4
|
+
import { durableSessionOrchestration_1_0_3 } from "./orchestration_1_0_3.js";
|
|
5
|
+
import { durableSessionOrchestration_1_0_4 } from "./orchestration_1_0_4.js";
|
|
6
|
+
import { durableSessionOrchestration_1_0_5 } from "./orchestration_1_0_5.js";
|
|
7
|
+
import { durableSessionOrchestration_1_0_6 } from "./orchestration_1_0_6.js";
|
|
8
|
+
import { durableSessionOrchestration_1_0_7 } from "./orchestration_1_0_7.js";
|
|
9
|
+
import { durableSessionOrchestration_1_0_8 } from "./orchestration_1_0_8.js";
|
|
10
|
+
import { durableSessionOrchestration_1_0_9 } from "./orchestration_1_0_9.js";
|
|
11
|
+
import { durableSessionOrchestration_1_0_10 } from "./orchestration_1_0_10.js";
|
|
12
|
+
import { durableSessionOrchestration_1_0_11 } from "./orchestration_1_0_11.js";
|
|
13
|
+
import { durableSessionOrchestration_1_0_12 } from "./orchestration_1_0_12.js";
|
|
14
|
+
import { durableSessionOrchestration_1_0_13 } from "./orchestration_1_0_13.js";
|
|
15
|
+
import { durableSessionOrchestration_1_0_14 } from "./orchestration_1_0_14.js";
|
|
16
|
+
import { durableSessionOrchestration_1_0_15 } from "./orchestration_1_0_15.js";
|
|
17
|
+
import { durableSessionOrchestration_1_0_16 } from "./orchestration_1_0_16.js";
|
|
18
|
+
import { durableSessionOrchestration_1_0_17 } from "./orchestration_1_0_17.js";
|
|
19
|
+
import { durableSessionOrchestration_1_0_18 } from "./orchestration_1_0_18.js";
|
|
20
|
+
import { durableSessionOrchestration_1_0_19 } from "./orchestration_1_0_19.js";
|
|
21
|
+
import { durableSessionOrchestration_1_0_20 } from "./orchestration_1_0_20.js";
|
|
22
|
+
import { CURRENT_ORCHESTRATION_VERSION, durableSessionOrchestration_1_0_21, } from "./orchestration.js";
|
|
23
|
+
export const DURABLE_SESSION_ORCHESTRATION_NAME = "durable-session-v2";
|
|
24
|
+
export const DURABLE_SESSION_LATEST_VERSION = CURRENT_ORCHESTRATION_VERSION;
|
|
25
|
+
export const DURABLE_SESSION_ORCHESTRATION_REGISTRY = [
|
|
26
|
+
{ version: "1.0.0", handler: durableSessionOrchestration_1_0_0 },
|
|
27
|
+
{ version: "1.0.1", handler: durableSessionOrchestration_1_0_1 },
|
|
28
|
+
{ version: "1.0.2", handler: durableSessionOrchestration_1_0_2 },
|
|
29
|
+
{ version: "1.0.3", handler: durableSessionOrchestration_1_0_3 },
|
|
30
|
+
{ version: "1.0.4", handler: durableSessionOrchestration_1_0_4 },
|
|
31
|
+
{ version: "1.0.5", handler: durableSessionOrchestration_1_0_5 },
|
|
32
|
+
{ version: "1.0.6", handler: durableSessionOrchestration_1_0_6 },
|
|
33
|
+
{ version: "1.0.7", handler: durableSessionOrchestration_1_0_7 },
|
|
34
|
+
{ version: "1.0.8", handler: durableSessionOrchestration_1_0_8 },
|
|
35
|
+
{ version: "1.0.9", handler: durableSessionOrchestration_1_0_9 },
|
|
36
|
+
{ version: "1.0.10", handler: durableSessionOrchestration_1_0_10 },
|
|
37
|
+
{ version: "1.0.11", handler: durableSessionOrchestration_1_0_11 },
|
|
38
|
+
{ version: "1.0.12", handler: durableSessionOrchestration_1_0_12 },
|
|
39
|
+
{ version: "1.0.13", handler: durableSessionOrchestration_1_0_13 },
|
|
40
|
+
{ version: "1.0.14", handler: durableSessionOrchestration_1_0_14 },
|
|
41
|
+
{ version: "1.0.15", handler: durableSessionOrchestration_1_0_15 },
|
|
42
|
+
{ version: "1.0.16", handler: durableSessionOrchestration_1_0_16 },
|
|
43
|
+
{ version: "1.0.17", handler: durableSessionOrchestration_1_0_17 },
|
|
44
|
+
{ version: "1.0.18", handler: durableSessionOrchestration_1_0_18 },
|
|
45
|
+
{ version: "1.0.19", handler: durableSessionOrchestration_1_0_19 },
|
|
46
|
+
{ version: "1.0.20", handler: durableSessionOrchestration_1_0_20 },
|
|
47
|
+
{ version: DURABLE_SESSION_LATEST_VERSION, handler: durableSessionOrchestration_1_0_21 },
|
|
48
|
+
];
|
|
49
|
+
//# sourceMappingURL=orchestration-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestration-registry.js","sourceRoot":"","sources":["../src/orchestration-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,iCAAiC,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,kCAAkC,EAAE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AE;IAClE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,kCAAkC,EAAE;IAClE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,kCAAkC,EAAE;IAClE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,kCAAkC,EAAE;IAClE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,kCAAkC,EAAE;IAClE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,kCAAkC,EAAE;IAClE,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,kCAAkC,EAAE;IAClE,EAAE,OAAO,EAAE,8BAA8B,EAAE,OAAO,EAAE,kCAAkC,EAAE;CAC3F,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { OrchestrationInput } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Long-lived durable session orchestration.
|
|
4
|
+
*
|
|
5
|
+
* One orchestration per copilot session. Uses:
|
|
6
|
+
* - SessionProxy for session-scoped operations (runTurn, dehydrate, hydrate, destroy)
|
|
7
|
+
* - SessionManagerProxy for global operations (listModels)
|
|
8
|
+
* - A single FIFO event queue ("messages") for all client→orchestration communication
|
|
9
|
+
*
|
|
10
|
+
* Main loop:
|
|
11
|
+
* 1. Dequeue message from "messages" queue
|
|
12
|
+
* 2. session.hydrate() if needed
|
|
13
|
+
* 3. session.runTurn(prompt) — returns TurnResult
|
|
14
|
+
* 4. Handle result: completed → idle wait, wait → timer, input → wait for answer
|
|
15
|
+
*
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export declare const CURRENT_ORCHESTRATION_VERSION = "1.0.21";
|
|
19
|
+
/**
|
|
20
|
+
* Long-lived durable session orchestration.
|
|
21
|
+
*
|
|
22
|
+
* One orchestration per copilot session. Uses:
|
|
23
|
+
* - SessionProxy for session-scoped operations (runTurn, dehydrate, hydrate, destroy)
|
|
24
|
+
* - SessionManagerProxy for global operations (listModels)
|
|
25
|
+
* - A single FIFO event queue ("messages") for all client→orchestration communication
|
|
26
|
+
*
|
|
27
|
+
* Main loop:
|
|
28
|
+
* 1. Dequeue message from "messages" queue
|
|
29
|
+
* 2. session.hydrate() if needed
|
|
30
|
+
* 3. session.runTurn(prompt) — returns TurnResult
|
|
31
|
+
* 4. Handle result: completed → idle wait, wait → timer, input → wait for answer
|
|
32
|
+
*
|
|
33
|
+
* @internal
|
|
34
|
+
*/
|
|
35
|
+
export declare function durableSessionOrchestration_1_0_21(ctx: any, input: OrchestrationInput): Generator<any, string, any>;
|
|
36
|
+
//# sourceMappingURL=orchestration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"orchestration.d.ts","sourceRoot":"","sources":["../src/orchestration.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAGR,kBAAkB,EASrB,MAAM,YAAY,CAAC;AAapB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,6BAA6B,WAAW,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,wBAAiB,kCAAkC,CAC/C,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,kBAAkB,GAC1B,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,CA28C7B"}
|