@amaster.ai/employee-runtime-connector 0.1.0-beta.51 → 0.1.0-beta.53
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.
|
@@ -2162,6 +2162,12 @@ function createManagedPiMcpProfileApi(options = {}) {
|
|
|
2162
2162
|
if (typeof sourceConfig.channel === "string" && ["stable", "beta", "dev", "canary"].includes(sourceConfig.channel)) {
|
|
2163
2163
|
config.channel = sourceConfig.channel;
|
|
2164
2164
|
}
|
|
2165
|
+
if (typeof sourceConfig.sessionMode === "string" && ["persistent", "isolated", "existing"].includes(sourceConfig.sessionMode)) {
|
|
2166
|
+
config.sessionMode = sourceConfig.sessionMode;
|
|
2167
|
+
}
|
|
2168
|
+
if (typeof sourceConfig.userDataDir === "string" && sourceConfig.userDataDir.trim().length > 0) {
|
|
2169
|
+
config.userDataDir = sourceConfig.userDataDir.trim();
|
|
2170
|
+
}
|
|
2165
2171
|
return {
|
|
2166
2172
|
packageSpec,
|
|
2167
2173
|
plugin: {
|
|
@@ -2904,7 +2910,6 @@ function removeRunCompletionState(directory, commandId) {
|
|
|
2904
2910
|
}
|
|
2905
2911
|
|
|
2906
2912
|
// src/amaster-runtime-daemon/prompt-compiler.mjs
|
|
2907
|
-
var DEFAULT_PROMPT_BUDGET_CHARS = 32e3;
|
|
2908
2913
|
var DEADLINE_POSTURE_GUARD = "Named-window:skip_this_window_and_continue; no lower-quality/approval-bypass/fabrication/whole-task-stop; deadline_posture_receipt=targetMilestoneRef,posture,onMiss,taskContinuation,next owner/action; not Server proof";
|
|
2909
2914
|
var MIN_PROMPT_BUDGET_CHARS = 8192;
|
|
2910
2915
|
var CONTINUATION_WAKE_PATTERN = /(continuation|continued|retry|approved|liveness|resume|max_turn)/i;
|
|
@@ -2915,15 +2920,6 @@ var RECOVERY_WAKE_REASONS = /* @__PURE__ */ new Set([
|
|
|
2915
2920
|
function isRecoveryWakeReason(wakeReason) {
|
|
2916
2921
|
return RECOVERY_WAKE_REASONS.has(wakeReason);
|
|
2917
2922
|
}
|
|
2918
|
-
function stringifyBoundedJson(value, maxChars = 24e3) {
|
|
2919
|
-
let text = "";
|
|
2920
|
-
try {
|
|
2921
|
-
text = JSON.stringify(value, null, 2);
|
|
2922
|
-
} catch {
|
|
2923
|
-
text = String(value);
|
|
2924
|
-
}
|
|
2925
|
-
return truncateText(text, maxChars);
|
|
2926
|
-
}
|
|
2927
2923
|
function jsonText(value) {
|
|
2928
2924
|
return JSON.stringify(value, null, 2);
|
|
2929
2925
|
}
|
|
@@ -3172,7 +3168,7 @@ function verifiedCompanyContextSection(context) {
|
|
|
3172
3168
|
content: [
|
|
3173
3169
|
"Use these server-snapshotted current Company facts as authoritative context for this run.",
|
|
3174
3170
|
"The current verification contract does not supply shareholder structure or a financial baseline; treat them as unknown unless separate evidence is present, and do not describe the verified registration facts below as missing.",
|
|
3175
|
-
|
|
3171
|
+
jsonText(companyContext)
|
|
3176
3172
|
].join("\n"),
|
|
3177
3173
|
sourceRef: [
|
|
3178
3174
|
`company:${companyId}`,
|
|
@@ -3229,7 +3225,7 @@ function interactionResolutionText(context) {
|
|
|
3229
3225
|
"Treat this resolved interaction as the authoritative delta for this run.",
|
|
3230
3226
|
readString(resolution.status) === "changes_requested" ? "Apply every requested change before creating a replacement review." : "",
|
|
3231
3227
|
exactDocumentRevisionDirective,
|
|
3232
|
-
|
|
3228
|
+
jsonText(resolution)
|
|
3233
3229
|
].filter(Boolean).join("\n");
|
|
3234
3230
|
}
|
|
3235
3231
|
function recoveryInstructionText(input) {
|
|
@@ -3436,15 +3432,15 @@ function buildManifest(mode, maxChars, sections, governedReadProvenance, usedCha
|
|
|
3436
3432
|
budget: {
|
|
3437
3433
|
totalChars: maxChars,
|
|
3438
3434
|
usedChars,
|
|
3439
|
-
utilization: (usedChars / maxChars).toFixed(4)
|
|
3435
|
+
utilization: maxChars === null ? null : (usedChars / maxChars).toFixed(4)
|
|
3440
3436
|
},
|
|
3441
3437
|
sections: sections.map(manifestEntry),
|
|
3442
3438
|
governedReadProvenance
|
|
3443
3439
|
};
|
|
3444
3440
|
}
|
|
3445
3441
|
function compileCommandPromptWithManifest(input, options = {}) {
|
|
3446
|
-
const maxChars = Number(options.maxChars
|
|
3447
|
-
if (!Number.isInteger(maxChars) || maxChars < MIN_PROMPT_BUDGET_CHARS) {
|
|
3442
|
+
const maxChars = options.maxChars == null ? null : Number(options.maxChars);
|
|
3443
|
+
if (maxChars !== null && (!Number.isInteger(maxChars) || maxChars < MIN_PROMPT_BUDGET_CHARS)) {
|
|
3448
3444
|
throw new RangeError(`Prompt budget must be an integer of at least ${MIN_PROMPT_BUDGET_CHARS} characters`);
|
|
3449
3445
|
}
|
|
3450
3446
|
const context = asRecord(input.context);
|
|
@@ -3508,7 +3504,7 @@ ${resolvedDependencies.details.content}` : ""
|
|
|
3508
3504
|
{ name: "wake_comments", title: wakeDeltaTitle, priority: interactionResolution ? 99 : 95, sourceRef: wakeDeltaSourceRefs, originalContent: wakeDeltaOriginal, content: wakeDeltaContent, truncationReason: commentsSelected ? null : "duplicate_task_context" },
|
|
3509
3505
|
{ name: "task", title: "Task Context", priority: 90, sourceRef: `issue:${input.issueId ?? "unknown"}`, originalContent: taskText, content: includeTask ? taskText : "", truncationReason: includeTask ? null : "mode_selection" },
|
|
3510
3506
|
{ 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 },
|
|
3511
|
-
{ name: "agent_instructions", title: "Agent Instructions", priority:
|
|
3507
|
+
{ name: "agent_instructions", title: "Agent Instructions", priority: 100, sourceRef: "agent_instructions_bundle", content: readString(input.agentInstructions) ?? "" },
|
|
3512
3508
|
{ name: "attachments", title: "Materialized Inputs", priority: 80, sourceRef: "materialized_attachments", content: readString(input.attachmentsText) ?? "" },
|
|
3513
3509
|
{ name: "on_demand_refs", title: "On-demand Context References", priority: 70, sourceRef: `issue:${input.issueId ?? "unknown"}`, content: onDemandRefs(input) },
|
|
3514
3510
|
{ name: "raw_snapshot", title: "Raw Context Snapshot", priority: 0, sourceRef: `run:${input.runId ?? "unknown"}`, originalChars: jsonCharLength(context), content: "", truncationReason: "on_demand_large_object" }
|
|
@@ -3534,6 +3530,14 @@ ${resolvedDependencies.details.content}` : ""
|
|
|
3534
3530
|
let prompt = "";
|
|
3535
3531
|
let compactManifest = false;
|
|
3536
3532
|
let manifest = buildManifest(mode, maxChars, sections, governedReads.provenance, 0);
|
|
3533
|
+
if (maxChars === null) {
|
|
3534
|
+
for (let telemetryPass = 0; telemetryPass < 20; telemetryPass += 1) {
|
|
3535
|
+
prompt = renderPrompt(sections, manifest);
|
|
3536
|
+
if (manifest.budget.usedChars === prompt.length) return { prompt, manifest };
|
|
3537
|
+
manifest = buildManifest(mode, null, sections, governedReads.provenance, prompt.length);
|
|
3538
|
+
}
|
|
3539
|
+
throw new Error("Prompt compiler could not stabilize the unbounded Context Manifest");
|
|
3540
|
+
}
|
|
3537
3541
|
for (let pass = 0; pass < 20; pass += 1) {
|
|
3538
3542
|
let usedChars = 0;
|
|
3539
3543
|
for (let telemetryPass = 0; telemetryPass < 3; telemetryPass += 1) {
|
|
@@ -4369,6 +4373,7 @@ var CODEX_USAGE_LIMIT_RE = /you(?:'|’)ve hit your usage limit for .+\.\s+switc
|
|
|
4369
4373
|
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;
|
|
4370
4374
|
var PI_PROVIDER_QUOTA_EXHAUSTED_RE = /(?:\binsufficient[_\s-]?user[_\s-]?quota\b|河狸币余额不足|\b402\b[^\n]*(?:余额不足|payment\s+required))/i;
|
|
4371
4375
|
var PI_PROVIDER_TRANSIENT_RE = /(?:\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;
|
|
4376
|
+
var PI_PROVIDER_PROTOCOL_RE = /provider[^\n]*finish_reason[^\n]*unexpected_state/i;
|
|
4372
4377
|
var PI_PROVIDER_RETRY_AFTER_SECONDS_RE = /retry[-\s]?after\s*[:=]?\s*(\d{1,6})\s*(?:seconds?|secs?|s)\b/i;
|
|
4373
4378
|
var PI_TERMINAL_CLEANUP_PERMISSION_RE = /(?:\bkill\b[^\n]*\bEPERM\b|\bEPERM\b[^\n]*\bkill\b)/i;
|
|
4374
4379
|
var MAX_PI_PROVIDER_RETRY_AFTER_SECONDS = 7 * 24 * 60 * 60;
|
|
@@ -4711,6 +4716,12 @@ function extractPiProviderRetryNotBefore(errorMessage, now) {
|
|
|
4711
4716
|
function classifyPiProviderError(input, now = /* @__PURE__ */ new Date()) {
|
|
4712
4717
|
const errorMessage = readString(asRecord(input).errorMessage);
|
|
4713
4718
|
if (!errorMessage) return null;
|
|
4719
|
+
if (PI_PROVIDER_PROTOCOL_RE.test(errorMessage)) {
|
|
4720
|
+
return {
|
|
4721
|
+
errorCode: "pi_provider_protocol_failure",
|
|
4722
|
+
errorFamily: "provider_protocol"
|
|
4723
|
+
};
|
|
4724
|
+
}
|
|
4714
4725
|
if (PI_PROVIDER_QUOTA_EXHAUSTED_RE.test(errorMessage)) {
|
|
4715
4726
|
return {
|
|
4716
4727
|
errorCode: "pi_provider_quota_exhausted",
|
|
@@ -4955,13 +4966,17 @@ function parsePiJsonl(stdout) {
|
|
|
4955
4966
|
let hasAssistantOutput = false;
|
|
4956
4967
|
let nonCleanupErrorCount = 0;
|
|
4957
4968
|
let nonCleanupErrorMessage = null;
|
|
4969
|
+
let terminalEventIndex = null;
|
|
4970
|
+
let eventIndex = -1;
|
|
4958
4971
|
const messages = [];
|
|
4959
4972
|
const mcpToolResults = [];
|
|
4960
4973
|
const cleanupDiagnostics = [];
|
|
4974
|
+
const diagnostics = [];
|
|
4961
4975
|
const usage = { inputTokens: 0, cachedInputTokens: 0, outputTokens: 0 };
|
|
4962
4976
|
for (const rawLine of String(stdout ?? "").split(/\r?\n/)) {
|
|
4963
4977
|
const event = parseJsonLine(rawLine.trim());
|
|
4964
4978
|
if (!event) continue;
|
|
4979
|
+
eventIndex += 1;
|
|
4965
4980
|
mcpToolResults.push(...piMcpToolResults(event));
|
|
4966
4981
|
if (event.type === "session") {
|
|
4967
4982
|
sessionId = readString(event.sessionId) ?? readString(event.id) ?? sessionId;
|
|
@@ -4986,13 +5001,26 @@ function parsePiJsonl(stdout) {
|
|
|
4986
5001
|
}
|
|
4987
5002
|
if (["message", "message_update", "message_end", "turn_end", "agent_end"].includes(event.type)) {
|
|
4988
5003
|
if (event.type === "turn_end") sawTurnEnd = true;
|
|
4989
|
-
if (event.type === "turn_end" || event.type === "agent_end")
|
|
5004
|
+
if (event.type === "turn_end" || event.type === "agent_end") {
|
|
5005
|
+
terminalEventType = event.type;
|
|
5006
|
+
terminalEventIndex = eventIndex;
|
|
5007
|
+
}
|
|
4990
5008
|
stopReason = readString(event.stopReason ?? event.stop_reason) ?? piNestedMessageStopReason(event) ?? stopReason;
|
|
4991
5009
|
const terminalError = piStopReasonErrorText(event) ?? piNestedMessageErrorText(event);
|
|
4992
5010
|
if (terminalError) {
|
|
4993
5011
|
nonCleanupErrorCount += 1;
|
|
4994
5012
|
nonCleanupErrorMessage = terminalError;
|
|
4995
5013
|
errorMessage = terminalError;
|
|
5014
|
+
if (PI_PROVIDER_PROTOCOL_RE.test(terminalError)) {
|
|
5015
|
+
diagnostics.push({
|
|
5016
|
+
source: "provider",
|
|
5017
|
+
phase: "terminal",
|
|
5018
|
+
severity: "error",
|
|
5019
|
+
code: "pi_provider_protocol_failure",
|
|
5020
|
+
message: terminalError,
|
|
5021
|
+
eventIndex
|
|
5022
|
+
});
|
|
5023
|
+
}
|
|
4996
5024
|
}
|
|
4997
5025
|
hasAssistantOutput = maybeCapturePiMessage(event, messages, usage) || hasAssistantOutput;
|
|
4998
5026
|
continue;
|
|
@@ -5001,16 +5029,33 @@ function parsePiJsonl(stdout) {
|
|
|
5001
5029
|
const eventError = readString(event.message);
|
|
5002
5030
|
if (!eventError) continue;
|
|
5003
5031
|
if (PI_TERMINAL_CLEANUP_PERMISSION_RE.test(eventError)) {
|
|
5004
|
-
|
|
5032
|
+
const diagnostic = {
|
|
5005
5033
|
code: "pi_terminal_cleanup_permission_denied",
|
|
5006
5034
|
message: eventError,
|
|
5007
5035
|
phase: terminalEventType === "agent_end" ? "post_terminal" : "pre_terminal"
|
|
5036
|
+
};
|
|
5037
|
+
cleanupDiagnostics.push(diagnostic);
|
|
5038
|
+
diagnostics.push({
|
|
5039
|
+
source: "executor",
|
|
5040
|
+
severity: "warning",
|
|
5041
|
+
...diagnostic,
|
|
5042
|
+
eventIndex
|
|
5008
5043
|
});
|
|
5009
5044
|
errorMessage = nonCleanupErrorMessage ?? eventError;
|
|
5010
5045
|
} else {
|
|
5011
5046
|
nonCleanupErrorCount += 1;
|
|
5012
5047
|
nonCleanupErrorMessage = eventError;
|
|
5013
5048
|
errorMessage = eventError;
|
|
5049
|
+
if (PI_PROVIDER_PROTOCOL_RE.test(eventError)) {
|
|
5050
|
+
diagnostics.push({
|
|
5051
|
+
source: "provider",
|
|
5052
|
+
phase: terminalEventType === "agent_end" ? "post_terminal" : "pre_terminal",
|
|
5053
|
+
severity: "error",
|
|
5054
|
+
code: "pi_provider_protocol_failure",
|
|
5055
|
+
message: eventError,
|
|
5056
|
+
eventIndex
|
|
5057
|
+
});
|
|
5058
|
+
}
|
|
5014
5059
|
}
|
|
5015
5060
|
}
|
|
5016
5061
|
}
|
|
@@ -5021,11 +5066,13 @@ function parsePiJsonl(stdout) {
|
|
|
5021
5066
|
usage,
|
|
5022
5067
|
sawTurnEnd,
|
|
5023
5068
|
terminalEventType,
|
|
5069
|
+
terminalEventIndex,
|
|
5024
5070
|
stopReason,
|
|
5025
5071
|
hasAssistantOutput,
|
|
5026
5072
|
errorMessage,
|
|
5027
5073
|
...nonCleanupErrorCount > 0 ? { nonCleanupErrorCount } : {},
|
|
5028
5074
|
...cleanupDiagnostics.length > 0 ? { cleanupDiagnostics } : {},
|
|
5075
|
+
...diagnostics.length > 0 ? { diagnostics } : {},
|
|
5029
5076
|
...uniqueMcpToolResults.length > 0 ? { mcpToolResults: uniqueMcpToolResults } : {}
|
|
5030
5077
|
};
|
|
5031
5078
|
}
|
|
@@ -8697,13 +8744,11 @@ function createPublicNetworkScope(options = {}) {
|
|
|
8697
8744
|
}
|
|
8698
8745
|
|
|
8699
8746
|
// src/amaster-runtime-daemon.mjs
|
|
8700
|
-
var CONNECTOR_VERSION = "0.1.0-beta.
|
|
8747
|
+
var CONNECTOR_VERSION = "0.1.0-beta.53";
|
|
8701
8748
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
8702
8749
|
var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
|
|
8703
8750
|
var CHECKPOINT_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
8704
8751
|
var PROMPT_AGENT_INSTRUCTION_FILE_ORDER = ["AGENTS.md", "SOUL.md"];
|
|
8705
|
-
var MAX_PROMPT_AGENT_INSTRUCTION_FILE_CHARS = 12e3;
|
|
8706
|
-
var MAX_PROMPT_AGENT_INSTRUCTIONS_CHARS = 24e3;
|
|
8707
8752
|
var AMASTER_PI_PROHIBITED_EXTRA_ARGS = /* @__PURE__ */ new Set(["--no-extensions", "--no-skills", "--no-tools", "--no-session"]);
|
|
8708
8753
|
var MAX_PI_CAPABILITY_SOURCE_ENTRIES = 200;
|
|
8709
8754
|
var PI_COMPLETION_OUTPUT_GRACE_MS = 1e3;
|
|
@@ -9827,13 +9872,17 @@ function renderIssueLine(context) {
|
|
|
9827
9872
|
function renderComments(context) {
|
|
9828
9873
|
const wake = asRecord(context.paperclipWake);
|
|
9829
9874
|
const comments = Array.isArray(wake.comments) ? wake.comments : [];
|
|
9830
|
-
|
|
9875
|
+
const rendered = comments.map((entry, index) => {
|
|
9831
9876
|
const comment = asRecord(entry);
|
|
9832
9877
|
const id = readString(comment.id) ?? `comment-${index + 1}`;
|
|
9833
9878
|
const body = readString(comment.body) ?? "";
|
|
9879
|
+
const truncatedNote = comment.bodyTruncated === true ? `
|
|
9880
|
+
[comment body truncated \u2014 fetch full text via typed read tool: comment:${id}]` : "";
|
|
9834
9881
|
return `${index + 1}. ${id}
|
|
9835
|
-
${body}`;
|
|
9882
|
+
${body}${truncatedNote}`;
|
|
9836
9883
|
}).filter((entry) => entry.trim().length > 0).join("\n\n");
|
|
9884
|
+
const fallbackNote = wake.fallbackFetchNeeded === true ? "[some wake comments were truncated or omitted from this prompt \u2014 fetch full text via managed typed read tools using the comment:<id> references]" : "";
|
|
9885
|
+
return [rendered, fallbackNote].filter(Boolean).join("\n\n");
|
|
9837
9886
|
}
|
|
9838
9887
|
function renderTaskMarkdown(context) {
|
|
9839
9888
|
return readString(context.paperclipTaskMarkdown);
|
|
@@ -9861,16 +9910,10 @@ function normalizeAgentInstructionsFiles(bundle) {
|
|
|
9861
9910
|
function renderAgentInstructionsBundle(bundle) {
|
|
9862
9911
|
const files = normalizeAgentInstructionsFiles(asRecord(bundle));
|
|
9863
9912
|
if (files.length === 0) return "";
|
|
9864
|
-
|
|
9865
|
-
|
|
9866
|
-
|
|
9867
|
-
|
|
9868
|
-
const section = [`### ${file.path}`, content].join("\n");
|
|
9869
|
-
if (used + section.length > MAX_PROMPT_AGENT_INSTRUCTIONS_CHARS) break;
|
|
9870
|
-
parts.push(section);
|
|
9871
|
-
used += section.length;
|
|
9872
|
-
}
|
|
9873
|
-
return parts.length > 1 ? parts.join("\n\n") : "";
|
|
9913
|
+
return [
|
|
9914
|
+
"Current agent instructions:",
|
|
9915
|
+
...files.map((file) => [`### ${file.path}`, file.content].join("\n"))
|
|
9916
|
+
].join("\n\n");
|
|
9874
9917
|
}
|
|
9875
9918
|
function commandRuntimeAuth(command) {
|
|
9876
9919
|
const topLevel = asRecord(command.runtimeAuth);
|
|
@@ -13033,7 +13076,8 @@ async function executeRunCommand(config, command) {
|
|
|
13033
13076
|
...piCompanyMemory ? { companyMemory: piCompanyMemory.attestation } : {}
|
|
13034
13077
|
});
|
|
13035
13078
|
}
|
|
13036
|
-
|
|
13079
|
+
const promptBudgetSummary = contextManifest.budget.totalChars === null ? `${contextManifest.budget.usedChars} characters (unbounded)` : `${contextManifest.budget.usedChars}/${contextManifest.budget.totalChars} characters`;
|
|
13080
|
+
await ingestLog(config, command, "system", "info", `Compiled ${contextManifest.mode} prompt using ${promptBudgetSummary}`, {
|
|
13037
13081
|
presentationKind: "context_manifest",
|
|
13038
13082
|
contextManifest
|
|
13039
13083
|
});
|
|
@@ -13256,17 +13300,17 @@ async function executeRunCommand(config, command) {
|
|
|
13256
13300
|
command,
|
|
13257
13301
|
"system",
|
|
13258
13302
|
"warn",
|
|
13259
|
-
"Pi
|
|
13303
|
+
"Pi reported a post-terminal cleanup permission failure; server disposition evaluation remains authoritative",
|
|
13260
13304
|
{
|
|
13261
13305
|
presentationKind: "pi_terminal_cleanup",
|
|
13262
13306
|
cleanupDisposition
|
|
13263
13307
|
}
|
|
13264
13308
|
);
|
|
13265
13309
|
}
|
|
13266
|
-
const parsedForValidation =
|
|
13310
|
+
const parsedForValidation = parsed;
|
|
13267
13311
|
const piTurnLimitFailure = executor.kind === "pi" && !cancelled && !hasOutputFlood && !hasMemoryLimit && execution.timedOut !== true && !execution.spawnError ? classifyPiTurnLimitResult(parsedForValidation) : null;
|
|
13268
13312
|
const piInvalidOutputError = executor.kind === "pi" ? piOutputValidationError(parsedForValidation, {
|
|
13269
|
-
allowMissingTurnEnd: completionOutputStopped
|
|
13313
|
+
allowMissingTurnEnd: completionOutputStopped,
|
|
13270
13314
|
allowMissingAssistantOutput: execution.completionOutputType === "approval_required"
|
|
13271
13315
|
}) : null;
|
|
13272
13316
|
const piProviderFailure = executor.kind === "pi" && !cancelled && !hasOutputFlood && !hasMemoryLimit && execution.timedOut !== true && !execution.spawnError ? classifyPiProviderError(parsedForValidation) : null;
|
|
@@ -13276,13 +13320,22 @@ async function executeRunCommand(config, command) {
|
|
|
13276
13320
|
stderr: execution.stderr,
|
|
13277
13321
|
errorMessage: parsedErrorMessage
|
|
13278
13322
|
}) : null;
|
|
13279
|
-
const succeeded = !cancelled && !hasOutputFlood && !hasMemoryLimit && (execution.exitCode === 0 || completionOutputStopped
|
|
13323
|
+
const succeeded = !cancelled && !hasOutputFlood && !hasMemoryLimit && (execution.exitCode === 0 || completionOutputStopped) && !execution.timedOut && !execution.spawnError && !parsedErrorMessage;
|
|
13280
13324
|
const resultStderr = filterExecutionStderrForResult(executor.kind, execution.stderr);
|
|
13281
13325
|
const error = execution.timedOut ? `Executor timed out after ${config.executorTimeoutSeconds}s` : cancelled ? "Executor cancelled by AMaster control plane" : execution.spawnError ?? parsedErrorMessage ?? (succeeded ? null : `Executor exited with code ${execution.exitCode ?? "unknown"}`);
|
|
13282
13326
|
const costUsage = parsedCostUsage(parsed.usage);
|
|
13327
|
+
const executorOutcome = {
|
|
13328
|
+
status: cancelled ? "cancelled" : execution.timedOut ? "timed_out" : execution.exitCode === 0 && execution.signal === null ? "completed" : "failed",
|
|
13329
|
+
exitCode: execution.exitCode,
|
|
13330
|
+
signal: execution.signal,
|
|
13331
|
+
terminalEvent: ["agent_end", "turn_end"].includes(readString(parsed.terminalEventType) ?? "") ? readString(parsed.terminalEventType) : null,
|
|
13332
|
+
terminalEventIndex: Number.isInteger(parsed.terminalEventIndex) ? parsed.terminalEventIndex : null
|
|
13333
|
+
};
|
|
13283
13334
|
let result3 = {
|
|
13284
13335
|
evidenceContract: { version: 1 },
|
|
13285
13336
|
executorKind: executor.kind,
|
|
13337
|
+
executorOutcome,
|
|
13338
|
+
...Array.isArray(parsed.diagnostics) && parsed.diagnostics.length > 0 ? { diagnostics: parsed.diagnostics } : {},
|
|
13286
13339
|
command: invocation.command,
|
|
13287
13340
|
args: invocation.args,
|
|
13288
13341
|
cwd,
|
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { dirname, join, resolve } from "node:path";
|
|
|
5
5
|
import { homedir, hostname } from "node:os";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
|
|
8
|
-
const CONNECTOR_VERSION = "0.1.0-beta.
|
|
8
|
+
const CONNECTOR_VERSION = "0.1.0-beta.53";
|
|
9
9
|
|
|
10
10
|
const CAPABILITIES = [
|
|
11
11
|
"remote_registration",
|