@amaster.ai/employee-runtime-connector 0.1.1-beta.71 → 0.1.1-beta.72
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.
|
@@ -3861,6 +3861,14 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
3861
3861
|
}
|
|
3862
3862
|
return profile;
|
|
3863
3863
|
}
|
|
3864
|
+
function readCommonRoleSkills(piHome) {
|
|
3865
|
+
const skillsRoot = resolve3(piHome, "bundles", "common", "skills");
|
|
3866
|
+
if (!existsSync3(skillsRoot)) return [];
|
|
3867
|
+
return readdirSync3(skillsRoot).sort().flatMap((name) => {
|
|
3868
|
+
const source = join4(skillsRoot, name);
|
|
3869
|
+
return existsSync3(join4(source, "SKILL.md")) ? [{ name, source }] : [];
|
|
3870
|
+
});
|
|
3871
|
+
}
|
|
3864
3872
|
function resolveManagedRoleSkills(piHome, skillProfiles) {
|
|
3865
3873
|
const entriesByName = /* @__PURE__ */ new Map();
|
|
3866
3874
|
for (const skillProfile of skillProfiles) {
|
|
@@ -3875,6 +3883,9 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
3875
3883
|
entriesByName.set(entry.name, entry);
|
|
3876
3884
|
}
|
|
3877
3885
|
}
|
|
3886
|
+
for (const entry of readCommonRoleSkills(piHome)) {
|
|
3887
|
+
if (!entriesByName.has(entry.name)) entriesByName.set(entry.name, entry);
|
|
3888
|
+
}
|
|
3878
3889
|
const entries = [...entriesByName.values()].map((entry) => ({
|
|
3879
3890
|
name: entry.name,
|
|
3880
3891
|
filePath: realpathSync2(join4(entry.source, "SKILL.md"))
|
|
@@ -6608,8 +6619,10 @@ function runtimeAuthorizationText(context, mode, { suppressOrdinaryCompletionCon
|
|
|
6608
6619
|
const evidenceAutoAcceptance = acceptancePolicy.mode === "evidence_auto" && acceptancePolicy.verdictAuthority === "none" && acceptancePolicy.acceptanceAuthority === null && acceptanceValidatorIds.length === EVIDENCE_AUTO_VALIDATOR_IDS.size && acceptanceValidatorIds.every((value) => EVIDENCE_AUTO_VALIDATOR_IDS.has(value));
|
|
6609
6620
|
const completionRole = readString(completion.role);
|
|
6610
6621
|
const completionDeliverable = readString(completion.deliverable);
|
|
6622
|
+
const delegatedAggregationEvidence = asRecord(context.paperclipDelegatedAggregationEvidence);
|
|
6623
|
+
const delegatedDelivery = readString(delegatedAggregationEvidence.schemaVersion) === "delegated-aggregation-evidence-v1" && readString(delegatedAggregationEvidence.finalAggregationIssueId) && readString(delegatedAggregationEvidence.manifestId) && readString(delegatedAggregationEvidence.packageReviewInteractionId);
|
|
6611
6624
|
const manifestRefreshOnly = legacyManifestRefreshOnly(context);
|
|
6612
|
-
const firstDocumentCheckpoint = completionDeliverable === "document_or_artifact" ? manifestRefreshOnly ? "The current deliverable content already exists and this run is limited to refreshing stale immutable Manifest refs. Do not create or revise a document unless a fresh Delivery readiness read proves a content or acceptance gap beyond stale refs." : mode === "cold" ? "Before the first external browse, search, or research action, call upsert_document with a stable key. Create a checkpoint skeleton containing the acceptance criteria, a source table, and known unknowns; update the same document with each piece of verified evidence instead of waiting until broad research is complete. Immediately after upsert_document, call update_parent with status: in_progress and a concrete next action; complete both control-plane writes before the first external browse, search, or research action." : "Before the first external browse, search, or research action, read the existing stable-key document. Preserve all still-valid verified rows, source URLs, conclusions, and known unknowns; do not replace a populated document with a blank skeleton or less-informative fallback. Only when the document does not exist may you create a checkpoint skeleton. Then call update_parent with status: in_progress and a concrete next action before the first external browse, search, or research action. Update the same document with each piece of verified evidence." : "";
|
|
6625
|
+
const firstDocumentCheckpoint = completionDeliverable === "document_or_artifact" && !delegatedDelivery ? manifestRefreshOnly ? "The current deliverable content already exists and this run is limited to refreshing stale immutable Manifest refs. Do not create or revise a document unless a fresh Delivery readiness read proves a content or acceptance gap beyond stale refs." : mode === "cold" ? "Before the first external browse, search, or research action, call upsert_document with a stable key. Create a checkpoint skeleton containing the acceptance criteria, a source table, and known unknowns; update the same document with each piece of verified evidence instead of waiting until broad research is complete. Immediately after upsert_document, call update_parent with status: in_progress and a concrete next action; complete both control-plane writes before the first external browse, search, or research action." : "Before the first external browse, search, or research action, read the existing stable-key document. Preserve all still-valid verified rows, source URLs, conclusions, and known unknowns; do not replace a populated document with a blank skeleton or less-informative fallback. Only when the document does not exist may you create a checkpoint skeleton. Then call update_parent with status: in_progress and a concrete next action before the first external browse, search, or research action. Update the same document with each piece of verified evidence." : "";
|
|
6613
6626
|
const completionContract = !suppressOrdinaryCompletionContract && completionRole && completionDeliverable ? [
|
|
6614
6627
|
workDisposition.mode === "required" ? "Before the first business mutation, ensure the current required work disposition is recorded. Read-only governed checks may precede it. If no current valid receipt exists, call runtime_action.describe for record_work_disposition and persist exactly one truthful disposition before upsert_document, update_parent, add_comment, create_interaction, publish_delivery_manifest, or any other business mutation. Before ending this run, persist durable progress through Runtime Actions; browser and tool history alone are not durable progress." : "Before ending this run, persist durable progress through Runtime Actions and record one explicit task disposition. Browser and tool history alone are not durable progress.",
|
|
6615
6628
|
firstDocumentCheckpoint,
|
|
@@ -6623,9 +6636,9 @@ function runtimeAuthorizationText(context, mode, { suppressOrdinaryCompletionCon
|
|
|
6623
6636
|
"Do not create a generic review-mode request_confirmation to ask the Board to accept final completion or the Outcome, and do not mark the issue done yourself. This does not prohibit an explicit intermediate review of an exact document revision before execution continues."
|
|
6624
6637
|
].join(" ") : "";
|
|
6625
6638
|
const businessOutcomeTerminalContract = !suppressOrdinaryCompletionContract && businessOutcome.mode === "required" ? [
|
|
6626
|
-
delivery.mode === "required" ? "When every acceptance criterion is satisfied and the exact current Delivery Manifest is ready, record the final execution disposition with update_parent status in_progress and a concise evidence summary, then end the run successfully without creating a final review interaction." : "When every acceptance criterion is satisfied, record the final execution disposition with update_parent status in_progress and a concise evidence summary, then end the run successfully without creating a final review interaction.",
|
|
6639
|
+
delivery.mode === "required" ? delegatedDelivery ? "When every acceptance criterion is satisfied and the exact delegated final-child Manifest and package review remain current, record only the root execution disposition with update_parent status in_progress and a concise evidence summary, then end the run successfully without creating or publishing another package." : "When every acceptance criterion is satisfied and the exact current Delivery Manifest is ready, record the final execution disposition with update_parent status in_progress and a concise evidence summary, then end the run successfully without creating a final review interaction." : "When every acceptance criterion is satisfied, record the final execution disposition with update_parent status in_progress and a concise evidence summary, then end the run successfully without creating a final review interaction.",
|
|
6627
6640
|
"The exact runtime_action_in_progress_server_owned rejection is the expected fail-before-effect receipt for this Server-owned handoff. After receiving it, do not retry update_parent with done or another status; end the run successfully so the Server terminal reconciler can take over.",
|
|
6628
|
-
evidenceAutoAcceptance ? delivery.mode === "required" ? "Only after the run and command succeed does the Server validate the exact current Delivery Manifest and terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; report the actual Server-owned terminal disposition without implying a handoff." : "Only after the run and command succeed does the Server validate the terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; report the actual Server-owned terminal disposition without implying a handoff." : delivery.mode === "required" ? "Only after the run and command succeed does the Server bind the exact current Delivery Manifest and terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically." : "Only after the run and command succeed does the Server bind the terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically."
|
|
6641
|
+
evidenceAutoAcceptance ? delivery.mode === "required" ? delegatedDelivery ? "Only after the run and command succeed does the Server validate the exact delegated final-child Manifest, accepted package review, and terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; report the actual Server-owned terminal disposition without implying a handoff." : "Only after the run and command succeed does the Server validate the exact current Delivery Manifest and terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; report the actual Server-owned terminal disposition without implying a handoff." : "Only after the run and command succeed does the Server validate the terminal Outcome evidence, auto-accept the Outcome, and finalize the issue as done atomically. This evidence-auto path does not create a Board review; report the actual Server-owned terminal disposition without implying a handoff." : delivery.mode === "required" ? delegatedDelivery ? "Only after the run and command succeed does the Server bind the exact delegated final-child Manifest, accepted package review, and terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically." : "Only after the run and command succeed does the Server bind the exact current Delivery Manifest and terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically." : "Only after the run and command succeed does the Server bind the terminal Outcome evidence, create the formal Board review before generic continuation handoff is evaluated, and move the issue to in_review. Board acceptance then finalizes the issue as done atomically."
|
|
6629
6642
|
].join(" ") : "";
|
|
6630
6643
|
const organizationCapabilityAllowed = asRecord(envelope.organizationCapability).allowed === true;
|
|
6631
6644
|
const organizationMutationAuthorized = allowed.has("organization_mutation");
|
|
@@ -6648,6 +6661,19 @@ function runtimeAuthorizationText(context, mode, { suppressOrdinaryCompletionCon
|
|
|
6648
6661
|
authorizationContract
|
|
6649
6662
|
].filter(Boolean).join("\n");
|
|
6650
6663
|
}
|
|
6664
|
+
function continuationPostconditionGapSection(context, input) {
|
|
6665
|
+
const gap = asRecord(context.paperclipContinuationPostconditionGap);
|
|
6666
|
+
if (readString(gap.schemaVersion) !== "continuation-postcondition-gap-v1") return null;
|
|
6667
|
+
return {
|
|
6668
|
+
sourceRef: `run:${readString(gap.sourceRunId) ?? input.runId ?? "unknown"}:postcondition-gap`,
|
|
6669
|
+
freshness: { kind: "run_snapshot" },
|
|
6670
|
+
content: [
|
|
6671
|
+
"This bounded Server-owned projection overrides conflicting historical summary instructions.",
|
|
6672
|
+
stringifyBoundedJson(gap, 12e3),
|
|
6673
|
+
"Revalidate the projection, execute only the first agent-owned missing action, and do not repeat forbiddenRepeats. Board-owned and external gaps require their typed wait path."
|
|
6674
|
+
].join("\n")
|
|
6675
|
+
};
|
|
6676
|
+
}
|
|
6651
6677
|
function runtimeDecompositionRequirementText(context) {
|
|
6652
6678
|
const issue = asRecord(context.paperclipIssue);
|
|
6653
6679
|
const requirements = asRecord(issue.taskRequirements);
|
|
@@ -7267,6 +7293,7 @@ ${resolvedDependencies.details.content}` : ""
|
|
|
7267
7293
|
const deliveryReadinessContent = runtimeDeliveryReadinessText(context, input);
|
|
7268
7294
|
const optionalTaskWikiContext = optionalTaskWikiContextSection(context);
|
|
7269
7295
|
const taskContextAuthority = taskContextAuthoritySection(context);
|
|
7296
|
+
const continuationPostconditionGap = continuationPostconditionGapSection(context, input);
|
|
7270
7297
|
const companyInitializationAuthority = companyInitializationAuthoritySection(context);
|
|
7271
7298
|
const rawSections = [
|
|
7272
7299
|
{ name: "recovery_instruction", title: "Recovery Instruction", priority: 100, sourceRef: `run:${input.runId ?? "unknown"}`, content: completeRecoveryInstruction, truncationReason: completeRecoveryInstruction ? null : "mode_selection" },
|
|
@@ -7276,6 +7303,7 @@ ${resolvedDependencies.details.content}` : ""
|
|
|
7276
7303
|
...companyInitializationAuthority && !includeTask ? [companyInitializationAuthority] : [],
|
|
7277
7304
|
...taskAcceptanceContract ? [{ name: "task_acceptance_contract", title: "Task Acceptance Contract", priority: 100, ...taskAcceptanceContract }] : [],
|
|
7278
7305
|
...governedBusinessState ? [{ name: "governed_business_state", title: "Governed Business State", priority: 99, ...governedBusinessState }] : [],
|
|
7306
|
+
...continuationPostconditionGap ? [{ name: "continuation_postcondition_gap", title: "Continuation Postcondition Gap", priority: 100, ...continuationPostconditionGap }] : [],
|
|
7279
7307
|
{ 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 },
|
|
7280
7308
|
...resolvedDependencyContent ? [{
|
|
7281
7309
|
name: "resolved_dependencies",
|
|
@@ -8608,7 +8636,7 @@ var CODEX_REMOTE_COMPACTION_RE = /remote\s+compact\s+task/i;
|
|
|
8608
8636
|
var CODEX_USAGE_LIMIT_RE = /you(?:'|’)ve hit your usage limit for .+\.\s+switch to another model now,\s+or try again at\s+([^.!\n]+)(?:[.!]|\n|$)/i;
|
|
8609
8637
|
var PI_PROVIDER_AUTH_RE = /(?:(?:\b401\b|\b403\b)[^\n]*(?:unauthorized|forbidden|auth(?:entication|orization)?|api[_\s-]?key)|(?:invalid|missing|expired|revoked)\s+(?:provider\s+)?api[_\s-]?key|provider\s+authentication\s+required)/i;
|
|
8610
8638
|
var PI_PROVIDER_QUOTA_EXHAUSTED_RE = /(?:\binsufficient[_\s-]?user[_\s-]?quota\b|河狸币余额不足|\b402\b[^\n]*(?:余额不足|payment\s+required))/i;
|
|
8611
|
-
var PI_PROVIDER_TRANSIENT_RE = /(
|
|
8639
|
+
var PI_PROVIDER_TRANSIENT_RE = /(?:Stream ended without finish_reason|\b(?:429|5\d{2})\b|rate[-\s]?limit(?:ed)?|too\s+many\s+requests|billing\s+admission\s+failed|service\s+unavailable|upstream[^\n]*(?:unavailable|failed|timeout)|connect(?:ion)?[^\n]*refused|temporar(?:y|ily)[^\n]*(?:unavailable|failed)|try\s+again\s+later)/i;
|
|
8612
8640
|
var PI_PROVIDER_PROTOCOL_RE = /provider[^\n]*finish_reason[^\n]*unexpected_state/i;
|
|
8613
8641
|
var PI_PROVIDER_RETRY_AFTER_SECONDS_RE = /retry[-\s]?after\s*[:=]?\s*(\d{1,6})\s*(?:seconds?|secs?|s)\b/i;
|
|
8614
8642
|
var PI_TERMINAL_CLEANUP_PERMISSION_RE = /(?:\bkill\b[^\n]*\bEPERM\b|\bEPERM\b[^\n]*\bkill\b)/i;
|
|
@@ -9044,6 +9072,15 @@ function classifyPiProviderError(input, now = /* @__PURE__ */ new Date()) {
|
|
|
9044
9072
|
...retryNotBefore ? { retryNotBefore: retryNotBefore.toISOString() } : {}
|
|
9045
9073
|
};
|
|
9046
9074
|
}
|
|
9075
|
+
function classifyPiOutputFailure(input, options = {}) {
|
|
9076
|
+
const providerFailure = classifyPiProviderError(input, options.now);
|
|
9077
|
+
if (providerFailure) return providerFailure;
|
|
9078
|
+
if (!readString(options.invalidOutputError)) return null;
|
|
9079
|
+
return {
|
|
9080
|
+
errorCode: "pi_executor_invalid_output",
|
|
9081
|
+
errorFamily: "validation"
|
|
9082
|
+
};
|
|
9083
|
+
}
|
|
9047
9084
|
function parseClaudeStreamJson(stdout) {
|
|
9048
9085
|
let sessionId = null;
|
|
9049
9086
|
let summary = "";
|
|
@@ -11340,7 +11377,7 @@ var source_acquisition_compatibility_default = {
|
|
|
11340
11377
|
};
|
|
11341
11378
|
|
|
11342
11379
|
// src/amaster-runtime-daemon.mjs
|
|
11343
|
-
var CONNECTOR_VERSION = "0.1.1-beta.
|
|
11380
|
+
var CONNECTOR_VERSION = "0.1.1-beta.72";
|
|
11344
11381
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
11345
11382
|
var SOURCE_ACQUISITION_CAPABILITY = source_acquisition_compatibility_default.profileVersion;
|
|
11346
11383
|
var daemonRequire = createRequire(import.meta.url);
|
|
@@ -16551,7 +16588,8 @@ async function executeRunCommand(config, command) {
|
|
|
16551
16588
|
completionOutputType: execution.completionOutputType,
|
|
16552
16589
|
completionOutputHasFinalAssistantText: terminalTextRepair?.succeeded === true ? true : execution.completionOutputHasFinalAssistantText
|
|
16553
16590
|
}) : null;
|
|
16554
|
-
const
|
|
16591
|
+
const piOutputFailure = executor.kind === "pi" && !cancelled && !hasOutputFlood && !hasArgumentAmplification && !hasMemoryLimit && execution.timedOut !== true && !execution.spawnError ? classifyPiOutputFailure(parsedForValidation, { invalidOutputError: piInvalidOutputError }) : null;
|
|
16592
|
+
const piProviderFailure = piOutputFailure?.errorCode !== "pi_executor_invalid_output" ? piOutputFailure : null;
|
|
16555
16593
|
const parsedErrorMessage = outputFloodError ?? argumentAmplificationError ?? memoryLimitError ?? piTurnLimitFailure?.message ?? piInvalidOutputError ?? nativeSessionRolloutError ?? nativeSessionRolloutCleanupError ?? parsedForValidation.errorMessage;
|
|
16556
16594
|
const codexTransientFailure = executor.kind === "codex" && (execution.exitCode ?? 0) !== 0 ? classifyCodexTransientUpstreamError({
|
|
16557
16595
|
stdout: execution.stdout,
|
|
@@ -16648,10 +16686,7 @@ async function executeRunCommand(config, command) {
|
|
|
16648
16686
|
...Array.isArray(execution.killedWorkspaceResidents) && execution.killedWorkspaceResidents.length > 0 ? {
|
|
16649
16687
|
killedWorkspaceResidents: execution.killedWorkspaceResidents
|
|
16650
16688
|
} : {},
|
|
16651
|
-
...
|
|
16652
|
-
errorCode: "pi_executor_invalid_output",
|
|
16653
|
-
errorFamily: "validation"
|
|
16654
|
-
} : {},
|
|
16689
|
+
...piOutputFailure?.errorCode === "pi_executor_invalid_output" && !piTurnLimitFailure ? piOutputFailure : {},
|
|
16655
16690
|
...piTurnLimitFailure ? {
|
|
16656
16691
|
errorCode: piTurnLimitFailure.errorCode,
|
|
16657
16692
|
errorFamily: piTurnLimitFailure.errorFamily,
|
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.72";
|
|
10
10
|
|
|
11
11
|
const CAPABILITIES = [
|
|
12
12
|
"remote_registration",
|