@sleep2agi/agent-network 2.3.0-preview.8 → 2.3.0-preview.80

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 (104) hide show
  1. package/README.md +35 -324
  2. package/dist/bin/anet.cjs +101 -0
  3. package/dist/bin/cli.d.ts +1 -0
  4. package/dist/bin/cli.js +20 -1
  5. package/dist/bin/goal-wake-log-render.d.ts +31 -0
  6. package/dist/src/active-network-task.d.ts +28 -0
  7. package/dist/src/batch-workdir.d.ts +9 -0
  8. package/dist/src/bootstrap-password-db.d.ts +13 -0
  9. package/dist/src/channel-attachments.d.ts +29 -0
  10. package/dist/src/channel-meta.d.ts +10 -0
  11. package/dist/src/channel-task-trace.d.ts +14 -0
  12. package/dist/src/claude-vendor-env.d.ts +28 -0
  13. package/dist/src/cli-args.d.ts +8 -0
  14. package/dist/src/cli-version-display.d.ts +16 -0
  15. package/dist/src/client-task-trace.d.ts +9 -0
  16. package/dist/src/client.js +1 -1
  17. package/dist/src/codex-copresence-preflight.d.ts +65 -0
  18. package/dist/src/codex-copresence-profile.d.ts +125 -0
  19. package/dist/src/codex-copresence-recovery.d.ts +43 -0
  20. package/dist/src/codex-copresence-thread.d.ts +13 -0
  21. package/dist/src/codex-model-default.d.ts +6 -0
  22. package/dist/src/codex-tui-client-health.d.ts +17 -0
  23. package/dist/src/commhub-response.d.ts +1 -0
  24. package/dist/src/controlled-upload.d.ts +83 -0
  25. package/dist/src/copresence-deps.d.ts +22 -0
  26. package/dist/src/copresence-identity.d.ts +339 -0
  27. package/dist/src/copresence-startup-diagnosis.d.ts +17 -0
  28. package/dist/src/daemon-capability-display.d.ts +110 -0
  29. package/dist/src/daemon-capability-display.js +21 -0
  30. package/dist/src/daemon-runtime-path-preflight.d.ts +22 -0
  31. package/dist/src/daemon-runtime-staleness.d.ts +13 -0
  32. package/dist/src/dashboard-managed-process.d.ts +35 -0
  33. package/dist/src/display-width.d.ts +27 -0
  34. package/dist/src/doctor-node-count.d.ts +28 -0
  35. package/dist/src/environ-alias.d.ts +14 -0
  36. package/dist/src/grok-attach-client.d.ts +129 -0
  37. package/dist/src/grok-build-drift.d.ts +15 -0
  38. package/dist/src/grok-copresence-disclosure.d.ts +11 -0
  39. package/dist/src/grok-copresence-orchestration.d.ts +75 -0
  40. package/dist/src/grok-copresence-profile.d.ts +65 -0
  41. package/dist/src/host-telemetry.d.ts +14 -0
  42. package/dist/src/hub-time-display.d.ts +20 -0
  43. package/dist/src/hub-version-skew.d.ts +19 -0
  44. package/dist/src/im/correlation-store.d.ts +34 -0
  45. package/dist/src/im/feishu/adapter.d.ts +87 -1
  46. package/dist/src/im/feishu/bridge.d.ts +85 -14
  47. package/dist/src/im/feishu/config.d.ts +31 -0
  48. package/dist/src/im/feishu/hub-upload.d.ts +88 -0
  49. package/dist/src/im/feishu/outbound-marker.d.ts +140 -0
  50. package/dist/src/im/feishu/outbound-paths.d.ts +50 -0
  51. package/dist/src/im/feishu/outbound-route.d.ts +62 -0
  52. package/dist/src/im/feishu/worker-lifecycle.d.ts +13 -0
  53. package/dist/src/im/feishu/worker.js +190 -139
  54. package/dist/src/im/types.d.ts +38 -1
  55. package/dist/src/local-process-state.d.ts +12 -0
  56. package/dist/src/locale-diagnostic.d.ts +12 -0
  57. package/dist/src/ls-columns.d.ts +15 -0
  58. package/dist/src/mock-llm.d.ts +12 -0
  59. package/dist/src/node-activity-log.d.ts +4 -0
  60. package/dist/src/node-not-found.d.ts +1 -0
  61. package/dist/src/node-server-payload.d.ts +66 -0
  62. package/dist/src/node-server.js +7 -1
  63. package/dist/src/normalize-runtime.d.ts +29 -2
  64. package/dist/src/offline-age.d.ts +29 -0
  65. package/dist/src/one-line-cell.d.ts +20 -0
  66. package/dist/src/opencode-agent-node-pair.d.ts +25 -0
  67. package/dist/src/opencode-auth-login.d.ts +43 -0
  68. package/dist/src/opencode-launch-env.d.ts +13 -0
  69. package/dist/src/opencode-owner-mode.d.ts +6 -0
  70. package/dist/src/opencode-package-binary.d.ts +21 -0
  71. package/dist/src/opencode-pin.d.ts +44 -0
  72. package/dist/src/opencode-preset.d.ts +73 -0
  73. package/dist/src/opencode-runtime-binding.d.ts +30 -0
  74. package/dist/src/opencode-safe-root.d.ts +27 -0
  75. package/dist/src/opencode-smoke-env.d.ts +1 -0
  76. package/dist/src/outbound-attachments.d.ts +57 -0
  77. package/dist/src/outbound-tool-names.d.ts +1 -0
  78. package/dist/src/owned-roots.d.ts +58 -0
  79. package/dist/src/owner-env-file.d.ts +2 -0
  80. package/dist/src/package-mode-preflight.d.ts +41 -0
  81. package/dist/src/posix-codex-copresence.d.ts +8 -0
  82. package/dist/src/posix-modes.d.ts +36 -0
  83. package/dist/src/primary-network.d.ts +23 -0
  84. package/dist/src/private-state.d.ts +10 -0
  85. package/dist/src/process-telemetry.d.ts +12 -0
  86. package/dist/src/profile-serialize.d.ts +1 -0
  87. package/dist/src/project-key.d.ts +1 -0
  88. package/dist/src/reply-originator.d.ts +20 -0
  89. package/dist/src/resume-runtime-infer.d.ts +18 -0
  90. package/dist/src/secret-shell-guidance.d.ts +3 -0
  91. package/dist/src/session-status-class.d.ts +48 -0
  92. package/dist/src/stale-socket.d.ts +118 -0
  93. package/dist/src/subcommand-redirect.d.ts +26 -0
  94. package/dist/src/task-trace.d.ts +33 -0
  95. package/dist/src/tmux-attach.d.ts +8 -0
  96. package/dist/src/tmux-capability.d.ts +58 -0
  97. package/dist/src/tmux-exact-target.d.ts +34 -0
  98. package/dist/src/tmux-pane-prompt.d.ts +22 -0
  99. package/dist/src/token-cli.d.ts +13 -0
  100. package/dist/src/tool-allowlist.d.ts +28 -0
  101. package/dist/src/unsafe-package-path-reason.d.ts +17 -0
  102. package/dist/src/win-launcher.d.ts +20 -0
  103. package/dist/src/windows-codex-copresence.d.ts +60 -0
  104. package/package.json +10 -5
@@ -72,13 +72,42 @@ export interface NormalizedIMEvent {
72
72
  mentioned: boolean;
73
73
  content: {
74
74
  text?: string;
75
- /** Local filesystem paths to already-downloaded images. */
75
+ /** Local filesystem paths to already-downloaded images.
76
+ *
77
+ * RFC-020 §17 backward-compat shim: the new richer
78
+ * `attachments[]` field below is the canonical source going
79
+ * forward. `images` stays a `string[]` of paths so an older
80
+ * agent-node worker reading this envelope across a rolling
81
+ * upgrade doesn't crash. New workers prefer `attachments`,
82
+ * old workers ignore it and keep using `images`. */
76
83
  images?: string[];
77
84
  files?: {
78
85
  name: string;
79
86
  path?: string;
80
87
  url?: string;
81
88
  }[];
89
+ /** RFC-020 §17 cross-machine attachment descriptors.
90
+ *
91
+ * Each entry mirrors `meta.attachments[]` on commhub tasks
92
+ * (`{ type, file_id?, path?, mime?, name?, size? }`). The
93
+ * feishu bridge populates `file_id` by uploading inbound
94
+ * files to `/api/upload` so cross-host agents delegated via
95
+ * `commhub_send_task(meta.attachments=...)` can fetch via
96
+ * `/api/files/<id>`. When upload fails, `file_id` is absent
97
+ * and the descriptor degrades to path-only (single-host
98
+ * still works via local Read; no regression vs pre-fix
99
+ * baseline).
100
+ *
101
+ * Always populated alongside `images` for the same files —
102
+ * duplication is intentional for rolling-upgrade safety. */
103
+ attachments?: Array<{
104
+ type: "image" | "file";
105
+ path?: string;
106
+ file_id?: string;
107
+ mime?: string;
108
+ name?: string;
109
+ size?: number;
110
+ }>;
82
111
  };
83
112
  /**
84
113
  * Original platform payload. Default: held in memory only and dropped after
@@ -115,6 +144,14 @@ export interface NormalizedIMMessage {
115
144
  replyToMessageId?: string;
116
145
  /** Ephemeral / visible-to-sender-only. Slack only; others ignore. */
117
146
  ephemeral?: boolean;
147
+ /** Caption-mode hint (RFC-020 §15.2): bypass markdown-card / markdown→PNG
148
+ * rendering and send as plain text. Set by the bridge when the same
149
+ * dispatch loop is also sending one or more attachment files — the text
150
+ * is a caption ("here's the report"), not the deliverable. Without this
151
+ * hint, Vincent's "make me a PDF" UAT had the bot's accompanying
152
+ * description heading + bullet list rendered to PNG via #329, which
153
+ * read as "you sent another image" instead of "you sent my file". */
154
+ forceTextOnly?: boolean;
118
155
  /** Tie back to the commhub task that produced this message. */
119
156
  correlation: {
120
157
  taskId: string;
@@ -0,0 +1,12 @@
1
+ export type LocalProcessState = {
2
+ kind: "alive";
3
+ pid: number;
4
+ } | {
5
+ kind: "stale";
6
+ pid: number;
7
+ } | {
8
+ kind: "none";
9
+ };
10
+ export declare function describeLocalProcess(state: LocalProcessState): string;
11
+ /** doctor 印完节点清单后的那一句:说清这一列量的是本机,不是 hub。 */
12
+ export declare const LOCAL_VS_HUB_NOTE: string;
@@ -0,0 +1,12 @@
1
+ export interface LocaleDiagnostic {
2
+ effectiveVariable: "LC_ALL" | "LC_CTYPE" | "LANG" | null;
3
+ effectiveValue: string | null;
4
+ shouldWarn: boolean;
5
+ }
6
+ /**
7
+ * Resolve the locale with the same precedence used by POSIX libc. Windows
8
+ * does not use these variables as its process Unicode boundary, so prescribing
9
+ * a POSIX locale there would be misleading.
10
+ */
11
+ export declare function diagnoseLocale(env: Readonly<Record<string, string | undefined>>, platform: string): LocaleDiagnostic;
12
+ export declare function formatLocaleSource(diagnostic: LocaleDiagnostic): string;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * 一列该多宽:装得下表头,也装得下这一列里最长的那个值。
3
+ *
4
+ * 🔴 两处用它的地方来源不同,但问题一样:
5
+ * - `anet node ls` 的 RUNTIME 列:值域来自 `SUPPORTED_RUNTIME_NAMES`(唯一真源);
6
+ * - `anet status` / `anet tasks` 的 STATUS 列:值域散在 server/ 里(另一个包),
7
+ * CLI 没法 import —— 但**要打印的那些行就在手上**,直接从数据算。
8
+ *
9
+ * 两种情况都不该写死一个数:写死的那个,下一次加 runtime / 加状态时就漂了。
10
+ */
11
+ export declare function columnWidth(values: readonly unknown[], header: string): number;
12
+ /** RUNTIME 列的专用入口 —— 保留原名,调用点不用改。 */
13
+ export declare function runtimeColumnWidth(names: readonly string[], header?: string): number;
14
+ export declare function lsHeaderRow(runtimeWidth: number): string;
15
+ export declare function lsSeparatorRow(runtimeWidth: number): string;
@@ -0,0 +1,12 @@
1
+ export declare const MOCK_LLM_FALLBACK = "(mock LLM: no rule matched)";
2
+ export type MockLlmRule = Readonly<{
3
+ in_substring: string;
4
+ out: string;
5
+ }>;
6
+ export type MockLlmResolution = Readonly<{
7
+ reply: string;
8
+ matched: boolean;
9
+ ruleIndex: number | null;
10
+ }>;
11
+ export declare function loadMockLlmRules(path: string): readonly MockLlmRule[];
12
+ export declare function resolveMockLlmReply(rules: readonly MockLlmRule[], prompt: string, warn?: (message: string) => void): MockLlmResolution;
@@ -0,0 +1,4 @@
1
+ export interface ActivityLogSink {
2
+ append(line: string): void;
3
+ }
4
+ export declare function createActivityLogSink(baseDir: string, alias: string, now?: () => Date): ActivityLogSink;
@@ -0,0 +1 @@
1
+ export declare function nodeNotFoundMessage(ref: string, knownNames: string[], suggestion: string | null): string;
@@ -0,0 +1,66 @@
1
+ /**
2
+ * What gets written to `<project>/.anet/node-server.js` (issue #1216).
3
+ *
4
+ * The target name is not negotiable: `agent-node`'s grok co-presence spawn
5
+ * gate pins the CommHub MCP payload to exactly that path, so whatever the
6
+ * source is, the file that lands there is called `.js`.
7
+ *
8
+ * 🔴 The bug this module exists to remove: the old code copied the source
9
+ * verbatim and justified it with a comment claiming
10
+ *
11
+ * "bun runs .ts content under a .js extension fine"
12
+ *
13
+ * which is false — bun selects its parser from the extension:
14
+ *
15
+ * $ printf 'function f(x: string): void {}\nf("hi");\n' > probe.ts
16
+ * $ cp probe.ts probe.js
17
+ * $ bun probe.ts → runs
18
+ * $ bun probe.js → error: Expected ")" but found ":"
19
+ *
20
+ * An installed npm package never hit it, because its first resolver candidate
21
+ * (`dist/src/node-server.js`) is compiled. Only a source checkout fell through
22
+ * to `src/node-server.ts` — i.e. every local run and every hand-verified PR.
23
+ *
24
+ * And the symptom was three layers from the cause: the node died on
25
+ * `grok copresence CommHub MCP readiness preflight failed (1)`, which names
26
+ * neither a file nor a parse error.
27
+ */
28
+ /** Injected so the decision is testable without spawning anything. */
29
+ export interface TypeScriptBundler {
30
+ /** Returns the self-contained JavaScript for `entryPath`, or throws. */
31
+ bundleSync(entryPath: string): string;
32
+ }
33
+ export declare class NodeServerPayloadError extends Error {
34
+ constructor(message: string);
35
+ }
36
+ /**
37
+ * Decide what bytes belong at the `.js` target for a given source path.
38
+ *
39
+ * A `.js` source is passed through untouched — the published package ships a
40
+ * compiled bundle there, and re-processing it risks changing bytes for no gain.
41
+ *
42
+ * 🔴 A `.ts` source must be **bundled, not merely transpiled**. Stripping types
43
+ * fixes the parse error but leaves the file's relative imports pointing at
44
+ * siblings that do not exist beside the destination:
45
+ *
46
+ * import { inboundChannelMeta } from "./channel-meta.js";
47
+ * → Cannot find module './channel-meta.js' from '<project>/.anet/node-server.js'
48
+ *
49
+ * That second failure is why transpiling alone still ended at
50
+ * "CommHub MCP readiness preflight failed (1)". The published
51
+ * `dist/src/node-server.js` works precisely because it is a self-contained
52
+ * bundle, so a source checkout has to produce the same shape.
53
+ */
54
+ export declare function nodeServerPayloadFor(source: string, sourcePath: string, bundler: TypeScriptBundler | null): string;
55
+ /**
56
+ * The bundler available on this runtime, or null.
57
+ *
58
+ * bun can bundle; the published CLI runs under node and cannot — but it also
59
+ * never resolves a `.ts` candidate (its `dist/` copy wins), so null there is
60
+ * correct rather than a gap.
61
+ *
62
+ * `spawnSync` rather than `Bun.build()` because both call sites are
63
+ * synchronous, and making them async would change the ordering of the file
64
+ * writes around them.
65
+ */
66
+ export declare function ambientTypeScriptTranspiler(): TypeScriptBundler | null;