@astrosheep/keiyaku 4.6.6 → 4.6.7

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 (68) hide show
  1. package/README.md +7 -0
  2. package/build/{integrations/marketplace → plugins}/.agents/plugins/marketplace.json +1 -1
  3. package/build/plugins/.claude-plugin/marketplace.json +5 -0
  4. package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/.claude-plugin/plugin.json +1 -1
  5. package/build/{integrations/marketplace/plugins/keiyaku → plugins/codex}/.codex-plugin/plugin.json +1 -1
  6. package/build/plugins/codex/skills/keiyaku/SKILL.md +44 -0
  7. package/build/plugins/codex/skills/keiyaku-akuma/SKILL.md +130 -0
  8. package/build/plugins/codex/skills/keiyaku-akuma/references/automation.md +269 -0
  9. package/build/plugins/codex/skills/keiyaku-babysit/SKILL.md +65 -0
  10. package/build/plugins/codex/skills/keiyaku-bind/SKILL.md +216 -0
  11. package/build/plugins/codex/skills/keiyaku-bind/agents/openai.yaml +4 -0
  12. package/build/plugins/codex/skills/keiyaku-task/SKILL.md +104 -0
  13. package/build/plugins/codex/skills/keiyaku-workflow/SKILL.md +129 -0
  14. package/build/plugins/opencode/package.json +6 -0
  15. package/build/plugins/opencode/skills/keiyaku/SKILL.md +44 -0
  16. package/build/plugins/opencode/skills/keiyaku-akuma/SKILL.md +130 -0
  17. package/build/plugins/opencode/skills/keiyaku-akuma/references/automation.md +269 -0
  18. package/build/plugins/opencode/skills/keiyaku-babysit/SKILL.md +65 -0
  19. package/build/plugins/opencode/skills/keiyaku-bind/SKILL.md +216 -0
  20. package/build/plugins/opencode/skills/keiyaku-bind/agents/openai.yaml +4 -0
  21. package/build/plugins/opencode/skills/keiyaku-task/SKILL.md +104 -0
  22. package/build/plugins/opencode/skills/keiyaku-workflow/SKILL.md +129 -0
  23. package/build/skills/keiyaku/SKILL.md +44 -0
  24. package/build/skills/keiyaku-akuma/SKILL.md +130 -0
  25. package/build/skills/keiyaku-akuma/references/automation.md +269 -0
  26. package/build/skills/keiyaku-babysit/SKILL.md +65 -0
  27. package/build/skills/keiyaku-bind/SKILL.md +216 -0
  28. package/build/skills/keiyaku-bind/agents/openai.yaml +4 -0
  29. package/build/skills/keiyaku-task/SKILL.md +104 -0
  30. package/build/skills/keiyaku-workflow/SKILL.md +129 -0
  31. package/build/src/akuma/akuma-instance.js +7 -5
  32. package/build/src/akuma/akuma-observe.d.ts +4 -0
  33. package/build/src/akuma/akuma-observe.js +12 -0
  34. package/build/src/akuma/akuma-owner.d.ts +3 -2
  35. package/build/src/akuma/akuma-owner.js +28 -10
  36. package/build/src/akuma/akuma-selection-execution.d.ts +3 -1
  37. package/build/src/akuma/akuma-selection-execution.js +2 -1
  38. package/build/src/akuma/akuma-wait.d.ts +2 -1
  39. package/build/src/akuma/akuma-wait.js +4 -1
  40. package/build/src/akuma/body.d.ts +1 -0
  41. package/build/src/akuma/body.js +12 -23
  42. package/build/src/akuma/selection-owner-port.d.ts +1 -1
  43. package/build/src/akuma/selection-owner-port.js +16 -5
  44. package/build/src/akuma/selection-request.d.ts +2 -0
  45. package/build/src/akuma/selection-request.js +2 -1
  46. package/build/src/akuma-body.js +4 -2
  47. package/build/src/cli/commands/akuma.js +6 -12
  48. package/build/src/cli/commands/install.js +3 -3
  49. package/build/src/library/akuma-creation.js +21 -19
  50. package/build/src/library/selection.js +5 -2
  51. package/build/src/plugin/akuma-signals.d.ts +10 -11
  52. package/build/src/plugin/akuma-signals.js +36 -20
  53. package/build/src/plugin/public.d.ts +5 -0
  54. package/build/src/plugin/runtime.d.ts +1 -0
  55. package/build/src/plugin/runtime.js +34 -23
  56. package/package.json +7 -7
  57. package/build/integrations/marketplace/.claude-plugin/marketplace.json +0 -5
  58. package/build/integrations/marketplace/plugins/keiyaku/package.json +0 -17
  59. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku/SKILL.md +0 -0
  60. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-akuma/SKILL.md +0 -0
  61. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-akuma/references/automation.md +0 -0
  62. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-babysit/SKILL.md +0 -0
  63. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-bind/SKILL.md +0 -0
  64. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-bind/agents/openai.yaml +0 -0
  65. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-task/SKILL.md +0 -0
  66. /package/build/{integrations/marketplace/plugins/keiyaku → plugins/claude}/skills/keiyaku-workflow/SKILL.md +0 -0
  67. /package/build/{integrations/marketplace/plugins/keiyaku/opencode.js → plugins/opencode/index.js} +0 -0
  68. /package/build/{integrations → plugins}/pi/keiyaku.ts +0 -0
@@ -18,7 +18,7 @@ function object(value) {
18
18
  function message(error) {
19
19
  return (error instanceof Error ? error.message : String(error)).slice(0, DIAGNOSTIC_LIMIT);
20
20
  }
21
- function diagnostic(report, subject, stage, error) {
21
+ export function reportPluginDiagnostic(report, subject, stage, error) {
22
22
  if (report === undefined)
23
23
  return;
24
24
  try {
@@ -67,30 +67,30 @@ async function settleBefore(promise, cancellation) {
67
67
  }
68
68
  function selectedEntry(entry, report) {
69
69
  if (entry.name.trim().length === 0) {
70
- diagnostic(report, "<unnamed>", "selection", new TypeError("plugin setting name must be nonblank"));
70
+ reportPluginDiagnostic(report, "<unnamed>", "selection", new TypeError("plugin setting name must be nonblank"));
71
71
  return null;
72
72
  }
73
73
  if (!object(entry.value)) {
74
- diagnostic(report, entry.name, "selection", new TypeError("plugin setting must be an object"));
74
+ reportPluginDiagnostic(report, entry.name, "selection", new TypeError("plugin setting must be an object"));
75
75
  return null;
76
76
  }
77
77
  const names = Object.keys(entry.value);
78
78
  if (!names.includes("package") || names.some((name) => !["package", "enabled", "config"].includes(name))) {
79
- diagnostic(report, entry.name, "selection", new TypeError("plugin setting has unknown or missing fields"));
79
+ reportPluginDiagnostic(report, entry.name, "selection", new TypeError("plugin setting has unknown or missing fields"));
80
80
  return null;
81
81
  }
82
82
  const packageName = entry.value.package;
83
83
  if (typeof packageName !== "string" || packageName.trim().length === 0) {
84
- diagnostic(report, entry.name, "selection", new TypeError("plugin package must be a nonblank string"));
84
+ reportPluginDiagnostic(report, entry.name, "selection", new TypeError("plugin package must be a nonblank string"));
85
85
  return null;
86
86
  }
87
87
  if (packageName !== packageName.trim()) {
88
- diagnostic(report, entry.name, "selection", new TypeError("plugin package must not have surrounding whitespace"));
88
+ reportPluginDiagnostic(report, entry.name, "selection", new TypeError("plugin package must not have surrounding whitespace"));
89
89
  return null;
90
90
  }
91
91
  const enabled = entry.value.enabled;
92
92
  if (enabled !== undefined && typeof enabled !== "boolean") {
93
- diagnostic(report, entry.name, "selection", new TypeError("plugin enabled must be a boolean"));
93
+ reportPluginDiagnostic(report, entry.name, "selection", new TypeError("plugin enabled must be a boolean"));
94
94
  return null;
95
95
  }
96
96
  if (enabled === false)
@@ -101,7 +101,7 @@ function selectedPlugins(input, report) {
101
101
  const view = input.namespace(PLUGIN_NAMESPACE);
102
102
  if (view.kind === "failed") {
103
103
  for (const failure of view.failures)
104
- diagnostic(report, "settings", failure.scope, failure.diagnostic);
104
+ reportPluginDiagnostic(report, "settings", failure.scope, failure.diagnostic);
105
105
  return BUILTIN_PLUGINS;
106
106
  }
107
107
  if (view.entries.length === 0)
@@ -197,6 +197,21 @@ async function writablePaths(world, declarations) {
197
197
  }
198
198
  return paths;
199
199
  }
200
+ /**
201
+ * The runtime's acceptance vocabulary. The record is exhaustive over the public
202
+ * payload map, so adding a signal there fails compilation here until the same
203
+ * kind is accepted.
204
+ */
205
+ const SIGNAL_KINDS = Object.freeze({
206
+ "akuma.initiating": true,
207
+ "akuma.called": true,
208
+ "akuma.outcome-observed": true,
209
+ "akuma.turn-outcome": true,
210
+ "akuma.body-ended": true,
211
+ });
212
+ function isSignalKind(kind) {
213
+ return Object.hasOwn(SIGNAL_KINDS, kind);
214
+ }
200
215
  function handlers(pluginId, instance) {
201
216
  if (!object(instance))
202
217
  throw new TypeError("plugin activation must return an object");
@@ -208,12 +223,8 @@ function handlers(pluginId, instance) {
208
223
  throw new TypeError("plugin signals must be an object");
209
224
  const registered = [];
210
225
  for (const [kind, handler] of Object.entries(instance.signals)) {
211
- if (kind !== "akuma.initiating" &&
212
- kind !== "akuma.called" &&
213
- kind !== "akuma.turn-outcome" &&
214
- kind !== "akuma.body-ended") {
226
+ if (!isSignalKind(kind))
215
227
  throw new TypeError(`plugin signal is unknown: ${kind}`);
216
- }
217
228
  if (typeof handler !== "function")
218
229
  throw new TypeError(`plugin signal handler is not a function: ${kind}`);
219
230
  registered.push({ pluginId, kind, handler });
@@ -270,7 +281,7 @@ async function activate(input) {
270
281
  }
271
282
  catch (error) {
272
283
  markStarted();
273
- diagnostic(report, selected.id, "import", error);
284
+ reportPluginDiagnostic(report, selected.id, "import", error);
274
285
  return [];
275
286
  }
276
287
  if (cancellation.aborted) {
@@ -288,7 +299,7 @@ async function activate(input) {
288
299
  }
289
300
  catch (error) {
290
301
  markStarted();
291
- diagnostic(report, selected.id, "validation", error);
302
+ reportPluginDiagnostic(report, selected.id, "validation", error);
292
303
  return [];
293
304
  }
294
305
  let context;
@@ -307,7 +318,7 @@ async function activate(input) {
307
318
  }
308
319
  catch (error) {
309
320
  markStarted();
310
- diagnostic(report, selected.id, "validation", error);
321
+ reportPluginDiagnostic(report, selected.id, "validation", error);
311
322
  return [];
312
323
  }
313
324
  if (cancellation.aborted) {
@@ -324,16 +335,16 @@ async function activate(input) {
324
335
  return registered;
325
336
  }
326
337
  catch (error) {
327
- diagnostic(report, selected.id, "activation", error);
338
+ reportPluginDiagnostic(report, selected.id, "activation", error);
328
339
  return [];
329
340
  }
330
341
  }
331
342
  async function deliver(entry, signal, reportDiagnostic, timeoutMs) {
332
343
  const result = await boundedAttempt((cancellation) => entry.handler(signal, cancellation), timeoutMs);
333
344
  if (result.kind === "timed-out")
334
- diagnostic(reportDiagnostic, entry.pluginId, "signal", timeoutError());
345
+ reportPluginDiagnostic(reportDiagnostic, entry.pluginId, "signal", timeoutError());
335
346
  if (result.kind === "failed")
336
- diagnostic(reportDiagnostic, entry.pluginId, "signal", result.error);
347
+ reportPluginDiagnostic(reportDiagnostic, entry.pluginId, "signal", result.error);
337
348
  }
338
349
  export async function pluginRuntime(input) {
339
350
  let runtime = PROCESS_RUNTIMES.get(input.world);
@@ -358,7 +369,7 @@ async function createPluginRuntime(input) {
358
369
  releaseStarted();
359
370
  if (result.kind === "settled")
360
371
  return { handlers: result.value, timedOut: false };
361
- diagnostic(report, entry.id, "activation", result.kind === "failed" ? result.error : timeoutError());
372
+ reportPluginDiagnostic(report, entry.id, "activation", result.kind === "failed" ? result.error : timeoutError());
362
373
  return { handlers: [], timedOut: result.kind === "timed-out" };
363
374
  });
364
375
  previousStarted = started;
@@ -372,16 +383,16 @@ async function createPluginRuntime(input) {
372
383
  const activatedHandlers = await settleBefore(activation, cancellation);
373
384
  if (activatedHandlers !== ABORTED) {
374
385
  if (activatedHandlers.timedOut)
375
- diagnostic(reportDiagnostic, selected[index].id, "signal", timeoutError());
386
+ reportPluginDiagnostic(reportDiagnostic, selected[index].id, "signal", timeoutError());
376
387
  return activatedHandlers.handlers;
377
388
  }
378
- diagnostic(reportDiagnostic, selected[index].id, "signal", timeoutError());
389
+ reportPluginDiagnostic(reportDiagnostic, selected[index].id, "signal", timeoutError());
379
390
  return [];
380
391
  }));
381
392
  return handlers.flat();
382
393
  });
383
394
  if (activated.kind === "failed") {
384
- diagnostic(reportDiagnostic, "runtime", "signal", activated.error);
395
+ reportPluginDiagnostic(reportDiagnostic, "runtime", "signal", activated.error);
385
396
  return;
386
397
  }
387
398
  if (activated.kind === "timed-out")
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@astrosheep/keiyaku",
3
- "version": "4.6.6",
3
+ "version": "4.6.7",
4
4
  "workspaces": [
5
- "plugins/*"
5
+ "plugins/square"
6
6
  ],
7
7
  "files": [
8
8
  "build"
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "scripts": {
31
31
  "release": "npm run test:release && npm version patch && npm publish",
32
- "build": "node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('build', { recursive: true, force: true })\" && tsc -p tsconfig.json && npm run build --workspace @astrosheep/keiyaku-plugin-square && node scripts/copy-integrations.js && node scripts/build-windows-launcher.js && node --input-type=module -e \"import { chmodSync } from 'node:fs'; chmodSync('build/src/cli/index.js', 0o755)\"",
32
+ "build": "node --input-type=module -e \"import { rmSync } from 'node:fs'; rmSync('build', { recursive: true, force: true })\" && tsc -p tsconfig.json && npm run build --workspace @astrosheep/keiyaku-plugin-square && node scripts/copy-plugins.js && node scripts/build-windows-launcher.js && node --input-type=module -e \"import { chmodSync } from 'node:fs'; chmodSync('build/src/cli/index.js', 0o755)\"",
33
33
  "prepack": "node scripts/verify-package.js",
34
34
  "postpack": "node scripts/verify-package.js",
35
35
  "harness:version": "node scripts/update-harness-version.js",
@@ -73,8 +73,8 @@
73
73
  "dependencies": {
74
74
  "@agentclientprotocol/sdk": "^1.3.0",
75
75
  "@anthropic-ai/claude-agent-sdk": "^0.3.226",
76
- "@astrosheep/keiyaku-plugin-square": "0.1.7",
77
- "@astrosheep/square": "^0.3.63",
76
+ "@astrosheep/keiyaku-plugin-square": "0.1.8",
77
+ "@astrosheep/square": "^0.3.70",
78
78
  "@opencode-ai/sdk": "1.18.3",
79
79
  "cross-spawn": "^7.0.6",
80
80
  "diff": "^8.0.4",
@@ -91,10 +91,10 @@
91
91
  ],
92
92
  "pi": {
93
93
  "extensions": [
94
- "./build/integrations/pi/keiyaku.ts"
94
+ "./build/plugins/pi/keiyaku.ts"
95
95
  ],
96
96
  "skills": [
97
- "./build/integrations/marketplace/plugins/keiyaku/skills"
97
+ "./build/skills"
98
98
  ]
99
99
  },
100
100
  "author": "",
@@ -1,5 +0,0 @@
1
- {
2
- "name": "keiyaku",
3
- "owner": { "name": "Keiyaku" },
4
- "plugins": [{ "name": "keiyaku", "source": "./plugins/keiyaku" }]
5
- }
@@ -1,17 +0,0 @@
1
- {
2
- "name": "keiyaku-harness",
3
- "version": "4.5.28",
4
- "type": "module",
5
- "main": "./opencode.js",
6
- "keywords": [
7
- "pi-package"
8
- ],
9
- "pi": {
10
- "extensions": [
11
- "../../../pi/keiyaku.ts"
12
- ],
13
- "skills": [
14
- "./skills"
15
- ]
16
- }
17
- }
File without changes