oasis_test_v2 2.2.46 → 2.2.48
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/dist/index.js +137 -48
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5240,18 +5240,19 @@ async function probeCodexAppServer(bin, timeoutMs = 15e3) {
|
|
|
5240
5240
|
if (config2 === void 0 || listState === "pending") return;
|
|
5241
5241
|
finish({ config: config2, models: listState === "done" ? listed : null });
|
|
5242
5242
|
};
|
|
5243
|
-
const
|
|
5243
|
+
const abort = () => finish(config2 === void 0 ? null : { config: config2, models: listState === "done" ? listed : null });
|
|
5244
|
+
const timer = setTimeout(abort, timeoutMs);
|
|
5244
5245
|
const send = (id, method, params) => {
|
|
5245
5246
|
try {
|
|
5246
5247
|
child.stdin?.write(`${JSON.stringify({ jsonrpc: "2.0", id, method, params })}
|
|
5247
5248
|
`);
|
|
5248
5249
|
} catch {
|
|
5249
|
-
|
|
5250
|
+
abort();
|
|
5250
5251
|
}
|
|
5251
5252
|
};
|
|
5252
|
-
child.on("error",
|
|
5253
|
-
child.stdin?.on("error",
|
|
5254
|
-
child.on("close",
|
|
5253
|
+
child.on("error", abort);
|
|
5254
|
+
child.stdin?.on("error", abort);
|
|
5255
|
+
child.on("close", abort);
|
|
5255
5256
|
let buf = "";
|
|
5256
5257
|
child.stdout?.on("data", (chunk) => {
|
|
5257
5258
|
if (settled) return;
|
|
@@ -5951,6 +5952,9 @@ var init_protocol_session = __esm({
|
|
|
5951
5952
|
function codexNum(v2) {
|
|
5952
5953
|
return typeof v2 === "number" && Number.isFinite(v2) ? v2 : 0;
|
|
5953
5954
|
}
|
|
5955
|
+
function codexOutputTokens(output, reasoning) {
|
|
5956
|
+
return Math.max(codexNum(output), codexNum(reasoning));
|
|
5957
|
+
}
|
|
5954
5958
|
function parseCodexAppServerTurnUsage(params) {
|
|
5955
5959
|
const p2 = params;
|
|
5956
5960
|
const last = p2?.tokenUsage?.last;
|
|
@@ -5959,7 +5963,7 @@ function parseCodexAppServerTurnUsage(params) {
|
|
|
5959
5963
|
input: codexNum(last["inputTokens"]),
|
|
5960
5964
|
cacheRead: codexNum(last["cachedInputTokens"]),
|
|
5961
5965
|
cacheWrite: codexNum(last["cacheWriteInputTokens"]),
|
|
5962
|
-
output:
|
|
5966
|
+
output: codexOutputTokens(last["outputTokens"], last["reasoningOutputTokens"])
|
|
5963
5967
|
};
|
|
5964
5968
|
}
|
|
5965
5969
|
function addCodexBuckets(acc, add) {
|
|
@@ -5991,8 +5995,8 @@ function bucketsOf(usage) {
|
|
|
5991
5995
|
// cache 字段名跨版本有两种
|
|
5992
5996
|
cacheRead: codexNum(usage["cached_input_tokens"]) || codexNum(usage["cache_read_input_tokens"]),
|
|
5993
5997
|
cacheWrite: codexNum(usage["cache_write_input_tokens"]),
|
|
5994
|
-
//
|
|
5995
|
-
output:
|
|
5998
|
+
// output_tokens 已含 reasoning,见 codexOutputTokens。
|
|
5999
|
+
output: codexOutputTokens(usage["output_tokens"], usage["reasoning_output_tokens"])
|
|
5996
6000
|
};
|
|
5997
6001
|
}
|
|
5998
6002
|
function usageFromBuckets(b2) {
|
|
@@ -10504,6 +10508,11 @@ var init_chat_item_ledger = __esm({
|
|
|
10504
10508
|
const ord = this.rows.get(itemId)?.ord;
|
|
10505
10509
|
return ord === null ? void 0 : ord;
|
|
10506
10510
|
}
|
|
10511
|
+
/** 展示时间与持久行同源;不以浏览器收到帧的时间代替。 */
|
|
10512
|
+
timestampsFor(itemId) {
|
|
10513
|
+
const row = this.rows.get(itemId);
|
|
10514
|
+
return row ? { createdAt: row.createdAt, completedAt: row.completedAt } : void 0;
|
|
10515
|
+
}
|
|
10507
10516
|
get failures() {
|
|
10508
10517
|
return this.failureCount;
|
|
10509
10518
|
}
|
|
@@ -10707,6 +10716,8 @@ var init_chat_item_ledger = __esm({
|
|
|
10707
10716
|
if (this.rows.has(row.id)) continue;
|
|
10708
10717
|
const { text: text6, attrs } = restoredTextAndAttrs(row);
|
|
10709
10718
|
const item = {
|
|
10719
|
+
createdAt: row.createdAt,
|
|
10720
|
+
completedAt: row.completedAt,
|
|
10710
10721
|
id: row.id,
|
|
10711
10722
|
seq: ++this.seqCounter,
|
|
10712
10723
|
ord: row.ord,
|
|
@@ -10961,7 +10972,10 @@ var init_chat_item_ledger = __esm({
|
|
|
10961
10972
|
const id = input.deterministicId ?? this.newId();
|
|
10962
10973
|
const startedVersion = this.tick();
|
|
10963
10974
|
const writeVersion = this.tick();
|
|
10975
|
+
const createdAt = this.now();
|
|
10964
10976
|
const row = {
|
|
10977
|
+
createdAt,
|
|
10978
|
+
completedAt: null,
|
|
10965
10979
|
id,
|
|
10966
10980
|
seq: ++this.seqCounter,
|
|
10967
10981
|
ord: null,
|
|
@@ -10985,7 +10999,6 @@ var init_chat_item_ledger = __esm({
|
|
|
10985
10999
|
if (!input.forceNullMessage) this.segmentItemCount += 1;
|
|
10986
11000
|
if (!input.persist || !this.persistEnabled) return id;
|
|
10987
11001
|
const messageId = row.messageId;
|
|
10988
|
-
const createdAt = this.now();
|
|
10989
11002
|
const payload2 = input.payload ?? this.payloadOf(row);
|
|
10990
11003
|
const metadata = input.metadata ?? { [CHAT_ITEM_META_LEGACY_CONTENT]: input.inContent };
|
|
10991
11004
|
this.enqueue(async () => {
|
|
@@ -11053,9 +11066,11 @@ var init_chat_item_ledger = __esm({
|
|
|
11053
11066
|
persist(row, op, what) {
|
|
11054
11067
|
const version2 = this.tick();
|
|
11055
11068
|
row.wireVersion = version2;
|
|
11069
|
+
const at = this.now();
|
|
11070
|
+
if (op.op === "set_status" && op.status !== "streaming") row.completedAt = at;
|
|
11056
11071
|
if (!row.persist || !this.persistEnabled) return;
|
|
11057
11072
|
this.enqueue(async () => {
|
|
11058
|
-
await this.deps.items.applyOp(row.id, op, { at
|
|
11073
|
+
await this.deps.items.applyOp(row.id, op, { at, version: version2 });
|
|
11059
11074
|
}, what);
|
|
11060
11075
|
}
|
|
11061
11076
|
/** 串行链 + 失败吞掉计数。**串行是必须的**:append_text 依赖建行已经落地。 */
|
|
@@ -121001,11 +121016,11 @@ var require_lib2 = __commonJS({
|
|
|
121001
121016
|
var DEFAULT_INITIAL = "Thinking...";
|
|
121002
121017
|
var DEFAULT_EMPTY = "(no content)";
|
|
121003
121018
|
var INITIAL_SUMMARY = "[Generating...]";
|
|
121004
|
-
var
|
|
121019
|
+
var SUMMARY_MAX_CHARS2 = 50;
|
|
121005
121020
|
var ERROR_FOOTER = "\n\n\u2014 _(Generation interrupted)_";
|
|
121006
121021
|
var DEFAULT_MAX_ELEMENT_CHARS = 3e4;
|
|
121007
121022
|
var ELEMENT_ID = "stream_md";
|
|
121008
|
-
function truncateSummary(text6, max =
|
|
121023
|
+
function truncateSummary(text6, max = SUMMARY_MAX_CHARS2) {
|
|
121009
121024
|
if (!text6)
|
|
121010
121025
|
return "";
|
|
121011
121026
|
const cleaned = text6.replace(/\s+/g, " ").trim();
|
|
@@ -162578,8 +162593,12 @@ var init_live_chat = __esm({
|
|
|
162578
162593
|
payload: item.payload
|
|
162579
162594
|
});
|
|
162580
162595
|
}
|
|
162581
|
-
assignV3Seq(turn, frame) {
|
|
162582
|
-
|
|
162596
|
+
assignV3Seq(turn, frame, times = turn.items?.timestampsFor(frame.itemId)) {
|
|
162597
|
+
const payload2 = times ? {
|
|
162598
|
+
...frame.payload && typeof frame.payload === "object" && !Array.isArray(frame.payload) ? frame.payload : {},
|
|
162599
|
+
...times
|
|
162600
|
+
} : frame.payload;
|
|
162601
|
+
return { ...frame, ...payload2 !== void 0 ? { payload: payload2 } : {}, epoch: turn.liveEpoch, seq: ++turn.v3Seq };
|
|
162583
162602
|
}
|
|
162584
162603
|
/**
|
|
162585
162604
|
* v3 帧的**唯一**发布出口:按 24ms 窗口合并同一 item 上相邻的 `append_text`,其余一律是顺序屏障。
|
|
@@ -162732,7 +162751,7 @@ var init_live_chat = __esm({
|
|
|
162732
162751
|
operation: item.status === "completed" ? "completed" : "failed",
|
|
162733
162752
|
itemVersion: item.version,
|
|
162734
162753
|
...item.ord !== null ? { ord: item.ord } : {}
|
|
162735
|
-
}));
|
|
162754
|
+
}, { createdAt: item.createdAt, completedAt: item.completedAt }));
|
|
162736
162755
|
return true;
|
|
162737
162756
|
}
|
|
162738
162757
|
emitV3TurnTerminal(turn, status) {
|
|
@@ -200836,7 +200855,34 @@ function registerDelegatedChildTurn(liveChat, childSessionId, session, deps = {}
|
|
|
200836
200855
|
} catch {
|
|
200837
200856
|
}
|
|
200838
200857
|
});
|
|
200839
|
-
const
|
|
200858
|
+
const recordFailure = (err) => {
|
|
200859
|
+
const chatExit = err instanceof Error ? err.chatExit : void 0;
|
|
200860
|
+
const text6 = chatExit?.summary ?? (err instanceof Error ? err.message : String(err));
|
|
200861
|
+
const extra = {
|
|
200862
|
+
...chatExit?.reason ? { reason: chatExit.reason } : {},
|
|
200863
|
+
...chatExit?.detail ? { detail: chatExit.detail } : {}
|
|
200864
|
+
};
|
|
200865
|
+
try {
|
|
200866
|
+
ctrl.emit({ type: "error", text: text6, ...extra });
|
|
200867
|
+
} catch {
|
|
200868
|
+
}
|
|
200869
|
+
try {
|
|
200870
|
+
const outcome = ledger.recordError(text6, extra);
|
|
200871
|
+
ctrl.publishServerItem({
|
|
200872
|
+
itemId: outcome.itemId,
|
|
200873
|
+
itemType: "control",
|
|
200874
|
+
startedVersion: outcome.startedVersion,
|
|
200875
|
+
version: outcome.version,
|
|
200876
|
+
ord: outcome.ord,
|
|
200877
|
+
status: "failed",
|
|
200878
|
+
payload: { code: "error", note: text6, ...extra }
|
|
200879
|
+
});
|
|
200880
|
+
} catch (e) {
|
|
200881
|
+
log3(`[delegation] \u5B50\u4F1A\u8BDD ${childSessionId} \u5931\u8D25\u539F\u56E0\u843D\u8D26\u5931\u8D25: ${String(e)}`);
|
|
200882
|
+
}
|
|
200883
|
+
};
|
|
200884
|
+
const settle = async (signal, err) => {
|
|
200885
|
+
if (signal === "failed") recordFailure(err);
|
|
200840
200886
|
try {
|
|
200841
200887
|
normalized4?.finishTurn(signal);
|
|
200842
200888
|
} catch {
|
|
@@ -200844,12 +200890,12 @@ function registerDelegatedChildTurn(liveChat, childSessionId, session, deps = {}
|
|
|
200844
200890
|
try {
|
|
200845
200891
|
ledger.finish(signal);
|
|
200846
200892
|
await ledger.drain();
|
|
200847
|
-
} catch (
|
|
200848
|
-
log3(`[delegation] \u5B50\u4F1A\u8BDD ${childSessionId} \u8D26\u672C\u6536\u5C3E\u5931\u8D25: ${String(
|
|
200893
|
+
} catch (err2) {
|
|
200894
|
+
log3(`[delegation] \u5B50\u4F1A\u8BDD ${childSessionId} \u8D26\u672C\u6536\u5C3E\u5931\u8D25: ${String(err2)}`);
|
|
200849
200895
|
}
|
|
200850
200896
|
ctrl.finish(signal === "completed" ? "done" : "error");
|
|
200851
200897
|
};
|
|
200852
|
-
void session.done.then(() => settle("completed"), () => settle("failed"));
|
|
200898
|
+
void session.done.then(() => settle("completed"), (err) => settle("failed", err));
|
|
200853
200899
|
}
|
|
200854
200900
|
var init_child_live_turn = __esm({
|
|
200855
200901
|
"../server/src/domains/delegations/child-live-turn.ts"() {
|
|
@@ -239393,6 +239439,25 @@ var init_escalation_opening = __esm({
|
|
|
239393
239439
|
}
|
|
239394
239440
|
});
|
|
239395
239441
|
|
|
239442
|
+
// ../server/src/domains/delegations/reply-anchors.ts
|
|
239443
|
+
function delegationReplyAnchors(record8) {
|
|
239444
|
+
const bySequence = /* @__PURE__ */ new Map();
|
|
239445
|
+
for (const summary of record8.roundSummaries) {
|
|
239446
|
+
const sequence = summary.settledSeq;
|
|
239447
|
+
if (typeof sequence !== "number" || !Number.isSafeInteger(sequence) || sequence < 1 || !Number.isSafeInteger(summary.round) || summary.round < 1) continue;
|
|
239448
|
+
const ids2 = bySequence.get(sequence) ?? /* @__PURE__ */ new Set();
|
|
239449
|
+
ids2.add(childRoundMessageIds(record8.childSessionId, summary.round).placeholderId);
|
|
239450
|
+
bySequence.set(sequence, ids2);
|
|
239451
|
+
}
|
|
239452
|
+
return [...bySequence].flatMap(([settledSeq, ids2]) => ids2.size === 1 ? [{ settledSeq, childMessageId: [...ids2][0] }] : []);
|
|
239453
|
+
}
|
|
239454
|
+
var init_reply_anchors = __esm({
|
|
239455
|
+
"../server/src/domains/delegations/reply-anchors.ts"() {
|
|
239456
|
+
"use strict";
|
|
239457
|
+
init_service3();
|
|
239458
|
+
}
|
|
239459
|
+
});
|
|
239460
|
+
|
|
239396
239461
|
// ../server/src/domains/chat-sessions/project-bundle.ts
|
|
239397
239462
|
async function buildChatProjectBundle(projectId2, projects, readBlob) {
|
|
239398
239463
|
const project = await projects.getProject(projectId2);
|
|
@@ -239492,7 +239557,11 @@ function mapChatItemToSnapshotEntry(row) {
|
|
|
239492
239557
|
ord: row.ord,
|
|
239493
239558
|
messageId: row.messageId,
|
|
239494
239559
|
updatedAt: row.updatedAt,
|
|
239495
|
-
payload:
|
|
239560
|
+
payload: {
|
|
239561
|
+
...row.payload && typeof row.payload === "object" && !Array.isArray(row.payload) ? row.payload : {},
|
|
239562
|
+
createdAt: row.createdAt,
|
|
239563
|
+
completedAt: row.completedAt
|
|
239564
|
+
}
|
|
239496
239565
|
};
|
|
239497
239566
|
}
|
|
239498
239567
|
function throwWorkdirError(code2) {
|
|
@@ -240014,6 +240083,7 @@ function createChatSessionsDomain(opts) {
|
|
|
240014
240083
|
/* 与协调者读口**同一个函数**——两侧 artifacts 有「逐字同源」的既有断言。它顺带给每份产物
|
|
240015
240084
|
填上 `childMessageId`(子会话面板把产出卡挂到产出它的那一轮下面要用)。 */
|
|
240016
240085
|
artifacts: delegationArtifactsView(record8),
|
|
240086
|
+
replyAnchors: delegationReplyAnchors(record8),
|
|
240017
240087
|
createdAt: record8.createdAt,
|
|
240018
240088
|
...record8.settledAt ? { settledAt: record8.settledAt } : {}
|
|
240019
240089
|
});
|
|
@@ -240401,6 +240471,7 @@ var init_chat_sessions2 = __esm({
|
|
|
240401
240471
|
init_workorders();
|
|
240402
240472
|
init_chat_parts();
|
|
240403
240473
|
init_service3();
|
|
240474
|
+
init_reply_anchors();
|
|
240404
240475
|
init_injected_context();
|
|
240405
240476
|
init_deletion();
|
|
240406
240477
|
init_chat_turn_gate();
|
|
@@ -263799,6 +263870,16 @@ function pickDecisionContent(d) {
|
|
|
263799
263870
|
|
|
263800
263871
|
// ../server/src/domains/discussions/context.ts
|
|
263801
263872
|
init_project_bundle();
|
|
263873
|
+
var decisionLabels = {
|
|
263874
|
+
proposed: "\u63D0\u8BAE\u4E2D",
|
|
263875
|
+
accepted: "\u5DF2\u786E\u8BA4",
|
|
263876
|
+
rejected: "\u5DF2\u5426\u51B3",
|
|
263877
|
+
superseded: "\u5DF2\u88AB\u66FF\u4EE3",
|
|
263878
|
+
withdrawn: "\u5DF2\u64A4\u9500"
|
|
263879
|
+
};
|
|
263880
|
+
function listField(label, items) {
|
|
263881
|
+
return items.length > 1 ? [`- ${label}\uFF1A`, ...items.map((item) => ` - ${item}`)] : [`- ${label}\uFF1A${items[0] ?? "\u65E0"}`];
|
|
263882
|
+
}
|
|
263802
263883
|
function renderDiscussionContext(input) {
|
|
263803
263884
|
const lines = [
|
|
263804
263885
|
"# \u5F53\u524D\u4F1A\u8BDD\u4E0A\u4E0B\u6587",
|
|
@@ -263819,44 +263900,37 @@ function renderDiscussionContext(input) {
|
|
|
263819
263900
|
if (!input.discussions.length) lines.push("\u5F53\u524D\u6682\u65E0\u5386\u53F2\u8BA8\u8BBA\u8BB0\u5F55\u3002", "");
|
|
263820
263901
|
for (const row of input.discussions) {
|
|
263821
263902
|
const d = row.value.record;
|
|
263903
|
+
const topicNames = d.topics.map((t) => input.topics.find((topic) => topic.value.projectId === d.project_id && topic.value.topicId === t.topic_id)?.value.title ?? "\u8BAE\u9898\u540D\u79F0\u7F3A\u5931");
|
|
263822
263904
|
lines.push(
|
|
263823
|
-
`### ${d.
|
|
263824
|
-
|
|
263825
|
-
`- \
|
|
263826
|
-
`- \
|
|
263827
|
-
`- \u6700\u540E\u8986\u76D6\u7684\u5BF9\u8BDD\u65F6\u95F4\uFF1A${row.value.discussedAt}`,
|
|
263828
|
-
`- \u6D88\u606F\u622A\u6B62\u70B9\uFF1A${d.source_cutoff}`,
|
|
263905
|
+
`### ${d.title}`,
|
|
263906
|
+
"",
|
|
263907
|
+
...!input.projectId ? [`- \u9879\u76EE\u5F52\u5C5E\uFF1A${d.project_id ?? "\u975E\u9879\u76EE\u8BA8\u8BBA"}`] : [],
|
|
263908
|
+
`- \u8BA8\u8BBA\u65E5\u671F\uFF1A${row.value.discussedAt.slice(0, 10)}`,
|
|
263829
263909
|
`- \u6458\u8981\uFF1A${d.summary}`,
|
|
263830
|
-
|
|
263831
|
-
...
|
|
263832
|
-
"
|
|
263833
|
-
...d.open_questions.map((q2) => ` - ${q2}`),
|
|
263834
|
-
"- \u4E0B\u4E00\u6B65\uFF1A",
|
|
263835
|
-
...d.next_steps.map((n) => ` - ${n}`),
|
|
263910
|
+
`- \u6D89\u53CA\u8BAE\u9898\uFF1A${topicNames.join("\u3001") || "\u65E0"}`,
|
|
263911
|
+
...listField("\u672A\u51B3\u95EE\u9898", d.open_questions),
|
|
263912
|
+
...listField("\u4E0B\u4E00\u6B65", d.next_steps),
|
|
263836
263913
|
""
|
|
263837
263914
|
);
|
|
263838
263915
|
}
|
|
263839
263916
|
if (input.projectId) {
|
|
263840
|
-
lines.push("## \u9879\u76EE\u8BAE\u9898\u4E0E\u51B3\u7B56", "", "\u4EC5
|
|
263917
|
+
lines.push("## \u9879\u76EE\u8BAE\u9898\u4E0E\u51B3\u7B56", "", "\u4EC5\u201C\u5DF2\u786E\u8BA4\u201D\u8868\u793A\u5DF2\u786E\u8BA4\u65B9\u6848\uFF1B\u201C\u63D0\u8BAE\u4E2D\u201D\u5C1A\u672A\u786E\u8BA4\uFF1B\u201C\u5DF2\u5426\u51B3\u201D\u201C\u5DF2\u64A4\u9500\u201D\u201C\u5DF2\u88AB\u66FF\u4EE3\u201D\u4E3A\u5931\u6548\u6216\u5386\u53F2\u65B9\u6848\u3002", "");
|
|
263841
263918
|
if (!input.topics.length) lines.push("\u5F53\u524D\u6682\u65E0\u9879\u76EE\u8BAE\u9898\u4E0E\u51B3\u7B56\u3002", "");
|
|
263842
263919
|
for (const t of input.topics) {
|
|
263843
|
-
lines.push(`###
|
|
263920
|
+
lines.push(`### \u8BAE\u9898\uFF1A${t.value.title}`, "");
|
|
263844
263921
|
const decisions = input.decisions.filter((d) => d.value.topicId === t.value.topicId);
|
|
263845
263922
|
if (!decisions.length) lines.push("\u6682\u65E0\u51B3\u7B56\u3002", "");
|
|
263846
|
-
for (const d of decisions) {
|
|
263923
|
+
for (const [index2, d] of decisions.entries()) {
|
|
263847
263924
|
const r = d.value.record;
|
|
263848
263925
|
lines.push(
|
|
263849
|
-
`#### ${
|
|
263850
|
-
|
|
263851
|
-
`- \
|
|
263852
|
-
`- \u539F\u56E0\uFF1A${r.rationale}`,
|
|
263926
|
+
`#### \u51B3\u7B56 ${index2 + 1}\uFF1A${r.statement}`,
|
|
263927
|
+
"",
|
|
263928
|
+
`- \u72B6\u6001\uFF1A${decisionLabels[r.state]}`,
|
|
263929
|
+
`- \u539F\u56E0\uFF1A${r.rationale || "\u672A\u8BF4\u660E"}`,
|
|
263853
263930
|
`- \u786E\u8BA4\u4EBA\uFF1A${r.confirmer ?? "\u672A\u786E\u8BA4"}`,
|
|
263854
|
-
"
|
|
263855
|
-
...r.
|
|
263856
|
-
|
|
263857
|
-
...r.source_refs.map((s2) => ` - ${s2.session_id} / ${s2.message_id}\uFF1A${JSON.stringify(s2.content)}`),
|
|
263858
|
-
`- \u66FF\u4EE3\u5173\u7CFB\uFF1A${r.supersedes.join("\u3001") || "\u65E0"}`,
|
|
263859
|
-
`- \u6700\u8FD1\u66F4\u65B0\u65F6\u95F4\uFF1A${r.updated_at}`,
|
|
263931
|
+
...listField("\u5907\u9009\u65B9\u6848", r.alternatives.map((a) => `${a.statement}\uFF0C${a.reason || "\u672A\u8BF4\u660E\u539F\u56E0"}`)),
|
|
263932
|
+
...r.supersedes.length ? listField("\u66FF\u4EE3\u51B3\u7B56", r.supersedes.map((id) => input.decisions.find((other) => other.value.decisionId === id)?.value.record.statement ?? "\u672A\u627E\u5230\u5BF9\u5E94\u51B3\u7B56")) : [],
|
|
263933
|
+
`- \u66F4\u65B0\u65F6\u95F4\uFF1A${r.updated_at.slice(0, 10)}`,
|
|
263860
263934
|
""
|
|
263861
263935
|
);
|
|
263862
263936
|
}
|
|
@@ -263889,7 +263963,12 @@ var DiscussionContext = class {
|
|
|
263889
263963
|
let discussions = (await tx.list("discussion")).filter((r) => r.value.userId === session.humanActorId);
|
|
263890
263964
|
discussions.sort((a, b2) => Date.parse(a.value.discussedAt) - Date.parse(b2.value.discussedAt) || a.id.localeCompare(b2.id));
|
|
263891
263965
|
discussions = projectId2 ? discussions.filter((r) => r.value.record.project_id === projectId2) : discussions.slice(-10);
|
|
263892
|
-
const
|
|
263966
|
+
const discussionProjects = new Set(discussions.map((d) => d.value.record.project_id));
|
|
263967
|
+
const view = projectId2 ? await this.service.view(projectId2, tx) : {
|
|
263968
|
+
// Resolve names for the selected personal history without loading project decisions.
|
|
263969
|
+
topics: (await tx.list("topic")).filter((t) => discussionProjects.has(t.value.projectId)),
|
|
263970
|
+
decisions: []
|
|
263971
|
+
};
|
|
263893
263972
|
const markdown = renderDiscussionContext({
|
|
263894
263973
|
userName,
|
|
263895
263974
|
projectId: projectId2,
|
|
@@ -264567,6 +264646,15 @@ function transcriptTail(ref2) {
|
|
|
264567
264646
|
return "";
|
|
264568
264647
|
}
|
|
264569
264648
|
}
|
|
264649
|
+
var SUMMARY_MAX_CHARS = 500;
|
|
264650
|
+
function clipLine(line) {
|
|
264651
|
+
return line.length > SUMMARY_MAX_CHARS ? `${line.slice(0, SUMMARY_MAX_CHARS)}\u2026` : line;
|
|
264652
|
+
}
|
|
264653
|
+
function providerMessage(line) {
|
|
264654
|
+
const m2 = /['"]message['"]\s*:\s*(?:'((?:[^'\\]|\\.)*)'|"((?:[^"\\]|\\.)*)")/.exec(line);
|
|
264655
|
+
const text6 = (m2?.[1] ?? m2?.[2])?.trim();
|
|
264656
|
+
return text6 ? text6 : void 0;
|
|
264657
|
+
}
|
|
264570
264658
|
function buildChatExitError(info) {
|
|
264571
264659
|
const genericLine = `runtime exited with code ${info.code ?? "null"}${info.reason ? ` (${info.reason})` : ""}`;
|
|
264572
264660
|
let detail = "";
|
|
@@ -264576,8 +264664,9 @@ function buildChatExitError(info) {
|
|
|
264576
264664
|
}
|
|
264577
264665
|
const firstDetailLine = detail.split("\n").map((line) => line.trim()).find(Boolean) ?? "";
|
|
264578
264666
|
const firstErrorLine = info.errorMessage?.split("\n").map((line) => line.trim()).find(Boolean) ?? "";
|
|
264667
|
+
const readableError = firstErrorLine ? clipLine(providerMessage(firstErrorLine) ?? firstErrorLine) : "";
|
|
264579
264668
|
const fixed = info.reason ? SUMMARY_BY_REASON[info.reason] : void 0;
|
|
264580
|
-
const summary = fixed ?
|
|
264669
|
+
const summary = fixed ? readableError && info.reason !== "cancelled" && info.reason !== "timeout" ? `${fixed}\uFF1A${readableError}` : fixed : readableError ? `\u5BF9\u8BDD\u5931\u8D25\uFF1A${readableError}` : firstDetailLine ? `\u5BF9\u8BDD\u5931\u8D25\uFF1A${clipLine(firstDetailLine)}` : `\u5BF9\u8BDD\u5931\u8D25\uFF08${genericLine}\uFF09`;
|
|
264581
264670
|
const chatExit = {
|
|
264582
264671
|
...info.reason ? { reason: info.reason } : {},
|
|
264583
264672
|
summary,
|
|
@@ -279036,7 +279125,7 @@ function shimScript() {
|
|
|
279036
279125
|
}
|
|
279037
279126
|
|
|
279038
279127
|
// src/index.ts
|
|
279039
|
-
var PKG_VERSION = true ? "2.2.
|
|
279128
|
+
var PKG_VERSION = true ? "2.2.48" : "dev";
|
|
279040
279129
|
var LOCAL_BIN = localBin();
|
|
279041
279130
|
var NPM_PREFIX = npmPrefix();
|
|
279042
279131
|
var INSTANCE = DEFAULT_INSTANCE;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oasis_test_v2",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.48",
|
|
4
4
|
"description": "Oasis node daemon + CLI — background daemon, auto-start, full server CLI",
|
|
5
5
|
"bin": {
|
|
6
6
|
"oasis": "./dist/index.js"
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"node": ">=20"
|
|
27
27
|
},
|
|
28
28
|
"oasisRelease": {
|
|
29
|
-
"sourceHead": "
|
|
29
|
+
"sourceHead": "e73f3d47b4a699e20634f714e27dd2dd31e4082c"
|
|
30
30
|
}
|
|
31
31
|
}
|