@cydm/pie 4.4.0 → 4.4.2

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 (41) hide show
  1. package/dist/builtin/extensions/ask-user/index.js +6 -6
  2. package/dist/builtin/extensions/changelog/index.js +1 -1
  3. package/dist/builtin/extensions/cron/index.js +2 -2
  4. package/dist/builtin/extensions/document-attachments/index.js +1 -1
  5. package/dist/builtin/extensions/herdr-agent-state/index.js +1 -1
  6. package/dist/builtin/extensions/im-forward/README.md +4 -3
  7. package/dist/builtin/extensions/im-forward/index.js +24 -5
  8. package/dist/builtin/extensions/init/index.js +1 -1
  9. package/dist/builtin/extensions/mcp-adapter/index.js +2 -2
  10. package/dist/builtin/extensions/memory/index.js +11 -9
  11. package/dist/builtin/extensions/pie-ipc/index.js +270 -344
  12. package/dist/builtin/extensions/pie-proc/index.js +70 -7
  13. package/dist/builtin/extensions/plan-mode/index.js +6 -6
  14. package/dist/builtin/extensions/subagent/index.js +11 -9
  15. package/dist/builtin/extensions/todo/index.js +6 -6
  16. package/dist/builtin/skills/computer-use-axi/computer-use-axi-broker.js +1 -1
  17. package/dist/builtin/skills/computer-use-axi/computer-use-axi-runtime.js +1 -1
  18. package/dist/chunks/{auth-storage-3EGM3VTK.js → auth-storage-RABPRJ6T.js} +3 -3
  19. package/dist/chunks/chunk-7KLWHWZD.js +164 -0
  20. package/dist/chunks/{chunk-I7PBXG5Q.js → chunk-7LTQLJJF.js} +9 -6
  21. package/dist/chunks/{chunk-XXGYUYXI.js → chunk-BPSCGGVF.js} +1 -1
  22. package/dist/chunks/{chunk-VHKMWOG3.js → chunk-EQOI6RZV.js} +5 -3
  23. package/dist/chunks/{chunk-B4N5LJMD.js → chunk-IPLMGAML.js} +1 -1
  24. package/dist/chunks/{chunk-GY47MKCJ.js → chunk-IZDNZW3S.js} +8 -8
  25. package/dist/chunks/{chunk-AKXEZH7K.js → chunk-OFLKAWI4.js} +0 -7
  26. package/dist/chunks/{chunk-6DNYGVZP.js → chunk-OV7SLSHR.js} +4 -2
  27. package/dist/chunks/{chunk-6JEYRAQM.js → chunk-R7VO46EK.js} +2 -2
  28. package/dist/chunks/{chunk-LZQXQOPJ.js → chunk-RZGYXAJU.js} +12 -1
  29. package/dist/chunks/{chunk-ILUHTKF3.js → chunk-UCKOXAME.js} +61 -11
  30. package/dist/chunks/{chunk-XMOWWL4B.js → chunk-XO3NM7BB.js} +3 -3
  31. package/dist/chunks/{chunk-N5B5IGJ6.js → chunk-YNTIOWCD.js} +5 -5
  32. package/dist/chunks/{config-74AUVDLT.js → config-HF2PDLN5.js} +8 -4
  33. package/dist/chunks/{manager-cli-4Z6RZ7F4.js → manager-cli-BYCF4RKN.js} +5 -3
  34. package/dist/chunks/{model-registry-NKE3BRSZ.js → model-registry-7FNIUYPF.js} +5 -5
  35. package/dist/chunks/{src-V2M7FLWY.js → src-A5YI46OD.js} +6 -6
  36. package/dist/chunks/{src-4EQ7PBEI.js → src-OA3TP6DS.js} +5 -5
  37. package/dist/chunks/{src-46R5ZFOU.js → src-OVWRBWKU.js} +4 -4
  38. package/dist/chunks/{src-BHIH4VLE.js → src-TF2RAGRU.js} +3 -3
  39. package/dist/chunks/{test-stream-FC6ZRENI.js → test-stream-7YZDGBPO.js} +3 -3
  40. package/dist/cli.js +231 -49
  41. package/package.json +2 -2
@@ -1,12 +1,12 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  createAskUserCapability
4
- } from "../../../chunks/chunk-N5B5IGJ6.js";
5
- import "../../../chunks/chunk-XMOWWL4B.js";
6
- import "../../../chunks/chunk-B4N5LJMD.js";
7
- import "../../../chunks/chunk-6JEYRAQM.js";
8
- import "../../../chunks/chunk-XXGYUYXI.js";
9
- import "../../../chunks/chunk-LZQXQOPJ.js";
4
+ } from "../../../chunks/chunk-YNTIOWCD.js";
5
+ import "../../../chunks/chunk-XO3NM7BB.js";
6
+ import "../../../chunks/chunk-IPLMGAML.js";
7
+ import "../../../chunks/chunk-R7VO46EK.js";
8
+ import "../../../chunks/chunk-BPSCGGVF.js";
9
+ import "../../../chunks/chunk-RZGYXAJU.js";
10
10
 
11
11
  // builtin/extensions/ask-user/index.ts
12
12
  function askUserExtension(ctx) {
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
- import "../../../chunks/chunk-LZQXQOPJ.js";
2
+ import "../../../chunks/chunk-RZGYXAJU.js";
3
3
 
4
4
  // builtin/extensions/changelog/index.ts
5
5
  import * as fs from "node:fs";
@@ -1,8 +1,8 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  Type
4
- } from "../../../chunks/chunk-XXGYUYXI.js";
5
- import "../../../chunks/chunk-LZQXQOPJ.js";
4
+ } from "../../../chunks/chunk-BPSCGGVF.js";
5
+ import "../../../chunks/chunk-RZGYXAJU.js";
6
6
 
7
7
  // builtin/extensions/cron/index.ts
8
8
  import * as path4 from "node:path";
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
- import "../../../chunks/chunk-LZQXQOPJ.js";
2
+ import "../../../chunks/chunk-RZGYXAJU.js";
3
3
 
4
4
  // builtin/extensions/document-attachments/index.ts
5
5
  import * as fs from "node:fs";
@@ -1,5 +1,5 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
- import "../../../chunks/chunk-LZQXQOPJ.js";
2
+ import "../../../chunks/chunk-RZGYXAJU.js";
3
3
 
4
4
  // builtin/extensions/herdr-agent-state/index.ts
5
5
  import { spawn } from "node:child_process";
@@ -69,8 +69,9 @@ are read as implicit Feishu settings. Unknown explicit providers never fall back
69
69
  Provider settings merge only within the same provider, with project precedence.
70
70
 
71
71
  The footer shows `[IM…]` while starting, `[IM]` only after the consumer's ready
72
- marker, `[IM!]` on configuration/connection failure, `[IM-DEGRADED:bus]`
73
- when the last recognized bus SDK state is disconnected beyond a ten-minute
72
+ marker, `[IM!]` on configuration/connection failure, `[IM↓]` (logged
73
+ and reported by `/tools/im-forward status` with the specific cause, `bus`
74
+ or `dispatch`) when the last recognized bus SDK state is disconnected beyond a ten-minute
74
75
  reconnect grace, and nothing when off. A five-minute probe reads a bounded
75
76
  log tail using host-local timestamps; unknown/unavailable evidence preserves
76
77
  an existing warning. Only a recognized reconnect clears it. This is passive
@@ -84,7 +85,7 @@ On a machine where a resident holds the consumer slot, non-holder runtimes
84
85
  operate in dispatch mode: they never spawn a consumer and receive events over
85
86
  pie-ipc. For such runtimes the tag answers a delivery question, not a
86
87
  lifecycle one: `[IM]` while dispatch mode is the working configuration (the
87
- holder is alive and sorting), `[IM-DEGRADED:dispatch]` when the holder
88
+ holder is alive and sorting), `[IM↓]` (cause `dispatch`) when the holder
88
89
  heartbeat stays fresh yet nothing has been dispatched here past a ten-minute
89
90
  grace window, and `[IM…]` only while the runtime is genuinely starting or
90
91
  waiting to claim. A dispatched event restores `[IM]` immediately. Losing the
@@ -31,12 +31,12 @@ import {
31
31
  truncateMarkdown,
32
32
  tryClaimConsumer,
33
33
  writeConfig
34
- } from "../../../chunks/chunk-AKXEZH7K.js";
34
+ } from "../../../chunks/chunk-OFLKAWI4.js";
35
35
  import {
36
36
  detectImageMime,
37
37
  readImageFormat
38
38
  } from "../../../chunks/chunk-F7EBZTZO.js";
39
- import "../../../chunks/chunk-LZQXQOPJ.js";
39
+ import "../../../chunks/chunk-RZGYXAJU.js";
40
40
 
41
41
  // builtin/extensions/im-forward/runtime.ts
42
42
  import * as crypto from "node:crypto";
@@ -836,10 +836,14 @@ function createRuntime(ctx, cfg, connection, liveEnabled, persistEnabled) {
836
836
  return false;
837
837
  }
838
838
  };
839
+ const degradedTag = (cause) => {
840
+ ctx.log(`im-forward: footer degraded (${cause})`);
841
+ return "[IM\u2193]";
842
+ };
839
843
  function updateFooterTag() {
840
844
  ctx.ui.setStatus?.(
841
845
  STATUS_KEY,
842
- configurationFailed ? "[IM!]" : forwardingEnabled ? consumerLastExit ? "[IM!]" : busStale ? "[IM-DEGRADED:bus]" : consumerReady ? "[IM]" : dispatchMode ? dispatchStale() ? "[IM-DEGRADED:dispatch]" : "[IM]" : "[IM\u2026]" : void 0
846
+ configurationFailed ? "[IM!]" : forwardingEnabled ? consumerLastExit ? "[IM!]" : busStale ? degradedTag("bus") : consumerReady ? "[IM]" : dispatchMode ? dispatchStale() ? degradedTag("dispatch") : "[IM]" : "[IM\u2026]" : void 0
843
847
  );
844
848
  }
845
849
  const DISPATCH_GRACE_MS = 10 * 6e4;
@@ -1219,7 +1223,11 @@ ${pending.caption || IM_INPUT_FALLBACK_CAPTION}` : pending.caption).trim();
1219
1223
  attribution?.replyTo,
1220
1224
  attribution,
1221
1225
  deliver
1222
- ).catch(() => void 0);
1226
+ ).then((delivered) => {
1227
+ if (delivered === true && attribution?.replyTo && connection.react) {
1228
+ providerCall("react", () => connection.react(attribution.replyTo, "CheckMark")).catch(() => void 0);
1229
+ }
1230
+ }).catch(() => void 0);
1223
1231
  });
1224
1232
  ctx.on("turn:failed", (event) => {
1225
1233
  if (!isForwardingEnabled()) return;
@@ -1230,8 +1238,10 @@ ${pending.caption || IM_INPUT_FALLBACK_CAPTION}` : pending.caption).trim();
1230
1238
  const attribution = resolveOutboundAttribution(sessionId);
1231
1239
  const deliverTf = /* @__PURE__ */ new Map();
1232
1240
  if (!outboundRoleAllows(attribution, deliverTf)) return;
1241
+ const recoveryHint = `\u8F93\u5165\u4ECD\u5728\u4F1A\u8BDD\u4E2D\uFF0C\u56DE\u590D\u201C\u91CD\u7B54\u4E0A\u4E00\u6761\u201D\u5373\u53EF\u57FA\u4E8E\u5B83\u91CD\u65B0\u4F5C\u7B54\uFF0C\u65E0\u9700\u91CD\u53D1\u539F\u59CB\u8BF7\u6C42\u3002`;
1233
1242
  void forwardMessage(
1234
- `\u26A0\uFE0F \u4EFB\u52A1\u5931\u8D25\uFF1A${reason}`,
1243
+ `\u26A0\uFE0F \u4EFB\u52A1\u5931\u8D25\uFF1A${reason}\uFF08\u91CD\u8BD5\u5DF2\u7528\u5C3D\uFF09
1244
+ ${recoveryHint}`,
1235
1245
  sessionId,
1236
1246
  sequence,
1237
1247
  attribution?.caption,
@@ -1524,8 +1534,10 @@ ${pending.caption || IM_INPUT_FALLBACK_CAPTION}` : pending.caption).trim();
1524
1534
  anchor
1525
1535
  )
1526
1536
  );
1537
+ return false;
1527
1538
  }
1528
1539
  }
1540
+ return true;
1529
1541
  }
1530
1542
  const sentAnchors = /* @__PURE__ */ new Set();
1531
1543
  function registerRoute(sent, sessionId) {
@@ -3650,6 +3662,13 @@ function connect(binary, profile, targetKind = "chat", settings = { targetId: ""
3650
3662
  async acknowledge(id) {
3651
3663
  await call(["im", "reactions", "create", "--as", "bot", "--params", JSON.stringify({ message_id: id }), "--data", JSON.stringify({ reaction_type: { emoji_type: "THUMBSUP" } })]);
3652
3664
  },
3665
+ // 4.4.1 turn-settled reaction (dogfood ask: "结束☑️就好"). Feishu's
3666
+ // official emoji_type table lists "CheckMark" for ✔ (verified against
3667
+ // the larksuite/cli reactions reference — OnCheck/WHITE_CHECK_MARK do
3668
+ // NOT exist and the API rejects them).
3669
+ async react(id, emoji) {
3670
+ await call(["im", "reactions", "create", "--as", "bot", "--params", JSON.stringify({ message_id: id }), "--data", JSON.stringify({ reaction_type: { emoji_type: emoji } })]);
3671
+ },
3653
3672
  async metadata(id) {
3654
3673
  const data = await call(["im", "+messages-mget", "--as", "bot", "--message-ids", id]);
3655
3674
  const message = Array.isArray(data?.messages) ? data.messages[0] : void 0;
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from "node:module"; const require =
2
2
  import {
3
3
  resolveCliProjectRoot
4
4
  } from "../../../chunks/chunk-WLFOBECN.js";
5
- import "../../../chunks/chunk-LZQXQOPJ.js";
5
+ import "../../../chunks/chunk-RZGYXAJU.js";
6
6
 
7
7
  // builtin/extensions/init/index.ts
8
8
  import fs from "node:fs";
@@ -1,13 +1,13 @@
1
1
  import { createRequire as __createRequire } from "node:module"; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  Type
4
- } from "../../../chunks/chunk-XXGYUYXI.js";
4
+ } from "../../../chunks/chunk-BPSCGGVF.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __export,
8
8
  __require,
9
9
  __toESM
10
- } from "../../../chunks/chunk-LZQXQOPJ.js";
10
+ } from "../../../chunks/chunk-RZGYXAJU.js";
11
11
 
12
12
  // ../../node_modules/isexe/windows.js
13
13
  var require_windows = __commonJS({
@@ -3,11 +3,12 @@ import {
3
3
  distillWorkerLogPath,
4
4
  readDistillWorkerLog,
5
5
  spawnDistillWorker
6
- } from "../../../chunks/chunk-GY47MKCJ.js";
6
+ } from "../../../chunks/chunk-IZDNZW3S.js";
7
7
  import {
8
8
  getConfigDir,
9
- getSettingsPath
10
- } from "../../../chunks/chunk-ILUHTKF3.js";
9
+ getSettingsPath,
10
+ init_config
11
+ } from "../../../chunks/chunk-UCKOXAME.js";
11
12
  import {
12
13
  DEFAULT_MEMORY_INJECTION_BUDGET,
13
14
  MemoryStore,
@@ -19,18 +20,19 @@ import {
19
20
  saveAttestedEntry,
20
21
  searchMemory,
21
22
  todayKey
22
- } from "../../../chunks/chunk-N5B5IGJ6.js";
23
- import "../../../chunks/chunk-XMOWWL4B.js";
24
- import "../../../chunks/chunk-B4N5LJMD.js";
25
- import "../../../chunks/chunk-6JEYRAQM.js";
23
+ } from "../../../chunks/chunk-YNTIOWCD.js";
24
+ import "../../../chunks/chunk-XO3NM7BB.js";
25
+ import "../../../chunks/chunk-IPLMGAML.js";
26
+ import "../../../chunks/chunk-R7VO46EK.js";
26
27
  import {
27
28
  Type
28
- } from "../../../chunks/chunk-XXGYUYXI.js";
29
- import "../../../chunks/chunk-LZQXQOPJ.js";
29
+ } from "../../../chunks/chunk-BPSCGGVF.js";
30
+ import "../../../chunks/chunk-RZGYXAJU.js";
30
31
 
31
32
  // builtin/extensions/memory/index.ts
32
33
  import * as fs from "node:fs";
33
34
  import * as path from "node:path";
35
+ init_config();
34
36
  function yesterdayKey() {
35
37
  const probe = /* @__PURE__ */ new Date();
36
38
  probe.setDate(probe.getDate() - 1);