@workser/engine 0.1.4 → 0.1.6

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,8 @@
3
3
  Workser's coding engine for the **loop in our service** mode (plan decision
4
4
  D1): OpenCode's agent contract running on Node — in a Trigger.dev worker, or
5
5
  anywhere — with every file and shell action going through a **Place**. The
6
- machine can be a remote E2B sandbox or the project's cloud computer; the model
6
+ machine can be a remote E2B sandbox or an AI agent's cloud computer (its own,
7
+ or the team computer); the model
7
8
  key (the run token) never goes there.
8
9
 
9
10
  ## What is OpenCode's here
@@ -35,12 +35,12 @@ export interface E2BSandboxLike {
35
35
  pause?(): Promise<unknown>;
36
36
  }
37
37
  /**
38
- * A remote E2B machine (a project sandbox or the project's cloud computer) as
39
- * a Place — the "loop in our service" mode. The engine runs in our worker; the
38
+ * A remote E2B machine (a project sandbox, or an AI agent's cloud computer —
39
+ * its own, or the team computer) as a Place — the "loop in our service" mode. The engine runs in our worker; the
40
40
  * files and commands are on the machine; the model key never goes there.
41
41
  */
42
42
  /**
43
- * NODE ON PATH, WHERE IT CAME FROM NVM. A project computer's image installs
43
+ * NODE ON PATH, WHERE IT CAME FROM NVM. A cloud computer's image installs
44
44
  * Node with nvm for `user`, which only an interactive shell loads: a job's
45
45
  * `npm test`, its checks and the agent's own `node` saw none. Loaded only
46
46
  * when `node` is missing, so a machine that has it (the workbench template, a
@@ -1,11 +1,11 @@
1
1
  import { parseGitStatus } from './local.js';
2
2
  /**
3
- * A remote E2B machine (a project sandbox or the project's cloud computer) as
4
- * a Place — the "loop in our service" mode. The engine runs in our worker; the
3
+ * A remote E2B machine (a project sandbox, or an AI agent's cloud computer —
4
+ * its own, or the team computer) as a Place — the "loop in our service" mode. The engine runs in our worker; the
5
5
  * files and commands are on the machine; the model key never goes there.
6
6
  */
7
7
  /**
8
- * NODE ON PATH, WHERE IT CAME FROM NVM. A project computer's image installs
8
+ * NODE ON PATH, WHERE IT CAME FROM NVM. A cloud computer's image installs
9
9
  * Node with nvm for `user`, which only an interactive shell loads: a job's
10
10
  * `npm test`, its checks and the agent's own `node` saw none. Loaded only
11
11
  * when `node` is missing, so a machine that has it (the workbench template, a
@@ -113,3 +113,5 @@ export declare class CoreSession implements EngineSession {
113
113
  private runTool;
114
114
  private context;
115
115
  }
116
+ /** What an ask says the AI agent wants to do, by permission (`mcp`: a connected MCP server's tool, from the runner). */
117
+ export declare function askVerb(permission: string): string;
@@ -487,7 +487,7 @@ export class CoreSession {
487
487
  const asked = await this.options.ask({
488
488
  kind: 'permission',
489
489
  title: request.title.slice(0, 300),
490
- message: `The AI agent wants to ${request.permission === 'bash' ? 'run a command' : 'change a file'}:\n${request.detail.slice(0, 3_000)}`,
490
+ message: `The AI agent wants to ${askVerb(request.permission)}:\n${request.detail.slice(0, 3_000)}`,
491
491
  action_summary: request.detail.slice(0, 500),
492
492
  payload: { permission: request.permission, patterns: request.patterns },
493
493
  });
@@ -502,6 +502,14 @@ export class CoreSession {
502
502
  };
503
503
  }
504
504
  }
505
+ /** What an ask says the AI agent wants to do, by permission (`mcp`: a connected MCP server's tool, from the runner). */
506
+ export function askVerb(permission) {
507
+ if (permission === 'bash')
508
+ return 'run a command';
509
+ if (permission === 'mcp')
510
+ return 'use a connected tool';
511
+ return 'change a file';
512
+ }
505
513
  function randomId() {
506
514
  return Math.random().toString(36).slice(2, 12);
507
515
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workser/engine",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Workser's coding engine for the 'loop in our service' mode: OpenCode's agent contract (its prompts, tool schemas and edit semantics, vendored from v1.18.23) running on Node, with every file and shell action going through a Place — so the machine can be a remote sandbox and no model key is ever on it.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -21,10 +21,11 @@
21
21
  "typecheck": "tsc -p tsconfig.json --noEmit",
22
22
  "test": "rm -rf dist && tsc -p tsconfig.json && node --test dist/test/*.test.js",
23
23
  "prepublishOnly": "rm -rf dist && NODE_OPTIONS=--max-old-space-size=3072 tsc -p tsconfig.json && node scripts/check-pack.mjs",
24
- "check:pack": "node scripts/check-pack.mjs"
24
+ "check:pack": "node scripts/check-pack.mjs",
25
+ "release": "npm version patch && npm publish"
25
26
  },
26
27
  "dependencies": {
27
- "@workser/runtime": "^0.1.2"
28
+ "@workser/runtime": "^0.1.9"
28
29
  },
29
30
  "peerDependencies": {
30
31
  "e2b": ">=1"