@agentage/extension 0.16.0 → 0.18.1
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/api/download.d.ts +14 -0
- package/dist/api/download.js +10 -0
- package/dist/api/files-registry.d.ts +17 -0
- package/dist/api/files-registry.js +10 -0
- package/dist/api/files.d.ts +8 -0
- package/dist/api/files.js +82 -0
- package/dist/api/openapi-doc.js +21 -12
- package/dist/api/routes.d.ts +10 -1
- package/dist/api/routes.js +15 -2
- package/dist/auth/token-check.d.ts +1 -1
- package/dist/auth/verify-token.js +9 -9
- package/dist/context/test-context.d.ts +5 -1
- package/dist/context/test-context.js +2 -1
- package/dist/host/daemon/app-files.d.ts +13 -0
- package/dist/host/daemon/app-files.js +51 -0
- package/dist/host/daemon/app-header.d.ts +3 -0
- package/dist/host/daemon/app-header.js +12 -0
- package/dist/host/daemon/app-reload.d.ts +10 -0
- package/dist/host/daemon/app-reload.js +18 -0
- package/dist/host/daemon/child.d.ts +1 -0
- package/dist/host/daemon/child.js +7 -4
- package/dist/host/daemon/cli-user-watch.d.ts +8 -0
- package/dist/host/daemon/cli-user-watch.js +43 -0
- package/dist/host/daemon/cli-user.d.ts +2 -0
- package/dist/host/daemon/cli-user.js +42 -0
- package/dist/host/daemon/daemon.d.ts +1 -0
- package/dist/host/daemon/daemon.js +13 -1
- package/dist/host/daemon/health-routes.d.ts +2 -0
- package/dist/host/daemon/health-routes.js +29 -15
- package/dist/host/daemon/limits.d.ts +1 -0
- package/dist/host/daemon/limits.js +2 -0
- package/dist/host/daemon/routes.js +25 -7
- package/dist/host/daemon/seal.d.ts +6 -2
- package/dist/host/daemon/seal.js +9 -2
- package/dist/host/daemon/shell-events.d.ts +9 -0
- package/dist/host/daemon/shell-events.js +36 -0
- package/dist/host/daemon/shell-routes.d.ts +28 -0
- package/dist/host/daemon/shell-routes.js +63 -0
- package/dist/host/daemon/supervisor.d.ts +2 -0
- package/dist/host/daemon/supervisor.js +2 -1
- package/dist/host/data-lock.js +5 -5
- package/dist/host/host-env.js +14 -2
- package/dist/host/host-extension.js +4 -3
- package/dist/host/host-git-store.d.ts +10 -0
- package/dist/host/host-git-store.js +36 -0
- package/dist/host/host-migrations.d.ts +1 -1
- package/dist/host/host-migrations.js +2 -2
- package/dist/host/host-parts.d.ts +2 -2
- package/dist/host/host-parts.js +1 -1
- package/dist/host/host-url-store.d.ts +4 -2
- package/dist/host/host-url-store.js +18 -15
- package/dist/host/open-store.d.ts +6 -0
- package/dist/host/open-store.js +6 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3 -1
- package/dist/manifest/manifest.schema.d.ts +13 -0
- package/dist/manifest/manifest.schema.js +16 -2
- package/dist/manifest/parts.d.ts +7 -0
- package/dist/manifest/parts.js +5 -0
- package/dist/manifest/primitives.schema.js +3 -3
- package/dist/mcp/connector.d.ts +4 -0
- package/dist/mcp/connector.js +11 -0
- package/dist/mcp/mcp-app.d.ts +4 -1
- package/dist/mcp/mcp-app.js +28 -18
- package/dist/mcp/server.d.ts +6 -3
- package/dist/mcp/server.js +70 -18
- package/dist/mcp/tools.d.ts +40 -4
- package/dist/mcp/tools.js +34 -12
- package/dist/runtime/part-mounts.js +12 -6
- package/dist/runtime/run-part.js +22 -6
- package/dist/server/api-routes.d.ts +5 -2
- package/dist/server/api-routes.js +41 -14
- package/dist/server/app.d.ts +3 -0
- package/dist/server/app.js +11 -1
- package/dist/server/send-download.d.ts +3 -0
- package/dist/server/send-download.js +29 -0
- package/dist/shell/dist/index.html +46 -0
- package/dist/shell/dist/shell.css +2 -0
- package/dist/shell/dist/shell.js +68 -0
- package/dist/shell/dist/vendor/app.js +1 -0
- package/dist/shell/dist/vendor/chunk-AOJ3DQEL.js +14 -0
- package/dist/shell/dist/vendor/chunk-LW5HXGAJ.js +14 -0
- package/dist/shell/dist/vendor/chunk-PQJPUKWH.js +14 -0
- package/dist/shell/dist/vendor/chunk-SQE76S5B.js +1 -0
- package/dist/shell/dist/vendor/jsx-runtime.js +1 -0
- package/dist/shell/dist/vendor/react-dom-client.js +33 -0
- package/dist/shell/dist/vendor/react-dom.js +1 -0
- package/dist/shell/dist/vendor/react.js +1 -0
- package/dist/shell/package.json +5 -0
- package/dist/store/git-env.d.ts +11 -0
- package/dist/store/git-env.js +44 -0
- package/dist/store/store-url.d.ts +1 -1
- package/dist/store/store-url.js +2 -0
- package/dist/store/store.types.d.ts +3 -0
- package/dist/store/store.types.js +1 -1
- package/dist/testing/test-server.js +11 -12
- package/dist/tool/app-build.d.ts +13 -0
- package/dist/tool/app-build.js +126 -0
- package/dist/tool/app-load.d.ts +4 -0
- package/dist/tool/app-load.js +34 -0
- package/dist/tool/build.js +5 -2
- package/dist/tool/check.js +4 -2
- package/dist/tool/container-recipe.d.ts +9 -2
- package/dist/tool/container-recipe.js +14 -9
- package/dist/tool/container-stage.js +1 -1
- package/dist/tool/index.d.ts +1 -0
- package/dist/tool/index.js +1 -0
- package/dist/tool/main.d.ts +2 -0
- package/dist/tool/main.js +8 -1
- package/dist/tool/recipe.d.ts +1 -1
- package/dist/tool/recipe.js +16 -6
- package/dist/tool/record-extras.js +4 -3
- package/dist/tool/rules/folders.js +1 -1
- package/dist/tool/rules/sealing.js +4 -0
- package/dist/tool/rules/store.js +0 -3
- package/dist/tool/rules/surface.js +4 -1
- package/dist/tool/stage.js +2 -2
- package/dist/tool/up/compose.d.ts +4 -0
- package/dist/tool/up/compose.js +41 -3
- package/dist/tool/up/gateway.js +16 -3
- package/dist/tool/up/secrets.d.ts +1 -0
- package/dist/tool/up/secrets.js +13 -1
- package/dist/tool/up/up.js +8 -5
- package/dist/vendor/app/api.d.ts +9 -0
- package/dist/vendor/app/api.js +63 -0
- package/dist/vendor/app/app.types.d.ts +65 -0
- package/dist/vendor/app/app.types.js +1 -0
- package/dist/vendor/app/boundary.d.ts +15 -0
- package/dist/vendor/app/boundary.js +17 -0
- package/dist/vendor/app/context.d.ts +5 -0
- package/dist/vendor/app/context.js +22 -0
- package/dist/vendor/app/index.d.ts +7 -0
- package/dist/vendor/app/index.js +6 -0
- package/dist/vendor/app/region.d.ts +6 -0
- package/dist/vendor/app/region.js +14 -0
- package/dist/vendor/app/split.d.ts +20 -0
- package/dist/vendor/app/split.js +38 -0
- package/dist/vendor/app/state-store.d.ts +3 -0
- package/dist/vendor/app/state-store.js +35 -0
- package/dist/vendor/app/test-host.d.ts +29 -0
- package/dist/vendor/app/test-host.js +66 -0
- package/dist/vendor/app/theme.css +32 -0
- package/package.json +35 -2
- package/schemas/extension-discovery.schema.json +1 -1
- package/schemas/extension-package.schema.json +28 -1
- package/schemas/extension-record.schema.json +1 -1
- package/schemas/health.schema.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { AppRoute, AppUser, AsideKey, BottomBar, Notice, PageLink, StateStore } from './app.types.js';
|
|
3
|
+
export interface TestCall {
|
|
4
|
+
id: string;
|
|
5
|
+
path: string;
|
|
6
|
+
method: string;
|
|
7
|
+
headers: Record<string, string>;
|
|
8
|
+
body?: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface TestRecord {
|
|
11
|
+
notices: Notice[];
|
|
12
|
+
calls: TestCall[];
|
|
13
|
+
aside: AsideKey | null;
|
|
14
|
+
pages: string[];
|
|
15
|
+
pageLinks: PageLink[];
|
|
16
|
+
bottomBar: BottomBar | null;
|
|
17
|
+
}
|
|
18
|
+
export interface TestHostProps {
|
|
19
|
+
id: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
user?: AppUser | null;
|
|
22
|
+
scopes?: string[];
|
|
23
|
+
reply?: (call: TestCall) => unknown;
|
|
24
|
+
record?: TestRecord;
|
|
25
|
+
store?: StateStore;
|
|
26
|
+
route?: AppRoute;
|
|
27
|
+
}
|
|
28
|
+
export declare const createTestRecord: () => TestRecord;
|
|
29
|
+
export declare const TestHost: (props: TestHostProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { AppContext } from './context.js';
|
|
4
|
+
import { createStateStore } from './state-store.js';
|
|
5
|
+
const REGIONS = ['lead', 'actions', 'aside', 'notices', 'bottom', 'side'];
|
|
6
|
+
const TEST_USER = { id: 'u-test', name: 'Test User' };
|
|
7
|
+
const NO_SCOPES = [];
|
|
8
|
+
const HOME = { path: '', query: {} };
|
|
9
|
+
const echo = (call) => ({ path: call.path });
|
|
10
|
+
export const createTestRecord = () => ({
|
|
11
|
+
notices: [],
|
|
12
|
+
calls: [],
|
|
13
|
+
aside: null,
|
|
14
|
+
pages: [],
|
|
15
|
+
pageLinks: [],
|
|
16
|
+
bottomBar: null,
|
|
17
|
+
});
|
|
18
|
+
const testRequest = (record, reply) => async (id, path, init) => {
|
|
19
|
+
const headers = Object.fromEntries(new Headers(init.headers).entries());
|
|
20
|
+
const body = typeof init.body === 'string' ? JSON.parse(init.body) : undefined;
|
|
21
|
+
const call = { id, path, method: init.method ?? 'GET', headers, body };
|
|
22
|
+
record.calls.push(call);
|
|
23
|
+
return new Response(JSON.stringify({ success: true, data: reply(call) }), {
|
|
24
|
+
headers: { 'Content-Type': 'application/json' },
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
const testShell = (record) => ({
|
|
28
|
+
notify: (n) => void record.notices.push(n),
|
|
29
|
+
openAside: (key) => void (record.aside = key),
|
|
30
|
+
closeAside: () => void (record.aside = null),
|
|
31
|
+
navigate: (page) => void record.pages.push(page),
|
|
32
|
+
setPages: (pages) => void (record.pageLinks = pages),
|
|
33
|
+
setBottomBar: (bar) => void (record.bottomBar = bar),
|
|
34
|
+
});
|
|
35
|
+
const useRegionHost = () => {
|
|
36
|
+
const [nodes] = useState(() => new Map());
|
|
37
|
+
const [listeners] = useState(() => new Set());
|
|
38
|
+
const host = useMemo(() => ({
|
|
39
|
+
node: (name) => nodes.get(name) ?? null,
|
|
40
|
+
subscribe: (fn) => (listeners.add(fn), () => void listeners.delete(fn)),
|
|
41
|
+
}), [nodes, listeners]);
|
|
42
|
+
const ref = (name) => (el) => {
|
|
43
|
+
if (el)
|
|
44
|
+
nodes.set(name, el);
|
|
45
|
+
else
|
|
46
|
+
nodes.delete(name);
|
|
47
|
+
listeners.forEach((fn) => fn());
|
|
48
|
+
};
|
|
49
|
+
return [host, ref];
|
|
50
|
+
};
|
|
51
|
+
// A small shell for unit tests of an app: the six regions as divs and an in-memory host.
|
|
52
|
+
export const TestHost = (props) => {
|
|
53
|
+
const [record] = useState(() => props.record ?? createTestRecord());
|
|
54
|
+
const [store] = useState(() => props.store ?? createStateStore());
|
|
55
|
+
const [regions, regionRef] = useRegionHost();
|
|
56
|
+
const { id, user = TEST_USER, scopes = NO_SCOPES, reply = echo, route = HOME } = props;
|
|
57
|
+
const value = useMemo(() => ({
|
|
58
|
+
id,
|
|
59
|
+
route,
|
|
60
|
+
store,
|
|
61
|
+
regions,
|
|
62
|
+
host: { user, scopes, request: testRequest(record, reply) },
|
|
63
|
+
shell: testShell(record),
|
|
64
|
+
}), [id, route, store, regions, user, scopes, record, reply]);
|
|
65
|
+
return (_jsxs(AppContext.Provider, { value: value, children: [_jsx("div", { "data-region": "main", children: props.children }), REGIONS.map((name) => (_jsx("div", { "data-region": name, ref: regionRef(name) }, name)))] }));
|
|
66
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* K11: the shell-samples/index.html hex values under the design-system token names, dark only. */
|
|
2
|
+
@theme {
|
|
3
|
+
--color-background: #1f2028;
|
|
4
|
+
--color-foreground: #ffffff;
|
|
5
|
+
--color-card: #2e3039;
|
|
6
|
+
--color-card-foreground: #ffffff;
|
|
7
|
+
--color-popover: #2e3039;
|
|
8
|
+
--color-popover-foreground: #ffffff;
|
|
9
|
+
--color-sidebar: #1f2028;
|
|
10
|
+
--color-sidebar-foreground: #ffffff;
|
|
11
|
+
--color-sidebar-border: #3a3d4a;
|
|
12
|
+
--color-primary: #f5a623;
|
|
13
|
+
--color-primary-foreground: #1f2028;
|
|
14
|
+
--color-primary-emphasis: #f5a623;
|
|
15
|
+
--color-primary-soft: rgb(245 166 35 / 0.12);
|
|
16
|
+
--color-primary-hover: #d97706;
|
|
17
|
+
--color-secondary: #2e3039;
|
|
18
|
+
--color-secondary-foreground: #ffffff;
|
|
19
|
+
--color-accent: #3a3d4a;
|
|
20
|
+
--color-accent-foreground: #ffffff;
|
|
21
|
+
--color-muted: #2e3039;
|
|
22
|
+
--color-muted-foreground: #a9adc1;
|
|
23
|
+
--color-destructive: #f08a7e;
|
|
24
|
+
--color-destructive-foreground: #1f2028;
|
|
25
|
+
--color-success: #5fd08f;
|
|
26
|
+
--color-success-foreground: #1f2028;
|
|
27
|
+
--color-border: #3a3d4a;
|
|
28
|
+
--color-input: #3a3d4a;
|
|
29
|
+
--color-ring: #f5a623;
|
|
30
|
+
--font-sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
31
|
+
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
|
|
32
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentage/extension",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.1",
|
|
4
4
|
"description": "The agentage extension kit: create(ctx) per part (pages, ui, api, mcp, worker, cli), the store, /health, discovery, the envelope, and the build tool with up and token",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -40,6 +40,15 @@
|
|
|
40
40
|
"types": "./dist/logs/index.d.ts",
|
|
41
41
|
"default": "./dist/logs/index.js"
|
|
42
42
|
},
|
|
43
|
+
"./app": {
|
|
44
|
+
"types": "./dist/vendor/app/index.d.ts",
|
|
45
|
+
"default": "./dist/vendor/app/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./app/test-host": {
|
|
48
|
+
"types": "./dist/vendor/app/test-host.d.ts",
|
|
49
|
+
"default": "./dist/vendor/app/test-host.js"
|
|
50
|
+
},
|
|
51
|
+
"./app/theme.css": "./dist/vendor/app/theme.css",
|
|
43
52
|
"./migrate": {
|
|
44
53
|
"default": "./dist/store/migrate.js"
|
|
45
54
|
},
|
|
@@ -70,14 +79,38 @@
|
|
|
70
79
|
},
|
|
71
80
|
"peerDependencies": {
|
|
72
81
|
"@electric-sql/pglite": "^0.5.0",
|
|
73
|
-
"
|
|
82
|
+
"@tailwindcss/postcss": "^4.3.0",
|
|
83
|
+
"esbuild": ">=0.25.0",
|
|
84
|
+
"express": "^5.1.0",
|
|
85
|
+
"postcss": "^8.5.0",
|
|
86
|
+
"react": "^19.0.0",
|
|
87
|
+
"react-dom": "^19.0.0",
|
|
88
|
+
"tailwindcss": "^4.3.0"
|
|
74
89
|
},
|
|
75
90
|
"peerDependenciesMeta": {
|
|
76
91
|
"@electric-sql/pglite": {
|
|
77
92
|
"optional": true
|
|
78
93
|
},
|
|
94
|
+
"@tailwindcss/postcss": {
|
|
95
|
+
"optional": true
|
|
96
|
+
},
|
|
97
|
+
"esbuild": {
|
|
98
|
+
"optional": true
|
|
99
|
+
},
|
|
79
100
|
"express": {
|
|
80
101
|
"optional": true
|
|
102
|
+
},
|
|
103
|
+
"postcss": {
|
|
104
|
+
"optional": true
|
|
105
|
+
},
|
|
106
|
+
"react": {
|
|
107
|
+
"optional": true
|
|
108
|
+
},
|
|
109
|
+
"react-dom": {
|
|
110
|
+
"optional": true
|
|
111
|
+
},
|
|
112
|
+
"tailwindcss": {
|
|
113
|
+
"optional": true
|
|
81
114
|
}
|
|
82
115
|
},
|
|
83
116
|
"keywords": [
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"id": {
|
|
8
8
|
"type": "string",
|
|
9
9
|
"maxLength": 32,
|
|
10
|
-
"pattern": "^(?!(?:auth|www|api|sync|mail|mcp|ui|git|setup|status|update|extension|add|remove|help|con|prn|aux|nul|com[0-9]|lpt[0-9])$)[a-z][a-z0-9-]*$"
|
|
10
|
+
"pattern": "^(?!(?:auth|www|api|sync|mail|mcp|ui|app|shell|host|health|git|setup|status|update|extension|add|remove|help|con|prn|aux|nul|com[0-9]|lpt[0-9])$)[a-z][a-z0-9-]*$"
|
|
11
11
|
},
|
|
12
12
|
"version": {
|
|
13
13
|
"type": "string",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"id": {
|
|
34
34
|
"type": "string",
|
|
35
35
|
"maxLength": 32,
|
|
36
|
-
"pattern": "^(?!(?:auth|www|api|sync|mail|mcp|ui|git|setup|status|update|extension|add|remove|help|con|prn|aux|nul|com[0-9]|lpt[0-9])$)[a-z][a-z0-9-]*$"
|
|
36
|
+
"pattern": "^(?!(?:auth|www|api|sync|mail|mcp|ui|app|shell|host|health|git|setup|status|update|extension|add|remove|help|con|prn|aux|nul|com[0-9]|lpt[0-9])$)[a-z][a-z0-9-]*$"
|
|
37
37
|
},
|
|
38
38
|
"parts": {
|
|
39
39
|
"type": "object",
|
|
@@ -74,6 +74,9 @@
|
|
|
74
74
|
}
|
|
75
75
|
]
|
|
76
76
|
},
|
|
77
|
+
"app": {
|
|
78
|
+
"type": "boolean"
|
|
79
|
+
},
|
|
77
80
|
"api": {
|
|
78
81
|
"anyOf": [
|
|
79
82
|
{
|
|
@@ -180,6 +183,30 @@
|
|
|
180
183
|
},
|
|
181
184
|
"additionalProperties": false
|
|
182
185
|
},
|
|
186
|
+
"app": {
|
|
187
|
+
"type": "object",
|
|
188
|
+
"properties": {
|
|
189
|
+
"title": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"minLength": 1,
|
|
192
|
+
"maxLength": 40
|
|
193
|
+
},
|
|
194
|
+
"icon": {
|
|
195
|
+
"type": "string",
|
|
196
|
+
"maxLength": 64,
|
|
197
|
+
"pattern": "^[a-z][a-z0-9-]*$"
|
|
198
|
+
},
|
|
199
|
+
"order": {
|
|
200
|
+
"type": "integer",
|
|
201
|
+
"minimum": 0,
|
|
202
|
+
"maximum": 1000
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"required": [
|
|
206
|
+
"title"
|
|
207
|
+
],
|
|
208
|
+
"additionalProperties": false
|
|
209
|
+
},
|
|
183
210
|
"commands": {
|
|
184
211
|
"minItems": 1,
|
|
185
212
|
"type": "array",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"id": {
|
|
8
8
|
"type": "string",
|
|
9
9
|
"maxLength": 32,
|
|
10
|
-
"pattern": "^(?!(?:auth|www|api|sync|mail|mcp|ui|git|setup|status|update|extension|add|remove|help|con|prn|aux|nul|com[0-9]|lpt[0-9])$)[a-z][a-z0-9-]*$"
|
|
10
|
+
"pattern": "^(?!(?:auth|www|api|sync|mail|mcp|ui|app|shell|host|health|git|setup|status|update|extension|add|remove|help|con|prn|aux|nul|com[0-9]|lpt[0-9])$)[a-z][a-z0-9-]*$"
|
|
11
11
|
},
|
|
12
12
|
"version": {
|
|
13
13
|
"type": "string",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"extension": {
|
|
22
22
|
"type": "string",
|
|
23
23
|
"maxLength": 32,
|
|
24
|
-
"pattern": "^(?!(?:auth|www|api|sync|mail|mcp|ui|git|setup|status|update|extension|add|remove|help|con|prn|aux|nul|com[0-9]|lpt[0-9])$)[a-z][a-z0-9-]*$"
|
|
24
|
+
"pattern": "^(?!(?:auth|www|api|sync|mail|mcp|ui|app|shell|host|health|git|setup|status|update|extension|add|remove|help|con|prn|aux|nul|com[0-9]|lpt[0-9])$)[a-z][a-z0-9-]*$"
|
|
25
25
|
},
|
|
26
26
|
"part": {
|
|
27
27
|
"type": "string",
|