esoul-sdk 0.3.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/README.md +61 -0
- package/bin/esoul-plugin.mjs +110 -0
- package/dist/files.d.ts +59 -0
- package/dist/files.js +39 -0
- package/dist/helpers.d.ts +40 -0
- package/dist/helpers.js +93 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/manifest.d.ts +359 -0
- package/dist/manifest.js +136 -0
- package/dist/react.d.ts +85 -0
- package/dist/react.js +43 -0
- package/dist/server.d.ts +189 -0
- package/dist/server.js +58 -0
- package/dist/testing/index.d.ts +20 -0
- package/dist/testing/index.js +121 -0
- package/dist/types.d.ts +226 -0
- package/dist/types.js +6 -0
- package/docs/01-getting-started.md +114 -0
- package/docs/02-manifest.md +52 -0
- package/docs/03-events-and-state.md +92 -0
- package/docs/04-tools.md +85 -0
- package/docs/05-ui.md +86 -0
- package/docs/06-server.md +78 -0
- package/docs/07-background-tasks.md +61 -0
- package/docs/08-connections.md +49 -0
- package/docs/09-files.md +35 -0
- package/docs/10-testing.md +62 -0
- package/docs/11-shipping.md +70 -0
- package/docs/12-rules.md +37 -0
- package/llms-full.txt +934 -0
- package/llms.txt +23 -0
- package/package.json +80 -0
- package/schemas/plugin.schema.json +263 -0
- package/scripts/build-llms.mjs +36 -0
package/llms.txt
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# esoul-sdk
|
|
2
|
+
|
|
3
|
+
> Build ExternalSoul apps: event-sourced state, agent tools on every surface, server ops and webhooks,
|
|
4
|
+
> durable background tasks, OAuth connections held by the platform, files. Apps are built and tested
|
|
5
|
+
> in the Forge workbench, submitted as a pull request, reviewed, released by one script, then added
|
|
6
|
+
> to a workspace like any native app.
|
|
7
|
+
|
|
8
|
+
- llms-full.txt — the complete contract in one file (read it whole)
|
|
9
|
+
- docs/01-getting-started.md — Getting started
|
|
10
|
+
- docs/02-manifest.md — The manifest — `plugin.json`
|
|
11
|
+
- docs/03-events-and-state.md — Events and state — the heart of the contract
|
|
12
|
+
- docs/04-tools.md — Tools — what agents call
|
|
13
|
+
- docs/05-ui.md — The UI
|
|
14
|
+
- docs/06-server.md — The server half — `server.ts`
|
|
15
|
+
- docs/07-background-tasks.md — Background tasks — durable work
|
|
16
|
+
- docs/08-connections.md — Connections and OAuth — tokens the platform holds for you
|
|
17
|
+
- docs/09-files.md — Files — workspace files, Drive, your own provider
|
|
18
|
+
- docs/10-testing.md — Testing — the fold contract as tests
|
|
19
|
+
- docs/11-shipping.md — Shipping — submit, review, release, install
|
|
20
|
+
- docs/12-rules.md — Rules and failures — every rule with the failure that earned it
|
|
21
|
+
|
|
22
|
+
The one rule behind the others: events are the truth — pure idempotent processors, ids minted in
|
|
23
|
+
dataCreators, collapse keys on bursts, and an app reaches the platform only through esoul-sdk.
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "esoul-sdk",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Build ExternalSoul apps: event-sourced state, agent tools, server ops, background tasks, OAuth connections, files — the contract the Forge compiles against.",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./server": {
|
|
15
|
+
"types": "./dist/server.d.ts",
|
|
16
|
+
"default": "./dist/server.js"
|
|
17
|
+
},
|
|
18
|
+
"./react": {
|
|
19
|
+
"types": "./dist/react.d.ts",
|
|
20
|
+
"default": "./dist/react.js"
|
|
21
|
+
},
|
|
22
|
+
"./testing": {
|
|
23
|
+
"types": "./dist/testing/index.d.ts",
|
|
24
|
+
"default": "./dist/testing/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./llms-full.txt": "./llms-full.txt",
|
|
27
|
+
"./schemas/plugin.schema.json": "./schemas/plugin.schema.json"
|
|
28
|
+
},
|
|
29
|
+
"bin": {
|
|
30
|
+
"esoul-app": "bin/esoul-plugin.mjs"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"bin",
|
|
35
|
+
"schemas",
|
|
36
|
+
"docs",
|
|
37
|
+
"scripts/build-llms.mjs",
|
|
38
|
+
"llms.txt",
|
|
39
|
+
"llms-full.txt",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc -p tsconfig.json",
|
|
44
|
+
"docs:llms": "node scripts/build-llms.mjs",
|
|
45
|
+
"prepack": "npm run docs:llms && npm run build"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"zod": "^3.25.0",
|
|
49
|
+
"nanoid": "^5.0.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"react": ">=18",
|
|
53
|
+
"react-redux": ">=9"
|
|
54
|
+
},
|
|
55
|
+
"peerDependenciesMeta": {
|
|
56
|
+
"react": {
|
|
57
|
+
"optional": true
|
|
58
|
+
},
|
|
59
|
+
"react-redux": {
|
|
60
|
+
"optional": true
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
"keywords": [
|
|
64
|
+
"externalsoul",
|
|
65
|
+
"esoul",
|
|
66
|
+
"plugin",
|
|
67
|
+
"sdk",
|
|
68
|
+
"agent",
|
|
69
|
+
"event-sourcing"
|
|
70
|
+
],
|
|
71
|
+
"repository": {
|
|
72
|
+
"type": "git",
|
|
73
|
+
"url": "git+https://github.com/vyomkeshj/ExternalSoul.git",
|
|
74
|
+
"directory": "packages/esoul-sdk"
|
|
75
|
+
},
|
|
76
|
+
"homepage": "https://externalsoul.com",
|
|
77
|
+
"publishConfig": {
|
|
78
|
+
"access": "public"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/PluginManifest",
|
|
3
|
+
"definitions": {
|
|
4
|
+
"PluginManifest": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"manifestVersion": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"const": 1
|
|
10
|
+
},
|
|
11
|
+
"id": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
14
|
+
},
|
|
15
|
+
"name": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"minLength": 1,
|
|
18
|
+
"maxLength": 80
|
|
19
|
+
},
|
|
20
|
+
"version": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$"
|
|
23
|
+
},
|
|
24
|
+
"description": {
|
|
25
|
+
"type": "string",
|
|
26
|
+
"minLength": 1,
|
|
27
|
+
"maxLength": 500
|
|
28
|
+
},
|
|
29
|
+
"applicationType": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"pattern": "^plugin_[a-z0-9_]*$"
|
|
32
|
+
},
|
|
33
|
+
"entry": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"pattern": "^[a-zA-Z0-9_-]+$"
|
|
36
|
+
},
|
|
37
|
+
"icon": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"pattern": "^[A-Z][A-Za-z0-9]*$",
|
|
40
|
+
"maxLength": 40
|
|
41
|
+
},
|
|
42
|
+
"author": {
|
|
43
|
+
"type": "object",
|
|
44
|
+
"properties": {
|
|
45
|
+
"name": {
|
|
46
|
+
"type": "string"
|
|
47
|
+
},
|
|
48
|
+
"email": {
|
|
49
|
+
"type": "string"
|
|
50
|
+
},
|
|
51
|
+
"url": {
|
|
52
|
+
"type": "string"
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"required": [
|
|
56
|
+
"name"
|
|
57
|
+
],
|
|
58
|
+
"additionalProperties": false
|
|
59
|
+
},
|
|
60
|
+
"kickableTasks": {
|
|
61
|
+
"type": "array",
|
|
62
|
+
"items": {
|
|
63
|
+
"type": "string"
|
|
64
|
+
},
|
|
65
|
+
"default": []
|
|
66
|
+
},
|
|
67
|
+
"webhooks": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"type": "string",
|
|
71
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
72
|
+
},
|
|
73
|
+
"default": []
|
|
74
|
+
},
|
|
75
|
+
"ops": {
|
|
76
|
+
"type": "array",
|
|
77
|
+
"items": {
|
|
78
|
+
"type": "string",
|
|
79
|
+
"pattern": "^[a-z][a-z0-9_-]*$"
|
|
80
|
+
},
|
|
81
|
+
"default": []
|
|
82
|
+
},
|
|
83
|
+
"pollTasks": {
|
|
84
|
+
"type": "array",
|
|
85
|
+
"items": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"properties": {
|
|
88
|
+
"task": {
|
|
89
|
+
"type": "string"
|
|
90
|
+
},
|
|
91
|
+
"everyMinutes": {
|
|
92
|
+
"type": "integer",
|
|
93
|
+
"minimum": 5,
|
|
94
|
+
"maximum": 1440
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"required": [
|
|
98
|
+
"task",
|
|
99
|
+
"everyMinutes"
|
|
100
|
+
],
|
|
101
|
+
"additionalProperties": false
|
|
102
|
+
},
|
|
103
|
+
"default": []
|
|
104
|
+
},
|
|
105
|
+
"platformApi": {
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"min": {
|
|
109
|
+
"type": "string",
|
|
110
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$"
|
|
111
|
+
},
|
|
112
|
+
"max": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$"
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
"required": [
|
|
118
|
+
"min"
|
|
119
|
+
],
|
|
120
|
+
"additionalProperties": false
|
|
121
|
+
},
|
|
122
|
+
"scopes": {
|
|
123
|
+
"type": "array",
|
|
124
|
+
"items": {
|
|
125
|
+
"type": "string"
|
|
126
|
+
},
|
|
127
|
+
"default": []
|
|
128
|
+
},
|
|
129
|
+
"workspaceTools": {
|
|
130
|
+
"type": "array",
|
|
131
|
+
"items": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"pattern": "^[a-z][a-z0-9_]*:[a-z][a-z0-9_]*$"
|
|
134
|
+
},
|
|
135
|
+
"default": []
|
|
136
|
+
},
|
|
137
|
+
"connections": {
|
|
138
|
+
"type": "array",
|
|
139
|
+
"items": {
|
|
140
|
+
"type": "object",
|
|
141
|
+
"properties": {
|
|
142
|
+
"key": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
145
|
+
},
|
|
146
|
+
"kind": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"enum": [
|
|
149
|
+
"oauth2",
|
|
150
|
+
"apiKey"
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
"label": {
|
|
154
|
+
"type": "string",
|
|
155
|
+
"minLength": 1,
|
|
156
|
+
"maxLength": 60
|
|
157
|
+
},
|
|
158
|
+
"description": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"maxLength": 300
|
|
161
|
+
},
|
|
162
|
+
"authorizeUrl": {
|
|
163
|
+
"type": "string",
|
|
164
|
+
"format": "uri"
|
|
165
|
+
},
|
|
166
|
+
"tokenUrl": {
|
|
167
|
+
"type": "string",
|
|
168
|
+
"format": "uri"
|
|
169
|
+
},
|
|
170
|
+
"oauthScopes": {
|
|
171
|
+
"type": "array",
|
|
172
|
+
"items": {
|
|
173
|
+
"type": "string"
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"clientIdEnv": {
|
|
177
|
+
"type": "string",
|
|
178
|
+
"pattern": "^[A-Z][A-Z0-9_]*$"
|
|
179
|
+
},
|
|
180
|
+
"clientSecretEnv": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"pattern": "^[A-Z][A-Z0-9_]*$"
|
|
183
|
+
},
|
|
184
|
+
"headerNames": {
|
|
185
|
+
"type": "array",
|
|
186
|
+
"items": {
|
|
187
|
+
"type": "string"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"required": [
|
|
192
|
+
"key",
|
|
193
|
+
"kind",
|
|
194
|
+
"label"
|
|
195
|
+
],
|
|
196
|
+
"additionalProperties": false
|
|
197
|
+
},
|
|
198
|
+
"default": []
|
|
199
|
+
},
|
|
200
|
+
"fileSources": {
|
|
201
|
+
"type": "object",
|
|
202
|
+
"properties": {
|
|
203
|
+
"workspace": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"enum": [
|
|
206
|
+
"read",
|
|
207
|
+
"readwrite"
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"providers": {
|
|
211
|
+
"type": "array",
|
|
212
|
+
"items": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
215
|
+
},
|
|
216
|
+
"default": []
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"additionalProperties": false
|
|
220
|
+
},
|
|
221
|
+
"fileProviders": {
|
|
222
|
+
"type": "array",
|
|
223
|
+
"items": {
|
|
224
|
+
"type": "object",
|
|
225
|
+
"properties": {
|
|
226
|
+
"key": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
229
|
+
},
|
|
230
|
+
"connectionKey": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
233
|
+
},
|
|
234
|
+
"label": {
|
|
235
|
+
"type": "string",
|
|
236
|
+
"minLength": 1,
|
|
237
|
+
"maxLength": 60
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"required": [
|
|
241
|
+
"key",
|
|
242
|
+
"connectionKey",
|
|
243
|
+
"label"
|
|
244
|
+
],
|
|
245
|
+
"additionalProperties": false
|
|
246
|
+
},
|
|
247
|
+
"default": []
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
"required": [
|
|
251
|
+
"manifestVersion",
|
|
252
|
+
"id",
|
|
253
|
+
"name",
|
|
254
|
+
"version",
|
|
255
|
+
"description",
|
|
256
|
+
"applicationType",
|
|
257
|
+
"entry"
|
|
258
|
+
],
|
|
259
|
+
"additionalProperties": false
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
263
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Regenerate llms.txt (short) and llms-full.txt (the whole contract) from README + docs/,
|
|
4
|
+
* so a coding model reads exactly what a person reads. `npm run docs:llms`.
|
|
5
|
+
*/
|
|
6
|
+
import { readFileSync, readdirSync, writeFileSync } from "node:fs";
|
|
7
|
+
import { dirname, join } from "node:path";
|
|
8
|
+
import { fileURLToPath } from "node:url";
|
|
9
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
10
|
+
const pages = readdirSync(join(root, "docs")).filter((f) => /^\d\d-.*\.md$/.test(f)).sort();
|
|
11
|
+
const full = [
|
|
12
|
+
"# esoul-sdk — the complete contract for building ExternalSoul apps (llms-full.txt)",
|
|
13
|
+
"",
|
|
14
|
+
"Generated from README.md and docs/. Read it whole. Every rule carries the failure that earned it.",
|
|
15
|
+
"",
|
|
16
|
+
readFileSync(join(root, "README.md"), "utf8"),
|
|
17
|
+
...pages.map((f) => `\n\n${"=".repeat(78)}\n${readFileSync(join(root, "docs", f), "utf8")}`),
|
|
18
|
+
].join("\n");
|
|
19
|
+
writeFileSync(join(root, "llms-full.txt"), full);
|
|
20
|
+
const short = [
|
|
21
|
+
"# esoul-sdk",
|
|
22
|
+
"",
|
|
23
|
+
"> Build ExternalSoul apps: event-sourced state, agent tools on every surface, server ops and webhooks,",
|
|
24
|
+
"> durable background tasks, OAuth connections held by the platform, files. Apps are built and tested",
|
|
25
|
+
"> in the Forge workbench, submitted as a pull request, reviewed, released by one script, then added",
|
|
26
|
+
"> to a workspace like any native app.",
|
|
27
|
+
"",
|
|
28
|
+
"- llms-full.txt — the complete contract in one file (read it whole)",
|
|
29
|
+
...pages.map((f) => `- docs/${f} — ${readFileSync(join(root, "docs", f), "utf8").split("\n")[0].replace(/^#\s*\d+\.\s*/, "")}`),
|
|
30
|
+
"",
|
|
31
|
+
"The one rule behind the others: events are the truth — pure idempotent processors, ids minted in",
|
|
32
|
+
"dataCreators, collapse keys on bursts, and an app reaches the platform only through esoul-sdk.",
|
|
33
|
+
"",
|
|
34
|
+
].join("\n");
|
|
35
|
+
writeFileSync(join(root, "llms.txt"), short);
|
|
36
|
+
console.log(`llms-full.txt ${full.length} chars from ${pages.length} pages; llms.txt ${short.length} chars`);
|