@amaster.ai/employee-runtime-connector 0.1.1-beta.313 → 0.1.1-beta.315

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.
@@ -34508,7 +34508,7 @@ function assertRequiredTaskAttachmentMaterialized(input, materialized) {
34508
34508
  }
34509
34509
 
34510
34510
  // src/amaster-runtime-daemon.mjs
34511
- var CONNECTOR_VERSION = "0.1.1-beta.313";
34511
+ var CONNECTOR_VERSION = "0.1.1-beta.315";
34512
34512
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
34513
34513
  var daemonRequire = createRequire(import.meta.url);
34514
34514
  var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
@@ -38775,7 +38775,13 @@ async function materializeIssueAttachments(config, command, workspace) {
38775
38775
  const runtimeAuth = commandRuntimeAuth(command);
38776
38776
  const issueId = commandIssueId(command);
38777
38777
  if (!issueId || !readString(runtimeAuth.apiUrl) || !readString(runtimeAuth.apiKey)) return [];
38778
- const attachments = await runtimeApiJson(runtimeAuth, `/api/issues/${encodeURIComponent(issueId)}/attachments`);
38778
+ const authority = asRecord(requireCommandContextEnvelope(command).dynamicContext.companyInitializationAuthority);
38779
+ const query = readString(authority.initializationId) ? `?initializationId=${encodeURIComponent(authority.initializationId)}&initializationRevision=${encodeURIComponent(authority.revision)}` : "";
38780
+ const response = await runtimeApiJson(runtimeAuth, `/api/issues/${encodeURIComponent(issueId)}/attachments${query}`);
38781
+ if (query && (response?.initializationId !== authority.initializationId || response?.revision !== authority.revision || !Array.isArray(response?.attachments))) {
38782
+ throw new Error("Server did not return the requested initialization inputs");
38783
+ }
38784
+ const attachments = query ? response.attachments : response;
38779
38785
  if (!Array.isArray(attachments) || attachments.length === 0) return [];
38780
38786
  const lineageCandidatesByAttachmentId = await loadIssueAttachmentLineageCandidates(
38781
38787
  config,
@@ -38790,7 +38796,10 @@ async function materializeIssueAttachments(config, command, workspace) {
38790
38796
  for (const [index, rawAttachment] of attachments.entries()) {
38791
38797
  const attachment = asRecord(rawAttachment);
38792
38798
  const contentPath = readString(attachment.contentPath) ?? readString(attachment.downloadPath);
38793
- if (!contentPath) continue;
38799
+ if (!contentPath) {
38800
+ if (attachment.initializationInput === true) throw new Error("Initialization input has no download path");
38801
+ continue;
38802
+ }
38794
38803
  let filename = safeMaterializedAttachmentFilename(attachment, index);
38795
38804
  if (usedFilenames.has(filename)) {
38796
38805
  const ext = extname3(filename);
@@ -38800,6 +38809,9 @@ async function materializeIssueAttachments(config, command, workspace) {
38800
38809
  usedFilenames.add(filename);
38801
38810
  const targetPath = join19(targetDir, filename);
38802
38811
  const body = await runtimeApiBuffer(runtimeAuth, contentPath);
38812
+ if (attachment.initializationInput === true && (body.byteLength !== attachment.byteSize || createHash19("sha256").update(body).digest("hex") !== attachment.sha256)) {
38813
+ throw new Error("Initialization input content does not match its preparation receipt");
38814
+ }
38803
38815
  writeFileSync12(targetPath, body);
38804
38816
  const attachmentId = readString(attachment.id);
38805
38817
  const actualSha256 = createHash19("sha256").update(body).digest("hex");
@@ -39358,7 +39370,7 @@ async function executeRunCommand(config, command) {
39358
39370
  }
39359
39371
  materializedAttachments = [...requiredArtifactInputs, ...issueAttachments];
39360
39372
  } catch (err) {
39361
- if (issueAttachmentsAreRequired(command, commandTaskResourceInput(command))) throw err;
39373
+ if (issueAttachmentsAreRequired(command, commandTaskResourceInput(command)) || readString(asRecord(requireCommandContextEnvelope(command).dynamicContext.companyInitializationAuthority).initializationId)) throw err;
39362
39374
  enqueuePreparationLog("system", "warn", `Failed to materialize issue attachments: ${err instanceof Error ? err.message : String(err)}`, {
39363
39375
  error: err instanceof Error ? err.message : String(err)
39364
39376
  });
@@ -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.313";
10
+ const CONNECTOR_VERSION = "0.1.1-beta.315";
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.313",
3
+ "version": "0.1.1-beta.315",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",