@electric-ax/agents-server-conformance-tests 0.1.11 → 0.1.12

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/dist/index.cjs CHANGED
@@ -621,7 +621,7 @@ async function executeStep(ctx, step) {
621
621
  method: `POST`,
622
622
  body: JSON.stringify(body)
623
623
  });
624
- (0, vitest.expect)(res.status).toBe(204);
624
+ (0, vitest.expect)([200, 204]).toContain(res.status);
625
625
  ctx.history.push({
626
626
  type: `message_sent`,
627
627
  entityUrl,
@@ -1896,7 +1896,7 @@ function runElectricAgentsConformanceTests(config) {
1896
1896
  method: `POST`,
1897
1897
  body: JSON.stringify({ payload: { hello: true } })
1898
1898
  });
1899
- (0, vitest.expect)(res.status).toBe(204);
1899
+ (0, vitest.expect)([200, 204]).toContain(res.status);
1900
1900
  }).expectWebhook().respondDone().run());
1901
1901
  });
1902
1902
  (0, vitest.describe)(`Electric Agents List`, () => {
@@ -2510,7 +2510,7 @@ function runElectricAgentsConformanceTests(config) {
2510
2510
  payload: { action: `test` }
2511
2511
  })
2512
2512
  });
2513
- (0, vitest.expect)(res.status).toBe(204);
2513
+ (0, vitest.expect)([200, 204]).toContain(res.status);
2514
2514
  }).run();
2515
2515
  });
2516
2516
  });
@@ -2639,7 +2639,7 @@ function runElectricAgentsConformanceTests(config) {
2639
2639
  targetIdx
2640
2640
  } })
2641
2641
  });
2642
- (0, vitest.expect)(res.status).toBe(204);
2642
+ (0, vitest.expect)([200, 204]).toContain(res.status);
2643
2643
  ctx.history.push({
2644
2644
  type: `message_sent`,
2645
2645
  entityUrl: url,
@@ -2916,12 +2916,15 @@ function runElectricAgentsConformanceTests(config) {
2916
2916
  const sandbox = await makeSandbox(`/tmp`);
2917
2917
  try {
2918
2918
  const tool = createBashTool(sandbox);
2919
- const result = await tool.execute(`test-tc`, { command: `sleep 60` });
2919
+ const result = await tool.execute(`test-tc`, {
2920
+ command: `sleep 60`,
2921
+ timeoutMs: 1e3
2922
+ });
2920
2923
  (0, vitest.expect)(result.details.timedOut).toBe(true);
2921
2924
  } finally {
2922
2925
  await sandbox.dispose();
2923
2926
  }
2924
- }, 35e3);
2927
+ }, 5e3);
2925
2928
  (0, vitest.test)(`read_file rejects paths outside working directory`, async () => {
2926
2929
  const { createReadFileTool } = await import(`../../agents-runtime/src/tools`);
2927
2930
  const fs = await import(`node:fs/promises`);
@@ -3130,7 +3133,7 @@ function runElectricAgentsConformanceTests(config) {
3130
3133
  (0, vitest.expect)(res.status).toBe(404);
3131
3134
  }).run();
3132
3135
  });
3133
- (0, vitest.test)(`tag update on stopped entity is rejected without claim`, () => {
3136
+ (0, vitest.test)(`tag update on stopped entity is rejected as not running`, () => {
3134
3137
  const id = Date.now();
3135
3138
  return electricAgents(config.baseUrl).subscription(`/meta-stopped-agent-${id}/**`, `meta-stopped-sub-${id}`).registerType({
3136
3139
  name: `meta-stopped-agent-${id}`,
@@ -3141,7 +3144,7 @@ function runElectricAgentsConformanceTests(config) {
3141
3144
  method: `POST`,
3142
3145
  body: JSON.stringify({ value: `value` })
3143
3146
  });
3144
- (0, vitest.expect)(res.status).toBe(401);
3147
+ (0, vitest.expect)(res.status).toBe(409);
3145
3148
  }).run();
3146
3149
  });
3147
3150
  });
@@ -3181,7 +3184,7 @@ function runElectricAgentsConformanceTests(config) {
3181
3184
  type: `farewell`
3182
3185
  })
3183
3186
  });
3184
- (0, vitest.expect)(res.status).toBe(204);
3187
+ (0, vitest.expect)([200, 204]).toContain(res.status);
3185
3188
  }).run();
3186
3189
  });
3187
3190
  (0, vitest.test)(`amend schemas on deleted type returns 404`, async () => {
@@ -3315,11 +3318,11 @@ function runElectricAgentsConformanceTests(config) {
3315
3318
  (0, vitest.expect)(ctx.currentWriteToken).toBeNull();
3316
3319
  }).run();
3317
3320
  });
3318
- (0, vitest.test)(`tag update without token is rejected`, () => {
3321
+ (0, vitest.test)(`tag update without legacy entity write token is authorized by principal permission`, () => {
3319
3322
  const id = Date.now();
3320
3323
  return electricAgents(config.baseUrl).subscription(`/auth-meta-notoken-agent-${id}/**`, `auth-meta-notoken-sub-${id}`).registerType({
3321
3324
  name: `auth-meta-notoken-agent-${id}`,
3322
- description: `Test tag update without token`,
3325
+ description: `Test tag update without legacy entity write token`,
3323
3326
  creation_schema: { type: `object` }
3324
3327
  }).spawn(`auth-meta-notoken-agent-${id}`, `entity-1`).custom(async (ctx) => {
3325
3328
  const res = await fetch(appendPathToUrl(ctx.baseUrl, routeControlPlanePath(`${ctx.currentEntityUrl}/tags/key`)), {
@@ -3327,7 +3330,7 @@ function runElectricAgentsConformanceTests(config) {
3327
3330
  headers: { "content-type": `application/json` },
3328
3331
  body: JSON.stringify({ value: `value` })
3329
3332
  });
3330
- (0, vitest.expect)(res.status).toBe(401);
3333
+ (0, vitest.expect)(res.status).toBe(200);
3331
3334
  }).run();
3332
3335
  });
3333
3336
  (0, vitest.test)(`spawn does not expose a public tag write token`, () => {
@@ -3352,7 +3355,7 @@ function runElectricAgentsConformanceTests(config) {
3352
3355
  headers: { "content-type": `application/json` },
3353
3356
  body: JSON.stringify({ payload: `hi` })
3354
3357
  });
3355
- (0, vitest.expect)(res.status).toBe(204);
3358
+ (0, vitest.expect)([200, 204]).toContain(res.status);
3356
3359
  }).expectWebhook().respondDone().run();
3357
3360
  });
3358
3361
  (0, vitest.test)(`GET entity does not leak write_token`, () => {
package/dist/index.js CHANGED
@@ -597,7 +597,7 @@ async function executeStep(ctx, step) {
597
597
  method: `POST`,
598
598
  body: JSON.stringify(body)
599
599
  });
600
- expect(res.status).toBe(204);
600
+ expect([200, 204]).toContain(res.status);
601
601
  ctx.history.push({
602
602
  type: `message_sent`,
603
603
  entityUrl,
@@ -1872,7 +1872,7 @@ function runElectricAgentsConformanceTests(config) {
1872
1872
  method: `POST`,
1873
1873
  body: JSON.stringify({ payload: { hello: true } })
1874
1874
  });
1875
- expect(res.status).toBe(204);
1875
+ expect([200, 204]).toContain(res.status);
1876
1876
  }).expectWebhook().respondDone().run());
1877
1877
  });
1878
1878
  describe(`Electric Agents List`, () => {
@@ -2486,7 +2486,7 @@ function runElectricAgentsConformanceTests(config) {
2486
2486
  payload: { action: `test` }
2487
2487
  })
2488
2488
  });
2489
- expect(res.status).toBe(204);
2489
+ expect([200, 204]).toContain(res.status);
2490
2490
  }).run();
2491
2491
  });
2492
2492
  });
@@ -2615,7 +2615,7 @@ function runElectricAgentsConformanceTests(config) {
2615
2615
  targetIdx
2616
2616
  } })
2617
2617
  });
2618
- expect(res.status).toBe(204);
2618
+ expect([200, 204]).toContain(res.status);
2619
2619
  ctx.history.push({
2620
2620
  type: `message_sent`,
2621
2621
  entityUrl: url,
@@ -2892,12 +2892,15 @@ function runElectricAgentsConformanceTests(config) {
2892
2892
  const sandbox = await makeSandbox(`/tmp`);
2893
2893
  try {
2894
2894
  const tool = createBashTool(sandbox);
2895
- const result = await tool.execute(`test-tc`, { command: `sleep 60` });
2895
+ const result = await tool.execute(`test-tc`, {
2896
+ command: `sleep 60`,
2897
+ timeoutMs: 1e3
2898
+ });
2896
2899
  expect(result.details.timedOut).toBe(true);
2897
2900
  } finally {
2898
2901
  await sandbox.dispose();
2899
2902
  }
2900
- }, 35e3);
2903
+ }, 5e3);
2901
2904
  test(`read_file rejects paths outside working directory`, async () => {
2902
2905
  const { createReadFileTool } = await import(`../../agents-runtime/src/tools`);
2903
2906
  const fs = await import(`node:fs/promises`);
@@ -3106,7 +3109,7 @@ function runElectricAgentsConformanceTests(config) {
3106
3109
  expect(res.status).toBe(404);
3107
3110
  }).run();
3108
3111
  });
3109
- test(`tag update on stopped entity is rejected without claim`, () => {
3112
+ test(`tag update on stopped entity is rejected as not running`, () => {
3110
3113
  const id = Date.now();
3111
3114
  return electricAgents(config.baseUrl).subscription(`/meta-stopped-agent-${id}/**`, `meta-stopped-sub-${id}`).registerType({
3112
3115
  name: `meta-stopped-agent-${id}`,
@@ -3117,7 +3120,7 @@ function runElectricAgentsConformanceTests(config) {
3117
3120
  method: `POST`,
3118
3121
  body: JSON.stringify({ value: `value` })
3119
3122
  });
3120
- expect(res.status).toBe(401);
3123
+ expect(res.status).toBe(409);
3121
3124
  }).run();
3122
3125
  });
3123
3126
  });
@@ -3157,7 +3160,7 @@ function runElectricAgentsConformanceTests(config) {
3157
3160
  type: `farewell`
3158
3161
  })
3159
3162
  });
3160
- expect(res.status).toBe(204);
3163
+ expect([200, 204]).toContain(res.status);
3161
3164
  }).run();
3162
3165
  });
3163
3166
  test(`amend schemas on deleted type returns 404`, async () => {
@@ -3291,11 +3294,11 @@ function runElectricAgentsConformanceTests(config) {
3291
3294
  expect(ctx.currentWriteToken).toBeNull();
3292
3295
  }).run();
3293
3296
  });
3294
- test(`tag update without token is rejected`, () => {
3297
+ test(`tag update without legacy entity write token is authorized by principal permission`, () => {
3295
3298
  const id = Date.now();
3296
3299
  return electricAgents(config.baseUrl).subscription(`/auth-meta-notoken-agent-${id}/**`, `auth-meta-notoken-sub-${id}`).registerType({
3297
3300
  name: `auth-meta-notoken-agent-${id}`,
3298
- description: `Test tag update without token`,
3301
+ description: `Test tag update without legacy entity write token`,
3299
3302
  creation_schema: { type: `object` }
3300
3303
  }).spawn(`auth-meta-notoken-agent-${id}`, `entity-1`).custom(async (ctx) => {
3301
3304
  const res = await fetch(appendPathToUrl(ctx.baseUrl, routeControlPlanePath(`${ctx.currentEntityUrl}/tags/key`)), {
@@ -3303,7 +3306,7 @@ function runElectricAgentsConformanceTests(config) {
3303
3306
  headers: { "content-type": `application/json` },
3304
3307
  body: JSON.stringify({ value: `value` })
3305
3308
  });
3306
- expect(res.status).toBe(401);
3309
+ expect(res.status).toBe(200);
3307
3310
  }).run();
3308
3311
  });
3309
3312
  test(`spawn does not expose a public tag write token`, () => {
@@ -3328,7 +3331,7 @@ function runElectricAgentsConformanceTests(config) {
3328
3331
  headers: { "content-type": `application/json` },
3329
3332
  body: JSON.stringify({ payload: `hi` })
3330
3333
  });
3331
- expect(res.status).toBe(204);
3334
+ expect([200, 204]).toContain(res.status);
3332
3335
  }).expectWebhook().respondDone().run();
3333
3336
  });
3334
3337
  test(`GET entity does not leak write_token`, () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electric-ax/agents-server-conformance-tests",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Conformance test suite for Electric Agents server implementations",
5
5
  "author": "Durable Stream contributors",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  ],
36
36
  "dependencies": {
37
37
  "@durable-streams/client": "^0.2.6",
38
- "@electric-sql/client": "^1.5.20",
38
+ "@electric-sql/client": "^1.5.21",
39
39
  "fast-check": "^4.6.0",
40
40
  "vitest": "^4.1.0"
41
41
  },
@@ -43,7 +43,7 @@
43
43
  "@mariozechner/pi-agent-core": "^0.70.2",
44
44
  "tsdown": "^0.9.0",
45
45
  "typescript": "^5.0.0",
46
- "@electric-ax/agents-server": "0.4.16"
46
+ "@electric-ax/agents-server": "0.4.20"
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=18.0.0"