@openforge-ai/sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Forge AI Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/index.cjs ADDED
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ ForgeClient: () => ForgeClient
24
+ });
25
+ module.exports = __toCommonJS(index_exports);
26
+
27
+ // src/client.ts
28
+ var ForgeClient = class {
29
+ configPath;
30
+ stateDir;
31
+ environment;
32
+ constructor(options = {}) {
33
+ this.configPath = options.configPath ?? "forge.yaml";
34
+ this.stateDir = options.stateDir ?? ".forge";
35
+ this.environment = options.environment ?? "dev";
36
+ }
37
+ // TODO: Implement config loading with YAML parsing
38
+ async loadConfig() {
39
+ throw new Error("Not implemented \u2014 use @openforge-ai/cli for full functionality");
40
+ }
41
+ // TODO: Implement plan generation
42
+ async plan(_config) {
43
+ throw new Error("Not implemented \u2014 use @openforge-ai/cli for full functionality");
44
+ }
45
+ // TODO: Implement apply
46
+ async apply(_plan, _opts) {
47
+ throw new Error("Not implemented \u2014 use @openforge-ai/cli for full functionality");
48
+ }
49
+ // TODO: Load current state
50
+ async getState() {
51
+ throw new Error("Not implemented \u2014 use @openforge-ai/cli for full functionality");
52
+ }
53
+ getConfigPath() {
54
+ return this.configPath;
55
+ }
56
+ getStateDir() {
57
+ return this.stateDir;
58
+ }
59
+ getEnvironment() {
60
+ return this.environment;
61
+ }
62
+ };
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ ForgeClient
66
+ });
@@ -0,0 +1,113 @@
1
+ interface ForgeConfig {
2
+ version: "1";
3
+ agent: AgentConfig;
4
+ model: ModelConfig;
5
+ system_prompt?: SystemPromptConfig;
6
+ tools?: ToolsConfig;
7
+ memory?: MemoryConfig;
8
+ environments?: Record<string, EnvironmentOverride>;
9
+ hooks?: HooksConfig;
10
+ }
11
+ interface AgentConfig {
12
+ name: string;
13
+ description?: string;
14
+ }
15
+ interface ModelConfig {
16
+ provider: ModelProvider;
17
+ name: string;
18
+ temperature?: number;
19
+ max_tokens?: number;
20
+ }
21
+ type ModelProvider = "anthropic" | "openai" | "google" | "ollama" | "bedrock";
22
+ interface SystemPromptConfig {
23
+ file?: string;
24
+ inline?: string;
25
+ }
26
+ interface ToolsConfig {
27
+ mcp_servers?: McpServerConfig[];
28
+ }
29
+ interface McpServerConfig {
30
+ name: string;
31
+ command: string;
32
+ args?: string[];
33
+ env?: Record<string, string>;
34
+ }
35
+ interface MemoryConfig {
36
+ type: MemoryType;
37
+ provider?: MemoryProvider;
38
+ collection?: string;
39
+ }
40
+ type MemoryType = "none" | "in-context" | "vector";
41
+ type MemoryProvider = "chroma" | "pinecone" | "weaviate";
42
+ interface EnvironmentOverride {
43
+ model?: Partial<ModelConfig>;
44
+ tools?: ToolsConfig;
45
+ memory?: MemoryConfig;
46
+ }
47
+ interface HooksConfig {
48
+ pre_deploy?: HookStep[];
49
+ post_deploy?: HookStep[];
50
+ }
51
+ interface HookStep {
52
+ run: string;
53
+ }
54
+ interface AgentState {
55
+ configHash: string;
56
+ lastDeployed: string;
57
+ environment: string;
58
+ agentName: string;
59
+ agentVersion?: string;
60
+ config: ForgeConfig;
61
+ }
62
+ interface PlanResult {
63
+ toCreate: PlanItem[];
64
+ toUpdate: PlanItem[];
65
+ toDelete: PlanItem[];
66
+ noChange: PlanItem[];
67
+ hasChanges: boolean;
68
+ }
69
+ interface PlanItem {
70
+ resource: string;
71
+ field?: string;
72
+ oldValue?: unknown;
73
+ newValue?: unknown;
74
+ summary: string;
75
+ }
76
+ interface ApplyOptions {
77
+ dryRun: boolean;
78
+ environment: string;
79
+ autoApprove: boolean;
80
+ stateDir?: string;
81
+ }
82
+ interface ApplyResult {
83
+ success: boolean;
84
+ applied: PlanItem[];
85
+ skipped: PlanItem[];
86
+ error?: string;
87
+ state: AgentState;
88
+ }
89
+ interface ForgeClientOptions {
90
+ configPath?: string;
91
+ stateDir?: string;
92
+ environment?: string;
93
+ }
94
+
95
+ /**
96
+ * Programmatic API for Forge operations.
97
+ * Wraps the core engine functionality for use outside the CLI.
98
+ */
99
+ declare class ForgeClient {
100
+ private configPath;
101
+ private stateDir;
102
+ private environment;
103
+ constructor(options?: ForgeClientOptions);
104
+ loadConfig(): Promise<ForgeConfig>;
105
+ plan(_config: ForgeConfig): Promise<PlanResult>;
106
+ apply(_plan: PlanResult, _opts?: Partial<ApplyOptions>): Promise<ApplyResult>;
107
+ getState(): Promise<AgentState | null>;
108
+ getConfigPath(): string;
109
+ getStateDir(): string;
110
+ getEnvironment(): string;
111
+ }
112
+
113
+ export { type AgentConfig, type AgentState, type ApplyOptions, type ApplyResult, type EnvironmentOverride, ForgeClient, type ForgeClientOptions, type ForgeConfig, type HookStep, type HooksConfig, type McpServerConfig, type MemoryConfig, type MemoryProvider, type MemoryType, type ModelConfig, type ModelProvider, type PlanItem, type PlanResult, type SystemPromptConfig, type ToolsConfig };
@@ -0,0 +1,113 @@
1
+ interface ForgeConfig {
2
+ version: "1";
3
+ agent: AgentConfig;
4
+ model: ModelConfig;
5
+ system_prompt?: SystemPromptConfig;
6
+ tools?: ToolsConfig;
7
+ memory?: MemoryConfig;
8
+ environments?: Record<string, EnvironmentOverride>;
9
+ hooks?: HooksConfig;
10
+ }
11
+ interface AgentConfig {
12
+ name: string;
13
+ description?: string;
14
+ }
15
+ interface ModelConfig {
16
+ provider: ModelProvider;
17
+ name: string;
18
+ temperature?: number;
19
+ max_tokens?: number;
20
+ }
21
+ type ModelProvider = "anthropic" | "openai" | "google" | "ollama" | "bedrock";
22
+ interface SystemPromptConfig {
23
+ file?: string;
24
+ inline?: string;
25
+ }
26
+ interface ToolsConfig {
27
+ mcp_servers?: McpServerConfig[];
28
+ }
29
+ interface McpServerConfig {
30
+ name: string;
31
+ command: string;
32
+ args?: string[];
33
+ env?: Record<string, string>;
34
+ }
35
+ interface MemoryConfig {
36
+ type: MemoryType;
37
+ provider?: MemoryProvider;
38
+ collection?: string;
39
+ }
40
+ type MemoryType = "none" | "in-context" | "vector";
41
+ type MemoryProvider = "chroma" | "pinecone" | "weaviate";
42
+ interface EnvironmentOverride {
43
+ model?: Partial<ModelConfig>;
44
+ tools?: ToolsConfig;
45
+ memory?: MemoryConfig;
46
+ }
47
+ interface HooksConfig {
48
+ pre_deploy?: HookStep[];
49
+ post_deploy?: HookStep[];
50
+ }
51
+ interface HookStep {
52
+ run: string;
53
+ }
54
+ interface AgentState {
55
+ configHash: string;
56
+ lastDeployed: string;
57
+ environment: string;
58
+ agentName: string;
59
+ agentVersion?: string;
60
+ config: ForgeConfig;
61
+ }
62
+ interface PlanResult {
63
+ toCreate: PlanItem[];
64
+ toUpdate: PlanItem[];
65
+ toDelete: PlanItem[];
66
+ noChange: PlanItem[];
67
+ hasChanges: boolean;
68
+ }
69
+ interface PlanItem {
70
+ resource: string;
71
+ field?: string;
72
+ oldValue?: unknown;
73
+ newValue?: unknown;
74
+ summary: string;
75
+ }
76
+ interface ApplyOptions {
77
+ dryRun: boolean;
78
+ environment: string;
79
+ autoApprove: boolean;
80
+ stateDir?: string;
81
+ }
82
+ interface ApplyResult {
83
+ success: boolean;
84
+ applied: PlanItem[];
85
+ skipped: PlanItem[];
86
+ error?: string;
87
+ state: AgentState;
88
+ }
89
+ interface ForgeClientOptions {
90
+ configPath?: string;
91
+ stateDir?: string;
92
+ environment?: string;
93
+ }
94
+
95
+ /**
96
+ * Programmatic API for Forge operations.
97
+ * Wraps the core engine functionality for use outside the CLI.
98
+ */
99
+ declare class ForgeClient {
100
+ private configPath;
101
+ private stateDir;
102
+ private environment;
103
+ constructor(options?: ForgeClientOptions);
104
+ loadConfig(): Promise<ForgeConfig>;
105
+ plan(_config: ForgeConfig): Promise<PlanResult>;
106
+ apply(_plan: PlanResult, _opts?: Partial<ApplyOptions>): Promise<ApplyResult>;
107
+ getState(): Promise<AgentState | null>;
108
+ getConfigPath(): string;
109
+ getStateDir(): string;
110
+ getEnvironment(): string;
111
+ }
112
+
113
+ export { type AgentConfig, type AgentState, type ApplyOptions, type ApplyResult, type EnvironmentOverride, ForgeClient, type ForgeClientOptions, type ForgeConfig, type HookStep, type HooksConfig, type McpServerConfig, type MemoryConfig, type MemoryProvider, type MemoryType, type ModelConfig, type ModelProvider, type PlanItem, type PlanResult, type SystemPromptConfig, type ToolsConfig };
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ // src/client.ts
2
+ var ForgeClient = class {
3
+ configPath;
4
+ stateDir;
5
+ environment;
6
+ constructor(options = {}) {
7
+ this.configPath = options.configPath ?? "forge.yaml";
8
+ this.stateDir = options.stateDir ?? ".forge";
9
+ this.environment = options.environment ?? "dev";
10
+ }
11
+ // TODO: Implement config loading with YAML parsing
12
+ async loadConfig() {
13
+ throw new Error("Not implemented \u2014 use @openforge-ai/cli for full functionality");
14
+ }
15
+ // TODO: Implement plan generation
16
+ async plan(_config) {
17
+ throw new Error("Not implemented \u2014 use @openforge-ai/cli for full functionality");
18
+ }
19
+ // TODO: Implement apply
20
+ async apply(_plan, _opts) {
21
+ throw new Error("Not implemented \u2014 use @openforge-ai/cli for full functionality");
22
+ }
23
+ // TODO: Load current state
24
+ async getState() {
25
+ throw new Error("Not implemented \u2014 use @openforge-ai/cli for full functionality");
26
+ }
27
+ getConfigPath() {
28
+ return this.configPath;
29
+ }
30
+ getStateDir() {
31
+ return this.stateDir;
32
+ }
33
+ getEnvironment() {
34
+ return this.environment;
35
+ }
36
+ };
37
+ export {
38
+ ForgeClient
39
+ };
package/package.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "@openforge-ai/sdk",
3
+ "version": "0.1.0",
4
+ "description": "TypeScript SDK and types for Forge agent infrastructure",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/seanfraserio/forge.git",
10
+ "directory": "packages/sdk"
11
+ },
12
+ "publishConfig": {
13
+ "access": "public"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "keywords": [
19
+ "forge",
20
+ "ai",
21
+ "agents",
22
+ "sdk",
23
+ "types"
24
+ ],
25
+ "main": "./dist/index.cjs",
26
+ "module": "./dist/index.js",
27
+ "types": "./dist/index.d.ts",
28
+ "exports": {
29
+ ".": {
30
+ "import": "./dist/index.js",
31
+ "require": "./dist/index.cjs"
32
+ }
33
+ },
34
+ "devDependencies": {
35
+ "tsup": "^8.0.0",
36
+ "typescript": "^5.4.0",
37
+ "vitest": "^1.4.0"
38
+ },
39
+ "scripts": {
40
+ "build": "tsup src/index.ts --format esm,cjs --dts",
41
+ "test": "vitest run",
42
+ "dev": "tsup src/index.ts --format esm,cjs --dts --watch",
43
+ "typecheck": "tsc --noEmit"
44
+ }
45
+ }