@alneas/eaos-server 0.1.0 → 0.2.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.
Files changed (43) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.ja.md +28 -18
  3. package/README.md +8 -2
  4. package/dist/agentic/agent-jobs.d.ts +5 -1
  5. package/dist/agentic/autonomous-worker.d.ts +30 -3
  6. package/dist/agentic/autonomous-worker.js +2 -1
  7. package/dist/agentic/event-bridge.d.ts +6 -0
  8. package/dist/agentic/index.d.ts +7 -3
  9. package/dist/agentic/index.js +2 -1
  10. package/dist/agentic/local-runner.d.ts +6 -2
  11. package/dist/chunk-4BARRLJR.js +180 -0
  12. package/dist/chunk-4BARRLJR.js.map +1 -0
  13. package/dist/{chunk-THYUY5ZZ.js → chunk-F2J6IQ6I.js} +68 -25
  14. package/dist/chunk-F2J6IQ6I.js.map +1 -0
  15. package/dist/{chunk-6KV5CJBW.js → chunk-F4IITPGX.js} +5 -5
  16. package/dist/{chunk-DHQGNP4T.js → chunk-SDJNYPYK.js} +2 -2
  17. package/dist/{chunk-DHQGNP4T.js.map → chunk-SDJNYPYK.js.map} +1 -1
  18. package/dist/chunk-YMHVRBUU.js +199 -0
  19. package/dist/chunk-YMHVRBUU.js.map +1 -0
  20. package/dist/db-package/index.js +3 -3
  21. package/dist/engine.js +2 -2
  22. package/dist/execution/chat.d.ts +7 -0
  23. package/dist/execution/chat.js +7 -0
  24. package/dist/execution/chat.js.map +1 -0
  25. package/dist/execution/index.d.ts +294 -2
  26. package/dist/execution/index.js +10 -1
  27. package/dist/execution/index.js.map +1 -1
  28. package/dist/execution/tool-agent.d.ts +7 -0
  29. package/dist/execution/tool-agent.js +8 -0
  30. package/dist/execution/tool-agent.js.map +1 -0
  31. package/dist/index.d.ts +5 -1
  32. package/dist/index.js +4 -3
  33. package/dist/lifecycle-engine/backend-migration.js +1 -1
  34. package/dist/lifecycle-engine/baseline.js +1 -1
  35. package/dist/lifecycle-engine/index.js +1 -1
  36. package/dist/lifecycle-engine/platform/index.js +8 -8
  37. package/dist/sql-lifecycle/index.d.ts +1 -1
  38. package/docs/api.md +809 -2
  39. package/docs/guide.md +44 -0
  40. package/docs/index.md +6 -2
  41. package/package.json +12 -3
  42. package/dist/chunk-THYUY5ZZ.js.map +0 -1
  43. /package/dist/{chunk-6KV5CJBW.js.map → chunk-F4IITPGX.js.map} +0 -0
package/docs/guide.md CHANGED
@@ -46,3 +46,47 @@ The host supplies verified identity and current lifecycle/resource authorization
46
46
  Code installation, database/infrastructure application and tenant activation are separate operations. Import/build/test/install do not perform production migrations or infrastructure updates. Before registry publication, build and test checksum-pinned tarballs in isolated consumers instead of linking sibling source.
47
47
 
48
48
  See [live entitlements](entitlements.md), [database boundaries](db/docs/guide.md), [lifecycle](lifecycle/docs/guide.md) and [storage](storage/docs/guide.md).
49
+
50
+
51
+ ## Shared model execution
52
+
53
+ `@alneas/eaos-server/execution/chat` owns generic chat orchestration and
54
+ `@alneas/eaos-server/execution/tool-agent` owns bounded read-tool orchestration
55
+ and unexecuted write handoffs. Appkit Core 0.2.0 owns HTTP/SSE and Action execution.
56
+ Hosts retain model endpoints, credentials, tool registration, live permission,
57
+ model bindings, budgets and durable accounting. Domain prompts, extraction schemas,
58
+ account mappings and the proposal/approval/save composition belong to plugins.
59
+
60
+ The built-in LiteLLM worker uses this same chat API with the existing endpoint,
61
+ model and fetch options. `litellmHeaders` supplies Host credentials; `chat` supplies
62
+ shared policies and adapters. Injected executors still run first. Goose/Hermes remain
63
+ process adapters. Worker text output limits remain distinct from serialized stream
64
+ event limits. Optional `runTask` cancellation applies to built-in chat; existing
65
+ process and injected-executor cancellation contracts are unchanged.
66
+
67
+ LiteLLM requests SSE (`stream: true`). A custom JSON-only endpoint must supply a
68
+ compatible `AIChatAdapter` or an injected executor; no parallel provider parser is
69
+ provided. A configured model registry requires explicit `modelAdapters` bindings
70
+ for its model IDs. Host parameters cannot replace `model`, `messages`, `tools` or
71
+ `stream`. Unknown usage is passed to the existing accounting port for reconciliation;
72
+ Appkit's OpenAI-compatible adapter does not expose provider SSE token-usage fields.
73
+ This integration does not estimate them or silently record zero.
74
+
75
+ ```typescript
76
+ import { createChatClient, type ChatClientOptions } from '@alneas/eaos-server/execution/chat';
77
+ import { createToolAgent, type ToolAgentOptions } from '@alneas/eaos-server/execution/tool-agent';
78
+
79
+ export function connectChat(options: ChatClientOptions) {
80
+ return createChatClient(options);
81
+ }
82
+
83
+ export function connectReadAgent(options: ToolAgentOptions) {
84
+ return createToolAgent(options);
85
+ }
86
+ ```
87
+
88
+ Read-tool descriptors and retained tool results are reauthorized before model
89
+ disclosure. Write requests remain handoffs to the existing Action/Proposal approval
90
+ path. Provider errors, incomplete streams, cancellation, policy revocation and
91
+ oversized output reject before an authorized response is returned. A transport
92
+ fixture integration test is distinct from a live model/provider acceptance test.
package/docs/index.md CHANGED
@@ -12,6 +12,8 @@ tags: ["eaos","explanation"]
12
12
 
13
13
  # Server execution and persistence
14
14
 
15
+ [![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/docs/) [![Node.js minimum 24](https://img.shields.io/badge/Node.js-%3E%3D24-339933?style=flat&logo=nodedotjs&logoColor=white)](https://nodejs.org/en/about/previous-releases) [![Hono](https://img.shields.io/badge/Hono-E36002?style=flat&logo=hono&logoColor=white)](https://hono.dev/docs/)
16
+
15
17
  ## Elevator Pitch
16
18
 
17
19
  Host developers use Server to compose HTTP/MCP, lifecycle and durable data services.
@@ -29,14 +31,14 @@ Shared implementations keep authorization, CAS, audit and Outbox consistent. The
29
31
 
30
32
  ## Quickstart
31
33
 
32
- Registry installation requires a published release. During pre-publication development, install the checksum-pinned tarballs produced by the workspace build instead of assuming these names exist in a registry.
34
+ This checkout prepares version 0.2.0; version 0.1.0 is already published. Until 0.2.0 is published, install the checksum-pinned candidate tarball. The command below applies after that release.
33
35
 
34
36
  ### Public import
35
37
 
36
38
  Use Node.js 24 or later and the required Appkit Core 0.2.0 peer. The canonicalization example is pure and needs no database connection or credentials. Server execution later requires host-owned identity, authorization and persistence bindings. The subpath is an import target, not a separately installed package.
37
39
 
38
40
  ```bash
39
- bun add @alneas/eaos-server @alneas/appkit-core@0.2.0
41
+ bun add @alneas/eaos-server@0.2.0 @alneas/appkit-core@0.2.0
40
42
  ```
41
43
 
42
44
  ```typescript
@@ -51,3 +53,5 @@ console.log(canonical({ format: 1, operation: 'inspect' }))
51
53
  - [Architecture and boundaries](guide.md)
52
54
  - [API reference](api.md)
53
55
  - [EAOS composition](https://tech-docs.alneas.com/eaos-workspace/architecture/)
56
+
57
+ Questions and issue reports in English are welcome in [GitHub Issues](https://github.com/dataarthub/eaos/issues). Private vulnerability reports can use [GitHub private reporting](https://github.com/dataarthub/eaos/security/advisories/new).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alneas/eaos-server",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "EAOS server public package",
@@ -296,19 +296,28 @@
296
296
  "./plugin-sdk": {
297
297
  "types": "./dist/plugin-sdk.d.ts",
298
298
  "import": "./dist/plugin-sdk.js"
299
+ },
300
+ "./execution/chat": {
301
+ "types": "./dist/execution/chat.d.ts",
302
+ "import": "./dist/execution/chat.js"
303
+ },
304
+ "./execution/tool-agent": {
305
+ "types": "./dist/execution/tool-agent.d.ts",
306
+ "import": "./dist/execution/tool-agent.js"
299
307
  }
300
308
  },
301
309
  "files": [
302
310
  "dist",
303
311
  "docs",
304
312
  "README.md",
313
+ "README.ja.md",
305
314
  "LICENSE",
306
315
  "CHANGELOG.md",
307
316
  "README.ja.md"
308
317
  ],
309
318
  "scripts": {
310
319
  "build": "tsup",
311
- "test": "bun test"
320
+ "test": "node ../../scripts/run-source-tests.mjs"
312
321
  },
313
322
  "publishConfig": {
314
323
  "registry": "https://registry.npmjs.org",
@@ -325,7 +334,7 @@
325
334
  "@alneas/appkit-core": "0.2.0"
326
335
  },
327
336
  "dependencies": {
328
- "@alneas/eaos-core": "^0.1.0",
337
+ "@alneas/eaos-core": "^0.2.0",
329
338
  "semver": "^7.8.5",
330
339
  "hono": "^4.13.13",
331
340
  "ajv": "^8.20.0",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/agentic/autonomous-worker.ts"],"sourcesContent":["import { defaultRuntimePlacementPolicy, McpGatekeeper, type AgentRuntimeResourcePolicy } from '@alneas/eaos-core'\nimport { ServerAgentExecutionError, type ServerAgentExecutor, type ServerAgentTaskRequest, type ServerAgentTaskResult, type ServerAgentWorkerType } from './types'\nimport { randomUUID } from 'node:crypto'\nimport { createCommandAgentExecutor, validateAgentRuntimePolicy } from './executor'\n\n/**\n * Trusted gatekeeper, runtime endpoints/adapters, and execution limits for {@link ServerAutonomousWorker}.\n */\nexport interface ServerWorkerOptions {\n /** Host security/approval policies; defaults to a new McpGatekeeper. */\n gatekeeper?: McpGatekeeper\n /** Trusted executable path; defaults to GOOSE_BIN_PATH or goose. */\n gooseBinaryPath?: string\n /** Trusted executable path; defaults to HERMES_AGENT_BIN_PATH or hermes. */\n hermesAgentBinaryPath?: string\n /** Host LiteLLM base URL; defaults to LITELLM_ENDPOINT or http://localhost:4000/v1. */\n litellmEndpoint?: string\n /** Host model identifier; defaults to LITELLM_MODEL and is required for built-in LiteLLM execution. */\n litellmModel?: string\n /** Combined command output/string result ceiling, safe integer 1–10000000; defaults to 1000000. */\n maxOutputChars?: number\n /** Framework default is safe for the ARM agent host. Host adapters may tighten it. */\n runtimePolicy?: AgentRuntimeResourcePolicy\n /** Built-in Goose/Hermes execution is permitted only on the AI placement. */\n runtimeRole?: ServerRuntimeRole\n /** Host fetch implementation for built-in LiteLLM; defaults to global fetch. */\n fetch?: typeof fetch\n /** Host/plugin adapters for coding agents and other external runtimes. */\n executors?: Partial<Record<ServerAgentWorkerType, ServerAgentExecutor>>\n}\n\n/**\n * Host placement role controlling whether built-in Goose/Hermes processes may run locally.\n * @see ServerAutonomousWorker.\n */\nexport type ServerRuntimeRole = 'edge' | 'application-worker' | 'ai'\n\nfunction inferRuntimeRole(): ServerRuntimeRole {\n const configured = process.env.EAOS_RUNTIME_ROLE\n if (configured === 'edge' || configured === 'application-worker' || configured === 'ai') return configured\n // The supported three-host topology places the AI runtime on the ARM host.\n // Unknown x64 hosts therefore fail closed as application-worker hosts.\n return process.arch === 'arm64' ? 'ai' : 'application-worker'\n}\n\n/**\n * Admits and executes host agent tasks through a gatekeeper and bounded runtime adapters.\n * @remarks This class runs only when runTask is called; it installs no scheduler. The host authenticates tenant/user claims before admission. Framework-managed tasks share a per-instance concurrency counter; injected executors own scheduling and are exempt from it. Built-in Goose/Hermes require the ai role and Node process/systemd support. Queue persistence, approvals, retries, and side-effect idempotency belong to the host.\n * @example\n * ```typescript\n * import { ServerAutonomousWorker, type ServerWorkerOptions } from \"@alneas/eaos-server/agentic/autonomous-worker\";\n * export function worker(options: ServerWorkerOptions) { return new ServerAutonomousWorker(options); }\n * ```\n */\nexport class ServerAutonomousWorker {\n private gatekeeper: McpGatekeeper\n private goosePath: string\n private hermesAgentPath: string\n private litellmUrl: string\n private litellmModel?: string\n private maxOutputChars: number\n private runtimePolicy: AgentRuntimeResourcePolicy\n private runtimeRole: ServerRuntimeRole\n private activeTasks = 0\n private fetchImpl: typeof fetch\n private executors: Partial<Record<ServerAgentWorkerType, ServerAgentExecutor>>\n\n /**\n * Captures runtime settings and validates resource policy, role, and output ceiling.\n * @param options - Trusted host configuration; omitted gatekeeper uses a new McpGatekeeper and runtime role uses EAOS_RUNTIME_ROLE, then ai on arm64 or application-worker otherwise.\n * @throws Invalid resource policy, role, or output limit.\n */\n constructor(options?: ServerWorkerOptions) {\n this.gatekeeper = options?.gatekeeper || new McpGatekeeper()\n this.goosePath = options?.gooseBinaryPath || process.env.GOOSE_BIN_PATH || 'goose'\n this.hermesAgentPath = options?.hermesAgentBinaryPath || process.env.HERMES_AGENT_BIN_PATH || 'hermes'\n this.litellmUrl = options?.litellmEndpoint || process.env.LITELLM_ENDPOINT || 'http://localhost:4000/v1'\n this.litellmModel = options?.litellmModel || process.env.LITELLM_MODEL\n this.maxOutputChars = options?.maxOutputChars ?? 1_000_000\n this.runtimePolicy = validateAgentRuntimePolicy(options?.runtimePolicy || defaultRuntimePlacementPolicy().ai.agentRuntime)\n this.runtimeRole = options?.runtimeRole || inferRuntimeRole()\n if (!['edge', 'application-worker', 'ai'].includes(this.runtimeRole)) throw new Error('Invalid agent runtime role')\n this.fetchImpl = options?.fetch || fetch\n this.executors = options?.executors || {}\n if (!Number.isSafeInteger(this.maxOutputChars) || this.maxOutputChars < 1 || this.maxOutputChars > 10_000_000) throw new Error('Invalid worker output limit')\n }\n\n /**\n * Checks task limits and gatekeeper policy before dispatching one runtime attempt.\n * @param request - Verified task identity and instructions; required strings must be nonblank, title at most 500 characters, instructions at most 1000000, and timeout a safe integer 1–3600000 milliseconds when provided.\n * @returns COMPLETED text output, PENDING_APPROVAL ticket data without execution, or FAILED data with error and optional classification/retry advice. Duration is measured in wall-clock milliseconds.\n * @throws Can reject a throwing gatekeeper or malformed gatekeeper interaction before dispatch; runtime execution errors are normally returned as FAILED data.\n * @remarks Gatekeeper receives fixed agent/server_bot roles rather than request user roles. Approval tickets are generated but not persisted here. The configured framework policy overrides request.runtimePolicy before execution. Injected executors and built-in LiteLLM outputs are bounded by maxOutputChars; LiteLLM response bodies are parsed before text length is checked.\n * @example\n * ```typescript\n * import { ServerAutonomousWorker, type ServerWorkerOptions } from \"@alneas/eaos-server/agentic/autonomous-worker\";\n * import type { ServerAgentTaskRequest } from \"@alneas/eaos-server/agentic/types\";\n * export async function execute(options: ServerWorkerOptions, request: ServerAgentTaskRequest) {\n * return new ServerAutonomousWorker(options).runTask(request);\n * }\n * ```\n */\n async runTask(request: ServerAgentTaskRequest): Promise<ServerAgentTaskResult> {\n const startTime = Date.now()\n\n if (!request || [request.id, request.tenantId, request.userId, request.title, request.instructions].some(value => typeof value !== 'string' || !value.trim())) {\n return { taskId: typeof request?.id === 'string' ? request.id : 'unknown', status: 'FAILED', error: 'Invalid agent task request', durationMs: Date.now() - startTime }\n }\n if (request.instructions.length > 1_000_000 || request.title.length > 500 || request.timeoutMs !== undefined && (!Number.isSafeInteger(request.timeoutMs) || request.timeoutMs < 1 || request.timeoutMs > 3_600_000)) {\n return { taskId: request.id, status: 'FAILED', error: 'Agent task exceeds configured limits', durationMs: Date.now() - startTime }\n }\n\n // 1. Evaluate security and gatekeeper policies\n const policy = this.gatekeeper.validateCall({\n toolName: `server_agent_${request.workerType}`,\n userRoles: ['agent', 'server_bot'],\n tenantId: request.tenantId,\n })\n\n if (!policy.allowed) {\n return {\n taskId: request.id,\n status: 'FAILED',\n error: `Task execution blocked by security policy: ${policy.reason}`,\n riskLevel: policy.riskLevel,\n durationMs: Date.now() - startTime,\n }\n }\n\n if (policy.requireHumanApproval) {\n return {\n taskId: request.id,\n status: 'PENDING_APPROVAL',\n approvalTicketId: randomUUID(),\n approvalLevel: policy.approvalLevel,\n riskLevel: policy.riskLevel,\n durationMs: Date.now() - startTime,\n }\n }\n\n // Explicitly injected executors are host-owned adapters and may implement\n // their own queue/scheduler. The framework-managed Goose/Hermes path is\n // bounded by the default policy so a forgotten host setting cannot create\n // unbounded local agent concurrency.\n const frameworkManaged = !this.executors[request.workerType]\n if (frameworkManaged && (request.workerType === 'goose' || request.workerType === 'hermes_agent') && this.runtimeRole !== 'ai') {\n return {\n taskId: request.id,\n status: 'FAILED',\n error: `Built-in ${request.workerType} execution is restricted to the AI runtime placement`,\n failureCode: 'AGENT_UNAVAILABLE',\n retryable: true,\n durationMs: Date.now() - startTime,\n }\n }\n if (frameworkManaged && this.activeTasks >= this.runtimePolicy.maxConcurrent) {\n return {\n taskId: request.id,\n status: 'FAILED',\n error: 'Agent runtime concurrency limit reached',\n failureCode: 'AGENT_UNAVAILABLE',\n retryable: true,\n durationMs: Date.now() - startTime,\n }\n }\n\n // 2. Dispatch according to worker type\n if (frameworkManaged) this.activeTasks += 1\n try {\n const output = await this.execute({ ...structuredClone(request), runtimePolicy: structuredClone(this.runtimePolicy) })\n return {\n taskId: request.id,\n status: 'COMPLETED',\n output,\n durationMs: Date.now() - startTime,\n }\n } catch (err) {\n return {\n taskId: request.id,\n status: 'FAILED',\n error: (err as Error).message,\n ...(err instanceof ServerAgentExecutionError ? { failureCode: err.failureCode, retryable: err.retryable } : {}),\n durationMs: Date.now() - startTime,\n }\n } finally {\n if (frameworkManaged) this.activeTasks -= 1\n }\n }\n\n private async execute(request: ServerAgentTaskRequest): Promise<string> {\n const injected = this.executors[request.workerType]\n if (injected) return this.boundOutput(await injected(structuredClone(request)))\n if (request.workerType === 'goose') return this.executeHeadlessGoose(request)\n if (request.workerType === 'hermes_agent') return this.executeHeadlessHermesAgent(request)\n if (request.workerType === 'litellm') return this.executeLiteLlm(request)\n throw new Error(`No executor configured for worker type '${request.workerType}'`)\n }\n\n /**\n * Execute Goose in headless batch mode\n */\n private async executeHeadlessGoose(request: ServerAgentTaskRequest): Promise<string> {\n return createCommandAgentExecutor({\n command: this.goosePath,\n buildArgs: task => ['run', '--text', task.instructions],\n includeProcessEnv: true,\n maxOutputChars: this.maxOutputChars,\n sandbox: { mode: 'auto', policy: this.runtimePolicy },\n })(request)\n }\n\n /**\n * Execute NousResearch Hermes Agent in headless mode (-z / non-interactive)\n * Hermes Agent provides persistent cross-session memory and self-improving skill extraction.\n */\n private async executeHeadlessHermesAgent(request: ServerAgentTaskRequest): Promise<string> {\n return createCommandAgentExecutor({\n command: this.hermesAgentPath,\n buildArgs: task => ['run', '-z', task.instructions],\n includeProcessEnv: true,\n maxOutputChars: this.maxOutputChars,\n sandbox: { mode: 'auto', policy: this.runtimePolicy },\n })(request)\n }\n\n /**\n * Execute a host-selected model through LiteLLM.\n */\n private async executeLiteLlm(request: ServerAgentTaskRequest): Promise<string> {\n if (!this.litellmModel) throw new Error('LiteLLM model is not configured')\n const endpoint = new URL(this.litellmUrl)\n if (!['http:', 'https:'].includes(endpoint.protocol)) throw new Error('Invalid LiteLLM endpoint')\n endpoint.pathname = `${endpoint.pathname.replace(/\\/$/, '')}/chat/completions`\n const response = await this.fetchImpl(endpoint, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n model: this.litellmModel,\n messages: [{ role: 'user', content: request.instructions }],\n metadata: { tenantId: request.tenantId, taskId: request.id },\n }),\n signal: AbortSignal.timeout(request.timeoutMs ?? 60_000),\n redirect: 'error',\n })\n if (!response.ok) throw new Error(`LiteLLM request failed (${response.status})`)\n const body = await response.json() as { choices?: Array<{ message?: { content?: unknown } }> }\n const output = body.choices?.[0]?.message?.content\n if (typeof output !== 'string') throw new Error('LiteLLM returned no assistant content')\n return this.boundOutput(output)\n }\n\n private boundOutput(output: string): string {\n if (output.length > this.maxOutputChars) throw new Error('Agent output exceeds configured limit')\n return output\n }\n}\n"],"mappings":";;;;;;;;;AAAA,SAAS,+BAA+B,qBAAsD;AAE9F,SAAS,kBAAkB;AAmC3B,SAAS,mBAAsC;AAC7C,QAAM,aAAa,QAAQ,IAAI;AAC/B,MAAI,eAAe,UAAU,eAAe,wBAAwB,eAAe,KAAM,QAAO;AAGhG,SAAO,QAAQ,SAAS,UAAU,OAAO;AAC3C;AAWO,IAAM,yBAAN,MAA6B;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd;AAAA,EACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOR,YAAY,SAA+B;AACzC,SAAK,aAAa,SAAS,cAAc,IAAI,cAAc;AAC3D,SAAK,YAAY,SAAS,mBAAmB,QAAQ,IAAI,kBAAkB;AAC3E,SAAK,kBAAkB,SAAS,yBAAyB,QAAQ,IAAI,yBAAyB;AAC9F,SAAK,aAAa,SAAS,mBAAmB,QAAQ,IAAI,oBAAoB;AAC9E,SAAK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