@nelsonlongxiang/dsh-open-a2a-net 0.5.14 → 0.6.24

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 (86) hide show
  1. package/README.md +243 -121
  2. package/README_zh.md +144 -84
  3. package/assets/nexusDist/assets/index-034h1cNc.js +3 -0
  4. package/assets/nexusDist/assets/index-PG9EieGX.css +1 -0
  5. package/assets/nexusDist/index.html +26 -0
  6. package/assets/stageDist/assets/index-Bj7S2pA1.css +1 -0
  7. package/assets/stageDist/assets/index-C-28k_o5.js +974 -0
  8. package/assets/stageDist/assets/interiors-CQGBjffT.png +0 -0
  9. package/assets/stageDist/assets/office-tileset-CHQT-uYL.png +0 -0
  10. package/assets/stageDist/index.html +13 -0
  11. package/lib/a2a-client.js +190 -13
  12. package/lib/canvas-store.js +218 -0
  13. package/lib/card.js +25 -0
  14. package/lib/client/A2aControl.js +45 -137
  15. package/lib/client/locales.js +16 -40
  16. package/lib/client.js +164 -467
  17. package/lib/client.js.map +1 -1
  18. package/lib/group-store.js +6 -0
  19. package/lib/idempotency-store.js +291 -0
  20. package/lib/index.js +4217 -259
  21. package/lib/joined-store.js +11 -0
  22. package/lib/layout-store.js +155 -0
  23. package/lib/peer-store.js +98 -13
  24. package/lib/receipt-ladder.js +35 -0
  25. package/lib/receipt.js +102 -0
  26. package/lib/self-suppress.js +62 -0
  27. package/lib/session-transcript.js +150 -0
  28. package/lib/skill/SKILL.md +77 -0
  29. package/lib/skill/references/discovery.md +38 -0
  30. package/lib/skill/references/membership.md +50 -0
  31. package/lib/skill/references/pitfalls.md +42 -0
  32. package/lib/skill/references/routing.md +43 -0
  33. package/lib/skill-registration.js +52 -0
  34. package/lib/stage-mount.js +32 -0
  35. package/lib/task-ledger.js +540 -0
  36. package/lib/team-store.js +122 -0
  37. package/lib/teams-bridge.js +18 -0
  38. package/lib/transport-caps.js +31 -0
  39. package/lib/types/a2a-client.d.ts +72 -1
  40. package/lib/types/canvas-store.d.ts +102 -0
  41. package/lib/types/client/A2aControl.d.ts +18 -28
  42. package/lib/types/client/locales.d.ts +1 -1
  43. package/lib/types/group-store.d.ts +6 -0
  44. package/lib/types/idempotency-store.d.ts +164 -0
  45. package/lib/types/index.d.ts +210 -6
  46. package/lib/types/joined-store.d.ts +9 -0
  47. package/lib/types/layout-store.d.ts +63 -0
  48. package/lib/types/peer-store.d.ts +45 -2
  49. package/lib/types/receipt-ladder.d.ts +25 -0
  50. package/lib/types/receipt.d.ts +51 -0
  51. package/lib/types/self-suppress.d.ts +41 -0
  52. package/lib/types/session-transcript.d.ts +37 -0
  53. package/lib/types/skill-registration.d.ts +3 -0
  54. package/lib/types/stage-mount.d.ts +29 -0
  55. package/lib/types/task-ledger.d.ts +308 -0
  56. package/lib/types/team-store.d.ts +55 -0
  57. package/lib/types/teams-bridge.d.ts +112 -0
  58. package/lib/types/transport-caps.d.ts +29 -0
  59. package/lib/types/types.d.ts +43 -0
  60. package/nexus-stage/package-lock.json +2262 -0
  61. package/nexus-stage/package.json +21 -0
  62. package/nexus-stage/scripts/__pycache__/mockhost.cpython-312.pyc +0 -0
  63. package/nexus-stage/scripts/mockhost.py +253 -0
  64. package/nexus-stage/src/canvas-ops.ts +175 -0
  65. package/nexus-stage/src/canvas-wire.ts +156 -0
  66. package/nexus-stage/src/edges.ts +72 -0
  67. package/nexus-stage/src/fault.ts +56 -0
  68. package/nexus-stage/src/federation.ts +234 -0
  69. package/nexus-stage/src/layout-doc.ts +143 -0
  70. package/nexus-stage/src/layout-wire.ts +158 -0
  71. package/nexus-stage/src/main.ts +361 -0
  72. package/nexus-stage/src/planning-menus.ts +352 -0
  73. package/nexus-stage/src/planning-nodelist.ts +294 -0
  74. package/nexus-stage/src/planning-types.ts +111 -0
  75. package/nexus-stage/src/planning-view.ts +1313 -0
  76. package/nexus-stage/src/planning.css +280 -0
  77. package/nexus-stage/src/seat.ts +35 -0
  78. package/nexus-stage/src/stage-name.ts +13 -0
  79. package/nexus-stage/src/tokens.ts +32 -0
  80. package/nexus-stage/src/viewport.ts +83 -0
  81. package/nexus-stage/src/workbench.css +267 -0
  82. package/nexus-stage/src/workbench.ts +1530 -0
  83. package/nexus-stage/src/world.ts +509 -0
  84. package/nexus-stage/tsconfig.json +25 -0
  85. package/nexus-stage/vite.config.ts +16 -0
  86. package/package.json +83 -22
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Public shapes of the planning board: its input, dependencies, the
3
+ * handler seam tests drive, and the view surface. planning-view re-exports
4
+ * all of them, so importers keep using `./planning-view`.
5
+ * @module nexus-stage/planning-types
6
+ */
7
+ import type { CanvasAction } from './canvas-ops'
8
+ import type { InFlightRow, PeerRow, RemoteTeamRow } from './federation'
9
+ import type { LampState } from './layout-wire'
10
+ import type { LayoutViewport } from './viewport'
11
+ import type { SessionLite, TeamLite } from './world'
12
+
13
+ /** Minimal session/team shapes consumed here (topology rows satisfy them). */
14
+ export interface PlanningSession extends SessionLite {}
15
+ export interface PlanningTeam extends TeamLite {}
16
+
17
+ export interface PlanningInput {
18
+ sessions: ReadonlyArray<PlanningSession>
19
+ teams: ReadonlyArray<PlanningTeam>
20
+ peerCount: number
21
+ /** Federation peers (PR D): rows for the badge column right of the content. */
22
+ peers?: ReadonlyArray<PeerRow>
23
+ /** Pending outbound routes (PR D): the accent activity edges. */
24
+ inFlight?: ReadonlyArray<InFlightRow>
25
+ /** Remote team directory rows (PR D v1 ruling): grouped under peer cards. */
26
+ remoteTeams?: ReadonlyArray<RemoteTeamRow>
27
+ }
28
+
29
+ /** Screen-width class a viewport is remembered under (window width, not board width — collapsing the rail must not switch buckets). */
30
+ export type ViewportBucket = 'narrow' | 'medium' | 'wide'
31
+
32
+ export function viewportBucket(width: number): ViewportBucket {
33
+ return width < 680 ? 'narrow' : width < 1024 ? 'medium' : 'wide'
34
+ }
35
+
36
+ export interface PlanningDeps {
37
+ /** An edit that should persist happened (drag/nudge/pan/zoom/marquee end). */
38
+ onDirty(): void
39
+ /** The save lamp was clicked (error state -> retry). */
40
+ onLampClick(): void
41
+ /** Viewport size in CSS px (defaults to the root element's box; tests
42
+ * inject fixed sizes so fit math is assertable without layout). */
43
+ viewSize?(): { w: number; h: number }
44
+ /**
45
+ * Per-device viewport memory. The saved layout's viewport is the LAST
46
+ * saver's screen, so a desktop pan landed on a phone (and any other
47
+ * device's save yanked this one's view). When present, the first adopted
48
+ * layout takes this screen bucket's own viewport — else, on a wide screen,
49
+ * the host's (where it was most likely saved), else a fit — later
50
+ * adoptions leave the viewport alone, and every persisted edit writes the
51
+ * bucket back. Optional: without it the host viewport wins as before.
52
+ */
53
+ viewportStore?: { get(bucket: ViewportBucket): unknown; set(bucket: ViewportBucket, vp: LayoutViewport): void }
54
+ /**
55
+ * A team write action (optimistic state already applied by the view).
56
+ * Resolves true when the host accepted it — or it was an idempotent
57
+ * no-op (ok:false without an error string). Resolves false when the
58
+ * write was refused/failed: the view then rolls the action's scoped
59
+ * undo back itself. Rejecting the promise is also handled (treated as
60
+ * false) — the channel must not leave the team's guard pinned.
61
+ */
62
+ onCanvasAction(a: CanvasAction): Promise<boolean>
63
+ /** A plain (non-shift, no-drag) left click selected exactly one node
64
+ * (0.6.13): the host may open the reading face (chat drawer) for it.
65
+ * Selection itself is already applied — this is a notification, not a
66
+ * command; the host decides what (if anything) to show. */
67
+ onNodePick?(id: string): void
68
+ /** Wall clock for the inFlight age labels (tests pin it; default Date.now). */
69
+ now?(): number
70
+ }
71
+
72
+ /** Pointer-like event surface the handlers consume (real events satisfy it). */
73
+ export interface SeamPointer {
74
+ button: number
75
+ shiftKey: boolean
76
+ ctrlKey: boolean
77
+ clientX: number
78
+ clientY: number
79
+ pointerId?: number
80
+ target: Element | null
81
+ deltaX?: number
82
+ deltaY?: number
83
+ deltaMode?: number
84
+ preventDefault(): void
85
+ }
86
+
87
+ export interface SeamKey { key: string; shiftKey: boolean; altKey?: boolean; ctrlKey?: boolean; metaKey?: boolean; target: Element | null; preventDefault(): void }
88
+
89
+ export interface PlanningView {
90
+ root: HTMLElement
91
+ reconcile(input: PlanningInput): void
92
+ activate(): void
93
+ deactivate(): void
94
+ /** Adopt a (possibly normalized) layout document when the save loop allows. */
95
+ adoptExternalLayout(layout: unknown): void
96
+ /** The current document for the save loop, read at send time. */
97
+ snapshotDoc(): unknown
98
+ setLamp(state: LampState, savedAt?: string): void
99
+ /** A transient notice (host error verbatim or an info hint). */
100
+ notice(kind: 'error' | 'info', text: string): void
101
+ seam: {
102
+ pointerDown(ev: SeamPointer): void
103
+ pointerMove(ev: SeamPointer): void
104
+ pointerUp(ev: SeamPointer): void
105
+ wheel(ev: SeamPointer): void
106
+ key(ev: SeamKey): void
107
+ keyUp(ev: SeamKey): void
108
+ contextMenu(ev: SeamPointer): void
109
+ }
110
+ destroy(): void
111
+ }