@amaster.ai/employee-runtime-connector 0.1.0-beta.27 → 0.1.0-beta.28
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.
|
@@ -2208,6 +2208,13 @@ function isTerminalResultOutboxStatus(status) {
|
|
|
2208
2208
|
var DEFAULT_PROMPT_BUDGET_CHARS = 32e3;
|
|
2209
2209
|
var MIN_PROMPT_BUDGET_CHARS = 8192;
|
|
2210
2210
|
var CONTINUATION_WAKE_PATTERN = /(continuation|continued|retry|approved|liveness|resume|max_turn)/i;
|
|
2211
|
+
var RECOVERY_WAKE_REASONS = /* @__PURE__ */ new Set([
|
|
2212
|
+
"finish_successful_run_handoff",
|
|
2213
|
+
"source_scoped_recovery_action"
|
|
2214
|
+
]);
|
|
2215
|
+
function isRecoveryWakeReason(wakeReason) {
|
|
2216
|
+
return RECOVERY_WAKE_REASONS.has(wakeReason);
|
|
2217
|
+
}
|
|
2211
2218
|
function jsonText(value) {
|
|
2212
2219
|
return JSON.stringify(value, null, 2);
|
|
2213
2220
|
}
|
|
@@ -2223,7 +2230,7 @@ function estimatedTokens(chars) {
|
|
|
2223
2230
|
}
|
|
2224
2231
|
function contextMode(input) {
|
|
2225
2232
|
const nativeSession = asRecord(input.nativeSession);
|
|
2226
|
-
if (nativeSession.mode === "governed_action_approval" || readString(input.context?.resumeFromRunId) || CONTINUATION_WAKE_PATTERN.test(input.wakeReason ?? "")) return "continuation";
|
|
2233
|
+
if (nativeSession.mode === "governed_action_approval" || readString(input.context?.resumeFromRunId) || isRecoveryWakeReason(input.wakeReason) || CONTINUATION_WAKE_PATTERN.test(input.wakeReason ?? "")) return "continuation";
|
|
2227
2234
|
if (nativeSession.resume === true || Object.keys(asRecord(input.context?.paperclipContinuationSummary)).length > 0) {
|
|
2228
2235
|
return "warm";
|
|
2229
2236
|
}
|
|
@@ -2324,6 +2331,29 @@ function approvalContinuationText(input) {
|
|
|
2324
2331
|
"Do not advance to another write action until that exact call returns status succeeded."
|
|
2325
2332
|
].join("\n");
|
|
2326
2333
|
}
|
|
2334
|
+
function recoveryInstructionText(input) {
|
|
2335
|
+
const context = asRecord(input.context);
|
|
2336
|
+
if (input.wakeReason === "finish_successful_run_handoff" && context.handoffRequired === true) {
|
|
2337
|
+
return readString(context.instruction) ?? [
|
|
2338
|
+
"The prior successful run did not leave a terminal task disposition.",
|
|
2339
|
+
"Do not repeat the original source work or create or revise deliverables.",
|
|
2340
|
+
"Inspect the existing task and run evidence, then choose exactly one explicit disposition: done, in_review, input, blocked, delegated, or queued.",
|
|
2341
|
+
"Record the disposition with its concrete owner or next action and update the task accordingly."
|
|
2342
|
+
].join("\n");
|
|
2343
|
+
}
|
|
2344
|
+
if (input.wakeReason === "source_scoped_recovery_action") {
|
|
2345
|
+
return [
|
|
2346
|
+
"This is a status-only source recovery. Do not repeat the original source work or create or revise deliverables.",
|
|
2347
|
+
"Inspect the existing task and run evidence, then choose exactly one explicit disposition using task-governance actions:",
|
|
2348
|
+
"- done only when the existing evidence already satisfies acceptance;",
|
|
2349
|
+
"- in_review or input when a specific human review or answer is required;",
|
|
2350
|
+
"- blocked with a named unblock owner and action;",
|
|
2351
|
+
"- delegated or queued only with a concrete continuation path.",
|
|
2352
|
+
"Record the disposition in a comment and update the parent task accordingly."
|
|
2353
|
+
].join("\n");
|
|
2354
|
+
}
|
|
2355
|
+
return "";
|
|
2356
|
+
}
|
|
2327
2357
|
function runtimeAuthorizationText(context) {
|
|
2328
2358
|
const envelope = asRecord(context.authorizationEnvelope);
|
|
2329
2359
|
const allowed = new Set(
|
|
@@ -2418,6 +2448,7 @@ function compileCommandPromptWithManifest(input, options = {}) {
|
|
|
2418
2448
|
const snapshotFreshness = { kind: "run_snapshot" };
|
|
2419
2449
|
const rawSections = [
|
|
2420
2450
|
{ name: "runtime_rules", title: "", priority: 100, sourceRef: `command:${input.commandId}`, content: fixedRules(input, !hasTask) },
|
|
2451
|
+
{ name: "recovery_instruction", title: "Recovery Instruction", priority: 99, sourceRef: `run:${input.runId ?? "unknown"}`, content: recoveryInstructionText(input), truncationReason: isRecoveryWakeReason(input.wakeReason) ? null : "mode_selection" },
|
|
2421
2452
|
{ name: "approval_continuation", title: "Approved Runtime Action Continuation", priority: 99, sourceRef: `run:${input.runId ?? "unknown"}`, content: approvalContinuationText(input), truncationReason: mode === "continuation" ? null : "mode_selection" },
|
|
2422
2453
|
{ name: "runtime_authorization", title: "Runtime Action Authorization", priority: 98, sourceRef: `run:${input.runId ?? "unknown"}`, content: runtimeAuthorizationText(context) },
|
|
2423
2454
|
{ 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 },
|
|
@@ -4719,7 +4750,7 @@ function readWorkspaceStatus(cwd, opts = {}) {
|
|
|
4719
4750
|
}
|
|
4720
4751
|
|
|
4721
4752
|
// src/amaster-runtime-daemon.mjs
|
|
4722
|
-
var CONNECTOR_VERSION = "0.1.0-beta.
|
|
4753
|
+
var CONNECTOR_VERSION = "0.1.0-beta.28";
|
|
4723
4754
|
var CONNECTOR_CONTRACT_VERSION = "2026-06-04.v1";
|
|
4724
4755
|
var MAX_CHECKPOINT_BYTES = 20 * 1024 * 1024;
|
|
4725
4756
|
var CHECKPOINT_TTL_MS = 24 * 60 * 60 * 1e3;
|
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.28";
|
|
9
9
|
|
|
10
10
|
const CAPABILITIES = [
|
|
11
11
|
"remote_registration",
|