@amaster.ai/employee-runtime-connector 0.1.1-beta.322 → 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.
|
@@ -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.
|
|
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
|
|
39350
|
-
|
|
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,
|
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.323";
|
|
11
11
|
|
|
12
12
|
const CONFIG_KEY_MAP = new Map([
|
|
13
13
|
["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
|