@amaster.ai/employee-runtime-connector 0.1.1-beta.57 → 0.1.1-beta.59
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.
|
@@ -6124,6 +6124,64 @@ function sectionText(section) {
|
|
|
6124
6124
|
return section.title ? `## ${section.title}
|
|
6125
6125
|
${section.content}` : section.content;
|
|
6126
6126
|
}
|
|
6127
|
+
function companyInitializationAuthoritySection(context) {
|
|
6128
|
+
const authority = asRecord(context.companyInitializationAuthority);
|
|
6129
|
+
const authorization = asRecord(context.authorizationEnvelope);
|
|
6130
|
+
const initializationId = readString(authority.initializationId);
|
|
6131
|
+
const revision = Number(authority.revision);
|
|
6132
|
+
const organizationVersion = Number(authority.organizationVersion);
|
|
6133
|
+
const minAgentCount = Number(authority.minAgentCount);
|
|
6134
|
+
const targetAgentCount = Number(authority.targetAgentCount);
|
|
6135
|
+
const maxAgentCount = Number(authority.maxAgentCount);
|
|
6136
|
+
const sourceRevision = readString(authorization.sourceRevision);
|
|
6137
|
+
if (readString(authority.schemaVersion) !== "mirrorx.company-initialization-authority.v1" || readString(authorization.sourceKind) !== "company_initialization" || readString(authorization.sourceId) !== initializationId || sourceRevision !== `${revision}:${organizationVersion}` || !initializationId || !Number.isInteger(revision) || revision < 1 || !Number.isInteger(organizationVersion) || organizationVersion < 1 || !Number.isInteger(minAgentCount) || !Number.isInteger(targetAgentCount) || !Number.isInteger(maxAgentCount) || minAgentCount < 1 || targetAgentCount < minAgentCount || targetAgentCount > maxAgentCount) return null;
|
|
6138
|
+
const executionPolicy = asRecord(authority.executionPolicy);
|
|
6139
|
+
const executionPolicyRef = readString(executionPolicy.ref);
|
|
6140
|
+
const executionPolicyContent = readString(executionPolicy.content);
|
|
6141
|
+
if (executionPolicyRef !== "mirrorx.company-initialization-execution-policy.v1" || !executionPolicyContent) {
|
|
6142
|
+
const error = new Error("Matched Company initialization authority is missing its Server-owned execution policy");
|
|
6143
|
+
error.code = "company_initialization_authority_invalid";
|
|
6144
|
+
throw error;
|
|
6145
|
+
}
|
|
6146
|
+
if (authority.readyPostconditionsFresh !== true) {
|
|
6147
|
+
const error = new Error("Matched Company initialization authority does not contain fresh ready postconditions");
|
|
6148
|
+
error.code = "company_initialization_authority_not_fresh";
|
|
6149
|
+
throw error;
|
|
6150
|
+
}
|
|
6151
|
+
const remainingReadyPostconditions = Array.isArray(authority.remainingReadyPostconditions) ? authority.remainingReadyPostconditions.map(asRecord).flatMap((postcondition) => {
|
|
6152
|
+
const key = readString(postcondition.key);
|
|
6153
|
+
return key ? [{ key }] : [];
|
|
6154
|
+
}) : [];
|
|
6155
|
+
const artifactState = asRecord(authority.organizationPlanArtifactState);
|
|
6156
|
+
const artifactStateKind = readString(artifactState.kind);
|
|
6157
|
+
const content = [
|
|
6158
|
+
"This is the current Server-owned Company initialization authority. It overrides continuation summaries, comments, model plans, and prior-run next-action prose.",
|
|
6159
|
+
`- Initialization id: ${JSON.stringify(initializationId)}`,
|
|
6160
|
+
`- Input revision: ${revision}`,
|
|
6161
|
+
`- Organization version: ${organizationVersion}`,
|
|
6162
|
+
`- Team mode: ${JSON.stringify(readString(authority.mode) ?? "standard")}`,
|
|
6163
|
+
`- Agent bounds: ${minAgentCount}..${maxAgentCount}; locked target ${targetAgentCount}`,
|
|
6164
|
+
`- Organization Plan artifact state: ${artifactStateKind ?? "unknown"}`,
|
|
6165
|
+
`- Server-authoritative remainingReadyPostconditions: ${JSON.stringify(remainingReadyPostconditions)}`,
|
|
6166
|
+
"- Ready postconditions freshness: fresh",
|
|
6167
|
+
"Execute only the positive remainingReadyPostconditions above. Do not revive work absent from that list.",
|
|
6168
|
+
`- Initialization execution policy: ${executionPolicyRef}.`,
|
|
6169
|
+
executionPolicyContent
|
|
6170
|
+
].join("\n");
|
|
6171
|
+
return {
|
|
6172
|
+
name: "company_initialization_authority",
|
|
6173
|
+
title: "Current Company Initialization Authority",
|
|
6174
|
+
priority: 100,
|
|
6175
|
+
sourceRef: `company-initialization:${initializationId}@${revision}:${organizationVersion}`,
|
|
6176
|
+
observedAt: null,
|
|
6177
|
+
freshness: { kind: "run_snapshot" },
|
|
6178
|
+
scope: {
|
|
6179
|
+
companyId: readString(asRecord(context.paperclipCompany).id),
|
|
6180
|
+
issueId: readString(asRecord(context.paperclipIssue).id)
|
|
6181
|
+
},
|
|
6182
|
+
content
|
|
6183
|
+
};
|
|
6184
|
+
}
|
|
6127
6185
|
function truncateSection(section, targetChars) {
|
|
6128
6186
|
const mandatoryContent = section.mandatoryContent ?? "";
|
|
6129
6187
|
if (targetChars <= mandatoryContent.length) {
|
|
@@ -6162,6 +6220,7 @@ var CONTEXT_AVAILABILITY_SECTION_TITLES = Object.freeze({
|
|
|
6162
6220
|
approval_continuation: "Approved Runtime Action Continuation",
|
|
6163
6221
|
wake_comments: "Wake Delta",
|
|
6164
6222
|
task: "Task Context",
|
|
6223
|
+
company_initialization_authority: "Current Company Initialization Authority",
|
|
6165
6224
|
governed_business_state: "Governed Business State",
|
|
6166
6225
|
task_acceptance_contract: "Task Acceptance Contract",
|
|
6167
6226
|
continuation_summary: "Continuation Summary",
|
|
@@ -6401,11 +6460,13 @@ ${resolvedDependencies.details.content}` : ""
|
|
|
6401
6460
|
const deliveryReadinessContent = runtimeDeliveryReadinessText(context, input);
|
|
6402
6461
|
const optionalTaskWikiContext = optionalTaskWikiContextSection(context);
|
|
6403
6462
|
const taskContextAuthority = taskContextAuthoritySection(context);
|
|
6463
|
+
const companyInitializationAuthority = companyInitializationAuthoritySection(context);
|
|
6404
6464
|
const rawSections = [
|
|
6405
6465
|
{ name: "recovery_instruction", title: "Recovery Instruction", priority: 100, sourceRef: `run:${input.runId ?? "unknown"}`, content: completeRecoveryInstruction, truncationReason: completeRecoveryInstruction ? null : "mode_selection" },
|
|
6406
6466
|
{ name: "approval_continuation", title: "Approved Runtime Action Continuation", priority: 99, sourceRef: `run:${input.runId ?? "unknown"}`, content: approvalContinuationText(input), truncationReason: mode === "continuation" ? null : "mode_selection" },
|
|
6407
6467
|
{ name: "wake_comments", title: wakeDeltaTitle, priority: interactionResolution ? 99 : 95, sourceRef: wakeDeltaSourceRefs, originalContent: wakeDeltaOriginal, content: wakeDeltaContent, truncationReason: commentsSelected ? null : "duplicate_task_context" },
|
|
6408
6468
|
{ name: "task", title: "Task Context", priority: 90, sourceRef: taskSourceRefs, originalContent: [taskText, taskCommentRefGuidance(input, taskText)].filter(Boolean).join("\n"), content: includeTask ? [taskText, taskCommentRefGuidance(input, taskText)].filter(Boolean).join("\n") : "", truncationReason: includeTask ? null : "mode_selection" },
|
|
6469
|
+
...companyInitializationAuthority && !includeTask ? [companyInitializationAuthority] : [],
|
|
6409
6470
|
...taskAcceptanceContract ? [{ name: "task_acceptance_contract", title: "Task Acceptance Contract", priority: 100, ...taskAcceptanceContract }] : [],
|
|
6410
6471
|
...governedBusinessState ? [{ name: "governed_business_state", title: "Governed Business State", priority: 99, ...governedBusinessState }] : [],
|
|
6411
6472
|
{ name: "continuation_summary", title: continuationSectionTitle(context), 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 },
|
|
@@ -10177,7 +10238,7 @@ var source_acquisition_compatibility_default = {
|
|
|
10177
10238
|
};
|
|
10178
10239
|
|
|
10179
10240
|
// src/amaster-runtime-daemon.mjs
|
|
10180
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
10241
|
+
var CONNECTOR_VERSION = "0.1.1-beta.59";
|
|
10181
10242
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
10182
10243
|
var SOURCE_ACQUISITION_CAPABILITY = source_acquisition_compatibility_default.profileVersion;
|
|
10183
10244
|
var SOURCE_ACQUISITION_PROFILE_VERSION = source_acquisition_compatibility_default.profileVersion;
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { basename, dirname, join, resolve } from "node:path";
|
|
|
6
6
|
import { homedir, hostname } from "node:os";
|
|
7
7
|
import { fileURLToPath } from "node:url";
|
|
8
8
|
|
|
9
|
-
const CONNECTOR_VERSION = "0.1.1-beta.
|
|
9
|
+
const CONNECTOR_VERSION = "0.1.1-beta.59";
|
|
10
10
|
|
|
11
11
|
const CAPABILITIES = [
|
|
12
12
|
"remote_registration",
|