@celljs/ai-agent 4.2.0 → 4.4.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 CHANGED
@@ -3,7 +3,7 @@
3
3
  基于 [pi-agent-core](https://www.npmjs.com/package/@earendil-works/pi-agent-core) 的通用 agent:agent 循环、并行工具调用、事件流,不带编码工具和文件系统权限,适合在业务里做助手。模型来自 [@celljs/ai-pi](../ai-pi)。需要读写代码、执行命令的场景用 [@celljs/ai-coding-agent](../ai-coding-agent)。
4
4
 
5
5
  - 工具写成 `AgentTool` 组件,可以直接用注入的服务;同样的组件也是编码会话的工具;
6
- - `AgentFactory` 按 `cell.ai.agent` 创建 pi-agent-core 的 `Agent`;
6
+ - `AgentFactory` 按 `ai.agent` 创建 pi-agent-core 的 `Agent`;
7
7
  - `AgentEventUtil.stream()` 把 agent(或编码会话)的事件写成 Server-Sent Events。
8
8
 
9
9
  pi-agent-core 用动态 `import()` 加载,需要 Node.js >= 22.19 或 Bun。
@@ -11,17 +11,16 @@ pi-agent-core 用动态 `import()` 加载,需要 Node.js >= 22.19 或 Bun。
11
11
  ## 配置
12
12
 
13
13
  ```yaml
14
- cell:
15
- ai:
16
- agent:
17
- model: anthropic/claude-sonnet-4-5 # pi-ai 的 <provider>/<model id>;默认第一个有凭据的模型
18
- systemPrompt: You are the support assistant of ACME.
19
- thinkingLevel: low
20
- tools: [find_order, refund] # AgentTool 组件名;默认全部
21
- toolExecution: parallel # 或 sequential
14
+ ai:
15
+ agent:
16
+ model: anthropic/claude-sonnet-4-5 # pi-ai 的 <provider>/<model id>;默认第一个有凭据的模型
17
+ systemPrompt: You are the support assistant of ACME.
18
+ thinkingLevel: low
19
+ tools: [find_order, refund] # AgentTool 组件名;默认全部
20
+ toolExecution: parallel # 或 sequential
22
21
  ```
23
22
 
24
- API key 在 `cell.ai.pi.apiKeys` 或服务商的环境变量里配置。
23
+ API key 在 `ai.pi.apiKeys` 或服务商的环境变量里配置。
25
24
 
26
25
  ## 使用
27
26
 
@@ -0,0 +1,41 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "properties": {
4
+ "ai": {
5
+ "type": "object",
6
+ "description": "AI.",
7
+ "properties": {
8
+ "agent": {
9
+ "type": "object",
10
+ "description": "Defaults of agents.",
11
+ "properties": {
12
+ "model": {
13
+ "type": "string",
14
+ "description": "<provider>/<model id>; empty: the first model with credentials."
15
+ },
16
+ "systemPrompt": {
17
+ "type": "string"
18
+ },
19
+ "thinkingLevel": {
20
+ "type": "string"
21
+ },
22
+ "tools": {
23
+ "type": "array",
24
+ "items": {
25
+ "type": "string"
26
+ }
27
+ },
28
+ "toolExecution": {
29
+ "type": "string",
30
+ "description": "How the tool calls of one response run.",
31
+ "enum": [
32
+ "parallel",
33
+ "sequential"
34
+ ]
35
+ }
36
+ }
37
+ }
38
+ }
39
+ }
40
+ }
41
+ }
package/cell.yml CHANGED
@@ -1,5 +1,4 @@
1
- cell:
2
- ai:
3
- agent:
4
- # parallel | sequential: how the tool calls of one model response run.
5
- toolExecution: parallel
1
+ ai:
2
+ agent:
3
+ # parallel | sequential: how the tool calls of one model response run.
4
+ toolExecution: parallel
@@ -2,7 +2,7 @@ import type { Agent, AgentMessage, ThinkingLevel } from './pi/index.js';
2
2
  export declare const AgentTool: unique symbol;
3
3
  export declare const AgentFactory: unique symbol;
4
4
  /** Configuration key of {@link AgentOptions}. */
5
- export declare const AGENT_OPTIONS = "cell.ai.agent";
5
+ export declare const AGENT_OPTIONS = "ai.agent";
6
6
  /**
7
7
  * A tool as a Cell component: pi-agent-core's `AgentTool` (`name`, `label`, `description`, JSON Schema
8
8
  * `parameters`, `execute`). `execute` throws on failure. The same components are tools of coding agent
@@ -10,7 +10,7 @@ export declare const AGENT_OPTIONS = "cell.ai.agent";
10
10
  */
11
11
  export type AgentTool<TParameters extends object = object, TDetails = any> = import('@earendil-works/pi-agent-core', { with: { 'resolution-mode': 'import'
12
12
  } }).AgentTool<TParameters, TDetails>;
13
- /** `cell.ai.agent`. */
13
+ /** `ai.agent`. */
14
14
  export interface AgentOptions {
15
15
  /** `<provider>/<model id>` of pi-ai (@celljs/ai-pi). Default: the first model with credentials. */
16
16
  model?: string;
@@ -21,7 +21,7 @@ export interface AgentOptions {
21
21
  /** How the tool calls of one model response run. Default: parallel. */
22
22
  toolExecution?: 'parallel' | 'sequential';
23
23
  }
24
- /** Options of one agent; they override `cell.ai.agent`. */
24
+ /** Options of one agent; they override `ai.agent`. */
25
25
  export interface AgentCreateOptions extends Omit<AgentOptions, 'toolExecution'> {
26
26
  /** Conversation to continue, e.g. `agent.state.messages` saved earlier. */
27
27
  messages?: AgentMessage[];
@@ -1,5 +1,5 @@
1
1
  export const AgentTool = Symbol('AgentTool');
2
2
  export const AgentFactory = Symbol('AgentFactory');
3
3
  /** Configuration key of {@link AgentOptions}. */
4
- export const AGENT_OPTIONS = 'cell.ai.agent';
4
+ export const AGENT_OPTIONS = 'ai.agent';
5
5
  //# sourceMappingURL=agent-protocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-protocol.js","sourceRoot":"","sources":["../../src/node/agent-protocol.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAEnD,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"agent-protocol.js","sourceRoot":"","sources":["../../src/node/agent-protocol.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAEnD,iDAAiD;AACjD,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC"}
@@ -10,7 +10,7 @@ export class AgentToolNotFoundError extends AgentError {
10
10
  }
11
11
  export class AgentModelMissingError extends AgentError {
12
12
  constructor() {
13
- super('No model is available for the agent: set cell.ai.agent.model ("<provider>/<model id>") and the API key of its provider (e.g. ANTHROPIC_API_KEY or cell.ai.pi.apiKeys).');
13
+ super('No model is available for the agent: set ai.agent.model ("<provider>/<model id>") and the API key of its provider (e.g. ANTHROPIC_API_KEY or ai.pi.apiKeys).');
14
14
  }
15
15
  }
16
16
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/node/error/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,OAAO,UAAW,SAAQ,WAAW;CAAG;AAE9C,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IAClD,YACa,IAAY,EACZ,SAAmB;QAE5B,KAAK,CAAC,mCAAmC,IAAI,kBAAkB,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,0CAA0C,GAAG,CAAC,CAAC;oBAH/I,IAAI;yBACJ,SAAS;IAGtB,CAAC;CACJ;AAED,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IAClD;QACI,KAAK,CACD,wKAAwK,CAC3K,CAAC;IACN,CAAC;CACJ"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/node/error/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,MAAM,OAAO,UAAW,SAAQ,WAAW;CAAG;AAE9C,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IAClD,YACa,IAAY,EACZ,SAAmB;QAE5B,KAAK,CAAC,mCAAmC,IAAI,kBAAkB,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,0CAA0C,GAAG,CAAC,CAAC;oBAH/I,IAAI;yBACJ,SAAS;IAGtB,CAAC;CACJ;AAED,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IAClD;QACI,KAAK,CACD,8JAA8J,CACjK,CAAC;IACN,CAAC;CACJ"}
@@ -5,7 +5,7 @@ const agentModule = autoBind();
5
5
  /** A container with ai-core, ai-pi, this package and the scripted `FauxPiModels` as the agents' model. */
6
6
  export async function createAgentTestContainer(options = {}, ...modules) {
7
7
  const test = await createPiTestContainer({}, agentModule, ...modules);
8
- currentThis.cellProps.cell.ai.agent = { model: FauxPiModels.MODEL, ...options };
8
+ currentThis.cellProps.ai.agent = { model: FauxPiModels.MODEL, ...options };
9
9
  return test;
10
10
  }
11
11
  //# sourceMappingURL=test-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"test-container.js","sourceRoot":"","sources":["../../../src/node/test/test-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAwB,MAAM,6BAA6B,CAAC;AACxG,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,UAAU,CAAC;AAElB,MAAM,WAAW,GAAG,QAAQ,EAAE,CAAC;AAI/B,0GAA0G;AAC1G,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,OAAO,GAAiB,EAAE,EAAE,GAAG,OAA0B;IACpG,MAAM,IAAI,GAAG,MAAM,qBAAqB,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,CAAC;IACtE,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC;IAChF,OAAO,IAAI,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"test-container.js","sourceRoot":"","sources":["../../../src/node/test/test-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAwB,MAAM,6BAA6B,CAAC;AACxG,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,UAAU,CAAC;AAElB,MAAM,WAAW,GAAG,QAAQ,EAAE,CAAC;AAI/B,0GAA0G;AAC1G,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,OAAO,GAAiB,EAAE,EAAE,GAAG,OAA0B;IACpG,MAAM,IAAI,GAAG,MAAM,qBAAqB,CAAC,EAAE,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,CAAC;IACtE,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC;IAC3E,OAAO,IAAI,CAAC;AAChB,CAAC"}
@@ -2,7 +2,7 @@ import type { Agent, AgentMessage, ThinkingLevel } from './pi';
2
2
  export declare const AgentTool: unique symbol;
3
3
  export declare const AgentFactory: unique symbol;
4
4
  /** Configuration key of {@link AgentOptions}. */
5
- export declare const AGENT_OPTIONS = "cell.ai.agent";
5
+ export declare const AGENT_OPTIONS = "ai.agent";
6
6
  /**
7
7
  * A tool as a Cell component: pi-agent-core's `AgentTool` (`name`, `label`, `description`, JSON Schema
8
8
  * `parameters`, `execute`). `execute` throws on failure. The same components are tools of coding agent
@@ -10,7 +10,7 @@ export declare const AGENT_OPTIONS = "cell.ai.agent";
10
10
  */
11
11
  export type AgentTool<TParameters extends object = object, TDetails = any> = import('@earendil-works/pi-agent-core', { with: { 'resolution-mode': 'import'
12
12
  } }).AgentTool<TParameters, TDetails>;
13
- /** `cell.ai.agent`. */
13
+ /** `ai.agent`. */
14
14
  export interface AgentOptions {
15
15
  /** `<provider>/<model id>` of pi-ai (@celljs/ai-pi). Default: the first model with credentials. */
16
16
  model?: string;
@@ -21,7 +21,7 @@ export interface AgentOptions {
21
21
  /** How the tool calls of one model response run. Default: parallel. */
22
22
  toolExecution?: 'parallel' | 'sequential';
23
23
  }
24
- /** Options of one agent; they override `cell.ai.agent`. */
24
+ /** Options of one agent; they override `ai.agent`. */
25
25
  export interface AgentCreateOptions extends Omit<AgentOptions, 'toolExecution'> {
26
26
  /** Conversation to continue, e.g. `agent.state.messages` saved earlier. */
27
27
  messages?: AgentMessage[];
@@ -1 +1 @@
1
- {"version":3,"file":"agent-protocol.d.ts","sourceRoot":"","sources":["../../src/node/agent-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAE/D,eAAO,MAAM,SAAS,eAAsB,CAAC;AAC7C,eAAO,MAAM,YAAY,eAAyB,CAAC;AAEnD,iDAAiD;AACjD,eAAO,MAAM,aAAa,kBAAkB,CAAC;AAE7C;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,EAAE,QAAQ,GAAG,GAAG,IAAI,OAAO,+BAA+B,EAAU,UACzH,iBAAiB,EAAE,QAAQ;GAC9B,EAAG,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAErC,uBAAuB;AACvB,MAAM,WAAW,YAAY;IACzB,mGAAmG;IACnG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,uEAAuE;IACvE,aAAa,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;CAC7C;AAED,2DAA2D;AAC3D,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC;IAC3E,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC7B;AAED,4GAA4G;AAC5G,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CACxD"}
1
+ {"version":3,"file":"agent-protocol.d.ts","sourceRoot":"","sources":["../../src/node/agent-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,MAAM,CAAC;AAE/D,eAAO,MAAM,SAAS,eAAsB,CAAC;AAC7C,eAAO,MAAM,YAAY,eAAyB,CAAC;AAEnD,iDAAiD;AACjD,eAAO,MAAM,aAAa,aAAa,CAAC;AAExC;;;;GAIG;AACH,MAAM,MAAM,SAAS,CAAC,WAAW,SAAS,MAAM,GAAG,MAAM,EAAE,QAAQ,GAAG,GAAG,IAAI,OAAO,+BAA+B,EAAU,UACzH,iBAAiB,EAAE,QAAQ;GAC9B,EAAG,SAAS,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;AAErC,kBAAkB;AAClB,MAAM,WAAW,YAAY;IACzB,mGAAmG;IACnG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,uEAAuE;IACvE,aAAa,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;CAC7C;AAED,sDAAsD;AACtD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC;IAC3E,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC7B;AAED,4GAA4G;AAC5G,MAAM,WAAW,YAAY;IACzB,MAAM,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;CACxD"}
@@ -4,5 +4,5 @@ exports.AGENT_OPTIONS = exports.AgentFactory = exports.AgentTool = void 0;
4
4
  exports.AgentTool = Symbol('AgentTool');
5
5
  exports.AgentFactory = Symbol('AgentFactory');
6
6
  /** Configuration key of {@link AgentOptions}. */
7
- exports.AGENT_OPTIONS = 'cell.ai.agent';
7
+ exports.AGENT_OPTIONS = 'ai.agent';
8
8
  //# sourceMappingURL=agent-protocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent-protocol.js","sourceRoot":"","sources":["../../src/node/agent-protocol.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAChC,QAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAEnD,iDAAiD;AACpC,QAAA,aAAa,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"agent-protocol.js","sourceRoot":"","sources":["../../src/node/agent-protocol.ts"],"names":[],"mappings":";;;AAEa,QAAA,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,CAAC;AAChC,QAAA,YAAY,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAEnD,iDAAiD;AACpC,QAAA,aAAa,GAAG,UAAU,CAAC"}
@@ -15,7 +15,7 @@ class AgentToolNotFoundError extends AgentError {
15
15
  exports.AgentToolNotFoundError = AgentToolNotFoundError;
16
16
  class AgentModelMissingError extends AgentError {
17
17
  constructor() {
18
- super('No model is available for the agent: set cell.ai.agent.model ("<provider>/<model id>") and the API key of its provider (e.g. ANTHROPIC_API_KEY or cell.ai.pi.apiKeys).');
18
+ super('No model is available for the agent: set ai.agent.model ("<provider>/<model id>") and the API key of its provider (e.g. ANTHROPIC_API_KEY or ai.pi.apiKeys).');
19
19
  }
20
20
  }
21
21
  exports.AgentModelMissingError = AgentModelMissingError;
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/node/error/errors.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAE3C,gBAAwB,SAAQ,kBAAW;CAAG;;AAE9C,4BAAoC,SAAQ,UAAU;IAClD,YACa,IAAY,EACZ,SAAmB;QAE5B,KAAK,CAAC,mCAAmC,IAAI,kBAAkB,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,0CAA0C,GAAG,CAAC,CAAC;oBAH/I,IAAI;yBACJ,SAAS;IAGtB,CAAC;CACJ;;AAED,4BAAoC,SAAQ,UAAU;IAClD;QACI,KAAK,CACD,wKAAwK,CAC3K,CAAC;IACN,CAAC;CACJ"}
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/node/error/errors.ts"],"names":[],"mappings":";;;AAAA,uCAA2C;AAE3C,gBAAwB,SAAQ,kBAAW;CAAG;;AAE9C,4BAAoC,SAAQ,UAAU;IAClD,YACa,IAAY,EACZ,SAAmB;QAE5B,KAAK,CAAC,mCAAmC,IAAI,kBAAkB,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,0CAA0C,GAAG,CAAC,CAAC;oBAH/I,IAAI;yBACJ,SAAS;IAGtB,CAAC;CACJ;;AAED,4BAAoC,SAAQ,UAAU;IAClD;QACI,KAAK,CACD,8JAA8J,CACjK,CAAC;IACN,CAAC;CACJ"}
@@ -8,7 +8,7 @@ const agentModule = (0, core_1.autoBind)();
8
8
  /** A container with ai-core, ai-pi, this package and the scripted `FauxPiModels` as the agents' model. */
9
9
  async function createAgentTestContainer(options = {}, ...modules) {
10
10
  const test = await (0, test_1.createPiTestContainer)({}, agentModule, ...modules);
11
- core_1.currentThis.cellProps.cell.ai.agent = { model: test_1.FauxPiModels.MODEL, ...options };
11
+ core_1.currentThis.cellProps.ai.agent = { model: test_1.FauxPiModels.MODEL, ...options };
12
12
  return test;
13
13
  }
14
14
  //# sourceMappingURL=test-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"test-container.js","sourceRoot":"","sources":["../../../src/node/test/test-container.ts"],"names":[],"mappings":";;;AAAA,sDAAwG;AACxG,uCAAqD;AAErD,oBAAkB;AAElB,MAAM,WAAW,GAAG,IAAA,eAAQ,GAAE,CAAC;AAI/B,0GAA0G;AACnG,KAAK,mCAAmC,OAAO,GAAiB,EAAE,EAAE,GAAG,OAA0B;IACpG,MAAM,IAAI,GAAG,MAAM,IAAA,4BAAqB,EAAC,EAAE,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,CAAC;IACtE,kBAAW,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,mBAAY,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC;IAChF,OAAO,IAAI,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"test-container.js","sourceRoot":"","sources":["../../../src/node/test/test-container.ts"],"names":[],"mappings":";;;AAAA,sDAAwG;AACxG,uCAAqD;AAErD,oBAAkB;AAElB,MAAM,WAAW,GAAG,IAAA,eAAQ,GAAE,CAAC;AAI/B,0GAA0G;AACnG,KAAK,mCAAmC,OAAO,GAAiB,EAAE,EAAE,GAAG,OAA0B;IACpG,MAAM,IAAI,GAAG,MAAM,IAAA,4BAAqB,EAAC,EAAE,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,CAAC;IACtE,kBAAW,CAAC,SAAS,CAAC,EAAE,CAAC,KAAK,GAAG,EAAE,KAAK,EAAE,mBAAY,CAAC,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC;IAC3E,OAAO,IAAI,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ai-agent",
3
- "version": "4.2.0",
3
+ "version": "4.4.0",
4
4
  "description": "General-purpose pi agents (pi-agent-core) with tools as Cell components",
5
5
  "keywords": [
6
6
  "cell-component"
@@ -23,7 +23,8 @@
23
23
  "lib",
24
24
  "esm",
25
25
  "src",
26
- "cell.yml"
26
+ "cell.yml",
27
+ "cell.schema.json"
27
28
  ],
28
29
  "scripts": {
29
30
  "build": "tsc -b && bun ../../scripts/build-esm.ts",
@@ -32,12 +33,12 @@
32
33
  "watch": "tsc -b -w --preserveWatchOutput"
33
34
  },
34
35
  "dependencies": {
35
- "@celljs/ai-pi": "4.2.0",
36
- "@celljs/core": "4.2.0",
36
+ "@celljs/ai-pi": "4.4.0",
37
+ "@celljs/core": "4.4.0",
37
38
  "@earendil-works/pi-agent-core": "^1.5.0"
38
39
  },
39
40
  "devDependencies": {
40
- "@celljs/ai-core": "4.2.0"
41
+ "@celljs/ai-core": "4.4.0"
41
42
  },
42
43
  "publishConfig": {
43
44
  "access": "public"
@@ -4,7 +4,7 @@ export const AgentTool = Symbol('AgentTool');
4
4
  export const AgentFactory = Symbol('AgentFactory');
5
5
 
6
6
  /** Configuration key of {@link AgentOptions}. */
7
- export const AGENT_OPTIONS = 'cell.ai.agent';
7
+ export const AGENT_OPTIONS = 'ai.agent';
8
8
 
9
9
  /**
10
10
  * A tool as a Cell component: pi-agent-core's `AgentTool` (`name`, `label`, `description`, JSON Schema
@@ -15,7 +15,7 @@ export type AgentTool<TParameters extends object = object, TDetails = any> = imp
15
15
  'resolution-mode': 'import',
16
16
  }}).AgentTool<TParameters, TDetails>;
17
17
 
18
- /** `cell.ai.agent`. */
18
+ /** `ai.agent`. */
19
19
  export interface AgentOptions {
20
20
  /** `<provider>/<model id>` of pi-ai (@celljs/ai-pi). Default: the first model with credentials. */
21
21
  model?: string;
@@ -27,7 +27,7 @@ export interface AgentOptions {
27
27
  toolExecution?: 'parallel' | 'sequential';
28
28
  }
29
29
 
30
- /** Options of one agent; they override `cell.ai.agent`. */
30
+ /** Options of one agent; they override `ai.agent`. */
31
31
  export interface AgentCreateOptions extends Omit<AgentOptions, 'toolExecution'> {
32
32
  /** Conversation to continue, e.g. `agent.state.messages` saved earlier. */
33
33
  messages?: AgentMessage[];
@@ -14,7 +14,7 @@ export class AgentToolNotFoundError extends AgentError {
14
14
  export class AgentModelMissingError extends AgentError {
15
15
  constructor() {
16
16
  super(
17
- 'No model is available for the agent: set cell.ai.agent.model ("<provider>/<model id>") and the API key of its provider (e.g. ANTHROPIC_API_KEY or cell.ai.pi.apiKeys).',
17
+ 'No model is available for the agent: set ai.agent.model ("<provider>/<model id>") and the API key of its provider (e.g. ANTHROPIC_API_KEY or ai.pi.apiKeys).',
18
18
  );
19
19
  }
20
20
  }
@@ -10,6 +10,6 @@ type ContainerModule = Parameters<typeof createPiTestContainer>[1];
10
10
  /** A container with ai-core, ai-pi, this package and the scripted `FauxPiModels` as the agents' model. */
11
11
  export async function createAgentTestContainer(options: AgentOptions = {}, ...modules: ContainerModule[]): Promise<PiTestContainer> {
12
12
  const test = await createPiTestContainer({}, agentModule, ...modules);
13
- currentThis.cellProps.cell.ai.agent = { model: FauxPiModels.MODEL, ...options };
13
+ currentThis.cellProps.ai.agent = { model: FauxPiModels.MODEL, ...options };
14
14
  return test;
15
15
  }