@amaster.ai/employee-runtime-connector 0.1.1-beta.232 → 0.1.1-beta.233

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
@@ -18,6 +18,25 @@ npm install --omit=dev --prefix /opt/pi-cli-runtime @amaster.ai/employee-runtime
18
18
 
19
19
  Do not use `latest`, `^`, or `~` in a runtime image. The image tag and connector package version should identify one immutable deployment.
20
20
 
21
+ ## Incremental type safety
22
+
23
+ `pnpm typecheck` runs the legacy entry-point syntax checks plus TypeScript strict
24
+ `checkJs` over `src/amaster-runtime-daemon/typed/**/*.mjs` and compile-time contract
25
+ tests in `type-tests/`. The first migrated boundary is the run-completion phase and
26
+ event transition table. It is imported by the existing completion-state module and
27
+ bundled normally; package layout and runtime state version are unchanged.
28
+
29
+ The package declares its own TypeScript development dependency, using the same
30
+ compiler version locked by the workspace. Source-development installs need dev
31
+ dependencies for this gate; it must not depend on the root workspace exposing
32
+ `tsc` on PATH. Published runtime consumers only need the distributed artifacts.
33
+
34
+ Put newly extracted independent daemon logic in the typed lane with explicit
35
+ inputs/outputs. New files in that directory are included automatically. Do not add
36
+ `any` or disable checking to make the gate pass. Keep untrusted I/O validation at
37
+ the boundary. `check:syntax` is only a parser check; this incremental gate does not
38
+ claim that the existing CLI/daemon or all legacy helpers are fully type-checked.
39
+
21
40
  Immutable images should pin an exact package version as their baseline. The current connector does not download or replace runtime code while running; package upgrades and rollbacks belong to the image build and rollout.
22
41
 
23
42
  The governed MCP cache identity follows the installed `pi-mcp-adapter` version.
@@ -12323,6 +12323,8 @@ var BUSINESS_TASK_ENROLLMENT_READ_STATES = [
12323
12323
  var BUSINESS_TASK_ENROLLMENT_WAKE_STATUSES = [
12324
12324
  "pending",
12325
12325
  "waiting_dependency",
12326
+ "waiting_prerequisite",
12327
+ "transferred_prerequisite",
12326
12328
  "leased",
12327
12329
  "delivered",
12328
12330
  "cancelled",
@@ -12446,6 +12448,8 @@ var governedBusinessTaskEnrollmentSchema = external_exports.object({
12446
12448
  }).strict();
12447
12449
  var governedBusinessTaskWakeDispatchSchema = external_exports.object({
12448
12450
  outboxId: external_exports.string().uuid(),
12451
+ prerequisiteAssignmentReceiptId: external_exports.string().uuid().nullable(),
12452
+ prerequisiteReleaseBindingId: external_exports.string().uuid().nullable(),
12449
12453
  enrollmentId: external_exports.string().uuid(),
12450
12454
  executionEpoch: external_exports.number().int().positive(),
12451
12455
  agentId: external_exports.string().uuid(),
@@ -23549,8 +23553,8 @@ function isTerminalResultOutboxStatus(status) {
23549
23553
  // src/amaster-runtime-daemon/run-completion-state.mjs
23550
23554
  import { existsSync as existsSync8, mkdirSync as mkdirSync4, readFileSync as readFileSync10, readdirSync as readdirSync5, renameSync as renameSync5, unlinkSync as unlinkSync2, writeFileSync as writeFileSync6 } from "node:fs";
23551
23555
  import { join as join8 } from "node:path";
23552
- var RUN_COMPLETION_STATE_VERSION = 1;
23553
- var RUN_COMPLETION_USAGE_SCHEMA_VERSION = "runtime-command-usage-v1";
23556
+
23557
+ // src/amaster-runtime-daemon/typed/run-completion-transitions.mjs
23554
23558
  var RUN_COMPLETION_PHASES = /* @__PURE__ */ new Set([
23555
23559
  "executing",
23556
23560
  "usage_snapshot_persisted",
@@ -23590,6 +23594,16 @@ var PHASE_TRANSITIONS = /* @__PURE__ */ new Map([
23590
23594
  ["profile_cleanup:profile_cleanup_abandoned", "result_post_pending"],
23591
23595
  ["result_post_pending:result_post_delivered", "terminal"]
23592
23596
  ]);
23597
+ function isRunCompletionPhase(value) {
23598
+ return typeof value === "string" && RUN_COMPLETION_PHASES.has(value);
23599
+ }
23600
+ function nextRunCompletionPhase(phase, event) {
23601
+ return PHASE_TRANSITIONS.get(`${phase}:${event}`);
23602
+ }
23603
+
23604
+ // src/amaster-runtime-daemon/run-completion-state.mjs
23605
+ var RUN_COMPLETION_STATE_VERSION = 1;
23606
+ var RUN_COMPLETION_USAGE_SCHEMA_VERSION = "runtime-command-usage-v1";
23593
23607
  function record4(value) {
23594
23608
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
23595
23609
  }
@@ -23720,7 +23734,7 @@ function appendRunCompletionUsageTurn(state, input) {
23720
23734
  }
23721
23735
  function transitionRunCompletionState(state, event, patch = {}, now = (/* @__PURE__ */ new Date()).toISOString()) {
23722
23736
  const current = assertValidRunCompletionState(state);
23723
- const nextPhase = PHASE_TRANSITIONS.get(`${current.phase}:${event}`);
23737
+ const nextPhase = nextRunCompletionPhase(current.phase, event);
23724
23738
  if (!nextPhase) {
23725
23739
  throw new Error(`run_completion_state_transition_invalid:${current.phase}:${event}`);
23726
23740
  }
@@ -23748,7 +23762,7 @@ function assertValidRunCompletionState(value) {
23748
23762
  if (state.version !== RUN_COMPLETION_STATE_VERSION) throw new Error("run_completion_state_invalid:version");
23749
23763
  const commandId = nonEmptyString(state.commandId, "commandId");
23750
23764
  const connectorId = nonEmptyString(state.connectorId, "connectorId");
23751
- if (!RUN_COMPLETION_PHASES.has(state.phase)) throw new Error("run_completion_state_invalid:phase");
23765
+ if (!isRunCompletionPhase(state.phase)) throw new Error("run_completion_state_invalid:phase");
23752
23766
  const command = record4(state.command);
23753
23767
  if (nonEmptyString(command.commandId ?? command.id, "command.commandId") !== commandId) {
23754
23768
  throw new Error("run_completion_state_invalid:command_binding");
@@ -30361,7 +30375,7 @@ function assertRequiredTaskAttachmentMaterialized(input, materialized) {
30361
30375
  }
30362
30376
 
30363
30377
  // src/amaster-runtime-daemon.mjs
30364
- var CONNECTOR_VERSION = "0.1.1-beta.232";
30378
+ var CONNECTOR_VERSION = "0.1.1-beta.233";
30365
30379
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
30366
30380
  var daemonRequire = createRequire(import.meta.url);
30367
30381
  var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
@@ -7,7 +7,7 @@ import { homedir, hostname } from "node:os";
7
7
  import { fileURLToPath } from "node:url";
8
8
  import { BUILD_SUPPORTED_CAPABILITIES } from "./amaster-runtime-daemon/capability-registry.mjs";
9
9
 
10
- const CONNECTOR_VERSION = "0.1.1-beta.232";
10
+ const CONNECTOR_VERSION = "0.1.1-beta.233";
11
11
 
12
12
  const CONFIG_KEY_MAP = new Map([
13
13
  ["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/employee-runtime-connector",
3
- "version": "0.1.1-beta.232",
3
+ "version": "0.1.1-beta.233",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -17,7 +17,8 @@
17
17
  "clean": "node scripts/clean.mjs",
18
18
  "phase0b:live": "node probes/runtime-v2-phase0b/live-probe.mjs",
19
19
  "phase0b:test": "node --test probes/runtime-v2-phase0b/*.test.mjs",
20
- "typecheck": "node --check scripts/build.mjs && node --check scripts/bundle.mjs && node --check src/amaster-runtime.mjs && node --check src/amaster-runtime-daemon.mjs",
20
+ "check:syntax": "node --check scripts/build.mjs && node --check scripts/bundle.mjs && node --check src/amaster-runtime.mjs && node --check src/amaster-runtime-daemon.mjs",
21
+ "typecheck": "pnpm run check:syntax && tsc --project tsconfig.json",
21
22
  "test": "pnpm run build && node --test test/*.test.mjs src/amaster-runtime-daemon/*.test.mjs",
22
23
  "prepack": "pnpm run test"
23
24
  },
@@ -30,7 +31,8 @@
30
31
  "devDependencies": {
31
32
  "@paperclipai/shared": "workspace:*",
32
33
  "esbuild": "^0.27.3",
33
- "smol-toml": "1.7.0"
34
+ "smol-toml": "1.7.0",
35
+ "typescript": "^5.7.3"
34
36
  },
35
37
  "dependencies": {
36
38
  "playwright-core": "^1.58.2"