@agentforge-io/core 2.0.1 → 2.0.2

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.
@@ -315,11 +315,16 @@ exports.AgentService = AgentService;
315
315
  * Map a persisted `AgentRecord` to the runtime `AgentDefinition` the runner
316
316
  * expects. The `context` column (plain-text knowledge) is prepended to the
317
317
  * system prompt — the cheapest path before RAG is implemented.
318
+ *
319
+ * Extra host fields (`appearance`, `slug`) are passed through as opaque
320
+ * properties so callers like `PublicChatController` can surface them to the
321
+ * widget. The runner ignores anything it doesn't recognize.
318
322
  */
319
323
  function toAgentDefinition(record) {
320
324
  const systemPrompt = record.context
321
325
  ? `${record.systemPrompt}\n\n--- Knowledge ---\n${record.context}`
322
326
  : record.systemPrompt;
327
+ const extra = record;
323
328
  return {
324
329
  id: record.id,
325
330
  name: record.name,
@@ -333,5 +338,7 @@ function toAgentDefinition(record) {
333
338
  mcpServers: record.mcpServers,
334
339
  metadata: record.metadata,
335
340
  connectorOwnerUserId: record.connectorOwnerUserId,
341
+ ...(record.slug !== undefined ? { slug: record.slug } : {}),
342
+ ...(extra.appearance !== undefined ? { appearance: extra.appearance } : {}),
336
343
  };
337
344
  }
@@ -31,13 +31,26 @@ export declare class McpServerService {
31
31
  constructor(repo: McpServerRepository, client?: McpClientService | undefined);
32
32
  create(input: CreateMcpServerInput): Promise<McpServerRecord>;
33
33
  listForTenant(tenantId: string): Promise<McpServerRecord[]>;
34
+ /**
35
+ * Active rows across every tenant. The platform's boot orchestrator uses
36
+ * this to (re)connect MCPs after a process restart; per-request code
37
+ * paths should keep using `listForTenant` to avoid leaking other tenants'
38
+ * configs into a response.
39
+ */
40
+ listAllActive(): Promise<McpServerRecord[]>;
34
41
  getById(id: string): Promise<McpServerRecord>;
35
42
  getByIdForTenant(id: string, tenantId: string): Promise<McpServerRecord>;
36
43
  update(id: string, tenantId: string, patch: McpServerRecordPatch): Promise<McpServerRecord>;
37
44
  delete(id: string, tenantId: string): Promise<void>;
38
- /** Boot path: connect to every active server across tenants. Failures
39
- * are logged but don't abort boot a broken Notion key shouldn't keep
40
- * the rest of the platform from coming up. */
45
+ /**
46
+ * @deprecated Headers are passed through to `McpClientService.register`
47
+ * exactly as stored no `{{KEY}}` resolution against the host's vault.
48
+ * Hosts wiring secrets-in-vault should call `listAllActive()` and run
49
+ * their own bootstrapper instead (see `apps/server/src/modules/mcp/`).
50
+ * This method survives only to keep the legacy in-lib `McpModule`
51
+ * working during the deprecation lap; it will be removed in the same
52
+ * release that drops `McpModule` itself.
53
+ */
41
54
  registerAllActive(): Promise<void>;
42
55
  private assertName;
43
56
  private assertUrl;
@@ -57,6 +57,15 @@ class McpServerService {
57
57
  async listForTenant(tenantId) {
58
58
  return this.repo.listForTenant(tenantId);
59
59
  }
60
+ /**
61
+ * Active rows across every tenant. The platform's boot orchestrator uses
62
+ * this to (re)connect MCPs after a process restart; per-request code
63
+ * paths should keep using `listForTenant` to avoid leaking other tenants'
64
+ * configs into a response.
65
+ */
66
+ async listAllActive() {
67
+ return this.repo.listActive();
68
+ }
60
69
  async getById(id) {
61
70
  const r = await this.repo.findById(id);
62
71
  if (!r)
@@ -102,9 +111,15 @@ class McpServerService {
102
111
  }
103
112
  await this.repo.delete(id);
104
113
  }
105
- /** Boot path: connect to every active server across tenants. Failures
106
- * are logged but don't abort boot a broken Notion key shouldn't keep
107
- * the rest of the platform from coming up. */
114
+ /**
115
+ * @deprecated Headers are passed through to `McpClientService.register`
116
+ * exactly as stored no `{{KEY}}` resolution against the host's vault.
117
+ * Hosts wiring secrets-in-vault should call `listAllActive()` and run
118
+ * their own bootstrapper instead (see `apps/server/src/modules/mcp/`).
119
+ * This method survives only to keep the legacy in-lib `McpModule`
120
+ * working during the deprecation lap; it will be removed in the same
121
+ * release that drops `McpModule` itself.
122
+ */
108
123
  async registerAllActive() {
109
124
  if (!this.client)
110
125
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentforge-io/core",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "Framework-free AI runtime SDK. Owns: agent loop (Anthropic), conversations, tools, streaming, agent-job queue, SdkHooks. Identity, billing, infra (email/uploads/secrets) live in the host's modules — not here.",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",