@nelsonlongxiang/dsh-open-a2a-net 0.6.28 → 0.6.29

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 (55) hide show
  1. package/README.md +85 -14
  2. package/README_zh.md +81 -7
  3. package/assets/nexusDist/assets/index-BqepxJ7E.css +1 -0
  4. package/assets/nexusDist/assets/index-CTWH6QRh.js +9 -0
  5. package/assets/nexusDist/index.html +2 -2
  6. package/cli/a2a.mjs +624 -624
  7. package/cordis.patch.yml +21 -21
  8. package/lib/client.js +64 -64
  9. package/lib/client.js.map +1 -1
  10. package/lib/faces/admin.js +744 -0
  11. package/lib/index.js +139 -737
  12. package/lib/recursion-guard.js +78 -0
  13. package/lib/runtime.js +1 -0
  14. package/lib/skill/SKILL.md +34 -9
  15. package/lib/skill/references/cli.md +24 -7
  16. package/lib/skill/references/discovery.md +5 -2
  17. package/lib/skill/references/pitfalls.md +2 -1
  18. package/lib/skill/references/routing.md +18 -8
  19. package/lib/skill/references/setup.md +152 -0
  20. package/lib/task-ledger.js +6 -0
  21. package/lib/types/faces/admin.d.ts +132 -0
  22. package/lib/types/index.d.ts +11 -3
  23. package/lib/types/recursion-guard.d.ts +56 -0
  24. package/lib/types/runtime.d.ts +34 -0
  25. package/lib/types/task-ledger.d.ts +6 -0
  26. package/nexus-stage/package-lock.json +2262 -2262
  27. package/nexus-stage/src/canvas-ops.ts +175 -175
  28. package/nexus-stage/src/canvas-wire.ts +156 -156
  29. package/nexus-stage/src/edges.ts +72 -72
  30. package/nexus-stage/src/federation-overlay.ts +103 -103
  31. package/nexus-stage/src/federation.ts +240 -240
  32. package/nexus-stage/src/layout-doc.ts +143 -143
  33. package/nexus-stage/src/layout-wire.ts +158 -158
  34. package/nexus-stage/src/planning-card-text.ts +73 -0
  35. package/nexus-stage/src/planning-fit.ts +45 -0
  36. package/nexus-stage/src/planning-legend.ts +38 -0
  37. package/nexus-stage/src/planning-overlap.ts +134 -0
  38. package/nexus-stage/src/planning-relayout.ts +121 -0
  39. package/nexus-stage/src/planning-search.ts +168 -0
  40. package/nexus-stage/src/planning-view.ts +63 -88
  41. package/nexus-stage/src/planning.css +39 -8
  42. package/nexus-stage/src/seat.ts +35 -35
  43. package/nexus-stage/src/stage-name.ts +13 -13
  44. package/nexus-stage/src/tokens.ts +31 -31
  45. package/nexus-stage/src/viewport.ts +24 -1
  46. package/nexus-stage/src/wb-chat.ts +20 -6
  47. package/nexus-stage/src/wb-ledger.ts +20 -7
  48. package/nexus-stage/src/wb-names.ts +43 -0
  49. package/nexus-stage/src/workbench.css +8 -2
  50. package/nexus-stage/src/workbench.ts +55 -17
  51. package/nexus-stage/src/world.ts +5 -1
  52. package/package.json +216 -214
  53. package/assets/nexusDist/assets/index-1niOBYxp.js +0 -5
  54. package/assets/nexusDist/assets/index-uQf7NwjF.css +0 -1
  55. package/nexus-stage/scripts/__pycache__/mockhost.cpython-312.pyc +0 -0
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Recursion guard (#60, first step: the hop budget) per
3
+ * docs/protocol/recursion-guard.md. State rides the payload: the origin
4
+ * mints the envelope with a full budget, every forwarded leg decrements,
5
+ * and a zero-budget arrival is refused with a STRUCTURED budget-exhausted
6
+ * error — silent swallowing is forbidden. The visited set (protocol §4.3)
7
+ * is the SECOND step and is deliberately absent here.
8
+ *
9
+ * Wire form: the X-A2A-Guard header carries a base64 JSON payload
10
+ * { visitToken, hopBudget, deadlineAt? }. An ABSENT header means a
11
+ * non-forwarding origin: the receiver grants the default one-shot budget
12
+ * and records guardMode 'default' (protocol §6 — old peers are
13
+ * constrained, not broken). Parse cost is O(1) for the budget path.
14
+ * @module @nelsonlongxiang/dsh-open-a2a-net/recursion-guard
15
+ */
16
+ export declare const DEFAULT_HOP_BUDGET = 4;
17
+ /** Wire code for a zero-budget arrival (cluster-C registry, after -32006). */
18
+ export declare const WIRE_ERROR_BUDGET_EXHAUSTED = -32007;
19
+ /** The guard payload as it travels on the wire. */
20
+ export interface RecursionGuard {
21
+ readonly visitToken: string;
22
+ readonly hopBudget: number;
23
+ readonly deadlineAt?: number;
24
+ }
25
+ export type GuardVerdict = {
26
+ readonly kind: 'ok';
27
+ readonly guard: RecursionGuard;
28
+ readonly mode: 'explicit' | 'default';
29
+ } | {
30
+ readonly kind: 'budget-exhausted';
31
+ };
32
+ /**
33
+ * Ingress check: parse the header, validate the budget, fail closed. A
34
+ * malformed payload falls back to the default budget (a guard that cannot
35
+ * be evaluated must not reject honest first-hop traffic; the budget bound
36
+ * still applies). hopBudget <= 0 on arrival ⇒ budget-exhausted.
37
+ */
38
+ export declare function checkGuardAtIngress(header: string | undefined): GuardVerdict;
39
+ /** Mint the outbound guard for a first-hop dispatch (full budget at origin). */
40
+ export declare function mintGuard(): RecursionGuard;
41
+ /** Serialize for the X-A2A-Guard header. */
42
+ export declare function guardHeader(guard: RecursionGuard): string;
43
+ /**
44
+ * The ingress refusal path (gh#60): budget-exhausted answers the structured
45
+ * error, records the receiptless ledger row, and reports true (the caller
46
+ * returns). The whole response lives here so the ingress seam stays ONE
47
+ * line (the index.ts ratchet pays-as-it-goes: no net line growth).
48
+ */
49
+ export declare function refuseIfBudgetExhausted(req: {
50
+ headers: Record<string, unknown>;
51
+ }, res: {
52
+ writeHead: (status: number, headers: Record<string, string | number>) => void;
53
+ end: (body: string) => void;
54
+ }, team: string, caller: string, taskId: string, ledger: {
55
+ trackReceiptless: (taskId: string, team: string, peer: string, contextId?: string, brief?: string) => void;
56
+ }): boolean;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Shared A2A runtime types (gh#77): shapes that used to be declared inside
3
+ * `apply()` and are now read by the face modules as well.
4
+ * @module src/runtime
5
+ */
6
+ import type { A2aPeerCard } from './types.ts';
7
+ /**
8
+ * Recent routing activity for the network panel: a bounded ring of the
9
+ * latest inbound and outbound route outcomes, newest last. The state route
10
+ * serves a copy; the panel derives unread badges from new entries.
11
+ */
12
+ export interface RouteActivityEntry {
13
+ readonly ts: number;
14
+ readonly dir: 'in' | 'out';
15
+ readonly team: string;
16
+ readonly peer: string;
17
+ readonly ok: boolean;
18
+ }
19
+ /**
20
+ * In-flight outbound routes: a route registers on dial and unregisters on
21
+ * settlement, so the panel can show collaboration in progress ("who is
22
+ * waiting on whom") — the state route serves a snapshot.
23
+ */
24
+ export interface InFlightRoute {
25
+ readonly id: number;
26
+ readonly team: string;
27
+ readonly peer: string;
28
+ readonly startedAt: number;
29
+ }
30
+ /** One peer-card cache entry: when it was fetched and what came back. */
31
+ export interface CardCacheEntry {
32
+ at: number;
33
+ card: A2aPeerCard | undefined;
34
+ }
@@ -120,6 +120,12 @@ export interface ArchivedRecord {
120
120
  readonly endedBy?: ArchiveEnd;
121
121
  /** gh#31: which side of the wire the row served, copied from the owed row (absent on rows archived before the field). */
122
122
  readonly direction?: 'inbound' | 'outbound';
123
+ /**
124
+ * gh#68: copied from the owed row when it awaited no receipt, so a tidied
125
+ * fire-forget expiry is not read as a send we gave up on. Only `false` is
126
+ * ever stored; absent means a receipt was owed (or the row predates the field).
127
+ */
128
+ readonly receiptExpected?: false;
123
129
  }
124
130
  /**
125
131
  * How one archived row ended (gh#31). The recorded field wins; legacy rows