@amaster.ai/employee-runtime-connector 0.1.1-beta.19 → 0.1.1-beta.20
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.
|
@@ -2515,6 +2515,7 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
2515
2515
|
]);
|
|
2516
2516
|
const HYBRID_DIRECT_TYPED_V1_TOOL_NAMES = /* @__PURE__ */ new Set([
|
|
2517
2517
|
"amaster.read_company_snapshot",
|
|
2518
|
+
"amaster.read_governed_business_state",
|
|
2518
2519
|
"runtime_action.describe",
|
|
2519
2520
|
"amaster.read_issue_document",
|
|
2520
2521
|
"amaster.read_issue_evidence"
|
|
@@ -4281,6 +4282,52 @@ function governedReadSection(context) {
|
|
|
4281
4282
|
}))
|
|
4282
4283
|
};
|
|
4283
4284
|
}
|
|
4285
|
+
function governedBusinessStateSection(context, input) {
|
|
4286
|
+
const current = asRecord(context.governedBusinessState);
|
|
4287
|
+
const resume = asRecord(context.governedBusinessResume);
|
|
4288
|
+
if (Object.keys(current).length === 0 && Object.keys(resume).length === 0) return null;
|
|
4289
|
+
const companyId = readString(asRecord(context.paperclipCompany).id);
|
|
4290
|
+
const issueId = readString(input.issueId);
|
|
4291
|
+
const currentSnapshot = asRecord(current.governed_state_snapshot);
|
|
4292
|
+
const resumeSnapshot = asRecord(resume.governed_state_snapshot);
|
|
4293
|
+
for (const [label, snapshot] of [["current", currentSnapshot], ["resume", resumeSnapshot]]) {
|
|
4294
|
+
if (Object.keys(snapshot).length === 0) continue;
|
|
4295
|
+
if (companyId && readString(snapshot.company_id) !== companyId || issueId && readString(snapshot.issue_id) !== issueId) {
|
|
4296
|
+
throw new Error(`governed_business_state_scope_mismatch:${label}`);
|
|
4297
|
+
}
|
|
4298
|
+
}
|
|
4299
|
+
const rules = [
|
|
4300
|
+
"This is bounded Server-owned read-side truth. It does not grant mutation authority and it is not a Delivery Manifest claim.",
|
|
4301
|
+
"Recommendation, First Business Activation, and Business Task Enrollment may be described as created/submitted/activated/enrolled only when authoritative_object_refs contains the exact matching Server ref. Issue and Document are not Business Task Enrollment.",
|
|
4302
|
+
"Pipeline is unsupported as a governed object. You may create or update a clearly labeled tracker/document, but never claim a formal Pipeline record or receipt.",
|
|
4303
|
+
"For parent aggregation, read Server-owned governed state; never accept child final prose, an Issue, or a Document as a formal object receipt.",
|
|
4304
|
+
"A read capability marked unavailable does not prove an instance is absent. A write capability marked unavailable does not prove the object kind is unsupported.",
|
|
4305
|
+
"When availability.status or a required read capability is unavailable, unrelated work may continue, but formal-object completion claims must remain fail-closed until a managed read succeeds.",
|
|
4306
|
+
"When a required formal object is missing or the current Runtime lacks its legal producer, keep the task incomplete and name missing_objects.reason_code plus next_owner. Board review remains independent final acceptance.",
|
|
4307
|
+
"free_text_reason is explanatory only and is not authority; resolve any conflict in favor of the structured Server-owned state."
|
|
4308
|
+
].join("\n");
|
|
4309
|
+
const bodies = [
|
|
4310
|
+
Object.keys(current).length > 0 ? `Current dispatch snapshot:
|
|
4311
|
+
${stringifyBoundedJson(current, 24e3)}` : "",
|
|
4312
|
+
Object.keys(resume).length > 0 ? `Changes-requested resume binding:
|
|
4313
|
+
${stringifyBoundedJson(resume, 24e3)}` : ""
|
|
4314
|
+
].filter(Boolean).join("\n\n");
|
|
4315
|
+
return {
|
|
4316
|
+
content: `${rules}
|
|
4317
|
+
|
|
4318
|
+
${bodies}`,
|
|
4319
|
+
mandatoryContent: rules,
|
|
4320
|
+
sourceRef: [
|
|
4321
|
+
readString(currentSnapshot.snapshot_id) ? `governed_state:${readString(currentSnapshot.snapshot_id)}` : null,
|
|
4322
|
+
readString(resume.continuation_id) ? `continuation:${readString(resume.continuation_id)}` : null
|
|
4323
|
+
].filter(Boolean),
|
|
4324
|
+
observedAt: [
|
|
4325
|
+
readString(currentSnapshot.generated_at),
|
|
4326
|
+
readString(resumeSnapshot.generated_at)
|
|
4327
|
+
].filter(Boolean),
|
|
4328
|
+
scope: { companyId: companyId ?? null, issueId: issueId ?? null }
|
|
4329
|
+
};
|
|
4330
|
+
}
|
|
4284
4331
|
function canonicalJsonValue(value) {
|
|
4285
4332
|
if (Array.isArray(value)) return value.map(canonicalJsonValue);
|
|
4286
4333
|
const record8 = asRecord(value);
|
|
@@ -4433,11 +4480,16 @@ function resolvedDependencySections(context, input, contextScope, snapshotFreshn
|
|
|
4433
4480
|
overflowRefs
|
|
4434
4481
|
};
|
|
4435
4482
|
}
|
|
4483
|
+
var MODEL_COMPANY_FACT_ALIASES = /* @__PURE__ */ new Map([
|
|
4484
|
+
["companyStage", "stage"],
|
|
4485
|
+
["productsServices", "products"]
|
|
4486
|
+
]);
|
|
4436
4487
|
function projectModelFactRecord(value, seenFacts) {
|
|
4437
4488
|
return Object.fromEntries(Object.entries(asRecord(value)).sort(([left], [right]) => left.localeCompare(right)).flatMap(([key, rawValue]) => {
|
|
4438
4489
|
if (typeof rawValue !== "string" || !rawValue.trim()) return [];
|
|
4439
4490
|
const normalizedValue = rawValue.trim();
|
|
4440
|
-
const
|
|
4491
|
+
const semanticKey = MODEL_COMPANY_FACT_ALIASES.get(key) ?? key;
|
|
4492
|
+
const fingerprint = `${semanticKey}\0${normalizedValue}`;
|
|
4441
4493
|
if (seenFacts.has(fingerprint)) return [];
|
|
4442
4494
|
seenFacts.add(fingerprint);
|
|
4443
4495
|
return [[key, normalizedValue]];
|
|
@@ -5030,6 +5082,7 @@ var CONTEXT_AVAILABILITY_SECTION_TITLES = Object.freeze({
|
|
|
5030
5082
|
approval_continuation: "Approved Runtime Action Continuation",
|
|
5031
5083
|
wake_comments: "Wake Delta",
|
|
5032
5084
|
task: "Task Context",
|
|
5085
|
+
governed_business_state: "Governed Business State",
|
|
5033
5086
|
continuation_summary: "Continuation Summary",
|
|
5034
5087
|
resolved_dependencies: "Resolved Dependency Outputs",
|
|
5035
5088
|
runtime_delivery_readiness: "Current Delivery Readiness",
|
|
@@ -5131,6 +5184,7 @@ function compileCommandPromptWithManifest(input, options = {}) {
|
|
|
5131
5184
|
const completeRecoveryInstruction = [recoveryInstruction, recoveryContinuationOption].filter(Boolean).join("\n\n");
|
|
5132
5185
|
const suppressOrdinaryCompletionContract = completeRecoveryInstruction.length > 0;
|
|
5133
5186
|
const governedReads = governedReadSection(context);
|
|
5187
|
+
const governedBusinessState = governedBusinessStateSection(context, input);
|
|
5134
5188
|
const verifiedCompanyContext = verifiedCompanyContextSection(context);
|
|
5135
5189
|
const hasTask = Boolean(readString(input.taskMarkdown));
|
|
5136
5190
|
const taskText = readString(input.taskMarkdown) ?? "";
|
|
@@ -5178,6 +5232,7 @@ ${resolvedDependencies.details.content}` : ""
|
|
|
5178
5232
|
{ name: "approval_continuation", title: "Approved Runtime Action Continuation", priority: 99, sourceRef: `run:${input.runId ?? "unknown"}`, content: approvalContinuationText(input), truncationReason: mode === "continuation" ? null : "mode_selection" },
|
|
5179
5233
|
{ name: "wake_comments", title: wakeDeltaTitle, priority: interactionResolution ? 99 : 95, sourceRef: wakeDeltaSourceRefs, originalContent: wakeDeltaOriginal, content: wakeDeltaContent, truncationReason: commentsSelected ? null : "duplicate_task_context" },
|
|
5180
5234
|
{ name: "task", title: "Task Context", priority: 90, sourceRef: `issue:${input.issueId ?? "unknown"}`, originalContent: [taskText, taskCommentRefGuidance(input)].filter(Boolean).join("\n"), content: includeTask ? [taskText, taskCommentRefGuidance(input)].filter(Boolean).join("\n") : "", truncationReason: includeTask ? null : "mode_selection" },
|
|
5235
|
+
...governedBusinessState ? [{ name: "governed_business_state", title: "Governed Business State", priority: 99, ...governedBusinessState }] : [],
|
|
5181
5236
|
{ 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 },
|
|
5182
5237
|
...resolvedDependencyContent ? [{
|
|
5183
5238
|
name: "resolved_dependencies",
|
|
@@ -9792,7 +9847,7 @@ function assertSourceAcquisitionRuntimeAuthority({
|
|
|
9792
9847
|
}
|
|
9793
9848
|
|
|
9794
9849
|
// src/amaster-runtime-daemon.mjs
|
|
9795
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
9850
|
+
var CONNECTOR_VERSION = "0.1.1-beta.20";
|
|
9796
9851
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
9797
9852
|
var SOURCE_ACQUISITION_CAPABILITY = "source_acquisition_v1";
|
|
9798
9853
|
var SOURCE_ACQUISITION_PROFILE_VERSION = "source_acquisition_v1";
|
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.20";
|
|
10
10
|
|
|
11
11
|
const CAPABILITIES = [
|
|
12
12
|
"remote_registration",
|