@ycodium-ai/agent-fake 0.2.3510 → 0.2.3566

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +12 -10
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -4,7 +4,7 @@ A minimal executor plugin. It starts no CLI and replays a fixed event script:
4
4
 
5
5
  - `startSession` emits `session.started`
6
6
  - `sendTurn` emits `turn.started`, one `content.delta`, then `turn.completed` (the host binds the turn by `turn.started`)
7
- - `config.script` picks the script: `plain` (default), `approval-tool` (two approvals before the reply), `async-question` (on a thread's first turn, the reply plus one non-blocking `user-input.requested` with `responseMode: "message"`), `stream` (a Markdown answer in `config.streamChunks` deltas, default 200, one every `config.streamIntervalMs`, default 30; the UI probe `interaction-table.ts` measures streaming with it), `replay` (recorded events; see [Event replay](#event-replay)), `mcp-send` (real calls through the built-in MCP server the host handed to `startSession`, the same path a real agent takes: a turn whose input is a JSON object is passed as the arguments of one `send_message` call, and a JSON array of `{ "tool": "…", "arguments": { … } }` is called step by step, for example `ycodium_plugin_define`, then `ycodium_plugin_run`, then a tool the mounted plugin contributes; the reply has one line per call with its result or error, and any other input gets the plain reply; see [Playbook mode](#playbook-mode) for per-thread scripts that ignore turn input), `visualize` (emits one in-progress builtin tool row, holds for `config.previewHoldMs` milliseconds so the input preview can paint, then one real `visualize_visualize` call on that same server; the tool row’s result is the MCP confirmation text, and the reply is “The figure is in the card above.”), or `lane` (the UI probe `lane1-journey.ts` script: the user message's `lane:stream|plain|approve|question|attach|hold` picks the turn; `hold` accepts a second `sendTurn` with the in-flight turn id as a steer and folds that text into the reply, and a steer whose target turn has ended is refused with `code: "provider-rejected"`; a playbook instance accepts steers too (see [Playbook mode](#playbook-mode)); `config.holdMs` is how long `hold` waits, default 15000)
7
+ - `config.script` picks the script: `plain` (default), `approval-tool` (two approvals before the reply), `async-question` (on a thread's first turn, the reply plus one non-blocking `user-input.requested` with `responseMode: "message"`), `stream` (a Markdown answer in `config.streamChunks` deltas, default 200, one every `config.streamIntervalMs`, default 30; the UI probe `interaction-table.ts` measures streaming with it), `replay` (recorded events; see [Event replay](#event-replay)), `mcp-send` (real calls through the built-in MCP server the host handed to `startSession`, the same path a real agent takes: a turn whose input (after the host’s leading skill, memory and per-turn tool guidance blocks are skipped) is a JSON object is passed as the arguments of one `send_message` call, and a JSON array of `{ "tool": "…", "arguments": { … } }` is called step by step, for example `ycodium_plugin_define`, then `ycodium_plugin_run`, then a tool the mounted plugin contributes; the reply has one line per call with its result or error, and any other input gets the plain reply; see [Playbook mode](#playbook-mode) for per-thread scripts that ignore turn input), `visualize` (emits one in-progress builtin tool row, holds for `config.previewHoldMs` milliseconds so the input preview can paint, then one real `visualize_visualize` call on that same server; the tool row’s result is the MCP confirmation text, and the reply is “The figure is in the card above.”), or `lane` (the UI probe `lane1-journey.ts` script: the user message's `lane:stream|plain|approve|question|attach|hold` picks the turn; `hold` accepts a second `sendTurn` with the in-flight turn id as a steer and folds that text into the reply, and a steer whose target turn has ended is refused with `code: "provider-rejected"`; a playbook instance accepts steers too (see [Playbook mode](#playbook-mode)); `config.holdMs` is how long `hold` waits, default 15000)
8
8
  - `interruptTurn` (or an aborted `AbortSignal`) ends the in-flight turn as `interrupted`
9
9
  - `readThread` returns the bookkeeping the instance recorded
10
10
  - `probe` reports two models, `fake` (default) and `fake-large`
package/dist/index.js CHANGED
@@ -535,6 +535,16 @@ async function holdTurn(ctx) {
535
535
  return text;
536
536
  }
537
537
 
538
+ // src/hostBlocks.ts
539
+ var HOST_BLOCK = /^(?:<(ycodium-memory|ycodium-skill)(?:\s[^>]*)?>[\s\S]*?<\/\1>|<ycodium-system>\n<tool-guidance>\n[\s\S]*?\n<\/tool-guidance>\n<\/ycodium-system>)\n\n/u;
540
+ function stripHostBlocks(input) {
541
+ let rest = input;
542
+ for (let block = HOST_BLOCK.exec(rest); block !== null; block = HOST_BLOCK.exec(rest)) {
543
+ rest = rest.slice(block[0].length);
544
+ }
545
+ return rest;
546
+ }
547
+
538
548
  // src/failScript.ts
539
549
  var FAIL_SENTENCES = {
540
550
  quota: "Fake provider: this account has used up its usage limit.",
@@ -547,7 +557,7 @@ var FAIL_SENTENCES = {
547
557
  };
548
558
  var isFailCategory = (value) => Object.hasOwn(FAIL_SENTENCES, value);
549
559
  var parseFailInput = (input) => {
550
- const match = /^fail:([a-z-]+)$/.exec(input?.trim() ?? "");
560
+ const match = /^fail:([a-z-]+)$/.exec(stripHostBlocks(input ?? "").trim());
551
561
  const category = match?.[1];
552
562
  return category !== void 0 && isFailCategory(category) ? { category, message: FAIL_SENTENCES[category] } : void 0;
553
563
  };
@@ -759,14 +769,6 @@ async function openMcpSession(input) {
759
769
  };
760
770
  }
761
771
  var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
762
- var HOST_BLOCK = /^<(ycodium-memory|ycodium-skill)(?:\s[^>]*)?>[\s\S]*?<\/\1>\n\n/u;
763
- function stripHostBlocks(input) {
764
- let rest = input;
765
- for (let block = HOST_BLOCK.exec(rest); block !== null; block = HOST_BLOCK.exec(rest)) {
766
- rest = rest.slice(block[0].length);
767
- }
768
- return rest;
769
- }
770
772
  function parseMcpSendInput(input) {
771
773
  let parsed;
772
774
  try {
@@ -1991,7 +1993,7 @@ var executors = [
1991
1993
  ];
1992
1994
  var index_default = definePlugin({
1993
1995
  id: "agent-fake",
1994
- apiVersion: 43,
1996
+ apiVersion: 46,
1995
1997
  executors,
1996
1998
  activate(ctx) {
1997
1999
  ctx.log.info("fake executor ready");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-fake",
3
- "version": "0.2.3510",
3
+ "version": "0.2.3566",
4
4
  "description": "Minimal fake executor for plugin authors and host orchestration tests.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -21,7 +21,7 @@
21
21
  "@types/node": "24.12.4",
22
22
  "esbuild": "0.28.1",
23
23
  "vite-plus": "0.2.2",
24
- "@ycodium-ai/plugin-api": "0.2.3510",
24
+ "@ycodium-ai/plugin-api": "0.2.3566",
25
25
  "ycodium-executor-testing": "0.0.0"
26
26
  },
27
27
  "ycodium": {