@agentage/extension 0.8.0 → 0.9.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/dist/agcid/agcid.d.ts +1 -3
- package/dist/agcid/agcid.js +2 -3
- package/dist/agcid/header.d.ts +3 -0
- package/dist/agcid/header.js +3 -0
- package/dist/api/openapi-doc.d.ts +1 -0
- package/dist/api/openapi-doc.js +5 -3
- package/dist/api/routes.js +2 -5
- package/dist/auth/part-auth.d.ts +1 -0
- package/dist/auth/part-auth.js +1 -1
- package/dist/auth/token-check.d.ts +5 -2
- package/dist/auth/token-check.js +10 -3
- package/dist/auth/verify-token.js +2 -2
- package/dist/command/cli-context.js +4 -1
- package/dist/command/command.types.d.ts +2 -0
- package/dist/command/command.types.js +1 -0
- package/dist/context/context.d.ts +2 -0
- package/dist/context/context.js +3 -1
- package/dist/context/recording-log.js +3 -3
- package/dist/context/test-command-context.d.ts +2 -0
- package/dist/context/test-command-context.js +13 -4
- package/dist/context/test-context.d.ts +2 -0
- package/dist/context/test-context.js +4 -0
- package/dist/contracts/index.d.ts +6 -0
- package/dist/contracts/index.js +6 -0
- package/dist/envelope/envelope.schema.js +1 -1
- package/dist/index.d.ts +6 -10
- package/dist/index.js +7 -10
- package/dist/log/log.d.ts +3 -0
- package/dist/log/log.js +7 -3
- package/dist/log/span.d.ts +9 -0
- package/dist/log/span.js +19 -0
- package/dist/mcp/tools.js +5 -4
- package/dist/pages/pages-app.js +2 -3
- package/dist/runtime/build-info.d.ts +1 -0
- package/dist/runtime/build-info.js +2 -1
- package/dist/runtime/part-runners.js +7 -1
- package/dist/server/api-routes.js +1 -1
- package/dist/tool/build-info.js +4 -4
- package/dist/tool/index.d.ts +4 -1
- package/dist/tool/index.js +4 -1
- package/dist/worker/run-log.js +7 -3
- package/package.json +5 -1
package/dist/agcid/agcid.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare const AGCID_PATTERN: RegExp;
|
|
3
|
-
export declare const isAgcid: (value: unknown) => value is string;
|
|
1
|
+
export { AGCID_HEADER, AGCID_PATTERN, isAgcid } from './header.js';
|
|
4
2
|
export declare const uuidv7: (now?: number, random?: Buffer) => string;
|
|
5
3
|
export declare const agcidOf: (incoming: unknown) => string;
|
package/dist/agcid/agcid.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { randomBytes } from 'node:crypto';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export const isAgcid = (value) => typeof value === 'string' && AGCID_PATTERN.test(value);
|
|
2
|
+
import { isAgcid } from './header.js';
|
|
3
|
+
export { AGCID_HEADER, AGCID_PATTERN, isAgcid } from './header.js';
|
|
5
4
|
const hyphenate = (hex) => [hex.slice(0, 8), hex.slice(8, 12), hex.slice(12, 16), hex.slice(16, 20), hex.slice(20)].join('-');
|
|
6
5
|
// RFC 9562 UUIDv7: 48-bit unix ms, version 7, variant 10, the rest random.
|
|
7
6
|
export const uuidv7 = (now = Date.now(), random = randomBytes(10)) => {
|
|
@@ -2,5 +2,6 @@ import { type ExtensionPackage } from '../manifest/manifest.schema.js';
|
|
|
2
2
|
import { type RouteEntry } from './routes.js';
|
|
3
3
|
type Json = Record<string, unknown>;
|
|
4
4
|
export declare const schemaOf: (zod: object, io: "input" | "output") => Json;
|
|
5
|
+
export declare const inQuery: (method: string) => boolean;
|
|
5
6
|
export declare const generatedOpenapi: (pkg: ExtensionPackage, routes: RouteEntry[]) => Json;
|
|
6
7
|
export {};
|
package/dist/api/openapi-doc.js
CHANGED
|
@@ -25,7 +25,7 @@ const okResponse = ({ output, etag }) => ({
|
|
|
25
25
|
...(etag && { headers: { ETag: { schema: STRING } } }),
|
|
26
26
|
});
|
|
27
27
|
const refusal = (code) => content(code, { $ref: '#/components/schemas/Error' });
|
|
28
|
-
const inQuery = (
|
|
28
|
+
export const inQuery = (method) => method === 'get' || method === 'delete';
|
|
29
29
|
const fields = (zod) => bare(zod, 'input');
|
|
30
30
|
const pathParameters = ({ path, spec }) => {
|
|
31
31
|
const typed = spec.params ? (fields(spec.params).properties ?? {}) : {};
|
|
@@ -37,7 +37,7 @@ const pathParameters = ({ path, spec }) => {
|
|
|
37
37
|
}));
|
|
38
38
|
};
|
|
39
39
|
const queryParameters = (entry) => {
|
|
40
|
-
if (!entry.spec.input || !inQuery(entry))
|
|
40
|
+
if (!entry.spec.input || !inQuery(entry.method))
|
|
41
41
|
return [];
|
|
42
42
|
const { properties = {}, required = [] } = fields(entry.spec.input);
|
|
43
43
|
return Object.entries(properties).map(([name, schema]) => ({
|
|
@@ -80,7 +80,9 @@ const operation = (id, entry) => {
|
|
|
80
80
|
security: securityOf(id, scope),
|
|
81
81
|
...(params.length > 0 && { parameters: params }),
|
|
82
82
|
...(input &&
|
|
83
|
-
!inQuery(entry) && {
|
|
83
|
+
!inQuery(entry.method) && {
|
|
84
|
+
requestBody: { required: true, content: json(bare(input, 'input')) },
|
|
85
|
+
}),
|
|
84
86
|
responses: responses(entry),
|
|
85
87
|
};
|
|
86
88
|
};
|
package/dist/api/routes.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import {} from 'zod';
|
|
2
|
-
import {} from '../auth/token-check.js';
|
|
2
|
+
import { badScope } from '../auth/token-check.js';
|
|
3
3
|
import {} from '../context/context.js';
|
|
4
4
|
import {} from '../envelope/envelope.js';
|
|
5
5
|
import { createWellKnownRegistry } from './well-known.js';
|
|
6
6
|
export const ROUTE_METHODS = ['get', 'post', 'put', 'patch', 'delete'];
|
|
7
7
|
const PATH = /^(\/([A-Za-z0-9._~-]+|\{[A-Za-z_][A-Za-z0-9_]*\}))+$/;
|
|
8
|
-
const SCOPES = ['public', 'optional', 'read', 'write', 'admin'];
|
|
9
8
|
const problemOf = (routes, { method, path, spec }) => {
|
|
10
9
|
if (!ROUTE_METHODS.includes(method))
|
|
11
10
|
return `method ${String(method)}: one of get, post, put, patch, delete`;
|
|
@@ -15,9 +14,7 @@ const problemOf = (routes, { method, path, spec }) => {
|
|
|
15
14
|
return 'is registered twice';
|
|
16
15
|
if (!spec.summary)
|
|
17
16
|
return 'needs a summary: it documents the route';
|
|
18
|
-
|
|
19
|
-
return `scope ${String(spec.scope)}: one of ${SCOPES.join(', ')}`;
|
|
20
|
-
return null;
|
|
17
|
+
return badScope(spec.scope);
|
|
21
18
|
};
|
|
22
19
|
export const createRouteRegistry = () => {
|
|
23
20
|
const routes = [];
|
package/dist/auth/part-auth.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Log } from '../log/log.js';
|
|
2
2
|
import { type Env } from '../runtime/build-info.js';
|
|
3
|
+
export declare const isAudience: (audience: string) => boolean;
|
|
3
4
|
export declare const covers: (audience: string, host: string) => boolean;
|
|
4
5
|
export declare const partAuth: (env: Env, id: string, log: Log, scopes: string[]) => Promise<{
|
|
5
6
|
tokenCheck: import("./token-check.js").TokenCheck;
|
package/dist/auth/part-auth.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createRevokedList, REVOKED_POLL_MS } from './revoked.js';
|
|
|
7
7
|
import { accessOfSecurity, scopeOf } from './token-check.js';
|
|
8
8
|
import { createTokenCheck, remoteKeys } from './verify-token.js';
|
|
9
9
|
// *.{a domain of two labels or more}, or one host, as a deployment's origin may name it.
|
|
10
|
-
const isAudience = (audience) => {
|
|
10
|
+
export const isAudience = (audience) => {
|
|
11
11
|
const host = audience.startsWith('*.') ? audience.slice(2) : audience;
|
|
12
12
|
return ['https', 'http'].some((scheme) => OriginSchema.safeParse(`${scheme}://${host}`).success);
|
|
13
13
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare const ACCESS: readonly ["public", "optional", "read", "write", "admin"];
|
|
2
|
+
export type Access = (typeof ACCESS)[number];
|
|
3
|
+
export declare const VERBS: readonly ["read", "write", "admin"];
|
|
4
|
+
export declare const badScope: (scope: unknown, allowed?: readonly Access[]) => string | null;
|
|
2
5
|
export interface Caller {
|
|
3
6
|
sub: string;
|
|
4
7
|
scopes: readonly string[];
|
|
@@ -6,7 +9,7 @@ export interface Caller {
|
|
|
6
9
|
export type TokenCheck = (authorization: string | undefined, access: Access) => Promise<Caller | null>;
|
|
7
10
|
export declare const setCaller: (request: object, caller: Caller | null) => void;
|
|
8
11
|
export declare const callerOf: (request: object) => Caller | null;
|
|
9
|
-
export declare const
|
|
12
|
+
export declare const rank: (access: Access) => number;
|
|
10
13
|
export declare const scopeOf: (id: string, access?: Access) => string;
|
|
11
14
|
export declare const strongest: (needed: readonly Access[]) => Access;
|
|
12
15
|
export declare const accessOfSecurity: (security: unknown) => Access;
|
package/dist/auth/token-check.js
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { setTimeout as sleep } from 'node:timers/promises';
|
|
2
|
+
// What a route or tool declares (api-standards section 5): public, optional (anonymous or a read bearer), or a verb.
|
|
3
|
+
export const ACCESS = ['public', 'optional', 'read', 'write', 'admin'];
|
|
4
|
+
export const VERBS = ['read', 'write', 'admin'];
|
|
5
|
+
// Where a route or a tool may declare its scope: tools have no optional.
|
|
6
|
+
export const badScope = (scope, allowed = ACCESS) => scope === undefined || allowed.includes(scope)
|
|
7
|
+
? null
|
|
8
|
+
: `scope ${String(scope)}: one of ${allowed.join(', ')}`;
|
|
2
9
|
const callers = new WeakMap();
|
|
3
10
|
export const setCaller = (request, caller) => void callers.set(request, caller);
|
|
4
11
|
export const callerOf = (request) => callers.get(request) ?? null;
|
|
5
|
-
export const
|
|
12
|
+
export const rank = (access) => ACCESS.indexOf(access);
|
|
6
13
|
export const scopeOf = (id, access = 'read') => access === 'public' ? 'public' : `${id}:${access === 'optional' ? 'read' : access}`;
|
|
7
|
-
export const strongest = (needed) => needed.reduce((top, access) => (
|
|
8
|
-
const VERB =
|
|
14
|
+
export const strongest = (needed) => needed.reduce((top, access) => (rank(access) > rank(top) ? access : top), 'public');
|
|
15
|
+
const VERB = new RegExp(`:(${VERBS.join('|')})$`);
|
|
9
16
|
const isAnonymous = (requirement) => typeof requirement === 'object' && requirement !== null && Object.keys(requirement).length === 0;
|
|
10
17
|
// OpenAPI security: [] is public, [{}, {pat}] optional, a scope names the verb; nothing declared needs read.
|
|
11
18
|
export const accessOfSecurity = (security) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRemoteJWKSet, errors, jwtVerify } from 'jose';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { fail, isFailure } from '../envelope/envelope.js';
|
|
4
|
-
import {
|
|
4
|
+
import { rank, retryOnce, scopeOf, VERBS } from './token-check.js';
|
|
5
5
|
const VERIFY = { algorithms: ['EdDSA'], requiredClaims: ['exp'] };
|
|
6
6
|
const ClaimsSchema = z.object({
|
|
7
7
|
sub: z.string().min(1),
|
|
@@ -51,7 +51,7 @@ const claimsOf = async (authorization, deps) => {
|
|
|
51
51
|
};
|
|
52
52
|
export const grants = (scope, id, access) => {
|
|
53
53
|
const held = new Set(scope.split(' '));
|
|
54
|
-
return
|
|
54
|
+
return VERBS.some((verb) => rank(verb) >= rank(access) && held.has(`${id}:${verb}`));
|
|
55
55
|
};
|
|
56
56
|
export const createTokenCheck = (deps) => async (authorization, access) => {
|
|
57
57
|
// optional: no bearer is anonymous, but a bearer sent is checked like read, never ignored.
|
|
@@ -2,6 +2,7 @@ import { chmodSync, mkdirSync } from 'node:fs';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import {} from '../auth/token-check.js';
|
|
4
4
|
import { createLog } from '../log/log.js';
|
|
5
|
+
import { createSpan } from '../log/span.js';
|
|
5
6
|
import {} from '../manifest/manifest.schema.js';
|
|
6
7
|
import {} from './command.types.js';
|
|
7
8
|
import {} from './out.js';
|
|
@@ -20,11 +21,13 @@ export const cliContext = (pkg, run) => {
|
|
|
20
21
|
const { id } = pkg.agentage;
|
|
21
22
|
const tags = { extension: id, part: 'cli', version: pkg.version, base: { command: run.command } };
|
|
22
23
|
const dir = ownDir(run.dataDir, id);
|
|
24
|
+
const log = createLog(tags, run.stderr);
|
|
23
25
|
return Object.freeze({
|
|
24
26
|
extension: Object.freeze({ id, version: pkg.version, part: 'cli' }),
|
|
25
27
|
args: Object.freeze(run.args),
|
|
26
28
|
out: run.out,
|
|
27
|
-
log
|
|
29
|
+
log,
|
|
30
|
+
span: createSpan(log),
|
|
28
31
|
user: run.user ?? null,
|
|
29
32
|
client: run.client ?? NO_CLIENT,
|
|
30
33
|
get dir() {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type RouteMethod } from '../api/routes.js';
|
|
2
2
|
import { type Caller } from '../auth/token-check.js';
|
|
3
3
|
import { type Log } from '../log/log.js';
|
|
4
|
+
import { type Span } from '../log/span.js';
|
|
4
5
|
import { type Out } from './out.js';
|
|
5
6
|
import { type ArgValue } from './args.js';
|
|
6
7
|
export interface CommandExtension {
|
|
@@ -17,6 +18,7 @@ export interface CliContext {
|
|
|
17
18
|
readonly args: Readonly<Record<string, ArgValue>>;
|
|
18
19
|
readonly out: Out;
|
|
19
20
|
readonly log: Log;
|
|
21
|
+
readonly span: Span;
|
|
20
22
|
readonly user: Caller | null;
|
|
21
23
|
readonly client: CliClient;
|
|
22
24
|
readonly dir: string;
|
|
@@ -2,6 +2,7 @@ import { type Caller } from '../auth/token-check.js';
|
|
|
2
2
|
import { type ExtensionPackage } from '../manifest/manifest.schema.js';
|
|
3
3
|
import { type StoreKind } from '../manifest/primitives.schema.js';
|
|
4
4
|
import { type Log } from '../log/log.js';
|
|
5
|
+
import { type Span } from '../log/span.js';
|
|
5
6
|
import { type Store } from '../store/store.types.js';
|
|
6
7
|
import { type Secrets } from './secrets.js';
|
|
7
8
|
export type ServerPartKind = 'pages' | 'api' | 'mcp' | 'worker';
|
|
@@ -20,6 +21,7 @@ export interface PartContext {
|
|
|
20
21
|
caller(request: object): Caller | null;
|
|
21
22
|
};
|
|
22
23
|
readonly log: Log;
|
|
24
|
+
readonly span: Span;
|
|
23
25
|
readonly settings: Readonly<Record<string, SettingValue>>;
|
|
24
26
|
readonly store: Store;
|
|
25
27
|
readonly secrets: Secrets;
|
package/dist/context/context.js
CHANGED
|
@@ -3,6 +3,7 @@ import {} from '../manifest/manifest.schema.js';
|
|
|
3
3
|
import { storeOf } from '../manifest/parts.js';
|
|
4
4
|
import {} from '../manifest/primitives.schema.js';
|
|
5
5
|
import { createLog } from '../log/log.js';
|
|
6
|
+
import { createSpan } from '../log/span.js';
|
|
6
7
|
import {} from '../store/store.types.js';
|
|
7
8
|
import {} from './secrets.js';
|
|
8
9
|
// ctx.store is always there; without a store part in the manifest it says so on first use.
|
|
@@ -27,5 +28,6 @@ export const createContext = (input) => {
|
|
|
27
28
|
const settings = Object.freeze({ ...settingDefaults(pkg), ...input.settings });
|
|
28
29
|
const auth = Object.freeze({ caller: callerOf });
|
|
29
30
|
const secrets = input.secrets ?? {};
|
|
30
|
-
|
|
31
|
+
const span = createSpan(log);
|
|
32
|
+
return Object.freeze({ extension, auth, log, span, settings, store: store ?? NO_STORE, secrets });
|
|
31
33
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { messageOf } from '../log/log.js';
|
|
2
|
-
export const recordingLog = (logs) => ({
|
|
1
|
+
import { messageOf, withLineAt } from '../log/log.js';
|
|
2
|
+
export const recordingLog = (logs) => withLineAt({
|
|
3
3
|
info: (message, fields = {}) => void logs.push({ level: 'info', message, fields }),
|
|
4
4
|
warn: (message, fields = {}) => void logs.push({ level: 'warn', message, fields }),
|
|
5
5
|
error: (error, fields = {}) => void logs.push({
|
|
@@ -7,4 +7,4 @@ export const recordingLog = (logs) => ({
|
|
|
7
7
|
message: messageOf(error),
|
|
8
8
|
fields: { ...fields, err: error },
|
|
9
9
|
}),
|
|
10
|
-
});
|
|
10
|
+
}, (level, message, fields) => void logs.push({ level, message, fields }));
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ArgValue } from '../command/args.js';
|
|
2
2
|
import { type Caller } from '../auth/token-check.js';
|
|
3
3
|
import { type CliClient, type CliContext } from '../command/command.types.js';
|
|
4
|
+
import { type SpanRecord } from '../log/span.js';
|
|
4
5
|
import { type LogEntry } from './recording-log.js';
|
|
5
6
|
export type ClientCall = {
|
|
6
7
|
kind: 'api';
|
|
@@ -19,6 +20,7 @@ export interface TestCommandContext extends CliContext {
|
|
|
19
20
|
};
|
|
20
21
|
readonly exitCode: number | undefined;
|
|
21
22
|
readonly logs: LogEntry[];
|
|
23
|
+
readonly spans: SpanRecord[];
|
|
22
24
|
readonly calls: ClientCall[];
|
|
23
25
|
}
|
|
24
26
|
export interface TestCommandOptions {
|
|
@@ -5,6 +5,7 @@ import {} from '../command/args.js';
|
|
|
5
5
|
import {} from '../auth/token-check.js';
|
|
6
6
|
import {} from '../command/command.types.js';
|
|
7
7
|
import { createOut } from '../command/out.js';
|
|
8
|
+
import { createSpan } from '../log/span.js';
|
|
8
9
|
import { packageExtension } from './package-extension.js';
|
|
9
10
|
import { recordingLog } from './recording-log.js';
|
|
10
11
|
// One recorded line per line written, the trailing newline dropped.
|
|
@@ -28,17 +29,25 @@ const recorded = (options) => {
|
|
|
28
29
|
const output = { stdout: [], stderr: [] };
|
|
29
30
|
const json = options.json ?? false;
|
|
30
31
|
const out = createOut({ json, stdout: lines(output.stdout), stderr: lines(output.stderr) });
|
|
31
|
-
return {
|
|
32
|
+
return {
|
|
33
|
+
out,
|
|
34
|
+
output,
|
|
35
|
+
logs: [],
|
|
36
|
+
spans: [],
|
|
37
|
+
calls: [],
|
|
38
|
+
};
|
|
32
39
|
};
|
|
33
40
|
export const commandContext = (options) => {
|
|
34
|
-
const { out, output, logs, calls } = recorded(options);
|
|
41
|
+
const { out, output, logs, spans, calls } = recorded(options);
|
|
35
42
|
const { id = 'test', version = '0.0.0' } = packageExtension();
|
|
36
43
|
const extension = { id, version, ...options.extension, part: 'cli' };
|
|
37
44
|
const fixedUser = { sub: 'usr_test', scopes: [`${extension.id}:read`] };
|
|
38
45
|
const dir = lazyDir();
|
|
46
|
+
const log = recordingLog(logs);
|
|
39
47
|
return {
|
|
40
|
-
...{ extension, args: { ...options.args }, out, output, logs, calls },
|
|
41
|
-
log
|
|
48
|
+
...{ extension, args: { ...options.args }, out, output, logs, spans, calls },
|
|
49
|
+
log,
|
|
50
|
+
span: createSpan(log, spans),
|
|
42
51
|
user: options.user === undefined ? fixedUser : options.user,
|
|
43
52
|
client: recordingClient(calls, options.client),
|
|
44
53
|
get dir() {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type RouteEntry, type RouteRegistrar } from '../api/routes.js';
|
|
2
2
|
import { type WellKnownRegistrar } from '../api/well-known.js';
|
|
3
|
+
import { type SpanRecord } from '../log/span.js';
|
|
3
4
|
import { type ToolEntry, type ToolRegistrar } from '../mcp/tools.js';
|
|
4
5
|
import { type JobOptions } from '../worker/job-options.js';
|
|
5
6
|
import { type JobRun } from '../worker/runs.js';
|
|
@@ -19,6 +20,7 @@ export interface TestContext extends PartContext {
|
|
|
19
20
|
readonly routes: RouteEntry[];
|
|
20
21
|
readonly wellKnown: WellKnownRegistrar;
|
|
21
22
|
readonly jobs: ScheduledJob[];
|
|
23
|
+
readonly spans: SpanRecord[];
|
|
22
24
|
runJob(name: string): Promise<JobRun | undefined>;
|
|
23
25
|
}
|
|
24
26
|
export interface ScheduledJob {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createRouteRegistry } from '../api/routes.js';
|
|
2
2
|
import {} from '../api/well-known.js';
|
|
3
3
|
import {} from '../log/log.js';
|
|
4
|
+
import { createSpan } from '../log/span.js';
|
|
4
5
|
import { createToolRegistry } from '../mcp/tools.js';
|
|
5
6
|
import { migrate } from '../store/migrations.js';
|
|
6
7
|
import { createTestStore } from '../store/test-store.js';
|
|
@@ -57,6 +58,7 @@ const identityOf = (options) => {
|
|
|
57
58
|
const serverContext = (options) => {
|
|
58
59
|
const logs = [];
|
|
59
60
|
const log = runLog(recordingLog(logs));
|
|
61
|
+
const spans = [];
|
|
60
62
|
const { extension, ...open } = identityOf(options);
|
|
61
63
|
const store = testStore(open.store, recordingLog([]));
|
|
62
64
|
const caller = { sub: 'usr_test', scopes: [`${extension.id}:read`] };
|
|
@@ -65,6 +67,8 @@ const serverContext = (options) => {
|
|
|
65
67
|
auth: { caller: () => caller },
|
|
66
68
|
log,
|
|
67
69
|
logs,
|
|
70
|
+
span: createSpan(log, spans),
|
|
71
|
+
spans,
|
|
68
72
|
settings: { ...options.settings },
|
|
69
73
|
store: store ?? NO_STORE,
|
|
70
74
|
secrets: Object.freeze({ ...options.secrets }),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AGCID_HEADER, isAgcid } from '../agcid/header.js';
|
|
2
|
+
export { DiscoveryDocumentSchema, ExtensionRecordSchema, type DiscoveryDocument, type ExtensionRecord, } from '../discovery/discovery.schema.js';
|
|
3
|
+
export { ERROR_CODES, type ErrorCode } from '../envelope/codes.js';
|
|
4
|
+
export { ErrorEnvelopeSchema, OkEnvelopeSchema } from '../envelope/envelope.schema.js';
|
|
5
|
+
export { type ErrorEnvelope, type OkEnvelope } from '../envelope/envelope.js';
|
|
6
|
+
export { HealthSchema, type HealthBody, type HealthStatus } from '../health/health.schema.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { AGCID_HEADER, isAgcid } from '../agcid/header.js';
|
|
2
|
+
export { DiscoveryDocumentSchema, ExtensionRecordSchema, } from '../discovery/discovery.schema.js';
|
|
3
|
+
export { ERROR_CODES } from '../envelope/codes.js';
|
|
4
|
+
export { ErrorEnvelopeSchema, OkEnvelopeSchema } from '../envelope/envelope.schema.js';
|
|
5
|
+
export {} from '../envelope/envelope.js';
|
|
6
|
+
export { HealthSchema } from '../health/health.schema.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { AGCID_PATTERN } from '../agcid/
|
|
2
|
+
import { AGCID_PATTERN } from '../agcid/header.js';
|
|
3
3
|
import { ERROR_CODES } from './codes.js';
|
|
4
4
|
const AgcidSchema = z.string().regex(AGCID_PATTERN);
|
|
5
5
|
const ErrorCodeSchema = z.enum(ERROR_CODES);
|
package/dist/index.d.ts
CHANGED
|
@@ -7,19 +7,15 @@ export { type Out } from './command/out.js';
|
|
|
7
7
|
export { type ExtensionInfo, type PartContext, type ServerPartKind, type SettingValue, } from './context/context.js';
|
|
8
8
|
export { type Secrets } from './context/secrets.js';
|
|
9
9
|
export { createTestContext, type ClientCall, type LogEntry, type ScheduledJob, type TestCommandContext, type TestCommandOptions, type TestContext, type TestContextOptions, } from './context/test-context.js';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
10
|
+
export { type DiscoveryDocument, type ExtensionRecord } from './discovery/discovery.schema.js';
|
|
11
|
+
export { ERROR_STATUS, type ErrorCode } from './envelope/codes.js';
|
|
12
|
+
export { fail, ok, reply, type ErrorDetail, type ErrorEnvelope, type Failure, type FailOptions, type OkEnvelope, type Reply, type ReplyOptions, } from './envelope/envelope.js';
|
|
13
|
+
export { DiscoveryDocumentSchema } from './discovery/discovery.schema.js';
|
|
14
14
|
export { ErrorEnvelopeSchema, OkEnvelopeSchema } from './envelope/envelope.schema.js';
|
|
15
15
|
export { parse, type ParseSchema } from './envelope/parse.js';
|
|
16
|
-
export {
|
|
16
|
+
export { type HealthBody, type HealthStatus } from './health/health.schema.js';
|
|
17
17
|
export { type Log, type LogFields } from './log/log.js';
|
|
18
|
-
export {
|
|
19
|
-
export { imageParts } from './manifest/parts.js';
|
|
20
|
-
export { SERVED_KINDS, STORE_KINDS, type StoreKind } from './manifest/primitives.schema.js';
|
|
21
|
-
export { readManifest, validateManifest } from './manifest/read-manifest.js';
|
|
22
|
-
export { canonical, mcpSnapshot, PROTOCOL_VERSIONS, type McpSnapshot, type ProtocolVersion, } from './mcp/snapshot.js';
|
|
18
|
+
export { type Span, type SpanRecord } from './log/span.js';
|
|
23
19
|
export { type McpContext, type ToolHandler, type ToolRegistrar, type ToolSpec, } from './mcp/tools.js';
|
|
24
20
|
export { versionPage, type PagesContext, type PagesSite } from './pages/pages.js';
|
|
25
21
|
export { type ApiCreate, type ApiHandler, type ApiPart } from './server/part.types.js';
|
package/dist/index.js
CHANGED
|
@@ -7,19 +7,16 @@ export {} from './command/out.js';
|
|
|
7
7
|
export {} from './context/context.js';
|
|
8
8
|
export {} from './context/secrets.js';
|
|
9
9
|
export { createTestContext, } from './context/test-context.js';
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
|
|
10
|
+
export {} from './discovery/discovery.schema.js';
|
|
11
|
+
export { ERROR_STATUS } from './envelope/codes.js';
|
|
12
|
+
export { fail, ok, reply, } from './envelope/envelope.js';
|
|
13
|
+
// Also in /contracts: main drops them once probe master's e2e reads them from there.
|
|
14
|
+
export { DiscoveryDocumentSchema } from './discovery/discovery.schema.js';
|
|
14
15
|
export { ErrorEnvelopeSchema, OkEnvelopeSchema } from './envelope/envelope.schema.js';
|
|
15
16
|
export { parse } from './envelope/parse.js';
|
|
16
|
-
export {
|
|
17
|
+
export {} from './health/health.schema.js';
|
|
17
18
|
export {} from './log/log.js';
|
|
18
|
-
export {
|
|
19
|
-
export { imageParts } from './manifest/parts.js';
|
|
20
|
-
export { SERVED_KINDS, STORE_KINDS } from './manifest/primitives.schema.js';
|
|
21
|
-
export { readManifest, validateManifest } from './manifest/read-manifest.js';
|
|
22
|
-
export { canonical, mcpSnapshot, PROTOCOL_VERSIONS, } from './mcp/snapshot.js';
|
|
19
|
+
export {} from './log/span.js';
|
|
23
20
|
export {} from './mcp/tools.js';
|
|
24
21
|
export { versionPage } from './pages/pages.js';
|
|
25
22
|
export {} from './server/part.types.js';
|
package/dist/log/log.d.ts
CHANGED
|
@@ -13,5 +13,8 @@ export interface LogTags {
|
|
|
13
13
|
}
|
|
14
14
|
export type LogWrite = (line: string) => void;
|
|
15
15
|
export declare const messageOf: (error: unknown) => string;
|
|
16
|
+
export declare const errorFields: (error: unknown) => LogFields;
|
|
17
|
+
export type LineAt = (level: LogLevel, message: string, fields: LogFields) => void;
|
|
18
|
+
export declare const withLineAt: (log: Log, at: LineAt) => Log;
|
|
16
19
|
export declare const createLog: (tags: LogTags, write?: LogWrite) => Log;
|
|
17
20
|
export declare const logAt: (log: Log, level: LogLevel, message: string, fields: LogFields) => void;
|
package/dist/log/log.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { currentAgcid } from '../agcid/current.js';
|
|
2
2
|
export const messageOf = (error) => error instanceof Error ? error.message : String(error);
|
|
3
|
-
const errorFields = (error) => {
|
|
3
|
+
export const errorFields = (error) => {
|
|
4
4
|
if (!(error instanceof Error))
|
|
5
5
|
return { err: { message: String(error) } };
|
|
6
6
|
return { err: { type: error.name, message: error.message, stack: error.stack } };
|
|
@@ -16,6 +16,11 @@ const line = (level, message, tags, fields) => {
|
|
|
16
16
|
};
|
|
17
17
|
const stderrWrite = (text) => void process.stderr.write(text);
|
|
18
18
|
const raw = new WeakMap();
|
|
19
|
+
// Registers how a Log writes a line as given, so logAt keeps every field on it.
|
|
20
|
+
export const withLineAt = (log, at) => {
|
|
21
|
+
raw.set(log, at);
|
|
22
|
+
return log;
|
|
23
|
+
};
|
|
19
24
|
export const createLog = (tags, write = stderrWrite) => {
|
|
20
25
|
const at = (level, message, fields) => write(line(level, message, tags, fields));
|
|
21
26
|
const log = {
|
|
@@ -23,8 +28,7 @@ export const createLog = (tags, write = stderrWrite) => {
|
|
|
23
28
|
warn: (message, fields = {}) => at('warn', message, fields),
|
|
24
29
|
error: (error, fields = {}) => at('error', messageOf(error), { ...fields, ...errorFields(error) }),
|
|
25
30
|
};
|
|
26
|
-
|
|
27
|
-
return log;
|
|
31
|
+
return withLineAt(log, at);
|
|
28
32
|
};
|
|
29
33
|
// A line at any level with no err field (an error-level line that is not an error event).
|
|
30
34
|
export const logAt = (log, level, message, fields) => {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Log } from './log.js';
|
|
2
|
+
export interface SpanRecord {
|
|
3
|
+
name: string;
|
|
4
|
+
ms: number;
|
|
5
|
+
ok: boolean;
|
|
6
|
+
err?: unknown;
|
|
7
|
+
}
|
|
8
|
+
export type Span = <T>(name: string, fn: () => T | Promise<T>) => Promise<T>;
|
|
9
|
+
export declare const createSpan: (log: Log, spans?: SpanRecord[]) => Span;
|
package/dist/log/span.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { errorFields, logAt } from './log.js';
|
|
2
|
+
// One line per span; a nested span is its own line, the agcid on both links them.
|
|
3
|
+
export const createSpan = (log, spans) => async (name, fn) => {
|
|
4
|
+
const start = performance.now();
|
|
5
|
+
const end = (ok, err) => {
|
|
6
|
+
const span = { name, ms: Math.round(performance.now() - start), ok };
|
|
7
|
+
spans?.push(ok ? span : { ...span, err });
|
|
8
|
+
logAt(log, ok ? 'info' : 'error', 'span', ok ? span : { ...span, ...errorFields(err) });
|
|
9
|
+
};
|
|
10
|
+
try {
|
|
11
|
+
const value = await fn();
|
|
12
|
+
end(true);
|
|
13
|
+
return value;
|
|
14
|
+
}
|
|
15
|
+
catch (err) {
|
|
16
|
+
end(false, err);
|
|
17
|
+
throw err;
|
|
18
|
+
}
|
|
19
|
+
};
|
package/dist/mcp/tools.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {} from 'zod';
|
|
2
|
-
import {} from '../auth/token-check.js';
|
|
2
|
+
import { ACCESS, badScope } from '../auth/token-check.js';
|
|
3
3
|
import {} from '../context/context.js';
|
|
4
4
|
const TOOL_NAME = /^[a-z][a-z0-9_-]*$/;
|
|
5
|
-
const
|
|
5
|
+
const TOOL_ACCESS = ACCESS.filter((access) => access !== 'optional');
|
|
6
6
|
export const createToolRegistry = () => {
|
|
7
7
|
const tools = [];
|
|
8
8
|
const tool = (name, spec, handler) => {
|
|
@@ -12,8 +12,9 @@ export const createToolRegistry = () => {
|
|
|
12
12
|
throw new Error(`tool ${name} is registered twice`);
|
|
13
13
|
if (!spec.description)
|
|
14
14
|
throw new Error(`tool ${name} needs a description: it routes the model`);
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
const bad = badScope(spec.scope, TOOL_ACCESS);
|
|
16
|
+
if (bad)
|
|
17
|
+
throw new Error(`tool ${name} ${bad}`);
|
|
17
18
|
tools.push({ name, spec, handler: handler });
|
|
18
19
|
};
|
|
19
20
|
return { tool, tools };
|
package/dist/pages/pages-app.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { extname } from 'node:path';
|
|
2
2
|
import {} from 'express';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
+
import { isAudience } from '../auth/part-auth.js';
|
|
4
5
|
import {} from '../runtime/build-info.js';
|
|
5
6
|
import { createPartApp } from '../server/app.js';
|
|
6
7
|
import {} from './pages.js';
|
|
7
|
-
// One host (a port allowed), or *. over at least two labels: never a whole top-level domain.
|
|
8
|
-
const AUDIENCE = /^(\*\.[a-z0-9-]+(\.[a-z0-9-]+)+|[a-z0-9-]+(\.[a-z0-9-]+)*)(:\d+)?$/;
|
|
9
8
|
const WEB = ['http:', 'https:'];
|
|
10
9
|
const webUrl = (url) => {
|
|
11
10
|
const parsed = url && URL.canParse(url) ? new URL(url) : undefined;
|
|
@@ -16,7 +15,7 @@ export const platformSources = (env) => {
|
|
|
16
15
|
const issuer = webUrl(env['AGENTAGE_ISSUER'])?.origin;
|
|
17
16
|
const scheme = webUrl(env['AGENTAGE_ORIGIN'])?.protocol ?? 'https:';
|
|
18
17
|
const audience = env['AGENTAGE_AUDIENCE'] ?? '';
|
|
19
|
-
return [issuer,
|
|
18
|
+
return [issuer, isAudience(audience) ? `${scheme}//${audience}` : undefined].filter((source) => Boolean(source));
|
|
20
19
|
};
|
|
21
20
|
const TYPES = { '.js': 'js', '.mjs': 'js', '.css': 'css', '.json': 'json' };
|
|
22
21
|
const SiteSchema = z.record(z.string().regex(/^\/[A-Za-z0-9._~/-]*$/), z.string());
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type BuildInfo } from '../discovery/discovery.js';
|
|
2
2
|
export type Env = Readonly<Record<string, string | undefined>>;
|
|
3
3
|
export declare const isoSeconds: (date: Date) => string;
|
|
4
|
+
export declare const buildTimeOf: (env: Env, now: Date) => string;
|
|
4
5
|
export declare const buildInfoFromEnv: (env: Env, now?: Date) => BuildInfo;
|
|
5
6
|
export declare const portFromEnv: (env: Env, fallback?: number) => number;
|
|
@@ -3,10 +3,11 @@ import { FULL_SHA } from '../manifest/primitives.schema.js';
|
|
|
3
3
|
const UNKNOWN_COMMIT = '0'.repeat(40);
|
|
4
4
|
export const isoSeconds = (date) => `${date.toISOString().slice(0, 19)}Z`;
|
|
5
5
|
const commitOf = (sha = '') => (FULL_SHA.test(sha) ? sha : UNKNOWN_COMMIT);
|
|
6
|
+
export const buildTimeOf = (env, now) => env['BUILD_TIME'] || isoSeconds(now);
|
|
6
7
|
// COMMIT_SHA and BUILD_TIME are baked into every image by the recipe; a bare dev run shows zeros.
|
|
7
8
|
export const buildInfoFromEnv = (env, now = new Date()) => ({
|
|
8
9
|
commit: commitOf(env['COMMIT_SHA']),
|
|
9
|
-
buildTime: env
|
|
10
|
+
buildTime: buildTimeOf(env, now),
|
|
10
11
|
});
|
|
11
12
|
export const portFromEnv = (env, fallback = 3000) => {
|
|
12
13
|
const port = Number(env['PORT']);
|
|
@@ -6,6 +6,7 @@ import {} from '../manifest/manifest.schema.js';
|
|
|
6
6
|
import { loadCreate } from '../manifest/entry.js';
|
|
7
7
|
import { hasStore } from '../manifest/parts.js';
|
|
8
8
|
import {} from '../manifest/primitives.schema.js';
|
|
9
|
+
import { createSpan } from '../log/span.js';
|
|
9
10
|
import { createMcpApp } from '../mcp/mcp-app.js';
|
|
10
11
|
import { createToolRegistry } from '../mcp/tools.js';
|
|
11
12
|
import { createPagesApp, platformSources } from '../pages/pages-app.js';
|
|
@@ -48,7 +49,12 @@ const worker = async (input) => {
|
|
|
48
49
|
const log = runLog(ctx.log);
|
|
49
50
|
const runs = hasStore(input.pkg, 'postgres') ? storeRuns(ctx.store) : memoryRuns();
|
|
50
51
|
const scheduler = createScheduler({ runs, log });
|
|
51
|
-
await callCreate(input, 'worker', {
|
|
52
|
+
await callCreate(input, 'worker', {
|
|
53
|
+
...ctx,
|
|
54
|
+
log,
|
|
55
|
+
span: createSpan(log),
|
|
56
|
+
schedule: scheduler.schedule,
|
|
57
|
+
});
|
|
52
58
|
const checks = { ...input.base.checks, ...scheduler.checks() };
|
|
53
59
|
scheduler.start();
|
|
54
60
|
return {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Router } from 'express';
|
|
2
|
+
import { inQuery } from '../api/openapi-doc.js';
|
|
2
3
|
import { createRouteRegistry } from '../api/routes.js';
|
|
3
4
|
import {} from '../api/well-known.js';
|
|
4
5
|
import {} from '../context/context.js';
|
|
5
6
|
import { isReply, ok, reply } from '../envelope/envelope.js';
|
|
6
7
|
import { parse } from '../envelope/parse.js';
|
|
7
8
|
import {} from './part.types.js';
|
|
8
|
-
const inQuery = (method) => method === 'get' || method === 'delete';
|
|
9
9
|
const inputOf = ({ method, spec }, query, body) => {
|
|
10
10
|
if (!spec.input)
|
|
11
11
|
return {};
|
package/dist/tool/build-info.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {} from '../discovery/discovery.js';
|
|
2
2
|
import { FULL_SHA } from '../manifest/primitives.schema.js';
|
|
3
|
-
import {
|
|
3
|
+
import { buildTimeOf } from '../runtime/build-info.js';
|
|
4
4
|
import { mustRun } from './exec.js';
|
|
5
|
-
const
|
|
5
|
+
const headCommit = async (dir, env, run) => {
|
|
6
6
|
const given = env['COMMIT_SHA'] || env['GITHUB_SHA'];
|
|
7
7
|
if (given)
|
|
8
8
|
return given;
|
|
@@ -10,8 +10,8 @@ const commitOf = async (dir, env, run) => {
|
|
|
10
10
|
};
|
|
11
11
|
// The commit every image label, /health and the record carry: CI's sha, else the checkout's HEAD.
|
|
12
12
|
export const resolveBuildInfo = async (dir, env, run, now = new Date()) => {
|
|
13
|
-
const commit = await
|
|
13
|
+
const commit = await headCommit(dir, env, run);
|
|
14
14
|
if (!FULL_SHA.test(commit))
|
|
15
15
|
throw new Error(`commit is not a full 40-hex sha: ${commit}`);
|
|
16
|
-
return { commit, buildTime: env
|
|
16
|
+
return { commit, buildTime: buildTimeOf(env, now) };
|
|
17
17
|
};
|
package/dist/tool/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { checkCli } from '../command/check-cli.js';
|
|
2
2
|
export { runCommand, type RunCommandOptions } from '../command/run-command.js';
|
|
3
|
-
export { type
|
|
3
|
+
export { PackageSchema, type CommandSpec, type ExtensionPackage, } from '../manifest/manifest.schema.js';
|
|
4
|
+
export { imageParts } from '../manifest/parts.js';
|
|
5
|
+
export { SERVED_KINDS, STORE_KINDS, type StoreKind } from '../manifest/primitives.schema.js';
|
|
4
6
|
export { readManifest, validateManifest } from '../manifest/read-manifest.js';
|
|
7
|
+
export { canonical, mcpSnapshot, PROTOCOL_VERSIONS, type McpSnapshot, type ProtocolVersion, } from '../mcp/snapshot.js';
|
|
5
8
|
export { build, type BuildDeps, type BuildOptions, type BuildResult, type BuiltImage, } from './build.js';
|
|
6
9
|
export { check, type CheckProblem, type CheckReport } from './check.js';
|
|
7
10
|
export { writeContracts } from './contracts.js';
|
package/dist/tool/index.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { checkCli } from '../command/check-cli.js';
|
|
2
2
|
export { runCommand } from '../command/run-command.js';
|
|
3
|
-
export {} from '../manifest/manifest.schema.js';
|
|
3
|
+
export { PackageSchema, } from '../manifest/manifest.schema.js';
|
|
4
|
+
export { imageParts } from '../manifest/parts.js';
|
|
5
|
+
export { SERVED_KINDS, STORE_KINDS } from '../manifest/primitives.schema.js';
|
|
4
6
|
export { readManifest, validateManifest } from '../manifest/read-manifest.js';
|
|
7
|
+
export { canonical, mcpSnapshot, PROTOCOL_VERSIONS, } from '../mcp/snapshot.js';
|
|
5
8
|
export { build, } from './build.js';
|
|
6
9
|
export { check } from './check.js';
|
|
7
10
|
export { writeContracts } from './contracts.js';
|
package/dist/worker/run-log.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
2
|
-
import { messageOf } from '../log/log.js';
|
|
2
|
+
import { logAt, messageOf, withLineAt, } from '../log/log.js';
|
|
3
3
|
export const LOG_CAP_BYTES = 64 * 1024;
|
|
4
4
|
const TRUNCATED = '\n[log truncated at 64 KB]\n';
|
|
5
5
|
const current = new AsyncLocalStorage();
|
|
@@ -22,7 +22,11 @@ const record = (level, message) => {
|
|
|
22
22
|
append(buffer, `${level} ${message}`);
|
|
23
23
|
};
|
|
24
24
|
// ctx.log for a worker: the usual JSON line, and inside a run also the run's own log.
|
|
25
|
-
|
|
25
|
+
const runLogAt = (base) => (level, message, fields) => {
|
|
26
|
+
record(level, message);
|
|
27
|
+
logAt(base, level, message, fields);
|
|
28
|
+
};
|
|
29
|
+
export const runLog = (base) => withLineAt({
|
|
26
30
|
info: (message, fields) => {
|
|
27
31
|
record('info', message);
|
|
28
32
|
base.info(message, fields);
|
|
@@ -35,4 +39,4 @@ export const runLog = (base) => ({
|
|
|
35
39
|
record('error', messageOf(error));
|
|
36
40
|
base.error(error, fields);
|
|
37
41
|
},
|
|
38
|
-
});
|
|
42
|
+
}, runLogAt(base));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentage/extension",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.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",
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
"types": "./dist/tool/index.d.ts",
|
|
29
29
|
"default": "./dist/tool/index.js"
|
|
30
30
|
},
|
|
31
|
+
"./contracts": {
|
|
32
|
+
"types": "./dist/contracts/index.d.ts",
|
|
33
|
+
"default": "./dist/contracts/index.js"
|
|
34
|
+
},
|
|
31
35
|
"./migrate": {
|
|
32
36
|
"default": "./dist/store/migrate.js"
|
|
33
37
|
},
|