@pennixrv/trellis-paseo-adapter 0.7.2-beta.19 → 0.7.2-beta.20

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
@@ -1,7 +1,7 @@
1
1
  # Optional Paseo adapter
2
2
 
3
3
  This package is installed explicitly through Pennix Lifecycle. It requires Node 22 or newer
4
- and Paseo 0.15.3. The ordinary Trellis CLI/core do not depend on it.
4
+ and a running Paseo daemon 0.15.3 or 0.15.4. The ordinary Trellis CLI/core do not depend on it.
5
5
 
6
6
  `trellis-paseo-adapter` accepts one version-1 JSON request on stdin and returns one bounded
7
7
  JSON response. Task commands own authorization, attempts, receipts and acceptance. The
@@ -11,5 +11,8 @@ An unknown write outcome requires native reconciliation, never automatic replay.
11
11
 
12
12
  Paseo server dependencies include native provider/PTY/voice packages. Their installation
13
13
  cost is confined to this optional package and Lifecycle's explicit script allowlist.
14
- The supported initial matrix is Paseo SDK/daemon 0.15.3 and Codex; other providers and
15
- remote transports are refused. Bottom-level approval/context settings use native defaults.
14
+ The supported matrix is Paseo SDK 0.15.3 with daemon 0.15.3 or 0.15.4 and Codex;
15
+ the public server-info handshake checks the daemon identity and exact version before
16
+ any operation. Missing or unknown versions, other providers and remote transports
17
+ are refused. Capability output distinguishes `sdk_version` from `daemon_version`.
18
+ Bottom-level approval/context settings use native defaults.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pennixrv/trellis-paseo-adapter",
3
- "version": "0.7.2-beta.19",
3
+ "version": "0.7.2-beta.20",
4
4
  "description": "Optional local Paseo public SDK adapter for Trellis worktree delegation",
5
5
  "type": "module",
6
6
  "bin": {
package/src/adapter.js CHANGED
@@ -6,6 +6,10 @@ import { hostname } from 'node:os';
6
6
  export const MAX_BYTES = 256 * 1024;
7
7
  const operations = new Set(['capability', 'inspect', 'prepare-workspace', 'prepare-agent', 'execute', 'followup', 'observe', 'wait', 'interrupt', 'resource-preview']);
8
8
  export function refuse(category) { throw Object.assign(new Error(category), { category }); }
9
+ export function verifyDaemonInfo(info, serverId) {
10
+ if (info?.serverId !== serverId) refuse('identity_mismatch');
11
+ if (!['0.15.3', '0.15.4'].includes(info.version)) refuse('unsupported');
12
+ }
9
13
  function text(value) { if (typeof value !== 'string' || !value || value.length > 65536 || value.includes('\0')) refuse('invalid_input'); return value; }
10
14
  function keys(object, allowed) {
11
15
  if (!object || typeof object !== 'object' || Array.isArray(object) || Object.keys(object).some(k => !allowed.includes(k))) refuse('invalid_input');
@@ -57,7 +61,7 @@ export async function perform(request, api, client, identity) {
57
61
  }
58
62
  if (op === 'capability') {
59
63
  const cwd = text(p.cwd);
60
- return { identity, sdk_version: '0.15.3', protocol: 1, models: await api.providers.listModels('codex', { cwd }), modes: await api.providers.listModes('codex', { cwd }) };
64
+ return { identity, sdk_version: '0.15.3', daemon_version: client.getLastServerInfoMessage().version, protocol: 1, models: await api.providers.listModels('codex', { cwd }), modes: await api.providers.listModes('codex', { cwd }) };
61
65
  }
62
66
  if (op === 'prepare-workspace') {
63
67
  const ref = await api.workspaces.create({ source: { kind: 'worktree', cwd: realpathSync(text(p.target)), action: 'branch-off', baseBranch: text(p.base_commit), branchName: text(p.branch) }, title: text(p.title), background: true });
@@ -129,7 +133,8 @@ export async function dispatch(input) {
129
133
  let api;
130
134
  try {
131
135
  await client.connect();
132
- if (client.getLastServerInfoMessage()?.serverId !== instance.serverId || !isSameDaemonInstance(instance, await readDaemonInstance(home))) refuse('identity_mismatch');
136
+ verifyDaemonInfo(client.getLastServerInfoMessage(), instance.serverId);
137
+ if (!isSameDaemonInstance(instance, await readDaemonInstance(home))) refuse('identity_mismatch');
133
138
  api = createPaseoApi(client);
134
139
  return await perform(request, api, client, { server_id: instance.serverId, home, pid: instance.pid, started_at: instance.startedAt });
135
140
  } finally { if (api) await api.dispose(); await client.close(); }