@amaster.ai/employee-runtime-connector 0.1.0-beta.50 → 0.1.0-beta.52

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.
@@ -2904,9 +2904,10 @@ function removeRunCompletionState(directory, commandId) {
2904
2904
  }
2905
2905
 
2906
2906
  // src/amaster-runtime-daemon/prompt-compiler.mjs
2907
- var DEFAULT_PROMPT_BUDGET_CHARS = 32e3;
2907
+ var DEFAULT_PROMPT_BUDGET_CHARS = 2e5;
2908
2908
  var DEADLINE_POSTURE_GUARD = "Named-window:skip_this_window_and_continue; no lower-quality/approval-bypass/fabrication/whole-task-stop; deadline_posture_receipt=targetMilestoneRef,posture,onMiss,taskContinuation,next owner/action; not Server proof";
2909
2909
  var MIN_PROMPT_BUDGET_CHARS = 8192;
2910
+ var MAX_PROMPT_SECTION_JSON_CHARS = 1e5;
2910
2911
  var CONTINUATION_WAKE_PATTERN = /(continuation|continued|retry|approved|liveness|resume|max_turn)/i;
2911
2912
  var RECOVERY_WAKE_REASONS = /* @__PURE__ */ new Set([
2912
2913
  "finish_successful_run_handoff",
@@ -3155,6 +3156,35 @@ function resolvedDependencySections(context, input, contextScope, snapshotFreshn
3155
3156
  }
3156
3157
  };
3157
3158
  }
3159
+ function verifiedCompanyContextSection(context) {
3160
+ const companyContext = asRecord(context.verifiedCompanyContext);
3161
+ if (Object.keys(companyContext).length === 0) return { content: "", sourceRef: [], observedAt: [] };
3162
+ if (companyContext.schemaVersion !== "mirrorx.verified-company-context.v1") {
3163
+ throw new Error("verified_company_context_invalid: unsupported schemaVersion");
3164
+ }
3165
+ const company = asRecord(companyContext.company);
3166
+ const registration = asRecord(companyContext.registration);
3167
+ const companyId = readString(company.id);
3168
+ const companyName = readString(company.name);
3169
+ if (!companyId || !companyName) {
3170
+ throw new Error("verified_company_context_invalid: company id and name are required");
3171
+ }
3172
+ return {
3173
+ content: [
3174
+ "Use these server-snapshotted current Company facts as authoritative context for this run.",
3175
+ "The current verification contract does not supply shareholder structure or a financial baseline; treat them as unknown unless separate evidence is present, and do not describe the verified registration facts below as missing.",
3176
+ stringifyBoundedJson(companyContext, MAX_PROMPT_SECTION_JSON_CHARS)
3177
+ ].join("\n"),
3178
+ sourceRef: [
3179
+ `company:${companyId}`,
3180
+ ...readString(registration.verificationId) ? [`company_business_verification:${readString(registration.verificationId)}`] : []
3181
+ ],
3182
+ observedAt: [
3183
+ readString(companyContext.confirmedProfileObservedAt),
3184
+ readString(registration.verifiedAt)
3185
+ ].filter(Boolean)
3186
+ };
3187
+ }
3158
3188
  function fixedRules(input, includeIssueLine) {
3159
3189
  return [
3160
3190
  "## AMaster Runtime Connector Task",
@@ -3200,7 +3230,7 @@ function interactionResolutionText(context) {
3200
3230
  "Treat this resolved interaction as the authoritative delta for this run.",
3201
3231
  readString(resolution.status) === "changes_requested" ? "Apply every requested change before creating a replacement review." : "",
3202
3232
  exactDocumentRevisionDirective,
3203
- stringifyBoundedJson(resolution, 8e3)
3233
+ stringifyBoundedJson(resolution, MAX_PROMPT_SECTION_JSON_CHARS)
3204
3234
  ].filter(Boolean).join("\n");
3205
3235
  }
3206
3236
  function recoveryInstructionText(input) {
@@ -3425,6 +3455,7 @@ function compileCommandPromptWithManifest(input, options = {}) {
3425
3455
  const completeRecoveryInstruction = [recoveryInstruction, recoveryContinuationOption].filter(Boolean).join("\n\n");
3426
3456
  const suppressOrdinaryCompletionContract = completeRecoveryInstruction.length > 0;
3427
3457
  const governedReads = governedReadSection(context);
3458
+ const verifiedCompanyContext = verifiedCompanyContextSection(context);
3428
3459
  const hasTask = Boolean(readString(input.taskMarkdown));
3429
3460
  const taskText = readString(input.taskMarkdown) ?? "";
3430
3461
  const continuationSummary = continuationText(context);
@@ -3474,10 +3505,11 @@ ${resolvedDependencies.details.content}` : ""
3474
3505
  { name: "runtime_decomposition_requirement", title: "Required Task Decomposition", priority: 98, sourceRef: `issue:${input.issueId ?? "unknown"}`, content: runtimeDecompositionRequirementText(context) },
3475
3506
  ...piMcpProxyExamples ? [{ name: "pi_mcp_proxy_examples", title: "Pi MCP Proxy Examples", priority: 96, sourceRef: "amaster_governed_mcp_proxy_contract", content: piMcpProxyExamples }] : [],
3476
3507
  { name: "continuation_summary", title: "Continuation Summary", priority: 97, sourceRef: readString(asRecord(context.paperclipContinuationSummary).key) ?? `issue:${input.issueId ?? "unknown"}`, observedAt: readString(asRecord(context.paperclipContinuationSummary).updatedAt), originalContent: continuationSummary, content: mode === "cold" ? "" : continuationSummary, truncationReason: mode === "cold" ? "mode_selection" : null },
3508
+ ...verifiedCompanyContext.content ? [{ name: "verified_company_context", title: "Verified Company Context", priority: 96, sourceRef: verifiedCompanyContext.sourceRef, observedAt: verifiedCompanyContext.observedAt, freshness: { kind: "run_snapshot" }, content: verifiedCompanyContext.content }] : [],
3477
3509
  { name: "wake_comments", title: wakeDeltaTitle, priority: interactionResolution ? 99 : 95, sourceRef: wakeDeltaSourceRefs, originalContent: wakeDeltaOriginal, content: wakeDeltaContent, truncationReason: commentsSelected ? null : "duplicate_task_context" },
3478
3510
  { name: "task", title: "Task Context", priority: 90, sourceRef: `issue:${input.issueId ?? "unknown"}`, originalContent: taskText, content: includeTask ? taskText : "", truncationReason: includeTask ? null : "mode_selection" },
3479
3511
  { name: "governed_reads", title: "Governed External Reads", priority: 88, sourceRef: governedReads.provenance.map((entry) => entry.sourceRef), observedAt: governedReads.provenance.map((entry) => entry.observedAt), freshness: governedReads.provenance.map((entry) => entry.freshness), scope: governedReads.provenance.map((entry) => entry.scope), content: governedReads.content },
3480
- { name: "agent_instructions", title: "Agent Instructions", priority: 85, sourceRef: "agent_instructions_bundle", content: readString(input.agentInstructions) ?? "" },
3512
+ { name: "agent_instructions", title: "Agent Instructions", priority: 100, sourceRef: "agent_instructions_bundle", content: readString(input.agentInstructions) ?? "" },
3481
3513
  { name: "attachments", title: "Materialized Inputs", priority: 80, sourceRef: "materialized_attachments", content: readString(input.attachmentsText) ?? "" },
3482
3514
  { name: "on_demand_refs", title: "On-demand Context References", priority: 70, sourceRef: `issue:${input.issueId ?? "unknown"}`, content: onDemandRefs(input) },
3483
3515
  { name: "raw_snapshot", title: "Raw Context Snapshot", priority: 0, sourceRef: `run:${input.runId ?? "unknown"}`, originalChars: jsonCharLength(context), content: "", truncationReason: "on_demand_large_object" }
@@ -8666,13 +8698,11 @@ function createPublicNetworkScope(options = {}) {
8666
8698
  }
8667
8699
 
8668
8700
  // src/amaster-runtime-daemon.mjs
8669
- var CONNECTOR_VERSION = "0.1.0-beta.50";
8701
+ var CONNECTOR_VERSION = "0.1.0-beta.52";
8670
8702
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
8671
8703
  var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
8672
8704
  var CHECKPOINT_TTL_MS = 24 * 60 * 60 * 1e3;
8673
8705
  var PROMPT_AGENT_INSTRUCTION_FILE_ORDER = ["AGENTS.md", "SOUL.md"];
8674
- var MAX_PROMPT_AGENT_INSTRUCTION_FILE_CHARS = 12e3;
8675
- var MAX_PROMPT_AGENT_INSTRUCTIONS_CHARS = 24e3;
8676
8706
  var AMASTER_PI_PROHIBITED_EXTRA_ARGS = /* @__PURE__ */ new Set(["--no-extensions", "--no-skills", "--no-tools", "--no-session"]);
8677
8707
  var MAX_PI_CAPABILITY_SOURCE_ENTRIES = 200;
8678
8708
  var PI_COMPLETION_OUTPUT_GRACE_MS = 1e3;
@@ -9796,13 +9826,17 @@ function renderIssueLine(context) {
9796
9826
  function renderComments(context) {
9797
9827
  const wake = asRecord(context.paperclipWake);
9798
9828
  const comments = Array.isArray(wake.comments) ? wake.comments : [];
9799
- return comments.map((entry, index) => {
9829
+ const rendered = comments.map((entry, index) => {
9800
9830
  const comment = asRecord(entry);
9801
9831
  const id = readString(comment.id) ?? `comment-${index + 1}`;
9802
9832
  const body = readString(comment.body) ?? "";
9833
+ const truncatedNote = comment.bodyTruncated === true ? `
9834
+ [comment body truncated \u2014 fetch full text via typed read tool: comment:${id}]` : "";
9803
9835
  return `${index + 1}. ${id}
9804
- ${body}`;
9836
+ ${body}${truncatedNote}`;
9805
9837
  }).filter((entry) => entry.trim().length > 0).join("\n\n");
9838
+ const fallbackNote = wake.fallbackFetchNeeded === true ? "[some wake comments were truncated or omitted from this prompt \u2014 fetch full text via managed typed read tools using the comment:<id> references]" : "";
9839
+ return [rendered, fallbackNote].filter(Boolean).join("\n\n");
9806
9840
  }
9807
9841
  function renderTaskMarkdown(context) {
9808
9842
  return readString(context.paperclipTaskMarkdown);
@@ -9830,16 +9864,10 @@ function normalizeAgentInstructionsFiles(bundle) {
9830
9864
  function renderAgentInstructionsBundle(bundle) {
9831
9865
  const files = normalizeAgentInstructionsFiles(asRecord(bundle));
9832
9866
  if (files.length === 0) return "";
9833
- const parts = ["Current agent instructions:"];
9834
- let used = parts[0].length;
9835
- for (const file of files) {
9836
- const content = truncateText(file.content, MAX_PROMPT_AGENT_INSTRUCTION_FILE_CHARS);
9837
- const section = [`### ${file.path}`, content].join("\n");
9838
- if (used + section.length > MAX_PROMPT_AGENT_INSTRUCTIONS_CHARS) break;
9839
- parts.push(section);
9840
- used += section.length;
9841
- }
9842
- return parts.length > 1 ? parts.join("\n\n") : "";
9867
+ return [
9868
+ "Current agent instructions:",
9869
+ ...files.map((file) => [`### ${file.path}`, file.content].join("\n"))
9870
+ ].join("\n\n");
9843
9871
  }
9844
9872
  function commandRuntimeAuth(command) {
9845
9873
  const topLevel = asRecord(command.runtimeAuth);
@@ -5,7 +5,7 @@ import { dirname, join, resolve } from "node:path";
5
5
  import { homedir, hostname } from "node:os";
6
6
  import { fileURLToPath } from "node:url";
7
7
 
8
- const CONNECTOR_VERSION = "0.1.0-beta.50";
8
+ const CONNECTOR_VERSION = "0.1.0-beta.52";
9
9
 
10
10
  const CAPABILITIES = [
11
11
  "remote_registration",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/employee-runtime-connector",
3
- "version": "0.1.0-beta.50",
3
+ "version": "0.1.0-beta.52",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",