@agentage/extension 0.19.0 → 0.19.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.
@@ -10,6 +10,7 @@ export declare const hostEnvOf: (env: Env) => {
10
10
  settings: Record<string, unknown>;
11
11
  secretsDir: string;
12
12
  origin: string;
13
+ platform: import("../index.js").PlatformInfo;
13
14
  drainMs: number;
14
15
  storeOpenMs: number;
15
16
  storeUrlFile: string | undefined;
@@ -1,4 +1,4 @@
1
- import { declaredScopes, partAuth } from '../auth/part-auth.js';
1
+ import { declaredScopes, partAuth, platformOf } from '../auth/part-auth.js';
2
2
  import { scopeOf } from '../auth/token-check.js';
3
3
  import { SECRETS_DIR } from '../context/secrets.js';
4
4
  import { parseObject } from '../context/settings.js';
@@ -28,6 +28,7 @@ export const hostEnvOf = (env) => {
28
28
  settings: env['AGENTAGE_SETTINGS'] ? parseObject(env['AGENTAGE_SETTINGS']) : {},
29
29
  secretsDir: env['AGENTAGE_SECRETS_DIR'] || SECRETS_DIR,
30
30
  origin: env['AGENTAGE_ORIGIN'] || `http://127.0.0.1${port ? `:${port}` : ''}`,
31
+ platform: platformOf(env),
31
32
  drainMs: msOf(env['AGENTAGE_DRAIN_MS'], GRACE_MS),
32
33
  storeOpenMs: msOf(env['AGENTAGE_STORE_OPEN_MS'], STORE_OPEN_MS),
33
34
  // G1, G2: the estate's postgres or clickhouse; unset keeps PGlite in dataDir.
@@ -1,4 +1,5 @@
1
1
  import { type Express } from 'express';
2
+ import { type PlatformInfo } from '../context/context.js';
2
3
  import { type BuildInfo } from '../discovery/discovery.js';
3
4
  import { type HealthBody } from '../health/health.schema.js';
4
5
  import { type Log } from '../log/log.js';
@@ -13,6 +14,7 @@ export interface HostOptions {
13
14
  secrets?: Record<string, string>;
14
15
  onExit?: () => void;
15
16
  origin?: string;
17
+ platform?: PlatformInfo;
16
18
  localOnly?: boolean;
17
19
  localPorts?: number[];
18
20
  storeOpenMs?: number;
@@ -3,6 +3,7 @@ import { stat } from 'node:fs/promises';
3
3
  import { join } from 'node:path';
4
4
  import { setTimeout as sleep } from 'node:timers/promises';
5
5
  import {} from 'express';
6
+ import {} from '../context/context.js';
6
7
  import {} from '../discovery/discovery.js';
7
8
  import { healthBody } from '../health/health.js';
8
9
  import {} from '../health/health.schema.js';
@@ -25,6 +25,7 @@ const contextOf = async (h, part, checks) => createContext({
25
25
  part,
26
26
  origin: h.opts.origin ?? 'http://127.0.0.1',
27
27
  commit: h.build.commit,
28
+ platform: h.opts.platform,
28
29
  log: part === 'api'
29
30
  ? h.log
30
31
  : createLog({ extension: h.pkg.agentage.id, part, version: h.pkg.version }),
@@ -52,11 +52,20 @@ export const serveHost = async (env, deps = {}) => {
52
52
  const at = hostEnvOf(env);
53
53
  const guard = guardOf(env, at);
54
54
  const hook = exitHook();
55
- const { dataDir, runDir, settings, origin, secretsDir, storeOpenMs, storeUrlFile } = at;
55
+ const { dataDir, runDir, settings, origin, platform, secretsDir, storeOpenMs, storeUrlFile } = at;
56
56
  // C2: on loopback the child checks Host and Origin itself, for its own port and the daemon's.
57
57
  const local = { localOnly: at.bind === '127.0.0.1', localPorts: loopbackPorts(origin) };
58
58
  const store = { storeOpenMs, storeUrlFile };
59
- const opts = { dataDir, runDir, settings, origin, ...store, onExit: hook.onExit, ...local };
59
+ const opts = {
60
+ dataDir,
61
+ runDir,
62
+ settings,
63
+ origin,
64
+ platform,
65
+ ...store,
66
+ onExit: hook.onExit,
67
+ ...local,
68
+ };
60
69
  const build = await hostBuildInfo(env, at.dir);
61
70
  const host = await hostWith(at.dir, opts, { secretsDir, guard, build });
62
71
  const server = await listen(host.app, at.port, at.bind);
@@ -4,7 +4,7 @@
4
4
  <meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'sha256-rPnVQ9IYe8CdsZZF35pNR4JDk/fH7Uqv6mzmCnCCky8=' 'sha256-lofENefBf5fETbin4TmrCuvlqGNlwIr9jsrkSYCOq+c=' 'sha256-ZowhplWzFwaUWeLf0FFjuCiJ6T38qHnoSSn0bfCSIG4='; style-src 'self'; img-src 'self' data:; font-src 'self' data:; connect-src 'self'; object-src 'none'; base-uri 'self'; form-action 'self'" />
5
5
  <meta charset="utf-8" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1" />
7
- <meta name="agentage-shell" content="0.19.0" />
7
+ <meta name="agentage-shell" content="0.19.1" />
8
8
  <title>agentage</title>
9
9
  <script>
10
10
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentage/extension",
3
- "version": "0.19.0",
3
+ "version": "0.19.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",