@amaster.ai/employee-runtime-connector 0.1.1-beta.321 → 0.1.1-beta.323

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.
@@ -9173,7 +9173,7 @@ var goalCriteriaProgressReadModelSchema = external_exports.object({
9173
9173
  items: external_exports.array(goalCriterionProgressReadModelSchema),
9174
9174
  completion: goalCompletionSummarySchema
9175
9175
  }).strict();
9176
- var DEFAULT_CONTINUE_PROGRESS_RATIONALE = "Board \u786E\u8BA4\u5F53\u524D\u4E1A\u52A1\u7ED3\u679C\u5C1A\u672A\u8FBE\u5230\uFF0C\u7EE7\u7EED\u63A8\u8FDB\u3002";
9176
+ var DEFAULT_CONTINUE_PROGRESS_RATIONALE = "\u516C\u53F8\u7BA1\u7406\u5458\u786E\u8BA4\u5F53\u524D\u4E1A\u52A1\u7ED3\u679C\u5C1A\u672A\u8FBE\u5230\uFF0C\u7EE7\u7EED\u63A8\u8FDB\u3002";
9177
9177
  var DEFAULT_KEEP_IN_GOAL_RATIONALE = "\u516C\u53F8\u8D1F\u8D23\u4EBA\u786E\u8BA4\u8FD9\u6761\u8FBE\u6210\u6807\u51C6\u4ECD\u9002\u7528\u4E8E\u5F53\u524D\u76EE\u6807\u3002";
9178
9178
  var DEFAULT_DEFER_GOAL_CRITERION_RATIONALE = "\u516C\u53F8\u8D1F\u8D23\u4EBA\u8BBE\u7F6E\u4E86\u4E0B\u6B21\u786E\u8BA4\u65F6\u95F4\u3002";
9179
9179
  var boardDecideGoalCriterionBaseSchema = external_exports.object({
@@ -34154,7 +34154,7 @@ function assertRequiredTaskAttachmentMaterialized(input, materialized) {
34154
34154
  }
34155
34155
 
34156
34156
  // src/amaster-runtime-daemon.mjs
34157
- var CONNECTOR_VERSION = "0.1.1-beta.321";
34157
+ var CONNECTOR_VERSION = "0.1.1-beta.323";
34158
34158
  var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
34159
34159
  var daemonRequire = createRequire(import.meta.url);
34160
34160
  var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
@@ -34859,6 +34859,33 @@ function handoffPiRunPathsToChild(config, paths) {
34859
34859
  makePiRunPathWritable(path, ownership.uid, ownership.gid);
34860
34860
  }
34861
34861
  }
34862
+ function materializePiRuntimeSystemPrompt(config, promptRoot, commandId, contents) {
34863
+ const normalizedCommandId = readString(commandId);
34864
+ if (!normalizedCommandId) throw new Error("pi_runtime_system_prompt_command_id_missing");
34865
+ const promptIdentity = createHash19("sha256").update(normalizedCommandId).digest("hex");
34866
+ const promptDir = join19(promptRoot, "tmp");
34867
+ mkdirSync10(promptDir, { recursive: true, mode: 448 });
34868
+ const promptDirStat = lstatSync12(promptDir);
34869
+ if (!promptDirStat.isDirectory() || promptDirStat.isSymbolicLink()) {
34870
+ throw new Error("pi_runtime_system_prompt_directory_invalid");
34871
+ }
34872
+ chmodSync8(promptDir, 448);
34873
+ const promptPath = join19(promptDir, `runtime-system-${promptIdentity}.md`);
34874
+ const temporaryPath = join19(promptDir, `.runtime-system.${process.pid}.${randomUUID()}.tmp`);
34875
+ try {
34876
+ writeFileSync12(temporaryPath, contents, { encoding: "utf8", mode: 384, flag: "wx" });
34877
+ renameSync10(temporaryPath, promptPath);
34878
+ chmodSync8(promptPath, 384);
34879
+ const promptMode = statSync13(promptPath).mode & 511;
34880
+ if (promptMode !== 384) {
34881
+ throw new Error(`pi_runtime_system_prompt_permissions_failed: mode=${promptMode.toString(8)}`);
34882
+ }
34883
+ } finally {
34884
+ rmSync10(temporaryPath, { force: true });
34885
+ }
34886
+ handoffPiRunPathsToChild(config, [promptDir, promptPath]);
34887
+ return promptPath;
34888
+ }
34862
34889
  function writeLocalRuntimeStatus(config, runtimeStatus) {
34863
34890
  const currentState = readState(process.env);
34864
34891
  writeState(process.env, {
@@ -39030,6 +39057,7 @@ async function executeRunCommand(config, command) {
39030
39057
  let managedMcpProfile = null;
39031
39058
  let managedMcpCleanup = null;
39032
39059
  let cleanupManagedMcpProfile = null;
39060
+ let piRuntimeSystemPromptCleanupPath = null;
39033
39061
  let piExecutorIdentity = null;
39034
39062
  const providerProtectedValues = [];
39035
39063
  let piResolvedProviderConfig = null;
@@ -39346,14 +39374,8 @@ async function executeRunCommand(config, command) {
39346
39374
  const appendedSystemPrompt = readString(promptCompilation.systemPrompt);
39347
39375
  if (executor.kind === "pi" && appendedSystemPrompt) {
39348
39376
  const promptRoot = managedMcpProfile?.profileRoot ?? workspace.executorHome;
39349
- const promptDir = join19(promptRoot, "tmp");
39350
- mkdirSync10(promptDir, { recursive: true, mode: 448 });
39351
- const promptPath = join19(
39352
- promptDir,
39353
- `runtime-system-${createHash19("sha256").update(command.commandId, "utf8").digest("hex")}.md`
39354
- );
39355
- writeFileSync12(promptPath, appendedSystemPrompt, { encoding: "utf8", mode: 384, flag: "wx" });
39356
- handoffPiRunPathsToChild(config, [promptDir, promptPath]);
39377
+ const promptPath = materializePiRuntimeSystemPrompt(config, promptRoot, command.commandId, appendedSystemPrompt);
39378
+ if (!managedMcpProfile) piRuntimeSystemPromptCleanupPath = promptPath;
39357
39379
  const printIndex = invocation.args.lastIndexOf("-p");
39358
39380
  invocation.args.splice(printIndex < 0 ? invocation.args.length : printIndex, 0, "--append-system-prompt", promptPath);
39359
39381
  }
@@ -40064,6 +40086,9 @@ async function executeRunCommand(config, command) {
40064
40086
  return { resultDelivered: Boolean(completion) };
40065
40087
  } finally {
40066
40088
  await preparationLogChain;
40089
+ if (piRuntimeSystemPromptCleanupPath) {
40090
+ rmSync10(piRuntimeSystemPromptCleanupPath, { force: true });
40091
+ }
40067
40092
  if (managedMcpProfile && !managedMcpCleanup && !completionOwnsManagedMcpProfile) {
40068
40093
  managedMcpCleanup = cleanupManagedMcpProfile(managedMcpProfile, {
40069
40094
  commandId: command.commandId,
@@ -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.321";
10
+ const CONNECTOR_VERSION = "0.1.1-beta.323";
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.321",
3
+ "version": "0.1.1-beta.323",
4
4
  "description": "MirrorX runtime connector CLI and daemon",
5
5
  "license": "MIT",
6
6
  "type": "module",