@sema-agent/cli 1.0.100 → 1.0.102
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.
- package/npm-shrinkwrap.json +18 -18
- package/package.json +6 -6
- package/sema-main.js +1793 -756
- package/sema.js +45 -1
package/sema-main.js
CHANGED
|
@@ -47339,7 +47339,7 @@ var CHROME_ARM_TABLE, CHROME_ARMS, init_seam = __esm({
|
|
|
47339
47339
|
},
|
|
47340
47340
|
wiring_manifest: {
|
|
47341
47341
|
required: !1,
|
|
47342
|
-
duty: "\u53EF\u9009:\u6E32\u5F15\u64CE\u63A5\u7EBF\u81EA\u8FF0\u91CC\u7684\
|
|
47342
|
+
duty: "\u53EF\u9009:\u6E32\u5F15\u64CE\u63A5\u7EBF\u81EA\u8FF0\u91CC\u7684\u4E09\u6BB5\u7528\u6237\u9762\u4E8B\u5B9E(modelGate = \u672C run \u88AB\u6A21\u578B\u95E8\u5378\u6389\u7684\u5DE5\u5177 + \u9010\u5B57\u6062\u590D\u529E\u6CD5;autoMode = \u6B66\u88C5\u4F4D + core \u516D\u8BCD\u539F\u56E0;mcp[] = \u672C\u817F\u7533\u62A5\u7684\u6BCF\u53F0 MCP \u670D\u52A1\u5668\u7684\u8FDE\u63A5\u65F6\u5FEB\u7167)\u3002\u{1F534} \u4E09\u6BB5\u7F3A\u5E2D\u4E00\u5F8B\u4E0D\u6E32\u80AF\u5B9A\u53E5;reason \u7EDD\u4E0D\u6620\u5C04 capabilities \u516D\u8BCD;restore \u539F\u6837\u5448\u73B0;mcp \u7684\u7A7A\u6570\u7EC4\u662F\u300C\u4E00\u53F0\u90FD\u6CA1\u7533\u62A5\u300D\u8FD9\u53E5\u6B63\u9762\u4E8B\u5B9E\u3001**\u4E0D\u662F**\u7F3A\u5E2D(\u5224\u5728\u573A\u5199 mcp !== undefined,\u522B\u5199 mcp?.length),errorCode \u6309\u5F00\u96C6\u5206\u652F\u5FC5\u5E26 default;durable \u91CD\u653E\u6309 run/leg \u5E42\u7B49"
|
|
47343
47343
|
},
|
|
47344
47344
|
text_segment_end: {
|
|
47345
47345
|
required: !1,
|
|
@@ -49104,7 +49104,7 @@ function isRewindFamilyCode(code2) {
|
|
|
49104
49104
|
function asModelFallbackReason(v2) {
|
|
49105
49105
|
return v2 === MODEL_FALLBACK_INHERIT_NO_TIER_BINDING ? MODEL_FALLBACK_INHERIT_NO_TIER_BINDING : void 0;
|
|
49106
49106
|
}
|
|
49107
|
-
var LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, LIMITS_ERROR_CODE_PREFIX, USAGE_WINDOW_EXHAUSTED, ENV_LIFETIME_EXPIRED, CONFIG_LIMIT_INVALID, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_REFUSAL_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, DELEGATION_CAP_CODES, MCP_SERVER_REVOKED, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, TOOL_END_INTERRUPTED_CODES, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, ACTIVE_RUN_BUSY_ERROR_CODE, STOP_PARK_ARBITER_UNREACHABLE, STOP_PARK_RESUME_WON, STOP_NOT_LANDED, STOP_NOT_LOCAL, STOP_PARKED, STOP_CONFLICT_CODES, OUTPUT_INVALID, RESUME_AT_ERROR_CODE_PREFIX, REWIND_ERROR_CODE_PREFIXES, RESUME_USAGE_WINDOW_EXHAUSTED, RESUME_PREFLIGHT_REJECTED, RESUME_RETRY_LATER_CODES, DRAINING_ERROR_CODE, SCENARIO_NOT_ALLOWED_ERROR_CODE, STREAM_MAX_DURATION, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, init_engineErrorCodes = __esm({
|
|
49107
|
+
var LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TURNS_EXCEEDED, LIMITS_MAX_WALLTIME_EXCEEDED, LIMITS_ERROR_CODE_PREFIX, USAGE_WINDOW_EXHAUSTED, ENV_LIFETIME_EXPIRED, CONFIG_LIMIT_INVALID, CONFIG_STRATEGY_FIND_LIMIT_INVALID, CONFIG_STRATEGY_MAX_SIZE_INVALID, CONFIG_LIMIT_UNKNOWN_KEY, CONFIG_DELEGATION_ENTRY_CAPS, CONFIG_REFUSAL_CODES, DELEGATION_CONCURRENCY_CAP, DELEGATION_SESSION_CAP, DELEGATION_CAP_CODES, MCP_SERVER_REVOKED, TOOL_END_INTERRUPTED_NEVER_STARTED, TOOL_END_INTERRUPTED_OUTCOME_UNKNOWN, TOOL_END_INTERRUPTED_CODES, CAPABILITY_SELF_ORCHESTRATION_REQUIRED, ACTIVE_RUN_BUSY_ERROR_CODE, STOP_PARK_ARBITER_UNREACHABLE, STOP_PARK_RESUME_WON, STOP_NOT_LANDED, STOP_NOT_LOCAL, STOP_PARKED, STOP_CONFLICT_CODES, OUTPUT_INVALID, RESUME_AT_ERROR_CODE_PREFIX, REWIND_ERROR_CODE_PREFIXES, RESUME_USAGE_WINDOW_EXHAUSTED, RESUME_PREFLIGHT_REJECTED, RESUME_PLACEMENT_MISMATCH, RESUME_RETRY_LATER_CODES, DRAINING_ERROR_CODE, SCENARIO_NOT_ALLOWED_ERROR_CODE, STREAM_MAX_DURATION, MODEL_FALLBACK_INHERIT_NO_TIER_BINDING, init_engineErrorCodes = __esm({
|
|
49108
49108
|
"node_modules/@sema-agent/client-core/dist/engineErrorCodes.js"() {
|
|
49109
49109
|
LIMITS_MAX_TOKENS_EXCEEDED = "limits.max_tokens_exceeded", LIMITS_MAX_COST_EXCEEDED = "limits.max_cost_exceeded", LIMITS_MAX_TURNS_EXCEEDED = "limits.max_turns_exceeded", LIMITS_MAX_WALLTIME_EXCEEDED = "limits.max_walltime_exceeded", LIMITS_ERROR_CODE_PREFIX = "limits.";
|
|
49110
49110
|
USAGE_WINDOW_EXHAUSTED = "usage.window_exhausted", ENV_LIFETIME_EXPIRED = "env.lifetime_expired", CONFIG_LIMIT_INVALID = "config.limit_invalid", CONFIG_STRATEGY_FIND_LIMIT_INVALID = "config.strategy_find_limit_invalid", CONFIG_STRATEGY_MAX_SIZE_INVALID = "config.strategy_max_size_invalid", CONFIG_LIMIT_UNKNOWN_KEY = "config.limit_unknown_key", CONFIG_DELEGATION_ENTRY_CAPS = "config.delegation_entry_caps", CONFIG_REFUSAL_CODES = /* @__PURE__ */ new Set([
|
|
@@ -49129,7 +49129,7 @@ var LIMITS_MAX_TOKENS_EXCEEDED, LIMITS_MAX_COST_EXCEEDED, LIMITS_MAX_TURNS_EXCEE
|
|
|
49129
49129
|
STOP_NOT_LOCAL,
|
|
49130
49130
|
STOP_PARKED
|
|
49131
49131
|
], OUTPUT_INVALID = "output.invalid", RESUME_AT_ERROR_CODE_PREFIX = "resume_at.", REWIND_ERROR_CODE_PREFIXES = [RESUME_AT_ERROR_CODE_PREFIX, "rewind_snapshot."];
|
|
49132
|
-
RESUME_USAGE_WINDOW_EXHAUSTED = "resume.usage_window_exhausted", RESUME_PREFLIGHT_REJECTED = "resume.preflight_rejected", RESUME_RETRY_LATER_CODES = Object.freeze([
|
|
49132
|
+
RESUME_USAGE_WINDOW_EXHAUSTED = "resume.usage_window_exhausted", RESUME_PREFLIGHT_REJECTED = "resume.preflight_rejected", RESUME_PLACEMENT_MISMATCH = "resume.placement_mismatch", RESUME_RETRY_LATER_CODES = Object.freeze([
|
|
49133
49133
|
RESUME_USAGE_WINDOW_EXHAUSTED,
|
|
49134
49134
|
RESUME_PREFLIGHT_REJECTED
|
|
49135
49135
|
]), DRAINING_ERROR_CODE = "draining", SCENARIO_NOT_ALLOWED_ERROR_CODE = "scenario_not_allowed", STREAM_MAX_DURATION = "STREAM_MAX_DURATION", MODEL_FALLBACK_INHERIT_NO_TIER_BINDING = "inherit_no_tier_binding";
|
|
@@ -50461,12 +50461,13 @@ var assistantArm, userArm, systemArm, diagnosticsArm, steeringInjectedArm, works
|
|
|
50461
50461
|
}, wiringManifestArm = function* (m2) {
|
|
50462
50462
|
if (m2.parentToolCallId !== void 0)
|
|
50463
50463
|
return;
|
|
50464
|
-
let modelGate = m2._sema_modelGate, autoMode = m2._sema_autoMode, hasGate = typeof modelGate == "object" && modelGate !== null, hasAuto = typeof autoMode == "object" && autoMode !== null;
|
|
50465
|
-
!hasGate && !hasAuto || (yield chrome({
|
|
50464
|
+
let modelGate = m2._sema_modelGate, autoMode = m2._sema_autoMode, mcp2 = m2._sema_mcp, hasGate = typeof modelGate == "object" && modelGate !== null, hasAuto = typeof autoMode == "object" && autoMode !== null, hasMcp = Array.isArray(mcp2);
|
|
50465
|
+
!hasGate && !hasAuto && !hasMcp || (yield chrome({
|
|
50466
50466
|
kind: "wiring_manifest",
|
|
50467
50467
|
laneProof: MAIN,
|
|
50468
50468
|
...hasGate ? { modelGate } : {},
|
|
50469
50469
|
...hasAuto ? { autoMode } : {},
|
|
50470
|
+
...hasMcp ? { mcp: mcp2 } : {},
|
|
50470
50471
|
...typeof m2.eventId == "string" && m2.eventId.length > 0 ? { eventId: m2.eventId } : {}
|
|
50471
50472
|
}));
|
|
50472
50473
|
}, textSegmentEndArm = function* (m2) {
|
|
@@ -51595,6 +51596,17 @@ function engineCapNestedTrue(baseUrl, parentKey, key) {
|
|
|
51595
51596
|
let parent2 = capsByBase.get(baseUrl)?.[parentKey];
|
|
51596
51597
|
return parent2 === null || typeof parent2 != "object" ? !1 : parent2[key] === !0;
|
|
51597
51598
|
}
|
|
51599
|
+
function engineCapValue(baseUrl, key) {
|
|
51600
|
+
if (!baseUrl)
|
|
51601
|
+
return { kind: "unobserved" };
|
|
51602
|
+
let caps = capsByBase.get(baseUrl);
|
|
51603
|
+
if (caps === void 0)
|
|
51604
|
+
return { kind: "unobserved" };
|
|
51605
|
+
if (!(key in caps))
|
|
51606
|
+
return { kind: "not_reported" };
|
|
51607
|
+
let v2 = caps[key];
|
|
51608
|
+
return v2 === void 0 ? { kind: "not_reported" } : v2 === null ? { kind: "null" } : { kind: "value", value: v2 };
|
|
51609
|
+
}
|
|
51598
51610
|
function engineCapString(baseUrl, key) {
|
|
51599
51611
|
if (!baseUrl)
|
|
51600
51612
|
return;
|
|
@@ -51615,6 +51627,123 @@ var capsByBase, inFlight, settleByBase, genByBase, init_engineCapsCache = __esm(
|
|
|
51615
51627
|
}
|
|
51616
51628
|
});
|
|
51617
51629
|
|
|
51630
|
+
// node_modules/@sema-agent/client-core/dist/principalWire.js
|
|
51631
|
+
function normalizeWirePrincipal(v2) {
|
|
51632
|
+
return v2 !== void 0 && v2.trim() !== "" ? v2 : void 0;
|
|
51633
|
+
}
|
|
51634
|
+
var init_principalWire = __esm({
|
|
51635
|
+
"node_modules/@sema-agent/client-core/dist/principalWire.js"() {
|
|
51636
|
+
}
|
|
51637
|
+
});
|
|
51638
|
+
|
|
51639
|
+
// node_modules/@sema-agent/client-core/dist/engineWireTarget.js
|
|
51640
|
+
function installEngineWireTarget(t2) {
|
|
51641
|
+
return installEngineWireTargetFor(DEFAULT_SESSION_KEY, t2);
|
|
51642
|
+
}
|
|
51643
|
+
function installEngineWireTargetFor(sessionKey, t2) {
|
|
51644
|
+
let prev = installedByKey.get(sessionKey);
|
|
51645
|
+
return installedByKey.set(sessionKey, t2), () => {
|
|
51646
|
+
installedByKey.set(sessionKey, prev);
|
|
51647
|
+
};
|
|
51648
|
+
}
|
|
51649
|
+
function engineWireTarget() {
|
|
51650
|
+
return engineWireTargetFor(DEFAULT_SESSION_KEY);
|
|
51651
|
+
}
|
|
51652
|
+
function engineWireTargetFor(sessionKey) {
|
|
51653
|
+
let installed6 = installedByKey.get(sessionKey) ?? null;
|
|
51654
|
+
if (installed6 !== null) {
|
|
51655
|
+
if (normalizeWirePrincipal(installed6.principal) === installed6.principal)
|
|
51656
|
+
return installed6;
|
|
51657
|
+
let { principal: _dropped, ...rest } = installed6;
|
|
51658
|
+
return rest;
|
|
51659
|
+
}
|
|
51660
|
+
let env6 = hostEnv(), baseUrl = env6.SEMA_LIVE_BASEURL;
|
|
51661
|
+
if (!baseUrl)
|
|
51662
|
+
return null;
|
|
51663
|
+
let envPrincipal = normalizeWirePrincipal(env6.SEMA_LIVE_PRINCIPAL);
|
|
51664
|
+
return {
|
|
51665
|
+
baseUrl,
|
|
51666
|
+
...env6.SEMA_LIVE_TOKEN ? { token: env6.SEMA_LIVE_TOKEN } : {},
|
|
51667
|
+
...envPrincipal !== void 0 ? { principal: envPrincipal } : {}
|
|
51668
|
+
};
|
|
51669
|
+
}
|
|
51670
|
+
function engineWireDebugEnabled() {
|
|
51671
|
+
return !!hostEnv().SEMA_DEBUG;
|
|
51672
|
+
}
|
|
51673
|
+
var installedByKey, init_engineWireTarget = __esm({
|
|
51674
|
+
"node_modules/@sema-agent/client-core/dist/engineWireTarget.js"() {
|
|
51675
|
+
init_hostEnv();
|
|
51676
|
+
init_sessionSlot();
|
|
51677
|
+
init_principalWire();
|
|
51678
|
+
installedByKey = createSessionSlot();
|
|
51679
|
+
}
|
|
51680
|
+
});
|
|
51681
|
+
|
|
51682
|
+
// node_modules/@sema-agent/client-core/dist/sqlEngineCapability.js
|
|
51683
|
+
function projectSqlEngineCapability(caps) {
|
|
51684
|
+
if (caps === null || typeof caps != "object")
|
|
51685
|
+
return;
|
|
51686
|
+
if (!("sql" in caps))
|
|
51687
|
+
return { kind: "not_reported" };
|
|
51688
|
+
let sql = caps.sql;
|
|
51689
|
+
if (sql === null)
|
|
51690
|
+
return { kind: "none" };
|
|
51691
|
+
if (sql === void 0)
|
|
51692
|
+
return { kind: "not_reported" };
|
|
51693
|
+
if (typeof sql != "object")
|
|
51694
|
+
return;
|
|
51695
|
+
let s = sql;
|
|
51696
|
+
if (!(typeof s.engine != "string" || s.engine === "") && !(typeof s.isolation != "string" || s.isolation === "") && !(s.txnMode !== null && (typeof s.txnMode != "string" || s.txnMode === "")))
|
|
51697
|
+
return { kind: "present", view: { engine: s.engine, isolation: s.isolation, txnMode: s.txnMode } };
|
|
51698
|
+
}
|
|
51699
|
+
function noteEngineCapsForSqlEngine(baseUrl, caps) {
|
|
51700
|
+
try {
|
|
51701
|
+
if (typeof baseUrl != "string" || baseUrl === "")
|
|
51702
|
+
return;
|
|
51703
|
+
let reading = projectSqlEngineCapability(caps);
|
|
51704
|
+
if (reading === void 0) {
|
|
51705
|
+
readingByBase.delete(baseUrl);
|
|
51706
|
+
return;
|
|
51707
|
+
}
|
|
51708
|
+
readingByBase.set(baseUrl, reading);
|
|
51709
|
+
} catch {
|
|
51710
|
+
}
|
|
51711
|
+
}
|
|
51712
|
+
function observedSqlEngine(baseUrl = engineWireTarget()?.baseUrl) {
|
|
51713
|
+
return typeof baseUrl != "string" || baseUrl === "" ? { kind: "unobserved" } : readingByBase.get(baseUrl) ?? { kind: "unobserved" };
|
|
51714
|
+
}
|
|
51715
|
+
function cleanSqlDetailScalar(v2) {
|
|
51716
|
+
return escapeDisplayControlChars(v2.slice(0, SQL_DETAIL_MAX));
|
|
51717
|
+
}
|
|
51718
|
+
function sqlEngineDoctorDetail(reading) {
|
|
51719
|
+
switch (reading.kind) {
|
|
51720
|
+
case "unobserved":
|
|
51721
|
+
return "not observed \u2014 the engine reports it on /v1/capabilities; this process has not received a capabilities response from the engine yet";
|
|
51722
|
+
case "not_reported":
|
|
51723
|
+
return "not reported by this engine \u2014 the capability position needs a newer engine";
|
|
51724
|
+
case "none":
|
|
51725
|
+
return "none \u2014 the engine reports no SQL engine posture: either this deployment has no SQL backend, or its initialization was refused (the engine log says which)";
|
|
51726
|
+
case "present": {
|
|
51727
|
+
let e = cleanSqlDetailScalar(reading.view.engine), i = cleanSqlDetailScalar(reading.view.isolation), t2 = reading.view.txnMode === null ? "no txn-mode indicator on this engine" : cleanSqlDetailScalar(reading.view.txnMode);
|
|
51728
|
+
return `${e} \xB7 isolation ${i} \xB7 txn ${t2}`;
|
|
51729
|
+
}
|
|
51730
|
+
}
|
|
51731
|
+
}
|
|
51732
|
+
function forgetSqlEngineReading(baseUrl) {
|
|
51733
|
+
typeof baseUrl != "string" || baseUrl === "" || readingByBase.delete(baseUrl);
|
|
51734
|
+
}
|
|
51735
|
+
function __resetSqlEngineReadingsForTests() {
|
|
51736
|
+
readingByBase.clear();
|
|
51737
|
+
}
|
|
51738
|
+
var readingByBase, SQL_DETAIL_MAX, init_sqlEngineCapability = __esm({
|
|
51739
|
+
"node_modules/@sema-agent/client-core/dist/sqlEngineCapability.js"() {
|
|
51740
|
+
init_fleetTaskDesc();
|
|
51741
|
+
init_engineWireTarget();
|
|
51742
|
+
readingByBase = /* @__PURE__ */ new Map();
|
|
51743
|
+
SQL_DETAIL_MAX = 40;
|
|
51744
|
+
}
|
|
51745
|
+
});
|
|
51746
|
+
|
|
51618
51747
|
// node_modules/@sema-agent/client-core/dist/adapter/types.js
|
|
51619
51748
|
function eventSeq(ev) {
|
|
51620
51749
|
return ev.id;
|
|
@@ -51883,15 +52012,6 @@ var SSE_HEARTBEAT_GRACE_ENV, SSE_GRACE_MIN_MS, SSE_GRACE_MAX_MS, SDK_DEFAULT_GRA
|
|
|
51883
52012
|
}
|
|
51884
52013
|
});
|
|
51885
52014
|
|
|
51886
|
-
// node_modules/@sema-agent/client-core/dist/principalWire.js
|
|
51887
|
-
function normalizeWirePrincipal(v2) {
|
|
51888
|
-
return v2 !== void 0 && v2.trim() !== "" ? v2 : void 0;
|
|
51889
|
-
}
|
|
51890
|
-
var init_principalWire = __esm({
|
|
51891
|
-
"node_modules/@sema-agent/client-core/dist/principalWire.js"() {
|
|
51892
|
-
}
|
|
51893
|
-
});
|
|
51894
|
-
|
|
51895
52015
|
// node_modules/@sema-agent/client-core/dist/engineWireSdk.js
|
|
51896
52016
|
import { AgentClient } from "@sema-agent/sdk";
|
|
51897
52017
|
function isLoopbackWireUrl(url3) {
|
|
@@ -53106,7 +53226,7 @@ function eventToSdkMessage(ev, ctx) {
|
|
|
53106
53226
|
// falls back to the mock synthesizer (events.d.ts:79). Not a renderable CC SDKMessage —
|
|
53107
53227
|
// a side-channel arm `sdkMessagesToCcEvents` reads; CC's own renderer never sees it.
|
|
53108
53228
|
case "tool_end": {
|
|
53109
|
-
let structured = ev.structured, toolEndErrorCode = ev.errorCode, toolEndSettledBy = ev.settledBy, toolEndApprover = ev.approver, toolEndResolution = ev.resolution, collateralAbort = ev._sema_collateral_abort;
|
|
53229
|
+
let structured = ev.structured, toolEndErrorCode = ev.errorCode, toolEndSettledBy = ev.settledBy, toolEndApprover = ev.approver, toolEndResolution = ev.resolution, toolEndAutoDenied = ev.autoDenied, collateralAbort = ev._sema_collateral_abort;
|
|
53110
53230
|
return projected(stamp(ctx, {
|
|
53111
53231
|
type: "tool_end_result",
|
|
53112
53232
|
toolCallId: ev.toolCallId,
|
|
@@ -53125,6 +53245,8 @@ function eventToSdkMessage(ev, ctx) {
|
|
|
53125
53245
|
...typeof toolEndApprover == "string" && toolEndApprover.length > 0 ? { approver: toolEndApprover } : {},
|
|
53126
53246
|
// A-D2:拒绝臂分类(开集、缺席不铸、在场原样;判据本体是上方那段头注)。
|
|
53127
53247
|
...typeof toolEndResolution == "string" && toolEndResolution.length > 0 ? { resolution: toolEndResolution } : {},
|
|
53248
|
+
// S-125⑧:自动拒判别位(**严格 true** 才上臂;见上方头注)。
|
|
53249
|
+
...toolEndAutoDenied === !0 ? { autoDenied: !0 } : {},
|
|
53128
53250
|
// #324:连坐 abort 机读位(严格 true 才上臂;见上方头注)。
|
|
53129
53251
|
...collateralAbort === !0 ? { _sema_collateral_abort: !0 } : {},
|
|
53130
53252
|
...ev.eventId !== void 0 ? { eventId: ev.eventId } : {},
|
|
@@ -53425,6 +53547,25 @@ function eventToSdkMessage(ev, ctx) {
|
|
|
53425
53547
|
*/
|
|
53426
53548
|
case "approval_request":
|
|
53427
53549
|
return dropped("unsupported_arm", "approval_request");
|
|
53550
|
+
/**
|
|
53551
|
+
* `approval_revoke`(design/172 撤卡帧;server ≥7.55.0 起也进重放,SDK 8.x 才把它写进
|
|
53552
|
+
* `AgentEvent` union —— 0.58.0 sdk 8.2.0 提货批**编译期逼进来**的臂,与 `engine_notice`
|
|
53553
|
+
* / `human_input` 走的是同一条路:臂一进 union,`default` 的 B5 穷举断言当场红)。
|
|
53554
|
+
*
|
|
53555
|
+
* 🔴 **与 `approval_request` 同源同处置,所以并**在它旁边而不是并进上面那两条 —— 它是
|
|
53556
|
+
* 同一条流内审批协议的**撤销**半场(载荷同是 `ApprovalFrameEnvelope`,`schemaVersion`
|
|
53557
|
+
* 未知的帧要按信封先读再窄化)。本包今天**零消费口**:`isToolApprovalFrame` 只认
|
|
53558
|
+
* legacy 的 `tool_approval` / `tool_approval_complete` 两词,新族两帧一个都不接。
|
|
53559
|
+
* 🔴 分类 = `dropped/unsupported_arm` 而**不是** `nothing/not_in_slice`(与
|
|
53560
|
+
* `approval_request` 同一条理由,逐字见上一臂):`none` 是静默的,只有 `dropped` 会经
|
|
53561
|
+
* `reportDroppedFrame` 走宿主 sink + console 留痕。撤卡帧带的是**用户可见的状态迁移**
|
|
53562
|
+
* (那张卡已经不该再被决断了),悄悄丢掉它比吼一行更坏。
|
|
53563
|
+
* 📋 缺口如实记账(**不**在本批修 —— 与 `approval_request` 是同一条新卡链,属功能不属修复):
|
|
53564
|
+
* 接法在上一臂的「接法」段里写着,撤卡半场按 `approvalId` 撤同一张卡;在那条链落地之前
|
|
53565
|
+
* **不许**由本切片顺手编一个假 transcript 形来假装接上了。
|
|
53566
|
+
*/
|
|
53567
|
+
case "approval_revoke":
|
|
53568
|
+
return dropped("unsupported_arm", "approval_revoke");
|
|
53428
53569
|
// ── `engine_notice`(#310 / #318 件①,server ≥7.36,契约 = ASSISTANT-WIRE-CONTRACT 附录 D)────
|
|
53429
53570
|
// 🔴 **到期复核已兑现(sdk 7.4.0 提货,0.48.0)** —— 与 `human_input`(sdk 6.9.0)逐字同一条路。
|
|
53430
53571
|
// 本臂此前是 switch **之前**的一条 raw 预分派,理由 = 它还没进已发布 SDK 的 `AgentEvent`
|
|
@@ -53456,6 +53597,25 @@ function textEndProjection(ev, ctx) {
|
|
|
53456
53597
|
...typeof ev.parentToolCallId == "string" ? { parentToolCallId: ev.parentToolCallId } : {}
|
|
53457
53598
|
}));
|
|
53458
53599
|
}
|
|
53600
|
+
function projectMcpSection(raw2) {
|
|
53601
|
+
if (!Array.isArray(raw2))
|
|
53602
|
+
return;
|
|
53603
|
+
let rows2 = [];
|
|
53604
|
+
for (let e of raw2) {
|
|
53605
|
+
if (typeof e != "object" || e === null || Array.isArray(e))
|
|
53606
|
+
continue;
|
|
53607
|
+
let r = e, name = typeof r.name == "string" && r.name.length > 0 ? r.name : void 0, status3 = typeof r.status == "string" && r.status.length > 0 ? r.status : void 0;
|
|
53608
|
+
name === void 0 || status3 === void 0 || rows2.push({
|
|
53609
|
+
name,
|
|
53610
|
+
status: status3,
|
|
53611
|
+
...typeof r.source == "string" && r.source.length > 0 ? { source: r.source } : {},
|
|
53612
|
+
...typeof r.errorCode == "string" && r.errorCode.length > 0 ? { errorCode: r.errorCode } : {},
|
|
53613
|
+
...typeof r.toolCount == "number" && Number.isFinite(r.toolCount) ? { toolCount: r.toolCount } : {}
|
|
53614
|
+
});
|
|
53615
|
+
}
|
|
53616
|
+
if (!(raw2.length > 0 && rows2.length === 0))
|
|
53617
|
+
return rows2;
|
|
53618
|
+
}
|
|
53459
53619
|
function projectModelGateSection(raw2) {
|
|
53460
53620
|
if (typeof raw2 != "object" || raw2 === null || Array.isArray(raw2))
|
|
53461
53621
|
return;
|
|
@@ -53471,11 +53631,12 @@ function projectAutoModeSection(raw2) {
|
|
|
53471
53631
|
return { armed: armed3, reason };
|
|
53472
53632
|
}
|
|
53473
53633
|
function wiringManifestSupersetBody(ev) {
|
|
53474
|
-
let modelGate = projectModelGateSection(ev.modelGate), autoMode = projectAutoModeSection(ev.autoMode);
|
|
53475
|
-
if (!(modelGate === void 0 && autoMode === void 0))
|
|
53634
|
+
let modelGate = projectModelGateSection(ev.modelGate), autoMode = projectAutoModeSection(ev.autoMode), mcp2 = projectMcpSection(ev.mcp);
|
|
53635
|
+
if (!(modelGate === void 0 && autoMode === void 0 && mcp2 === void 0))
|
|
53476
53636
|
return {
|
|
53477
53637
|
...modelGate !== void 0 ? { _sema_modelGate: modelGate } : {},
|
|
53478
|
-
...autoMode !== void 0 ? { _sema_autoMode: autoMode } : {}
|
|
53638
|
+
...autoMode !== void 0 ? { _sema_autoMode: autoMode } : {},
|
|
53639
|
+
...mcp2 !== void 0 ? { _sema_mcp: mcp2 } : {}
|
|
53479
53640
|
};
|
|
53480
53641
|
}
|
|
53481
53642
|
function engineNoticeProjection(ev, ctx) {
|
|
@@ -55354,49 +55515,6 @@ var HEADLESS_RECONNECT_MAX, RUN_ROW_TERMINAL_STATUSES, init_headlessReconnectWir
|
|
|
55354
55515
|
}
|
|
55355
55516
|
});
|
|
55356
55517
|
|
|
55357
|
-
// node_modules/@sema-agent/client-core/dist/engineWireTarget.js
|
|
55358
|
-
function installEngineWireTarget(t2) {
|
|
55359
|
-
return installEngineWireTargetFor(DEFAULT_SESSION_KEY, t2);
|
|
55360
|
-
}
|
|
55361
|
-
function installEngineWireTargetFor(sessionKey, t2) {
|
|
55362
|
-
let prev = installedByKey.get(sessionKey);
|
|
55363
|
-
return installedByKey.set(sessionKey, t2), () => {
|
|
55364
|
-
installedByKey.set(sessionKey, prev);
|
|
55365
|
-
};
|
|
55366
|
-
}
|
|
55367
|
-
function engineWireTarget() {
|
|
55368
|
-
return engineWireTargetFor(DEFAULT_SESSION_KEY);
|
|
55369
|
-
}
|
|
55370
|
-
function engineWireTargetFor(sessionKey) {
|
|
55371
|
-
let installed6 = installedByKey.get(sessionKey) ?? null;
|
|
55372
|
-
if (installed6 !== null) {
|
|
55373
|
-
if (normalizeWirePrincipal(installed6.principal) === installed6.principal)
|
|
55374
|
-
return installed6;
|
|
55375
|
-
let { principal: _dropped, ...rest } = installed6;
|
|
55376
|
-
return rest;
|
|
55377
|
-
}
|
|
55378
|
-
let env6 = hostEnv(), baseUrl = env6.SEMA_LIVE_BASEURL;
|
|
55379
|
-
if (!baseUrl)
|
|
55380
|
-
return null;
|
|
55381
|
-
let envPrincipal = normalizeWirePrincipal(env6.SEMA_LIVE_PRINCIPAL);
|
|
55382
|
-
return {
|
|
55383
|
-
baseUrl,
|
|
55384
|
-
...env6.SEMA_LIVE_TOKEN ? { token: env6.SEMA_LIVE_TOKEN } : {},
|
|
55385
|
-
...envPrincipal !== void 0 ? { principal: envPrincipal } : {}
|
|
55386
|
-
};
|
|
55387
|
-
}
|
|
55388
|
-
function engineWireDebugEnabled() {
|
|
55389
|
-
return !!hostEnv().SEMA_DEBUG;
|
|
55390
|
-
}
|
|
55391
|
-
var installedByKey, init_engineWireTarget = __esm({
|
|
55392
|
-
"node_modules/@sema-agent/client-core/dist/engineWireTarget.js"() {
|
|
55393
|
-
init_hostEnv();
|
|
55394
|
-
init_sessionSlot();
|
|
55395
|
-
init_principalWire();
|
|
55396
|
-
installedByKey = createSessionSlot();
|
|
55397
|
-
}
|
|
55398
|
-
});
|
|
55399
|
-
|
|
55400
55518
|
// node_modules/@sema-agent/client-core/dist/engineSessionParam.js
|
|
55401
55519
|
function engineSessionParamFor(sessionKey) {
|
|
55402
55520
|
let sid = hostSessionFor(sessionKey)?.currentSessionId();
|
|
@@ -56641,6 +56759,37 @@ var capByBase2, CAP_FALSE_RETRY_TTL_MS2, activeTails, activitySink, tailMetaSink
|
|
|
56641
56759
|
}
|
|
56642
56760
|
});
|
|
56643
56761
|
|
|
56762
|
+
// node_modules/@sema-agent/client-core/dist/resumeRefusalCopy.js
|
|
56763
|
+
function resumeRefusalFromError(err8) {
|
|
56764
|
+
if (typeof err8 != "object" || err8 === null)
|
|
56765
|
+
return null;
|
|
56766
|
+
let code2 = err8.errorCode;
|
|
56767
|
+
if (typeof code2 != "string" || !RESUME_REFUSAL_CODES.includes(code2))
|
|
56768
|
+
return null;
|
|
56769
|
+
if (code2 === RESUME_PLACEMENT_MISMATCH)
|
|
56770
|
+
return { code: code2, waitable: !1 };
|
|
56771
|
+
let timed = resumeRetryLaterFromError(err8);
|
|
56772
|
+
return timed === null ? { code: code2, waitable: !1 } : {
|
|
56773
|
+
code: code2,
|
|
56774
|
+
waitable: timed.waitable,
|
|
56775
|
+
...timed.retryAfterSec !== void 0 ? { retryAfterSec: timed.retryAfterSec } : {}
|
|
56776
|
+
};
|
|
56777
|
+
}
|
|
56778
|
+
function resumeRefusalContent(detail) {
|
|
56779
|
+
let parts = [];
|
|
56780
|
+
return detail.code === RESUME_PLACEMENT_MISMATCH ? (parts.push("This resume named a different placement root than the one recorded when the work was parked"), parts.push("The engine refused it before consuming anything \u2014 the parked work is untouched"), parts.push("Retry with the recorded root, or omit the placement root to inherit it"), parts.join(" \xB7 ")) : (parts.push("The deployment's resume preflight refused this attempt"), parts.push("The refusal happened before the commit \u2014 your decision was not consumed"), parts.push(detail.waitable ? "The engine supplied a wait, so this token stays redeemable once the obstacle clears" : "The engine line above says whether this token can still be redeemed"), parts.join(" \xB7 "));
|
|
56781
|
+
}
|
|
56782
|
+
var RESUME_REFUSAL_CODES, init_resumeRefusalCopy = __esm({
|
|
56783
|
+
"node_modules/@sema-agent/client-core/dist/resumeRefusalCopy.js"() {
|
|
56784
|
+
init_engineErrorCodes();
|
|
56785
|
+
init_wireErrorTriage();
|
|
56786
|
+
RESUME_REFUSAL_CODES = Object.freeze([
|
|
56787
|
+
RESUME_PLACEMENT_MISMATCH,
|
|
56788
|
+
RESUME_PREFLIGHT_REJECTED
|
|
56789
|
+
]);
|
|
56790
|
+
}
|
|
56791
|
+
});
|
|
56792
|
+
|
|
56644
56793
|
// node_modules/@sema-agent/client-core/dist/sessionMap.js
|
|
56645
56794
|
function engineNamespaceKeyFor(baseUrl) {
|
|
56646
56795
|
if (!baseUrl)
|
|
@@ -59420,6 +59569,7 @@ var HITL_ASK_QUESTION_ID_PREFIX, PLAN_REVIEW_QUESTION_ID_PREFIX, HITL_FRAME_CALL
|
|
|
59420
59569
|
});
|
|
59421
59570
|
|
|
59422
59571
|
// node_modules/@sema-agent/client-core/dist/hitl/toolApprovalWire.js
|
|
59572
|
+
import { RULE_OFFER_MATCHES, RULE_OFFER_BATCH_MEMBER_KINDS, RULE_OFFER_UNCOVERED_REASONS, RULE_OFFERS_ABSENCE_REASONS, DENIAL_LIMIT_KINDS } from "@sema-agent/sdk";
|
|
59423
59573
|
function isFsApprovalGate(gate) {
|
|
59424
59574
|
return gate ? gate.kind === "tool_approval" ? !0 : typeof gate.toolName == "string" && toolNameIsFsWrite(gate.toolName) : !1;
|
|
59425
59575
|
}
|
|
@@ -59684,13 +59834,58 @@ function isNonNegativeFinite(v2) {
|
|
|
59684
59834
|
function isWireRecordCarrier(v2) {
|
|
59685
59835
|
return typeof v2 == "object" && v2 !== null && !Array.isArray(v2);
|
|
59686
59836
|
}
|
|
59837
|
+
function readDenialLimitFallback(v2) {
|
|
59838
|
+
if (!isWireRecordCarrier(v2))
|
|
59839
|
+
return;
|
|
59840
|
+
let d4 = v2;
|
|
59841
|
+
if (isNonNegativeFinite(d4.consecutive) && isNonNegativeFinite(d4.total) && isNonNegativeFinite(d4.autoDenyAfterMs) && !(typeof d4.limit != "string" || d4.limit === ""))
|
|
59842
|
+
return {
|
|
59843
|
+
consecutive: d4.consecutive,
|
|
59844
|
+
total: d4.total,
|
|
59845
|
+
limit: d4.limit,
|
|
59846
|
+
autoDenyAfterMs: d4.autoDenyAfterMs
|
|
59847
|
+
};
|
|
59848
|
+
}
|
|
59849
|
+
function isRuleOfferMatch(v2) {
|
|
59850
|
+
return typeof v2 == "string" && RULE_OFFER_MATCHES.includes(v2);
|
|
59851
|
+
}
|
|
59687
59852
|
function readRuleTriple(v2) {
|
|
59688
59853
|
if (v2 === null || typeof v2 != "object")
|
|
59689
59854
|
return;
|
|
59690
59855
|
let o = v2;
|
|
59691
|
-
if (!(typeof o.rule != "string" || o.rule === "") &&
|
|
59856
|
+
if (!(typeof o.rule != "string" || o.rule === "") && isRuleOfferMatch(o.match) && !(typeof o.command != "string" || o.command === ""))
|
|
59692
59857
|
return { rule: o.rule, match: o.match, command: o.command };
|
|
59693
59858
|
}
|
|
59859
|
+
function readRuleOfferBatchMember(v2) {
|
|
59860
|
+
if (v2 === null || typeof v2 != "object")
|
|
59861
|
+
return;
|
|
59862
|
+
let o = v2, seg = o.segment;
|
|
59863
|
+
if (typeof seg != "string" || seg === "")
|
|
59864
|
+
return;
|
|
59865
|
+
let kind = o.kind === void 0 ? "command" : o.kind;
|
|
59866
|
+
if (typeof kind == "string" && RULE_OFFER_BATCH_MEMBER_KINDS.includes(kind)) {
|
|
59867
|
+
if (kind === "directoryRead") {
|
|
59868
|
+
let rule = o.rule, dir = o.directory;
|
|
59869
|
+
return typeof rule != "string" || rule === "" || typeof dir != "string" || dir === "" ? void 0 : { kind: "directoryRead", rule, directory: dir, segment: seg };
|
|
59870
|
+
}
|
|
59871
|
+
if (kind === "command") {
|
|
59872
|
+
let triple = readRuleTriple(v2);
|
|
59873
|
+
return triple === void 0 ? void 0 : { kind: "command", ...triple, segment: seg };
|
|
59874
|
+
}
|
|
59875
|
+
}
|
|
59876
|
+
}
|
|
59877
|
+
function readUncoveredDetail(v2) {
|
|
59878
|
+
if (!Array.isArray(v2) || v2.length === 0 || v2.length > MAX_RULE_OFFER_UNCOVERED_DETAIL_TOLERATED)
|
|
59879
|
+
return;
|
|
59880
|
+
let out6 = [];
|
|
59881
|
+
for (let raw2 of v2) {
|
|
59882
|
+
if (raw2 === null || typeof raw2 != "object")
|
|
59883
|
+
continue;
|
|
59884
|
+
let o = raw2;
|
|
59885
|
+
typeof o.segment != "string" || o.segment === "" || typeof o.reason == "string" && RULE_OFFER_UNCOVERED_REASONS.includes(o.reason) && out6.push({ segment: o.segment, reason: o.reason });
|
|
59886
|
+
}
|
|
59887
|
+
return out6.length > 0 ? out6 : void 0;
|
|
59888
|
+
}
|
|
59694
59889
|
function readRuleOffers(v2) {
|
|
59695
59890
|
if (!Array.isArray(v2) || v2.length === 0 || v2.length > MAX_RULE_OFFERS_TOLERATED)
|
|
59696
59891
|
return;
|
|
@@ -59715,16 +59910,23 @@ function readRuleOffers(v2) {
|
|
|
59715
59910
|
continue;
|
|
59716
59911
|
let members = [], memberShapeOk = !0;
|
|
59717
59912
|
for (let raw2 of o.rules) {
|
|
59718
|
-
let
|
|
59719
|
-
if (
|
|
59913
|
+
let member = readRuleOfferBatchMember(raw2);
|
|
59914
|
+
if (member === void 0) {
|
|
59720
59915
|
memberShapeOk = !1;
|
|
59721
59916
|
break;
|
|
59722
59917
|
}
|
|
59723
|
-
members.push(
|
|
59918
|
+
members.push(member);
|
|
59724
59919
|
}
|
|
59725
59920
|
if (!memberShapeOk)
|
|
59726
59921
|
continue;
|
|
59727
|
-
|
|
59922
|
+
let detail = readUncoveredDetail(item.uncoveredDetail);
|
|
59923
|
+
out6.push({
|
|
59924
|
+
kind: "batch",
|
|
59925
|
+
offerIndex: i,
|
|
59926
|
+
rules: members,
|
|
59927
|
+
uncoveredSegments: uncovered,
|
|
59928
|
+
...detail !== void 0 ? { uncoveredDetail: detail } : {}
|
|
59929
|
+
});
|
|
59728
59930
|
continue;
|
|
59729
59931
|
}
|
|
59730
59932
|
}
|
|
@@ -59762,7 +59964,7 @@ async function surfaceToolApprovalFrameAndRespond(frame, respond, streamArgs, si
|
|
|
59762
59964
|
let p = pathFromGateMessage(frame.message);
|
|
59763
59965
|
args = p !== void 0 ? { file_path: p } : {};
|
|
59764
59966
|
}
|
|
59765
|
-
let ruleOffers = readRuleOfferSupply(frame.ruleOffers, frame.ruleSuggestions), card = await surfaceApprovalCard({
|
|
59967
|
+
let ruleOffers = readRuleOfferSupply(frame.ruleOffers, frame.ruleSuggestions), denialLimitFallback = readDenialLimitFallback(frame.denialLimitFallback), card = await surfaceApprovalCard({
|
|
59766
59968
|
toolName: toolName2,
|
|
59767
59969
|
args,
|
|
59768
59970
|
// A-028.3:live 帧腿的卡身份键经 gateIdentity 唯一铸口(帧上无 gatedCallId,以 approvalId 铸)。
|
|
@@ -59823,7 +60025,22 @@ async function surfaceToolApprovalFrameAndRespond(frame, respond, streamArgs, si
|
|
|
59823
60025
|
// requiresRealApproval 同一条纪律 —— 缺席同时覆盖「真的没有」与「扫不了」,折成显式 false 会把
|
|
59824
60026
|
// 「没扫到」渲成「已确认干净」,而这一位存在的全部理由就是「人眼读到的顺序 ≠ 真跑的字节顺序」。
|
|
59825
60027
|
// 🔴 披露不清洗:args 字节在本层一个都不改(清洗会让卡上显示的与真跑的不是同一个东西)。
|
|
59826
|
-
...frame.inputHasBidi === !0 ? { inputHasBidi: !0 } : {}
|
|
60028
|
+
...frame.inputHasBidi === !0 ? { inputHasBidi: !0 } : {},
|
|
60029
|
+
// ── S-15 第五单(0.59.0):报价缺席因由透传 ────────────────────────────────────────────────
|
|
60030
|
+
// **非空串才 stamp**,词表**不校**(开集;server 已按闭集拒过词表外的值,包再校一遍只会在
|
|
60031
|
+
// core 加员当天把合法值判没 —— `autoMode.reason` 的透传纪律逐字同规)。缺席/坏形 ⇒ 键不 stamp。
|
|
60032
|
+
// 🔴 与 `ruleOffers` 引擎侧互斥,但本层**不据此互删**:两者同时在场是上游坏形,原样上卡让端
|
|
60033
|
+
// 看得见,包替上游把矛盾湮灭掉只会让排障说不清是谁窄没的。
|
|
60034
|
+
...typeof frame.ruleOffersAbsence == "string" && frame.ruleOffersAbsence !== "" ? { ruleOffersAbsence: frame.ruleOffersAbsence } : {},
|
|
60035
|
+
// ── S-114(0.59.0):auto 分类器限额回落卡透传 ──────────────────────────────────────────────
|
|
60036
|
+
// 经 `readDenialLimitFallback` 四成员窄读(缺一整只丢;判据本体在该函数顶注)。
|
|
60037
|
+
// 🔴 stamp 的是**窄读产物**而不是原对象:端拿到的四座恒是有限非负数 + 非空 limit 串,
|
|
60038
|
+
// 不必各自再写一遍同样的判断(三端各写一遍 = 三份会漂的判官)。
|
|
60039
|
+
...denialLimitFallback !== void 0 ? { denialLimitFallback } : {},
|
|
60040
|
+
// ── S-125③/#564(0.59.0):ask 出身透传 ────────────────────────────────────────────────────
|
|
60041
|
+
// 非空串才 stamp,词表**不校**(同 ruleOffersAbsence)。🔴 缺席 ⇒ 键不 stamp,**绝不折成
|
|
60042
|
+
// `"policy"`**:那是一个正面事实(出自部署 ToolPolicy),把「老引擎没报」折进去 = 替引擎编话。
|
|
60043
|
+
...typeof frame.origin == "string" && frame.origin !== "" ? { origin: frame.origin } : {}
|
|
59827
60044
|
}), decision = card.kind === "allow" ? card.allowSession ? "allow_session" : "allow" : "deny";
|
|
59828
60045
|
card.kind === "failed" && hostLog("debug", `liveToolApprovalWire: approval card unavailable (${card.reason}) \u2014 fail-closed deny for ${frame.approvalId}`);
|
|
59829
60046
|
let note;
|
|
@@ -59863,7 +60080,7 @@ async function surfaceToolApprovalFrameAndRespond(frame, respond, streamArgs, si
|
|
|
59863
60080
|
return hostLog("debug", `liveToolApprovalWire: respond(${decision}) failed for ${frame.approvalId} (status=${respondRefusal?.status ?? "none"} errorCode=${logSafeErrorCode(respondRefusal?.errorCode)} messageLen=${respondRefusal?.message?.length ?? 0}) \u2014 engine self-settles (TTL/abort); the refusal text is handed back on outcome.respondRefusal for the host to surface`), respondRefusal !== void 0 ? { decision: "unresolved", respondRefusal } : { decision: "unresolved" };
|
|
59864
60081
|
}
|
|
59865
60082
|
}
|
|
59866
|
-
var cardPortByKey, cardPortMissesByKey, TOOL_APPROVAL_FRAME_KEYS_MIRROR, RESPOND_DECISIONS, USELESS_REFUSAL_TEXTS, MACHINE_CODE_SHAPE, FS_WRITE_GATE_ASK_PATTERN, MAX_RULE_OFFERS_TOLERATED, MAX_RULE_OFFER_BATCH_MEMBERS_TOLERATED, MAX_RESPOND_NOTE_CHARS, init_toolApprovalWire = __esm({
|
|
60083
|
+
var cardPortByKey, cardPortMissesByKey, TOOL_APPROVAL_FRAME_KEYS_MIRROR, RESPOND_DECISIONS, USELESS_REFUSAL_TEXTS, MACHINE_CODE_SHAPE, FS_WRITE_GATE_ASK_PATTERN, MAX_RULE_OFFERS_TOLERATED, MAX_RULE_OFFER_BATCH_MEMBERS_TOLERATED, MAX_RULE_OFFER_UNCOVERED_DETAIL_TOLERATED, MAX_RESPOND_NOTE_CHARS, init_toolApprovalWire = __esm({
|
|
59867
60084
|
"node_modules/@sema-agent/client-core/dist/hitl/toolApprovalWire.js"() {
|
|
59868
60085
|
init_hitlBridge();
|
|
59869
60086
|
init_host();
|
|
@@ -59890,16 +60107,29 @@ var cardPortByKey, cardPortMissesByKey, TOOL_APPROVAL_FRAME_KEYS_MIRROR, RESPOND
|
|
|
59890
60107
|
"governanceForced",
|
|
59891
60108
|
// sdk 6.14.0 追平(#225 件1,client-core 0.26.0):server 7.12.0 起真发规则候选 —— 门
|
|
59892
60109
|
// (run-approval-frame-keys-test.mjs)在 bump SDK 当天恰红抓获本键缺席,本次补齐。
|
|
59893
|
-
// ⚠️ **退役键**(server 7.46.0 起同文件 0 命中):留在镜像里是因为 sdk
|
|
60110
|
+
// ⚠️ **退役键**(server 7.46.0 起同文件 0 命中):留在镜像里是因为 sdk 8.2.0 的运行期锚仍含它,
|
|
59894
60111
|
// 删了对账门的「SDK 锚的每个键本仓都有」当场红;本包对它只做归一读(见帧上同名键的 JSDoc)。
|
|
59895
60112
|
"ruleSuggestions",
|
|
59896
60113
|
// #334/[5223](client-core 0.43.0):server 7.46.0 起把规则候选整体换成判别联合 `ruleOffers`
|
|
59897
60114
|
// (core 5.58.0 design/375;engine 7.46.0 fixture 的 `@sema-agent/server/dist/tool-approval.d.ts`
|
|
59898
|
-
// 直证,同文件旧键 0 命中)
|
|
59899
|
-
//
|
|
60115
|
+
// 直证,同文件旧键 0 命中)。✅ **sdk 8.2.0 锚已含本键**(S-134 锚②)⇒ 0.58.0 提货批按退出
|
|
60116
|
+
// 条件删掉了对账门里那条 AHEAD_OF_ANCHOR 领先登记,本键回到「逐元素相等」的常态。
|
|
59900
60117
|
"ruleOffers",
|
|
60118
|
+
// S-15 第五单(client-core 0.59.0):server 7.55.0 起真发 `ruleOffersAbsence`(core #490 修②;
|
|
60119
|
+
// engine 7.60.0 fixture 直证)。⚠️ 与 `ruleOffers` **同形不同命**:它是**追平**不是领先 ——
|
|
60120
|
+
// sdk 8.3.0 的运行期锚已含本键(node 直读 27 项实证)⇒ **不**进 AHEAD_OF_ANCHOR
|
|
60121
|
+
// (往那张表里塞一个锚已有的键,它的第二条退出条件当场红)。
|
|
60122
|
+
"ruleOffersAbsence",
|
|
60123
|
+
// S-114(client-core 0.59.0):server 7.57.0 起真发 `denialLimitFallback`(core 7.4.0 #548;
|
|
60124
|
+
// engine 7.60.0 fixture 直证)。同上一条:sdk 8.3.0 锚已含本键 ⇒ 追平,不进领先表。
|
|
60125
|
+
// 🔴 本键与 `requiresRealApproval` 是孪生键,但两者在镜像里各占一格 —— 合并会让「只有一位在场」
|
|
60126
|
+
// 的坏形无处显形。
|
|
60127
|
+
"denialLimitFallback",
|
|
60128
|
+
// S-125③/#564(client-core 0.59.0):server 7.57.0 起真发 `origin`(core 7.5.0 `ASK_ORIGINS`
|
|
60129
|
+
// 八词;engine 7.60.0 fixture 直证)。同上:sdk 8.3.0 锚已含本键 ⇒ 追平,不进领先表。
|
|
60130
|
+
"origin",
|
|
59901
60131
|
// #341/[5214]③(client-core 0.43.0):server 7.46.0 起真发 `inputHasBidi`(E-14 Trojan Source 族;
|
|
59902
|
-
// 7.44 fixture 同文件 0 命中)
|
|
60132
|
+
// 7.44 fixture 同文件 0 命中)。仍**领先** sdk 8.2.0 锚(node 直读 18 项无本键)⇒ AHEAD_OF_ANCHOR 登记。
|
|
59903
60133
|
"inputHasBidi",
|
|
59904
60134
|
// 🔴 **同形族扫的产物**(client-core 0.43.0,[same-shape-residue-constitution]):本批的病形是
|
|
59905
60135
|
// 「镜像滞后于 server 实发键」。族扫 = 把 engine 7.46.0 fixture 的 `ToolApprovalFrame` 23 个声明键
|
|
@@ -59929,7 +60159,7 @@ var cardPortByKey, cardPortMissesByKey, TOOL_APPROVAL_FRAME_KEYS_MIRROR, RESPOND
|
|
|
59929
60159
|
"requiresRealApproval",
|
|
59930
60160
|
// [4851] 头号请托(client-core 0.38.2):server 7.34.0 起真发窗三键(#288/[4429]② cli 自己请托,
|
|
59931
60161
|
// server src/tool-approval.ts 三键声明+条件 stamp)。⚠️ 与 requiresRealApproval 同形=**领先** SDK
|
|
59932
|
-
// 运行期锚(sdk
|
|
60162
|
+
// 运行期锚(sdk 8.2.0 锚 18 项,node 直读实证无三键)⇒ 进对账门 AHEAD_OF_ANCHOR 带退出条件登记
|
|
59933
60163
|
// (SDK 追平当天登记自红逼删)。0.38.1 把三键丢在包边界外 = [4845]「卡到期屏幕零反应」的直接成因
|
|
59934
60164
|
// (壳读器 readAskDeadlineMs 早已预埋,缺的一直是包边界这一格——#283 逐字同形第四例)。
|
|
59935
60165
|
"expiresInMs",
|
|
@@ -59942,7 +60172,7 @@ var cardPortByKey, cardPortMissesByKey, TOOL_APPROVAL_FRAME_KEYS_MIRROR, RESPOND
|
|
|
59942
60172
|
USELESS_REFUSAL_TEXTS = /* @__PURE__ */ new Set(["[object Object]", "null", "undefined", ""]);
|
|
59943
60173
|
MACHINE_CODE_SHAPE = /^[A-Za-z0-9._:-]{1,64}$/;
|
|
59944
60174
|
FS_WRITE_GATE_ASK_PATTERN = /^approve write to "([^"]+)"\?$/;
|
|
59945
|
-
MAX_RULE_OFFERS_TOLERATED = 8, MAX_RULE_OFFER_BATCH_MEMBERS_TOLERATED = 8;
|
|
60175
|
+
MAX_RULE_OFFERS_TOLERATED = 8, MAX_RULE_OFFER_BATCH_MEMBERS_TOLERATED = 8, MAX_RULE_OFFER_UNCOVERED_DETAIL_TOLERATED = 32;
|
|
59946
60176
|
MAX_RESPOND_NOTE_CHARS = 2048;
|
|
59947
60177
|
}
|
|
59948
60178
|
});
|
|
@@ -61066,13 +61296,18 @@ async function waitForParkRowBirth(deps2) {
|
|
|
61066
61296
|
} catch {
|
|
61067
61297
|
}
|
|
61068
61298
|
}
|
|
61069
|
-
};
|
|
61299
|
+
}, lastProbeMs = 0;
|
|
61070
61300
|
for (; ; ) {
|
|
61071
61301
|
if (aborted2())
|
|
61072
61302
|
return { kind: "aborted", waitedMs: now2() - startedAt, probes };
|
|
61303
|
+
{
|
|
61304
|
+
let remainingBeforeProbe = budgetMs - (now2() - startedAt);
|
|
61305
|
+
if (budgetMs > 0 && probes > 0 && lastProbeMs > 0 && remainingBeforeProbe < lastProbeMs)
|
|
61306
|
+
return { kind: "unborn", reason: lastReason, waitedMs: now2() - startedAt, probes };
|
|
61307
|
+
}
|
|
61073
61308
|
probes += 1;
|
|
61074
|
-
let outcome = await probeWithinRemaining(probes, budgetMs - (now2() - startedAt));
|
|
61075
|
-
if (outcome === "aborted" || aborted2())
|
|
61309
|
+
let probeStartedAt = now2(), outcome = await probeWithinRemaining(probes, budgetMs - (now2() - startedAt));
|
|
61310
|
+
if (lastProbeMs = now2() - probeStartedAt, outcome === "aborted" || aborted2())
|
|
61076
61311
|
return { kind: "aborted", waitedMs: now2() - startedAt, probes };
|
|
61077
61312
|
if (outcome === "deadline")
|
|
61078
61313
|
return {
|
|
@@ -63437,6 +63672,7 @@ __export(dist_exports, {
|
|
|
63437
63672
|
DELEGATION_CAP_CODES: () => DELEGATION_CAP_CODES,
|
|
63438
63673
|
DELEGATION_CONCURRENCY_CAP: () => DELEGATION_CONCURRENCY_CAP,
|
|
63439
63674
|
DELEGATION_SESSION_CAP: () => DELEGATION_SESSION_CAP,
|
|
63675
|
+
DENIAL_LIMIT_KINDS: () => DENIAL_LIMIT_KINDS,
|
|
63440
63676
|
DETACH_DURABLE_OFF_400_ANCHOR: () => DETACH_DURABLE_OFF_400_ANCHOR,
|
|
63441
63677
|
DETACH_HEADER: () => DETACH_HEADER,
|
|
63442
63678
|
DETACH_WIRE_MIN_ENGINE: () => DETACH_WIRE_MIN_ENGINE,
|
|
@@ -63548,7 +63784,9 @@ __export(dist_exports, {
|
|
|
63548
63784
|
RESUME_CHOICE_BACKGROUND_LABEL: () => RESUME_CHOICE_BACKGROUND_LABEL,
|
|
63549
63785
|
RESUME_CHOICE_CANCEL_LABEL: () => RESUME_CHOICE_CANCEL_LABEL,
|
|
63550
63786
|
RESUME_CHOICE_HEADER: () => RESUME_CHOICE_HEADER,
|
|
63787
|
+
RESUME_PLACEMENT_MISMATCH: () => RESUME_PLACEMENT_MISMATCH,
|
|
63551
63788
|
RESUME_PREFLIGHT_REJECTED: () => RESUME_PREFLIGHT_REJECTED,
|
|
63789
|
+
RESUME_REFUSAL_CODES: () => RESUME_REFUSAL_CODES,
|
|
63552
63790
|
RESUME_RETRY_LATER_CODES: () => RESUME_RETRY_LATER_CODES,
|
|
63553
63791
|
RESUME_RUNNING_GUIDANCE_TAG: () => RESUME_RUNNING_GUIDANCE_TAG,
|
|
63554
63792
|
RESUME_RUNNING_NO_UI_EXIT_CODE: () => RESUME_RUNNING_NO_UI_EXIT_CODE,
|
|
@@ -63557,6 +63795,10 @@ __export(dist_exports, {
|
|
|
63557
63795
|
REWIND_ERROR_CODE_PREFIXES: () => REWIND_ERROR_CODE_PREFIXES,
|
|
63558
63796
|
RULE_NOT_SENT_REJECTED_WARN_TEXT: () => RULE_NOT_SENT_REJECTED_WARN_TEXT,
|
|
63559
63797
|
RULE_NOT_SENT_WARN_TEXT: () => RULE_NOT_SENT_WARN_TEXT,
|
|
63798
|
+
RULE_OFFERS_ABSENCE_REASONS: () => RULE_OFFERS_ABSENCE_REASONS,
|
|
63799
|
+
RULE_OFFER_BATCH_MEMBER_KINDS: () => RULE_OFFER_BATCH_MEMBER_KINDS,
|
|
63800
|
+
RULE_OFFER_MATCHES: () => RULE_OFFER_MATCHES,
|
|
63801
|
+
RULE_OFFER_UNCOVERED_REASONS: () => RULE_OFFER_UNCOVERED_REASONS,
|
|
63560
63802
|
RUNNING_STATES: () => RUNNING_STATES,
|
|
63561
63803
|
RUN_BLOCKED_MESSAGE_PREFIX: () => RUN_BLOCKED_MESSAGE_PREFIX,
|
|
63562
63804
|
RUN_LEVEL_STOP_ERROR_CODES: () => RUN_LEVEL_STOP_ERROR_CODES,
|
|
@@ -63635,6 +63877,7 @@ __export(dist_exports, {
|
|
|
63635
63877
|
__resetHooksWireCapsForTests: () => __resetHooksWireCapsForTests,
|
|
63636
63878
|
__resetRetainWithoutWakeWarningForTests: () => __resetRetainWithoutWakeWarningForTests,
|
|
63637
63879
|
__resetRunningChoiceLedgerForTests: () => __resetRunningChoiceLedgerForTests,
|
|
63880
|
+
__resetSqlEngineReadingsForTests: () => __resetSqlEngineReadingsForTests,
|
|
63638
63881
|
__resetSubagentOutputCapCacheForTests: () => __resetSubagentOutputCapCacheForTests,
|
|
63639
63882
|
__resetSubagentOwnerLedgerForTests: () => __resetSubagentOwnerLedgerForTests,
|
|
63640
63883
|
__resetSubagentStreamCapCacheForTests: () => __resetSubagentStreamCapCacheForTests,
|
|
@@ -63780,6 +64023,7 @@ __export(dist_exports, {
|
|
|
63780
64023
|
engineCapState: () => engineCapState,
|
|
63781
64024
|
engineCapString: () => engineCapString,
|
|
63782
64025
|
engineCapTrue: () => engineCapTrue,
|
|
64026
|
+
engineCapValue: () => engineCapValue,
|
|
63783
64027
|
engineCapsSettled: () => engineCapsSettled,
|
|
63784
64028
|
engineCcStopSemantics: () => engineCcStopSemantics,
|
|
63785
64029
|
engineLimitsSupportWarning: () => engineLimitsSupportWarning,
|
|
@@ -63822,6 +64066,7 @@ __export(dist_exports, {
|
|
|
63822
64066
|
fleetViewStubRowIds: () => fleetViewStubRowIds,
|
|
63823
64067
|
fmtCtxOut: () => fmtCtxOut,
|
|
63824
64068
|
fmtTokens: () => fmtTokens,
|
|
64069
|
+
forgetSqlEngineReading: () => forgetSqlEngineReading,
|
|
63825
64070
|
gateArmedWaitMs: () => gateArmedWaitMs,
|
|
63826
64071
|
gateKind: () => gateKind,
|
|
63827
64072
|
getBgParentRun: () => getBgParentRun,
|
|
@@ -63965,6 +64210,7 @@ __export(dist_exports, {
|
|
|
63965
64210
|
normalizeTaskNotification: () => normalizeTaskNotification,
|
|
63966
64211
|
normalizeWirePrincipal: () => normalizeWirePrincipal,
|
|
63967
64212
|
noteBgOwnerAbsence: () => noteBgOwnerAbsence,
|
|
64213
|
+
noteEngineCapsForSqlEngine: () => noteEngineCapsForSqlEngine,
|
|
63968
64214
|
notePlanReviewAnswered: () => notePlanReviewAnswered,
|
|
63969
64215
|
notePlanReviewAnsweredFor: () => notePlanReviewAnsweredFor,
|
|
63970
64216
|
notePlanReviewAnsweredIfDecisive: () => notePlanReviewAnsweredIfDecisive,
|
|
@@ -63973,6 +64219,7 @@ __export(dist_exports, {
|
|
|
63973
64219
|
notificationDropCounters: () => notificationDropCounters,
|
|
63974
64220
|
notificationQueuePortMisses: () => notificationQueuePortMisses,
|
|
63975
64221
|
observeCancelByDeny: () => observeCancelByDeny,
|
|
64222
|
+
observedSqlEngine: () => observedSqlEngine,
|
|
63976
64223
|
onEngineTaskBound: () => onEngineTaskBound,
|
|
63977
64224
|
onGateArmed: () => onGateArmed,
|
|
63978
64225
|
onGateArmedFor: () => onGateArmedFor,
|
|
@@ -64029,6 +64276,7 @@ __export(dist_exports, {
|
|
|
64029
64276
|
projectFleetAgentRows: () => projectFleetAgentRows,
|
|
64030
64277
|
projectFleetAgentRowsFor: () => projectFleetAgentRowsFor,
|
|
64031
64278
|
projectRewind: () => projectRewind,
|
|
64279
|
+
projectSqlEngineCapability: () => projectSqlEngineCapability,
|
|
64032
64280
|
projectTasks: () => projectTasks,
|
|
64033
64281
|
projectWorkflowRun: () => projectWorkflowRun,
|
|
64034
64282
|
projectWorkflowTaskOutput: () => projectWorkflowTaskOutput,
|
|
@@ -64114,6 +64362,8 @@ __export(dist_exports, {
|
|
|
64114
64362
|
respondToQuestion: () => respondToQuestion,
|
|
64115
64363
|
resumeAttachReplayDisclosure: () => resumeAttachReplayDisclosure,
|
|
64116
64364
|
resumeChoiceFromLabels: () => resumeChoiceFromLabels,
|
|
64365
|
+
resumeRefusalContent: () => resumeRefusalContent,
|
|
64366
|
+
resumeRefusalFromError: () => resumeRefusalFromError,
|
|
64117
64367
|
resumeRetryLaterFromError: () => resumeRetryLaterFromError,
|
|
64118
64368
|
resumeRunningCancelUnconfirmedRow: () => resumeRunningCancelUnconfirmedRow,
|
|
64119
64369
|
resumeRunningLivenessRow: () => resumeRunningLivenessRow,
|
|
@@ -64148,6 +64398,7 @@ __export(dist_exports, {
|
|
|
64148
64398
|
skillCommandsToSpecs: () => skillCommandsToSpecs,
|
|
64149
64399
|
splitApiErrorSupplement: () => splitApiErrorSupplement,
|
|
64150
64400
|
spoolMarkerOf: () => spoolMarkerOf,
|
|
64401
|
+
sqlEngineDoctorDetail: () => sqlEngineDoctorDetail,
|
|
64151
64402
|
stamp: () => stamp,
|
|
64152
64403
|
startApprovalsFeed: () => startApprovalsFeed,
|
|
64153
64404
|
steerEngineSubagent: () => steerEngineSubagent,
|
|
@@ -64254,6 +64505,7 @@ var init_dist = __esm({
|
|
|
64254
64505
|
init_engineInlineTaskStats();
|
|
64255
64506
|
init_printToolResultFrame();
|
|
64256
64507
|
init_engineCapsCache();
|
|
64508
|
+
init_sqlEngineCapability();
|
|
64257
64509
|
init_engineToolLabelStore();
|
|
64258
64510
|
init_fleetTaskDesc();
|
|
64259
64511
|
init_hostEnv();
|
|
@@ -64320,6 +64572,7 @@ var init_dist = __esm({
|
|
|
64320
64572
|
init_engineWireTarget();
|
|
64321
64573
|
init_principalWire();
|
|
64322
64574
|
init_wireErrorTriage();
|
|
64575
|
+
init_resumeRefusalCopy();
|
|
64323
64576
|
init_sessionMap();
|
|
64324
64577
|
init_detachWire();
|
|
64325
64578
|
init_workflowMonitor();
|
|
@@ -81827,6 +82080,23 @@ var SECRET_LITERAL_RE, ENV_NAME, hasNul, NON_SECRET_URL, K8S_QUANTITY, TCP_PORT,
|
|
|
81827
82080
|
* declared `"local"`, the engine read ABSENT. A value outside the table is REJECTED at parse — a mistyped trust
|
|
81828
82081
|
* word must never be read as a legal one (the consumer's gate is equally severe: no case-folding). */
|
|
81829
82082
|
contentOrigin: external_exports2.enum(MCP_CONTENT_ORIGINS).optional(),
|
|
82083
|
+
/** Declaration-plane GROUPING LABEL for this server — maps 1:1 onto the engine's `McpServerSpec.source`
|
|
82084
|
+
* (core ≥7.5.0 echoes it verbatim on `wiring_manifest.mcp[].source`, single-line + 80-char cap, so a
|
|
82085
|
+
* consumer can group servers by where they were declared). An OPEN set: CC's `plugin` / `user` /
|
|
82086
|
+
* `project` / `local` are conventions, not a vocabulary — a deployment's own word is equally legal, so
|
|
82087
|
+
* no closed table here (a closed table would reject the operator's grouping word at parse). ABSENT =
|
|
82088
|
+
* no label (`.optional()`, no default — a label has no default tier). 🔴 ZERO rules here (`z.unknown()`):
|
|
82089
|
+
* the label RULE (string, non-empty, ≤80 chars) lives in ONE place — the consumer's projection helper,
|
|
82090
|
+
* which drops a malformed label's KEY, keeps the server and records the drop. Nothing may live here:
|
|
82091
|
+
* this domain parses all-or-nothing, so ANY rejection at parse (1.7.0 `min/max`, 1.7.1 `z.string()`
|
|
82092
|
+
* against a `null`) lets one bad label default the ENTIRE mcp domain — every server gone, silently when
|
|
82093
|
+
* no onWarning is wired — a blast radius a display label must never have. 1.7.2 makes the key
|
|
82094
|
+
* parse-transparent: whatever JSON value the file carries reaches the consumer verbatim. Display-only:
|
|
82095
|
+
* no gate / policy / trust
|
|
82096
|
+
* effect (the trust axis is `contentOrigin` above, which stays a closed table). Before this key existed
|
|
82097
|
+
* both legs stripped it (default-strip object); this is the declaration half of the consumer-side fix
|
|
82098
|
+
* (ticket B-036 / S-143), the projection half lives in the consumer. */
|
|
82099
|
+
source: external_exports2.unknown().optional(),
|
|
81830
82100
|
notes: external_exports2.string().optional()
|
|
81831
82101
|
}), McpConfig = external_exports2.object({ servers: external_exports2.array(McpServerSpec).default([]) }).superRefine((cfg, ctx) => {
|
|
81832
82102
|
let seen2 = /* @__PURE__ */ new Set();
|
|
@@ -89000,38 +89270,87 @@ var consumedProbe, init_metaComboFallback = __esm({
|
|
|
89000
89270
|
// build-src/src/utils/earlyInput.ts
|
|
89001
89271
|
var earlyInput_exports = {};
|
|
89002
89272
|
__export(earlyInput_exports, {
|
|
89273
|
+
__earlyInputStateForTests: () => __earlyInputStateForTests,
|
|
89274
|
+
__processChunkForTests: () => __processChunkForTests,
|
|
89275
|
+
__setEarlyInputStateForTests: () => __setEarlyInputStateForTests,
|
|
89003
89276
|
consumeEarlyInput: () => consumeEarlyInput,
|
|
89004
89277
|
flushPendingEscape: () => flushPendingEscape,
|
|
89005
89278
|
foldEarlyInput: () => foldEarlyInput,
|
|
89006
89279
|
hasEarlyInput: () => hasEarlyInput,
|
|
89007
89280
|
isCapturingEarlyInput: () => isCapturingEarlyInput,
|
|
89008
89281
|
releaseEarlyInputForNonReplLane: () => releaseEarlyInputForNonReplLane,
|
|
89282
|
+
replayHandover: () => replayHandover,
|
|
89009
89283
|
seedEarlyInput: () => seedEarlyInput,
|
|
89010
89284
|
startCapturingEarlyInput: () => startCapturingEarlyInput,
|
|
89011
89285
|
stopCapturingEarlyInput: () => stopCapturingEarlyInput
|
|
89012
89286
|
});
|
|
89287
|
+
function earlyInputTrace(line) {
|
|
89288
|
+
try {
|
|
89289
|
+
let argv = process.argv, path28;
|
|
89290
|
+
for (let i = 0; i < argv.length; i++) {
|
|
89291
|
+
let a = argv[i];
|
|
89292
|
+
if (a.startsWith("--debug-file=")) {
|
|
89293
|
+
path28 = a.slice(13);
|
|
89294
|
+
break;
|
|
89295
|
+
}
|
|
89296
|
+
if (a === "--debug-file" && typeof argv[i + 1] == "string") {
|
|
89297
|
+
path28 = argv[i + 1];
|
|
89298
|
+
break;
|
|
89299
|
+
}
|
|
89300
|
+
}
|
|
89301
|
+
if (!path28) return;
|
|
89302
|
+
__require("node:fs").appendFileSync(path28, `${(/* @__PURE__ */ new Date()).toISOString()} [DEBUG] [earlyInput] ${line}
|
|
89303
|
+
`);
|
|
89304
|
+
} catch {
|
|
89305
|
+
}
|
|
89306
|
+
}
|
|
89013
89307
|
function startCapturingEarlyInput() {
|
|
89014
|
-
if (!
|
|
89015
|
-
|
|
89016
|
-
|
|
89017
|
-
|
|
89018
|
-
|
|
89019
|
-
|
|
89020
|
-
|
|
89021
|
-
|
|
89022
|
-
|
|
89023
|
-
|
|
89308
|
+
if (!process.stdin.isTTY || isCapturing || process.argv.includes("-p") || process.argv.includes("--print"))
|
|
89309
|
+
return;
|
|
89310
|
+
isCapturing = !0, captureArmedStdin = !0, earlyInputBuffer = "", flushPendingEscape();
|
|
89311
|
+
let handedOver = { chunks: [], stopped: !1 };
|
|
89312
|
+
try {
|
|
89313
|
+
let slot = globalThis[EARLY_INPUT_PRELUDE_SLOT];
|
|
89314
|
+
slot !== void 0 && typeof slot.detach == "function" && (handedOver = slot.detach(), delete globalThis[EARLY_INPUT_PRELUDE_SLOT]);
|
|
89315
|
+
} catch {
|
|
89316
|
+
handedOver = { chunks: [], stopped: !1 };
|
|
89317
|
+
}
|
|
89318
|
+
try {
|
|
89319
|
+
process.stdin.readableEncoding !== "utf8" && process.stdin.setEncoding("utf8"), process.stdin.setRawMode(!0), process.stdin.ref(), readableHandler = () => {
|
|
89320
|
+
let chunk2 = process.stdin.read();
|
|
89321
|
+
for (; chunk2 !== null; )
|
|
89322
|
+
typeof chunk2 == "string" && processChunk(chunk2), chunk2 = process.stdin.read();
|
|
89323
|
+
}, process.stdin.on("readable", readableHandler), replayHandover(handedOver, Date.now()), earlyInputTrace(`capture armed: handover chunks=${String(handedOver.chunks.length)} bytes=${String(handedOver.chunks.reduce((n2, c2) => n2 + c2.s.length, 0))} stopped=${String(handedOver.stopped)} buffer=${String(earlyInputBuffer.length)} capturing=${String(isCapturing)}`);
|
|
89324
|
+
} catch (e) {
|
|
89325
|
+
isCapturing = !1, earlyInputTrace(`capture FAILED: ${e instanceof Error ? e.stack ?? e.message : String(e)}`);
|
|
89326
|
+
}
|
|
89327
|
+
}
|
|
89328
|
+
function replayHandover(h, now2) {
|
|
89329
|
+
let list = h.chunks;
|
|
89330
|
+
for (let i = 0; i < list.length; i++) {
|
|
89331
|
+
let cur = list[i];
|
|
89332
|
+
if (processChunk(cur.s), !isCapturing) return;
|
|
89333
|
+
if (pendingEscape !== "\x1B") continue;
|
|
89334
|
+
if (i + 1 < list.length) {
|
|
89335
|
+
list[i + 1].t - cur.t > PENDING_ESCAPE_FLUSH_MS && flushPendingEscape();
|
|
89336
|
+
continue;
|
|
89024
89337
|
}
|
|
89338
|
+
let waited = now2 - cur.t;
|
|
89339
|
+
waited > PENDING_ESCAPE_FLUSH_MS ? flushPendingEscape() : armPendingEscapeFlush(PENDING_ESCAPE_FLUSH_MS - waited);
|
|
89025
89340
|
}
|
|
89026
89341
|
}
|
|
89027
89342
|
function clearPendingEscapeTimer() {
|
|
89028
89343
|
pendingEscapeTimer !== null && (clearTimeout(pendingEscapeTimer), pendingEscapeTimer = null);
|
|
89029
89344
|
}
|
|
89030
89345
|
function flushPendingEscape() {
|
|
89031
|
-
clearPendingEscapeTimer(), pendingEscape = "";
|
|
89346
|
+
clearPendingEscapeTimer(), pendingEscape = "", pendingEscapeDeadline = -1;
|
|
89032
89347
|
}
|
|
89033
|
-
function armPendingEscapeFlush() {
|
|
89034
|
-
clearPendingEscapeTimer(), pendingEscape
|
|
89348
|
+
function armPendingEscapeFlush(remainingMs = PENDING_ESCAPE_FLUSH_MS) {
|
|
89349
|
+
if (clearPendingEscapeTimer(), pendingEscape !== "\x1B") {
|
|
89350
|
+
pendingEscapeDeadline = -1;
|
|
89351
|
+
return;
|
|
89352
|
+
}
|
|
89353
|
+
lastArmedEscapeMs = Math.max(0, remainingMs), pendingEscapeDeadline = Date.now() + lastArmedEscapeMs, pendingEscapeTimer = setTimeout(flushPendingEscape, lastArmedEscapeMs), pendingEscapeTimer.unref?.();
|
|
89035
89354
|
}
|
|
89036
89355
|
function foldEarlyInput(buffer5, pending4, str3) {
|
|
89037
89356
|
let buf = buffer5, s = pending4 + str3, i = 0;
|
|
@@ -89086,7 +89405,7 @@ function processChunk(str3) {
|
|
|
89086
89405
|
break;
|
|
89087
89406
|
}
|
|
89088
89407
|
}
|
|
89089
|
-
clearPendingEscapeTimer();
|
|
89408
|
+
pendingEscape === "\x1B" && pendingEscapeDeadline >= 0 && Date.now() > pendingEscapeDeadline && flushPendingEscape(), clearPendingEscapeTimer();
|
|
89090
89409
|
let folded = foldEarlyInput(earlyInputBuffer, pendingEscape, head);
|
|
89091
89410
|
if (earlyInputBuffer = folded.buffer, pendingEscape = folded.pending, armPendingEscapeFlush(), tail === "ctrl-c") {
|
|
89092
89411
|
stopCapturingEarlyInput(), process.exit(130);
|
|
@@ -89117,7 +89436,16 @@ function releaseEarlyInputForNonReplLane() {
|
|
|
89117
89436
|
function consumeEarlyInput() {
|
|
89118
89437
|
stopCapturingEarlyInput();
|
|
89119
89438
|
let input = earlyInputBuffer.trim();
|
|
89120
|
-
return earlyInputBuffer = "", input;
|
|
89439
|
+
return earlyInputTrace(`consume: buffer=${String(earlyInputBuffer.length)} trimmed=${String(input.length)}`), earlyInputBuffer = "", input;
|
|
89440
|
+
}
|
|
89441
|
+
function __earlyInputStateForTests() {
|
|
89442
|
+
return { buffer: earlyInputBuffer, pending: pendingEscape, capturing: isCapturing, armedMs: lastArmedEscapeMs };
|
|
89443
|
+
}
|
|
89444
|
+
function __processChunkForTests(str3) {
|
|
89445
|
+
processChunk(str3);
|
|
89446
|
+
}
|
|
89447
|
+
function __setEarlyInputStateForTests(o) {
|
|
89448
|
+
o.buffer !== void 0 && (earlyInputBuffer = o.buffer), o.pending !== void 0 && (pendingEscape = o.pending), o.capturing !== void 0 && (isCapturing = o.capturing), clearPendingEscapeTimer();
|
|
89121
89449
|
}
|
|
89122
89450
|
function hasEarlyInput() {
|
|
89123
89451
|
return earlyInputBuffer.trim().length > 0;
|
|
@@ -89128,11 +89456,13 @@ function seedEarlyInput(text2) {
|
|
|
89128
89456
|
function isCapturingEarlyInput() {
|
|
89129
89457
|
return isCapturing;
|
|
89130
89458
|
}
|
|
89131
|
-
var earlyInputBuffer, isCapturing, captureArmedStdin, readableHandler, pendingEscape, PENDING_ESCAPE_FLUSH_MS, pendingEscapeTimer, init_earlyInput = __esm({
|
|
89459
|
+
var earlyInputBuffer, EARLY_INPUT_PRELUDE_SLOT, isCapturing, captureArmedStdin, readableHandler, pendingEscape, PENDING_ESCAPE_FLUSH_MS, pendingEscapeTimer, lastArmedEscapeMs, pendingEscapeDeadline, init_earlyInput = __esm({
|
|
89132
89460
|
"build-src/src/utils/earlyInput.ts"() {
|
|
89133
89461
|
init_intl();
|
|
89134
|
-
earlyInputBuffer = ""
|
|
89462
|
+
earlyInputBuffer = "";
|
|
89463
|
+
EARLY_INPUT_PRELUDE_SLOT = /* @__PURE__ */ Symbol.for("sema.earlyInputPrelude"), isCapturing = !1, captureArmedStdin = !1, readableHandler = null;
|
|
89135
89464
|
pendingEscape = "", PENDING_ESCAPE_FLUSH_MS = 50, pendingEscapeTimer = null;
|
|
89465
|
+
lastArmedEscapeMs = -1, pendingEscapeDeadline = -1;
|
|
89136
89466
|
}
|
|
89137
89467
|
});
|
|
89138
89468
|
|
|
@@ -120569,7 +120899,8 @@ beta`,
|
|
|
120569
120899
|
type: "engine_notice",
|
|
120570
120900
|
code: "mcp_server_unavailable",
|
|
120571
120901
|
message: "the MCP server is not reachable",
|
|
120572
|
-
|
|
120902
|
+
// B-018 debug 不变量哨兵:未登记码的 detail **值**不许落任何日志(只落键名);无秘密纯哨兵串。
|
|
120903
|
+
detail: { serverName: "nope", sessionId: scenarioIds.sessionId, auditDetail: "B018_DETAIL_VALUE_MUST_NOT_BE_LOGGED" },
|
|
120573
120904
|
sessionId: scenarioIds.sessionId,
|
|
120574
120905
|
ts: 1700000000001
|
|
120575
120906
|
};
|
|
@@ -175588,7 +175919,7 @@ How to use the statusLine command:
|
|
|
175588
175919
|
To display both 5-hour and 7-day limits when available:
|
|
175589
175920
|
- input=$(cat); five=$(echo "$input" | jq -r '.rate_limits.five_hour.used_percentage // empty'); week=$(echo "$input" | jq -r '.rate_limits.seven_day.used_percentage // empty'); out=""; [ -n "$five" ] && out="5h:$(printf '%.0f' "$five")%"; [ -n "$week" ] && out="$out 7d:$(printf '%.0f' "$week")%"; echo "$out"
|
|
175590
175921
|
|
|
175591
|
-
2. For longer commands, you can save a new file in the user's ~/.
|
|
175922
|
+
2. For longer commands, you can save a new file in the user's ~/.sema directory, e.g.:
|
|
175592
175923
|
- ~/.sema/statusline-command.sh and reference that file in the settings.
|
|
175593
175924
|
|
|
175594
175925
|
3. Update the user's ~/.sema/settings.json with:
|
|
@@ -265997,7 +266328,7 @@ var require_extension = __commonJS({
|
|
|
265997
266328
|
var require_websocket2 = __commonJS({
|
|
265998
266329
|
"node_modules/ws/lib/websocket.js"(exports2, module2) {
|
|
265999
266330
|
"use strict";
|
|
266000
|
-
var EventEmitter5 = __require("events"), https2 = __require("https"), http3 = __require("http"), net = __require("net"), tls = __require("tls"), { randomBytes: randomBytes31, createHash:
|
|
266331
|
+
var EventEmitter5 = __require("events"), https2 = __require("https"), http3 = __require("http"), net = __require("net"), tls = __require("tls"), { randomBytes: randomBytes31, createHash: createHash33 } = __require("crypto"), { Duplex, Readable: Readable5 } = __require("stream"), { URL: URL6 } = __require("url"), PerMessageDeflate2 = require_permessage_deflate2(), Receiver2 = require_receiver2(), Sender2 = require_sender2(), { isBlob: isBlob2 } = require_validation2(), {
|
|
266001
266332
|
BINARY_TYPES,
|
|
266002
266333
|
CLOSE_TIMEOUT,
|
|
266003
266334
|
EMPTY_BUFFER,
|
|
@@ -266459,7 +266790,7 @@ var require_websocket2 = __commonJS({
|
|
|
266459
266790
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
266460
266791
|
return;
|
|
266461
266792
|
}
|
|
266462
|
-
let digest =
|
|
266793
|
+
let digest = createHash33("sha1").update(key + GUID).digest("base64");
|
|
266463
266794
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
266464
266795
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
266465
266796
|
return;
|
|
@@ -266697,7 +267028,7 @@ var require_subprotocol = __commonJS({
|
|
|
266697
267028
|
var require_websocket_server = __commonJS({
|
|
266698
267029
|
"node_modules/ws/lib/websocket-server.js"(exports2, module2) {
|
|
266699
267030
|
"use strict";
|
|
266700
|
-
var EventEmitter5 = __require("events"), http3 = __require("http"), { Duplex } = __require("stream"), { createHash:
|
|
267031
|
+
var EventEmitter5 = __require("events"), http3 = __require("http"), { Duplex } = __require("stream"), { createHash: createHash33 } = __require("crypto"), extension2 = require_extension(), PerMessageDeflate2 = require_permessage_deflate2(), subprotocol2 = require_subprotocol(), WebSocket3 = require_websocket2(), { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants9(), keyRegex = /^[+/0-9A-Za-z]{22}==$/, RUNNING = 0, CLOSING = 1, CLOSED = 2, WebSocketServer2 = class extends EventEmitter5 {
|
|
266701
267032
|
/**
|
|
266702
267033
|
* Create a `WebSocketServer` instance.
|
|
266703
267034
|
*
|
|
@@ -266944,7 +267275,7 @@ var require_websocket_server = __commonJS({
|
|
|
266944
267275
|
"HTTP/1.1 101 Switching Protocols",
|
|
266945
267276
|
"Upgrade: websocket",
|
|
266946
267277
|
"Connection: Upgrade",
|
|
266947
|
-
`Sec-WebSocket-Accept: ${
|
|
267278
|
+
`Sec-WebSocket-Accept: ${createHash33("sha1").update(key + GUID).digest("base64")}`
|
|
266948
267279
|
], ws = new this.options.WebSocket(null, void 0, this.options);
|
|
266949
267280
|
if (protocols.size) {
|
|
266950
267281
|
let protocol = this.options.handleProtocols ? this.options.handleProtocols(protocols, req) : protocols.values().next().value;
|
|
@@ -290982,6 +291313,19 @@ function approvalMovedToDurableQueueRow(toolName2) {
|
|
|
290982
291313
|
function approvalWindowClosedRow(toolName2) {
|
|
290983
291314
|
return `sema: the approval window for "${toolName2}" closed \u2014 what happens to that step now is the engine's own policy. By default it keeps the call waiting in a durable queue, so this card is left up and answering it now is normally still accepted; if the engine settled it instead, answering will say so. Nothing was decided by this card.`;
|
|
290984
291315
|
}
|
|
291316
|
+
function approvalAutoDeniedRow(toolName2) {
|
|
291317
|
+
return `sema: the approval window for "${toolName2}" closed and the engine denied this call itself (auto-deny limit reached \u2014 no human decided it). This card no longer decides anything; the engine may ask again for a later call.`;
|
|
291318
|
+
}
|
|
291319
|
+
function readToolEndAutoDenied(ev) {
|
|
291320
|
+
if (typeof ev != "object" || ev === null) return !1;
|
|
291321
|
+
let rec = ev;
|
|
291322
|
+
return rec.type !== "tool_end" ? !1 : rec.autoDenied === !0;
|
|
291323
|
+
}
|
|
291324
|
+
function readToolEndToolCallId(ev) {
|
|
291325
|
+
if (typeof ev != "object" || ev === null) return;
|
|
291326
|
+
let raw2 = ev.toolCallId;
|
|
291327
|
+
return typeof raw2 == "string" && raw2 !== "" ? raw2 : void 0;
|
|
291328
|
+
}
|
|
290985
291329
|
function parkRowDeadlineState(row2, nowMs2) {
|
|
290986
291330
|
if (typeof row2 != "object" || row2 === null) return { kind: "none" };
|
|
290987
291331
|
let raw2 = row2.deadline;
|
|
@@ -291238,6 +291582,53 @@ var PARK_DEADLINE_MAX_SANE_MS, parkRowDeadlineHandoff, lateDecideLane, MAX_LATE_
|
|
|
291238
291582
|
});
|
|
291239
291583
|
|
|
291240
291584
|
// build-src/src/sema/liveApprovalCardHandles.ts
|
|
291585
|
+
function noteTerminalSeen(epoch, toolCallId) {
|
|
291586
|
+
for (; terminalSeenByToolCallId.size >= SETTLED_CARD_MAX; ) {
|
|
291587
|
+
let oldest = terminalSeenByToolCallId.values().next();
|
|
291588
|
+
if (oldest.done === !0) break;
|
|
291589
|
+
terminalSeenByToolCallId.delete(oldest.value);
|
|
291590
|
+
}
|
|
291591
|
+
terminalSeenByToolCallId.add(settledKey(epoch, toolCallId));
|
|
291592
|
+
}
|
|
291593
|
+
function resolveToolEndAutoDenied(ev, streamEpoch) {
|
|
291594
|
+
if (typeof ev != "object" || ev === null || ev.type !== "tool_end") return { kind: "none" };
|
|
291595
|
+
let toolCallId = readToolEndToolCallId(ev);
|
|
291596
|
+
if (toolCallId === void 0) return { kind: "none" };
|
|
291597
|
+
let autoDenied = readToolEndAutoDenied(ev), settled = takeSettledCardToolName(toolCallId, streamEpoch), live = callKeyByToolCallId.get(toolCallId);
|
|
291598
|
+
live !== void 0 && live.epoch === streamEpoch && noteTerminalSeen(streamEpoch, toolCallId);
|
|
291599
|
+
let epochLive = streamEpoch === getLiveSessionEpoch();
|
|
291600
|
+
return !autoDenied || !epochLive ? { kind: "none" } : markApprovalCardAutoDenied(toolCallId, streamEpoch) ? { kind: "live" } : settled !== void 0 ? { kind: "late", toolName: settled } : { kind: "none" };
|
|
291601
|
+
}
|
|
291602
|
+
function registerApprovalCardToolCallId(toolCallId, callKey) {
|
|
291603
|
+
let epoch = getLiveSessionEpoch();
|
|
291604
|
+
return typeof toolCallId != "string" || toolCallId === "" || callKeyByToolCallId.set(toolCallId, { callKey, epoch }), epoch;
|
|
291605
|
+
}
|
|
291606
|
+
function forgetApprovalCardToolCallId(toolCallId, callKey, bornEpoch, windowClosedToolName) {
|
|
291607
|
+
if (typeof toolCallId != "string" || toolCallId === "") return;
|
|
291608
|
+
let live = callKeyByToolCallId.get(toolCallId);
|
|
291609
|
+
if (live !== void 0 && live.callKey === callKey && callKeyByToolCallId.delete(toolCallId), !(typeof windowClosedToolName != "string" || windowClosedToolName === "") && !terminalSeenByToolCallId.delete(settledKey(bornEpoch, toolCallId))) {
|
|
291610
|
+
for (; settledCardByToolCallId.size >= SETTLED_CARD_MAX; ) {
|
|
291611
|
+
let oldest = settledCardByToolCallId.keys().next();
|
|
291612
|
+
if (oldest.done === !0) break;
|
|
291613
|
+
settledCardByToolCallId.delete(oldest.value);
|
|
291614
|
+
}
|
|
291615
|
+
settledCardByToolCallId.set(settledKey(bornEpoch, toolCallId), windowClosedToolName);
|
|
291616
|
+
}
|
|
291617
|
+
}
|
|
291618
|
+
function takeSettledCardToolName(toolCallId, epoch) {
|
|
291619
|
+
if (typeof toolCallId != "string" || toolCallId === "") return;
|
|
291620
|
+
if (epoch === void 0) {
|
|
291621
|
+
for (let k3 of settledCardByToolCallId.keys())
|
|
291622
|
+
if (k3.endsWith(`:${toolCallId}`)) {
|
|
291623
|
+
let name2 = settledCardByToolCallId.get(k3);
|
|
291624
|
+
return settledCardByToolCallId.delete(k3), name2;
|
|
291625
|
+
}
|
|
291626
|
+
return;
|
|
291627
|
+
}
|
|
291628
|
+
let k2 = settledKey(epoch, toolCallId), name = settledCardByToolCallId.get(k2);
|
|
291629
|
+
if (name !== void 0)
|
|
291630
|
+
return settledCardByToolCallId.delete(k2), name;
|
|
291631
|
+
}
|
|
291241
291632
|
function retractApprovalCard(callKey, cause) {
|
|
291242
291633
|
let handle2 = liveApprovalCards.get(callKey);
|
|
291243
291634
|
return handle2 === void 0 ? !1 : (liveApprovalCards.delete(callKey), handle2.retract(cause), !0);
|
|
@@ -291246,9 +291637,22 @@ function markApprovalCardMovedToDurableQueue(callKey) {
|
|
|
291246
291637
|
let handle2 = liveApprovalCards.get(callKey);
|
|
291247
291638
|
return handle2 === void 0 ? !1 : handle2.windowClosed("parked-frame");
|
|
291248
291639
|
}
|
|
291249
|
-
|
|
291640
|
+
function markApprovalCardAutoDenied(toolCallId, streamEpoch) {
|
|
291641
|
+
if (typeof toolCallId != "string" || toolCallId === "") return !1;
|
|
291642
|
+
let born = callKeyByToolCallId.get(toolCallId);
|
|
291643
|
+
if (born === void 0 || streamEpoch !== void 0 && born.epoch !== streamEpoch) return !1;
|
|
291644
|
+
let handle2 = liveApprovalCards.get(born.callKey);
|
|
291645
|
+
return handle2 === void 0 ? !1 : handle2.windowClosed("auto-denied");
|
|
291646
|
+
}
|
|
291647
|
+
function surfaceToolEndAutoDenied(ev, streamEpoch) {
|
|
291648
|
+
let r = resolveToolEndAutoDenied(ev, streamEpoch);
|
|
291649
|
+
return r.kind !== "late" ? r.kind : surfaceLateDecideOutcome(approvalAutoDeniedRow(r.toolName)) ? "late" : "late-unsurfaced";
|
|
291650
|
+
}
|
|
291651
|
+
var liveApprovalCards, callKeyByToolCallId, SETTLED_CARD_MAX, settledCardByToolCallId, settledKey, terminalSeenByToolCallId, init_liveApprovalCardHandles = __esm({
|
|
291250
291652
|
"build-src/src/sema/liveApprovalCardHandles.ts"() {
|
|
291251
|
-
|
|
291653
|
+
init_askParkExpiry();
|
|
291654
|
+
init_liveSessionStore();
|
|
291655
|
+
liveApprovalCards = /* @__PURE__ */ new Map(), callKeyByToolCallId = /* @__PURE__ */ new Map(), SETTLED_CARD_MAX = 64, settledCardByToolCallId = /* @__PURE__ */ new Map(), settledKey = (epoch, toolCallId) => `${String(epoch)}:${toolCallId}`, terminalSeenByToolCallId = /* @__PURE__ */ new Set();
|
|
291252
291656
|
}
|
|
291253
291657
|
});
|
|
291254
291658
|
|
|
@@ -367524,27 +367928,6 @@ var arm, DEVICE_LANE_ABSENT_CODE, DEVICE_RUN_STORE_ABSENT_CODE, DEVICE_SERVICE_T
|
|
|
367524
367928
|
}
|
|
367525
367929
|
});
|
|
367526
367930
|
|
|
367527
|
-
// build-src/src/sema/resumeRefusalCopy.ts
|
|
367528
|
-
function resumeRefusalFromError(err8) {
|
|
367529
|
-
if (typeof err8 != "object" || err8 === null) return null;
|
|
367530
|
-
let e = err8, code2 = e.errorCode;
|
|
367531
|
-
if (typeof code2 != "string" || !RESUME_REFUSAL_CODES.includes(code2)) return null;
|
|
367532
|
-
let sec = e.retryAfterSec;
|
|
367533
|
-
return {
|
|
367534
|
-
code: code2,
|
|
367535
|
-
...typeof sec == "number" && Number.isFinite(sec) && sec >= 0 ? { retryAfterSec: sec } : {}
|
|
367536
|
-
};
|
|
367537
|
-
}
|
|
367538
|
-
function resumeRefusalContent(detail) {
|
|
367539
|
-
let parts = [];
|
|
367540
|
-
return detail.code === "resume.placement_mismatch" ? (parts.push("This resume named a different placement root than the one recorded when the work was parked"), parts.push("The engine refused it before consuming anything \u2014 the parked work is untouched"), parts.push("Retry with the recorded root, or omit the placement root to inherit it")) : (parts.push("The deployment's resume preflight refused this attempt"), parts.push("The refusal happened before the commit \u2014 your decision was not consumed"), parts.push("The engine line above says whether this token can still be redeemed")), parts.join(" \xB7 ");
|
|
367541
|
-
}
|
|
367542
|
-
var RESUME_REFUSAL_CODES, init_resumeRefusalCopy = __esm({
|
|
367543
|
-
"build-src/src/sema/resumeRefusalCopy.ts"() {
|
|
367544
|
-
RESUME_REFUSAL_CODES = ["resume.placement_mismatch", "resume.preflight_rejected"];
|
|
367545
|
-
}
|
|
367546
|
-
});
|
|
367547
|
-
|
|
367548
367931
|
// build-src/src/sema/scenarioNotAllowedCopy.ts
|
|
367549
367932
|
function scenarioNotAllowedContent(detail, requestedScenario) {
|
|
367550
367933
|
let parts = [];
|
|
@@ -367585,7 +367968,7 @@ var init_apiErrorSupplement = __esm({
|
|
|
367585
367968
|
"build-src/src/sema/apiErrorSupplement.ts"() {
|
|
367586
367969
|
init_devicesWire();
|
|
367587
367970
|
init_quotaExhaustedCopy();
|
|
367588
|
-
|
|
367971
|
+
init_dist();
|
|
367589
367972
|
init_scenarioNotAllowedCopy();
|
|
367590
367973
|
}
|
|
367591
367974
|
});
|
|
@@ -368791,12 +369174,31 @@ function resolveEngineEntry() {
|
|
|
368791
369174
|
function localEngineVersion() {
|
|
368792
369175
|
let entry = resolveEngineEntry();
|
|
368793
369176
|
if (entry)
|
|
369177
|
+
return engineVersionOfEntry(entry);
|
|
369178
|
+
}
|
|
369179
|
+
function engineVersionOfEntry(entry) {
|
|
369180
|
+
let readVersion = (dir) => {
|
|
368794
369181
|
try {
|
|
368795
|
-
let pkg = JSON.parse(readFileSync36(join124(
|
|
369182
|
+
let pkg = JSON.parse(readFileSync36(join124(dir, "package.json"), "utf8"));
|
|
368796
369183
|
return typeof pkg.version == "string" && pkg.version.length > 0 ? pkg.version : void 0;
|
|
368797
369184
|
} catch {
|
|
368798
369185
|
return;
|
|
368799
369186
|
}
|
|
369187
|
+
}, script = entry.args[0], fromEntry;
|
|
369188
|
+
if (typeof script == "string" && script.length > 0) {
|
|
369189
|
+
let dir = dirname59(script);
|
|
369190
|
+
for (let i = 0; i < 6 && dir !== dirname59(dir); i++) {
|
|
369191
|
+
if (existsSync23(join124(dir, "package.json"))) {
|
|
369192
|
+
fromEntry = readVersion(dir);
|
|
369193
|
+
break;
|
|
369194
|
+
}
|
|
369195
|
+
dir = dirname59(dir);
|
|
369196
|
+
}
|
|
369197
|
+
}
|
|
369198
|
+
let fromCwd = readVersion(entry.cwd);
|
|
369199
|
+
return fromEntry !== void 0 && fromCwd !== void 0 && fromEntry !== fromCwd && logForDebugging(
|
|
369200
|
+
`[engine-lifecycle] torn engine install: entry ${script} belongs to ${fromEntry} but cwd ${entry.cwd} is ${fromCwd} \u2014 version gate follows the ENTRY (what actually runs)`
|
|
369201
|
+
), fromEntry ?? fromCwd;
|
|
368800
369202
|
}
|
|
368801
369203
|
function localDistNewerThanEngine(wantVersion, engineVersion2) {
|
|
368802
369204
|
if (engineVersion2 === wantVersion) return !1;
|
|
@@ -401427,30 +401829,18 @@ var sema_brand_default, init_sema_brand = __esm({
|
|
|
401427
401829
|
_doc: "displayName/email \u7559 null = \u8FD0\u884C\u65F6\u56DE\u9000(\u540D\u5B57\u53D6\u672C\u673A OS \u7528\u6237\u540D,\u90AE\u7BB1\u4E0D\u663E\u793A)\u3002\u522B\u70E7\u4E2A\u4EBA\u4FE1\u606F\u8FDB\u54C1\u724C\u6587\u4EF6(F-S1-1:\u65B0\u7528\u6237\u66FE\u770B\u5230 Welcome back Clay!)\u3002"
|
|
401428
401830
|
},
|
|
401429
401831
|
whatsNew: {
|
|
401430
|
-
version: "1.0.
|
|
401832
|
+
version: "1.0.102",
|
|
401431
401833
|
notes: [
|
|
401432
|
-
|
|
401433
|
-
|
|
401434
|
-
|
|
401435
|
-
|
|
401436
|
-
"
|
|
401437
|
-
|
|
401438
|
-
"A sema started from inside an engine-run command (for example a hook or a Bash step) no longer writes a second state file under ~/.sema, so onboarding, directory trust, and marketplace state are not reset.",
|
|
401439
|
-
"The bundled engine is 7.57.0: model request failures and retries are now written to the engine log, and secrets are scrubbed from stored run results.",
|
|
401440
|
-
"The engine now refuses to let the model rewrite sema's own settings files (anything under ~/.sema and the other configuration roots), and the refusal is shown in the transcript instead of silently failing. Bundled engine is 7.59.0.",
|
|
401441
|
-
"Switching models in /model no longer gets the whole model list rejected when an entry carries display-only keys; the switch takes effect without restarting the engine.",
|
|
401442
|
-
"Typing while the prompt is still starting up no longer echoes raw characters or drops your Enter: keys are captured from the first millisecond and seeded into the input box once it is ready.",
|
|
401443
|
-
"Control keys that arrive in the same burst as text (for example ctrl+U or a slash command typed quickly under load) are handled as keys again instead of landing in the input box as literal characters.",
|
|
401444
|
-
"When the model has not sent its first token yet, the spinner line says so with the elapsed time instead of looking frozen; retry status shows what it is waiting on.",
|
|
401445
|
-
'Messages from sub-agents and from other sema sessions now appear as their own collapsed rows ("Message from @name: \u2026", ctrl+o to expand) instead of being folded into a generic background-task card.',
|
|
401446
|
-
"Tools removed by a model gate are announced once in the transcript with the way to restore them, and /doctor now reports whether auto mode is actually armed on the engine.",
|
|
401447
|
-
"Permission rules and settings descriptions now refer to ~/.sema instead of ~/.claude, so allow rules written for the real configuration directory match.",
|
|
401448
|
-
"MCP server connection warnings are shown once per session instead of on every message, and agent definitions that reference an MCP tool the server does not offer now get a hint instead of silently losing the tool.",
|
|
401449
|
-
"sema ps, sema logs and sema attach exit normally again after printing their result (they no longer hang in the terminal), and ctrl+C works in those commands."
|
|
401834
|
+
`Approval cards now carry the facts behind the ask: when the auto-deny limit tripped (counts, which limit, and how long until the engine auto-denies), when an org rule, an unreachable org rule store or a hook asked for the review, and why no "don't ask again" offer is available (mandated gate, shadowed by a higher-priority rule, or a lane that cannot persist rules). Routine asks add no extra line.`,
|
|
401835
|
+
`When an approval window closes and the engine later auto-denies that call (auto-deny limit reached), the transcript now says so with a dedicated line instead of leaving the earlier "the engine's policy decides" note standing; the correction is bound to the card's own session and tool call, so a later session never inherits it.`,
|
|
401836
|
+
`/doctor has a new "MCP servers (engine leg)" row read from the engine's wiring manifest: "not observed" when no run has reported it, "declared no MCP servers" when the engine leg reported an empty list, otherwise one entry per server with status, tool count, error code and source label ("source not declared" when the engine did not carry one).`,
|
|
401837
|
+
"The engine version gate now follows the entry script's own package, so a torn install (new package on disk, old entry still running) is reported once and no longer triggers a second automatic restart.",
|
|
401838
|
+
"The bundled engine is 7.62.0 (core 7.5.2, settings-schema 1.7.1): MCP servers declared with a source label keep it on the wiring manifest. Known issue: with this engine, writing `source: null` for a server in config.d/mcp.json empties the whole MCP server list for that engine \u2014 omit the key or use a string until the next engine update.",
|
|
401839
|
+
'The SQL engine row in `sema doctor` no longer claims "local file stores" when the engine reports no SQL posture; it now says the backend is either not configured or its initialization was refused and points at the engine log.'
|
|
401450
401840
|
]
|
|
401451
401841
|
},
|
|
401452
|
-
productVersion: "1.0.
|
|
401453
|
-
announcement:
|
|
401842
|
+
productVersion: "1.0.102",
|
|
401843
|
+
announcement: 'sema 1.0.102 \u2014 the bundled engine is 7.62.0 (MCP servers can carry a source label on the wiring manifest), approval cards now explain auto-deny limits, org rules, hooks and why a rule offer is missing, a card whose approval window closed is corrected when the engine auto-denies the call, /doctor gains an "MCP servers (engine leg)" row, and the engine version gate follows the entry script so a torn install no longer restarts the engine twice.',
|
|
401454
401844
|
version: "1.0.91"
|
|
401455
401845
|
};
|
|
401456
401846
|
}
|
|
@@ -405783,30 +406173,18 @@ var require_sema_brand = __commonJS({
|
|
|
405783
406173
|
_doc: "displayName/email \u7559 null = \u8FD0\u884C\u65F6\u56DE\u9000(\u540D\u5B57\u53D6\u672C\u673A OS \u7528\u6237\u540D,\u90AE\u7BB1\u4E0D\u663E\u793A)\u3002\u522B\u70E7\u4E2A\u4EBA\u4FE1\u606F\u8FDB\u54C1\u724C\u6587\u4EF6(F-S1-1:\u65B0\u7528\u6237\u66FE\u770B\u5230 Welcome back Clay!)\u3002"
|
|
405784
406174
|
},
|
|
405785
406175
|
whatsNew: {
|
|
405786
|
-
version: "1.0.
|
|
406176
|
+
version: "1.0.102",
|
|
405787
406177
|
notes: [
|
|
405788
|
-
|
|
405789
|
-
|
|
405790
|
-
|
|
405791
|
-
|
|
405792
|
-
"
|
|
405793
|
-
|
|
405794
|
-
"A sema started from inside an engine-run command (for example a hook or a Bash step) no longer writes a second state file under ~/.sema, so onboarding, directory trust, and marketplace state are not reset.",
|
|
405795
|
-
"The bundled engine is 7.57.0: model request failures and retries are now written to the engine log, and secrets are scrubbed from stored run results.",
|
|
405796
|
-
"The engine now refuses to let the model rewrite sema's own settings files (anything under ~/.sema and the other configuration roots), and the refusal is shown in the transcript instead of silently failing. Bundled engine is 7.59.0.",
|
|
405797
|
-
"Switching models in /model no longer gets the whole model list rejected when an entry carries display-only keys; the switch takes effect without restarting the engine.",
|
|
405798
|
-
"Typing while the prompt is still starting up no longer echoes raw characters or drops your Enter: keys are captured from the first millisecond and seeded into the input box once it is ready.",
|
|
405799
|
-
"Control keys that arrive in the same burst as text (for example ctrl+U or a slash command typed quickly under load) are handled as keys again instead of landing in the input box as literal characters.",
|
|
405800
|
-
"When the model has not sent its first token yet, the spinner line says so with the elapsed time instead of looking frozen; retry status shows what it is waiting on.",
|
|
405801
|
-
'Messages from sub-agents and from other sema sessions now appear as their own collapsed rows ("Message from @name: \u2026", ctrl+o to expand) instead of being folded into a generic background-task card.',
|
|
405802
|
-
"Tools removed by a model gate are announced once in the transcript with the way to restore them, and /doctor now reports whether auto mode is actually armed on the engine.",
|
|
405803
|
-
"Permission rules and settings descriptions now refer to ~/.sema instead of ~/.claude, so allow rules written for the real configuration directory match.",
|
|
405804
|
-
"MCP server connection warnings are shown once per session instead of on every message, and agent definitions that reference an MCP tool the server does not offer now get a hint instead of silently losing the tool.",
|
|
405805
|
-
"sema ps, sema logs and sema attach exit normally again after printing their result (they no longer hang in the terminal), and ctrl+C works in those commands."
|
|
406178
|
+
`Approval cards now carry the facts behind the ask: when the auto-deny limit tripped (counts, which limit, and how long until the engine auto-denies), when an org rule, an unreachable org rule store or a hook asked for the review, and why no "don't ask again" offer is available (mandated gate, shadowed by a higher-priority rule, or a lane that cannot persist rules). Routine asks add no extra line.`,
|
|
406179
|
+
`When an approval window closes and the engine later auto-denies that call (auto-deny limit reached), the transcript now says so with a dedicated line instead of leaving the earlier "the engine's policy decides" note standing; the correction is bound to the card's own session and tool call, so a later session never inherits it.`,
|
|
406180
|
+
`/doctor has a new "MCP servers (engine leg)" row read from the engine's wiring manifest: "not observed" when no run has reported it, "declared no MCP servers" when the engine leg reported an empty list, otherwise one entry per server with status, tool count, error code and source label ("source not declared" when the engine did not carry one).`,
|
|
406181
|
+
"The engine version gate now follows the entry script's own package, so a torn install (new package on disk, old entry still running) is reported once and no longer triggers a second automatic restart.",
|
|
406182
|
+
"The bundled engine is 7.62.0 (core 7.5.2, settings-schema 1.7.1): MCP servers declared with a source label keep it on the wiring manifest. Known issue: with this engine, writing `source: null` for a server in config.d/mcp.json empties the whole MCP server list for that engine \u2014 omit the key or use a string until the next engine update.",
|
|
406183
|
+
'The SQL engine row in `sema doctor` no longer claims "local file stores" when the engine reports no SQL posture; it now says the backend is either not configured or its initialization was refused and points at the engine log.'
|
|
405806
406184
|
]
|
|
405807
406185
|
},
|
|
405808
|
-
productVersion: "1.0.
|
|
405809
|
-
announcement:
|
|
406186
|
+
productVersion: "1.0.102",
|
|
406187
|
+
announcement: 'sema 1.0.102 \u2014 the bundled engine is 7.62.0 (MCP servers can carry a source label on the wiring manifest), approval cards now explain auto-deny limits, org rules, hooks and why a rule offer is missing, a card whose approval window closed is corrected when the engine auto-denies the call, /doctor gains an "MCP servers (engine leg)" row, and the engine version gate follows the entry script so a torn install no longer restarts the engine twice.',
|
|
405810
406188
|
version: "1.0.91"
|
|
405811
406189
|
};
|
|
405812
406190
|
}
|
|
@@ -426866,9 +427244,10 @@ var AUTO_MODE_DENIAL_LIMIT_DEFAULTS, init_auto_mode_defaults = __esm({
|
|
|
426866
427244
|
});
|
|
426867
427245
|
|
|
426868
427246
|
// node_modules/@sema-agent/core/dist/core/auto-mode-arming.js
|
|
426869
|
-
var init_auto_mode_arming = __esm({
|
|
427247
|
+
var NO_BOUND_CEILING, init_auto_mode_arming = __esm({
|
|
426870
427248
|
"node_modules/@sema-agent/core/dist/core/auto-mode-arming.js"() {
|
|
426871
427249
|
init_auto_mode_defaults();
|
|
427250
|
+
NO_BOUND_CEILING = Number.POSITIVE_INFINITY;
|
|
426872
427251
|
}
|
|
426873
427252
|
});
|
|
426874
427253
|
|
|
@@ -430056,9 +430435,9 @@ function makeProtocolNamespace(id, prefix) {
|
|
|
430056
430435
|
function protocolOf(name) {
|
|
430057
430436
|
return PROTOCOL_TABLE.find((ns) => name.startsWith(ns.prefix));
|
|
430058
430437
|
}
|
|
430059
|
-
var MCP_PREFIX_NAME, A2A_PREFIX_NAME, MCP_NAMESPACE, A2A_NAMESPACE, PROTOCOL_TABLE, init_protocol_table = __esm({
|
|
430438
|
+
var MCP_PREFIX_NAME, A2A_PREFIX_NAME, MCP_NAMESPACE, A2A_NAMESPACE, PROTOCOL_TABLE, NAMESPACED_NAME_SHAPES, init_protocol_table = __esm({
|
|
430060
430439
|
"node_modules/@sema-agent/core/dist/core/protocol-table.js"() {
|
|
430061
|
-
MCP_PREFIX_NAME = "mcp__", A2A_PREFIX_NAME = "a2a__", MCP_NAMESPACE = makeProtocolNamespace("mcp", MCP_PREFIX_NAME), A2A_NAMESPACE = makeProtocolNamespace("a2a", A2A_PREFIX_NAME), PROTOCOL_TABLE = [MCP_NAMESPACE, A2A_NAMESPACE];
|
|
430440
|
+
MCP_PREFIX_NAME = "mcp__", A2A_PREFIX_NAME = "a2a__", MCP_NAMESPACE = makeProtocolNamespace("mcp", MCP_PREFIX_NAME), A2A_NAMESPACE = makeProtocolNamespace("a2a", A2A_PREFIX_NAME), PROTOCOL_TABLE = [MCP_NAMESPACE, A2A_NAMESPACE], NAMESPACED_NAME_SHAPES = PROTOCOL_TABLE.map((ns) => `${ns.prefix}<peer>__<tool>`).join(", ");
|
|
430062
430441
|
}
|
|
430063
430442
|
});
|
|
430064
430443
|
|
|
@@ -430108,6 +430487,7 @@ import { tmpdir as tmpdir12 } from "node:os";
|
|
|
430108
430487
|
import { join as join153 } from "node:path";
|
|
430109
430488
|
var MCP_PREFIX, MCP_IDLE_TIMEOUT_STDIO_DEFAULT_MS, MCP_IDLE_TIMEOUT_HTTP_DEFAULT_MS, MCP_BLOB_DIR, MCP_SCHEMA_CHILD_SEAT, LIST_ENTRY_FINGERPRINT_MAX_CHARS, LOOP_REWIND_FINGERPRINT_MAX_CHARS, init_mcp4 = __esm({
|
|
430110
430489
|
"node_modules/@sema-agent/core/dist/core/mcp.js"() {
|
|
430490
|
+
init_untrusted_egress();
|
|
430111
430491
|
init_protocol_table();
|
|
430112
430492
|
init_protocol_naming();
|
|
430113
430493
|
init_client5();
|
|
@@ -430690,6 +431070,9 @@ function refuseOutOfContractDecision(d4, opts) {
|
|
|
430690
431070
|
return d4;
|
|
430691
431071
|
if (Object.prototype.hasOwnProperty.call(d4, RETIRED_TEXT_FIELD))
|
|
430692
431072
|
return { action: "deny", message: RETIRED_TEXT_FIELD_DENY_MESSAGE, decisionReason: "rule" };
|
|
431073
|
+
let fb = d4.denialLimitFallback;
|
|
431074
|
+
if (typeof fb == "object" && fb !== null && fb.autoDenyAfterMs !== void 0)
|
|
431075
|
+
return { action: "deny", message: RETIRED_WINDOW_MEMBER_DENY_MESSAGE, decisionReason: "rule" };
|
|
430693
431076
|
if (opts?.reasonIsNonInput === !0)
|
|
430694
431077
|
return d4;
|
|
430695
431078
|
let dr = d4.decisionReason;
|
|
@@ -430819,7 +431202,7 @@ function combinePolicies(...policies) {
|
|
|
430819
431202
|
}
|
|
430820
431203
|
};
|
|
430821
431204
|
}
|
|
430822
|
-
var DECISION_REASONS, DECISION_REASON_SET, ALLOW, RETIRED_TEXT_FIELD, RETIRED_TEXT_FIELD_DENY_MESSAGE, COARSE_SHELL_TOOLS, CASE_INSENSITIVE_FS, ASK_DENY_RESOLUTION_VALUES, ASK_DENY_RESOLUTION_SET, coreMintedResolutions, init_tool_policy = __esm({
|
|
431205
|
+
var DECISION_REASONS, DECISION_REASON_SET, ALLOW, RETIRED_TEXT_FIELD, RETIRED_WINDOW_MEMBER, RETIRED_WINDOW_MEMBER_DENY_MESSAGE, RETIRED_TEXT_FIELD_DENY_MESSAGE, COARSE_SHELL_TOOLS, CASE_INSENSITIVE_FS, ASK_DENY_RESOLUTION_VALUES, ASK_DENY_RESOLUTION_SET, coreMintedResolutions, init_tool_policy = __esm({
|
|
430823
431206
|
"node_modules/@sema-agent/core/dist/core/tool-policy.js"() {
|
|
430824
431207
|
init_ask_class();
|
|
430825
431208
|
init_auto_mode_arming();
|
|
@@ -430830,7 +431213,7 @@ var DECISION_REASONS, DECISION_REASON_SET, ALLOW, RETIRED_TEXT_FIELD, RETIRED_TE
|
|
|
430830
431213
|
init_protocol_table();
|
|
430831
431214
|
init_safety();
|
|
430832
431215
|
DECISION_REASONS = ["rule", "mode", "hook", "safety", "classifier", "persisted_rule", "sandbox", "org_rule", "org_unavailable"], DECISION_REASON_SET = new Set(DECISION_REASONS);
|
|
430833
|
-
ALLOW = { action: "allow" }, RETIRED_TEXT_FIELD = "reason", RETIRED_TEXT_FIELD_DENY_MESSAGE = `a permission decision carries the retired "${RETIRED_TEXT_FIELD}" field \u2014 rename it to "message" (the one text field a decision carries); denied fail-closed rather than executing a decision whose text this layer cannot read`;
|
|
431216
|
+
ALLOW = { action: "allow" }, RETIRED_TEXT_FIELD = "reason", RETIRED_WINDOW_MEMBER = "autoDenyAfterMs", RETIRED_WINDOW_MEMBER_DENY_MESSAGE = `a permission decision's "denialLimitFallback" carries "${RETIRED_WINDOW_MEMBER}" \u2014 the decision names the counts only; the auto-deny window is decided by the ask's route (a live approver arms it, every other route runs none) and cannot be declared by a policy; denied fail-closed rather than silently replacing the declared number`, RETIRED_TEXT_FIELD_DENY_MESSAGE = `a permission decision carries the retired "${RETIRED_TEXT_FIELD}" field \u2014 rename it to "message" (the one text field a decision carries); denied fail-closed rather than executing a decision whose text this layer cannot read`;
|
|
430834
431217
|
COARSE_SHELL_TOOLS = ["Bash", "Monitor"], CASE_INSENSITIVE_FS = process.platform === "darwin" || process.platform === "win32", ASK_DENY_RESOLUTION_VALUES = [
|
|
430835
431218
|
"human_refused",
|
|
430836
431219
|
"window_expired",
|
|
@@ -430845,6 +431228,20 @@ var DECISION_REASONS, DECISION_REASON_SET, ALLOW, RETIRED_TEXT_FIELD, RETIRED_TE
|
|
|
430845
431228
|
}
|
|
430846
431229
|
});
|
|
430847
431230
|
|
|
431231
|
+
// node_modules/@sema-agent/core/dist/core/auto-mode.js
|
|
431232
|
+
var init_auto_mode = __esm({
|
|
431233
|
+
"node_modules/@sema-agent/core/dist/core/auto-mode.js"() {
|
|
431234
|
+
init_auto_mode_defaults();
|
|
431235
|
+
}
|
|
431236
|
+
});
|
|
431237
|
+
|
|
431238
|
+
// node_modules/@sema-agent/core/dist/core/ask-origin.js
|
|
431239
|
+
var ASK_ORIGINS, ASK_ORIGIN_SET, init_ask_origin = __esm({
|
|
431240
|
+
"node_modules/@sema-agent/core/dist/core/ask-origin.js"() {
|
|
431241
|
+
ASK_ORIGINS = ["content_question", "unresolvable", "org_unavailable", "org_rule", "hook", "ask_rule", "denial_limit_fallback", "policy"], ASK_ORIGIN_SET = new Set(ASK_ORIGINS);
|
|
431242
|
+
}
|
|
431243
|
+
});
|
|
431244
|
+
|
|
430848
431245
|
// node_modules/@sema-agent/core/dist/core/permission-rule-model.js
|
|
430849
431246
|
function foldSpacing(s) {
|
|
430850
431247
|
let out6 = "", quote2, pendingGap = !1;
|
|
@@ -431203,6 +431600,8 @@ var MAX_PENDING_STEER_CHARS, PENDING_STEER_QUEUE_BYTE_BUDGET_BYTES, MAX_PENDING_
|
|
|
431203
431600
|
init_harness();
|
|
431204
431601
|
init_untrusted_text();
|
|
431205
431602
|
init_tool_policy();
|
|
431603
|
+
init_auto_mode();
|
|
431604
|
+
init_ask_origin();
|
|
431206
431605
|
init_permission_rule_model();
|
|
431207
431606
|
init_untrusted_egress();
|
|
431208
431607
|
init_ask_question();
|
|
@@ -432807,13 +433206,13 @@ function assertRedemptionNotQuarantined(quarantined, delta) {
|
|
|
432807
433206
|
if (hit !== void 0)
|
|
432808
433207
|
throw new Error(`this approval's add (dot ${delta.add.dot.actor}#${delta.add.dot.counter}) was quarantined (${hit.reason}) \u2014 replaying the old record cannot revive it; a new consent (a new ask, a new record, a new dot) is required`);
|
|
432809
433208
|
}
|
|
432810
|
-
var PERMISSION_RULE_WRITER, ADD_ONLY_KEYS,
|
|
433209
|
+
var PERMISSION_RULE_WRITER, ADD_ONLY_KEYS, InMemoryDurableRulePartition, init_permission_rule_store = __esm({
|
|
432811
433210
|
"node_modules/@sema-agent/core/dist/core/permission-rule-store.js"() {
|
|
432812
433211
|
init_canonical_json();
|
|
432813
433212
|
init_permission_rule_model();
|
|
432814
433213
|
PERMISSION_RULE_WRITER = "__semaPermissionRuleWriter";
|
|
432815
433214
|
ADD_ONLY_KEYS = ["add", "redemption", "rule", "command", "match", "tool"];
|
|
432816
|
-
|
|
433215
|
+
InMemoryDurableRulePartition = class {
|
|
432817
433216
|
actor;
|
|
432818
433217
|
now;
|
|
432819
433218
|
durability = "process-local";
|
|
@@ -432874,11 +433273,11 @@ var PERMISSION_RULE_WRITER, ADD_ONLY_KEYS, InMemoryPermissionRuleStore, init_per
|
|
|
432874
433273
|
});
|
|
432875
433274
|
|
|
432876
433275
|
// node_modules/@sema-agent/core/dist/core/permission-rule-org.js
|
|
432877
|
-
var ORG_FETCHED_AT_SKEW_ALLOWANCE_MS, init_permission_rule_org = __esm({
|
|
433276
|
+
var ORG_FETCHED_AT_SKEW_ALLOWANCE_MS, UNGOVERNED_ORG_RESOLUTION, init_permission_rule_org = __esm({
|
|
432878
433277
|
"node_modules/@sema-agent/core/dist/core/permission-rule-org.js"() {
|
|
432879
433278
|
init_permission_rule_model();
|
|
432880
433279
|
init_permission_rule_store();
|
|
432881
|
-
ORG_FETCHED_AT_SKEW_ALLOWANCE_MS = 5 * 6e4;
|
|
433280
|
+
ORG_FETCHED_AT_SKEW_ALLOWANCE_MS = 5 * 6e4, UNGOVERNED_ORG_RESOLUTION = Object.freeze({ source: "org", status: "ungoverned", rules: [], disclosures: [] });
|
|
432882
433281
|
}
|
|
432883
433282
|
});
|
|
432884
433283
|
|
|
@@ -433045,82 +433444,6 @@ var init_compaction_call_options = __esm({
|
|
|
433045
433444
|
}
|
|
433046
433445
|
});
|
|
433047
433446
|
|
|
433048
|
-
// node_modules/@sema-agent/core/dist/core/auto-mode.js
|
|
433049
|
-
var init_auto_mode = __esm({
|
|
433050
|
-
"node_modules/@sema-agent/core/dist/core/auto-mode.js"() {
|
|
433051
|
-
init_auto_mode_defaults();
|
|
433052
|
-
}
|
|
433053
|
-
});
|
|
433054
|
-
|
|
433055
|
-
// node_modules/@sema-agent/core/dist/core/runner/denial-limit-arms.js
|
|
433056
|
-
var init_denial_limit_arms = __esm({
|
|
433057
|
-
"node_modules/@sema-agent/core/dist/core/runner/denial-limit-arms.js"() {
|
|
433058
|
-
init_auto_mode();
|
|
433059
|
-
init_types21();
|
|
433060
|
-
init_untrusted_text();
|
|
433061
|
-
}
|
|
433062
|
-
});
|
|
433063
|
-
|
|
433064
|
-
// node_modules/@sema-agent/core/dist/core/auto-mode-prompt-assets.js
|
|
433065
|
-
var init_auto_mode_prompt_assets = __esm({
|
|
433066
|
-
"node_modules/@sema-agent/core/dist/core/auto-mode-prompt-assets.js"() {
|
|
433067
|
-
}
|
|
433068
|
-
});
|
|
433069
|
-
|
|
433070
|
-
// node_modules/@sema-agent/core/dist/core/auto-mode-prompt.js
|
|
433071
|
-
var init_auto_mode_prompt = __esm({
|
|
433072
|
-
"node_modules/@sema-agent/core/dist/core/auto-mode-prompt.js"() {
|
|
433073
|
-
init_auto_mode_defaults();
|
|
433074
|
-
init_auto_mode_prompt_assets();
|
|
433075
|
-
init_untrusted_text();
|
|
433076
|
-
init_auto_mode_defaults();
|
|
433077
|
-
}
|
|
433078
|
-
});
|
|
433079
|
-
|
|
433080
|
-
// node_modules/@sema-agent/core/dist/core/a2a-task-state.js
|
|
433081
|
-
var A2A_TASK_STATES, init_a2a_task_state = __esm({
|
|
433082
|
-
"node_modules/@sema-agent/core/dist/core/a2a-task-state.js"() {
|
|
433083
|
-
A2A_TASK_STATES = [
|
|
433084
|
-
"submitted",
|
|
433085
|
-
"working",
|
|
433086
|
-
"input-required",
|
|
433087
|
-
"completed",
|
|
433088
|
-
"canceled",
|
|
433089
|
-
"failed",
|
|
433090
|
-
"rejected",
|
|
433091
|
-
"auth-required",
|
|
433092
|
-
"unknown"
|
|
433093
|
-
];
|
|
433094
|
-
}
|
|
433095
|
-
});
|
|
433096
|
-
|
|
433097
|
-
// node_modules/@sema-agent/core/dist/core/a2a.js
|
|
433098
|
-
var A2A_CALL_TOTAL_TIMEOUT_MS, A2A_RESPONSE_MAX_BYTES, A2A_STATE_SET, init_a2a = __esm({
|
|
433099
|
-
"node_modules/@sema-agent/core/dist/core/a2a.js"() {
|
|
433100
|
-
init_build3();
|
|
433101
|
-
init_a2a_task_state();
|
|
433102
|
-
init_mcp4();
|
|
433103
|
-
init_protocol_naming();
|
|
433104
|
-
init_protocol_table();
|
|
433105
|
-
init_untrusted_text();
|
|
433106
|
-
A2A_CALL_TOTAL_TIMEOUT_MS = 10 * 6e4, A2A_RESPONSE_MAX_BYTES = 8 * 1024 * 1024, A2A_STATE_SET = new Set(A2A_TASK_STATES);
|
|
433107
|
-
}
|
|
433108
|
-
});
|
|
433109
|
-
|
|
433110
|
-
// node_modules/@sema-agent/core/dist/agents/agent-transcript-tool.js
|
|
433111
|
-
var init_agent_transcript_tool = __esm({
|
|
433112
|
-
"node_modules/@sema-agent/core/dist/agents/agent-transcript-tool.js"() {
|
|
433113
|
-
init_build3();
|
|
433114
|
-
init_tools3();
|
|
433115
|
-
init_background_agent_store();
|
|
433116
|
-
init_task_registry();
|
|
433117
|
-
init_untrusted_text();
|
|
433118
|
-
init_subagent_steps();
|
|
433119
|
-
init_subagent();
|
|
433120
|
-
init_retain_ledger();
|
|
433121
|
-
}
|
|
433122
|
-
});
|
|
433123
|
-
|
|
433124
433447
|
// node_modules/@sema-agent/core/dist/core/mailbox-store.js
|
|
433125
433448
|
var init_mailbox_store = __esm({
|
|
433126
433449
|
"node_modules/@sema-agent/core/dist/core/mailbox-store.js"() {
|
|
@@ -433228,114 +433551,11 @@ var uplinkSeqGlobal, REVIVE_LEASE_TTL_MS, init_send_message_tool = __esm({
|
|
|
433228
433551
|
}
|
|
433229
433552
|
});
|
|
433230
433553
|
|
|
433231
|
-
// node_modules/@sema-agent/core/dist/core/runner/
|
|
433232
|
-
var
|
|
433233
|
-
"node_modules/@sema-agent/core/dist/core/runner/
|
|
433234
|
-
|
|
433235
|
-
init_safety();
|
|
433236
|
-
init_tool_policy();
|
|
433237
|
-
PATH_WRITE_TOOLS = /* @__PURE__ */ new Set(["Write", "Edit", "MultiEdit"]), PATH_CONFINABLE_WRITE_TOOLS = /* @__PURE__ */ new Set([...PATH_WRITE_TOOLS, "NotebookEdit"]);
|
|
433238
|
-
}
|
|
433239
|
-
});
|
|
433240
|
-
|
|
433241
|
-
// node_modules/@sema-agent/core/dist/core/skill-tool-specifier.js
|
|
433242
|
-
var SPECIFIER_ENFORCED_TOOLS, init_skill_tool_specifier = __esm({
|
|
433243
|
-
"node_modules/@sema-agent/core/dist/core/skill-tool-specifier.js"() {
|
|
433244
|
-
init_permission_rules();
|
|
433245
|
-
init_tool_policy();
|
|
433246
|
-
init_bash_readonly_classifier();
|
|
433247
|
-
SPECIFIER_ENFORCED_TOOLS = new Set(COARSE_SHELL_TOOLS);
|
|
433248
|
-
}
|
|
433249
|
-
});
|
|
433250
|
-
|
|
433251
|
-
// node_modules/@sema-agent/core/dist/core/runner/active-skill-scope.js
|
|
433252
|
-
var init_active_skill_scope = __esm({
|
|
433253
|
-
"node_modules/@sema-agent/core/dist/core/runner/active-skill-scope.js"() {
|
|
433254
|
-
init_safety();
|
|
433255
|
-
init_session_rule_policy();
|
|
433256
|
-
init_skill_tool_specifier();
|
|
433257
|
-
}
|
|
433258
|
-
});
|
|
433259
|
-
|
|
433260
|
-
// node_modules/@sema-agent/core/dist/core/hooks.js
|
|
433261
|
-
var objectPrototype, init_hooks3 = __esm({
|
|
433262
|
-
"node_modules/@sema-agent/core/dist/core/hooks.js"() {
|
|
433263
|
-
init_tool_policy();
|
|
433264
|
-
init_ask_class();
|
|
433265
|
-
init_auto_mode();
|
|
433554
|
+
// node_modules/@sema-agent/core/dist/core/runner/announce-once-ledger.js
|
|
433555
|
+
var init_announce_once_ledger = __esm({
|
|
433556
|
+
"node_modules/@sema-agent/core/dist/core/runner/announce-once-ledger.js"() {
|
|
433557
|
+
init_untrusted_egress();
|
|
433266
433558
|
init_untrusted_text();
|
|
433267
|
-
init_reminder_mint();
|
|
433268
|
-
init_checkpoint_store();
|
|
433269
|
-
init_ask_question();
|
|
433270
|
-
init_safe_notify();
|
|
433271
|
-
init_permission_rule_org();
|
|
433272
|
-
objectPrototype = Object.prototype;
|
|
433273
|
-
}
|
|
433274
|
-
});
|
|
433275
|
-
|
|
433276
|
-
// node_modules/@sema-agent/core/dist/core/write-protect.js
|
|
433277
|
-
var freezeTable, WRITE_PROTECTED_DEFAULT_TABLE, init_write_protect = __esm({
|
|
433278
|
-
"node_modules/@sema-agent/core/dist/core/write-protect.js"() {
|
|
433279
|
-
init_safety();
|
|
433280
|
-
init_session_rule_policy();
|
|
433281
|
-
freezeTable = (rows2) => Object.freeze(rows2.map((r) => Object.freeze(r))), WRITE_PROTECTED_DEFAULT_TABLE = freezeTable([
|
|
433282
|
-
{ name: ".gitconfig", kind: "basename" },
|
|
433283
|
-
{ name: ".gitmodules", kind: "basename" },
|
|
433284
|
-
{ name: ".bashrc", kind: "basename" },
|
|
433285
|
-
{ name: ".bash_profile", kind: "basename" },
|
|
433286
|
-
{ name: ".zshrc", kind: "basename" },
|
|
433287
|
-
{ name: ".zprofile", kind: "basename" },
|
|
433288
|
-
{ name: ".profile", kind: "basename" },
|
|
433289
|
-
{ name: ".zshenv", kind: "basename" },
|
|
433290
|
-
{ name: ".zlogin", kind: "basename" },
|
|
433291
|
-
{ name: ".zlogout", kind: "basename" },
|
|
433292
|
-
{ name: ".bash_login", kind: "basename" },
|
|
433293
|
-
{ name: ".bash_aliases", kind: "basename" },
|
|
433294
|
-
{ name: ".bash_logout", kind: "basename" },
|
|
433295
|
-
{ name: ".envrc", kind: "basename" },
|
|
433296
|
-
{ name: ".ripgreprc", kind: "basename" },
|
|
433297
|
-
{ name: ".mcp.json", kind: "basename" },
|
|
433298
|
-
{ name: ".claude.json", kind: "basename" },
|
|
433299
|
-
{ name: ".npmrc", kind: "basename" },
|
|
433300
|
-
{ name: ".yarnrc", kind: "basename" },
|
|
433301
|
-
{ name: ".yarnrc.yml", kind: "basename" },
|
|
433302
|
-
{ name: ".pnp.cjs", kind: "basename" },
|
|
433303
|
-
{ name: ".pnp.loader.mjs", kind: "basename" },
|
|
433304
|
-
{ name: ".pnpmfile.cjs", kind: "basename" },
|
|
433305
|
-
{ name: "bunfig.toml", kind: "basename" },
|
|
433306
|
-
{ name: ".bunfig.toml", kind: "basename" },
|
|
433307
|
-
{ name: ".bazelrc", kind: "basename" },
|
|
433308
|
-
{ name: ".bazelversion", kind: "basename" },
|
|
433309
|
-
{ name: ".bazeliskrc", kind: "basename" },
|
|
433310
|
-
{ name: ".pre-commit-config.yaml", kind: "basename" },
|
|
433311
|
-
{ name: "lefthook.yml", kind: "basename" },
|
|
433312
|
-
{ name: ".lefthook.yml", kind: "basename" },
|
|
433313
|
-
{ name: "lefthook.yaml", kind: "basename" },
|
|
433314
|
-
{ name: ".lefthook.yaml", kind: "basename" },
|
|
433315
|
-
{ name: "gradle-wrapper.properties", kind: "basename" },
|
|
433316
|
-
{ name: "maven-wrapper.properties", kind: "basename" },
|
|
433317
|
-
{ name: ".devcontainer.json", kind: "basename" },
|
|
433318
|
-
{ name: "pyrightconfig.json", kind: "basename" },
|
|
433319
|
-
{ name: ".git", kind: "segment" },
|
|
433320
|
-
{ name: ".vscode", kind: "segment" },
|
|
433321
|
-
{ name: ".idea", kind: "segment" },
|
|
433322
|
-
{ name: ".claude", kind: "segment" },
|
|
433323
|
-
{ name: ".husky", kind: "segment" },
|
|
433324
|
-
{ name: ".cargo", kind: "segment" },
|
|
433325
|
-
{ name: ".devcontainer", kind: "segment" },
|
|
433326
|
-
{ name: ".yarn", kind: "segment" },
|
|
433327
|
-
{ name: ".mvn", kind: "segment" },
|
|
433328
|
-
{ name: ".config/git", kind: "segment-run" },
|
|
433329
|
-
{ name: ".ssh", kind: "segment" },
|
|
433330
|
-
{ name: ".gnupg", kind: "segment" }
|
|
433331
|
-
]);
|
|
433332
|
-
}
|
|
433333
|
-
});
|
|
433334
|
-
|
|
433335
|
-
// node_modules/@sema-agent/core/dist/core/cache-break-detector.js
|
|
433336
|
-
var SERVER_GAP_MS, init_cache_break_detector = __esm({
|
|
433337
|
-
"node_modules/@sema-agent/core/dist/core/cache-break-detector.js"() {
|
|
433338
|
-
SERVER_GAP_MS = 5 * 6e4;
|
|
433339
433559
|
}
|
|
433340
433560
|
});
|
|
433341
433561
|
|
|
@@ -433345,121 +433565,6 @@ var init_timeout = __esm({
|
|
|
433345
433565
|
}
|
|
433346
433566
|
});
|
|
433347
433567
|
|
|
433348
|
-
// node_modules/@sema-agent/core/dist/core/tool-name-aliases.js
|
|
433349
|
-
var RETIRED_TOOL_NAMES, init_tool_name_aliases = __esm({
|
|
433350
|
-
"node_modules/@sema-agent/core/dist/core/tool-name-aliases.js"() {
|
|
433351
|
-
RETIRED_TOOL_NAMES = /* @__PURE__ */ new Map([
|
|
433352
|
-
["read_file", 'renamed "Read"'],
|
|
433353
|
-
["edit_file", 'renamed "Edit"'],
|
|
433354
|
-
["write_file", 'renamed "Write"'],
|
|
433355
|
-
["bash", 'renamed "Bash"'],
|
|
433356
|
-
["bash_readonly", 'folded into "Bash" (read-only posture rides handsReadOnly/shellGate, not a tool name)'],
|
|
433357
|
-
["glob", 'renamed "Glob"'],
|
|
433358
|
-
["grep", 'renamed "Grep"'],
|
|
433359
|
-
["web_fetch", 'renamed "WebFetch"'],
|
|
433360
|
-
["tool_search", 'renamed "ToolSearch"'],
|
|
433361
|
-
["skill", 'renamed "Skill"'],
|
|
433362
|
-
["present_plan", 'renamed "ExitPlanMode"'],
|
|
433363
|
-
["enter_plan_mode", 'renamed "EnterPlanMode"'],
|
|
433364
|
-
["spawn_subagent", 'renamed "Agent"'],
|
|
433365
|
-
["CronCancel", 'renamed "CronDelete"'],
|
|
433366
|
-
["lsp", 'renamed "LSP"'],
|
|
433367
|
-
["submit_output", 'renamed "StructuredOutput"'],
|
|
433368
|
-
["repo_map", 'renamed "RepoMap"'],
|
|
433369
|
-
["read_tool_result", 'renamed "ReadToolResult"'],
|
|
433370
|
-
["report_blocked", 'renamed "ReportBlocked"'],
|
|
433371
|
-
["declare_done", 'renamed "DeclareDone"'],
|
|
433372
|
-
["run_workflow", 'renamed "Workflow"'],
|
|
433373
|
-
["RunWorkflow", 'renamed "Workflow"'],
|
|
433374
|
-
["Task", 'renamed "Agent" (a deployment-defined tool named "Task" is fine \u2014 this fires only when the name matches nothing in the roster)'],
|
|
433375
|
-
["BashOutput", 'renamed "TaskOutput"'],
|
|
433376
|
-
["AgentOutputTool", 'renamed "TaskOutput"'],
|
|
433377
|
-
["BashOutputTool", 'renamed "TaskOutput"'],
|
|
433378
|
-
["AgentOutput", 'renamed "TaskOutput"'],
|
|
433379
|
-
["WorkflowStatus", 'folded into "TaskOutput" (poll by runId)'],
|
|
433380
|
-
["KillShell", 'renamed "TaskStop"'],
|
|
433381
|
-
["KillBash", 'renamed "TaskStop"'],
|
|
433382
|
-
["ListMcpResources", 'renamed "ListMcpResourcesTool"'],
|
|
433383
|
-
["ReadMcpResource", 'renamed "ReadMcpResourceTool"'],
|
|
433384
|
-
["ReadMcpResourceDir", 'renamed "ReadMcpResourceDirTool"'],
|
|
433385
|
-
["MultiEdit", 'removed \u2014 "Edit" accepts the edits[] shape'],
|
|
433386
|
-
["Fork", 'removed \u2014 use Agent with subagent_type: "fork"'],
|
|
433387
|
-
["Sleep", 'removed \u2014 schedule a re-wake with CronCreate({schedule:{kind:"delay"}}) or wait with Monitor'],
|
|
433388
|
-
["Remember", "removed \u2014 memory is file-based; write the memory directory with the ordinary file tools"],
|
|
433389
|
-
["remember", "removed \u2014 memory is file-based; write the memory directory with the ordinary file tools"],
|
|
433390
|
-
["Recall", "removed \u2014 memory is file-based; read the memory directory with the ordinary file tools"],
|
|
433391
|
-
["recall", "removed \u2014 memory is file-based; read the memory directory with the ordinary file tools"]
|
|
433392
|
-
]);
|
|
433393
|
-
}
|
|
433394
|
-
});
|
|
433395
|
-
|
|
433396
|
-
// node_modules/@sema-agent/core/dist/core/lsp-protocol.js
|
|
433397
|
-
var init_lsp_protocol = __esm({
|
|
433398
|
-
"node_modules/@sema-agent/core/dist/core/lsp-protocol.js"() {
|
|
433399
|
-
}
|
|
433400
|
-
});
|
|
433401
|
-
|
|
433402
|
-
// node_modules/@sema-agent/core/dist/core/shared-memory/types.js
|
|
433403
|
-
var SHARED_MEMORY_LIST_TOOL_NAME, SHARED_MEMORY_READ_TOOL_NAME, init_types27 = __esm({
|
|
433404
|
-
"node_modules/@sema-agent/core/dist/core/shared-memory/types.js"() {
|
|
433405
|
-
SHARED_MEMORY_LIST_TOOL_NAME = "memory_list", SHARED_MEMORY_READ_TOOL_NAME = "memory_read";
|
|
433406
|
-
}
|
|
433407
|
-
});
|
|
433408
|
-
|
|
433409
|
-
// node_modules/@sema-agent/core/dist/core/shared-memory/normalize.js
|
|
433410
|
-
var init_normalize = __esm({
|
|
433411
|
-
"node_modules/@sema-agent/core/dist/core/shared-memory/normalize.js"() {
|
|
433412
|
-
init_untrusted_text();
|
|
433413
|
-
init_types27();
|
|
433414
|
-
}
|
|
433415
|
-
});
|
|
433416
|
-
|
|
433417
|
-
// node_modules/@sema-agent/core/dist/core/shared-memory/tools.js
|
|
433418
|
-
var LIST_HINT, LIST_DESCRIPTION, READ_HINT, READ_DESCRIPTION, init_tools4 = __esm({
|
|
433419
|
-
"node_modules/@sema-agent/core/dist/core/shared-memory/tools.js"() {
|
|
433420
|
-
init_build3();
|
|
433421
|
-
init_tools3();
|
|
433422
|
-
init_normalize();
|
|
433423
|
-
init_types27();
|
|
433424
|
-
LIST_HINT = "List shared memory stores and their documents \u2014 check here before telling the user you do not have something.", LIST_DESCRIPTION = [
|
|
433425
|
-
LIST_HINT,
|
|
433426
|
-
"",
|
|
433427
|
-
`List the memory documents in a memory store, sorted by path \u2014 each line gives a document's path, size, and last-updated date, but no content (use ${SHARED_MEMORY_READ_TOOL_NAME} for that). Pass store (the store's id) to choose the store, path_prefix to list one directory, and the cursor from a previous call to continue a long listing. Call with no arguments at all to list the memory stores connected to this session \u2014 their ids, a one-line description, and whether each is writable or read-only; that set can change during the session, so re-check it whenever you are unsure which store to use.`,
|
|
433428
|
-
"",
|
|
433429
|
-
"When store is omitted this call lists the stores themselves, and path_prefix and cursor are ignored.",
|
|
433430
|
-
"",
|
|
433431
|
-
`Call ${SHARED_MEMORY_LIST_TOOL_NAME} early when context about the project or the work in it would help \u2014 and always before telling the user you do not have something. If a listed document looks relevant, ${SHARED_MEMORY_READ_TOOL_NAME} it.`
|
|
433432
|
-
].join(`
|
|
433433
|
-
`), READ_HINT = "Read one shared memory document by store id and path \u2014 treat it as a past snapshot, not the answer.", READ_DESCRIPTION = [
|
|
433434
|
-
READ_HINT,
|
|
433435
|
-
"",
|
|
433436
|
-
"Read one memory document from a memory store by its store id and path.",
|
|
433437
|
-
"",
|
|
433438
|
-
"Read your memory often so corrections stick. Treat memories as past snapshots to verify against current sources, not the definitive answer.",
|
|
433439
|
-
"",
|
|
433440
|
-
"## When to access memories",
|
|
433441
|
-
"- When memories seem relevant, or the user references prior work with them or others in their organization.",
|
|
433442
|
-
"- You MUST access memory when the user explicitly asks you to check, recall, or remember.",
|
|
433443
|
-
`- Call ${SHARED_MEMORY_LIST_TOOL_NAME} early when context about the project would help, and always before telling the user you do not have something; if a listed document looks relevant, ${SHARED_MEMORY_READ_TOOL_NAME} it.`,
|
|
433444
|
-
"- If the user says to *ignore* or *not use* memory: Do not apply remembered facts, cite, compare against, or mention memory content.",
|
|
433445
|
-
"- Memory records can become stale over time. Use memory as context for what was true at a given point in time. Before answering the user or building assumptions based solely on information in memory records, verify that the memory is still correct and up-to-date by reading the current state of the files or resources. If a recalled memory conflicts with current information, trust what you observe now \u2014 and update or remove the stale memory rather than acting on it.",
|
|
433446
|
-
"",
|
|
433447
|
-
"## Before recommending from memory",
|
|
433448
|
-
"",
|
|
433449
|
-
"A memory that names a specific function, file, or flag is a claim that it existed *when the memory was written*. It may have been renamed, removed, or never merged. Before recommending it:",
|
|
433450
|
-
"",
|
|
433451
|
-
"- If the memory names a file path: check the file exists.",
|
|
433452
|
-
"- If the memory names a function or flag: grep for it.",
|
|
433453
|
-
"- If the user is about to act on your recommendation (not just asking about history), verify first.",
|
|
433454
|
-
"",
|
|
433455
|
-
'"The memory says X exists" is not the same as "X exists now."',
|
|
433456
|
-
"",
|
|
433457
|
-
"A memory that summarizes repo state (activity logs, architecture snapshots) is frozen in time. If the user asks about *recent* or *current* state, prefer `git log` or reading the code over recalling the snapshot."
|
|
433458
|
-
].join(`
|
|
433459
|
-
`);
|
|
433460
|
-
}
|
|
433461
|
-
});
|
|
433462
|
-
|
|
433463
433568
|
// node_modules/@sema-agent/core/dist/core/memory-vector.js
|
|
433464
433569
|
var init_memory_vector = __esm({
|
|
433465
433570
|
"node_modules/@sema-agent/core/dist/core/memory-vector.js"() {
|
|
@@ -433530,7 +433635,7 @@ var CONSOLIDATION_DEFAULTS, CONSOLIDATION_SEAT_FREEZE_GRACE_MS, init_consolidati
|
|
|
433530
433635
|
});
|
|
433531
433636
|
|
|
433532
433637
|
// node_modules/@sema-agent/core/dist/core/memory-engine/tools.js
|
|
433533
|
-
var MEMORY_SEARCH_TOOL_NAME2, MEMORY_GET_TOOL_NAME2, MEMORY_INDEX_TOOL_NAME, MEMORY_INDEX_PAGE_CAP_BYTES, MEMORY_GET_PAGE_CAP_BYTES, SEARCH_HINT, FENCE_SEMANTICS_SENTENCE, SEARCH_DESCRIPTION, GET_HINT, GET_DESCRIPTION, INDEX_HINT, INDEX_DESCRIPTION,
|
|
433638
|
+
var MEMORY_SEARCH_TOOL_NAME2, MEMORY_GET_TOOL_NAME2, MEMORY_INDEX_TOOL_NAME, MEMORY_INDEX_PAGE_CAP_BYTES, MEMORY_GET_PAGE_CAP_BYTES, SEARCH_HINT, FENCE_SEMANTICS_SENTENCE, SEARCH_DESCRIPTION, GET_HINT, GET_DESCRIPTION, INDEX_HINT, INDEX_DESCRIPTION, init_tools4 = __esm({
|
|
433534
433639
|
"node_modules/@sema-agent/core/dist/core/memory-engine/tools.js"() {
|
|
433535
433640
|
init_build3();
|
|
433536
433641
|
init_tools3();
|
|
@@ -433568,12 +433673,6 @@ var MEMORY_SEARCH_TOOL_NAME2, MEMORY_GET_TOOL_NAME2, MEMORY_INDEX_TOOL_NAME, MEM
|
|
|
433568
433673
|
}
|
|
433569
433674
|
});
|
|
433570
433675
|
|
|
433571
|
-
// node_modules/@sema-agent/core/dist/core/compliance.js
|
|
433572
|
-
var init_compliance = __esm({
|
|
433573
|
-
"node_modules/@sema-agent/core/dist/core/compliance.js"() {
|
|
433574
|
-
}
|
|
433575
|
-
});
|
|
433576
|
-
|
|
433577
433676
|
// node_modules/@sema-agent/core/dist/core/memory-engine/dual-root.js
|
|
433578
433677
|
var init_dual_root = __esm({
|
|
433579
433678
|
"node_modules/@sema-agent/core/dist/core/memory-engine/dual-root.js"() {
|
|
@@ -433711,12 +433810,383 @@ var init_prepare_memory = __esm({
|
|
|
433711
433810
|
init_engine5();
|
|
433712
433811
|
init_memory_capture_optout();
|
|
433713
433812
|
init_layout2();
|
|
433714
|
-
|
|
433813
|
+
init_tools4();
|
|
433715
433814
|
init_scope_contract();
|
|
433716
433815
|
init_file_backend();
|
|
433717
433816
|
}
|
|
433718
433817
|
});
|
|
433719
433818
|
|
|
433819
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-memory-engine-session.js
|
|
433820
|
+
var init_prepare_memory_engine_session = __esm({
|
|
433821
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-memory-engine-session.js"() {
|
|
433822
|
+
init_content_origin();
|
|
433823
|
+
init_delegation_provenance();
|
|
433824
|
+
init_delegation_settlement();
|
|
433825
|
+
init_protocol_table();
|
|
433826
|
+
init_types21();
|
|
433827
|
+
init_untrusted_text();
|
|
433828
|
+
init_safety();
|
|
433829
|
+
}
|
|
433830
|
+
});
|
|
433831
|
+
|
|
433832
|
+
// node_modules/@sema-agent/core/dist/core/shared-memory/types.js
|
|
433833
|
+
var SHARED_MEMORY_LIST_TOOL_NAME, SHARED_MEMORY_READ_TOOL_NAME, init_types27 = __esm({
|
|
433834
|
+
"node_modules/@sema-agent/core/dist/core/shared-memory/types.js"() {
|
|
433835
|
+
SHARED_MEMORY_LIST_TOOL_NAME = "memory_list", SHARED_MEMORY_READ_TOOL_NAME = "memory_read";
|
|
433836
|
+
}
|
|
433837
|
+
});
|
|
433838
|
+
|
|
433839
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-defer-classify.js
|
|
433840
|
+
var init_prepare_defer_classify = __esm({
|
|
433841
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-defer-classify.js"() {
|
|
433842
|
+
init_tool_catalog();
|
|
433843
|
+
init_fs();
|
|
433844
|
+
init_ask_question();
|
|
433845
|
+
init_tools4();
|
|
433846
|
+
init_types27();
|
|
433847
|
+
init_tool_disclosure();
|
|
433848
|
+
}
|
|
433849
|
+
});
|
|
433850
|
+
|
|
433851
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-listings.js
|
|
433852
|
+
var init_prepare_listings = __esm({
|
|
433853
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-listings.js"() {
|
|
433854
|
+
init_default6();
|
|
433855
|
+
init_synthetic_tools();
|
|
433856
|
+
init_turn_attachments();
|
|
433857
|
+
}
|
|
433858
|
+
});
|
|
433859
|
+
|
|
433860
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-prompt-inputs.js
|
|
433861
|
+
var init_prepare_prompt_inputs = __esm({
|
|
433862
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-prompt-inputs.js"() {
|
|
433863
|
+
init_default6();
|
|
433864
|
+
init_remote_env();
|
|
433865
|
+
init_git_status_frame();
|
|
433866
|
+
init_turn_attachments();
|
|
433867
|
+
}
|
|
433868
|
+
});
|
|
433869
|
+
|
|
433870
|
+
// node_modules/@sema-agent/core/dist/core/shared-memory/normalize.js
|
|
433871
|
+
var init_normalize = __esm({
|
|
433872
|
+
"node_modules/@sema-agent/core/dist/core/shared-memory/normalize.js"() {
|
|
433873
|
+
init_untrusted_text();
|
|
433874
|
+
init_types27();
|
|
433875
|
+
}
|
|
433876
|
+
});
|
|
433877
|
+
|
|
433878
|
+
// node_modules/@sema-agent/core/dist/core/shared-memory/tools.js
|
|
433879
|
+
var LIST_HINT, LIST_DESCRIPTION, READ_HINT, READ_DESCRIPTION, init_tools5 = __esm({
|
|
433880
|
+
"node_modules/@sema-agent/core/dist/core/shared-memory/tools.js"() {
|
|
433881
|
+
init_build3();
|
|
433882
|
+
init_tools3();
|
|
433883
|
+
init_normalize();
|
|
433884
|
+
init_types27();
|
|
433885
|
+
LIST_HINT = "List shared memory stores and their documents \u2014 check here before telling the user you do not have something.", LIST_DESCRIPTION = [
|
|
433886
|
+
LIST_HINT,
|
|
433887
|
+
"",
|
|
433888
|
+
`List the memory documents in a memory store, sorted by path \u2014 each line gives a document's path, size, and last-updated date, but no content (use ${SHARED_MEMORY_READ_TOOL_NAME} for that). Pass store (the store's id) to choose the store, path_prefix to list one directory, and the cursor from a previous call to continue a long listing. Call with no arguments at all to list the memory stores connected to this session \u2014 their ids, a one-line description, and whether each is writable or read-only; that set can change during the session, so re-check it whenever you are unsure which store to use.`,
|
|
433889
|
+
"",
|
|
433890
|
+
"When store is omitted this call lists the stores themselves, and path_prefix and cursor are ignored.",
|
|
433891
|
+
"",
|
|
433892
|
+
`Call ${SHARED_MEMORY_LIST_TOOL_NAME} early when context about the project or the work in it would help \u2014 and always before telling the user you do not have something. If a listed document looks relevant, ${SHARED_MEMORY_READ_TOOL_NAME} it.`
|
|
433893
|
+
].join(`
|
|
433894
|
+
`), READ_HINT = "Read one shared memory document by store id and path \u2014 treat it as a past snapshot, not the answer.", READ_DESCRIPTION = [
|
|
433895
|
+
READ_HINT,
|
|
433896
|
+
"",
|
|
433897
|
+
"Read one memory document from a memory store by its store id and path.",
|
|
433898
|
+
"",
|
|
433899
|
+
"Read your memory often so corrections stick. Treat memories as past snapshots to verify against current sources, not the definitive answer.",
|
|
433900
|
+
"",
|
|
433901
|
+
"## When to access memories",
|
|
433902
|
+
"- When memories seem relevant, or the user references prior work with them or others in their organization.",
|
|
433903
|
+
"- You MUST access memory when the user explicitly asks you to check, recall, or remember.",
|
|
433904
|
+
`- Call ${SHARED_MEMORY_LIST_TOOL_NAME} early when context about the project would help, and always before telling the user you do not have something; if a listed document looks relevant, ${SHARED_MEMORY_READ_TOOL_NAME} it.`,
|
|
433905
|
+
"- If the user says to *ignore* or *not use* memory: Do not apply remembered facts, cite, compare against, or mention memory content.",
|
|
433906
|
+
"- Memory records can become stale over time. Use memory as context for what was true at a given point in time. Before answering the user or building assumptions based solely on information in memory records, verify that the memory is still correct and up-to-date by reading the current state of the files or resources. If a recalled memory conflicts with current information, trust what you observe now \u2014 and update or remove the stale memory rather than acting on it.",
|
|
433907
|
+
"",
|
|
433908
|
+
"## Before recommending from memory",
|
|
433909
|
+
"",
|
|
433910
|
+
"A memory that names a specific function, file, or flag is a claim that it existed *when the memory was written*. It may have been renamed, removed, or never merged. Before recommending it:",
|
|
433911
|
+
"",
|
|
433912
|
+
"- If the memory names a file path: check the file exists.",
|
|
433913
|
+
"- If the memory names a function or flag: grep for it.",
|
|
433914
|
+
"- If the user is about to act on your recommendation (not just asking about history), verify first.",
|
|
433915
|
+
"",
|
|
433916
|
+
'"The memory says X exists" is not the same as "X exists now."',
|
|
433917
|
+
"",
|
|
433918
|
+
"A memory that summarizes repo state (activity logs, architecture snapshots) is frozen in time. If the user asks about *recent* or *current* state, prefer `git log` or reading the code over recalling the snapshot."
|
|
433919
|
+
].join(`
|
|
433920
|
+
`);
|
|
433921
|
+
}
|
|
433922
|
+
});
|
|
433923
|
+
|
|
433924
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-project-context.js
|
|
433925
|
+
var init_prepare_project_context = __esm({
|
|
433926
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-project-context.js"() {
|
|
433927
|
+
init_default6();
|
|
433928
|
+
init_tools4();
|
|
433929
|
+
init_memory4();
|
|
433930
|
+
init_session4();
|
|
433931
|
+
init_tools5();
|
|
433932
|
+
init_types27();
|
|
433933
|
+
init_tools3();
|
|
433934
|
+
init_synthetic_tools();
|
|
433935
|
+
}
|
|
433936
|
+
});
|
|
433937
|
+
|
|
433938
|
+
// node_modules/@sema-agent/core/dist/core/hooks.js
|
|
433939
|
+
var objectPrototype, init_hooks3 = __esm({
|
|
433940
|
+
"node_modules/@sema-agent/core/dist/core/hooks.js"() {
|
|
433941
|
+
init_tool_policy();
|
|
433942
|
+
init_ask_class();
|
|
433943
|
+
init_ask_origin();
|
|
433944
|
+
init_auto_mode();
|
|
433945
|
+
init_untrusted_text();
|
|
433946
|
+
init_reminder_mint();
|
|
433947
|
+
init_checkpoint_store();
|
|
433948
|
+
init_ask_question();
|
|
433949
|
+
init_safe_notify();
|
|
433950
|
+
init_permission_rule_org();
|
|
433951
|
+
objectPrototype = Object.prototype;
|
|
433952
|
+
}
|
|
433953
|
+
});
|
|
433954
|
+
|
|
433955
|
+
// node_modules/@sema-agent/core/dist/core/tool-name-aliases.js
|
|
433956
|
+
var RETIRED_TOOL_NAMES, init_tool_name_aliases = __esm({
|
|
433957
|
+
"node_modules/@sema-agent/core/dist/core/tool-name-aliases.js"() {
|
|
433958
|
+
RETIRED_TOOL_NAMES = /* @__PURE__ */ new Map([
|
|
433959
|
+
["read_file", 'renamed "Read"'],
|
|
433960
|
+
["edit_file", 'renamed "Edit"'],
|
|
433961
|
+
["write_file", 'renamed "Write"'],
|
|
433962
|
+
["bash", 'renamed "Bash"'],
|
|
433963
|
+
["bash_readonly", 'folded into "Bash" (read-only posture rides handsReadOnly/shellGate, not a tool name)'],
|
|
433964
|
+
["glob", 'renamed "Glob"'],
|
|
433965
|
+
["grep", 'renamed "Grep"'],
|
|
433966
|
+
["web_fetch", 'renamed "WebFetch"'],
|
|
433967
|
+
["tool_search", 'renamed "ToolSearch"'],
|
|
433968
|
+
["skill", 'renamed "Skill"'],
|
|
433969
|
+
["present_plan", 'renamed "ExitPlanMode"'],
|
|
433970
|
+
["enter_plan_mode", 'renamed "EnterPlanMode"'],
|
|
433971
|
+
["spawn_subagent", 'renamed "Agent"'],
|
|
433972
|
+
["CronCancel", 'renamed "CronDelete"'],
|
|
433973
|
+
["lsp", 'renamed "LSP"'],
|
|
433974
|
+
["submit_output", 'renamed "StructuredOutput"'],
|
|
433975
|
+
["repo_map", 'renamed "RepoMap"'],
|
|
433976
|
+
["read_tool_result", 'renamed "ReadToolResult"'],
|
|
433977
|
+
["report_blocked", 'renamed "ReportBlocked"'],
|
|
433978
|
+
["declare_done", 'renamed "DeclareDone"'],
|
|
433979
|
+
["run_workflow", 'renamed "Workflow"'],
|
|
433980
|
+
["RunWorkflow", 'renamed "Workflow"'],
|
|
433981
|
+
["Task", 'renamed "Agent" (a deployment-defined tool named "Task" is fine \u2014 this fires only when the name matches nothing in the roster)'],
|
|
433982
|
+
["BashOutput", 'renamed "TaskOutput"'],
|
|
433983
|
+
["AgentOutputTool", 'renamed "TaskOutput"'],
|
|
433984
|
+
["BashOutputTool", 'renamed "TaskOutput"'],
|
|
433985
|
+
["AgentOutput", 'renamed "TaskOutput"'],
|
|
433986
|
+
["WorkflowStatus", 'folded into "TaskOutput" (poll by runId)'],
|
|
433987
|
+
["KillShell", 'renamed "TaskStop"'],
|
|
433988
|
+
["KillBash", 'renamed "TaskStop"'],
|
|
433989
|
+
["ListMcpResources", 'renamed "ListMcpResourcesTool"'],
|
|
433990
|
+
["ReadMcpResource", 'renamed "ReadMcpResourceTool"'],
|
|
433991
|
+
["ReadMcpResourceDir", 'renamed "ReadMcpResourceDirTool"'],
|
|
433992
|
+
["MultiEdit", 'removed \u2014 "Edit" accepts the edits[] shape'],
|
|
433993
|
+
["Fork", 'removed \u2014 use Agent with subagent_type: "fork"'],
|
|
433994
|
+
["Sleep", 'removed \u2014 schedule a re-wake with CronCreate({schedule:{kind:"delay"}}) or wait with Monitor'],
|
|
433995
|
+
["Remember", "removed \u2014 memory is file-based; write the memory directory with the ordinary file tools"],
|
|
433996
|
+
["remember", "removed \u2014 memory is file-based; write the memory directory with the ordinary file tools"],
|
|
433997
|
+
["Recall", "removed \u2014 memory is file-based; read the memory directory with the ordinary file tools"],
|
|
433998
|
+
["recall", "removed \u2014 memory is file-based; read the memory directory with the ordinary file tools"]
|
|
433999
|
+
]);
|
|
434000
|
+
}
|
|
434001
|
+
});
|
|
434002
|
+
|
|
434003
|
+
// node_modules/@sema-agent/core/dist/core/runner/session-rule-policy.js
|
|
434004
|
+
var PATH_WRITE_TOOLS, PATH_CONFINABLE_WRITE_TOOLS, init_session_rule_policy = __esm({
|
|
434005
|
+
"node_modules/@sema-agent/core/dist/core/runner/session-rule-policy.js"() {
|
|
434006
|
+
init_safety();
|
|
434007
|
+
init_safety();
|
|
434008
|
+
init_tool_policy();
|
|
434009
|
+
PATH_WRITE_TOOLS = /* @__PURE__ */ new Set(["Write", "Edit", "MultiEdit"]), PATH_CONFINABLE_WRITE_TOOLS = /* @__PURE__ */ new Set([...PATH_WRITE_TOOLS, "NotebookEdit"]);
|
|
434010
|
+
}
|
|
434011
|
+
});
|
|
434012
|
+
|
|
434013
|
+
// node_modules/@sema-agent/core/dist/core/skill-tool-specifier.js
|
|
434014
|
+
var SPECIFIER_ENFORCED_TOOLS, init_skill_tool_specifier = __esm({
|
|
434015
|
+
"node_modules/@sema-agent/core/dist/core/skill-tool-specifier.js"() {
|
|
434016
|
+
init_permission_rules();
|
|
434017
|
+
init_tool_policy();
|
|
434018
|
+
init_bash_readonly_classifier();
|
|
434019
|
+
SPECIFIER_ENFORCED_TOOLS = new Set(COARSE_SHELL_TOOLS);
|
|
434020
|
+
}
|
|
434021
|
+
});
|
|
434022
|
+
|
|
434023
|
+
// node_modules/@sema-agent/core/dist/core/runner/active-skill-scope.js
|
|
434024
|
+
var init_active_skill_scope = __esm({
|
|
434025
|
+
"node_modules/@sema-agent/core/dist/core/runner/active-skill-scope.js"() {
|
|
434026
|
+
init_safety();
|
|
434027
|
+
init_session_rule_policy();
|
|
434028
|
+
init_skill_tool_specifier();
|
|
434029
|
+
}
|
|
434030
|
+
});
|
|
434031
|
+
|
|
434032
|
+
// node_modules/@sema-agent/core/dist/core/runner/denial-limit-arms.js
|
|
434033
|
+
var init_denial_limit_arms = __esm({
|
|
434034
|
+
"node_modules/@sema-agent/core/dist/core/runner/denial-limit-arms.js"() {
|
|
434035
|
+
init_auto_mode();
|
|
434036
|
+
init_auto_mode_arming();
|
|
434037
|
+
init_types21();
|
|
434038
|
+
init_untrusted_text();
|
|
434039
|
+
init_ask_origin();
|
|
434040
|
+
}
|
|
434041
|
+
});
|
|
434042
|
+
|
|
434043
|
+
// node_modules/@sema-agent/core/dist/core/runner/inherited-ask-grants.js
|
|
434044
|
+
var init_inherited_ask_grants = __esm({
|
|
434045
|
+
"node_modules/@sema-agent/core/dist/core/runner/inherited-ask-grants.js"() {
|
|
434046
|
+
init_arg_summary();
|
|
434047
|
+
init_tool_policy();
|
|
434048
|
+
}
|
|
434049
|
+
});
|
|
434050
|
+
|
|
434051
|
+
// node_modules/@sema-agent/core/dist/core/runner/permission-rule-lanes.js
|
|
434052
|
+
var init_permission_rule_lanes = __esm({
|
|
434053
|
+
"node_modules/@sema-agent/core/dist/core/runner/permission-rule-lanes.js"() {
|
|
434054
|
+
init_hooks3();
|
|
434055
|
+
init_permission_rule_model();
|
|
434056
|
+
init_permission_rule_org();
|
|
434057
|
+
}
|
|
434058
|
+
});
|
|
434059
|
+
|
|
434060
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-policy-chain.js
|
|
434061
|
+
var init_prepare_policy_chain = __esm({
|
|
434062
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-policy-chain.js"() {
|
|
434063
|
+
init_send_message_tool();
|
|
434064
|
+
init_ask_class();
|
|
434065
|
+
init_ask_question();
|
|
434066
|
+
init_checkpoint_store();
|
|
434067
|
+
init_hooks3();
|
|
434068
|
+
init_permission_rules();
|
|
434069
|
+
init_remote_env();
|
|
434070
|
+
init_tool_policy();
|
|
434071
|
+
init_tool_name_aliases();
|
|
434072
|
+
init_protocol_table();
|
|
434073
|
+
init_trace();
|
|
434074
|
+
init_active_skill_scope();
|
|
434075
|
+
init_denial_limit_arms();
|
|
434076
|
+
init_inherited_ask_grants();
|
|
434077
|
+
init_permission_rule_lanes();
|
|
434078
|
+
init_session_rule_policy();
|
|
434079
|
+
}
|
|
434080
|
+
});
|
|
434081
|
+
|
|
434082
|
+
// node_modules/@sema-agent/core/dist/core/media-byte-cap.js
|
|
434083
|
+
var init_media_byte_cap = __esm({
|
|
434084
|
+
"node_modules/@sema-agent/core/dist/core/media-byte-cap.js"() {
|
|
434085
|
+
}
|
|
434086
|
+
});
|
|
434087
|
+
|
|
434088
|
+
// node_modules/@sema-agent/core/dist/core/tool-result-budget.js
|
|
434089
|
+
var init_tool_result_budget = __esm({
|
|
434090
|
+
"node_modules/@sema-agent/core/dist/core/tool-result-budget.js"() {
|
|
434091
|
+
init_message_utils();
|
|
434092
|
+
init_tool_result_store();
|
|
434093
|
+
}
|
|
434094
|
+
});
|
|
434095
|
+
|
|
434096
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-context-lane.js
|
|
434097
|
+
var init_prepare_context_lane = __esm({
|
|
434098
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-context-lane.js"() {
|
|
434099
|
+
init_harness();
|
|
434100
|
+
init_context_edit();
|
|
434101
|
+
init_context_guard();
|
|
434102
|
+
init_media_byte_cap();
|
|
434103
|
+
init_tool_result_budget();
|
|
434104
|
+
init_tool_result_store();
|
|
434105
|
+
init_trace();
|
|
434106
|
+
init_types21();
|
|
434107
|
+
init_git_status_frame();
|
|
434108
|
+
}
|
|
434109
|
+
});
|
|
434110
|
+
|
|
434111
|
+
// node_modules/@sema-agent/core/dist/prompt-assembly/composer.js
|
|
434112
|
+
var SINGLE_BLOCK_LAYOUT, init_composer = __esm({
|
|
434113
|
+
"node_modules/@sema-agent/core/dist/prompt-assembly/composer.js"() {
|
|
434114
|
+
SINGLE_BLOCK_LAYOUT = { groups: [{ groupId: "body", untilRank: Number.POSITIVE_INFINITY, cacheControlBoundary: !0 }] };
|
|
434115
|
+
}
|
|
434116
|
+
});
|
|
434117
|
+
|
|
434118
|
+
// node_modules/@sema-agent/core/dist/prompt-assembly/assemble.js
|
|
434119
|
+
var init_assemble = __esm({
|
|
434120
|
+
"node_modules/@sema-agent/core/dist/prompt-assembly/assemble.js"() {
|
|
434121
|
+
init_default6();
|
|
434122
|
+
init_composer();
|
|
434123
|
+
init_sema_default();
|
|
434124
|
+
}
|
|
434125
|
+
});
|
|
434126
|
+
|
|
434127
|
+
// node_modules/@sema-agent/core/dist/prompt-assembly/artifact.js
|
|
434128
|
+
var init_artifact = __esm({
|
|
434129
|
+
"node_modules/@sema-agent/core/dist/prompt-assembly/artifact.js"() {
|
|
434130
|
+
init_epoch();
|
|
434131
|
+
}
|
|
434132
|
+
});
|
|
434133
|
+
|
|
434134
|
+
// node_modules/@sema-agent/core/dist/prompt-assembly/turn-snapshot.js
|
|
434135
|
+
var init_turn_snapshot = __esm({
|
|
434136
|
+
"node_modules/@sema-agent/core/dist/prompt-assembly/turn-snapshot.js"() {
|
|
434137
|
+
init_epoch();
|
|
434138
|
+
}
|
|
434139
|
+
});
|
|
434140
|
+
|
|
434141
|
+
// node_modules/@sema-agent/core/dist/core/cache-break-detector.js
|
|
434142
|
+
var SERVER_GAP_MS, init_cache_break_detector = __esm({
|
|
434143
|
+
"node_modules/@sema-agent/core/dist/core/cache-break-detector.js"() {
|
|
434144
|
+
SERVER_GAP_MS = 5 * 6e4;
|
|
434145
|
+
}
|
|
434146
|
+
});
|
|
434147
|
+
|
|
434148
|
+
// node_modules/@sema-agent/core/dist/core/runner/prompt-hash-salt.js
|
|
434149
|
+
import { randomBytes as randomBytes25 } from "node:crypto";
|
|
434150
|
+
var PROMPT_HASH_SALT, init_prompt_hash_salt = __esm({
|
|
434151
|
+
"node_modules/@sema-agent/core/dist/core/runner/prompt-hash-salt.js"() {
|
|
434152
|
+
PROMPT_HASH_SALT = randomBytes25(16);
|
|
434153
|
+
}
|
|
434154
|
+
});
|
|
434155
|
+
|
|
434156
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-turn-wiring.js
|
|
434157
|
+
var init_prepare_turn_wiring = __esm({
|
|
434158
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-turn-wiring.js"() {
|
|
434159
|
+
init_assemble();
|
|
434160
|
+
init_artifact();
|
|
434161
|
+
init_turn_snapshot();
|
|
434162
|
+
init_cache_break_detector();
|
|
434163
|
+
init_task_registry();
|
|
434164
|
+
init_tool_policy();
|
|
434165
|
+
init_encoding();
|
|
434166
|
+
init_fs();
|
|
434167
|
+
init_safety();
|
|
434168
|
+
init_prompt_hash_salt();
|
|
434169
|
+
init_turn_attachments();
|
|
434170
|
+
}
|
|
434171
|
+
});
|
|
434172
|
+
|
|
434173
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-prompt-assembly.js
|
|
434174
|
+
var init_prepare_prompt_assembly = __esm({
|
|
434175
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-prompt-assembly.js"() {
|
|
434176
|
+
init_send_message_tool();
|
|
434177
|
+
init_assemble();
|
|
434178
|
+
init_artifact();
|
|
434179
|
+
init_epoch();
|
|
434180
|
+
init_sema_default();
|
|
434181
|
+
init_tool_catalog();
|
|
434182
|
+
init_default6();
|
|
434183
|
+
init_protocol_table();
|
|
434184
|
+
init_reminder_mint();
|
|
434185
|
+
init_session4();
|
|
434186
|
+
init_prompt_hash_salt();
|
|
434187
|
+
}
|
|
434188
|
+
});
|
|
434189
|
+
|
|
433720
434190
|
// node_modules/@sema-agent/core/dist/core/retention.js
|
|
433721
434191
|
var init_retention = __esm({
|
|
433722
434192
|
"node_modules/@sema-agent/core/dist/core/retention.js"() {
|
|
@@ -433777,13 +434247,12 @@ var TASK_LIMIT_KEY_DICT, TASK_LIMIT_KEYS, init_prepare_config_doors = __esm({
|
|
|
433777
434247
|
});
|
|
433778
434248
|
|
|
433779
434249
|
// node_modules/@sema-agent/core/dist/core/runner/prepare-safety-scan.js
|
|
433780
|
-
var
|
|
434250
|
+
var init_prepare_safety_scan = __esm({
|
|
433781
434251
|
"node_modules/@sema-agent/core/dist/core/runner/prepare-safety-scan.js"() {
|
|
433782
434252
|
init_protocol_table();
|
|
433783
434253
|
init_fs();
|
|
433784
434254
|
init_tool_result_store();
|
|
433785
434255
|
init_present_plan_tool();
|
|
433786
|
-
NAMESPACED_NAME_SHAPES = PROTOCOL_TABLE.map((ns) => `${ns.prefix}<peer>__<tool>`).join(", ");
|
|
433787
434256
|
}
|
|
433788
434257
|
});
|
|
433789
434258
|
|
|
@@ -433812,17 +434281,9 @@ var init_session_file_state_replay = __esm({
|
|
|
433812
434281
|
}
|
|
433813
434282
|
});
|
|
433814
434283
|
|
|
433815
|
-
// node_modules/@sema-agent/core/dist/core/
|
|
433816
|
-
var
|
|
433817
|
-
"node_modules/@sema-agent/core/dist/core/
|
|
433818
|
-
}
|
|
433819
|
-
});
|
|
433820
|
-
|
|
433821
|
-
// node_modules/@sema-agent/core/dist/core/runner/prepare-workspace-restore.js
|
|
433822
|
-
var init_prepare_workspace_restore = __esm({
|
|
433823
|
-
"node_modules/@sema-agent/core/dist/core/runner/prepare-workspace-restore.js"() {
|
|
433824
|
-
init_remote_env();
|
|
433825
|
-
init_with_retry();
|
|
434284
|
+
// node_modules/@sema-agent/core/dist/core/runner/workspace-path.js
|
|
434285
|
+
var init_workspace_path = __esm({
|
|
434286
|
+
"node_modules/@sema-agent/core/dist/core/runner/workspace-path.js"() {
|
|
433826
434287
|
}
|
|
433827
434288
|
});
|
|
433828
434289
|
|
|
@@ -433838,57 +434299,68 @@ var init_prepare_hands_readface = __esm({
|
|
|
433838
434299
|
init_encoding();
|
|
433839
434300
|
init_session_file_state_replay();
|
|
433840
434301
|
init_types21();
|
|
433841
|
-
|
|
434302
|
+
init_workspace_path();
|
|
433842
434303
|
}
|
|
433843
434304
|
});
|
|
433844
434305
|
|
|
433845
|
-
// node_modules/@sema-agent/core/dist/core/
|
|
433846
|
-
var
|
|
433847
|
-
"node_modules/@sema-agent/core/dist/core/
|
|
434306
|
+
// node_modules/@sema-agent/core/dist/core/with-retry.js
|
|
434307
|
+
var init_with_retry = __esm({
|
|
434308
|
+
"node_modules/@sema-agent/core/dist/core/with-retry.js"() {
|
|
433848
434309
|
}
|
|
433849
434310
|
});
|
|
433850
434311
|
|
|
433851
|
-
// node_modules/@sema-agent/core/dist/
|
|
433852
|
-
var
|
|
433853
|
-
"node_modules/@sema-agent/core/dist/
|
|
433854
|
-
|
|
434312
|
+
// node_modules/@sema-agent/core/dist/core/runner/remote-env-retry.js
|
|
434313
|
+
var init_remote_env_retry = __esm({
|
|
434314
|
+
"node_modules/@sema-agent/core/dist/core/runner/remote-env-retry.js"() {
|
|
434315
|
+
init_remote_env();
|
|
434316
|
+
init_with_retry();
|
|
433855
434317
|
}
|
|
433856
434318
|
});
|
|
433857
434319
|
|
|
433858
|
-
// node_modules/@sema-agent/core/dist/
|
|
433859
|
-
var
|
|
433860
|
-
"node_modules/@sema-agent/core/dist/
|
|
433861
|
-
|
|
433862
|
-
|
|
433863
|
-
|
|
434320
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-workspace-restore.js
|
|
434321
|
+
var init_prepare_workspace_restore = __esm({
|
|
434322
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-workspace-restore.js"() {
|
|
434323
|
+
init_remote_env();
|
|
434324
|
+
init_remote_env_retry();
|
|
434325
|
+
init_workspace_path();
|
|
434326
|
+
init_remote_env_retry();
|
|
433864
434327
|
}
|
|
433865
434328
|
});
|
|
433866
434329
|
|
|
433867
|
-
// node_modules/@sema-agent/core/dist/
|
|
433868
|
-
var
|
|
433869
|
-
"node_modules/@sema-agent/core/dist/
|
|
433870
|
-
init_epoch();
|
|
434330
|
+
// node_modules/@sema-agent/core/dist/core/runner/park-commit.js
|
|
434331
|
+
var init_park_commit = __esm({
|
|
434332
|
+
"node_modules/@sema-agent/core/dist/core/runner/park-commit.js"() {
|
|
433871
434333
|
}
|
|
433872
434334
|
});
|
|
433873
434335
|
|
|
433874
|
-
// node_modules/@sema-agent/core/dist/
|
|
433875
|
-
var
|
|
433876
|
-
"node_modules/@sema-agent/core/dist/
|
|
433877
|
-
|
|
434336
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-offload-wrappers.js
|
|
434337
|
+
var init_prepare_offload_wrappers = __esm({
|
|
434338
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-offload-wrappers.js"() {
|
|
434339
|
+
init_tool_result_store();
|
|
433878
434340
|
}
|
|
433879
434341
|
});
|
|
433880
434342
|
|
|
433881
|
-
// node_modules/@sema-agent/core/dist/core/
|
|
433882
|
-
var
|
|
433883
|
-
"node_modules/@sema-agent/core/dist/core/
|
|
433884
|
-
|
|
433885
|
-
init_tool_result_store();
|
|
434343
|
+
// node_modules/@sema-agent/core/dist/core/file-history-retention.js
|
|
434344
|
+
var init_file_history_retention = __esm({
|
|
434345
|
+
"node_modules/@sema-agent/core/dist/core/file-history-retention.js"() {
|
|
434346
|
+
init_retention_policy();
|
|
433886
434347
|
}
|
|
433887
434348
|
});
|
|
433888
434349
|
|
|
433889
|
-
// node_modules/@sema-agent/core/dist/core/
|
|
433890
|
-
var
|
|
433891
|
-
"node_modules/@sema-agent/core/dist/core/
|
|
434350
|
+
// node_modules/@sema-agent/core/dist/core/file-history-store.js
|
|
434351
|
+
var init_file_history_store = __esm({
|
|
434352
|
+
"node_modules/@sema-agent/core/dist/core/file-history-store.js"() {
|
|
434353
|
+
init_safety();
|
|
434354
|
+
init_file_history_retention();
|
|
434355
|
+
}
|
|
434356
|
+
});
|
|
434357
|
+
|
|
434358
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-file-history.js
|
|
434359
|
+
var init_prepare_file_history = __esm({
|
|
434360
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-file-history.js"() {
|
|
434361
|
+
init_node_execution_env();
|
|
434362
|
+
init_remote_env();
|
|
434363
|
+
init_file_history_store();
|
|
433892
434364
|
}
|
|
433893
434365
|
});
|
|
433894
434366
|
|
|
@@ -433898,6 +434370,159 @@ var init_teardown_bounded = __esm({
|
|
|
433898
434370
|
}
|
|
433899
434371
|
});
|
|
433900
434372
|
|
|
434373
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-execution-env.js
|
|
434374
|
+
var init_prepare_execution_env = __esm({
|
|
434375
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-execution-env.js"() {
|
|
434376
|
+
init_stub_env();
|
|
434377
|
+
init_remote_env();
|
|
434378
|
+
init_teardown_bounded();
|
|
434379
|
+
}
|
|
434380
|
+
});
|
|
434381
|
+
|
|
434382
|
+
// node_modules/@sema-agent/core/dist/core/runner/edited-files-ledger.js
|
|
434383
|
+
var init_edited_files_ledger = __esm({
|
|
434384
|
+
"node_modules/@sema-agent/core/dist/core/runner/edited-files-ledger.js"() {
|
|
434385
|
+
}
|
|
434386
|
+
});
|
|
434387
|
+
|
|
434388
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-run-refs.js
|
|
434389
|
+
var init_prepare_run_refs = __esm({
|
|
434390
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-run-refs.js"() {
|
|
434391
|
+
init_subagent();
|
|
434392
|
+
init_retain_ledger();
|
|
434393
|
+
init_active_skill_scope();
|
|
434394
|
+
init_edited_files_ledger();
|
|
434395
|
+
}
|
|
434396
|
+
});
|
|
434397
|
+
|
|
434398
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-inherited-gate.js
|
|
434399
|
+
var init_prepare_inherited_gate = __esm({
|
|
434400
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-inherited-gate.js"() {
|
|
434401
|
+
init_subagent();
|
|
434402
|
+
init_ask_question();
|
|
434403
|
+
init_hooks3();
|
|
434404
|
+
init_stub_env();
|
|
434405
|
+
init_tool_policy();
|
|
434406
|
+
init_denial_limit_arms();
|
|
434407
|
+
}
|
|
434408
|
+
});
|
|
434409
|
+
|
|
434410
|
+
// node_modules/@sema-agent/core/dist/orchestration/workflow-script-runner.js
|
|
434411
|
+
var init_workflow_script_runner = __esm({
|
|
434412
|
+
"node_modules/@sema-agent/core/dist/orchestration/workflow-script-runner.js"() {
|
|
434413
|
+
init_governance_baseline_validity();
|
|
434414
|
+
}
|
|
434415
|
+
});
|
|
434416
|
+
|
|
434417
|
+
// node_modules/@sema-agent/core/dist/core/auto-mode-prompt-assets.js
|
|
434418
|
+
var init_auto_mode_prompt_assets = __esm({
|
|
434419
|
+
"node_modules/@sema-agent/core/dist/core/auto-mode-prompt-assets.js"() {
|
|
434420
|
+
}
|
|
434421
|
+
});
|
|
434422
|
+
|
|
434423
|
+
// node_modules/@sema-agent/core/dist/core/auto-mode-prompt.js
|
|
434424
|
+
var init_auto_mode_prompt = __esm({
|
|
434425
|
+
"node_modules/@sema-agent/core/dist/core/auto-mode-prompt.js"() {
|
|
434426
|
+
init_auto_mode_defaults();
|
|
434427
|
+
init_auto_mode_prompt_assets();
|
|
434428
|
+
init_untrusted_text();
|
|
434429
|
+
init_auto_mode_defaults();
|
|
434430
|
+
}
|
|
434431
|
+
});
|
|
434432
|
+
|
|
434433
|
+
// node_modules/@sema-agent/core/dist/core/compliance.js
|
|
434434
|
+
var init_compliance = __esm({
|
|
434435
|
+
"node_modules/@sema-agent/core/dist/core/compliance.js"() {
|
|
434436
|
+
}
|
|
434437
|
+
});
|
|
434438
|
+
|
|
434439
|
+
// node_modules/@sema-agent/core/dist/core/runner/derived-route-fallback.js
|
|
434440
|
+
var init_derived_route_fallback = __esm({
|
|
434441
|
+
"node_modules/@sema-agent/core/dist/core/runner/derived-route-fallback.js"() {
|
|
434442
|
+
init_route_adjudicator();
|
|
434443
|
+
init_types21();
|
|
434444
|
+
}
|
|
434445
|
+
});
|
|
434446
|
+
|
|
434447
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-caps-and-workflow.js
|
|
434448
|
+
var init_prepare_caps_and_workflow = __esm({
|
|
434449
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-caps-and-workflow.js"() {
|
|
434450
|
+
init_harness();
|
|
434451
|
+
init_subagent();
|
|
434452
|
+
init_cross_session_envelope();
|
|
434453
|
+
init_run_workflow_tool();
|
|
434454
|
+
init_workflow_script_runner();
|
|
434455
|
+
init_workflow_size_guideline();
|
|
434456
|
+
init_auto_mode_arming();
|
|
434457
|
+
init_auto_mode_prompt();
|
|
434458
|
+
init_auto_mode();
|
|
434459
|
+
init_checkpoint_store();
|
|
434460
|
+
init_compliance();
|
|
434461
|
+
init_present_plan_tool();
|
|
434462
|
+
init_roles();
|
|
434463
|
+
init_runtime();
|
|
434464
|
+
init_task_registry();
|
|
434465
|
+
init_tools3();
|
|
434466
|
+
init_derived_route_fallback();
|
|
434467
|
+
init_synthetic_tools();
|
|
434468
|
+
}
|
|
434469
|
+
});
|
|
434470
|
+
|
|
434471
|
+
// node_modules/@sema-agent/core/dist/agents/agent-transcript-tool.js
|
|
434472
|
+
var init_agent_transcript_tool = __esm({
|
|
434473
|
+
"node_modules/@sema-agent/core/dist/agents/agent-transcript-tool.js"() {
|
|
434474
|
+
init_build3();
|
|
434475
|
+
init_tools3();
|
|
434476
|
+
init_background_agent_store();
|
|
434477
|
+
init_task_registry();
|
|
434478
|
+
init_untrusted_text();
|
|
434479
|
+
init_subagent_steps();
|
|
434480
|
+
init_subagent();
|
|
434481
|
+
init_retain_ledger();
|
|
434482
|
+
}
|
|
434483
|
+
});
|
|
434484
|
+
|
|
434485
|
+
// node_modules/@sema-agent/core/dist/agents/list-agents-tool.js
|
|
434486
|
+
var init_list_agents_tool = __esm({
|
|
434487
|
+
"node_modules/@sema-agent/core/dist/agents/list-agents-tool.js"() {
|
|
434488
|
+
init_build3();
|
|
434489
|
+
init_tools3();
|
|
434490
|
+
init_untrusted_text();
|
|
434491
|
+
init_cross_session_ref();
|
|
434492
|
+
init_roster_store();
|
|
434493
|
+
init_peer_directory();
|
|
434494
|
+
}
|
|
434495
|
+
});
|
|
434496
|
+
|
|
434497
|
+
// node_modules/@sema-agent/core/dist/agents/peer-notice-route.js
|
|
434498
|
+
var init_peer_notice_route = __esm({
|
|
434499
|
+
"node_modules/@sema-agent/core/dist/agents/peer-notice-route.js"() {
|
|
434500
|
+
init_mailbox_store();
|
|
434501
|
+
init_peer_directory();
|
|
434502
|
+
init_peer_notices();
|
|
434503
|
+
}
|
|
434504
|
+
});
|
|
434505
|
+
|
|
434506
|
+
// node_modules/@sema-agent/core/dist/agents/peer-session-drain.js
|
|
434507
|
+
var PEER_DRAIN_LEASE_TTL_MS, init_peer_session_drain = __esm({
|
|
434508
|
+
"node_modules/@sema-agent/core/dist/agents/peer-session-drain.js"() {
|
|
434509
|
+
init_mailbox_store();
|
|
434510
|
+
init_types21();
|
|
434511
|
+
init_cross_session_envelope();
|
|
434512
|
+
init_cross_session_judge();
|
|
434513
|
+
init_peer_admission();
|
|
434514
|
+
init_peer_directory();
|
|
434515
|
+
init_untrusted_text();
|
|
434516
|
+
init_list_agents_tool();
|
|
434517
|
+
init_cross_session_judge();
|
|
434518
|
+
init_peer_held_queue();
|
|
434519
|
+
init_peer_idle();
|
|
434520
|
+
init_peer_notices();
|
|
434521
|
+
init_peer_notice_route();
|
|
434522
|
+
PEER_DRAIN_LEASE_TTL_MS = 5 * 6e4;
|
|
434523
|
+
}
|
|
434524
|
+
});
|
|
434525
|
+
|
|
433901
434526
|
// node_modules/@sema-agent/core/dist/tools/monitor.js
|
|
433902
434527
|
var MONITOR_DESCRIPTION, init_monitor = __esm({
|
|
433903
434528
|
"node_modules/@sema-agent/core/dist/tools/monitor.js"() {
|
|
@@ -433958,44 +434583,290 @@ var ENTER_DESCRIPTION, init_worktree = __esm({
|
|
|
433958
434583
|
}
|
|
433959
434584
|
});
|
|
433960
434585
|
|
|
433961
|
-
// node_modules/@sema-agent/core/dist/
|
|
433962
|
-
var
|
|
433963
|
-
"node_modules/@sema-agent/core/dist/
|
|
433964
|
-
|
|
433965
|
-
|
|
433966
|
-
|
|
433967
|
-
|
|
433968
|
-
|
|
433969
|
-
|
|
434586
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-delegation-surface.js
|
|
434587
|
+
var init_prepare_delegation_surface = __esm({
|
|
434588
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-delegation-surface.js"() {
|
|
434589
|
+
init_agent_transcript_tool();
|
|
434590
|
+
init_send_message_tool();
|
|
434591
|
+
init_peer_session_drain();
|
|
434592
|
+
init_monitor();
|
|
434593
|
+
init_worktree();
|
|
434594
|
+
init_task_registry();
|
|
434595
|
+
init_tool_result_store();
|
|
434596
|
+
init_trace();
|
|
434597
|
+
init_types21();
|
|
433970
434598
|
}
|
|
433971
434599
|
});
|
|
433972
434600
|
|
|
433973
|
-
// node_modules/@sema-agent/core/dist/
|
|
433974
|
-
var
|
|
433975
|
-
"node_modules/@sema-agent/core/dist/
|
|
433976
|
-
|
|
433977
|
-
|
|
433978
|
-
|
|
434601
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-tool-disclosure-mount.js
|
|
434602
|
+
var init_prepare_tool_disclosure_mount = __esm({
|
|
434603
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-tool-disclosure-mount.js"() {
|
|
434604
|
+
init_harness();
|
|
434605
|
+
init_cache_break_detector();
|
|
434606
|
+
init_types21();
|
|
434607
|
+
init_tool_disclosure();
|
|
433979
434608
|
}
|
|
433980
434609
|
});
|
|
433981
434610
|
|
|
433982
|
-
// node_modules/@sema-agent/core/dist/
|
|
433983
|
-
var
|
|
433984
|
-
"node_modules/@sema-agent/core/dist/
|
|
433985
|
-
|
|
434611
|
+
// node_modules/@sema-agent/core/dist/core/runner/checkpoint-scope.js
|
|
434612
|
+
var init_checkpoint_scope = __esm({
|
|
434613
|
+
"node_modules/@sema-agent/core/dist/core/runner/checkpoint-scope.js"() {
|
|
434614
|
+
}
|
|
434615
|
+
});
|
|
434616
|
+
|
|
434617
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-wiring-manifest.js
|
|
434618
|
+
var init_prepare_wiring_manifest = __esm({
|
|
434619
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-wiring-manifest.js"() {
|
|
434620
|
+
init_peer_session_drain();
|
|
434621
|
+
init_fs();
|
|
434622
|
+
init_checkpoint_store();
|
|
434623
|
+
init_hooks3();
|
|
434624
|
+
init_remote_env();
|
|
434625
|
+
init_tool_result_store();
|
|
434626
|
+
init_tool_policy();
|
|
433986
434627
|
init_types21();
|
|
433987
|
-
init_cross_session_envelope();
|
|
433988
|
-
init_cross_session_judge();
|
|
433989
|
-
init_peer_admission();
|
|
433990
|
-
init_peer_directory();
|
|
433991
434628
|
init_untrusted_text();
|
|
433992
|
-
|
|
433993
|
-
|
|
433994
|
-
|
|
433995
|
-
|
|
433996
|
-
|
|
433997
|
-
|
|
433998
|
-
|
|
434629
|
+
init_usage_window_store();
|
|
434630
|
+
init_wiring_manifest();
|
|
434631
|
+
init_checkpoint_scope();
|
|
434632
|
+
}
|
|
434633
|
+
});
|
|
434634
|
+
|
|
434635
|
+
// node_modules/@sema-agent/core/dist/core/runner/abort-race.js
|
|
434636
|
+
var init_abort_race = __esm({
|
|
434637
|
+
"node_modules/@sema-agent/core/dist/core/runner/abort-race.js"() {
|
|
434638
|
+
}
|
|
434639
|
+
});
|
|
434640
|
+
|
|
434641
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-ask-lane.js
|
|
434642
|
+
var init_prepare_ask_lane = __esm({
|
|
434643
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-ask-lane.js"() {
|
|
434644
|
+
init_arg_summary();
|
|
434645
|
+
init_hooks3();
|
|
434646
|
+
init_tool_policy();
|
|
434647
|
+
init_abort_race();
|
|
434648
|
+
init_denial_limit_arms();
|
|
434649
|
+
init_inherited_ask_grants();
|
|
434650
|
+
}
|
|
434651
|
+
});
|
|
434652
|
+
|
|
434653
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-suspend-saga.js
|
|
434654
|
+
var init_prepare_suspend_saga = __esm({
|
|
434655
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-suspend-saga.js"() {
|
|
434656
|
+
init_task_registry();
|
|
434657
|
+
init_remote_env();
|
|
434658
|
+
init_tool_policy();
|
|
434659
|
+
init_abort_race();
|
|
434660
|
+
init_checkpoint_scope();
|
|
434661
|
+
init_announce_once_ledger();
|
|
434662
|
+
init_remote_env_retry();
|
|
434663
|
+
}
|
|
434664
|
+
});
|
|
434665
|
+
|
|
434666
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-boundary-parks.js
|
|
434667
|
+
var init_prepare_boundary_parks = __esm({
|
|
434668
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-boundary-parks.js"() {
|
|
434669
|
+
init_background_shell();
|
|
434670
|
+
init_checkpoint_store();
|
|
434671
|
+
init_task_registry();
|
|
434672
|
+
init_checkpoint_scope();
|
|
434673
|
+
init_park_commit();
|
|
434674
|
+
init_remote_env_retry();
|
|
434675
|
+
}
|
|
434676
|
+
});
|
|
434677
|
+
|
|
434678
|
+
// node_modules/@sema-agent/core/dist/core/runner/content-ask-bindings.js
|
|
434679
|
+
var init_content_ask_bindings = __esm({
|
|
434680
|
+
"node_modules/@sema-agent/core/dist/core/runner/content-ask-bindings.js"() {
|
|
434681
|
+
}
|
|
434682
|
+
});
|
|
434683
|
+
|
|
434684
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-park-ask.js
|
|
434685
|
+
var init_prepare_park_ask = __esm({
|
|
434686
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-park-ask.js"() {
|
|
434687
|
+
init_uuid4();
|
|
434688
|
+
init_value2();
|
|
434689
|
+
init_ask_question();
|
|
434690
|
+
init_background_shell();
|
|
434691
|
+
init_canonical_json();
|
|
434692
|
+
init_checkpoint_store();
|
|
434693
|
+
init_hooks3();
|
|
434694
|
+
init_task_registry();
|
|
434695
|
+
init_tool_policy();
|
|
434696
|
+
init_tool_result_store();
|
|
434697
|
+
init_abort_race();
|
|
434698
|
+
init_checkpoint_scope();
|
|
434699
|
+
init_content_ask_bindings();
|
|
434700
|
+
init_park_commit();
|
|
434701
|
+
init_remote_env_retry();
|
|
434702
|
+
}
|
|
434703
|
+
});
|
|
434704
|
+
|
|
434705
|
+
// node_modules/@sema-agent/core/dist/core/sensitive-path-policy.js
|
|
434706
|
+
var CASE_INSENSITIVE_FS3, init_sensitive_path_policy = __esm({
|
|
434707
|
+
"node_modules/@sema-agent/core/dist/core/sensitive-path-policy.js"() {
|
|
434708
|
+
init_safety();
|
|
434709
|
+
init_read_deny();
|
|
434710
|
+
CASE_INSENSITIVE_FS3 = process.platform === "darwin" || process.platform === "win32";
|
|
434711
|
+
}
|
|
434712
|
+
});
|
|
434713
|
+
|
|
434714
|
+
// node_modules/@sema-agent/core/dist/core/write-protect.js
|
|
434715
|
+
var freezeTable, WRITE_PROTECTED_DEFAULT_TABLE, init_write_protect = __esm({
|
|
434716
|
+
"node_modules/@sema-agent/core/dist/core/write-protect.js"() {
|
|
434717
|
+
init_safety();
|
|
434718
|
+
init_session_rule_policy();
|
|
434719
|
+
init_sensitive_path_policy();
|
|
434720
|
+
freezeTable = (rows2) => Object.freeze(rows2.map((r) => Object.freeze(r))), WRITE_PROTECTED_DEFAULT_TABLE = freezeTable([
|
|
434721
|
+
{ name: ".gitconfig", kind: "basename" },
|
|
434722
|
+
{ name: ".gitmodules", kind: "basename" },
|
|
434723
|
+
{ name: ".bashrc", kind: "basename" },
|
|
434724
|
+
{ name: ".bash_profile", kind: "basename" },
|
|
434725
|
+
{ name: ".zshrc", kind: "basename" },
|
|
434726
|
+
{ name: ".zprofile", kind: "basename" },
|
|
434727
|
+
{ name: ".profile", kind: "basename" },
|
|
434728
|
+
{ name: ".zshenv", kind: "basename" },
|
|
434729
|
+
{ name: ".zlogin", kind: "basename" },
|
|
434730
|
+
{ name: ".zlogout", kind: "basename" },
|
|
434731
|
+
{ name: ".bash_login", kind: "basename" },
|
|
434732
|
+
{ name: ".bash_aliases", kind: "basename" },
|
|
434733
|
+
{ name: ".bash_logout", kind: "basename" },
|
|
434734
|
+
{ name: ".envrc", kind: "basename" },
|
|
434735
|
+
{ name: ".ripgreprc", kind: "basename" },
|
|
434736
|
+
{ name: ".mcp.json", kind: "basename" },
|
|
434737
|
+
{ name: ".claude.json", kind: "basename" },
|
|
434738
|
+
{ name: ".npmrc", kind: "basename" },
|
|
434739
|
+
{ name: ".yarnrc", kind: "basename" },
|
|
434740
|
+
{ name: ".yarnrc.yml", kind: "basename" },
|
|
434741
|
+
{ name: ".pnp.cjs", kind: "basename" },
|
|
434742
|
+
{ name: ".pnp.loader.mjs", kind: "basename" },
|
|
434743
|
+
{ name: ".pnpmfile.cjs", kind: "basename" },
|
|
434744
|
+
{ name: "bunfig.toml", kind: "basename" },
|
|
434745
|
+
{ name: ".bunfig.toml", kind: "basename" },
|
|
434746
|
+
{ name: ".bazelrc", kind: "basename" },
|
|
434747
|
+
{ name: ".bazelversion", kind: "basename" },
|
|
434748
|
+
{ name: ".bazeliskrc", kind: "basename" },
|
|
434749
|
+
{ name: ".pre-commit-config.yaml", kind: "basename" },
|
|
434750
|
+
{ name: "lefthook.yml", kind: "basename" },
|
|
434751
|
+
{ name: ".lefthook.yml", kind: "basename" },
|
|
434752
|
+
{ name: "lefthook.yaml", kind: "basename" },
|
|
434753
|
+
{ name: ".lefthook.yaml", kind: "basename" },
|
|
434754
|
+
{ name: "gradle-wrapper.properties", kind: "basename" },
|
|
434755
|
+
{ name: "maven-wrapper.properties", kind: "basename" },
|
|
434756
|
+
{ name: ".devcontainer.json", kind: "basename" },
|
|
434757
|
+
{ name: "pyrightconfig.json", kind: "basename" },
|
|
434758
|
+
{ name: ".git", kind: "segment" },
|
|
434759
|
+
{ name: ".vscode", kind: "segment" },
|
|
434760
|
+
{ name: ".idea", kind: "segment" },
|
|
434761
|
+
{ name: ".claude", kind: "segment" },
|
|
434762
|
+
{ name: ".husky", kind: "segment" },
|
|
434763
|
+
{ name: ".cargo", kind: "segment" },
|
|
434764
|
+
{ name: ".devcontainer", kind: "segment" },
|
|
434765
|
+
{ name: ".yarn", kind: "segment" },
|
|
434766
|
+
{ name: ".mvn", kind: "segment" },
|
|
434767
|
+
{ name: ".config/git", kind: "segment-run" },
|
|
434768
|
+
{ name: ".ssh", kind: "segment" },
|
|
434769
|
+
{ name: ".gnupg", kind: "segment" },
|
|
434770
|
+
{ name: ".sema.json", kind: "basename" },
|
|
434771
|
+
{ name: ".sema", kind: "segment" }
|
|
434772
|
+
]);
|
|
434773
|
+
}
|
|
434774
|
+
});
|
|
434775
|
+
|
|
434776
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-gate-stations.js
|
|
434777
|
+
var init_prepare_gate_stations = __esm({
|
|
434778
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-gate-stations.js"() {
|
|
434779
|
+
init_send_message_tool();
|
|
434780
|
+
init_compliance();
|
|
434781
|
+
init_hooks3();
|
|
434782
|
+
init_present_plan_tool();
|
|
434783
|
+
init_tool_policy();
|
|
434784
|
+
init_trace();
|
|
434785
|
+
init_write_protect();
|
|
434786
|
+
init_session_rule_policy();
|
|
434787
|
+
}
|
|
434788
|
+
});
|
|
434789
|
+
|
|
434790
|
+
// node_modules/@sema-agent/core/dist/core/a2a-task-state.js
|
|
434791
|
+
var A2A_TASK_STATES, init_a2a_task_state = __esm({
|
|
434792
|
+
"node_modules/@sema-agent/core/dist/core/a2a-task-state.js"() {
|
|
434793
|
+
A2A_TASK_STATES = [
|
|
434794
|
+
"submitted",
|
|
434795
|
+
"working",
|
|
434796
|
+
"input-required",
|
|
434797
|
+
"completed",
|
|
434798
|
+
"canceled",
|
|
434799
|
+
"failed",
|
|
434800
|
+
"rejected",
|
|
434801
|
+
"auth-required",
|
|
434802
|
+
"unknown"
|
|
434803
|
+
];
|
|
434804
|
+
}
|
|
434805
|
+
});
|
|
434806
|
+
|
|
434807
|
+
// node_modules/@sema-agent/core/dist/core/a2a.js
|
|
434808
|
+
var A2A_CALL_TOTAL_TIMEOUT_MS, A2A_RESPONSE_MAX_BYTES, A2A_STATE_SET, init_a2a = __esm({
|
|
434809
|
+
"node_modules/@sema-agent/core/dist/core/a2a.js"() {
|
|
434810
|
+
init_build3();
|
|
434811
|
+
init_a2a_task_state();
|
|
434812
|
+
init_mcp4();
|
|
434813
|
+
init_protocol_naming();
|
|
434814
|
+
init_protocol_table();
|
|
434815
|
+
init_untrusted_text();
|
|
434816
|
+
A2A_CALL_TOTAL_TIMEOUT_MS = 10 * 6e4, A2A_RESPONSE_MAX_BYTES = 8 * 1024 * 1024, A2A_STATE_SET = new Set(A2A_TASK_STATES);
|
|
434817
|
+
}
|
|
434818
|
+
});
|
|
434819
|
+
|
|
434820
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-protocol-tools.js
|
|
434821
|
+
var init_prepare_protocol_tools = __esm({
|
|
434822
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-protocol-tools.js"() {
|
|
434823
|
+
init_build3();
|
|
434824
|
+
init_mcp4();
|
|
434825
|
+
init_a2a();
|
|
434826
|
+
init_types21();
|
|
434827
|
+
}
|
|
434828
|
+
});
|
|
434829
|
+
|
|
434830
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-question-face.js
|
|
434831
|
+
var init_prepare_question_face = __esm({
|
|
434832
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-question-face.js"() {
|
|
434833
|
+
init_ask_question();
|
|
434834
|
+
init_canonical_json();
|
|
434835
|
+
init_checkpoint_store();
|
|
434836
|
+
init_content_ask_bindings();
|
|
434837
|
+
init_content_ask_bindings();
|
|
434838
|
+
}
|
|
434839
|
+
});
|
|
434840
|
+
|
|
434841
|
+
// node_modules/@sema-agent/core/dist/core/lsp-protocol.js
|
|
434842
|
+
var init_lsp_protocol = __esm({
|
|
434843
|
+
"node_modules/@sema-agent/core/dist/core/lsp-protocol.js"() {
|
|
434844
|
+
}
|
|
434845
|
+
});
|
|
434846
|
+
|
|
434847
|
+
// node_modules/@sema-agent/core/dist/core/lsp.js
|
|
434848
|
+
var MAX_LSP_FILE_BYTES, init_lsp = __esm({
|
|
434849
|
+
"node_modules/@sema-agent/core/dist/core/lsp.js"() {
|
|
434850
|
+
init_lsp_protocol();
|
|
434851
|
+
init_safety();
|
|
434852
|
+
init_build3();
|
|
434853
|
+
init_tools3();
|
|
434854
|
+
MAX_LSP_FILE_BYTES = 10 * 1e3 * 1e3;
|
|
434855
|
+
}
|
|
434856
|
+
});
|
|
434857
|
+
|
|
434858
|
+
// node_modules/@sema-agent/core/dist/core/runner/prepare-lsp.js
|
|
434859
|
+
var init_prepare_lsp = __esm({
|
|
434860
|
+
"node_modules/@sema-agent/core/dist/core/runner/prepare-lsp.js"() {
|
|
434861
|
+
init_lsp();
|
|
434862
|
+
init_lsp_protocol();
|
|
434863
|
+
}
|
|
434864
|
+
});
|
|
434865
|
+
|
|
434866
|
+
// node_modules/@sema-agent/core/dist/core/runner/rollback-stack.js
|
|
434867
|
+
var init_rollback_stack = __esm({
|
|
434868
|
+
"node_modules/@sema-agent/core/dist/core/runner/rollback-stack.js"() {
|
|
434869
|
+
init_teardown_bounded();
|
|
433999
434870
|
}
|
|
434000
434871
|
});
|
|
434001
434872
|
|
|
@@ -434032,24 +434903,6 @@ One short sentence on what you chose and why. Goes to telemetry and is shown bac
|
|
|
434032
434903
|
}
|
|
434033
434904
|
});
|
|
434034
434905
|
|
|
434035
|
-
// node_modules/@sema-agent/core/dist/orchestration/workflow-script-runner.js
|
|
434036
|
-
var init_workflow_script_runner = __esm({
|
|
434037
|
-
"node_modules/@sema-agent/core/dist/orchestration/workflow-script-runner.js"() {
|
|
434038
|
-
init_governance_baseline_validity();
|
|
434039
|
-
}
|
|
434040
|
-
});
|
|
434041
|
-
|
|
434042
|
-
// node_modules/@sema-agent/core/dist/core/lsp.js
|
|
434043
|
-
var MAX_LSP_FILE_BYTES, init_lsp = __esm({
|
|
434044
|
-
"node_modules/@sema-agent/core/dist/core/lsp.js"() {
|
|
434045
|
-
init_lsp_protocol();
|
|
434046
|
-
init_safety();
|
|
434047
|
-
init_build3();
|
|
434048
|
-
init_tools3();
|
|
434049
|
-
MAX_LSP_FILE_BYTES = 10 * 1e3 * 1e3;
|
|
434050
|
-
}
|
|
434051
|
-
});
|
|
434052
|
-
|
|
434053
434906
|
// node_modules/@sema-agent/core/dist/core/park-selfcheck.js
|
|
434054
434907
|
var init_park_selfcheck = __esm({
|
|
434055
434908
|
"node_modules/@sema-agent/core/dist/core/park-selfcheck.js"() {
|
|
@@ -434059,131 +434912,84 @@ var init_park_selfcheck = __esm({
|
|
|
434059
434912
|
}
|
|
434060
434913
|
});
|
|
434061
434914
|
|
|
434062
|
-
// node_modules/@sema-agent/core/dist/core/file-history-retention.js
|
|
434063
|
-
var init_file_history_retention = __esm({
|
|
434064
|
-
"node_modules/@sema-agent/core/dist/core/file-history-retention.js"() {
|
|
434065
|
-
init_retention_policy();
|
|
434066
|
-
}
|
|
434067
|
-
});
|
|
434068
|
-
|
|
434069
|
-
// node_modules/@sema-agent/core/dist/core/file-history-store.js
|
|
434070
|
-
var init_file_history_store = __esm({
|
|
434071
|
-
"node_modules/@sema-agent/core/dist/core/file-history-store.js"() {
|
|
434072
|
-
init_safety();
|
|
434073
|
-
init_file_history_retention();
|
|
434074
|
-
}
|
|
434075
|
-
});
|
|
434076
|
-
|
|
434077
434915
|
// node_modules/@sema-agent/core/dist/core/runner/prepare-task.js
|
|
434078
|
-
|
|
434079
|
-
var PROMPT_HASH_SALT, DEFAULT_RESOURCE_TTL_MS, USAGE_WINDOW_REAP_MARGIN_MS, DEFAULT_UNATTENDED_APPROVAL_TTL_MS, init_prepare_task = __esm({
|
|
434916
|
+
var init_prepare_task = __esm({
|
|
434080
434917
|
"node_modules/@sema-agent/core/dist/core/runner/prepare-task.js"() {
|
|
434081
434918
|
init_harness();
|
|
434082
434919
|
init_auto_compaction();
|
|
434083
434920
|
init_compaction_call_options();
|
|
434084
|
-
init_auto_mode();
|
|
434085
|
-
init_denial_limit_arms();
|
|
434086
|
-
init_auto_mode_arming();
|
|
434087
|
-
init_auto_mode_prompt();
|
|
434088
|
-
init_roles();
|
|
434089
|
-
init_arg_summary();
|
|
434090
|
-
init_mcp4();
|
|
434091
|
-
init_a2a();
|
|
434092
|
-
init_build3();
|
|
434093
|
-
init_value2();
|
|
434094
434921
|
init_uuid4();
|
|
434095
434922
|
init_runtime();
|
|
434096
434923
|
init_session4();
|
|
434097
|
-
init_subagent();
|
|
434098
|
-
init_agent_transcript_tool();
|
|
434099
434924
|
init_send_message_tool();
|
|
434100
|
-
|
|
434101
|
-
init_tool_policy();
|
|
434102
|
-
init_permission_rule_model();
|
|
434103
|
-
init_permission_rule_store();
|
|
434104
|
-
init_active_skill_scope();
|
|
434105
|
-
init_turn_attachments();
|
|
434106
|
-
init_untrusted_text();
|
|
434925
|
+
init_announce_once_ledger();
|
|
434107
434926
|
init_reminder_mint();
|
|
434108
|
-
init_ask_class();
|
|
434109
434927
|
init_trace();
|
|
434110
|
-
init_session_rule_policy();
|
|
434111
|
-
init_hooks3();
|
|
434112
|
-
init_write_protect();
|
|
434113
|
-
init_permission_rule_org();
|
|
434114
|
-
init_cache_break_detector();
|
|
434115
434928
|
init_request_params();
|
|
434116
|
-
init_route_adjudicator();
|
|
434117
434929
|
init_timeout();
|
|
434118
|
-
init_tools3();
|
|
434119
|
-
init_tool_name_aliases();
|
|
434120
|
-
init_protocol_table();
|
|
434121
|
-
init_permission_rules();
|
|
434122
|
-
init_lsp_protocol();
|
|
434123
434930
|
init_tool_result_store();
|
|
434124
434931
|
init_synthetic_tools();
|
|
434125
434932
|
init_strict_output_schema();
|
|
434126
|
-
init_tool_disclosure();
|
|
434127
434933
|
init_tools4();
|
|
434128
|
-
init_types27();
|
|
434129
|
-
init_tools5();
|
|
434130
|
-
init_content_origin();
|
|
434131
|
-
init_delegation_provenance();
|
|
434132
|
-
init_delegation_settlement();
|
|
434133
|
-
init_memory4();
|
|
434134
|
-
init_compliance();
|
|
434135
434934
|
init_memory_admission();
|
|
434136
434935
|
init_prepare_memory();
|
|
434936
|
+
init_prepare_memory_engine_session();
|
|
434937
|
+
init_prepare_defer_classify();
|
|
434938
|
+
init_prepare_listings();
|
|
434939
|
+
init_prepare_prompt_inputs();
|
|
434940
|
+
init_prepare_project_context();
|
|
434941
|
+
init_prepare_policy_chain();
|
|
434942
|
+
init_prepare_context_lane();
|
|
434943
|
+
init_prepare_turn_wiring();
|
|
434944
|
+
init_prepare_context_lane();
|
|
434945
|
+
init_prepare_prompt_assembly();
|
|
434137
434946
|
init_prepare_config_doors();
|
|
434138
434947
|
init_prepare_safety_scan();
|
|
434139
434948
|
init_prepare_acquire_reconcile();
|
|
434140
434949
|
init_prepare_hands_readface();
|
|
434141
|
-
init_edited_files_ledger();
|
|
434142
434950
|
init_prepare_workspace_restore();
|
|
434143
|
-
|
|
434144
|
-
|
|
434145
|
-
|
|
434146
|
-
|
|
434147
|
-
|
|
434148
|
-
|
|
434149
|
-
|
|
434150
|
-
|
|
434951
|
+
init_park_commit();
|
|
434952
|
+
init_park_commit();
|
|
434953
|
+
init_prepare_offload_wrappers();
|
|
434954
|
+
init_prepare_file_history();
|
|
434955
|
+
init_prepare_execution_env();
|
|
434956
|
+
init_prepare_run_refs();
|
|
434957
|
+
init_prepare_inherited_gate();
|
|
434958
|
+
init_prepare_caps_and_workflow();
|
|
434959
|
+
init_prepare_delegation_surface();
|
|
434960
|
+
init_prepare_tool_disclosure_mount();
|
|
434961
|
+
init_prepare_wiring_manifest();
|
|
434962
|
+
init_prepare_ask_lane();
|
|
434963
|
+
init_prepare_suspend_saga();
|
|
434964
|
+
init_prepare_boundary_parks();
|
|
434965
|
+
init_prepare_park_ask();
|
|
434966
|
+
init_prepare_gate_stations();
|
|
434967
|
+
init_prepare_park_ask();
|
|
434968
|
+
init_prepare_suspend_saga();
|
|
434969
|
+
init_checkpoint_scope();
|
|
434970
|
+
init_checkpoint_scope();
|
|
434971
|
+
init_prepare_wiring_manifest();
|
|
434972
|
+
init_derived_route_fallback();
|
|
434973
|
+
init_prepare_protocol_tools();
|
|
434974
|
+
init_prepare_question_face();
|
|
434975
|
+
init_prepare_lsp();
|
|
434976
|
+
init_rollback_stack();
|
|
434977
|
+
init_prepare_tool_disclosure_mount();
|
|
434978
|
+
init_prepare_file_history();
|
|
434151
434979
|
init_context_edit();
|
|
434152
|
-
init_tool_result_budget();
|
|
434153
|
-
init_media_byte_cap();
|
|
434154
|
-
init_context_guard();
|
|
434155
|
-
init_stub_env();
|
|
434156
434980
|
init_remote_env();
|
|
434157
434981
|
init_teardown_bounded();
|
|
434158
|
-
init_background_shell();
|
|
434159
434982
|
init_task_registry();
|
|
434160
|
-
init_monitor();
|
|
434161
|
-
init_worktree();
|
|
434162
434983
|
init_peer_session_drain();
|
|
434163
|
-
init_cross_session_envelope();
|
|
434164
|
-
init_node_execution_env();
|
|
434165
|
-
init_fs();
|
|
434166
|
-
init_encoding();
|
|
434167
|
-
init_ask_question();
|
|
434168
434984
|
init_scheduler_tools();
|
|
434169
|
-
init_present_plan_tool();
|
|
434170
434985
|
init_workflow_script_runner();
|
|
434171
|
-
init_run_workflow_tool();
|
|
434172
|
-
init_workflow_size_guideline();
|
|
434173
|
-
init_lsp();
|
|
434174
|
-
init_safety();
|
|
434175
434986
|
init_checkpoint_store();
|
|
434176
|
-
init_canonical_json();
|
|
434177
|
-
init_wiring_manifest();
|
|
434178
434987
|
init_park_selfcheck();
|
|
434179
|
-
init_usage_window_store();
|
|
434180
434988
|
init_types21();
|
|
434181
|
-
init_file_history_store();
|
|
434182
434989
|
init_prepare_hands_readface();
|
|
434183
434990
|
init_checkpoint_store();
|
|
434184
434991
|
init_prepare_config_doors();
|
|
434185
|
-
|
|
434186
|
-
PROMPT_HASH_SALT = randomBytes25(16), DEFAULT_RESOURCE_TTL_MS = 720 * 60 * 60 * 1e3, USAGE_WINDOW_REAP_MARGIN_MS = 3600 * 1e3, DEFAULT_UNATTENDED_APPROVAL_TTL_MS = 720 * 60 * 60 * 1e3;
|
|
434992
|
+
init_workspace_path();
|
|
434187
434993
|
}
|
|
434188
434994
|
});
|
|
434189
434995
|
|
|
@@ -434290,6 +435096,7 @@ var init_runtask = __esm({
|
|
|
434290
435096
|
init_hooks3();
|
|
434291
435097
|
init_human_input_projection();
|
|
434292
435098
|
init_untrusted_text();
|
|
435099
|
+
init_announce_once_ledger();
|
|
434293
435100
|
init_session_reconcile();
|
|
434294
435101
|
init_tool_result_store();
|
|
434295
435102
|
init_lsp_diagnostics();
|
|
@@ -435079,6 +435886,15 @@ var WINDOWS_DEVICE_NAMES, STALE_JOURNAL_MS, init_file_history_store2 = __esm({
|
|
|
435079
435886
|
}
|
|
435080
435887
|
});
|
|
435081
435888
|
|
|
435889
|
+
// node_modules/@sema-agent/core/dist/core/permission-rule-provider.js
|
|
435890
|
+
var init_permission_rule_provider = __esm({
|
|
435891
|
+
"node_modules/@sema-agent/core/dist/core/permission-rule-provider.js"() {
|
|
435892
|
+
init_permission_rule_model();
|
|
435893
|
+
init_permission_rule_store();
|
|
435894
|
+
init_permission_rule_org();
|
|
435895
|
+
}
|
|
435896
|
+
});
|
|
435897
|
+
|
|
435082
435898
|
// node_modules/@sema-agent/core/dist/core/permission-rule-sync.js
|
|
435083
435899
|
var init_permission_rule_sync = __esm({
|
|
435084
435900
|
"node_modules/@sema-agent/core/dist/core/permission-rule-sync.js"() {
|
|
@@ -435089,9 +435905,16 @@ var init_permission_rule_sync = __esm({
|
|
|
435089
435905
|
});
|
|
435090
435906
|
|
|
435091
435907
|
// node_modules/@sema-agent/core/dist/stores/file/permission-rule-store.js
|
|
435092
|
-
import { closeSync as closeSync14, constants as FS2, existsSync as existsSync29, fsyncSync as fsyncSync11, lstatSync as lstatSync5, mkdirSync as mkdirSync24, openSync as openSync15, readFileSync as readFileSync42, renameSync as renameSync16, unlinkSync as unlinkSync15, writeFileSync as writeFileSync22 } from "node:fs";
|
|
435908
|
+
import { closeSync as closeSync14, constants as FS2, existsSync as existsSync29, fsyncSync as fsyncSync11, lstatSync as lstatSync5, mkdirSync as mkdirSync24, openSync as openSync15, readFileSync as readFileSync42, readdirSync as readdirSync13, renameSync as renameSync16, unlinkSync as unlinkSync15, writeFileSync as writeFileSync22 } from "node:fs";
|
|
435093
435909
|
import { join as join157 } from "node:path";
|
|
435094
|
-
import { createHash as
|
|
435910
|
+
import { createHash as createHash27, randomBytes as randomBytes26 } from "node:crypto";
|
|
435911
|
+
function isRuleFile(v2) {
|
|
435912
|
+
let p = v2;
|
|
435913
|
+
return typeof p == "object" && p !== null && p.schemaVersion === 3 && Array.isArray(p.rules) && Array.isArray(p.tombstones) && typeof p.rev == "number" && (p.quarantined === void 0 || Array.isArray(p.quarantined));
|
|
435914
|
+
}
|
|
435915
|
+
function schemaVersionWord(v2) {
|
|
435916
|
+
return typeof v2 == "object" && v2 !== null ? v2.schemaVersion : void 0;
|
|
435917
|
+
}
|
|
435095
435918
|
function atomicPublish(dir, file2, payload2) {
|
|
435096
435919
|
let tmp = join157(dir, `.${randomBytes26(8).toString("hex")}.tmp`), fd2;
|
|
435097
435920
|
try {
|
|
@@ -435117,7 +435940,7 @@ function atomicPublish(dir, file2, payload2) {
|
|
|
435117
435940
|
}
|
|
435118
435941
|
}
|
|
435119
435942
|
function checksumOf(body) {
|
|
435120
|
-
return `sha256:${
|
|
435943
|
+
return `sha256:${createHash27("sha256").update(canonicalize3(body), "utf8").digest("hex")}`;
|
|
435121
435944
|
}
|
|
435122
435945
|
function assertSafeDir(dir) {
|
|
435123
435946
|
mkdirSync24(dir, { recursive: !0, mode: 448 });
|
|
@@ -435129,14 +435952,14 @@ function assertSafeDir(dir) {
|
|
|
435129
435952
|
if ((st2.mode & 18) !== 0)
|
|
435130
435953
|
throw new Error(`permission-rule store directory ${dir} is writable by group or others (mode ${(st2.mode & 511).toString(8)}); refusing to use it \u2014 anyone who can write here can grant themselves permissions`);
|
|
435131
435954
|
}
|
|
435132
|
-
var EMPTY_READ,
|
|
435955
|
+
var EMPTY_READ, FileDurableRulePartition, init_permission_rule_store2 = __esm({
|
|
435133
435956
|
"node_modules/@sema-agent/core/dist/stores/file/permission-rule-store.js"() {
|
|
435134
435957
|
init_permission_rule_store();
|
|
435135
435958
|
init_canonical_json();
|
|
435136
435959
|
init_fs_atomic();
|
|
435137
435960
|
init_marker();
|
|
435138
435961
|
EMPTY_READ = { rules: [], tombstones: [], rev: 0 };
|
|
435139
|
-
|
|
435962
|
+
FileDurableRulePartition = class {
|
|
435140
435963
|
dir;
|
|
435141
435964
|
file;
|
|
435142
435965
|
acquireWriteLock;
|
|
@@ -435170,8 +435993,8 @@ var EMPTY_READ, FilePermissionRuleStore, init_permission_rule_store2 = __esm({
|
|
|
435170
435993
|
let why = `${this.file} is not valid JSON (${err8.message}); refusing the whole file and loading zero rules`;
|
|
435171
435994
|
return this.disclose(why), { unreadable: why };
|
|
435172
435995
|
}
|
|
435173
|
-
if (
|
|
435174
|
-
let why = `${this.file} does not carry a readable rule-file shape; refusing the whole file and loading zero rules`;
|
|
435996
|
+
if (!isRuleFile(parsed)) {
|
|
435997
|
+
let sv = schemaVersionWord(parsed), why = sv === 1 || sv === 2 ? `${this.file} is a schema ${String(sv)} bucket that was not migrated to schema 3 (written by an older engine after this directory was migrated?); refusing the whole file and loading zero rules` : `${this.file} does not carry a readable rule-file shape; refusing the whole file and loading zero rules`;
|
|
435175
435998
|
return this.disclose(why), { unreadable: why };
|
|
435176
435999
|
}
|
|
435177
436000
|
let { checksum, ...body } = parsed;
|
|
@@ -435196,6 +436019,8 @@ var EMPTY_READ, FilePermissionRuleStore, init_permission_rule_store2 = __esm({
|
|
|
435196
436019
|
}
|
|
435197
436020
|
async list() {
|
|
435198
436021
|
let r = this.read();
|
|
436022
|
+
if ("unreadable" in r)
|
|
436023
|
+
throw new Error(r.unreadable);
|
|
435199
436024
|
if (!("file" in r))
|
|
435200
436025
|
return { ...EMPTY_READ };
|
|
435201
436026
|
let screened = this.screenDurableRows(r.file);
|
|
@@ -435210,26 +436035,11 @@ var EMPTY_READ, FilePermissionRuleStore, init_permission_rule_store2 = __esm({
|
|
|
435210
436035
|
let r = this.read();
|
|
435211
436036
|
return "file" in r ? this.screenDurableRows(r.file).quarantined : [];
|
|
435212
436037
|
}
|
|
435213
|
-
async readOrgState() {
|
|
435214
|
-
let r = this.read();
|
|
435215
|
-
return "file" in r ? r.file.org : void 0;
|
|
435216
|
-
}
|
|
435217
|
-
async installOrgState(state5) {
|
|
435218
|
-
this.acquireWriteLock(), await this.serialize(() => {
|
|
435219
|
-
let cur = this.current();
|
|
435220
|
-
if (cur.org !== void 0 && state5.revisionHighWater < cur.org.revisionHighWater)
|
|
435221
|
-
throw new Error(`refusing to lower the org revision high-water mark (${cur.org.revisionHighWater} \u2192 ${state5.revisionHighWater}) \u2014 an interleaved install must re-read and re-compare`);
|
|
435222
|
-
if (cur.org !== void 0 && state5.snapshot.revision === cur.org.snapshot.revision && canonicalize3(state5.snapshot.rules) !== canonicalize3(cur.org.snapshot.rules))
|
|
435223
|
-
throw new Error(`refusing to replace org revision ${state5.snapshot.revision} with DIFFERENT policy content under the same revision \u2014 content changes must bump the revision`);
|
|
435224
|
-
if (!this.writeAndVerify({ ...cur, schemaVersion: 2, org: state5 }))
|
|
435225
|
-
throw new Error("the permission-rule store did not survive its own write; the org snapshot was not installed");
|
|
435226
|
-
});
|
|
435227
|
-
}
|
|
435228
436038
|
current() {
|
|
435229
436039
|
let r = this.read();
|
|
435230
436040
|
if ("unreadable" in r)
|
|
435231
436041
|
throw new Error(`refusing to write the permission-rule store while it cannot be read: ${r.unreadable}`);
|
|
435232
|
-
return "absent" in r ? { schemaVersion:
|
|
436042
|
+
return "absent" in r ? { schemaVersion: 3, actor: `file-${randomBytes26(6).toString("hex")}`, counter: 0, rev: 0, rules: [], tombstones: [] } : {
|
|
435233
436043
|
schemaVersion: r.file.schemaVersion,
|
|
435234
436044
|
actor: r.file.actor,
|
|
435235
436045
|
counter: r.file.counter,
|
|
@@ -435237,7 +436047,6 @@ var EMPTY_READ, FilePermissionRuleStore, init_permission_rule_store2 = __esm({
|
|
|
435237
436047
|
rules: r.file.rules,
|
|
435238
436048
|
tombstones: r.file.tombstones,
|
|
435239
436049
|
...r.file.sync !== void 0 ? { sync: r.file.sync } : {},
|
|
435240
|
-
...r.file.org !== void 0 ? { org: r.file.org } : {},
|
|
435241
436050
|
...r.file.quarantined !== void 0 ? { quarantined: r.file.quarantined } : {}
|
|
435242
436051
|
};
|
|
435243
436052
|
}
|
|
@@ -435291,7 +436100,6 @@ var EMPTY_READ, FilePermissionRuleStore, init_permission_rule_store2 = __esm({
|
|
|
435291
436100
|
...cur.sync?.observedVector !== void 0 ? { observedVector: cur.sync.observedVector } : {}
|
|
435292
436101
|
}, delta, Date.now()), landed = {
|
|
435293
436102
|
...cur,
|
|
435294
|
-
schemaVersion: 2,
|
|
435295
436103
|
rev: cur.rev + 1,
|
|
435296
436104
|
rules: next2.rules,
|
|
435297
436105
|
tombstones: next2.tombstones,
|
|
@@ -435319,6 +436127,7 @@ var EMPTY_READ, FilePermissionRuleStore, init_permission_rule_store2 = __esm({
|
|
|
435319
436127
|
var init_permission_rule_adopt = __esm({
|
|
435320
436128
|
"node_modules/@sema-agent/core/dist/stores/file/permission-rule-adopt.js"() {
|
|
435321
436129
|
init_permission_rule_store();
|
|
436130
|
+
init_permission_rule_provider();
|
|
435322
436131
|
init_permission_rule_sync();
|
|
435323
436132
|
init_permission_rule_store2();
|
|
435324
436133
|
}
|
|
@@ -435369,15 +436178,6 @@ var init_file2 = __esm({
|
|
|
435369
436178
|
}
|
|
435370
436179
|
});
|
|
435371
436180
|
|
|
435372
|
-
// node_modules/@sema-agent/core/dist/core/sensitive-path-policy.js
|
|
435373
|
-
var CASE_INSENSITIVE_FS3, init_sensitive_path_policy = __esm({
|
|
435374
|
-
"node_modules/@sema-agent/core/dist/core/sensitive-path-policy.js"() {
|
|
435375
|
-
init_safety();
|
|
435376
|
-
init_read_deny();
|
|
435377
|
-
CASE_INSENSITIVE_FS3 = process.platform === "darwin" || process.platform === "win32";
|
|
435378
|
-
}
|
|
435379
|
-
});
|
|
435380
|
-
|
|
435381
436181
|
// node_modules/@sema-agent/core/dist/core/fs-write-gate-policy.js
|
|
435382
436182
|
var init_fs_write_gate_policy = __esm({
|
|
435383
436183
|
"node_modules/@sema-agent/core/dist/core/fs-write-gate-policy.js"() {
|
|
@@ -435576,6 +436376,7 @@ function precheckEditedRuleText2(text2, command8) {
|
|
|
435576
436376
|
var init_permission_rule_consent = __esm({
|
|
435577
436377
|
"node_modules/@sema-agent/core/dist/core/permission-rule-consent.js"() {
|
|
435578
436378
|
init_permission_rule_model();
|
|
436379
|
+
init_permission_rule_provider();
|
|
435579
436380
|
init_permission_rule_store();
|
|
435580
436381
|
}
|
|
435581
436382
|
});
|
|
@@ -435739,7 +436540,7 @@ var init_sync_client = __esm({
|
|
|
435739
436540
|
var init_memory_engine = __esm({
|
|
435740
436541
|
"node_modules/@sema-agent/core/dist/core/memory-engine/index.js"() {
|
|
435741
436542
|
init_engine5();
|
|
435742
|
-
|
|
436543
|
+
init_tools4();
|
|
435743
436544
|
init_provenance_wording();
|
|
435744
436545
|
init_scan();
|
|
435745
436546
|
init_file_backend();
|
|
@@ -436232,6 +437033,7 @@ var init_dist10 = __esm({
|
|
|
436232
437033
|
init_cascade();
|
|
436233
437034
|
init_sql_adapters();
|
|
436234
437035
|
init_mcp4();
|
|
437036
|
+
init_mcp4();
|
|
436235
437037
|
init_a2a();
|
|
436236
437038
|
init_protocol_table();
|
|
436237
437039
|
init_session_policy_store();
|
|
@@ -436314,6 +437116,8 @@ var init_dist10 = __esm({
|
|
|
436314
437116
|
init_loop_tick();
|
|
436315
437117
|
init_tighten_task_spec();
|
|
436316
437118
|
init_tool_policy();
|
|
437119
|
+
init_ask_origin();
|
|
437120
|
+
init_hooks3();
|
|
436317
437121
|
init_auto_mode();
|
|
436318
437122
|
init_auto_mode_defaults();
|
|
436319
437123
|
init_auto_mode_prompt();
|
|
@@ -436324,6 +437128,7 @@ var init_dist10 = __esm({
|
|
|
436324
437128
|
init_permission_rule_model();
|
|
436325
437129
|
init_permission_rule_store();
|
|
436326
437130
|
init_permission_rule_sync();
|
|
437131
|
+
init_permission_rule_provider();
|
|
436327
437132
|
init_permission_rule_session();
|
|
436328
437133
|
init_permission_rule_org();
|
|
436329
437134
|
init_governance_codes();
|
|
@@ -458236,7 +459041,7 @@ var init_config7 = __esm({
|
|
|
458236
459041
|
});
|
|
458237
459042
|
|
|
458238
459043
|
// build-src/src/utils/api.ts
|
|
458239
|
-
import { createHash as
|
|
459044
|
+
import { createHash as createHash28 } from "crypto";
|
|
458240
459045
|
function filterSwarmFieldsFromSchema(toolName2, schema) {
|
|
458241
459046
|
let fieldsToRemove = SWARM_FIELDS_BY_TOOL[toolName2];
|
|
458242
459047
|
if (!fieldsToRemove || fieldsToRemove.length === 0)
|
|
@@ -458299,7 +459104,7 @@ function logAPIPrefix(systemPrompt) {
|
|
|
458299
459104
|
firstSystemPrompt?.slice(
|
|
458300
459105
|
0,
|
|
458301
459106
|
20
|
|
458302
|
-
), firstSystemPrompt?.length, firstSystemPrompt &&
|
|
459107
|
+
), firstSystemPrompt?.length, firstSystemPrompt && createHash28("sha256").update(firstSystemPrompt).digest("hex");
|
|
458303
459108
|
}
|
|
458304
459109
|
function splitSysPromptPrefix(systemPrompt, options) {
|
|
458305
459110
|
let useGlobalCacheFeature = shouldUseGlobalCacheScope();
|
|
@@ -466186,12 +466991,15 @@ var CORE_ENGINE_NOTICE_CODES, PENDING_ENGINE_NOTICE_CODES, SURFACEABLE_ENGINE_NO
|
|
|
466186
466991
|
var wiringManifestStore_exports = {};
|
|
466187
466992
|
__export(wiringManifestStore_exports, {
|
|
466188
466993
|
autoModeDoctorDetail: () => autoModeDoctorDetail,
|
|
466994
|
+
forgetWiringManifestReading: () => forgetWiringManifestReading,
|
|
466189
466995
|
modelGateRemovedLine: () => modelGateRemovedLine,
|
|
466190
466996
|
noteWiringManifestReading: () => noteWiringManifestReading,
|
|
466191
466997
|
observedAutoMode: () => observedAutoMode,
|
|
466192
466998
|
observedModelGate: () => observedModelGate,
|
|
466999
|
+
observedWiringMcp: () => observedWiringMcp,
|
|
466193
467000
|
resetWiringManifestReadingForTest: () => resetWiringManifestReadingForTest,
|
|
466194
|
-
wiringManifestChromeView: () => wiringManifestChromeView
|
|
467001
|
+
wiringManifestChromeView: () => wiringManifestChromeView,
|
|
467002
|
+
wiringMcpDoctorDetail: () => wiringMcpDoctorDetail
|
|
466195
467003
|
});
|
|
466196
467004
|
function wiringManifestChromeView(e) {
|
|
466197
467005
|
if (typeof e != "object" || e === null) return null;
|
|
@@ -466210,23 +467018,50 @@ function wiringManifestChromeView(e) {
|
|
|
466210
467018
|
} catch {
|
|
466211
467019
|
return;
|
|
466212
467020
|
}
|
|
466213
|
-
}, gateClass = readFrom(gate, "class"), gateRestore = readFrom(gate, "restore"), removedRaw = readFrom(gate, "removed"), autoArmed = readFrom(auto, "armed"), autoReason = readFrom(auto, "reason"), modelGate = typeof gateClass == "string" && typeof gateRestore == "string" && Array.isArray(removedRaw) && removedRaw.every((t2) => typeof t2 == "string") ? { class: gateClass, removed: [...removedRaw], restore: gateRestore } : void 0, autoMode = typeof autoArmed == "boolean" && typeof autoReason == "string" ? { armed: autoArmed, reason: autoReason } : void 0;
|
|
467021
|
+
}, gateClass = readFrom(gate, "class"), gateRestore = readFrom(gate, "restore"), removedRaw = readFrom(gate, "removed"), autoArmed = readFrom(auto, "armed"), autoReason = readFrom(auto, "reason"), modelGate = typeof gateClass == "string" && typeof gateRestore == "string" && Array.isArray(removedRaw) && removedRaw.every((t2) => typeof t2 == "string") ? { class: gateClass, removed: [...removedRaw], restore: gateRestore } : void 0, autoMode = typeof autoArmed == "boolean" && typeof autoReason == "string" ? { armed: autoArmed, reason: autoReason } : void 0, mcpRaw = read("mcp"), mcp2;
|
|
467022
|
+
if (Array.isArray(mcpRaw)) {
|
|
467023
|
+
let rows2 = [];
|
|
467024
|
+
for (let raw2 of mcpRaw) {
|
|
467025
|
+
if (typeof raw2 != "object" || raw2 === null || Array.isArray(raw2)) continue;
|
|
467026
|
+
let r = raw2, name = readFrom(r, "name"), status3 = readFrom(r, "status");
|
|
467027
|
+
if (typeof name != "string" || name === "" || typeof status3 != "string" || status3 === "") continue;
|
|
467028
|
+
let source = readFrom(r, "source"), errorCode = readFrom(r, "errorCode"), toolCount = readFrom(r, "toolCount");
|
|
467029
|
+
rows2.push({
|
|
467030
|
+
name,
|
|
467031
|
+
// 🔴 `status` / `errorCode` 一律**开集**读(词的属主是 core):认不得的词照渲不丢行;
|
|
467032
|
+
// 抄一份闭集表会在 core 加员那天把一个合法值连同它那一行一起吞掉。
|
|
467033
|
+
status: status3,
|
|
467034
|
+
...typeof source == "string" && source !== "" ? { source } : {},
|
|
467035
|
+
...typeof errorCode == "string" && errorCode !== "" ? { errorCode } : {},
|
|
467036
|
+
// 🔴 `toolCount: 0` 是**读数**(连上了、零工具),不是缺席 ⇒ 有限数就收,别用 falsy 判。
|
|
467037
|
+
...typeof toolCount == "number" && Number.isFinite(toolCount) ? { toolCount } : {}
|
|
467038
|
+
});
|
|
467039
|
+
}
|
|
467040
|
+
(mcpRaw.length === 0 || rows2.length > 0) && (mcp2 = rows2);
|
|
467041
|
+
}
|
|
466214
467042
|
return {
|
|
466215
467043
|
...modelGate !== void 0 ? { modelGate } : {},
|
|
466216
|
-
...autoMode !== void 0 ? { autoMode } : {}
|
|
467044
|
+
...autoMode !== void 0 ? { autoMode } : {},
|
|
467045
|
+
...mcp2 !== void 0 ? { mcp: mcp2 } : {}
|
|
466217
467046
|
};
|
|
466218
467047
|
}
|
|
466219
467048
|
function noteWiringManifestReading(reading) {
|
|
466220
|
-
reading.autoMode !== void 0 && (lastAutoMode = reading.autoMode), reading.modelGate !== void 0 && (lastModelGate = reading.modelGate);
|
|
467049
|
+
reading.autoMode !== void 0 && (lastAutoMode = reading.autoMode), reading.modelGate !== void 0 && (lastModelGate = reading.modelGate), reading.mcp !== void 0 && (lastMcp = reading.mcp);
|
|
466221
467050
|
}
|
|
466222
467051
|
function observedAutoMode() {
|
|
466223
467052
|
return lastAutoMode;
|
|
466224
467053
|
}
|
|
467054
|
+
function observedWiringMcp() {
|
|
467055
|
+
return lastMcp;
|
|
467056
|
+
}
|
|
466225
467057
|
function observedModelGate() {
|
|
466226
467058
|
return lastModelGate;
|
|
466227
467059
|
}
|
|
467060
|
+
function forgetWiringManifestReading() {
|
|
467061
|
+
lastMcp = null, lastAutoMode = null, lastModelGate = null;
|
|
467062
|
+
}
|
|
466228
467063
|
function resetWiringManifestReadingForTest() {
|
|
466229
|
-
lastAutoMode = null, lastModelGate = null;
|
|
467064
|
+
lastMcp = null, lastAutoMode = null, lastModelGate = null;
|
|
466230
467065
|
}
|
|
466231
467066
|
function modelGateRemovedLine(gate) {
|
|
466232
467067
|
return `Model gate removed ${gate.class}: ${gate.removed.join(", ")} \u2014 restore: ${gate.restore}`;
|
|
@@ -466234,15 +467069,21 @@ function modelGateRemovedLine(gate) {
|
|
|
466234
467069
|
function autoModeDoctorDetail(reading) {
|
|
466235
467070
|
return reading === null ? {
|
|
466236
467071
|
status: "info",
|
|
466237
|
-
detail: "not observed \u2014 the engine reports it per run leg; this
|
|
467072
|
+
detail: "not observed \u2014 the engine reports it per run leg; this process has not seen a wiring-manifest frame yet (nothing has run in it, or the engine is older than 7.58.0)"
|
|
466238
467073
|
} : {
|
|
466239
467074
|
status: reading.armed ? "ok" : "info",
|
|
466240
467075
|
detail: `${reading.armed ? "armed" : "not armed"} \xB7 engine reason: ${reading.reason}`
|
|
466241
467076
|
};
|
|
466242
467077
|
}
|
|
466243
|
-
|
|
467078
|
+
function wiringMcpDoctorDetail(rows2, clean9) {
|
|
467079
|
+
return rows2 === null ? "not observed - the engine reports declared MCP servers on the wiring manifest; this process has not seen such a frame yet (nothing has run in it, or the engine is older than 7.60.0)" : rows2.length === 0 ? "this engine leg declared no MCP servers" : rows2.map((r) => {
|
|
467080
|
+
let parts = [`${clean9(r.name, 40)}: ${clean9(r.status, 24)}`];
|
|
467081
|
+
return r.errorCode !== void 0 && parts.push(`code ${clean9(r.errorCode, 40)}`), typeof r.toolCount == "number" && Number.isFinite(r.toolCount) && parts.push(`${r.toolCount} tools`), parts.push(r.source !== void 0 ? `source ${clean9(r.source, 40)}` : "source not declared"), parts.join(" - ");
|
|
467082
|
+
}).join(" | ");
|
|
467083
|
+
}
|
|
467084
|
+
var lastAutoMode, lastMcp, lastModelGate, init_wiringManifestStore = __esm({
|
|
466244
467085
|
"build-src/src/sema/wiringManifestStore.ts"() {
|
|
466245
|
-
lastAutoMode = null, lastModelGate = null;
|
|
467086
|
+
lastAutoMode = null, lastMcp = null, lastModelGate = null;
|
|
466246
467087
|
}
|
|
466247
467088
|
});
|
|
466248
467089
|
|
|
@@ -466343,7 +467184,7 @@ __export(upstreamBridge_exports, {
|
|
|
466343
467184
|
seedEngineTaskNotificationDedupFromTranscript: () => seedEngineTaskNotificationDedupFromTranscript,
|
|
466344
467185
|
timeoutWindowExpiredCallIdOf: () => timeoutWindowExpiredCallIdOf
|
|
466345
467186
|
});
|
|
466346
|
-
import { createHash as
|
|
467187
|
+
import { createHash as createHash29 } from "node:crypto";
|
|
466347
467188
|
function appendBridgeProbe(envName, line) {
|
|
466348
467189
|
let path28 = envName !== void 0 ? process.env[envName] : void 0;
|
|
466349
467190
|
if (path28)
|
|
@@ -466463,7 +467304,7 @@ function timeoutWindowExpiredCallIdOf(frame) {
|
|
|
466463
467304
|
return id.length <= MAX_COLLATERAL_ABORT_ID_CHARS ? id : void 0;
|
|
466464
467305
|
}
|
|
466465
467306
|
function identityDigest(v2) {
|
|
466466
|
-
return
|
|
467307
|
+
return createHash29("sha256").update(Buffer.from(v2, "utf16le")).digest("hex").slice(0, 32);
|
|
466467
467308
|
}
|
|
466468
467309
|
function wireIdentity(raw2) {
|
|
466469
467310
|
return typeof raw2 != "string" || raw2.length === 0 ? "" : raw2.length <= IDENTITY_INLINE_MAX ? `${String(raw2.length)}:${raw2}` : `${String(raw2.length)}:${raw2.slice(0, 64)}#${identityDigest(raw2)}`;
|
|
@@ -468444,6 +469285,74 @@ var clean7, BENIGN_ABSENCE_WORDS, init_ruleEvidenceNote = __esm({
|
|
|
468444
469285
|
}
|
|
468445
469286
|
});
|
|
468446
469287
|
|
|
469288
|
+
// build-src/src/sema/askFrameNotes.ts
|
|
469289
|
+
function readDenialLimitFallback3(v2) {
|
|
469290
|
+
if (typeof v2 != "object" || v2 === null) return;
|
|
469291
|
+
let r = v2, num = (n2) => typeof n2 == "number" && Number.isFinite(n2) && n2 >= 0;
|
|
469292
|
+
if (!(!num(r.consecutive) || !num(r.total) || !num(r.autoDenyAfterMs)) && !(typeof r.limit != "string" || r.limit === ""))
|
|
469293
|
+
return {
|
|
469294
|
+
consecutive: r.consecutive,
|
|
469295
|
+
total: r.total,
|
|
469296
|
+
limit: r.limit,
|
|
469297
|
+
autoDenyAfterMs: r.autoDenyAfterMs
|
|
469298
|
+
};
|
|
469299
|
+
}
|
|
469300
|
+
function denialLimitFallbackNote(v2) {
|
|
469301
|
+
if (v2 == null || typeof v2 != "object") return;
|
|
469302
|
+
let parts = ["auto-deny limit reached \u2014 this one needs a real human decision"], num = (n2) => typeof n2 == "number" && Number.isFinite(n2) && n2 >= 0 ? n2 : void 0, consecutive = num(v2.consecutive), total = num(v2.total);
|
|
469303
|
+
consecutive !== void 0 && total !== void 0 && parts.push(`${consecutive} consecutive / ${total} total denials so far`);
|
|
469304
|
+
let limit2 = typeof v2.limit == "string" && v2.limit !== "" ? v2.limit : void 0;
|
|
469305
|
+
limit2 !== void 0 && parts.push(`the limit that tripped: ${cleanUntrustedForDisplay(limit2, 24)}`);
|
|
469306
|
+
let windowMs = num(v2.autoDenyAfterMs);
|
|
469307
|
+
return windowMs !== void 0 && windowMs > 0 && parts.push(`the engine auto-denies it in ${Math.round(windowMs / 1e3)}s if nobody answers`), parts.join("; ");
|
|
469308
|
+
}
|
|
469309
|
+
function askOriginNote(origin2) {
|
|
469310
|
+
if (!(typeof origin2 != "string" || origin2 === ""))
|
|
469311
|
+
switch (origin2) {
|
|
469312
|
+
case "content_question":
|
|
469313
|
+
case "unresolvable":
|
|
469314
|
+
case "ask_rule":
|
|
469315
|
+
case "policy":
|
|
469316
|
+
return;
|
|
469317
|
+
case "org_unavailable":
|
|
469318
|
+
return "asked because the org rule store could not be reached";
|
|
469319
|
+
case "org_rule":
|
|
469320
|
+
return "asked by an org rule";
|
|
469321
|
+
case "hook":
|
|
469322
|
+
return "asked by a hook";
|
|
469323
|
+
case "denial_limit_fallback":
|
|
469324
|
+
return "asked because the auto-deny limit was reached";
|
|
469325
|
+
default:
|
|
469326
|
+
return `asked by an origin this build does not know yet (${cleanUntrustedForDisplay(origin2, 40)})`;
|
|
469327
|
+
}
|
|
469328
|
+
}
|
|
469329
|
+
function ruleOffersAbsenceNote(reason) {
|
|
469330
|
+
if (!(typeof reason != "string" || reason === ""))
|
|
469331
|
+
switch (reason) {
|
|
469332
|
+
case "mandated":
|
|
469333
|
+
return `no "don't ask again" option here: this gate is mandated, so a rule could not switch it off`;
|
|
469334
|
+
case "shadowed":
|
|
469335
|
+
return `no "don't ask again" option here: a higher-priority rule already covers this call`;
|
|
469336
|
+
case "lane_cannot_speak":
|
|
469337
|
+
return `no "don't ask again" option here: this approval lane cannot persist rules`;
|
|
469338
|
+
default:
|
|
469339
|
+
return `no "don't ask again" option here (reason this build does not know yet: ${cleanUntrustedForDisplay(reason, 40)})`;
|
|
469340
|
+
}
|
|
469341
|
+
}
|
|
469342
|
+
function askFrameNoteParts(req) {
|
|
469343
|
+
let denial = denialLimitFallbackNote(req.denialLimitFallback), origin2 = askOriginNote(req.origin), absence = ruleOffersAbsenceNote(req.ruleOffersAbsence);
|
|
469344
|
+
return [
|
|
469345
|
+
...denial !== void 0 ? [denial] : [],
|
|
469346
|
+
...origin2 !== void 0 ? [origin2] : [],
|
|
469347
|
+
...absence !== void 0 ? [absence] : []
|
|
469348
|
+
];
|
|
469349
|
+
}
|
|
469350
|
+
var init_askFrameNotes = __esm({
|
|
469351
|
+
"build-src/src/sema/askFrameNotes.ts"() {
|
|
469352
|
+
init_untrustedDisplayText();
|
|
469353
|
+
}
|
|
469354
|
+
});
|
|
469355
|
+
|
|
468447
469356
|
// build-src/src/sema/turnGateJournal.ts
|
|
468448
469357
|
function journalGatePresented(gateKind2, callId, engineTaskId) {
|
|
468449
469358
|
try {
|
|
@@ -468680,6 +469589,12 @@ function composeCardWireNote(req) {
|
|
|
468680
469589
|
...bidiNote !== void 0 ? [bidiNote] : [],
|
|
468681
469590
|
...req.governanceForced === !0 ? ["Required by deployment governance \u2014 permission-mode overrides do not apply"] : [],
|
|
468682
469591
|
...req.wireNote !== void 0 ? [req.wireNote] : [],
|
|
469592
|
+
// ── §23a 三位(L-107④):限额回落 · ask 出身 · 「不再询问」缺席原因 ─────────────────────
|
|
469593
|
+
// 🔴 排在 probeCause / ruleEvidence **之前**:这三句答的是「这只门为什么在这儿、为什么必须
|
|
469594
|
+
// 你来批」,而那两句答的是「引擎凭什么这么判」—— 先因后据。缺席零占位 ⇒ 老引擎上卡形与
|
|
469595
|
+
// 修前逐字节相同(additive 不回削)。
|
|
469596
|
+
// 🔴 三位的窄读与措辞全在 askFrameNotes(单源);本处只负责把它们放进这条 dim 行。
|
|
469597
|
+
...askFrameNoteParts(req),
|
|
468683
469598
|
...probeCause !== void 0 ? [probeCauseNoteText(probeCause)] : [],
|
|
468684
469599
|
...ruleEvidenceNote !== void 0 ? [ruleEvidenceNote] : []
|
|
468685
469600
|
];
|
|
@@ -468728,8 +469643,8 @@ function shellApprovalCardPort(req) {
|
|
|
468728
469643
|
}
|
|
468729
469644
|
let tool = lookup.kind === "tool" ? lookup.tool : genericGateTool(req.toolName), { callKey, signal } = req, askDeadlineMs = readAskDeadlineMs(req) ?? readParkRowDeadline(req.callKey);
|
|
468730
469645
|
return new Promise((resolve58) => {
|
|
468731
|
-
let selectedPersistRule, selectedPersistRuleBatchOfferIndex, selectedPersistRuleEdited, windowClosedAtMs, lateApproveConfirmedOnce = !1, lateApproveConfirmShown = !1, stagedPermissionUpdates = [], lateDecideWatchdogTimer, settled = !1, settle3 = (o) => {
|
|
468732
|
-
settled || (settled = !0, signal?.removeEventListener("abort", onAbortSignal), askWindowTimer !== void 0 && clearTimeout(askWindowTimer), askBackstopTimer !== void 0 && clearTimeout(askBackstopTimer), lateDecideWatchdogTimer !== void 0 && clearTimeout(lateDecideWatchdogTimer), liveApprovalCards.delete(callKey), journalGateResolved(callKey), resolve58(o));
|
|
469646
|
+
let selectedPersistRule, selectedPersistRuleBatchOfferIndex, selectedPersistRuleEdited, windowClosedAtMs, lateApproveConfirmedOnce = !1, lateApproveConfirmShown = !1, stagedPermissionUpdates = [], lateDecideWatchdogTimer, settled = !1, saidWindowClosed = !1, bornEpoch = getLiveSessionEpoch(), settle3 = (o) => {
|
|
469647
|
+
settled || (settled = !0, signal?.removeEventListener("abort", onAbortSignal), askWindowTimer !== void 0 && clearTimeout(askWindowTimer), askBackstopTimer !== void 0 && clearTimeout(askBackstopTimer), lateDecideWatchdogTimer !== void 0 && clearTimeout(lateDecideWatchdogTimer), liveApprovalCards.delete(callKey), forgetApprovalCardToolCallId(req.toolCallId, callKey, bornEpoch, saidWindowClosed ? req.toolName : void 0), journalGateResolved(callKey), resolve58(o));
|
|
468733
469648
|
}, removeFromQueue = () => {
|
|
468734
469649
|
try {
|
|
468735
469650
|
setQueue((queue3) => queue3.filter((item) => item.toolUseID !== callKey));
|
|
@@ -468821,9 +469736,9 @@ function shellApprovalCardPort(req) {
|
|
|
468821
469736
|
retractApprovalCard(callKey, "unanswered-after-window");
|
|
468822
469737
|
}, unansweredBackstopMs(backstopWindowMs)));
|
|
468823
469738
|
}, windowClosedEvidence = null, windowClosed = (evidence) => {
|
|
468824
|
-
if (settled || windowClosedEvidence
|
|
468825
|
-
windowClosedEvidence = evidence, logForDebugging(`liveToolApprovalWire: window closed for "${req.toolName}" callKey=${callKey} evidence=${evidence}`), askWindowTimer !== void 0 && (clearTimeout(askWindowTimer), askWindowTimer = void 0), windowClosedAtMs === void 0 && (windowClosedAtMs = Date.now()), markApprovalCardWindowClosed(callKey);
|
|
468826
|
-
let row2 = evidence === "parked-frame" ? approvalMovedToDurableQueueRow(req.toolName) : approvalWindowClosedRow(req.toolName);
|
|
469739
|
+
if (settled || windowClosedEvidence !== null && windowClosedEvidence !== "timer" || windowClosedEvidence === "timer" && evidence === "timer") return !1;
|
|
469740
|
+
windowClosedEvidence = evidence, logForDebugging(`liveToolApprovalWire: window closed for "${req.toolName}" callKey=${callKey} evidence=${evidence}`), askWindowTimer !== void 0 && (clearTimeout(askWindowTimer), askWindowTimer = void 0), windowClosedAtMs === void 0 && (windowClosedAtMs = Date.now()), markApprovalCardWindowClosed(callKey), saidWindowClosed = !0;
|
|
469741
|
+
let row2 = evidence === "parked-frame" ? approvalMovedToDurableQueueRow(req.toolName) : evidence === "auto-denied" ? approvalAutoDeniedRow(req.toolName) : approvalWindowClosedRow(req.toolName);
|
|
468827
469742
|
return surfaceLateDecideOutcome(row2) || logForDebugging("liveToolApprovalWire: the window-closed status row had nowhere to go \u2014 the user was NOT told"), armBackstopOnce(), !0;
|
|
468828
469743
|
};
|
|
468829
469744
|
if (signal?.aborted) {
|
|
@@ -469029,7 +469944,7 @@ function shellApprovalCardPort(req) {
|
|
|
469029
469944
|
askBackstopTimer !== void 0 && (clearTimeout(askBackstopTimer), askBackstopTimer = void 0), armBackstopOnce(), surfaceLateDecideOutcome(row2) || logForDebugging("liveToolApprovalWire: the late-approve confirmation banner had nowhere to go");
|
|
469030
469945
|
};
|
|
469031
469946
|
try {
|
|
469032
|
-
if (setQueue((queue3) => [...queue3, confirm2]), logEngineGateFallbackToAsk(req.toolName, syncVerdict), liveApprovalCards.set(callKey, { retract: retractCard, windowClosed }), askDeadlineMs !== void 0 && !isParkRowCard(callKey)) {
|
|
469947
|
+
if (setQueue((queue3) => [...queue3, confirm2]), logEngineGateFallbackToAsk(req.toolName, syncVerdict), liveApprovalCards.set(callKey, { retract: retractCard, windowClosed }), bornEpoch = registerApprovalCardToolCallId(req.toolCallId, callKey), askDeadlineMs !== void 0 && !isParkRowCard(callKey)) {
|
|
469033
469948
|
let remaining = askDeadlineMs - Date.now();
|
|
469034
469949
|
backstopWindowMs = Math.max(0, remaining), remaining <= 0 ? (logForDebugging(`liveToolApprovalWire: gate for "${req.toolName}" arrived with its approval window already closed \u2014 the card stays up, saying so`), windowClosed("timer")) : askWindowTimer = setTimeout(() => {
|
|
469035
469950
|
windowClosed("timer");
|
|
@@ -469074,6 +469989,9 @@ var asWireTool, forcedToolLoadFailureForTest, forcedToolNilExportForTest, loadFi
|
|
|
469074
469989
|
init_ruleEvidenceNote();
|
|
469075
469990
|
init_persistedRulesWire2();
|
|
469076
469991
|
init_armedGateRegistry2();
|
|
469992
|
+
init_askFrameNotes();
|
|
469993
|
+
init_liveSessionStore();
|
|
469994
|
+
init_liveApprovalCardHandles();
|
|
469077
469995
|
init_liveApprovalCardHandles();
|
|
469078
469996
|
init_turnGateJournal();
|
|
469079
469997
|
init_untrustedDisplayText();
|
|
@@ -469274,6 +470192,9 @@ function windowKeysFrom(frame, opts) {
|
|
|
469274
470192
|
...typeof frame.serverNowMs == "number" && Number.isFinite(frame.serverNowMs) ? { serverNowMs: frame.serverNowMs } : {}
|
|
469275
470193
|
};
|
|
469276
470194
|
}
|
|
470195
|
+
function readRuleOffersAbsenceStamp(card) {
|
|
470196
|
+
return typeof card.ruleOffersAbsence == "string" && card.ruleOffersAbsence !== "" ? { ruleOffersAbsence: card.ruleOffersAbsence } : {};
|
|
470197
|
+
}
|
|
469277
470198
|
function approvalCardRequestFrom(frame, opts) {
|
|
469278
470199
|
let card = frame.card, notes = [riskNoteFor(card.risk)];
|
|
469279
470200
|
card.argsOmitted === !0 && notes.push("arguments omitted by the engine (over the 16 KiB cap) \u2014 this does NOT mean the call has no arguments");
|
|
@@ -469311,6 +470232,28 @@ function approvalCardRequestFrom(frame, opts) {
|
|
|
469311
470232
|
// 不是 `ApprovalCard` 的键)⇒ 本处**不**去 card 上找它:两位不同源不同算点,在这里补一个同名读
|
|
469312
470233
|
// 就是拿一个量冒充另一个。那一位由 client-core 的行→卡重铸腿供给(0.48.0 件②)。
|
|
469313
470234
|
...card.inputHasBidi === !0 ? { inputHasBidi: !0 } : {},
|
|
470235
|
+
// ── §23a 两位(L-107④ 壳半场,1.0.102;登记在案的「刻意不透」两条同批清账)─────────────
|
|
470236
|
+
// 🔴 修前这两位在本腿被整键剥掉,理由(写在 approvalStreamWire.test 的 DELIBERATELY_NOT_STAMPED
|
|
470237
|
+
// 表里)是「壳侧零消费口 + client-core 也还没投影 ⇒ 透传一个没人读的对象 = 假 affordance」。
|
|
470238
|
+
// **两个前提本批同时消失**:client-core 0.59.0 把两位投影到 `ApprovalCardRequest` 的具名位,
|
|
470239
|
+
// 壳侧 `composeCardWireNote` → `askFrameNoteParts` 是它们的消费口。⇒ 那条登记的退出条件
|
|
470240
|
+
// (逐字:「包侧投影落地那一批本腿改经包面透传,同批删本条」)兑现,两条同批从表里删掉。
|
|
470241
|
+
// 🔴 **本腿一个字都不自己拼**:措辞单源在 askFrameNotes,由卡口(shellApprovalCardPort →
|
|
470242
|
+
// composeCardWireNote)统一渲 —— 本腿只把值原样送到卡入参上。两个铸卡口各拼一遍就是同一句
|
|
470243
|
+
// 话在两条车道上漂开(probeCause / ruleEvidence 当年立的同一条纪律)。
|
|
470244
|
+
// 🔴 **窄读走壳侧单源 `readDenialLimitFallback`**(askFrameNotes):活卡帧腿的窄读在包里做完了,
|
|
470245
|
+
// 但本腿读的是**生 wire**,而包的同名窄读器**没有导出**(dist 直证)⇒ 壳侧只此一把,判据与
|
|
470246
|
+
// server `.strict()` / 包内那把**逐字对齐**(四成员缺一整只丢)。已记候包:包导出后同批删。
|
|
470247
|
+
// 🔴 只按**铸点域**判,绝不再收窄一格(B-025「消费域比铸点域更窄」的病形)。
|
|
470248
|
+
...(() => {
|
|
470249
|
+
let dlf = readDenialLimitFallback3(card.denialLimitFallback);
|
|
470250
|
+
return dlf !== void 0 ? { denialLimitFallback: dlf } : {};
|
|
470251
|
+
})(),
|
|
470252
|
+
// 🔴 `ruleOffersAbsence` 按**开集**送(非空串即收):闭三词的属主是 core,壳再套一张闭集表会在
|
|
470253
|
+
// core 加员那天把合法值判没。空串是坏值不是「没有原因」⇒ 不送。
|
|
470254
|
+
// ⚠️ 本腿的「不再询问」档**本来就不渲**(ruleOffers/ruleSuggestions 刻意剥,见下方长注):
|
|
470255
|
+
// 送这一位不会造出档位,只会让卡上多一句「为什么没有这一格」—— 那正是它答的那一问。
|
|
470256
|
+
...readRuleOffersAbsenceStamp(card),
|
|
469314
470257
|
// ── #144 被越级的持久 allow 规则原文(合并批审计件⑧;**同族第三次**静默漏键)──────────────
|
|
469315
470258
|
// 🔴 与 `model` / `requiresRealApproval` / `inputHasBidi` 逐字同形:SDK 的 `APPROVAL_CARD_KEYS`
|
|
469316
470259
|
// 早已列了 `persistedRuleShadowed`(server ≥7.13.0 随卡真发),client-core 的
|
|
@@ -469390,6 +470333,15 @@ function genericCardRequestFrom(env6, askId, opts) {
|
|
|
469390
470333
|
// 扫描结果,不是卡的展示语义)。防御读:**严格 `true` 才 stamp**,其余(含 `"true"` / `1` / `false`)
|
|
469391
470334
|
// 一律键缺席。与 v1 腿同一条纪律 —— 未知形帧上少说一句披露只是降级,多说一句「已确认干净」是谎报。
|
|
469392
470335
|
...card.inputHasBidi === !0 ? { inputHasBidi: !0 } : {},
|
|
470336
|
+
// §23a 两位同形(L-107④;与 toolCallId / inputHasBidi 同一条降级纪律):这两位与 schemaVersion
|
|
470337
|
+
// **无关** —— 它们是引擎对这只 ask 本身的判定,不是卡的展示语义 ⇒ 未知形帧上照样防御读。
|
|
470338
|
+
// 🔴 措辞与窄读都在 askFrameNotes 单源;本腿只送已成形的值。读法与 v1 腿**同一个函数**
|
|
470339
|
+
// (不是「同样写一遍」)—— 两腿各抄一份窄读器就是同形存量。读不出一律键缺席。
|
|
470340
|
+
...(() => {
|
|
470341
|
+
let dlf = readDenialLimitFallback3(card.denialLimitFallback);
|
|
470342
|
+
return dlf !== void 0 ? { denialLimitFallback: dlf } : {};
|
|
470343
|
+
})(),
|
|
470344
|
+
...readRuleOffersAbsenceStamp(card),
|
|
469393
470345
|
...opts.signal !== void 0 ? { signal: opts.signal } : {},
|
|
469394
470346
|
wireNote: notes.join(" \xB7 "),
|
|
469395
470347
|
// 窗三键(见函数头注)——**先验自洽再投影**;验不过 ⇒ 整族不转(连本地锚点 `receivedAtMs` 都不盖:
|
|
@@ -469721,6 +470673,7 @@ var STREAM_APPROVAL_CAP, ASK_DECISION_DISABLED_CODE, IDEMPOTENCY_KEY_MAX, PARKIN
|
|
|
469721
470673
|
init_ruleEvidenceNote();
|
|
469722
470674
|
init_untrustedDisplayText();
|
|
469723
470675
|
init_wireNoticePort();
|
|
470676
|
+
init_askFrameNotes();
|
|
469724
470677
|
init_liveToolApprovalWire();
|
|
469725
470678
|
init_askParkExpiry();
|
|
469726
470679
|
STREAM_APPROVAL_CAP = "streamApproval", ASK_DECISION_DISABLED_CODE = "feature.approval_ask_disabled", IDEMPOTENCY_KEY_MAX = 255, PARKING_POLL_MAX = 2, PARKING_POLL_DELAY_MS = 400, CAPS_SETTLE_BUDGET_MS = 1500, LEGACY_SETTLE_GRACE_MS = 750, MAX_DECISION_NOTE_CHARS = 2048, TEARDOWN_BUDGET_MS = 1e3;
|
|
@@ -470019,6 +470972,7 @@ __export(agentsWire_exports, {
|
|
|
470019
470972
|
DELEGATION_CAP_CODES: () => DELEGATION_CAP_CODES,
|
|
470020
470973
|
DELEGATION_CONCURRENCY_CAP: () => DELEGATION_CONCURRENCY_CAP,
|
|
470021
470974
|
DELEGATION_SESSION_CAP: () => DELEGATION_SESSION_CAP,
|
|
470975
|
+
DENIAL_LIMIT_KINDS: () => DENIAL_LIMIT_KINDS,
|
|
470022
470976
|
DETACH_DURABLE_OFF_400_ANCHOR: () => DETACH_DURABLE_OFF_400_ANCHOR,
|
|
470023
470977
|
DETACH_HEADER: () => DETACH_HEADER,
|
|
470024
470978
|
DETACH_WIRE_MIN_ENGINE: () => DETACH_WIRE_MIN_ENGINE,
|
|
@@ -470130,7 +471084,9 @@ __export(agentsWire_exports, {
|
|
|
470130
471084
|
RESUME_CHOICE_BACKGROUND_LABEL: () => RESUME_CHOICE_BACKGROUND_LABEL,
|
|
470131
471085
|
RESUME_CHOICE_CANCEL_LABEL: () => RESUME_CHOICE_CANCEL_LABEL,
|
|
470132
471086
|
RESUME_CHOICE_HEADER: () => RESUME_CHOICE_HEADER,
|
|
471087
|
+
RESUME_PLACEMENT_MISMATCH: () => RESUME_PLACEMENT_MISMATCH,
|
|
470133
471088
|
RESUME_PREFLIGHT_REJECTED: () => RESUME_PREFLIGHT_REJECTED,
|
|
471089
|
+
RESUME_REFUSAL_CODES: () => RESUME_REFUSAL_CODES,
|
|
470134
471090
|
RESUME_RETRY_LATER_CODES: () => RESUME_RETRY_LATER_CODES,
|
|
470135
471091
|
RESUME_RUNNING_GUIDANCE_TAG: () => RESUME_RUNNING_GUIDANCE_TAG,
|
|
470136
471092
|
RESUME_RUNNING_NO_UI_EXIT_CODE: () => RESUME_RUNNING_NO_UI_EXIT_CODE,
|
|
@@ -470139,6 +471095,10 @@ __export(agentsWire_exports, {
|
|
|
470139
471095
|
REWIND_ERROR_CODE_PREFIXES: () => REWIND_ERROR_CODE_PREFIXES,
|
|
470140
471096
|
RULE_NOT_SENT_REJECTED_WARN_TEXT: () => RULE_NOT_SENT_REJECTED_WARN_TEXT,
|
|
470141
471097
|
RULE_NOT_SENT_WARN_TEXT: () => RULE_NOT_SENT_WARN_TEXT,
|
|
471098
|
+
RULE_OFFERS_ABSENCE_REASONS: () => RULE_OFFERS_ABSENCE_REASONS,
|
|
471099
|
+
RULE_OFFER_BATCH_MEMBER_KINDS: () => RULE_OFFER_BATCH_MEMBER_KINDS,
|
|
471100
|
+
RULE_OFFER_MATCHES: () => RULE_OFFER_MATCHES,
|
|
471101
|
+
RULE_OFFER_UNCOVERED_REASONS: () => RULE_OFFER_UNCOVERED_REASONS,
|
|
470142
471102
|
RUNNING_STATES: () => RUNNING_STATES,
|
|
470143
471103
|
RUN_BLOCKED_MESSAGE_PREFIX: () => RUN_BLOCKED_MESSAGE_PREFIX,
|
|
470144
471104
|
RUN_LEVEL_STOP_ERROR_CODES: () => RUN_LEVEL_STOP_ERROR_CODES,
|
|
@@ -470217,6 +471177,7 @@ __export(agentsWire_exports, {
|
|
|
470217
471177
|
__resetHooksWireCapsForTests: () => __resetHooksWireCapsForTests,
|
|
470218
471178
|
__resetRetainWithoutWakeWarningForTests: () => __resetRetainWithoutWakeWarningForTests,
|
|
470219
471179
|
__resetRunningChoiceLedgerForTests: () => __resetRunningChoiceLedgerForTests,
|
|
471180
|
+
__resetSqlEngineReadingsForTests: () => __resetSqlEngineReadingsForTests,
|
|
470220
471181
|
__resetSubagentOutputCapCacheForTests: () => __resetSubagentOutputCapCacheForTests,
|
|
470221
471182
|
__resetSubagentOwnerLedgerForTests: () => __resetSubagentOwnerLedgerForTests,
|
|
470222
471183
|
__resetSubagentStreamCapCacheForTests: () => __resetSubagentStreamCapCacheForTests,
|
|
@@ -470363,6 +471324,7 @@ __export(agentsWire_exports, {
|
|
|
470363
471324
|
engineCapState: () => engineCapState,
|
|
470364
471325
|
engineCapString: () => engineCapString,
|
|
470365
471326
|
engineCapTrue: () => engineCapTrue,
|
|
471327
|
+
engineCapValue: () => engineCapValue,
|
|
470366
471328
|
engineCapsSettled: () => engineCapsSettled,
|
|
470367
471329
|
engineCcStopSemantics: () => engineCcStopSemantics,
|
|
470368
471330
|
engineLimitsSupportWarning: () => engineLimitsSupportWarning,
|
|
@@ -470405,6 +471367,7 @@ __export(agentsWire_exports, {
|
|
|
470405
471367
|
fleetViewStubRowIds: () => fleetViewStubRowIds,
|
|
470406
471368
|
fmtCtxOut: () => fmtCtxOut,
|
|
470407
471369
|
fmtTokens: () => fmtTokens,
|
|
471370
|
+
forgetSqlEngineReading: () => forgetSqlEngineReading,
|
|
470408
471371
|
gateArmedWaitMs: () => gateArmedWaitMs,
|
|
470409
471372
|
gateKind: () => gateKind,
|
|
470410
471373
|
getBgParentRun: () => getBgParentRun,
|
|
@@ -470548,6 +471511,7 @@ __export(agentsWire_exports, {
|
|
|
470548
471511
|
normalizeTaskNotification: () => normalizeTaskNotification,
|
|
470549
471512
|
normalizeWirePrincipal: () => normalizeWirePrincipal,
|
|
470550
471513
|
noteBgOwnerAbsence: () => noteBgOwnerAbsence,
|
|
471514
|
+
noteEngineCapsForSqlEngine: () => noteEngineCapsForSqlEngine,
|
|
470551
471515
|
notePlanReviewAnswered: () => notePlanReviewAnswered,
|
|
470552
471516
|
notePlanReviewAnsweredFor: () => notePlanReviewAnsweredFor,
|
|
470553
471517
|
notePlanReviewAnsweredIfDecisive: () => notePlanReviewAnsweredIfDecisive,
|
|
@@ -470556,6 +471520,7 @@ __export(agentsWire_exports, {
|
|
|
470556
471520
|
notificationDropCounters: () => notificationDropCounters,
|
|
470557
471521
|
notificationQueuePortMisses: () => notificationQueuePortMisses,
|
|
470558
471522
|
observeCancelByDeny: () => observeCancelByDeny,
|
|
471523
|
+
observedSqlEngine: () => observedSqlEngine,
|
|
470559
471524
|
onEngineTaskBound: () => onEngineTaskBound,
|
|
470560
471525
|
onGateArmed: () => onGateArmed,
|
|
470561
471526
|
onGateArmedFor: () => onGateArmedFor,
|
|
@@ -470613,6 +471578,7 @@ __export(agentsWire_exports, {
|
|
|
470613
471578
|
projectFleetAgentRows: () => projectFleetAgentRows,
|
|
470614
471579
|
projectFleetAgentRowsFor: () => projectFleetAgentRowsFor,
|
|
470615
471580
|
projectRewind: () => projectRewind,
|
|
471581
|
+
projectSqlEngineCapability: () => projectSqlEngineCapability,
|
|
470616
471582
|
projectTasks: () => projectTasks,
|
|
470617
471583
|
projectWorkflowRun: () => projectWorkflowRun,
|
|
470618
471584
|
projectWorkflowTaskOutput: () => projectWorkflowTaskOutput,
|
|
@@ -470698,6 +471664,8 @@ __export(agentsWire_exports, {
|
|
|
470698
471664
|
respondToQuestion: () => respondToQuestion,
|
|
470699
471665
|
resumeAttachReplayDisclosure: () => resumeAttachReplayDisclosure,
|
|
470700
471666
|
resumeChoiceFromLabels: () => resumeChoiceFromLabels,
|
|
471667
|
+
resumeRefusalContent: () => resumeRefusalContent,
|
|
471668
|
+
resumeRefusalFromError: () => resumeRefusalFromError,
|
|
470701
471669
|
resumeRetryLaterFromError: () => resumeRetryLaterFromError,
|
|
470702
471670
|
resumeRunningCancelUnconfirmedRow: () => resumeRunningCancelUnconfirmedRow,
|
|
470703
471671
|
resumeRunningLivenessRow: () => resumeRunningLivenessRow,
|
|
@@ -470732,6 +471700,7 @@ __export(agentsWire_exports, {
|
|
|
470732
471700
|
skillCommandsToSpecs: () => skillCommandsToSpecs,
|
|
470733
471701
|
splitApiErrorSupplement: () => splitApiErrorSupplement,
|
|
470734
471702
|
spoolMarkerOf: () => spoolMarkerOf,
|
|
471703
|
+
sqlEngineDoctorDetail: () => sqlEngineDoctorDetail,
|
|
470735
471704
|
stamp: () => stamp,
|
|
470736
471705
|
startApprovalsFeed: () => startApprovalsFeed,
|
|
470737
471706
|
steerEngineSubagent: () => steerEngineSubagent,
|
|
@@ -470982,6 +471951,22 @@ var init_detachWire2 = __esm({
|
|
|
470982
471951
|
}
|
|
470983
471952
|
});
|
|
470984
471953
|
|
|
471954
|
+
// build-src/src/sema/sqlEngineCapability.ts
|
|
471955
|
+
var sqlEngineCapability_exports = {};
|
|
471956
|
+
__export(sqlEngineCapability_exports, {
|
|
471957
|
+
__resetSqlEngineReadingsForTests: () => __resetSqlEngineReadingsForTests,
|
|
471958
|
+
forgetSqlEngineReading: () => forgetSqlEngineReading,
|
|
471959
|
+
noteEngineCapsForSqlEngine: () => noteEngineCapsForSqlEngine,
|
|
471960
|
+
observedSqlEngine: () => observedSqlEngine,
|
|
471961
|
+
projectSqlEngineCapability: () => projectSqlEngineCapability,
|
|
471962
|
+
sqlEngineDoctorDetail: () => sqlEngineDoctorDetail
|
|
471963
|
+
});
|
|
471964
|
+
var init_sqlEngineCapability2 = __esm({
|
|
471965
|
+
"build-src/src/sema/sqlEngineCapability.ts"() {
|
|
471966
|
+
init_dist();
|
|
471967
|
+
}
|
|
471968
|
+
});
|
|
471969
|
+
|
|
470985
471970
|
// build-src/src/sema/engineCapsArm.ts
|
|
470986
471971
|
function beginCapsTeeEpoch(baseUrl) {
|
|
470987
471972
|
let next = (capsTeeEpochByBase.get(baseUrl) ?? 0) + 1;
|
|
@@ -471006,7 +471991,7 @@ function armEngineCapsProbes(input) {
|
|
|
471006
471991
|
return caps;
|
|
471007
471992
|
}) : capsProbe;
|
|
471008
471993
|
if (afterEngineRespawn) {
|
|
471009
|
-
resetCapsDiscoveryState(baseUrl), invalidateSelfKnowledgeCap(baseUrl), kickAppendSystemPromptCapProbe(baseUrl, appendCapProbe), invalidateEngineCaps(baseUrl, guardedCapsProbe);
|
|
471994
|
+
resetCapsDiscoveryState(baseUrl), invalidateSelfKnowledgeCap(baseUrl), forgetSqlEngineReading(baseUrl), forgetWiringManifestReading(), kickAppendSystemPromptCapProbe(baseUrl, appendCapProbe), invalidateEngineCaps(baseUrl, guardedCapsProbe);
|
|
471010
471995
|
return;
|
|
471011
471996
|
}
|
|
471012
471997
|
kickAppendSystemPromptCapProbe(baseUrl, appendCapProbe), kickEngineCapsProbe(baseUrl, guardedCapsProbe);
|
|
@@ -471018,6 +472003,8 @@ var capsTeeEpochByBase, init_engineCapsArm = __esm({
|
|
|
471018
472003
|
init_dist();
|
|
471019
472004
|
init_projectContextCapGate();
|
|
471020
472005
|
init_selfKnowledge();
|
|
472006
|
+
init_sqlEngineCapability2();
|
|
472007
|
+
init_wiringManifestStore();
|
|
471021
472008
|
capsTeeEpochByBase = /* @__PURE__ */ new Map();
|
|
471022
472009
|
}
|
|
471023
472010
|
});
|
|
@@ -471144,8 +472131,8 @@ function ledgerPath(scope) {
|
|
|
471144
472131
|
}
|
|
471145
472132
|
function crashConvergedScopeDigest(baseUrl, principal) {
|
|
471146
472133
|
try {
|
|
471147
|
-
let { createHash:
|
|
471148
|
-
return
|
|
472134
|
+
let { createHash: createHash33 } = __require("node:crypto");
|
|
472135
|
+
return createHash33("sha256").update(scopeKeyOf(baseUrl, principal)).digest("hex").slice(0, 16);
|
|
471149
472136
|
} catch {
|
|
471150
472137
|
return "nodigest";
|
|
471151
472138
|
}
|
|
@@ -471306,6 +472293,17 @@ async function* normalizeToolNames(events3) {
|
|
|
471306
472293
|
yield ev;
|
|
471307
472294
|
}
|
|
471308
472295
|
}
|
|
472296
|
+
async function* tapAutoDeniedToolEnds(events3, openEpoch) {
|
|
472297
|
+
for await (let ev of events3) {
|
|
472298
|
+
try {
|
|
472299
|
+
let kind = surfaceToolEndAutoDenied(ev, openEpoch);
|
|
472300
|
+
kind === "live" ? semaDebugLine("liveClient: tool_end autoDenied=true \u2014 the live card said so") : kind === "late" ? semaDebugLine("liveClient: tool_end autoDenied=true \u2014 corrected the window-closed row") : kind === "late-unsurfaced" && semaDebugLine("liveClient: tool_end autoDenied=true \u2014 the late correction could not be surfaced (no transcript sink); the ledger entry is consumed");
|
|
472301
|
+
} catch (e) {
|
|
472302
|
+
semaDebugLine(`liveClient: the autoDenied tap threw (ignored, the stream is never harmed): ${String(e)}`);
|
|
472303
|
+
}
|
|
472304
|
+
yield ev;
|
|
472305
|
+
}
|
|
472306
|
+
}
|
|
471309
472307
|
async function* stampSubagentOwners(events3, runIdOf, ownerSessionId) {
|
|
471310
472308
|
for await (let ev of events3)
|
|
471311
472309
|
recordSubagentOwnerFromProgress(ev, runIdOf(), ownerSessionId), yield ev;
|
|
@@ -471447,7 +472445,7 @@ function createLiveConversationClient(config4) {
|
|
|
471447
472445
|
capsTee: (caps) => {
|
|
471448
472446
|
noteEngineCapsForMcpGate(config4.baseUrl, caps), noteEngineCapsForSessionBackground(config4.baseUrl, caps), noteEngineCapsForProjectContext(config4.baseUrl, caps), readCrashConvergedOnce(client3, config4.baseUrl, { principal: config4.principal }), noteEngineCapsForWorkflowsGate(config4.baseUrl, caps, {
|
|
471449
472447
|
...typeof config4.principal == "string" ? { principal: config4.principal } : {}
|
|
471450
|
-
});
|
|
472448
|
+
}), noteEngineCapsForSqlEngine(config4.baseUrl, caps);
|
|
471451
472449
|
},
|
|
471452
472450
|
afterEngineRespawn: config4.afterEngineRespawn === !0
|
|
471453
472451
|
}), prepareTaskAgentsWire({
|
|
@@ -471638,7 +472636,7 @@ function createLiveConversationClient(config4) {
|
|
|
471638
472636
|
...opts?.signal ? { signal: opts.signal } : {}
|
|
471639
472637
|
}) : live;
|
|
471640
472638
|
return diagnoseSseIdleTear(
|
|
471641
|
-
normalizeToolNames(
|
|
472639
|
+
normalizeToolNames(tapAutoDeniedToolEnds(
|
|
471642
472640
|
captureSessionId(
|
|
471643
472641
|
// §4④ engine 1.163 — AskUserQuestion parks the run `suspended` (no `question` frames anymore);
|
|
471644
472642
|
// the bridge turns that park into dialog → approvals.decide → runs.events continuation, INSIDE
|
|
@@ -471674,8 +472672,9 @@ function createLiveConversationClient(config4) {
|
|
|
471674
472672
|
() => headerAcquired,
|
|
471675
472673
|
() => earlyTaskId,
|
|
471676
472674
|
() => getLiveSessionEpoch() === openEpoch
|
|
471677
|
-
)
|
|
471678
|
-
|
|
472675
|
+
),
|
|
472676
|
+
openEpoch
|
|
472677
|
+
)),
|
|
471679
472678
|
baseUrlTrimmed,
|
|
471680
472679
|
opts?.signal
|
|
471681
472680
|
);
|
|
@@ -471696,7 +472695,7 @@ function createLiveConversationClient(config4) {
|
|
|
471696
472695
|
events(taskId, opts) {
|
|
471697
472696
|
let openEpoch = getLiveSessionEpoch();
|
|
471698
472697
|
return withDurableSuggestionsTail(
|
|
471699
|
-
normalizeToolNames(
|
|
472698
|
+
normalizeToolNames(tapAutoDeniedToolEnds(
|
|
471700
472699
|
captureSessionId(
|
|
471701
472700
|
bridgeAskUserQuestionGates(
|
|
471702
472701
|
demuxQuestionFrames(
|
|
@@ -471727,8 +472726,9 @@ function createLiveConversationClient(config4) {
|
|
|
471727
472726
|
void 0,
|
|
471728
472727
|
void 0,
|
|
471729
472728
|
() => getLiveSessionEpoch() === openEpoch
|
|
471730
|
-
)
|
|
471731
|
-
|
|
472729
|
+
),
|
|
472730
|
+
openEpoch
|
|
472731
|
+
)),
|
|
471732
472732
|
taskId,
|
|
471733
472733
|
(id) => client3.runs.get(id, { ...engineSessionParamSpread() }),
|
|
471734
472734
|
// 调用方的中断口:补收窗(≤2s)里用户 Ctrl+C / 关流 ⇒ 立刻停,绝不在中断后多打 HTTP。
|
|
@@ -471824,6 +472824,9 @@ var ENGINE_TO_CC_TOOL, SUGGESTIONS_TAIL_MAX_ATTEMPTS, SUGGESTIONS_TAIL_RETRY_MS,
|
|
|
471824
472824
|
init_engineCapsArm();
|
|
471825
472825
|
init_crashConvergedNotice();
|
|
471826
472826
|
init_selfOrchestrationDenial2();
|
|
472827
|
+
init_sqlEngineCapability2();
|
|
472828
|
+
init_liveApprovalCardHandles();
|
|
472829
|
+
init_debugLine();
|
|
471827
472830
|
init_projectContextCapGate();
|
|
471828
472831
|
init_dist();
|
|
471829
472832
|
init_dist();
|
|
@@ -487837,12 +488840,12 @@ function readOffers(confirm2, key = "ruleOffers") {
|
|
|
487837
488840
|
if (!Array.isArray(o.rules) || o.rules.length === 0 || !Number.isSafeInteger(o.uncoveredSegments) || o.uncoveredSegments < 0) continue;
|
|
487838
488841
|
let members = [], memberShapeOk = !0;
|
|
487839
488842
|
for (let m2 of o.rules) {
|
|
487840
|
-
let
|
|
487841
|
-
if (
|
|
488843
|
+
let member = readBatchMember(m2);
|
|
488844
|
+
if (member === void 0) {
|
|
487842
488845
|
memberShapeOk = !1;
|
|
487843
488846
|
break;
|
|
487844
488847
|
}
|
|
487845
|
-
members.push(
|
|
488848
|
+
members.push(member);
|
|
487846
488849
|
}
|
|
487847
488850
|
if (!memberShapeOk) continue;
|
|
487848
488851
|
out6.push({ kind: "batch", offerIndex, rules: members, uncoveredSegments: o.uncoveredSegments });
|
|
@@ -487851,12 +488854,27 @@ function readOffers(confirm2, key = "ruleOffers") {
|
|
|
487851
488854
|
}
|
|
487852
488855
|
return out6;
|
|
487853
488856
|
}
|
|
488857
|
+
function isRuleOfferMatch2(v2) {
|
|
488858
|
+
return RULE_OFFER_MATCHES.some((m2) => m2 === v2);
|
|
488859
|
+
}
|
|
487854
488860
|
function readRuleTriple2(v2) {
|
|
487855
488861
|
if (v2 === null || typeof v2 != "object") return;
|
|
487856
488862
|
let s = v2;
|
|
487857
|
-
if (!(typeof s.rule != "string" || s.rule === "") &&
|
|
488863
|
+
if (!(typeof s.rule != "string" || s.rule === "") && isRuleOfferMatch2(s.match))
|
|
487858
488864
|
return { rule: s.rule, match: s.match, command: typeof s.command == "string" ? s.command : "" };
|
|
487859
488865
|
}
|
|
488866
|
+
function readBatchMember(v2) {
|
|
488867
|
+
if (v2 === null || typeof v2 != "object") return;
|
|
488868
|
+
let m2 = v2;
|
|
488869
|
+
if (typeof m2.segment != "string" || m2.segment === "") return;
|
|
488870
|
+
let segment2 = m2.segment, kind = m2.kind === void 0 ? "command" : m2.kind;
|
|
488871
|
+
if (kind === "command") {
|
|
488872
|
+
let triple = readRuleTriple2(v2);
|
|
488873
|
+
return triple === void 0 ? void 0 : { kind: "command", ...triple, segment: segment2 };
|
|
488874
|
+
}
|
|
488875
|
+
if (kind === "directoryRead")
|
|
488876
|
+
return typeof m2.rule != "string" || m2.rule === "" || typeof m2.directory != "string" || m2.directory === "" ? void 0 : { kind: "directoryRead", rule: m2.rule, directory: m2.directory, segment: segment2 };
|
|
488877
|
+
}
|
|
487860
488878
|
function engineRuleSuggestionOptions(confirm2) {
|
|
487861
488879
|
let offers = readOffers(confirm2);
|
|
487862
488880
|
if (offers.length === 0) return [];
|
|
@@ -512371,7 +513389,7 @@ function _temp158() {
|
|
|
512371
513389
|
}
|
|
512372
513390
|
var import_compiler_runtime307, import_react317, SETTINGS_ERRORS_NOTIFICATION_KEY, init_useSettingsErrors = __esm({
|
|
512373
513391
|
"build-src/src/hooks/notifs/useSettingsErrors.tsx"() {
|
|
512374
|
-
import_compiler_runtime307 = __toESM(require_compiler_runtime()
|
|
513392
|
+
import_compiler_runtime307 = __toESM(require_compiler_runtime()), import_react317 = __toESM(require_react());
|
|
512375
513393
|
init_notifications2();
|
|
512376
513394
|
init_state();
|
|
512377
513395
|
init_allErrors();
|
|
@@ -521907,6 +522925,24 @@ async function collectAxesRows(opts, deps2) {
|
|
|
521907
522925
|
} catch {
|
|
521908
522926
|
rows2.push({ label: "Auto mode", status: "warn", detail: "reading unavailable" });
|
|
521909
522927
|
}
|
|
522928
|
+
try {
|
|
522929
|
+
let { sqlEngineDoctorDetail: sqlEngineDoctorDetail2, observedSqlEngine: observedSqlEngine2 } = await Promise.resolve().then(() => (init_sqlEngineCapability2(), sqlEngineCapability_exports)), reading = deps2?.readSqlEngine !== void 0 ? deps2.readSqlEngine() : observedSqlEngine2();
|
|
522930
|
+
rows2.push({ label: "SQL engine", status: "info", detail: sqlEngineDoctorDetail2(reading) });
|
|
522931
|
+
} catch {
|
|
522932
|
+
rows2.push({ label: "SQL engine", status: "warn", detail: "reading unavailable" });
|
|
522933
|
+
}
|
|
522934
|
+
try {
|
|
522935
|
+
let { wiringMcpDoctorDetail: wiringMcpDoctorDetail2, observedWiringMcp: observedWiringMcp2 } = await Promise.resolve().then(() => (init_wiringManifestStore(), wiringManifestStore_exports)), readRows = deps2?.readWiringMcp !== void 0 ? deps2.readWiringMcp() : observedWiringMcp2();
|
|
522936
|
+
rows2.push({
|
|
522937
|
+
label: "MCP servers (engine leg)",
|
|
522938
|
+
status: "info",
|
|
522939
|
+
// 消毒口在**呈现面**给(措辞在 store,消毒在这里 —— 与 modelGateRemovedLine 同分工):
|
|
522940
|
+
// 三座都是 UNTRUSTED-for-display,只渲染、绝不参与判定。
|
|
522941
|
+
detail: wiringMcpDoctorDetail2(readRows, (v2, max2) => cleanUntrustedForDisplay(v2, max2))
|
|
522942
|
+
});
|
|
522943
|
+
} catch {
|
|
522944
|
+
rows2.push({ label: "MCP servers (engine leg)", status: "warn", detail: "reading unavailable" });
|
|
522945
|
+
}
|
|
521910
522946
|
let remote = (() => {
|
|
521911
522947
|
try {
|
|
521912
522948
|
return engineTarget.configuredEngineUrl();
|
|
@@ -525252,8 +526288,8 @@ var CC_DIR5, CC_GLOBAL_FILE2, MCP_SCOPE_LABELS, init_mcpChannels = __esm({
|
|
|
525252
526288
|
});
|
|
525253
526289
|
|
|
525254
526290
|
// build-src/src/sema/importSources.ts
|
|
525255
|
-
import { existsSync as existsSync34, mkdirSync as mkdirSync27, readdirSync as
|
|
525256
|
-
import { createHash as
|
|
526291
|
+
import { existsSync as existsSync34, mkdirSync as mkdirSync27, readdirSync as readdirSync14, readFileSync as readFileSync52, writeFileSync as writeFileSync27 } from "node:fs";
|
|
526292
|
+
import { createHash as createHash30 } from "node:crypto";
|
|
525257
526293
|
import { homedir as homedir48 } from "node:os";
|
|
525258
526294
|
import { dirname as dirname89, join as join195, resolve as resolve50, sep as sep43 } from "node:path";
|
|
525259
526295
|
function toSafeName(raw2) {
|
|
@@ -525261,14 +526297,14 @@ function toSafeName(raw2) {
|
|
|
525261
526297
|
}
|
|
525262
526298
|
function safeReaddirFiles(dir, ext) {
|
|
525263
526299
|
try {
|
|
525264
|
-
return
|
|
526300
|
+
return readdirSync14(dir, { withFileTypes: !0 }).filter((e) => e.isFile() && e.name.endsWith(ext)).map((e) => e.name);
|
|
525265
526301
|
} catch {
|
|
525266
526302
|
return [];
|
|
525267
526303
|
}
|
|
525268
526304
|
}
|
|
525269
526305
|
function hasNamespacedSubdirs(dir) {
|
|
525270
526306
|
try {
|
|
525271
|
-
return
|
|
526307
|
+
return readdirSync14(dir, { withFileTypes: !0 }).filter((e) => e.isDirectory()).map((e) => e.name);
|
|
525272
526308
|
} catch {
|
|
525273
526309
|
return [];
|
|
525274
526310
|
}
|
|
@@ -525725,7 +526761,7 @@ async function scanImportSources(opts) {
|
|
|
525725
526761
|
`) } : { scans, warnings };
|
|
525726
526762
|
}
|
|
525727
526763
|
function importScanDigest(scans) {
|
|
525728
|
-
let hash2 =
|
|
526764
|
+
let hash2 = createHash30("sha256");
|
|
525729
526765
|
for (let scan of [...scans].sort((a, b3) => a.sourceId.localeCompare(b3.sourceId))) {
|
|
525730
526766
|
hash2.update(scan.sourceId).update("\0");
|
|
525731
526767
|
for (let item of [...scan.result.items].sort((a, b3) => a.id.localeCompare(b3.id)))
|
|
@@ -526605,14 +527641,15 @@ async function* ask(params) {
|
|
|
526605
527641
|
continue;
|
|
526606
527642
|
}
|
|
526607
527643
|
if (t2 === "engine_notice") {
|
|
526608
|
-
let en2 = msg, clean9 = (v2) => cleanUntrustedForDisplay(v2, 160),
|
|
527644
|
+
let en2 = msg, clean9 = (v2) => cleanUntrustedForDisplay(v2, 160), detailKeys = "";
|
|
526609
527645
|
try {
|
|
526610
|
-
|
|
527646
|
+
detailKeys = en2.detail !== null && typeof en2.detail == "object" && !Array.isArray(en2.detail) ? Object.keys(en2.detail).map((k2) => clean9(k2)).join(",") : en2.detail === void 0 ? "" : `<${typeof en2.detail}>`;
|
|
526611
527647
|
} catch {
|
|
526612
|
-
|
|
527648
|
+
detailKeys = "(unreadable)";
|
|
526613
527649
|
}
|
|
527650
|
+
let messageLen = typeof en2.message == "string" ? en2.message.length : 0;
|
|
526614
527651
|
logForDebugging(
|
|
526615
|
-
`[sema][print] engine_notice swallowed (audit; no stdout parity frame \u2014 see [4429]/#302): code=${clean9(en2.code)} eventId=${clean9(en2.eventId)} eventSeq=${clean9(en2.eventSeq)} ts=${clean9(en2.ts)} sessionId=${clean9(en2.sessionId)}
|
|
527652
|
+
`[sema][print] engine_notice swallowed (audit; no stdout parity frame \u2014 see [4429]/#302): code=${clean9(en2.code)} eventId=${clean9(en2.eventId)} eventSeq=${clean9(en2.eventSeq)} ts=${clean9(en2.ts)} sessionId=${clean9(en2.sessionId)} messageLen=${String(messageLen)} detailKeys=[${detailKeys}]`
|
|
526616
527653
|
);
|
|
526617
527654
|
let noticeKey = `${clean9(en2.eventId)}|${clean9(en2.eventSeq)}|${clean9(en2.code)}`;
|
|
526618
527655
|
if (!emittedNoticeKeys.has(noticeKey) && isSurfaceableEngineNoticeCode(en2.code)) {
|
|
@@ -531150,18 +532187,18 @@ __export(adoptionGuard_exports, {
|
|
|
531150
532187
|
countLocalSessionArtifacts: () => countLocalSessionArtifacts,
|
|
531151
532188
|
remoteSwitchSessionNotice: () => remoteSwitchSessionNotice
|
|
531152
532189
|
});
|
|
531153
|
-
import { readdirSync as
|
|
532190
|
+
import { readdirSync as readdirSync15, existsSync as existsSync35 } from "node:fs";
|
|
531154
532191
|
import { join as join198 } from "node:path";
|
|
531155
532192
|
function countLocalSessionArtifacts() {
|
|
531156
532193
|
let census = { projects: 0, sessions: 0 };
|
|
531157
532194
|
try {
|
|
531158
532195
|
let root2 = getProjectsDir();
|
|
531159
532196
|
if (!existsSync35(root2)) return census;
|
|
531160
|
-
for (let entry of
|
|
532197
|
+
for (let entry of readdirSync15(root2, { withFileTypes: !0 })) {
|
|
531161
532198
|
if (!entry.isDirectory()) continue;
|
|
531162
532199
|
let n2 = 0;
|
|
531163
532200
|
try {
|
|
531164
|
-
n2 =
|
|
532201
|
+
n2 = readdirSync15(join198(root2, entry.name)).filter((f) => f.endsWith(".jsonl")).length;
|
|
531165
532202
|
} catch {
|
|
531166
532203
|
continue;
|
|
531167
532204
|
}
|
|
@@ -533085,8 +534122,8 @@ __export(cloudResources_exports, {
|
|
|
533085
534122
|
cloudResourceRemove: () => cloudResourceRemove,
|
|
533086
534123
|
cloudResourceSync: () => cloudResourceSync
|
|
533087
534124
|
});
|
|
533088
|
-
import { createHash as
|
|
533089
|
-
import { existsSync as existsSync37, readdirSync as
|
|
534125
|
+
import { createHash as createHash31 } from "node:crypto";
|
|
534126
|
+
import { existsSync as existsSync37, readdirSync as readdirSync16, readFileSync as readFileSync56, statSync as statSync17 } from "node:fs";
|
|
533090
534127
|
import { basename as basename69, dirname as dirname91, isAbsolute as isAbsolute34, join as join201, resolve as resolve51 } from "node:path";
|
|
533091
534128
|
import { getEffective as getEffective2, getMeConfig, getScopeConfigDraft as getScopeConfigDraft2, OAuthFlowError as OAuthFlowError3, RegistryApiError as RegistryApiError3 } from "@sema-agent/sdk/registry";
|
|
533092
534129
|
function fail4(e) {
|
|
@@ -533572,7 +534609,7 @@ async function readSkillEntry(file2, fallbackName) {
|
|
|
533572
534609
|
return { name, display: display2, entry: null, notes: [], skipReason: `skill name '${name}' is not registry-safe (letters/digits/._- , no spaces). Set a conforming 'name:' in the frontmatter.` };
|
|
533573
534610
|
if (!content)
|
|
533574
534611
|
return { name, display: display2, entry: null, notes: [], skipReason: `${file2} has no body after the frontmatter \u2014 nothing to upload.` };
|
|
533575
|
-
let contentHash = `sha256:${
|
|
534612
|
+
let contentHash = `sha256:${createHash31("sha256").update(content, "utf8").digest("hex")}`;
|
|
533576
534613
|
return {
|
|
533577
534614
|
name,
|
|
533578
534615
|
display: display2,
|
|
@@ -533585,7 +534622,7 @@ async function loadLocalSkillEntries() {
|
|
|
533585
534622
|
for (let root2 of roots) {
|
|
533586
534623
|
let dirs = [];
|
|
533587
534624
|
try {
|
|
533588
|
-
dirs =
|
|
534625
|
+
dirs = readdirSync16(root2).filter((d4) => {
|
|
533589
534626
|
try {
|
|
533590
534627
|
return statSync17(join201(root2, d4)).isDirectory() && existsSync37(join201(root2, d4, "SKILL.md"));
|
|
533591
534628
|
} catch {
|
|
@@ -538731,7 +539768,7 @@ import {
|
|
|
538731
539768
|
copyFileSync as copyFileSync8,
|
|
538732
539769
|
existsSync as existsSync39,
|
|
538733
539770
|
mkdirSync as mkdirSync29,
|
|
538734
|
-
readdirSync as
|
|
539771
|
+
readdirSync as readdirSync17,
|
|
538735
539772
|
readFileSync as readFileSync57,
|
|
538736
539773
|
statSync as statSync19
|
|
538737
539774
|
} from "node:fs";
|
|
@@ -538852,7 +539889,7 @@ function syncTree(srcDir, destDir, labelBase, opts, report) {
|
|
|
538852
539889
|
syncPlainFile(srcDir, destDir, labelBase, opts, report);
|
|
538853
539890
|
return;
|
|
538854
539891
|
}
|
|
538855
|
-
for (let name of
|
|
539892
|
+
for (let name of readdirSync17(srcDir)) {
|
|
538856
539893
|
let srcChild = join206(srcDir, name), destChild = join206(destDir, name), childStat;
|
|
538857
539894
|
try {
|
|
538858
539895
|
childStat = statSync19(srcChild);
|
|
@@ -541881,7 +542918,7 @@ var React202, import_jsx_runtime518, lastTierEditError, init_TiersHub = __esm({
|
|
|
541881
542918
|
});
|
|
541882
542919
|
|
|
541883
542920
|
// build-src/src/sema/config/skillsChannels.ts
|
|
541884
|
-
import { existsSync as existsSync40, mkdirSync as mkdirSync30, readdirSync as
|
|
542921
|
+
import { existsSync as existsSync40, mkdirSync as mkdirSync30, readdirSync as readdirSync18, readFileSync as readFileSync60, realpathSync as realpathSync17, renameSync as renameSync18, statSync as statSync20 } from "node:fs";
|
|
541885
542922
|
import { basename as basename72, dirname as dirname96, join as join209 } from "node:path";
|
|
541886
542923
|
function skillsDirFor(source) {
|
|
541887
542924
|
return source === "user" ? join209(resolveConfigHome(), "skills") : join209(getCwd(), ".sema", "skills");
|
|
@@ -541928,7 +542965,7 @@ function listInstalledSkills() {
|
|
|
541928
542965
|
for (let source of sources) {
|
|
541929
542966
|
let dir = skillsDirFor(source), entries;
|
|
541930
542967
|
try {
|
|
541931
|
-
entries =
|
|
542968
|
+
entries = readdirSync18(dir).filter((n2) => !n2.startsWith("."));
|
|
541932
542969
|
} catch {
|
|
541933
542970
|
continue;
|
|
541934
542971
|
}
|
|
@@ -544208,7 +545245,7 @@ Usage: sema --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
544208
545245
|
pendingHookMessages
|
|
544209
545246
|
}, renderAndRun);
|
|
544210
545247
|
}
|
|
544211
|
-
}).version("sema 1.0.
|
|
545248
|
+
}).version("sema 1.0.102", "-v, --version", "Output the version number"), program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)"), program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux."), canUserConfigureAdvisor() && program2.addOption(new Option("--advisor <model>", "Enable the server-side advisor tool with the specified model (alias or full ID).").hideHelp()), program2.addOption(new Option("--bg, --background", "Start the session as a background agent and return immediately (manage with `sema agents`)")), program2.command("ps").description("List background sessions").action(async () => {
|
|
544212
545249
|
await (await Promise.resolve().then(() => (init_bg2(), bg_exports))).psHandler([]), process.exit(process.exitCode ?? 0);
|
|
544213
545250
|
}), program2.command("logs [id]").description("Print a background session's recent terminal output").action(async (id) => {
|
|
544214
545251
|
await (await Promise.resolve().then(() => (init_bg2(), bg_exports))).logsHandler(id, []), process.exit(process.exitCode ?? 0);
|
|
@@ -546329,7 +547366,7 @@ var init_local_load = __esm({
|
|
|
546329
547366
|
// node_modules/@sema-agent/settings-schema/dist/scheduler-store-node.js
|
|
546330
547367
|
import { mkdirSync as mkdirSync32, readFileSync as readFileSync64, writeFileSync as writeFileSync30, renameSync as renameSync19 } from "node:fs";
|
|
546331
547368
|
import { dirname as dirname98 } from "node:path";
|
|
546332
|
-
import { randomBytes as randomBytes30, createHash as
|
|
547369
|
+
import { randomBytes as randomBytes30, createHash as createHash32 } from "node:crypto";
|
|
546333
547370
|
function loadSchedulerStore(path28) {
|
|
546334
547371
|
try {
|
|
546335
547372
|
return parseSchedulerStore(readFileSync64(path28, "utf-8"));
|
|
@@ -546428,7 +547465,7 @@ var init_schedulerDaemonWire = __esm({
|
|
|
546428
547465
|
});
|
|
546429
547466
|
|
|
546430
547467
|
// build-src/src/sema/scheduler/sessionReap.ts
|
|
546431
|
-
import { mkdirSync as mkdirSync33, readdirSync as
|
|
547468
|
+
import { mkdirSync as mkdirSync33, readdirSync as readdirSync19, readFileSync as readFileSync65, unlinkSync as unlinkSync17, writeFileSync as writeFileSync31 } from "node:fs";
|
|
546432
547469
|
import { dirname as dirname99, join as join214 } from "node:path";
|
|
546433
547470
|
function isSessionLifetimeRecord(r) {
|
|
546434
547471
|
return r.lifetime === "session";
|
|
@@ -546482,7 +547519,7 @@ function removeSchedulerClaim(storePath, pid = process.pid) {
|
|
|
546482
547519
|
function readAliveClaimedSessionIds(storePath, opts = {}) {
|
|
546483
547520
|
let alive = opts.isPidAlive ?? pidAlive3, dir = schedulerClaimsDir(storePath), out6 = /* @__PURE__ */ new Set(), files2;
|
|
546484
547521
|
try {
|
|
546485
|
-
files2 =
|
|
547522
|
+
files2 = readdirSync19(dir);
|
|
546486
547523
|
} catch {
|
|
546487
547524
|
return out6;
|
|
546488
547525
|
}
|
|
@@ -547240,11 +548277,11 @@ var init_skillsFill = __esm({
|
|
|
547240
548277
|
});
|
|
547241
548278
|
|
|
547242
548279
|
// build-src/src/sema/teamOnboarding.ts
|
|
547243
|
-
import { existsSync as existsSync43, readdirSync as
|
|
548280
|
+
import { existsSync as existsSync43, readdirSync as readdirSync20 } from "fs";
|
|
547244
548281
|
function hasWorkspaceData() {
|
|
547245
548282
|
try {
|
|
547246
548283
|
let dir = getProjectsDir2();
|
|
547247
|
-
return existsSync43(dir) ?
|
|
548284
|
+
return existsSync43(dir) ? readdirSync20(dir).length > 0 : !1;
|
|
547248
548285
|
} catch {
|
|
547249
548286
|
return !1;
|
|
547250
548287
|
}
|