@amaster.ai/employee-runtime-connector 0.1.1-beta.232 → 0.1.1-beta.234
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 +19 -0
- package/dist/amaster-runtime-daemon.mjs +26 -6
- package/dist/amaster-runtime.mjs +1 -1
- package/package.json +5 -3
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.
|
|
@@ -4554,7 +4554,7 @@ var updateMirrorxAgentSessionPreferenceSchema = external_exports.object({
|
|
|
4554
4554
|
(value) => value.groupId !== void 0 || value.pinned !== void 0 || value.archived !== void 0,
|
|
4555
4555
|
{ message: "At least one session preference field is required" }
|
|
4556
4556
|
);
|
|
4557
|
-
var mirrorxAgentSessionSectionSchema = external_exports.enum(["pinned", "recent", "group", "archived"]);
|
|
4557
|
+
var mirrorxAgentSessionSectionSchema = external_exports.enum(["attention", "pinned", "recent", "group", "archived"]);
|
|
4558
4558
|
var mirrorxAgentSessionSectionQuerySchema = external_exports.object({
|
|
4559
4559
|
section: mirrorxAgentSessionSectionSchema,
|
|
4560
4560
|
groupId: external_exports.string().uuid().optional(),
|
|
@@ -4576,6 +4576,12 @@ var mirrorxAgentSessionSectionQuerySchema = external_exports.object({
|
|
|
4576
4576
|
});
|
|
4577
4577
|
}
|
|
4578
4578
|
});
|
|
4579
|
+
var MIRRORX_SESSION_RESULT_DEFAULT_LIMIT = 50;
|
|
4580
|
+
var MIRRORX_SESSION_RESULT_MAX_LIMIT = 100;
|
|
4581
|
+
var mirrorxSessionResultSummariesQuerySchema = external_exports.object({
|
|
4582
|
+
limit: external_exports.coerce.number().int().min(1).max(MIRRORX_SESSION_RESULT_MAX_LIMIT).default(MIRRORX_SESSION_RESULT_DEFAULT_LIMIT),
|
|
4583
|
+
cursor: external_exports.string().trim().min(1).max(2048).optional()
|
|
4584
|
+
});
|
|
4579
4585
|
var mirrorxSessionComposerControlSchema = external_exports.object({
|
|
4580
4586
|
stateVersion: external_exports.string().trim().min(1).max(200),
|
|
4581
4587
|
expectedRunId: external_exports.string().uuid()
|
|
@@ -12323,6 +12329,8 @@ var BUSINESS_TASK_ENROLLMENT_READ_STATES = [
|
|
|
12323
12329
|
var BUSINESS_TASK_ENROLLMENT_WAKE_STATUSES = [
|
|
12324
12330
|
"pending",
|
|
12325
12331
|
"waiting_dependency",
|
|
12332
|
+
"waiting_prerequisite",
|
|
12333
|
+
"transferred_prerequisite",
|
|
12326
12334
|
"leased",
|
|
12327
12335
|
"delivered",
|
|
12328
12336
|
"cancelled",
|
|
@@ -12446,6 +12454,8 @@ var governedBusinessTaskEnrollmentSchema = external_exports.object({
|
|
|
12446
12454
|
}).strict();
|
|
12447
12455
|
var governedBusinessTaskWakeDispatchSchema = external_exports.object({
|
|
12448
12456
|
outboxId: external_exports.string().uuid(),
|
|
12457
|
+
prerequisiteAssignmentReceiptId: external_exports.string().uuid().nullable(),
|
|
12458
|
+
prerequisiteReleaseBindingId: external_exports.string().uuid().nullable(),
|
|
12449
12459
|
enrollmentId: external_exports.string().uuid(),
|
|
12450
12460
|
executionEpoch: external_exports.number().int().positive(),
|
|
12451
12461
|
agentId: external_exports.string().uuid(),
|
|
@@ -23549,8 +23559,8 @@ function isTerminalResultOutboxStatus(status) {
|
|
|
23549
23559
|
// src/amaster-runtime-daemon/run-completion-state.mjs
|
|
23550
23560
|
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
23561
|
import { join as join8 } from "node:path";
|
|
23552
|
-
|
|
23553
|
-
|
|
23562
|
+
|
|
23563
|
+
// src/amaster-runtime-daemon/typed/run-completion-transitions.mjs
|
|
23554
23564
|
var RUN_COMPLETION_PHASES = /* @__PURE__ */ new Set([
|
|
23555
23565
|
"executing",
|
|
23556
23566
|
"usage_snapshot_persisted",
|
|
@@ -23590,6 +23600,16 @@ var PHASE_TRANSITIONS = /* @__PURE__ */ new Map([
|
|
|
23590
23600
|
["profile_cleanup:profile_cleanup_abandoned", "result_post_pending"],
|
|
23591
23601
|
["result_post_pending:result_post_delivered", "terminal"]
|
|
23592
23602
|
]);
|
|
23603
|
+
function isRunCompletionPhase(value) {
|
|
23604
|
+
return typeof value === "string" && RUN_COMPLETION_PHASES.has(value);
|
|
23605
|
+
}
|
|
23606
|
+
function nextRunCompletionPhase(phase, event) {
|
|
23607
|
+
return PHASE_TRANSITIONS.get(`${phase}:${event}`);
|
|
23608
|
+
}
|
|
23609
|
+
|
|
23610
|
+
// src/amaster-runtime-daemon/run-completion-state.mjs
|
|
23611
|
+
var RUN_COMPLETION_STATE_VERSION = 1;
|
|
23612
|
+
var RUN_COMPLETION_USAGE_SCHEMA_VERSION = "runtime-command-usage-v1";
|
|
23593
23613
|
function record4(value) {
|
|
23594
23614
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
23595
23615
|
}
|
|
@@ -23720,7 +23740,7 @@ function appendRunCompletionUsageTurn(state, input) {
|
|
|
23720
23740
|
}
|
|
23721
23741
|
function transitionRunCompletionState(state, event, patch = {}, now = (/* @__PURE__ */ new Date()).toISOString()) {
|
|
23722
23742
|
const current = assertValidRunCompletionState(state);
|
|
23723
|
-
const nextPhase =
|
|
23743
|
+
const nextPhase = nextRunCompletionPhase(current.phase, event);
|
|
23724
23744
|
if (!nextPhase) {
|
|
23725
23745
|
throw new Error(`run_completion_state_transition_invalid:${current.phase}:${event}`);
|
|
23726
23746
|
}
|
|
@@ -23748,7 +23768,7 @@ function assertValidRunCompletionState(value) {
|
|
|
23748
23768
|
if (state.version !== RUN_COMPLETION_STATE_VERSION) throw new Error("run_completion_state_invalid:version");
|
|
23749
23769
|
const commandId = nonEmptyString(state.commandId, "commandId");
|
|
23750
23770
|
const connectorId = nonEmptyString(state.connectorId, "connectorId");
|
|
23751
|
-
if (!
|
|
23771
|
+
if (!isRunCompletionPhase(state.phase)) throw new Error("run_completion_state_invalid:phase");
|
|
23752
23772
|
const command = record4(state.command);
|
|
23753
23773
|
if (nonEmptyString(command.commandId ?? command.id, "command.commandId") !== commandId) {
|
|
23754
23774
|
throw new Error("run_completion_state_invalid:command_binding");
|
|
@@ -30361,7 +30381,7 @@ function assertRequiredTaskAttachmentMaterialized(input, materialized) {
|
|
|
30361
30381
|
}
|
|
30362
30382
|
|
|
30363
30383
|
// src/amaster-runtime-daemon.mjs
|
|
30364
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
30384
|
+
var CONNECTOR_VERSION = "0.1.1-beta.234";
|
|
30365
30385
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
30366
30386
|
var daemonRequire = createRequire(import.meta.url);
|
|
30367
30387
|
var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -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.
|
|
10
|
+
const CONNECTOR_VERSION = "0.1.1-beta.234";
|
|
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.
|
|
3
|
+
"version": "0.1.1-beta.234",
|
|
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
|
-
"
|
|
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"
|