@amaster.ai/employee-runtime-connector 0.1.1-beta.120 → 0.1.1-beta.122

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.
@@ -9056,6 +9056,8 @@ var issueExecutionStageSchema = external_exports.object({
9056
9056
  participants: external_exports.array(issueExecutionStageParticipantSchema).default([])
9057
9057
  });
9058
9058
  var issueExecutionMonitorPolicySchema = external_exports.object({
9059
+ effectId: external_exports.string().uuid().optional().nullable().default(null),
9060
+ executionEpoch: external_exports.number().int().positive().optional().nullable().default(null),
9059
9061
  nextCheckAt: external_exports.string().datetime(),
9060
9062
  notes: external_exports.string().max(500).optional().nullable().default(null),
9061
9063
  scheduledBy: external_exports.enum(ISSUE_MONITOR_SCHEDULED_BY).optional().default("assignee"),
@@ -9322,7 +9324,8 @@ var externalWaitSnoozeSchema = external_exports.object({
9322
9324
  var upsertIssueExternalWaitSchema = external_exports.object({
9323
9325
  ownerType: external_exports.enum(["external", "user"]),
9324
9326
  actionKind: external_exports.enum(["approval", "input", "dependency", "other"]),
9325
- reasonCode: external_exports.string().trim().min(1).max(120)
9327
+ reasonCode: external_exports.string().trim().min(1).max(120),
9328
+ reviewAt: external_exports.string().datetime().nullable().optional()
9326
9329
  }).strict();
9327
9330
  var resolveIssueExternalWaitSchema = external_exports.object({
9328
9331
  outcome: external_exports.enum(["completed", "cannot_complete", "external_input_change"]),
@@ -9705,7 +9708,8 @@ var chooseTaskDispositionOptionSchema = external_exports.object({
9705
9708
  ownerType: external_exports.enum(["external", "user"]),
9706
9709
  actionKind: external_exports.enum(["approval", "input", "dependency", "other"]),
9707
9710
  reasonCode: external_exports.string().trim().min(1).max(120).regex(/^[a-z][a-z0-9_]*$/),
9708
- resolutionCondition: external_exports.string().trim().min(1).max(1e3)
9711
+ resolutionCondition: external_exports.string().trim().min(1).max(1e3),
9712
+ reviewAt: external_exports.string().datetime({ offset: true }).optional()
9709
9713
  }).strict().optional(),
9710
9714
  monitor: external_exports.object({
9711
9715
  checkAfterMinutes: external_exports.number().int().min(5).max(90 * 24 * 60),
@@ -9751,6 +9755,8 @@ var chooseTaskDispositionResultSchema = external_exports.object({
9751
9755
  issueId: external_exports.string().uuid(),
9752
9756
  effectId: external_exports.string().uuid(),
9753
9757
  materializedAt: external_exports.string().datetime({ offset: true }),
9758
+ executionEpoch: external_exports.number().int().positive(),
9759
+ reviewAt: external_exports.string().datetime({ offset: true }).nullable().optional(),
9754
9760
  nextCheckAt: external_exports.string().datetime({ offset: true }).nullable().optional()
9755
9761
  }).strict()
9756
9762
  }).strict();
@@ -17358,14 +17364,16 @@ function reconcileManagedCodexMcpProfiles(rootPath, options = {}) {
17358
17364
  }
17359
17365
 
17360
17366
  // src/amaster-runtime-daemon/pi-managed-mcp-profile.mjs
17361
- import { createHash as createHash4 } from "node:crypto";
17367
+ import { createHash as createHash5 } from "node:crypto";
17362
17368
  import {
17363
17369
  chmodSync as chmodSync4,
17364
17370
  chownSync as chownSync2,
17371
+ closeSync,
17365
17372
  copyFileSync,
17366
17373
  existsSync as existsSync4,
17367
17374
  lstatSync as lstatSync3,
17368
17375
  mkdirSync as mkdirSync3,
17376
+ openSync,
17369
17377
  readFileSync as readFileSync5,
17370
17378
  realpathSync as realpathSync3,
17371
17379
  readdirSync as readdirSync3,
@@ -18732,6 +18740,97 @@ export default function amasterRoleSkillsVisibility(pi) {
18732
18740
  `;
18733
18741
  }
18734
18742
 
18743
+ // src/amaster-runtime-daemon/source-acquisition-invocation.mjs
18744
+ import { createHash as createHash4 } from "node:crypto";
18745
+ var SOURCE_ACQUISITION_PUBLIC_TOOLS2 = Object.freeze([
18746
+ "source_open",
18747
+ "source_snapshot",
18748
+ "source_screenshot",
18749
+ "source_analyze_screenshot",
18750
+ "source_wait",
18751
+ "runtime_action.submit",
18752
+ "runtime_action.status"
18753
+ ]);
18754
+ var SOURCE_ACQUISITION_AUTHENTICATED_TOOLS2 = SOURCE_ACQUISITION_PUBLIC_TOOLS2;
18755
+ var SOURCE_ACQUISITION_PI_EFFECTIVE_TOOLS = Object.freeze([
18756
+ "source_open",
18757
+ "source_snapshot",
18758
+ "source_screenshot",
18759
+ "source_analyze_screenshot",
18760
+ "source_wait",
18761
+ "runtime_action_submit",
18762
+ "runtime_action_status"
18763
+ ]);
18764
+ function exactToolsFor(profile) {
18765
+ if (profile?.access?.mode === "public") return SOURCE_ACQUISITION_PUBLIC_TOOLS2;
18766
+ if (profile?.access?.mode === "authenticated") return SOURCE_ACQUISITION_AUTHENTICATED_TOOLS2;
18767
+ throw new Error("source_acquisition_invocation_invalid");
18768
+ }
18769
+ function sourceAcquisitionPiInvocationArgs(profile) {
18770
+ const expected = exactToolsFor(profile);
18771
+ const actual = profile?.tools?.exactAllowlist;
18772
+ if (!Array.isArray(actual) || actual.length !== expected.length || actual.some((tool, index) => tool !== expected[index])) {
18773
+ throw new Error("source_acquisition_tool_allowlist_invalid");
18774
+ }
18775
+ return [
18776
+ "--tools",
18777
+ SOURCE_ACQUISITION_PI_EFFECTIVE_TOOLS.join(","),
18778
+ "--no-builtin-tools",
18779
+ "--no-skills",
18780
+ "--no-context-files",
18781
+ "--no-prompt-templates",
18782
+ "--no-session"
18783
+ ];
18784
+ }
18785
+ function serializeSourceAcquisitionProfile(profile) {
18786
+ if (!profile || typeof profile !== "object" || Array.isArray(profile)) return null;
18787
+ const canonicalize = (value) => {
18788
+ if (value === null || typeof value === "boolean" || typeof value === "string") {
18789
+ return JSON.stringify(value);
18790
+ }
18791
+ if (typeof value === "number" && Number.isFinite(value)) return JSON.stringify(value);
18792
+ if (Array.isArray(value)) return `[${value.map(canonicalize).join(",")}]`;
18793
+ if (value && typeof value === "object") {
18794
+ return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalize(value[key])}`).join(",")}}`;
18795
+ }
18796
+ throw new Error("source_acquisition_profile_canonicalization_failed");
18797
+ };
18798
+ const input = Buffer.from(canonicalize(profile), "utf8");
18799
+ return {
18800
+ input,
18801
+ sha256: createHash4("sha256").update(input).digest("hex")
18802
+ };
18803
+ }
18804
+ function sourceAcquisitionManagedInputs(options) {
18805
+ return [
18806
+ options.sourceProfileInput ? { fd: 4, input: options.sourceProfileInput, code: "source_acquisition_profile" } : null
18807
+ ].filter(Boolean);
18808
+ }
18809
+ function sourceAcquisitionManagedStdio(inputs) {
18810
+ const stdio = ["pipe", "pipe", "pipe"];
18811
+ for (const { fd } of inputs) {
18812
+ while (stdio.length <= fd) stdio.push("ignore");
18813
+ stdio[fd] = "pipe";
18814
+ }
18815
+ return stdio;
18816
+ }
18817
+ function deliverSourceAcquisitionManagedInputs(child, inputs, onError) {
18818
+ for (const { fd, input, code } of inputs) {
18819
+ child.stdio[fd].once("error", (error) => onError(code, error));
18820
+ child.stdio[fd].end(input);
18821
+ }
18822
+ }
18823
+ function assertSourceAcquisitionRuntimeAuthority({
18824
+ profile,
18825
+ executorKind,
18826
+ governedMcp
18827
+ }) {
18828
+ if (!profile) return;
18829
+ if (executorKind !== "pi" || !governedMcp || typeof governedMcp !== "object" || Object.keys(governedMcp).length === 0) {
18830
+ throw new Error("source_acquisition_governed_profile_required");
18831
+ }
18832
+ }
18833
+
18735
18834
  // src/amaster-runtime-daemon/pi-managed-mcp-profile.mjs
18736
18835
  var MANAGED_PI_MCP_TOOL_MODE = "proxy_only";
18737
18836
  var MANAGED_PI_DIRECT_TYPED_MCP_TOOL_MODE = "direct_typed";
@@ -19011,7 +19110,7 @@ function createManagedPiMcpProfileApi(options = {}) {
19011
19110
  nonEmpty2(session.invocationId, "nativeSession.invocationId");
19012
19111
  const sourceWorkspacePath = nonEmpty2(session.cwd, "nativeSession.cwd");
19013
19112
  const issueRoot = dirname4(runDir);
19014
- const managedSourceRunDirName = `${sourceRunId}-${createHash4("sha256").update(sourceRunId).digest("hex").slice(0, 8)}`;
19113
+ const managedSourceRunDirName = `${sourceRunId}-${createHash5("sha256").update(sourceRunId).digest("hex").slice(0, 8)}`;
19015
19114
  const sourceRunDirs = readdirSync3(issueRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && !entry.isSymbolicLink() && (entry.name === sourceRunId || entry.name === managedSourceRunDirName)).map((entry) => join5(issueRoot, entry.name));
19016
19115
  if (sourceRunDirs.length !== 1) {
19017
19116
  throw new Error(`pi_managed_mcp_session_rollout_missing: expected one source run directory for ${sourceRunId}, received ${sourceRunDirs.length}`);
@@ -19057,12 +19156,12 @@ function createManagedPiMcpProfileApi(options = {}) {
19057
19156
  return value;
19058
19157
  }
19059
19158
  function sha2563(value) {
19060
- return createHash4("sha256").update(value).digest("hex");
19159
+ return createHash5("sha256").update(value).digest("hex");
19061
19160
  }
19062
19161
  function trustedTreeDigest(rootPath, options2 = {}) {
19063
19162
  const root = resolve3(rootPath);
19064
19163
  const ignoredRootEntries = new Set(Array.isArray(options2.ignoredRootEntries) ? options2.ignoredRootEntries : []);
19065
- const hash = createHash4("sha256");
19164
+ const hash = createHash5("sha256");
19066
19165
  hash.update(`ignored-root:${[...ignoredRootEntries].sort().join(",")}
19067
19166
  `);
19068
19167
  const pending = [root];
@@ -19394,8 +19493,8 @@ function createManagedPiMcpProfileApi(options = {}) {
19394
19493
  if (!executableStat.isFile() || executableStat.isSymbolicLink()) {
19395
19494
  throw Object.assign(new Error("Pi executable is not a regular file"), { code: "EUNSAFE" });
19396
19495
  }
19397
- const contentSha256 = createHash4("sha256").update(readFileSync5(realPath)).digest("hex");
19398
- return `sha256:${createHash4("sha256").update(JSON.stringify({ realPath, contentSha256 })).digest("hex")}`;
19496
+ const contentSha256 = createHash5("sha256").update(readFileSync5(realPath)).digest("hex");
19497
+ return `sha256:${createHash5("sha256").update(JSON.stringify({ realPath, contentSha256 })).digest("hex")}`;
19399
19498
  } catch (error) {
19400
19499
  const errorCode = typeof error?.code === "string" ? error.code : "UNKNOWN";
19401
19500
  throw new Error(`pi_managed_mcp_attestation_failed: --version error=${errorCode}`);
@@ -19738,7 +19837,7 @@ function createManagedPiMcpProfileApi(options = {}) {
19738
19837
  if (skillProfiles.length === 0) return {};
19739
19838
  return {
19740
19839
  skillProfiles,
19741
- enabledSkillsDigest: createHash4("sha256").update(JSON.stringify(enabledSkills)).digest("hex"),
19840
+ enabledSkillsDigest: createHash5("sha256").update(JSON.stringify(enabledSkills)).digest("hex"),
19742
19841
  enabledSkillMetadataBytes,
19743
19842
  enabledSkillMetadataSha256
19744
19843
  };
@@ -19902,30 +20001,37 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
19902
20001
  completedAttempts = attempt;
19903
20002
  writeEffectiveToolsProbePhase(input.phasePath, "spawned", attempt);
19904
20003
  const resolvedExecutorCommand = resolveExecutorCommand(executorCommand, env) ?? executorCommand;
19905
- result3 = spawnSyncImpl(resolvedExecutorCommand, [
19906
- "--no-session",
19907
- "--no-approve",
19908
- "--no-skills",
19909
- "--no-context-files",
19910
- // The enforcement extensions live in the run profile, not an agent dir,
19911
- // so the probe must load them explicitly to measure the real run surface.
19912
- ...Array.isArray(input.extensionArgs) ? input.extensionArgs : [],
19913
- "--print",
19914
- "probe effective tools"
19915
- ], {
19916
- cwd: env.AMASTER_RUNTIME_EXECUTION_WORKDIR,
19917
- env: {
19918
- ...env,
19919
- AMASTER_PI_EFFECTIVE_TOOLS_MODE: "probe",
19920
- AMASTER_PI_EFFECTIVE_TOOLS_ATTEMPT: String(attempt)
19921
- },
19922
- encoding: "utf8",
19923
- timeout,
19924
- killSignal: "SIGKILL",
19925
- maxBuffer: 1024 * 1024,
19926
- ...isWindowsCommandShim(resolvedExecutorCommand) ? { shell: true } : {},
19927
- ...spawnIdentity ?? {}
19928
- });
20004
+ let sourceProfileFd = null;
20005
+ try {
20006
+ sourceProfileFd = input.sourceProfilePath ? openSync(input.sourceProfilePath, "r") : null;
20007
+ result3 = spawnSyncImpl(resolvedExecutorCommand, [
20008
+ "--no-session",
20009
+ "--no-approve",
20010
+ "--no-skills",
20011
+ "--no-context-files",
20012
+ // The enforcement extensions live in the run profile, not an agent dir,
20013
+ // so the probe must load them explicitly to measure the real run surface.
20014
+ ...Array.isArray(input.extensionArgs) ? input.extensionArgs : [],
20015
+ "--print",
20016
+ "probe effective tools"
20017
+ ], {
20018
+ cwd: env.AMASTER_RUNTIME_EXECUTION_WORKDIR,
20019
+ env: {
20020
+ ...env,
20021
+ AMASTER_PI_EFFECTIVE_TOOLS_MODE: "probe",
20022
+ AMASTER_PI_EFFECTIVE_TOOLS_ATTEMPT: String(attempt)
20023
+ },
20024
+ ...sourceProfileFd === null ? {} : { stdio: ["ignore", "pipe", "pipe", "ignore", sourceProfileFd] },
20025
+ encoding: "utf8",
20026
+ timeout,
20027
+ killSignal: "SIGKILL",
20028
+ maxBuffer: 1024 * 1024,
20029
+ ...isWindowsCommandShim(resolvedExecutorCommand) ? { shell: true } : {},
20030
+ ...spawnIdentity ?? {}
20031
+ });
20032
+ } finally {
20033
+ if (sourceProfileFd !== null) closeSync(sourceProfileFd);
20034
+ }
19929
20035
  if (result3.error?.code === "ETIMEDOUT" && attempt < attempts.length) continue;
19930
20036
  break;
19931
20037
  }
@@ -20121,6 +20227,11 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
20121
20227
  if (sourceExecutionReceiptPath) {
20122
20228
  createSourceAcquisitionExecutionReceipt(sourceExecutionReceiptPath, sourceExecutionIdentity);
20123
20229
  }
20230
+ const serializedSourceProfile = input.sourceAcquisition ? serializeSourceAcquisitionProfile(input.sourceAcquisition.profile) : null;
20231
+ const sourceAttestationProfilePath = serializedSourceProfile && directCatalog ? join5(tmp, "source-acquisition-attestation-profile.json") : null;
20232
+ if (sourceAttestationProfilePath) {
20233
+ writePrivateFile2(sourceAttestationProfilePath, serializedSourceProfile.input);
20234
+ }
20124
20235
  const adapterVersion = piMcpAdapterVersion(sharedRuntime.home);
20125
20236
  if (directCatalog) {
20126
20237
  writeProfileExtension(
@@ -20249,7 +20360,8 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
20249
20360
  extensionArgs: [...extensionArgs],
20250
20361
  finalActiveToolNames: effectiveRunToolAllowlist,
20251
20362
  profileToolAllowlist: null,
20252
- closureProfile
20363
+ closureProfile,
20364
+ ...sourceAttestationProfilePath ? { sourceProfilePath: sourceAttestationProfilePath } : {}
20253
20365
  };
20254
20366
  }
20255
20367
  let enabledRoleSkills = null;
@@ -20287,6 +20399,10 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
20287
20399
  ...sourceExecutionReceiptPath ? {
20288
20400
  AMASTER_SOURCE_ACQUISITION_EXECUTION_RECEIPT: sourceExecutionReceiptPath
20289
20401
  } : {},
20402
+ ...serializedSourceProfile ? {
20403
+ AMASTER_SOURCE_ACQUISITION_PROFILE_FD: "4",
20404
+ AMASTER_SOURCE_ACQUISITION_PROFILE_SHA256: serializedSourceProfile.sha256
20405
+ } : {},
20290
20406
  ...input.sourceAcquisition ? sourceAcquisitionBrowserEnvironment(input.sourceAcquisition, input.baseEnv) : {}
20291
20407
  };
20292
20408
  if (directAttestationInput) {
@@ -20313,6 +20429,9 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
20313
20429
  spawnIdentity,
20314
20430
  effectiveToolsBootstrapCache?.key ?? null
20315
20431
  ) : {};
20432
+ if (directAttestationInput?.sourceProfilePath) {
20433
+ rmSync3(directAttestationInput.sourceProfilePath, { force: true });
20434
+ }
20316
20435
  const effectiveToolProbeBootstrapCache = effectiveToolsBootstrapCache ? publishEffectiveToolsBootstrapCache(effectiveToolsBootstrapCache) : null;
20317
20436
  const runExitClosureOwnership = directAttestationInput ? {
20318
20437
  cache: ownershipStatSyncImpl(directAttestationInput.cachePath),
@@ -20399,7 +20518,7 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
20399
20518
  ])],
20400
20519
  attestation: {
20401
20520
  ...attestationFacts,
20402
- attestationId: createHash4("sha256").update(JSON.stringify(attestationFacts)).digest("hex"),
20521
+ attestationId: createHash5("sha256").update(JSON.stringify(attestationFacts)).digest("hex"),
20403
20522
  attestedAt: (/* @__PURE__ */ new Date()).toISOString()
20404
20523
  }
20405
20524
  };
@@ -20677,7 +20796,7 @@ ${result3.stderr ?? ""}`, "Pi", MINIMUM_PI_VERSION);
20677
20796
  protectedValues: [.../* @__PURE__ */ new Set([sessionToken, ...seededRuntime.protectedValues])],
20678
20797
  attestation: {
20679
20798
  ...attestationFacts,
20680
- attestationId: createHash4("sha256").update(JSON.stringify(attestationFacts)).digest("hex"),
20799
+ attestationId: createHash5("sha256").update(JSON.stringify(attestationFacts)).digest("hex"),
20681
20800
  attestedAt: (/* @__PURE__ */ new Date()).toISOString()
20682
20801
  }
20683
20802
  };
@@ -21375,7 +21494,7 @@ function inspectSourceAcquisitionProfile(profile, expectedRunId) {
21375
21494
  import { createHash as createHash7 } from "node:crypto";
21376
21495
 
21377
21496
  // src/amaster-runtime-daemon/current-run-contract.mjs
21378
- import { createHash as createHash5 } from "node:crypto";
21497
+ import { createHash as createHash6 } from "node:crypto";
21379
21498
  var CONTRACT_VERSION = "mirrorx.current-run-contract.v1";
21380
21499
  var REQUIRED_ACTIONS = [
21381
21500
  "amaster.read_issue_delivery",
@@ -21407,7 +21526,7 @@ function canonicalJson(value) {
21407
21526
  }
21408
21527
  function semanticHash(contract) {
21409
21528
  const { contractHash: _contractHash, compiledAt: _compiledAt, ...semantic } = contract;
21410
- return `sha256:${createHash5("sha256").update(canonicalJson(semantic)).digest("hex")}`;
21529
+ return `sha256:${createHash6("sha256").update(canonicalJson(semantic)).digest("hex")}`;
21411
21530
  }
21412
21531
  function validateBlockingGaps(value) {
21413
21532
  return Array.isArray(value) && value.length === 0;
@@ -21568,97 +21687,6 @@ function resolveTaskCompanyKnowledgePolicy(context) {
21568
21687
  };
21569
21688
  }
21570
21689
 
21571
- // src/amaster-runtime-daemon/source-acquisition-invocation.mjs
21572
- import { createHash as createHash6 } from "node:crypto";
21573
- var SOURCE_ACQUISITION_PUBLIC_TOOLS2 = Object.freeze([
21574
- "source_open",
21575
- "source_snapshot",
21576
- "source_screenshot",
21577
- "source_analyze_screenshot",
21578
- "source_wait",
21579
- "runtime_action.submit",
21580
- "runtime_action.status"
21581
- ]);
21582
- var SOURCE_ACQUISITION_AUTHENTICATED_TOOLS2 = SOURCE_ACQUISITION_PUBLIC_TOOLS2;
21583
- var SOURCE_ACQUISITION_PI_EFFECTIVE_TOOLS = Object.freeze([
21584
- "source_open",
21585
- "source_snapshot",
21586
- "source_screenshot",
21587
- "source_analyze_screenshot",
21588
- "source_wait",
21589
- "runtime_action_submit",
21590
- "runtime_action_status"
21591
- ]);
21592
- function exactToolsFor(profile) {
21593
- if (profile?.access?.mode === "public") return SOURCE_ACQUISITION_PUBLIC_TOOLS2;
21594
- if (profile?.access?.mode === "authenticated") return SOURCE_ACQUISITION_AUTHENTICATED_TOOLS2;
21595
- throw new Error("source_acquisition_invocation_invalid");
21596
- }
21597
- function sourceAcquisitionPiInvocationArgs(profile) {
21598
- const expected = exactToolsFor(profile);
21599
- const actual = profile?.tools?.exactAllowlist;
21600
- if (!Array.isArray(actual) || actual.length !== expected.length || actual.some((tool, index) => tool !== expected[index])) {
21601
- throw new Error("source_acquisition_tool_allowlist_invalid");
21602
- }
21603
- return [
21604
- "--tools",
21605
- SOURCE_ACQUISITION_PI_EFFECTIVE_TOOLS.join(","),
21606
- "--no-builtin-tools",
21607
- "--no-skills",
21608
- "--no-context-files",
21609
- "--no-prompt-templates",
21610
- "--no-session"
21611
- ];
21612
- }
21613
- function serializeSourceAcquisitionProfile(profile) {
21614
- if (!profile || typeof profile !== "object" || Array.isArray(profile)) return null;
21615
- const canonicalize = (value) => {
21616
- if (value === null || typeof value === "boolean" || typeof value === "string") {
21617
- return JSON.stringify(value);
21618
- }
21619
- if (typeof value === "number" && Number.isFinite(value)) return JSON.stringify(value);
21620
- if (Array.isArray(value)) return `[${value.map(canonicalize).join(",")}]`;
21621
- if (value && typeof value === "object") {
21622
- return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${canonicalize(value[key])}`).join(",")}}`;
21623
- }
21624
- throw new Error("source_acquisition_profile_canonicalization_failed");
21625
- };
21626
- const input = Buffer.from(canonicalize(profile), "utf8");
21627
- return {
21628
- input,
21629
- sha256: createHash6("sha256").update(input).digest("hex")
21630
- };
21631
- }
21632
- function sourceAcquisitionManagedInputs(options) {
21633
- return [
21634
- options.sourceProfileInput ? { fd: 4, input: options.sourceProfileInput, code: "source_acquisition_profile" } : null
21635
- ].filter(Boolean);
21636
- }
21637
- function sourceAcquisitionManagedStdio(inputs) {
21638
- const stdio = ["pipe", "pipe", "pipe"];
21639
- for (const { fd } of inputs) {
21640
- while (stdio.length <= fd) stdio.push("ignore");
21641
- stdio[fd] = "pipe";
21642
- }
21643
- return stdio;
21644
- }
21645
- function deliverSourceAcquisitionManagedInputs(child, inputs, onError) {
21646
- for (const { fd, input, code } of inputs) {
21647
- child.stdio[fd].once("error", (error) => onError(code, error));
21648
- child.stdio[fd].end(input);
21649
- }
21650
- }
21651
- function assertSourceAcquisitionRuntimeAuthority({
21652
- profile,
21653
- executorKind,
21654
- governedMcp
21655
- }) {
21656
- if (!profile) return;
21657
- if (executorKind !== "pi" || !governedMcp || typeof governedMcp !== "object" || Object.keys(governedMcp).length === 0) {
21658
- throw new Error("source_acquisition_governed_profile_required");
21659
- }
21660
- }
21661
-
21662
21690
  // src/amaster-runtime-daemon/prompt-compiler.mjs
21663
21691
  var DEADLINE_POSTURE_GUARD = "If a named time window or milestone is missed, skip that window and keep the task moving: never lower quality, bypass approvals, fabricate results, or stop the whole task because of the miss. Record a deadline-posture receipt with targetMilestoneRef, posture, onMiss=skip_this_window_and_continue, taskContinuation, and the next owner/action; the receipt is an execution signal, not Server-side proof.";
21664
21692
  var MIN_PROMPT_BUDGET_CHARS = 8192;
@@ -25672,7 +25700,7 @@ var bestEffortPostJson = bestEffortPostRuntimeConnectorJson;
25672
25700
 
25673
25701
  // src/amaster-runtime-daemon/runtime-artifact-upload.mjs
25674
25702
  import { createHash as createHash9 } from "node:crypto";
25675
- import { closeSync, constants, fstatSync, lstatSync as lstatSync5, openSync, readFileSync as readFileSync10, realpathSync as realpathSync4 } from "node:fs";
25703
+ import { closeSync as closeSync2, constants, fstatSync, lstatSync as lstatSync5, openSync as openSync2, readFileSync as readFileSync10, realpathSync as realpathSync4 } from "node:fs";
25676
25704
  import { isAbsolute as isAbsolute5, relative as relative4, resolve as resolve5 } from "node:path";
25677
25705
  var SHA256_PATTERN3 = /^[a-f0-9]{64}$/;
25678
25706
  function requiredString(value, name) {
@@ -25700,7 +25728,7 @@ function readOwnedWorkspaceFile(rootPath, sourceRelativePath, label = "Runtime w
25700
25728
  throw new Error(`${label} source is not an owned regular file`);
25701
25729
  }
25702
25730
  const noFollow = typeof constants.O_NOFOLLOW === "number" ? constants.O_NOFOLLOW : 0;
25703
- const descriptor = openSync(sourcePath, constants.O_RDONLY | noFollow);
25731
+ const descriptor = openSync2(sourcePath, constants.O_RDONLY | noFollow);
25704
25732
  try {
25705
25733
  const before = fstatSync(descriptor);
25706
25734
  if (!before.isFile() || !sameFileSnapshot(pathStat, before)) {
@@ -25733,7 +25761,7 @@ function readOwnedWorkspaceFile(rootPath, sourceRelativePath, label = "Runtime w
25733
25761
  }
25734
25762
  return { body, relativePath, stat: after };
25735
25763
  } finally {
25736
- closeSync(descriptor);
25764
+ closeSync2(descriptor);
25737
25765
  }
25738
25766
  }
25739
25767
  function prepareRuntimeArtifactUploads(cwd, mcpToolResults) {
@@ -28379,7 +28407,7 @@ function createSourceCompletionStopPolicy({
28379
28407
  }
28380
28408
 
28381
28409
  // src/amaster-runtime-daemon.mjs
28382
- var CONNECTOR_VERSION = "0.1.1-beta.120";
28410
+ var CONNECTOR_VERSION = "0.1.1-beta.122";
28383
28411
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
28384
28412
  var SOURCE_ACQUISITION_CAPABILITY2 = source_acquisition_compatibility_default.profileVersion;
28385
28413
  var daemonRequire = createRequire(import.meta.url);
@@ -6,7 +6,7 @@ import { basename, dirname, join, resolve } from "node:path";
6
6
  import { homedir, hostname } from "node:os";
7
7
  import { fileURLToPath } from "node:url";
8
8
 
9
- const CONNECTOR_VERSION = "0.1.1-beta.120";
9
+ const CONNECTOR_VERSION = "0.1.1-beta.122";
10
10
 
11
11
  const CAPABILITIES = [
12
12
  "remote_registration",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/employee-runtime-connector",
3
- "version": "0.1.1-beta.120",
3
+ "version": "0.1.1-beta.122",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",