@agentage/extension 0.22.0 → 0.24.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 +36 -73
- package/dist/core-client/core-client.js +1 -1
- package/dist/discovery/discovery.schema.js +4 -4
- package/dist/manifest/primitives.schema.d.ts +1 -0
- package/dist/manifest/primitives.schema.js +4 -1
- package/dist/mcp/tools.js +2 -2
- package/dist/runtime/part-mounts.js +1 -1
- package/dist/testing/test-server.js +1 -1
- package/dist/tool/app-build.d.ts +1 -1
- package/dist/tool/app-build.js +12 -15
- package/dist/tool/check.js +2 -2
- package/dist/tool/rules/app-deps.d.ts +1 -1
- package/dist/tool/rules/app-deps.js +20 -18
- package/dist/vendor/app/split.d.ts +3 -3
- package/dist/vendor/app/split.js +6 -6
- package/dist/vendor/app/theme.css +9 -1
- package/package.json +5 -5
- package/schemas/extension-discovery.schema.json +1 -1
- package/schemas/extension-record.schema.json +1 -1
- package/schemas/host-document.schema.json +1 -1
package/README.md
CHANGED
|
@@ -1,85 +1,48 @@
|
|
|
1
1
|
# @agentage/extension
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
schemas. The host document has the optional key `program { version, commit }` since 0.20.4: a cloud
|
|
9
|
-
app host fills it with its program; the daemon leaves it out.
|
|
10
|
-
The route `GET /api/{id}/caller` (the caller's own token facts) exists since 0.21.0.
|
|
11
|
-
The app kit has `setNavSection` since 0.22.0: an open app gives the shell a titled nav section.
|
|
12
|
-
`@agentage/extension/logs` is the event line (`EventSchema`, `parseLine`, `createLogger`,
|
|
13
|
-
`createEventsClient`, `KINDS`, `LEVELS`, `USER_TYPES`), built into the kit's own tarball.
|
|
14
|
-
`@agentage/extension/core` is the one client of the core's services (see "The core client").
|
|
15
|
-
`@agentage/extension/app` is the app part: `useAppShell()` (route, regions, notices, state) and
|
|
16
|
-
`useAppHost()` (`user`, `scopes`, `api`, and since 0.18.2 `extension { id, version }` and
|
|
17
|
-
`host { kind, url }`, kind `local`, `desktop` or `cloud`).
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
The extension kit of agentage. You write each part of an extension as one `create(ctx)` function.
|
|
6
|
+
The kit owns the server, the port, `/health`, auth, the store and the images. It also holds the
|
|
7
|
+
build tool that the `agentage extension` commands run. It is for extension authors.
|
|
18
8
|
|
|
19
9
|
```bash
|
|
20
10
|
npm install @agentage/extension express zod
|
|
21
11
|
```
|
|
22
12
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
| ------------- | ------------------------- | ----------------------------------------------------------------- |
|
|
44
|
-
| `no_core` | `<service> not reachable` | no address, not a URL, or the `url` function threw (`cause`) |
|
|
45
|
-
| `unreachable` | `<service> not reachable` | no connection |
|
|
46
|
-
| `timeout` | `<service> not reachable` | no answer before the deadline, a stalled body |
|
|
47
|
-
| `failed` | `<service> not reachable` | not 2xx, a 404 that is not the market's, a redirect, over 1 MB |
|
|
48
|
-
| `not_json` | `<service> not reachable` | a market body that is not JSON |
|
|
49
|
-
| `refused` | `market answer refused` | a 2xx with no release or rows, or not an exact version of that id |
|
|
50
|
-
| `no_token` | `logs needs a token` | `logs.send` with no token |
|
|
51
|
-
|
|
52
|
-
The rules for a caller:
|
|
13
|
+
A part is one folder in `src/`. This MCP part, from the extension template, serves the tool
|
|
14
|
+
`{id}_echo` on `POST /mcp`:
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { type McpContext } from '@agentage/extension';
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
|
|
20
|
+
export function create(ctx: McpContext) {
|
|
21
|
+
ctx.tool(
|
|
22
|
+
'echo',
|
|
23
|
+
{
|
|
24
|
+
description: 'Echo a message back',
|
|
25
|
+
scope: 'read',
|
|
26
|
+
input: z.object({ msg: z.string().min(1).max(200) }),
|
|
27
|
+
output: z.object({ msg: z.string() }),
|
|
28
|
+
},
|
|
29
|
+
async ({ msg }) => ({ msg: `pong ${msg}` })
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
```
|
|
53
33
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
- A release loop reads `data: null` as "no release" only when `down` is null. It also skips a
|
|
57
|
-
prerelease version and a `commit` of `null`, and keeps its own origin on https.
|
|
58
|
-
- Pass `timeoutMs` for the work: about 10 s for an install or a list in a terminal; a worker
|
|
59
|
-
sets its own. The default suits a page or a start that must not wait.
|
|
34
|
+
Since 0.24.0 the kit names each tool `{id}_{name}`, with one underscore. Its schemas still accept
|
|
35
|
+
the old `{id}__{name}` for now, and refuse a tool of another id.
|
|
60
36
|
|
|
61
|
-
|
|
62
|
-
false); `file` and `line` are there only when a problem has them. `warnings` is there only when a
|
|
63
|
-
rule warned: an `engines.agentage` of an older kit minor from the floor `0.12` up conforms with a
|
|
64
|
-
warning; below the floor or above the running kit it is a problem:
|
|
37
|
+
Start a new extension with `npx @agentage/cli extension create my-ext`: it pins this kit for you.
|
|
65
38
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"id": "probe",
|
|
69
|
-
"version": "0.4.0",
|
|
70
|
-
"conforms": false,
|
|
71
|
-
"rules": ["manifest", "entries", "surface", "stack", "store", "sealing"],
|
|
72
|
-
"problems": [
|
|
73
|
-
{ "rule": "sealing", "file": "src/api/index.ts", "line": 7, "problem": "reads process.env" }
|
|
74
|
-
],
|
|
75
|
-
"skipped": {}
|
|
76
|
-
}
|
|
77
|
-
```
|
|
39
|
+
Since 0.23.0, `check` asks an app part for `@agentage/components` ^0.21, the library that replaces
|
|
40
|
+
`@agentage/design-system`.
|
|
78
41
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
42
|
+
- The subpaths, the core client, the check report and secrets:
|
|
43
|
+
[docs/extension-package.md](https://github.com/agentage/kit/blob/master/docs/extension-package.md).
|
|
44
|
+
- Every part kind: [docs/parts.md](https://github.com/agentage/kit/blob/master/docs/parts.md). The tool:
|
|
45
|
+
[docs/tool.md](https://github.com/agentage/kit/blob/master/docs/tool.md). The whole kit: the
|
|
46
|
+
[kit README](https://github.com/agentage/kit#readme).
|
|
83
47
|
|
|
84
|
-
|
|
85
|
-
manifest, the tool and how a part image runs.
|
|
48
|
+
License: MIT
|
|
@@ -79,7 +79,7 @@ const logsOf = (s, o) => {
|
|
|
79
79
|
};
|
|
80
80
|
return { send, down: () => s.first.logs ?? null };
|
|
81
81
|
};
|
|
82
|
-
// Never throws
|
|
82
|
+
// Never throws, never waits past timeoutMs; caller rules: docs/extension-package.md "The core client".
|
|
83
83
|
export const createCoreClient = (o = {}) => {
|
|
84
84
|
const s = {
|
|
85
85
|
url: o.url ?? coreUrlOf(o.env ?? {}),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { CommandNameSchema, CommitSchema, ExtensionIdSchema, IMAGE_PART_KINDS, PrefixedToolNameSchema, SecretNameSchema, SecretPartSchema, StoreKindSchema, VersionSchema, } from '../manifest/primitives.schema.js';
|
|
2
|
+
import { CommandNameSchema, CommitSchema, ExtensionIdSchema, IMAGE_PART_KINDS, ownsTool, PrefixedToolNameSchema, SecretNameSchema, SecretPartSchema, StoreKindSchema, VersionSchema, } from '../manifest/primitives.schema.js';
|
|
3
3
|
import { APP_ROW_RULE, appRowFits, AppRowSchema, ServesSchema } from './served.schema.js';
|
|
4
4
|
// registry host[:port]/owner/{id}-{part}@sha256: deployed by digest, a version's images never change.
|
|
5
5
|
const ImageDigestRefSchema = z
|
|
@@ -92,9 +92,9 @@ const openapiNamesItsExtension = ({ id, openapi }) => !openapi || /^\/api\/v[0-9
|
|
|
92
92
|
const OPENAPI_RULE = { message: 'openapi is /api/{id}/openapi.json', path: ['openapi'] };
|
|
93
93
|
// A served document has no old /api/v{N} form: what serves it now runs this kit.
|
|
94
94
|
const openapiIsOwn = ({ id, openapi }) => !openapi || openapi === `/api/${id}/openapi.json`;
|
|
95
|
-
// A served tool is {id}__{name} of this id: the host
|
|
96
|
-
export const toolsAreOwn = ({ id, tools }) => (tools ?? []).every((t) => t.name
|
|
97
|
-
export const TOOLS_RULE = { message: 'every tool is {id}
|
|
95
|
+
// A served tool is {id}_{name} (or the old {id}__{name}) of this id: the host names it so.
|
|
96
|
+
export const toolsAreOwn = ({ id, tools }) => (tools ?? []).every((t) => ownsTool(id, t.name));
|
|
97
|
+
export const TOOLS_RULE = { message: 'every tool is {id}_{name}', path: ['tools'] };
|
|
98
98
|
// A scoped name lives only in secretParts, so an estate that does not read it mounts nothing.
|
|
99
99
|
const scoped = (name) => `secret ${name}: one or more parts, none repeated, and never also in secrets`;
|
|
100
100
|
// The build record: written by `build --push` into the package and the release asset; no host.
|
|
@@ -32,6 +32,7 @@ export declare const StoreKindSchema: z.ZodEnum<{
|
|
|
32
32
|
export declare const FULL_SHA: RegExp;
|
|
33
33
|
export declare const CommitSchema: z.ZodString;
|
|
34
34
|
export declare const PrefixedToolNameSchema: z.ZodString;
|
|
35
|
+
export declare const ownsTool: (id: string, name: string) => boolean;
|
|
35
36
|
export declare const IMAGE_PART_KINDS: readonly ["pages", "ui", "api", "mcp", "worker"];
|
|
36
37
|
export type ImagePartKind = (typeof IMAGE_PART_KINDS)[number];
|
|
37
38
|
export declare const camelName: (name: string) => string;
|
|
@@ -55,10 +55,13 @@ export const SERVED_KINDS = ['postgres', 'signoz', 'git', 'clickhouse'];
|
|
|
55
55
|
export const StoreKindSchema = z.enum(Object.keys(STORE_KINDS));
|
|
56
56
|
export const FULL_SHA = /^[0-9a-f]{40}$/;
|
|
57
57
|
export const CommitSchema = z.string().regex(FULL_SHA, { message: 'full 40-hex git sha' });
|
|
58
|
+
// {id}_{name} or the old {id}__{name}: an id has no _ and a name starts with a letter.
|
|
59
|
+
const OWN_TOOL_REST = /^__?[a-z][a-z0-9_-]*$/;
|
|
58
60
|
export const PrefixedToolNameSchema = z
|
|
59
61
|
.string()
|
|
60
62
|
.max(64)
|
|
61
|
-
.regex(/^[a-z][a-z0-9-]*__[a-z][a-z0-9_-]*$/);
|
|
63
|
+
.regex(/^[a-z][a-z0-9-]*__?[a-z][a-z0-9_-]*$/);
|
|
64
|
+
export const ownsTool = (id, name) => name.startsWith(id) && OWN_TOOL_REST.test(name.slice(id.length));
|
|
62
65
|
export const IMAGE_PART_KINDS = ['pages', 'ui', 'api', 'mcp', 'worker'];
|
|
63
66
|
export const camelName = (name) => name.replace(/-([a-z0-9])/g, (_, c) => c.toUpperCase());
|
|
64
67
|
export const SecretPartSchema = z.enum(['pages', 'api', 'mcp', 'worker']);
|
package/dist/mcp/tools.js
CHANGED
|
@@ -39,6 +39,6 @@ export const createToolRegistry = () => {
|
|
|
39
39
|
const [tool, connector] = [registrarOn(tools), registrarOn(connectors)];
|
|
40
40
|
return { tool, tools, instructions, served, connector, connectors };
|
|
41
41
|
};
|
|
42
|
-
export const prefixed = (id, name) => `${id}
|
|
43
|
-
// A connector tool keeps its own name (search, fetch); every other is {id}
|
|
42
|
+
export const prefixed = (id, name) => `${id}_${name}`;
|
|
43
|
+
// A connector tool keeps its own name (search, fetch); every other is {id}_{name}.
|
|
44
44
|
export const nameOf = (id, name, bare) => bare ? name : prefixed(id, name);
|
|
@@ -41,7 +41,7 @@ const mcp = async (input) => {
|
|
|
41
41
|
const paths = input.mcpPaths;
|
|
42
42
|
const options = { ...input.base, tools: registered, listing, paths, ...served };
|
|
43
43
|
const mount = (app) => mountWithConnector(app, options, registry.connectors);
|
|
44
|
-
// Connector tools stay out of the record: the record lists the {id}
|
|
44
|
+
// Connector tools stay out of the record: the record lists the {id}_{name} tools only.
|
|
45
45
|
const tools = toolRecords(input.pkg.agentage.id, registry.tools);
|
|
46
46
|
return { mount, record: tools.length ? { tools } : {} };
|
|
47
47
|
};
|
|
@@ -46,7 +46,7 @@ export const startTestServer = async (options) => {
|
|
|
46
46
|
const base = { pkg, build: TEST_BUILD, log: ctx.log, wellKnown, files };
|
|
47
47
|
return startOn(createApiApp({ ...base, router: mounted.router, routes: mounted.routes, ...guard }));
|
|
48
48
|
};
|
|
49
|
-
// Runs an mcp part's create(ctx) inside the kit's real /mcp app: tools named {id}
|
|
49
|
+
// Runs an mcp part's create(ctx) inside the kit's real /mcp app: tools named {id}_{name}; connector tools at /connector.
|
|
50
50
|
export const startTestMcp = async (options) => {
|
|
51
51
|
const ctx = options.ctx ?? createTestContext();
|
|
52
52
|
const registry = createToolRegistry();
|
package/dist/tool/app-build.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export interface AppBuilder {
|
|
|
8
8
|
rebuild(): Promise<AppFiles>;
|
|
9
9
|
dispose(): Promise<void>;
|
|
10
10
|
}
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const libSources: (dir: string, metafile?: Esbuild.Metafile) => string[];
|
|
12
12
|
export declare const appBuilder: (at: string) => Promise<AppBuilder>;
|
|
13
13
|
export declare const buildApp: (dir: string) => Promise<AppFiles>;
|
package/dist/tool/app-build.js
CHANGED
|
@@ -38,28 +38,25 @@ const esbuildOptions = (dir, entry) => ({
|
|
|
38
38
|
metafile: true,
|
|
39
39
|
outfile: join(dir, APP_DIR, 'app.js'),
|
|
40
40
|
});
|
|
41
|
-
const
|
|
42
|
-
// The
|
|
43
|
-
export const
|
|
44
|
-
.filter((file) =>
|
|
41
|
+
const LIB = /(^|\/)node_modules\/@agentage\/components\//;
|
|
42
|
+
// The components files the app bundles: their classes are scanned too, or a Button has no style.
|
|
43
|
+
export const libSources = (dir, metafile) => Object.keys(metafile?.inputs ?? {})
|
|
44
|
+
.filter((file) => LIB.test(file))
|
|
45
45
|
.map((file) => resolve(dir, file));
|
|
46
|
-
// The
|
|
47
|
-
const
|
|
48
|
-
const file = resolveFrom(dir, '@agentage/
|
|
49
|
-
|
|
50
|
-
return [];
|
|
51
|
-
const blocks = (await readFile(file, 'utf8')).match(/@theme\s*\{[^{}]*\}/g) ?? [];
|
|
52
|
-
return blocks.map((b) => b.replace(/^@theme/, '@theme reference'));
|
|
46
|
+
// The components tokens as reference: names, @utility and keyframes; the shell gives the values.
|
|
47
|
+
const libTokens = (dir) => {
|
|
48
|
+
const file = resolveFrom(dir, '@agentage/components/styles/tokens.css');
|
|
49
|
+
return file ? [`@import "${file}" reference;`] : [];
|
|
53
50
|
};
|
|
54
51
|
// Utilities only, no preflight and no theme variables: the shell owns both.
|
|
55
52
|
// Token names only (reference): utilities like bg-primary exist; the shell gives the values.
|
|
56
|
-
const cssInput =
|
|
53
|
+
const cssInput = (dir, extra) => {
|
|
57
54
|
const tw = packageDir(dir, 'tailwindcss');
|
|
58
55
|
const tokens = resolveFrom(dir, '@agentage/extension/app/theme.css');
|
|
59
56
|
return [
|
|
60
57
|
'@layer theme, utilities;',
|
|
61
58
|
`@import "${join(tw, 'theme.css')}" layer(theme) theme(reference inline);`,
|
|
62
|
-
...(
|
|
59
|
+
...libTokens(dir),
|
|
63
60
|
...(tokens ? [`@import "${tokens}" layer(theme) theme(reference);`] : []),
|
|
64
61
|
`@import "${join(tw, 'utilities.css')}" layer(utilities) source(none);`,
|
|
65
62
|
`@source "${join(dir, 'src', 'app')}";`,
|
|
@@ -71,7 +68,7 @@ const compileCss = async (dir, extra) => {
|
|
|
71
68
|
const tailwind = await loadFrom(dir, '@tailwindcss/postcss');
|
|
72
69
|
const plugin = tailwind({ base: dir, optimize: { minify: true } });
|
|
73
70
|
const from = join(dir, 'src', 'app', 'app.css');
|
|
74
|
-
return (await postcss([plugin]).process(
|
|
71
|
+
return (await postcss([plugin]).process(cssInput(dir, extra), { from })).css;
|
|
75
72
|
};
|
|
76
73
|
const hashed = (code, ext) => `app-${createHash('sha256').update(code).digest('hex').slice(0, 10)}.${ext}`;
|
|
77
74
|
// Written then renamed: a reader sees the old file or the new one, never half of one.
|
|
@@ -110,7 +107,7 @@ export const appBuilder = async (at) => {
|
|
|
110
107
|
const rebuild = async () => {
|
|
111
108
|
const result = await ctx.rebuild();
|
|
112
109
|
const code = result.outputFiles?.[0]?.contents ?? new Uint8Array();
|
|
113
|
-
return writeApp(dir, code, await compileCss(dir,
|
|
110
|
+
return writeApp(dir, code, await compileCss(dir, libSources(dir, result.metafile)));
|
|
114
111
|
};
|
|
115
112
|
return { rebuild, dispose: () => ctx.dispose() };
|
|
116
113
|
};
|
package/dist/tool/check.js
CHANGED
|
@@ -10,7 +10,7 @@ import {} from '../manifest/primitives.schema.js';
|
|
|
10
10
|
import { formatIssues, readJsonIfExists } from '../manifest/read-manifest.js';
|
|
11
11
|
import { runCommand } from './exec.js';
|
|
12
12
|
import { problemLines, warningLines } from './format.js';
|
|
13
|
-
import {
|
|
13
|
+
import { componentsProblems } from './rules/app-deps.js';
|
|
14
14
|
import { exportedPartCode } from './rules/folders.js';
|
|
15
15
|
import { sealing } from './rules/sealing.js';
|
|
16
16
|
import { store } from './rules/store.js';
|
|
@@ -63,7 +63,7 @@ const appProblem = async ({ dir, pkg }) => {
|
|
|
63
63
|
if (!appOf(pkg))
|
|
64
64
|
return [];
|
|
65
65
|
const built = (await exists(join(dir, 'dist/app/index.js'))) ? [] : [{ problem: APP_BUILT }];
|
|
66
|
-
return [...built, ...
|
|
66
|
+
return [...built, ...componentsProblems(pkg)];
|
|
67
67
|
};
|
|
68
68
|
// Every part built and exporting only create; cli handlers = commands; exports hold no part code.
|
|
69
69
|
const entries = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type ExtensionPackage } from '../../manifest/manifest.schema.js';
|
|
2
2
|
import { type Finding } from '../check.js';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const componentsProblems: (pkg: ExtensionPackage) => Finding[];
|
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import semver from 'semver';
|
|
2
2
|
import {} from '../../manifest/manifest.schema.js';
|
|
3
3
|
import {} from '../check.js';
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const LIB = '@agentage/components';
|
|
5
|
+
const OLD = '@agentage/design-system';
|
|
6
|
+
const NEEDED = '^0.21';
|
|
7
|
+
const specsOf = (pkg, name) => {
|
|
8
8
|
const declared = pkg;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
return [declared.dependencies, declared.devDependencies, declared.peerDependencies].flatMap((group) => (group?.[name] ?? []));
|
|
10
|
+
};
|
|
11
|
+
const finding = (problem) => [{ file: 'package.json', problem }];
|
|
12
|
+
// The kit's app code imports the components (resizable-split, 0.21+), so the app part must declare them.
|
|
13
|
+
export const componentsProblems = (pkg) => {
|
|
14
|
+
const old = specsOf(pkg, OLD).length > 0;
|
|
15
|
+
const specs = specsOf(pkg, LIB);
|
|
14
16
|
if (specs.length === 0)
|
|
15
|
-
return
|
|
16
|
-
{
|
|
17
|
-
|
|
18
|
-
problem: `the app part needs ${DS} ${NEEDED}: declare it in dependencies, devDependencies or peerDependencies`,
|
|
19
|
-
},
|
|
20
|
-
];
|
|
17
|
+
return finding(old
|
|
18
|
+
? `${OLD} is replaced: switch the app part to ${LIB} ${NEEDED}`
|
|
19
|
+
: `the app part needs ${LIB} ${NEEDED}: declare it in dependencies, devDependencies or peerDependencies`);
|
|
21
20
|
const bad = specs.find((spec) => !semver.validRange(spec) || !semver.subset(spec, NEEDED));
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
if (bad !== undefined)
|
|
22
|
+
return finding(`${LIB} ${bad}, the app part needs ${NEEDED}`);
|
|
23
|
+
// Both: a kit of 0.22 or older still imports the old library; remove it once no kit needs it.
|
|
24
|
+
return old
|
|
25
|
+
? [{ file: 'package.json', problem: `${OLD} is replaced by ${LIB}: remove it`, warning: true }]
|
|
26
|
+
: [];
|
|
25
27
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type ResizableSplitApi } from '@agentage/
|
|
1
|
+
import { type ResizableSplitApi } from '@agentage/components/resizable-split';
|
|
2
2
|
import { type ReactNode, type Ref } from 'react';
|
|
3
|
-
export { useResizableSplit as useSplit } from '@agentage/
|
|
4
|
-
export type { ResizableSplitApi as SplitApi } from '@agentage/
|
|
3
|
+
export { useResizableSplit as useSplit } from '@agentage/components/resizable-split';
|
|
4
|
+
export type { ResizableSplitApi as SplitApi } from '@agentage/components/resizable-split';
|
|
5
5
|
export declare const splitKey: (app: string, id: string) => string;
|
|
6
6
|
export declare const splitVar: (app: string, id: string) => string;
|
|
7
7
|
export declare const SPLIT_PREPAINT = "try{var d=document.documentElement,L=localStorage,E=function(k){return k.replace(/[^A-Za-z0-9-]/g,function(c){return '_'+c.charCodeAt(0).toString(16)+'_'})};for(var i=0;i<L.length;i++){var k=L.key(i),m=/^ag\\.split\\.[a-z0-9-]+\\.[a-z0-9-]+$/.test(k),n=parseInt(L.getItem(k),10);if(m&&n>0&&n<8000)d.style.setProperty('--split-'+E(k),n+'px');if(m&&L.getItem(k+'.collapsed')==='1')d.style.setProperty('--splitc-'+E(k),'0px')}}catch(e){}";
|
package/dist/vendor/app/split.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ResizableSplit } from '@agentage/
|
|
2
|
+
import { ResizableSplit } from '@agentage/components/resizable-split';
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import { useAppContext } from './context.js';
|
|
5
|
-
export { useResizableSplit as useSplit } from '@agentage/
|
|
5
|
+
export { useResizableSplit as useSplit } from '@agentage/components/resizable-split';
|
|
6
6
|
const NAME = /^[a-z0-9-]+$/;
|
|
7
7
|
const PHONE = '(max-width: 759px)';
|
|
8
|
-
// The stored size key; the
|
|
8
|
+
// The stored size key; the components split names its CSS variables from it.
|
|
9
9
|
export const splitKey = (app, id) => `ag.split.${app}.${id}`;
|
|
10
|
-
// The
|
|
10
|
+
// The components encoding of a storage key in a CSS variable name (`.` -> `_2e_`).
|
|
11
11
|
const encode = (key) => key.replace(/[^A-Za-z0-9-]/g, (c) => `_${(c.codePointAt(0) ?? 0).toString(16)}_`);
|
|
12
12
|
export const splitVar = (app, id) => `--split-${encode(splitKey(app, id))}`;
|
|
13
13
|
// Runs in the page head before any module: every stored `ag.split.{app}.{id}` (size and collapsed)
|
|
14
|
-
// is registered by its key pattern and set as the
|
|
14
|
+
// is registered by its key pattern and set as the components split variables, so the first
|
|
15
15
|
// paint is final. A test holds the names equal to resizableSplitVar and resizableSplitCollapsedVar.
|
|
16
16
|
export const SPLIT_PREPAINT = `try{var d=document.documentElement,L=localStorage,E=function(k){return k.replace(/[^A-Za-z0-9-]/g,function(c){return '_'+c.charCodeAt(0).toString(16)+'_'})};for(var i=0;i<L.length;i++){var k=L.key(i),m=/^ag\\.split\\.[a-z0-9-]+\\.[a-z0-9-]+$/.test(k),n=parseInt(L.getItem(k),10);if(m&&n>0&&n<8000)d.style.setProperty('--split-'+E(k),n+'px');if(m&&L.getItem(k+'.collapsed')==='1')d.style.setProperty('--splitc-'+E(k),'0px')}}catch(e){}`;
|
|
17
17
|
const usePhone = () => {
|
|
@@ -25,7 +25,7 @@ const usePhone = () => {
|
|
|
25
25
|
}, []);
|
|
26
26
|
return phone;
|
|
27
27
|
};
|
|
28
|
-
// Two panes of an app on the
|
|
28
|
+
// Two panes of an app on the components ResizableSplit (px, pre-paint, collapsible).
|
|
29
29
|
export const Split = ({ id, pane = 1, children, ...rest }) => {
|
|
30
30
|
const { id: app } = useAppContext();
|
|
31
31
|
if (!NAME.test(id))
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* K11: the shell-samples/index.html hex values under the
|
|
1
|
+
/* K11: the shell-samples/index.html hex values under the @agentage/components token names, dark only. */
|
|
2
2
|
@theme {
|
|
3
3
|
--color-background: #1f2028;
|
|
4
4
|
--color-foreground: #ffffff;
|
|
@@ -22,8 +22,16 @@
|
|
|
22
22
|
--color-muted-foreground: #a9adc1;
|
|
23
23
|
--color-destructive: #f08a7e;
|
|
24
24
|
--color-destructive-foreground: #1f2028;
|
|
25
|
+
--color-destructive-solid: oklch(0.588 0.208 25.6);
|
|
25
26
|
--color-success: #5fd08f;
|
|
26
27
|
--color-success-foreground: #1f2028;
|
|
28
|
+
/* 4.9:1 on the kit accent; the library dark warning is 3.8:1 there. */
|
|
29
|
+
--color-warning: oklch(0.77 0.16 50);
|
|
30
|
+
--color-warning-foreground: oklch(0.085 0.013 277);
|
|
31
|
+
/* The prototype blue: the library dark info is 3.6:1 on the kit card. */
|
|
32
|
+
--color-info: #8fa8ff;
|
|
33
|
+
--color-info-foreground: #1f2028;
|
|
34
|
+
--color-status-offline: oklch(0.7 0.014 256);
|
|
27
35
|
--color-border: #3a3d4a;
|
|
28
36
|
--color-input: #3a3d4a;
|
|
29
37
|
--color-ring: #f5a623;
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentage/extension",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.24.0",
|
|
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",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "git+https://github.com/agentage/
|
|
9
|
+
"url": "git+https://github.com/agentage/kit.git",
|
|
10
10
|
"directory": "packages/extension"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://agentage.io",
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/agentage/
|
|
14
|
+
"url": "https://github.com/agentage/kit/issues"
|
|
15
15
|
},
|
|
16
16
|
"publishConfig": {
|
|
17
17
|
"access": "public"
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"zod": "^4.2.0"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
|
-
"@agentage/
|
|
89
|
+
"@agentage/components": "^0.21",
|
|
90
90
|
"@electric-sql/pglite": "^0.5.0",
|
|
91
91
|
"@tailwindcss/postcss": "^4.3.0",
|
|
92
92
|
"esbuild": ">=0.25.0",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"tailwindcss": "^4.3.0"
|
|
98
98
|
},
|
|
99
99
|
"peerDependenciesMeta": {
|
|
100
|
-
"@agentage/
|
|
100
|
+
"@agentage/components": {
|
|
101
101
|
"optional": true
|
|
102
102
|
},
|
|
103
103
|
"@electric-sql/pglite": {
|