@amaster.ai/employee-runtime-connector 0.1.1-beta.140 → 0.1.1-beta.141
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.
|
@@ -15741,7 +15741,7 @@ var completeCompanyCreationReviewSchema = external_exports.object({
|
|
|
15741
15741
|
// src/amaster-runtime-daemon.mjs
|
|
15742
15742
|
import { chmodSync as chmodSync7, copyFileSync as copyFileSync2, existsSync as existsSync15, lstatSync as lstatSync9, mkdirSync as mkdirSync10, mkdtempSync as mkdtempSync2, readFileSync as readFileSync17, readdirSync as readdirSync11, realpathSync as realpathSync7, renameSync as renameSync9, rmSync as rmSync9, statSync as statSync10, symlinkSync as symlinkSync2, unlinkSync as unlinkSync3, writeFileSync as writeFileSync11 } from "node:fs";
|
|
15743
15743
|
import { arch as arch3, homedir as homedir3, hostname as hostname2, platform as platform3, tmpdir } from "node:os";
|
|
15744
|
-
import { basename as basename6, delimiter as delimiter3, dirname as dirname11, extname as extname3, isAbsolute as
|
|
15744
|
+
import { basename as basename6, delimiter as delimiter3, dirname as dirname11, extname as extname3, isAbsolute as isAbsolute10, join as join16, relative as relative8, resolve as resolve14 } from "node:path";
|
|
15745
15745
|
import { spawn, spawnSync as spawnSync5 } from "node:child_process";
|
|
15746
15746
|
|
|
15747
15747
|
// src/amaster-runtime-daemon/common.mjs
|
|
@@ -22294,6 +22294,7 @@ function inspectSourceAcquisitionProfile(profile, expectedRunId) {
|
|
|
22294
22294
|
|
|
22295
22295
|
// src/amaster-runtime-daemon/prompt-compiler.mjs
|
|
22296
22296
|
import { createHash as createHash7 } from "node:crypto";
|
|
22297
|
+
import { isAbsolute as isAbsolute4 } from "node:path";
|
|
22297
22298
|
|
|
22298
22299
|
// src/amaster-runtime-daemon/current-run-contract.mjs
|
|
22299
22300
|
import { createHash as createHash6 } from "node:crypto";
|
|
@@ -22531,6 +22532,30 @@ function jsonCharLength(value) {
|
|
|
22531
22532
|
return String(value).length;
|
|
22532
22533
|
}
|
|
22533
22534
|
}
|
|
22535
|
+
function runtimeTemplateCatalogSection(input) {
|
|
22536
|
+
const catalog = asRecord(input.runtimeTemplateCatalog);
|
|
22537
|
+
if (Object.keys(catalog).length === 0) return null;
|
|
22538
|
+
const targetDir = readString(catalog.targetDir);
|
|
22539
|
+
const manifestSha256 = readString(catalog.manifestSha256);
|
|
22540
|
+
if (catalog.status !== "ready" || !targetDir || !isAbsolute4(targetDir) || targetDir.length > 4096 || /[\0\r\n`]/u.test(targetDir) || !Number.isSafeInteger(catalog.fileCount) || catalog.fileCount < 1 || !manifestSha256 || !/^[a-f0-9]{64}$/u.test(manifestSha256)) {
|
|
22541
|
+
throw promptBudgetError(
|
|
22542
|
+
"runtime_template_catalog_projection_invalid",
|
|
22543
|
+
"Runtime Template Catalog projection requires one attested ready catalog"
|
|
22544
|
+
);
|
|
22545
|
+
}
|
|
22546
|
+
return {
|
|
22547
|
+
sourceRef: "runtime_template_catalog_attestation",
|
|
22548
|
+
content: [
|
|
22549
|
+
"The runtime connector attested and materialized the artifact template catalog before this command was leased.",
|
|
22550
|
+
`- exact catalog path: \`${targetDir}\``,
|
|
22551
|
+
`- file count: ${catalog.fileCount}`,
|
|
22552
|
+
`- manifest SHA-256: ${manifestSha256}`,
|
|
22553
|
+
"This exact catalog is the run's only authorized read-only path outside the execution workspace for template matching. Copy a selected template into the workspace before editing it.",
|
|
22554
|
+
"Use this exact path directly when listing or reading templates. Do not rely on `AMASTER_RUNTIME_TEMPLATES_ROOT` being inherited by out-of-process tools; the path above is the model-facing authority for this run.",
|
|
22555
|
+
"If this exact path is missing or unreadable, report a runtime gap. Do not silently fall back to another directory or treat the failure as a verified template miss."
|
|
22556
|
+
].join("\n")
|
|
22557
|
+
};
|
|
22558
|
+
}
|
|
22534
22559
|
function estimatedTokens(chars) {
|
|
22535
22560
|
return Math.ceil(chars / 4);
|
|
22536
22561
|
}
|
|
@@ -24172,6 +24197,7 @@ ${resolvedDependencies.details.content}` : resolvedDependencies.details.content
|
|
|
24172
24197
|
const taskContextAuthority = taskContextAuthoritySection(context);
|
|
24173
24198
|
const continuationPostconditionGap = continuationPostconditionGapSection(context, input);
|
|
24174
24199
|
const companyInitializationAuthority = companyInitializationAuthoritySection(context);
|
|
24200
|
+
const runtimeTemplateCatalog = runtimeTemplateCatalogSection(input);
|
|
24175
24201
|
const rawSections = [
|
|
24176
24202
|
{ name: "recovery_instruction", title: "Recovery Instruction", priority: 100, sourceRef: `run:${input.runId ?? "unknown"}`, content: completeRecoveryInstruction, truncationReason: completeRecoveryInstruction ? null : "mode_selection" },
|
|
24177
24203
|
{ name: "approval_continuation", title: "Approved Runtime Action Continuation", priority: 99, sourceRef: `run:${input.runId ?? "unknown"}`, content: approvalContinuationText(input), truncationReason: mode === "continuation" ? null : "mode_selection" },
|
|
@@ -24207,6 +24233,7 @@ ${resolvedDependencies.details.content}` : resolvedDependencies.details.content
|
|
|
24207
24233
|
}] : [],
|
|
24208
24234
|
{ 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 },
|
|
24209
24235
|
...optionalTaskWikiContext ? [optionalTaskWikiContext] : [],
|
|
24236
|
+
...runtimeTemplateCatalog ? [{ name: "runtime_template_catalog", title: "Runtime Template Catalog", priority: 100, ...runtimeTemplateCatalog }] : [],
|
|
24210
24237
|
{ name: "agent_instructions", title: "Agent Instructions", priority: 100, sourceRef: "agent_instructions_bundle", content: readString(input.agentInstructions) ?? "" },
|
|
24211
24238
|
{ name: "attachments", title: "Materialized Inputs", priority: 80, sourceRef: "materialized_attachments", content: readString(input.attachmentsText) ?? "" },
|
|
24212
24239
|
{
|
|
@@ -24239,7 +24266,7 @@ ${resolvedDependencies.details.content}` : resolvedDependencies.details.content
|
|
|
24239
24266
|
// src/amaster-runtime-daemon/agent-instruction-delivery.mjs
|
|
24240
24267
|
import { createHash as createHash8, randomBytes as randomBytes2 } from "node:crypto";
|
|
24241
24268
|
import { existsSync as existsSync7, lstatSync as lstatSync4, mkdirSync as mkdirSync5, readFileSync as readFileSync9, readdirSync as readdirSync6, realpathSync as realpathSync4, renameSync as renameSync6, rmSync as rmSync5, writeFileSync as writeFileSync7 } from "node:fs";
|
|
24242
|
-
import { dirname as dirname6, isAbsolute as
|
|
24269
|
+
import { dirname as dirname6, isAbsolute as isAbsolute5, join as join8, relative as relative3, resolve as resolve4 } from "node:path";
|
|
24243
24270
|
|
|
24244
24271
|
// src/amaster-runtime-daemon/workspace-manifest.mjs
|
|
24245
24272
|
import { chownSync as chownSync3, existsSync as existsSync6, readFileSync as readFileSync8, renameSync as renameSync5, rmSync as rmSync4, statSync as statSync3, writeFileSync as writeFileSync6 } from "node:fs";
|
|
@@ -24354,7 +24381,7 @@ function instructionTopologyError(code, message, details = {}) {
|
|
|
24354
24381
|
}
|
|
24355
24382
|
function pathWithin(candidate, root) {
|
|
24356
24383
|
const rel = relative3(root, candidate);
|
|
24357
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
24384
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute5(rel);
|
|
24358
24385
|
}
|
|
24359
24386
|
function lstatIfPresent(path) {
|
|
24360
24387
|
try {
|
|
@@ -24384,7 +24411,7 @@ function isManagedExecutionDirectory(directory, managedWorkspacesRoot) {
|
|
|
24384
24411
|
if (!manifest || typeof manifest !== "object" || Array.isArray(manifest) || manifest.managed !== true) {
|
|
24385
24412
|
return false;
|
|
24386
24413
|
}
|
|
24387
|
-
return [manifest.managedCwd, manifest.executionWorkdir].some((value) => typeof value === "string" &&
|
|
24414
|
+
return [manifest.managedCwd, manifest.executionWorkdir].some((value) => typeof value === "string" && isAbsolute5(value) && canonicalExistingPath(value) === candidate);
|
|
24388
24415
|
} catch {
|
|
24389
24416
|
return false;
|
|
24390
24417
|
}
|
|
@@ -26711,7 +26738,7 @@ var bestEffortPostJson = bestEffortPostRuntimeConnectorJson;
|
|
|
26711
26738
|
// src/amaster-runtime-daemon/runtime-artifact-upload.mjs
|
|
26712
26739
|
import { createHash as createHash9 } from "node:crypto";
|
|
26713
26740
|
import { closeSync as closeSync2, constants, fstatSync, lstatSync as lstatSync5, openSync as openSync2, readFileSync as readFileSync11, realpathSync as realpathSync5 } from "node:fs";
|
|
26714
|
-
import { isAbsolute as
|
|
26741
|
+
import { isAbsolute as isAbsolute6, relative as relative4, resolve as resolve6 } from "node:path";
|
|
26715
26742
|
var SHA256_PATTERN3 = /^[a-f0-9]{64}$/;
|
|
26716
26743
|
function requiredString(value, name) {
|
|
26717
26744
|
if (typeof value !== "string" || !value.trim()) throw new Error(`Runtime Artifact ${name} is required`);
|
|
@@ -26724,7 +26751,7 @@ function ownedRelativePath(value) {
|
|
|
26724
26751
|
}
|
|
26725
26752
|
function pathWithin2(candidate, root) {
|
|
26726
26753
|
const rel = relative4(root, candidate);
|
|
26727
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
26754
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute6(rel);
|
|
26728
26755
|
}
|
|
26729
26756
|
function sameFileSnapshot(left, right) {
|
|
26730
26757
|
return left.dev === right.dev && left.ino === right.ino && left.size === right.size && left.mtimeMs === right.mtimeMs && left.ctimeMs === right.ctimeMs;
|
|
@@ -27048,10 +27075,10 @@ function createRuntimeArtifactIngestQueue({ ingest, onError }) {
|
|
|
27048
27075
|
// src/amaster-runtime-daemon/workspace-guard.mjs
|
|
27049
27076
|
import { createHash as createHash11 } from "node:crypto";
|
|
27050
27077
|
import { existsSync as existsSync9, mkdirSync as mkdirSync7, realpathSync as realpathSync6, statSync as statSync4 } from "node:fs";
|
|
27051
|
-
import { basename as basename4, join as join10, isAbsolute as
|
|
27078
|
+
import { basename as basename4, join as join10, isAbsolute as isAbsolute7, relative as relative5, resolve as resolve7 } from "node:path";
|
|
27052
27079
|
function pathWithin3(candidate, root) {
|
|
27053
27080
|
const rel = relative5(root, candidate);
|
|
27054
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
27081
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute7(rel);
|
|
27055
27082
|
}
|
|
27056
27083
|
function resolveWorkspaceCwd(config, command) {
|
|
27057
27084
|
const payload = asRecord(command.payload);
|
|
@@ -27288,7 +27315,7 @@ import {
|
|
|
27288
27315
|
unlinkSync as unlinkSync2,
|
|
27289
27316
|
writeFileSync as writeFileSync9
|
|
27290
27317
|
} from "node:fs";
|
|
27291
|
-
import { dirname as dirname8, extname, isAbsolute as
|
|
27318
|
+
import { dirname as dirname8, extname, isAbsolute as isAbsolute8, join as join12, parse as parse3, resolve as resolve9, sep as sep3 } from "node:path";
|
|
27292
27319
|
import { fileURLToPath } from "node:url";
|
|
27293
27320
|
var PRESET_TEMPLATE_MANIFEST_FILE = ".mirrorx-preset-templates.json";
|
|
27294
27321
|
var MAX_PRESET_TEMPLATE_FILES = 256;
|
|
@@ -27340,7 +27367,7 @@ function assertCatalogReadableByExecutor(targetDir, fileNames, identity2) {
|
|
|
27340
27367
|
}
|
|
27341
27368
|
}
|
|
27342
27369
|
function validTemplateName(value) {
|
|
27343
|
-
return typeof value === "string" && value.length > 0 && value !== "." && value !== ".." && !value.includes("\0") && !value.includes("/") && !value.includes("\\") && !
|
|
27370
|
+
return typeof value === "string" && value.length > 0 && value !== "." && value !== ".." && !value.includes("\0") && !value.includes("/") && !value.includes("\\") && !isAbsolute8(value) && parse3(value).base === value && extname(value).toLowerCase() === ".md";
|
|
27344
27371
|
}
|
|
27345
27372
|
function readManifest(manifestPath, { strict }) {
|
|
27346
27373
|
try {
|
|
@@ -28215,7 +28242,7 @@ function readPiFinalContextAttestation(input) {
|
|
|
28215
28242
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
28216
28243
|
import { createHash as createHash14 } from "node:crypto";
|
|
28217
28244
|
import { existsSync as existsSync13, readdirSync as readdirSync10, readFileSync as readFileSync15, statSync as statSync8 } from "node:fs";
|
|
28218
|
-
import { basename as basename5, extname as extname2, isAbsolute as
|
|
28245
|
+
import { basename as basename5, extname as extname2, isAbsolute as isAbsolute9, join as join14, relative as relative6, resolve as resolve12 } from "node:path";
|
|
28219
28246
|
var WORKSPACE_RUNTIME_SERVICES_FILENAME = ".amaster-runtime-services.json";
|
|
28220
28247
|
var ARTIFACT_EXTENSIONS = /* @__PURE__ */ new Map([
|
|
28221
28248
|
[".md", "markdown"],
|
|
@@ -28261,7 +28288,7 @@ var SAFE_RUNTIME_SERVICE_HEALTH_STATUSES = /* @__PURE__ */ new Set(["unknown", "
|
|
|
28261
28288
|
var SAFE_RUNTIME_SERVICE_LIFECYCLES = /* @__PURE__ */ new Set(["shared", "ephemeral"]);
|
|
28262
28289
|
function statusPathWithin(candidate, root) {
|
|
28263
28290
|
const rel = relative6(root, candidate);
|
|
28264
|
-
return rel === "" || !rel.startsWith("..") && !
|
|
28291
|
+
return rel === "" || !rel.startsWith("..") && !isAbsolute9(rel);
|
|
28265
28292
|
}
|
|
28266
28293
|
function normalizeRelativePath(root, filePath) {
|
|
28267
28294
|
return relative6(root, filePath).split(/[\\/]+/).join("/");
|
|
@@ -29375,7 +29402,7 @@ function createSourceCompletionStopPolicy({
|
|
|
29375
29402
|
}
|
|
29376
29403
|
|
|
29377
29404
|
// src/amaster-runtime-daemon.mjs
|
|
29378
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
29405
|
+
var CONNECTOR_VERSION = "0.1.1-beta.141";
|
|
29379
29406
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
29380
29407
|
var SOURCE_ACQUISITION_CAPABILITY2 = source_acquisition_compatibility_default.profileVersion;
|
|
29381
29408
|
var daemonRequire = createRequire(import.meta.url);
|
|
@@ -29850,7 +29877,7 @@ function sourceAcquisitionPackageMetadata(packageName, location = "pi-config") {
|
|
|
29850
29877
|
}
|
|
29851
29878
|
function sourceAcquisitionBrowserExecutableReady() {
|
|
29852
29879
|
const executable = readString(process.env.AMASTER_BROWSER_EXECUTABLE_PATH);
|
|
29853
|
-
if (!executable || !
|
|
29880
|
+
if (!executable || !isAbsolute10(executable)) return false;
|
|
29854
29881
|
try {
|
|
29855
29882
|
const stat = statSync10(executable);
|
|
29856
29883
|
return stat.isFile() && (stat.mode & 73) !== 0;
|
|
@@ -30807,7 +30834,7 @@ function safeAgentInstructionMaterializationTarget(workspace, filePath) {
|
|
|
30807
30834
|
const raw = readString(filePath);
|
|
30808
30835
|
if (!raw || raw.includes("\0")) return null;
|
|
30809
30836
|
const normalized = raw.replace(/\\/g, "/");
|
|
30810
|
-
if (
|
|
30837
|
+
if (isAbsolute10(normalized)) return null;
|
|
30811
30838
|
const segments = normalized.split("/").filter(Boolean);
|
|
30812
30839
|
if (segments.length === 0 || segments.some((segment) => segment === "." || segment === "..")) return null;
|
|
30813
30840
|
const relativePath = segments.join("/");
|
|
@@ -31036,7 +31063,8 @@ function buildCommandPrompt(command, workspace, materializedAttachments = [], op
|
|
|
31036
31063
|
wikiAccess: {
|
|
31037
31064
|
tools: context.wikiToolsAvailable === true,
|
|
31038
31065
|
treePath: wikiTreePathForCommand(command, options.workspaceBindings)
|
|
31039
|
-
}
|
|
31066
|
+
},
|
|
31067
|
+
runtimeTemplateCatalog: options.runtimeTemplateCatalog
|
|
31040
31068
|
}, { maxChars: options.maxChars });
|
|
31041
31069
|
const auditedCompilation = attachCurrentRunContractShadowAudit(
|
|
31042
31070
|
compilation,
|
|
@@ -32060,7 +32088,7 @@ function manifestMatchesActiveRuntimeRef(manifest, refs, workdir = null) {
|
|
|
32060
32088
|
function buildOrphanReaperSample(root, workdir, manifest, residents) {
|
|
32061
32089
|
const relativeWorkdir = (() => {
|
|
32062
32090
|
const value = relative8(root, workdir);
|
|
32063
|
-
return value && !value.startsWith("..") && !
|
|
32091
|
+
return value && !value.startsWith("..") && !isAbsolute10(value) ? value : basename6(workdir);
|
|
32064
32092
|
})();
|
|
32065
32093
|
return {
|
|
32066
32094
|
workdir: relativeWorkdir,
|
|
@@ -34257,7 +34285,7 @@ async function clearIssueCheckpoint(config, command, workspace, reason) {
|
|
|
34257
34285
|
}
|
|
34258
34286
|
function safeCheckpointRelativePath(rawPath) {
|
|
34259
34287
|
const raw = String(rawPath ?? "").trim();
|
|
34260
|
-
if (
|
|
34288
|
+
if (isAbsolute10(raw) || /^[A-Za-z]:[\\/]/.test(raw)) return null;
|
|
34261
34289
|
const normalized = raw.split(/[\\/]+/).filter(Boolean).join("/");
|
|
34262
34290
|
if (!normalized || normalized.startsWith("../") || normalized.split("/").some((segment) => segment.startsWith("."))) return null;
|
|
34263
34291
|
if (normalized.startsWith("input-attachments/") || isRuntimeMetadataArtifactPath(normalized)) return null;
|
|
@@ -34728,6 +34756,7 @@ async function executeRunCommand(config, command) {
|
|
|
34728
34756
|
workspaceProjectInstructionReceipt,
|
|
34729
34757
|
effectiveToolSchemaAttestation,
|
|
34730
34758
|
modelContextBudget,
|
|
34759
|
+
runtimeTemplateCatalog: config.templateCatalog,
|
|
34731
34760
|
runtimeInstructionInjectionEnabled: strictContextGovernance,
|
|
34732
34761
|
maxChars: modelContextBudget.dynamicPromptMaxChars
|
|
34733
34762
|
}));
|
|
@@ -35549,7 +35578,9 @@ async function runOnce(config) {
|
|
|
35549
35578
|
return commands.length;
|
|
35550
35579
|
}
|
|
35551
35580
|
async function dispatchAvailableCommands(config, options = {}) {
|
|
35581
|
+
const templateCatalog = config.templateCatalog;
|
|
35552
35582
|
config = await ensureRegistered(config);
|
|
35583
|
+
config = { ...config, templateCatalog };
|
|
35553
35584
|
try {
|
|
35554
35585
|
await heartbeat(
|
|
35555
35586
|
config,
|
|
@@ -35559,7 +35590,7 @@ async function dispatchAvailableCommands(config, options = {}) {
|
|
|
35559
35590
|
if (!hasConnectorAuth(config) && isConnectorAuthFailure(err)) {
|
|
35560
35591
|
process.stderr.write("AMaster daemon heartbeat was rejected without connector auth; re-registering once.\n");
|
|
35561
35592
|
await register(config, { quiet: true });
|
|
35562
|
-
config = buildConfig(process.env, {});
|
|
35593
|
+
config = { ...buildConfig(process.env, {}), templateCatalog };
|
|
35563
35594
|
await heartbeat(config, { logMode: "compact" });
|
|
35564
35595
|
} else {
|
|
35565
35596
|
throw err;
|
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.141";
|
|
11
11
|
|
|
12
12
|
const CONFIG_KEY_MAP = new Map([
|
|
13
13
|
["server_url", "AMASTER_EMPLOYEE_SERVER_URL"],
|