@nelsonlongxiang/dsh-open-a2a-net 0.6.41 → 0.6.43
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.
- package/README.md +2 -1
- package/README_zh.md +2 -1
- package/assets/nexusDist/assets/index-CaA76j0F.js +9 -0
- package/assets/nexusDist/index.html +1 -1
- package/assets/stageDist/assets/index-Bj7S2pA1.css +1 -1
- package/assets/stageDist/assets/index-C-28k_o5.js +974 -974
- package/assets/stageDist/index.html +12 -12
- package/cli/a2a.mjs +24 -4
- package/lib/canvas-store.js +249 -17
- package/lib/client.js +62 -72
- package/lib/client.js.map +1 -1
- package/lib/config.js +1 -0
- package/lib/faces/admin.js +103 -63
- package/lib/faces/wire.js +3 -1
- package/lib/index.js +116 -22
- package/lib/origin-claim.js +4 -0
- package/lib/skill/SKILL.md +117 -117
- package/lib/skill/references/collaboration.md +428 -428
- package/lib/skill/references/discovery.md +78 -78
- package/lib/skill/references/intake.md +107 -107
- package/lib/skill/references/membership.md +73 -73
- package/lib/skill/references/pitfalls.md +51 -51
- package/lib/skill/references/router.md +96 -96
- package/lib/skill/references/routing.md +65 -65
- package/lib/types/canvas-store.d.ts +48 -1
- package/lib/types/config.d.ts +2 -0
- package/lib/types/faces/admin.d.ts +2 -0
- package/lib/types/origin-claim.d.ts +2 -0
- package/nexus-stage/package.json +21 -21
- package/nexus-stage/scripts/mockhost.py +261 -261
- package/nexus-stage/src/canvas-ops.ts +191 -191
- package/nexus-stage/src/canvas-wire.ts +164 -164
- package/nexus-stage/src/cli-home-picker.ts +42 -42
- package/nexus-stage/src/fault.ts +56 -56
- package/nexus-stage/src/federation-overlay.ts +103 -103
- package/nexus-stage/src/federation.ts +241 -241
- package/nexus-stage/src/layout-doc.ts +145 -145
- package/nexus-stage/src/main.ts +520 -513
- package/nexus-stage/src/planning-card-text.ts +73 -73
- package/nexus-stage/src/planning-card.ts +63 -63
- package/nexus-stage/src/planning-edges.ts +26 -26
- package/nexus-stage/src/planning-fit.ts +45 -45
- package/nexus-stage/src/planning-frame-hue.ts +13 -13
- package/nexus-stage/src/planning-legend.ts +39 -39
- package/nexus-stage/src/planning-member-handles.ts +61 -61
- package/nexus-stage/src/planning-menus.ts +422 -422
- package/nexus-stage/src/planning-mirror.ts +75 -75
- package/nexus-stage/src/planning-nodelist.ts +294 -294
- package/nexus-stage/src/planning-overlap.ts +159 -159
- package/nexus-stage/src/planning-reachability.ts +28 -28
- package/nexus-stage/src/planning-relayout.ts +121 -121
- package/nexus-stage/src/planning-roster.ts +15 -15
- package/nexus-stage/src/planning-search.ts +168 -168
- package/nexus-stage/src/planning-types.ts +115 -115
- package/nexus-stage/src/planning-undo.ts +68 -68
- package/nexus-stage/src/planning-view.ts +1499 -1499
- package/nexus-stage/src/planning.css +340 -340
- package/nexus-stage/src/seat-name-editor.ts +31 -31
- package/nexus-stage/src/session-drag.ts +64 -64
- package/nexus-stage/src/viewport.ts +106 -106
- package/nexus-stage/src/wb-chat.ts +684 -684
- package/nexus-stage/src/wb-directory.ts +237 -237
- package/nexus-stage/src/wb-ledger.ts +279 -279
- package/nexus-stage/src/wb-names.ts +43 -43
- package/nexus-stage/src/wb-rail.ts +147 -147
- package/nexus-stage/src/workbench.css +388 -388
- package/nexus-stage/src/workbench.ts +1294 -1272
- package/nexus-stage/src/world.ts +509 -509
- package/nexus-stage/tsconfig.json +24 -24
- package/nexus-stage/vite.config.ts +15 -15
- package/package.json +1 -1
- package/assets/nexusDist/assets/index-NkNSeIx6.js +0 -9
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Federation overlay DOM renderer (gh#49 module split from planning-view,
|
|
3
|
-
* the 1550→<1530 M1 ruling): draws the activity/federal overlay edges onto
|
|
4
|
-
* the planning svg and exposes the placements bookkeeping. The geometry
|
|
5
|
-
* stays in federation.ts (pure derivation); this module owns the DOM side
|
|
6
|
-
* and is created per planning view instance.
|
|
7
|
-
* @module nexus-stage/federation-overlay
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { WorldModel } from './world'
|
|
11
|
-
import { activityEdges, federalEdges, flyBounds, type FrameAnchor, type InFlightRow, type PeerPlacement, type PeerRow } from './federation'
|
|
12
|
-
|
|
13
|
-
/** The per-instance federation overlay: draw + bookkeeping seams. */
|
|
14
|
-
export interface FederationOverlay {
|
|
15
|
-
/** Redraw the overlay from the model's remote nodes (peer cards). */
|
|
16
|
-
render(now: number): void
|
|
17
|
-
/** Statusbar fly: fit frames ∪ peers (flyBounds pads). */
|
|
18
|
-
flyTo(viewportApply: () => void): PeerPlacement[]
|
|
19
|
-
/** The most recent placements (fly bounds + status reads). */
|
|
20
|
-
placements(): readonly PeerPlacement[]
|
|
21
|
-
/** Sync the polling facts the edges derive from. */
|
|
22
|
-
setInFlight(rows: ReadonlyArray<InFlightRow>): void
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface FederationHostFacts {
|
|
26
|
-
/** Peer rows from /state (score + link/verified for badges). */
|
|
27
|
-
peers: ReadonlyArray<PeerRow>
|
|
28
|
-
/** Pending outbound routes from /state. */
|
|
29
|
-
inFlight: ReadonlyArray<InFlightRow>
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const FRAME_HEAD_LIFT = 11
|
|
33
|
-
|
|
34
|
-
export function createFederationOverlay(svg: SVGElement, model: WorldModel): FederationOverlay {
|
|
35
|
-
let fedSvg: SVGElement[] = []
|
|
36
|
-
let lastPlacements: PeerPlacement[] = []
|
|
37
|
-
let lastInFlight: ReadonlyArray<InFlightRow> = []
|
|
38
|
-
|
|
39
|
-
function render(now: number): void {
|
|
40
|
-
for (const el of fedSvg) el.remove()
|
|
41
|
-
fedSvg = []
|
|
42
|
-
// Peer placements come from the MODEL's remote nodes (v1 ruling: peers
|
|
43
|
-
// are cards in the same pipeline, dragged/saved like sessions) — the
|
|
44
|
-
// old chip column is gone.
|
|
45
|
-
const placements: PeerPlacement[] = model.allNodes()
|
|
46
|
-
.filter(n => n.remote === true)
|
|
47
|
-
.map(n => ({ url: n.peerUrl ?? n.id.slice(5), score: n.score, x: n.x, y: n.y }))
|
|
48
|
-
lastPlacements = placements
|
|
49
|
-
const bounds = model.contentBounds()
|
|
50
|
-
if (bounds !== null) {
|
|
51
|
-
// Edges: titlebar anchors (fx + fw/2, fy + 11, edges.ts lockstep).
|
|
52
|
-
const anchors = new Map<string, FrameAnchor>()
|
|
53
|
-
for (const [name, rect] of model.allFrames()) {
|
|
54
|
-
anchors.set(name, { name, x: rect.x + rect.w / 2, y: rect.y + FRAME_HEAD_LIFT })
|
|
55
|
-
}
|
|
56
|
-
for (const e of activityEdges(lastInFlight, anchors, placements, now)) {
|
|
57
|
-
fedSvg.push(...fedEdge(e, 'e-activity', e.label))
|
|
58
|
-
}
|
|
59
|
-
for (const e of federalEdges(placements, bounds)) {
|
|
60
|
-
fedSvg.push(...fedEdge(e, 'e-federal', e.label))
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/** One overlay line + its optional midpoint label (offset +14/+18). */
|
|
66
|
-
function fedEdge(
|
|
67
|
-
e: { x1: number; y1: number; x2: number; y2: number },
|
|
68
|
-
cls: string,
|
|
69
|
-
label: string,
|
|
70
|
-
): SVGElement[] {
|
|
71
|
-
const line = document.createElementNS('http://www.w3.org/2000/svg', 'line')
|
|
72
|
-
line.setAttribute('class', cls)
|
|
73
|
-
line.setAttribute('x1', String(e.x1))
|
|
74
|
-
line.setAttribute('y1', String(e.y1))
|
|
75
|
-
line.setAttribute('x2', String(e.x2))
|
|
76
|
-
line.setAttribute('y2', String(e.y2))
|
|
77
|
-
svg.appendChild(line)
|
|
78
|
-
const out: SVGElement[] = [line]
|
|
79
|
-
if (label !== '') {
|
|
80
|
-
const t = document.createElementNS('http://www.w3.org/2000/svg', 'text')
|
|
81
|
-
t.setAttribute('class', 'edge-label mono')
|
|
82
|
-
t.setAttribute('x', String((e.x1 + e.x2) / 2 + 14))
|
|
83
|
-
t.setAttribute('y', String((e.y1 + e.y2) / 2 + 18))
|
|
84
|
-
t.textContent = label
|
|
85
|
-
svg.appendChild(t)
|
|
86
|
-
out.push(t)
|
|
87
|
-
}
|
|
88
|
-
return out
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return {
|
|
92
|
-
render,
|
|
93
|
-
flyTo(viewportApply: () => void): PeerPlacement[] {
|
|
94
|
-
viewportApply()
|
|
95
|
-
return lastPlacements
|
|
96
|
-
},
|
|
97
|
-
placements: () => lastPlacements,
|
|
98
|
-
setInFlight: rows => { lastInFlight = rows },
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/** The fly-bounds helper re-export for the view's statusbar fit. */
|
|
103
|
-
export { flyBounds }
|
|
1
|
+
/**
|
|
2
|
+
* Federation overlay DOM renderer (gh#49 module split from planning-view,
|
|
3
|
+
* the 1550→<1530 M1 ruling): draws the activity/federal overlay edges onto
|
|
4
|
+
* the planning svg and exposes the placements bookkeeping. The geometry
|
|
5
|
+
* stays in federation.ts (pure derivation); this module owns the DOM side
|
|
6
|
+
* and is created per planning view instance.
|
|
7
|
+
* @module nexus-stage/federation-overlay
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { WorldModel } from './world'
|
|
11
|
+
import { activityEdges, federalEdges, flyBounds, type FrameAnchor, type InFlightRow, type PeerPlacement, type PeerRow } from './federation'
|
|
12
|
+
|
|
13
|
+
/** The per-instance federation overlay: draw + bookkeeping seams. */
|
|
14
|
+
export interface FederationOverlay {
|
|
15
|
+
/** Redraw the overlay from the model's remote nodes (peer cards). */
|
|
16
|
+
render(now: number): void
|
|
17
|
+
/** Statusbar fly: fit frames ∪ peers (flyBounds pads). */
|
|
18
|
+
flyTo(viewportApply: () => void): PeerPlacement[]
|
|
19
|
+
/** The most recent placements (fly bounds + status reads). */
|
|
20
|
+
placements(): readonly PeerPlacement[]
|
|
21
|
+
/** Sync the polling facts the edges derive from. */
|
|
22
|
+
setInFlight(rows: ReadonlyArray<InFlightRow>): void
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface FederationHostFacts {
|
|
26
|
+
/** Peer rows from /state (score + link/verified for badges). */
|
|
27
|
+
peers: ReadonlyArray<PeerRow>
|
|
28
|
+
/** Pending outbound routes from /state. */
|
|
29
|
+
inFlight: ReadonlyArray<InFlightRow>
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const FRAME_HEAD_LIFT = 11
|
|
33
|
+
|
|
34
|
+
export function createFederationOverlay(svg: SVGElement, model: WorldModel): FederationOverlay {
|
|
35
|
+
let fedSvg: SVGElement[] = []
|
|
36
|
+
let lastPlacements: PeerPlacement[] = []
|
|
37
|
+
let lastInFlight: ReadonlyArray<InFlightRow> = []
|
|
38
|
+
|
|
39
|
+
function render(now: number): void {
|
|
40
|
+
for (const el of fedSvg) el.remove()
|
|
41
|
+
fedSvg = []
|
|
42
|
+
// Peer placements come from the MODEL's remote nodes (v1 ruling: peers
|
|
43
|
+
// are cards in the same pipeline, dragged/saved like sessions) — the
|
|
44
|
+
// old chip column is gone.
|
|
45
|
+
const placements: PeerPlacement[] = model.allNodes()
|
|
46
|
+
.filter(n => n.remote === true)
|
|
47
|
+
.map(n => ({ url: n.peerUrl ?? n.id.slice(5), score: n.score, x: n.x, y: n.y }))
|
|
48
|
+
lastPlacements = placements
|
|
49
|
+
const bounds = model.contentBounds()
|
|
50
|
+
if (bounds !== null) {
|
|
51
|
+
// Edges: titlebar anchors (fx + fw/2, fy + 11, edges.ts lockstep).
|
|
52
|
+
const anchors = new Map<string, FrameAnchor>()
|
|
53
|
+
for (const [name, rect] of model.allFrames()) {
|
|
54
|
+
anchors.set(name, { name, x: rect.x + rect.w / 2, y: rect.y + FRAME_HEAD_LIFT })
|
|
55
|
+
}
|
|
56
|
+
for (const e of activityEdges(lastInFlight, anchors, placements, now)) {
|
|
57
|
+
fedSvg.push(...fedEdge(e, 'e-activity', e.label))
|
|
58
|
+
}
|
|
59
|
+
for (const e of federalEdges(placements, bounds)) {
|
|
60
|
+
fedSvg.push(...fedEdge(e, 'e-federal', e.label))
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** One overlay line + its optional midpoint label (offset +14/+18). */
|
|
66
|
+
function fedEdge(
|
|
67
|
+
e: { x1: number; y1: number; x2: number; y2: number },
|
|
68
|
+
cls: string,
|
|
69
|
+
label: string,
|
|
70
|
+
): SVGElement[] {
|
|
71
|
+
const line = document.createElementNS('http://www.w3.org/2000/svg', 'line')
|
|
72
|
+
line.setAttribute('class', cls)
|
|
73
|
+
line.setAttribute('x1', String(e.x1))
|
|
74
|
+
line.setAttribute('y1', String(e.y1))
|
|
75
|
+
line.setAttribute('x2', String(e.x2))
|
|
76
|
+
line.setAttribute('y2', String(e.y2))
|
|
77
|
+
svg.appendChild(line)
|
|
78
|
+
const out: SVGElement[] = [line]
|
|
79
|
+
if (label !== '') {
|
|
80
|
+
const t = document.createElementNS('http://www.w3.org/2000/svg', 'text')
|
|
81
|
+
t.setAttribute('class', 'edge-label mono')
|
|
82
|
+
t.setAttribute('x', String((e.x1 + e.x2) / 2 + 14))
|
|
83
|
+
t.setAttribute('y', String((e.y1 + e.y2) / 2 + 18))
|
|
84
|
+
t.textContent = label
|
|
85
|
+
svg.appendChild(t)
|
|
86
|
+
out.push(t)
|
|
87
|
+
}
|
|
88
|
+
return out
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return {
|
|
92
|
+
render,
|
|
93
|
+
flyTo(viewportApply: () => void): PeerPlacement[] {
|
|
94
|
+
viewportApply()
|
|
95
|
+
return lastPlacements
|
|
96
|
+
},
|
|
97
|
+
placements: () => lastPlacements,
|
|
98
|
+
setInFlight: rows => { lastInFlight = rows },
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The fly-bounds helper re-export for the view's statusbar fit. */
|
|
103
|
+
export { flyBounds }
|