oasis_test_v2 2.2.8 → 2.2.9

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.
Files changed (2) hide show
  1. package/dist/index.js +162 -42
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -665,7 +665,7 @@ function isAgentAvatarPresetRef(ref2) {
665
665
  const id = ref2.slice(AGENT_AVATAR_PRESET_PREFIX.length);
666
666
  return AGENT_AVATAR_PRESET_IDS.includes(id);
667
667
  }
668
- var AGENT_AVATAR_PRESET_PREFIX, AGENT_AVATAR_LEGACY_PRESET_IDS, AGENT_AVATAR_V2_PRESET_IDS, AGENT_AVATAR_PRESET_IDS;
668
+ var AGENT_AVATAR_PRESET_PREFIX, AGENT_AVATAR_LEGACY_PRESET_IDS, AGENT_AVATAR_V2_PRESET_IDS, AGENT_AVATAR_PRESET_IDS, SYSTEM_AVATAR_REF;
669
669
  var init_avatar = __esm({
670
670
  "../contract/src/avatar.ts"() {
671
671
  "use strict";
@@ -695,6 +695,7 @@ var init_avatar = __esm({
695
695
  ...AGENT_AVATAR_LEGACY_PRESET_IDS,
696
696
  ...AGENT_AVATAR_V2_PRESET_IDS
697
697
  ];
698
+ SYSTEM_AVATAR_REF = "preset:system";
698
699
  }
699
700
  });
700
701
 
@@ -910,10 +911,15 @@ var init_link_windows = __esm({
910
911
  });
911
912
 
912
913
  // ../contract/src/registry.ts
913
- var AGENT_PREFS_DEFAULTS, SkillOwnedByAnotherCompanyError;
914
+ function isSystemActorId(id) {
915
+ return typeof id === "string" && id.startsWith(SYSTEM_ACTOR_ID_PREFIX);
916
+ }
917
+ var SYSTEM_ACTOR_ID_PREFIX, SYSTEM_ACTOR_DISPLAY_NAME, AGENT_PREFS_DEFAULTS, SkillOwnedByAnotherCompanyError;
914
918
  var init_registry = __esm({
915
919
  "../contract/src/registry.ts"() {
916
920
  "use strict";
921
+ SYSTEM_ACTOR_ID_PREFIX = "actor:system";
922
+ SYSTEM_ACTOR_DISPLAY_NAME = "\u7CFB\u7EDF";
917
923
  AGENT_PREFS_DEFAULTS = { memoryEnabled: true };
918
924
  SkillOwnedByAnotherCompanyError = class extends Error {
919
925
  constructor(skillId, companyId) {
@@ -29523,7 +29529,7 @@ async function sweepStaleChatTurns(deps) {
29523
29529
  `[chat-turn-sweep] \u8F6E\u6B21 ${turn.id}\uFF08\u4F1A\u8BDD ${turn.chatSessionId}\uFF09\u6536\u53E3\u4E3A ${outcome.status}\uFF08${outcome.reason}\uFF09\uFF0C\u4F1A\u8BDD\u69FD\u5DF2\u91CA\u653E`
29524
29530
  );
29525
29531
  const settledStatus = outcome.settled ? outcome.status : void 0;
29526
- if (deps.onTurnSettled && settledStatus && settledStatus !== "succeeded") {
29532
+ if (deps.onTurnSettled && settledStatus) {
29527
29533
  await deps.onTurnSettled({
29528
29534
  chatSessionId: turn.chatSessionId,
29529
29535
  turnId: turn.id,
@@ -162347,6 +162353,17 @@ var init_planner = __esm({
162347
162353
  });
162348
162354
 
162349
162355
  // ../server/src/domains/collab/workorders.ts
162356
+ function systemActorFallback(id) {
162357
+ return isSystemActorId(id) ? { name: SYSTEM_ACTOR_DISPLAY_NAME, avatar: SYSTEM_AVATAR_REF } : void 0;
162358
+ }
162359
+ function actorRefFieldsOf(a) {
162360
+ const avatar = a.avatar ?? (a.kind === "system" ? SYSTEM_AVATAR_REF : void 0);
162361
+ return {
162362
+ name: a.name,
162363
+ ...a.roles[0] ? { role: a.roles[0] } : {},
162364
+ ...avatar ? { avatar } : {}
162365
+ };
162366
+ }
162350
162367
  function overviewRootIdOf(arts) {
162351
162368
  const roots = arts.filter((a) => a.inputs.length === 0);
162352
162369
  if (roots.length <= 1) return roots[0]?.id;
@@ -162607,6 +162624,7 @@ var init_workorders = __esm({
162607
162624
  "../server/src/domains/collab/workorders.ts"() {
162608
162625
  "use strict";
162609
162626
  init_src5();
162627
+ init_src();
162610
162628
  init_node_state();
162611
162629
  init_planner();
162612
162630
  init_workorder_detail();
@@ -196005,11 +196023,12 @@ var init_service3 = __esm({
196005
196023
  );
196006
196024
  }
196007
196025
  }
196008
- async settleFromSweep(childSessionId, reason, companyId) {
196026
+ async settleFromSweep(childSessionId, reason, companyId, opts) {
196009
196027
  const store = await this.options.resolveStore(companyId).catch(() => null);
196010
196028
  if (!store) return null;
196011
196029
  const record8 = await store.getByChildSession(childSessionId).catch(() => null);
196012
196030
  if (!record8 || record8.state !== "running") return record8;
196031
+ if (opts?.outcome === "succeeded") return this.settleSucceededFromSweep(record8, companyId);
196013
196032
  const at = this.now();
196014
196033
  const settledSeqAtRound = record8.settledSeq + 1;
196015
196034
  const newSummary = {
@@ -196029,6 +196048,58 @@ var init_service3 = __esm({
196029
196048
  if (settled) await this.notifySettled(settled, companyId);
196030
196049
  return settled;
196031
196050
  }
196051
+ /**
196052
+ * 清扫拍把这一轮收成 **succeeded** 时的收口(2026-09-10 生产实测的那个洞)。
196053
+ *
196054
+ * 什么时候会走到这里:`settleRound` 是**派发那一刻建的闭包**,serve 一重启它就随老进程消失,
196055
+ * 这一轮改由 `chat-recovery` 重挂、跑完、把 assistant 行写成 done;随后清扫拍按「行已终态」
196056
+ * 把轮次收成 succeeded。此前这一支不外报,于是**没有任何人**去记这一轮、判终态、通知父会话、
196057
+ * 把产物搬回主会话工作区——专家干完了,页面上却永远转圈。
196058
+ * 现场:委派 e6196ab7 第 6 轮 04:02 写完 `outputs/org-collaboration-relationship.md` 并收尾,
196059
+ * 轮次 04:03:30 succeeded,台账仍是 `running`/5 轮、`settled_at` 空。
196060
+ *
196061
+ * 与失败那一支的差别只有三处,其余(追加式记账、`settledSeq`、唯一出口 `notifySettled`)逐字相同:
196062
+ * ① 摘要正文取**子会话这一轮真正的回答**,不是「被时钟闭合」那句;
196063
+ * ② 收成 `done`,不带 `failureKind`,`consecutiveFails` 归零;
196064
+ * ③ 多一道幂等闸,见下。
196065
+ *
196066
+ * **幂等闸**:`roundSummaries.length > dispatchSeq` 就说明这一轮 `settleRound` 已经记过了
196067
+ * (第 N 轮用的是 `dispatchSeq = N-1`),直接收手。没有它,「本进程没重启、`settleRound`
196068
+ * 正在后台跑收尾」与这一拍撞车时会把同一轮记两遍——这正是这一支原先被整个关掉的理由,
196069
+ * 现在用一道显式的闸换掉那个一刀切。
196070
+ */
196071
+ async settleSucceededFromSweep(record8, companyId) {
196072
+ const store = await this.options.resolveStore(companyId).catch(() => null);
196073
+ if (!store) return record8;
196074
+ const roundsRecorded = record8.roundSummaries.length;
196075
+ const thisRound = (record8.dispatchSeq ?? 0) + 1;
196076
+ if (roundsRecorded >= thisRound) return record8;
196077
+ const at = this.now();
196078
+ const text5 = await this.readChildRoundAnswer(record8, thisRound, companyId);
196079
+ const settledSeqAtRound = record8.settledSeq + 1;
196080
+ const newSummary = {
196081
+ round: (record8.roundSummaries[record8.roundSummaries.length - 1]?.round ?? 0) + 1,
196082
+ text: text5 || "\u8FD9\u4E00\u8F6E\u5DF2\u5B8C\u6210\uFF08\u6536\u5C3E\u65F6\u6B63\u6587\u6CA1\u8BFB\u5230\uFF0C\u4EA7\u7269\u4EE5\u5DE5\u4F5C\u533A\u91CC\u7684\u6587\u4EF6\u4E3A\u51C6\uFF09\u3002",
196083
+ at,
196084
+ settledSeq: settledSeqAtRound
196085
+ };
196086
+ const settled = await store.appendRoundSummary(record8.id, newSummary, {
196087
+ state: "done",
196088
+ consecutiveFails: 0,
196089
+ settledSeq: settledSeqAtRound,
196090
+ settledAt: at
196091
+ }).catch(() => null);
196092
+ if (settled) await this.notifySettled(settled, companyId);
196093
+ return settled;
196094
+ }
196095
+ /** 子会话第 `round` 轮那条回答行的正文(`childRoundMessageIds` 是唯一的 id 口径)。 */
196096
+ async readChildRoundAnswer(record8, round, companyId) {
196097
+ const chatStore = await this.options.resolveChatSessions(companyId).catch(() => null);
196098
+ if (!chatStore?.listMessages) return "";
196099
+ const { placeholderId } = childRoundMessageIds(record8.childSessionId, round);
196100
+ const messages = await chatStore.listMessages(record8.childSessionId).catch(() => []);
196101
+ return (messages.find((m2) => m2.id === placeholderId)?.content ?? "").trim();
196102
+ }
196032
196103
  /**
196033
196104
  * 队列里还有话没送到专家眼前 → 起下一轮,**把队列内容拼进 message**(§6.2.1 第二条路径)。
196034
196105
  *
@@ -201851,7 +201922,7 @@ async function draftActorResolver(registry2) {
201851
201922
  const byId = new Map(actors.map((a) => [a.id, a]));
201852
201923
  return (id) => {
201853
201924
  const a = byId.get(id);
201854
- return a ? { name: a.name, ...a.roles[0] ? { role: a.roles[0] } : {}, ...a.avatar ? { avatar: a.avatar } : {} } : void 0;
201925
+ return a ? actorRefFieldsOf(a) : systemActorFallback(id);
201855
201926
  };
201856
201927
  }
201857
201928
  async function draftRoleStaffingResolver(registry2) {
@@ -207078,7 +207149,16 @@ ${composed}`;
207078
207149
  body: JSON.stringify({ client_id: GH_CLIENT_ID, scope: "repo,read:user,read:org" })
207079
207150
  });
207080
207151
  const d = await dr.json();
207081
- send({ type: "code", code: d.user_code, url: d.verification_uri });
207152
+ const verifyUrl = (() => {
207153
+ try {
207154
+ const u = new URL(d.verification_uri);
207155
+ u.searchParams.set("user_code", d.user_code);
207156
+ return u.toString();
207157
+ } catch {
207158
+ return d.verification_uri;
207159
+ }
207160
+ })();
207161
+ send({ type: "code", code: d.user_code, url: verifyUrl });
207082
207162
  const deadline = Date.now() + d.expires_in * 1e3;
207083
207163
  while (!closed && Date.now() < deadline) {
207084
207164
  await new Promise((r) => setTimeout(r, d.interval * 1e3));
@@ -207193,7 +207273,7 @@ ${composed}`;
207193
207273
  * **接进既有那一拍,不新写一套扫描**——新写的那套迟早和既有判据漂移。
207194
207274
  * 委派域没装配时返回 null,调用方照常。
207195
207275
  */
207196
- settleDelegationFromSweep: (childSessionId, reason, companyId) => delegationService?.settleFromSweep(childSessionId, reason, companyId) ?? Promise.resolve(null),
207276
+ settleDelegationFromSweep: (childSessionId, reason, companyId, opts2) => delegationService?.settleFromSweep(childSessionId, reason, companyId, opts2) ?? Promise.resolve(null),
207197
207277
  close: async () => {
207198
207278
  if (broadcastTimer) clearInterval(broadcastTimer);
207199
207279
  if (pendingSystemNoticesRecoveryTimer) clearInterval(pendingSystemNoticesRecoveryTimer);
@@ -226529,12 +226609,16 @@ function buildWorkorderActivity(input) {
226529
226609
  const reasonKinds = new Set(reasons.map((r) => String(r.kind)));
226530
226610
  const executorId = w2?.assigneeActorId ?? rec.actorId;
226531
226611
  if (isPendingActor(executorId)) break;
226532
- const status = reasonKinds.has("rework") ? ACTIVITY_COPY.reworking(nodeName(nodeId)) : reasonKinds.has("resumed") ? ACTIVITY_COPY.resumed(nameOf(executorId), nodeName(nodeId)) : reasonKinds.has("spec_changed") ? ACTIVITY_COPY.specChanged(nodeName(nodeId)) : reasonKinds.has("issue") ? ACTIVITY_COPY.issueDriven(nodeName(nodeId)) : ACTIVITY_COPY.working(nodeName(nodeId));
226533
- const drivingIssueId = str4(reasons.find((r) => r.kind === "issue")?.issueId);
226534
- if (drivingIssueId) {
226535
- workOfIssue.set(drivingIssueId, workId);
226536
- const ic = plainCommentIssueIds.has(drivingIssueId) ? issueCards.get(drivingIssueId) : void 0;
226537
- const commentAuthor = issueById.get(drivingIssueId)?.authorActorId;
226612
+ const forcedBy = str4(reasons.find((r) => r.kind === "forced")?.actorId);
226613
+ const gapDriven = reasons.some((r) => r.kind === "issue" && r.issueKind === "gap");
226614
+ const status = reasonKinds.has("rework") ? ACTIVITY_COPY.reworking(nodeName(nodeId)) : reasonKinds.has("resumed") ? ACTIVITY_COPY.resumed(nameOf(executorId), nodeName(nodeId)) : reasonKinds.has("spec_changed") ? ACTIVITY_COPY.specChanged(nodeName(nodeId)) : gapDriven ? ACTIVITY_COPY.gapReworked(nameOf(executorId), nodeName(nodeId)) : reasonKinds.has("issue") ? ACTIVITY_COPY.issueDriven(nodeName(nodeId)) : forcedBy ? ACTIVITY_COPY.forcedRerun(nameOf(forcedBy), nodeName(nodeId)) : ACTIVITY_COPY.working(nodeName(nodeId));
226615
+ for (const r of reasons) {
226616
+ if (r.kind !== "issue") continue;
226617
+ const issueId = str4(r.issueId);
226618
+ if (!issueId) continue;
226619
+ workOfIssue.set(issueId, workId);
226620
+ const ic = plainCommentIssueIds.has(issueId) ? issueCards.get(issueId) : void 0;
226621
+ const commentAuthor = issueById.get(issueId)?.authorActorId;
226538
226622
  if (ic && commentAuthor) {
226539
226623
  touch(ic, rec);
226540
226624
  ic.executorId = executorId;
@@ -227091,6 +227175,22 @@ var init_activity2 = __esm({
227091
227175
  reworking: (node2) => `\u6B63\u5728\u6839\u636E\u5BA1\u6838\u4E0D\u901A\u8FC7\u539F\u56E0\u4FEE\u6539\u300A${node2}\u300B\u3002`,
227092
227176
  specChanged: (node2) => `\u6B63\u5728\u6839\u636E\u4EFB\u52A1\u8BF4\u660E\u7684\u66F4\u65B0\u8C03\u6574\u300A${node2}\u300B\u3002`,
227093
227177
  issueDriven: (node2) => `\u6B63\u5728\u6839\u636E\u53CD\u9988\u8C03\u6574\u300A${node2}\u300B\u3002`,
227178
+ /**
227179
+ * 缺口解开后**带着答复重开工**的那一轮(`reasons` 里有 `{kind:"issue", issueKind:"gap"}`)。
227180
+ *
227181
+ * 与 {@link issueDriven} 分开:那句说的是「按反馈调整」,而这一轮的事实是**卡点解除、重新开始**
227182
+ * ——中断链上最该看清的一拍。此前两者共用一句,恢复后的那一轮被说回泛泛的「正在根据反馈调整」。
227183
+ * 实测 next 213 次 / 23 单、v2 4 次,最近一次 2026-09-09(`issue` 里第二多的一档)。
227184
+ */
227185
+ gapReworked: (executor, node2) => `\u7F3A\u53E3\u5DF2\u89E3\u51B3\uFF0C${executor} \u5E26\u7740\u7B54\u590D\u91CD\u65B0\u5F00\u5DE5\u300A${node2}\u300B\u3002`,
227186
+ /**
227187
+ * 人点了 UI 的「重新运行」(`kernel-bridge.rerunNode`,ADR 0137)——`reasons` 里那条
227188
+ * `{kind:"forced", actorId}` 就是点的人。
227189
+ *
227190
+ * 此前没有自己的文案、落到 `working` 说成「正在处理《X》。」,**页面上完全看不出这一轮是
227191
+ * 有人手动强推的**。实测两条生产线合计 80 次(next 73 / v2 7,最近一次 2026-09-09)。
227192
+ */
227193
+ forcedRerun: (by, node2) => `${by} \u91CD\u65B0\u8FD0\u884C\u4E86\u300A${node2}\u300B\u3002`,
227094
227194
  /* 自动判定的那一刻**只说事实,不断言谁介入了**。
227095
227195
  `work.timeout` 由引擎发(`engine/activate.ts` 与 `server/run-settlement.ts`),失败后的重试
227096
227196
  也是引擎做的(`activate.ts` 的 `tryToRun`)——管理者根本不知道这两件事,此前却写成
@@ -228289,6 +228389,21 @@ function nodeIdOfWorkId(workId) {
228289
228389
  const nodeId = body2.slice(0, cut);
228290
228390
  return nodeId.startsWith("artifact:") ? nodeId : null;
228291
228391
  }
228392
+ function nodeIdOfIssueId(issueId, model) {
228393
+ if (!issueId) return null;
228394
+ const anchored = model.annotations.get(issueId)?.anchor.target;
228395
+ if (anchored) {
228396
+ if (anchored.startsWith("artifact:")) return anchored;
228397
+ const fromWork = nodeIdOfWorkId(anchored);
228398
+ if (fromWork) return fromWork;
228399
+ }
228400
+ const body2 = issueId.replace(/^(?:ann:rework:)?(?:gap:|esc:|ann:)/, "");
228401
+ if (!body2.startsWith("artifact:")) return null;
228402
+ const cut = body2.lastIndexOf(":");
228403
+ if (cut <= 0) return null;
228404
+ const nodeId = body2.slice(0, cut);
228405
+ return nodeId.startsWith("artifact:") ? nodeId : null;
228406
+ }
228292
228407
  function eventToAuditEntry(rec) {
228293
228408
  const ev = rec.event;
228294
228409
  const artifactId = rec.nodeId ?? nodeIdOfWorkId(rec.workId) ?? "";
@@ -228301,20 +228416,25 @@ function eventToAuditEntry(rec) {
228301
228416
  summary: `${KIND_LABEL2[ev.kind] ?? ev.kind}${artifactId ? ` \xB7 ${artifactId}` : ""}`
228302
228417
  };
228303
228418
  }
228304
- function enrichAudit(entry, model, titleOf, workorderId) {
228305
- if (!entry.artifactId) {
228306
- const workspaceTitle2 = workorderId ? titleOf.get(workorderId) : void 0;
228307
- return { ...entry, ...workspaceTitle2 ? { workspaceTitle: workspaceTitle2 } : {}, visibility: "ok" };
228308
- }
228309
- const a = model.artifacts.get(entry.artifactId);
228310
- if (!a) return { ...entry, visibility: "deleted" };
228311
- const workspaceTitle = titleOf.get(a.workspace);
228312
- return {
228313
- ...entry,
228314
- nodeName: nodeLabel(a),
228315
- ...workspaceTitle ? { workspaceTitle } : {},
228316
- visibility: "ok"
228419
+ function auditAnchorsOf(rec) {
228420
+ const issueId = rec.event.issueId;
228421
+ return { workorderId: rec.workorderId, ...typeof issueId === "string" && issueId ? { issueId } : {} };
228422
+ }
228423
+ function enrichAudit(entry, model, titleOf, anchors = {}) {
228424
+ const withNode = (id, a) => {
228425
+ const workspaceTitle2 = titleOf.get(a.workspace);
228426
+ return { ...entry, artifactId: id, nodeName: nodeLabel(a), ...workspaceTitle2 ? { workspaceTitle: workspaceTitle2 } : {}, visibility: "ok" };
228317
228427
  };
228428
+ if (entry.artifactId) {
228429
+ const a = model.artifacts.get(entry.artifactId);
228430
+ if (!a) return { ...entry, visibility: "deleted" };
228431
+ return withNode(entry.artifactId, a);
228432
+ }
228433
+ const viaIssue = nodeIdOfIssueId(anchors.issueId, model);
228434
+ const viaIssueArtifact = viaIssue ? model.artifacts.get(viaIssue) : void 0;
228435
+ if (viaIssue && viaIssueArtifact) return withNode(viaIssue, viaIssueArtifact);
228436
+ const workspaceTitle = anchors.workorderId ? titleOf.get(anchors.workorderId) : void 0;
228437
+ return { ...entry, ...workspaceTitle ? { workspaceTitle } : {}, visibility: "ok" };
228318
228438
  }
228319
228439
  async function buildAudit(source, q2 = {}, model) {
228320
228440
  const limit = Math.min(Math.max(q2.limit ?? 100, 1), 500);
@@ -228323,8 +228443,8 @@ async function buildAudit(source, q2 = {}, model) {
228323
228443
  const items = [];
228324
228444
  let lastCursor = null;
228325
228445
  let truncated = false;
228326
- const push2 = (entry, cursor, workorderId) => {
228327
- items.push(model && titleOf ? enrichAudit(entry, model, titleOf, workorderId) : entry);
228446
+ const push2 = (entry, cursor, anchors) => {
228447
+ items.push(model && titleOf ? enrichAudit(entry, model, titleOf, anchors) : entry);
228328
228448
  lastCursor = cursor;
228329
228449
  };
228330
228450
  const match = (actor, kind, at) => {
@@ -228341,7 +228461,7 @@ async function buildAudit(source, q2 = {}, model) {
228341
228461
  for (const rec of records) {
228342
228462
  const ev = rec.event;
228343
228463
  if (!match(rec.actorId, ev.kind, rec.createdAt)) continue;
228344
- collected.push({ entry: eventToAuditEntry(rec), workorderId: rec.workorderId });
228464
+ collected.push({ entry: eventToAuditEntry(rec), anchors: auditAnchorsOf(rec) });
228345
228465
  }
228346
228466
  } else if (source.oplog) {
228347
228467
  const src = source.oplog.readFilteredOps ? source.oplog.readFilteredOps({ ...q2.actor ? { actor: q2.actor } : {}, ...q2.kind ? { kind: q2.kind } : {} }, void 0, { latest: true }) : source.oplog.readAll();
@@ -228352,7 +228472,7 @@ async function buildAudit(source, q2 = {}, model) {
228352
228472
  }
228353
228473
  const tail = collected.slice(-limit).reverse();
228354
228474
  return {
228355
- items: model && titleOf ? tail.map(({ entry, workorderId }) => enrichAudit(entry, model, titleOf, workorderId)) : tail.map(({ entry }) => entry),
228475
+ items: model && titleOf ? tail.map(({ entry, anchors }) => enrichAudit(entry, model, titleOf, anchors)) : tail.map(({ entry }) => entry),
228356
228476
  cursor: null
228357
228477
  };
228358
228478
  }
@@ -228361,7 +228481,7 @@ async function buildAudit(source, q2 = {}, model) {
228361
228481
  for (const rec of records) {
228362
228482
  const ev = rec.event;
228363
228483
  if (!match(rec.actorId, ev.kind, rec.createdAt)) continue;
228364
- push2(eventToAuditEntry(rec), String(rec.seq), rec.workorderId);
228484
+ push2(eventToAuditEntry(rec), String(rec.seq), auditAnchorsOf(rec));
228365
228485
  if (items.length >= limit) {
228366
228486
  truncated = true;
228367
228487
  break;
@@ -229249,11 +229369,7 @@ async function buildResolver(registry2) {
229249
229369
  const byId = new Map(actors.map((a) => [a.id, a]));
229250
229370
  return (id) => {
229251
229371
  const a = byId.get(id);
229252
- return a ? {
229253
- name: a.name,
229254
- ...a.roles[0] ? { role: a.roles[0] } : {},
229255
- ...a.avatar ? { avatar: a.avatar } : {}
229256
- } : void 0;
229372
+ return a ? actorRefFieldsOf(a) : systemActorFallback(id);
229257
229373
  };
229258
229374
  }
229259
229375
  async function buildProjectResolver(artifacts) {
@@ -233830,7 +233946,7 @@ function createChatSessionsDomain(opts) {
233830
233946
  const byId = new Map(actors.map((a) => [a.id, a]));
233831
233947
  const resolver2 = (id) => {
233832
233948
  const a = byId.get(id);
233833
- return a ? { name: a.name } : void 0;
233949
+ return a ? { name: a.name } : systemActorFallback(id);
233834
233950
  };
233835
233951
  const allSummaries = buildWorkorderSummaries(wkKernel.model, resolver2, (wo) => byWo.get(wo) ?? null, (wo) => held.has(wo), void 0, void 0, (role) => wkKernel.actorForRole(role));
233836
233952
  const summaryById = new Map(allSummaries.map((s2) => [s2.id, s2]));
@@ -256333,6 +256449,7 @@ var init_src11 = __esm({
256333
256449
  init_node_store();
256334
256450
  init_tokens();
256335
256451
  init_collab();
256452
+ init_workorders();
256336
256453
  init_collab();
256337
256454
  init_closure_report();
256338
256455
  init_workorders();
@@ -258049,7 +258166,8 @@ async function startServe(opts) {
258049
258166
  kernel: defaultCompanyKernel,
258050
258167
  // B2:读路径走 oplog 派生投影——同一 oplog 写后重放重建
258051
258168
  oplog,
258052
- actorNames: { resolve: (actorId) => registryActorNames.get(actorId) },
258169
+ // 系统身份(`actor:system*`)不在名册里,缓存必然打空——补同一份展示名,别让它退成裸 id。
258170
+ actorNames: { resolve: (actorId) => registryActorNames.get(actorId) ?? systemActorFallback(actorId)?.name },
258053
258171
  blobs,
258054
258172
  // 项目普通文件上传入 blob 库
258055
258173
  actorDirectory: registryStore,
@@ -258085,7 +258203,7 @@ async function startServe(opts) {
258085
258203
  ...engine2.blobs ? { blobs: engine2.blobs } : {},
258086
258204
  actorDirectory: companyRegistry,
258087
258205
  actorNames: {
258088
- resolve: (actorId) => perCompanyActorNames.get(companyId)?.get(actorId)
258206
+ resolve: (actorId) => perCompanyActorNames.get(companyId)?.get(actorId) ?? systemActorFallback(actorId)?.name
258089
258207
  },
258090
258208
  resolveActorContext: async (actorId) => {
258091
258209
  const config2 = await companyRegistry.latestConfig(actorId).catch(() => null);
@@ -258146,7 +258264,8 @@ async function startServe(opts) {
258146
258264
  ops: [],
258147
258265
  nodeOutputs: persisted.nodeOutputs,
258148
258266
  workspaceBindings: persisted.workspaceBindings,
258149
- actorNames: { resolve: (actorId) => registryActorNames.get(actorId) }
258267
+ // 系统身份(`actor:system*`)不在名册里,缓存必然打空——补同一份展示名,别让它退成裸 id。
258268
+ actorNames: { resolve: (actorId) => registryActorNames.get(actorId) ?? systemActorFallback(actorId)?.name }
258150
258269
  });
258151
258270
  };
258152
258271
  const traceDsn = process.env["OASIS_TRACE_PG_DSN"] ?? pgDsn;
@@ -261209,7 +261328,8 @@ async function startServe(opts) {
261209
261328
  await server.settleDelegationFromSweep(
261210
261329
  chatSessionId,
261211
261330
  `\u5B50\u4F1A\u8BDD\u8FD9\u4E00\u8F6E\u88AB\u6062\u590D\u5668\u6536\u53E3\u4E3A ${status}\uFF08${reason}\uFF09`,
261212
- companyId
261331
+ companyId,
261332
+ { outcome: status === "succeeded" ? "succeeded" : "failed" }
261213
261333
  );
261214
261334
  },
261215
261335
  log: (m2) => console.log(m2),
@@ -270551,7 +270671,7 @@ function shimScript() {
270551
270671
  }
270552
270672
 
270553
270673
  // src/index.ts
270554
- var PKG_VERSION = true ? "2.2.8" : "dev";
270674
+ var PKG_VERSION = true ? "2.2.9" : "dev";
270555
270675
  var LOCAL_BIN = localBin();
270556
270676
  var NPM_PREFIX = npmPrefix();
270557
270677
  var INSTANCE = DEFAULT_INSTANCE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oasis_test_v2",
3
- "version": "2.2.8",
3
+ "version": "2.2.9",
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": "6677c1551a7015b5a37a4fc4c3d7f7e7aaf395e6"
29
+ "sourceHead": "c340be41660585edc13bbb809b8585d4b6b4e95a"
30
30
  }
31
31
  }