@nelsonlongxiang/dsh-open-a2a-net 0.6.41 → 0.6.42
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 +1 -1
- package/README_zh.md +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/lib/client.js +64 -64
- package/lib/client.js.map +1 -1
- package/lib/index.js +57 -9
- 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/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 +513 -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 +1272 -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
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Owner vs mirror on the board (owner ruling 2026-10-29, PR#96: canvas sync
|
|
3
|
-
* is single owner + mirror). A team belongs to the host that made it; every
|
|
4
|
-
* other host renders it as a MIRROR of that host's published card and edits
|
|
5
|
-
* it through the fleet relay. The frame head says so: 「镜像 · <owner host>」,
|
|
6
|
-
* and 「同步中…」 from the moment a relayed edit is sent until the owner
|
|
7
|
-
* answers (the relay then re-reads the owner's card in the background, and
|
|
8
|
-
* the owner's own change ping backs it up). Local frames carry no marker —
|
|
9
|
-
* this host is their owner.
|
|
10
|
-
* @module nexus-stage/planning-mirror
|
|
11
|
-
*/
|
|
12
|
-
import { peerHostOf } from './federation'
|
|
13
|
-
|
|
14
|
-
export interface MirrorRoute {
|
|
15
|
-
readonly text: string
|
|
16
|
-
readonly title: string
|
|
17
|
-
readonly syncing: boolean
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** The route line of a remote (mirrored) frame; undefined for a local frame. */
|
|
21
|
-
export function mirrorRoute(ownerUrl: string | undefined, syncing: boolean): MirrorRoute | undefined {
|
|
22
|
-
if (ownerUrl === undefined) return undefined
|
|
23
|
-
const host = peerHostOf(ownerUrl)
|
|
24
|
-
return {
|
|
25
|
-
text: syncing ? `同步中… · ${host}` : `镜像 · ${host}`,
|
|
26
|
-
title: syncing
|
|
27
|
-
? `已把改动交给属主 ${host},等待它确认`
|
|
28
|
-
: `这个团队属于 ${host},这里显示的是它的镜像;拖入或移出成员会经中继交给 ${host} 执行`,
|
|
29
|
-
syncing,
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
type MirrorOrg = ReadonlyArray<{ readonly url: string; readonly org: ReadonlyArray<{ readonly name: string }> }>
|
|
34
|
-
|
|
35
|
-
/** After the owner accepted a dissolve, hide its team at most this long: a
|
|
36
|
-
* peer's late add-member re-creates the team on the owner, and then it is
|
|
37
|
-
* real again even though the owner's org never stopped listing it. */
|
|
38
|
-
export const DISSOLVE_HIDE_MS = 10_000
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* 解散 on a mirror frame: the frame stays gone from the moment the dissolve
|
|
42
|
-
* is sent until the owner's published org stops listing the team (or
|
|
43
|
-
* DISSOLVE_HIDE_MS after the owner accepted). Without this, a poll that lands
|
|
44
|
-
* while the relay is in flight — or before the owner's card is re-read —
|
|
45
|
-
* draws the frame again (and keeps its saved rect for a later team of the
|
|
46
|
-
* same name). Keyed by owner AND name: two owners may both have a team X.
|
|
47
|
-
*/
|
|
48
|
-
export function createDissolveGuard(now: () => number = Date.now) {
|
|
49
|
-
const key = (ownerUrl: string, name: string): string => `${ownerUrl}\u0000${name}`
|
|
50
|
-
const dissolving = new Map<string, { url: string; name: string; acceptedAt?: number }>()
|
|
51
|
-
return {
|
|
52
|
-
/** Mark the dissolve and return the action carrying its owner (the relay fork). */
|
|
53
|
-
fork<A extends { type: 'remove-team'; name: string }>(act: A, ownerUrl: string): A & { fleetPeer: string } {
|
|
54
|
-
dissolving.set(key(ownerUrl, act.name), { url: ownerUrl, name: act.name })
|
|
55
|
-
return { ...act, fleetPeer: ownerUrl }
|
|
56
|
-
},
|
|
57
|
-
/** The owner answered: a refusal (or a failed channel) lets the frame back now, an acceptance starts the clock. */
|
|
58
|
-
settled(act: { type: string; name?: string; fleetPeer?: string }, ok: boolean): void {
|
|
59
|
-
if (act.type !== 'remove-team' || act.name === undefined || act.fleetPeer === undefined) return
|
|
60
|
-
const entry = dissolving.get(key(act.fleetPeer, act.name))
|
|
61
|
-
if (entry === undefined) return
|
|
62
|
-
if (ok) entry.acceptedAt = now()
|
|
63
|
-
else dissolving.delete(key(act.fleetPeer, act.name))
|
|
64
|
-
},
|
|
65
|
-
/** True while this owner's team is being (or has just been) dissolved here. */
|
|
66
|
-
hides(name: string, ownerUrl: string): boolean { return dissolving.has(key(ownerUrl, name)) },
|
|
67
|
-
/** Forget a dissolve once its owner's org no longer lists the team, or once its time is up. */
|
|
68
|
-
sweep(peerOrg: MirrorOrg): void {
|
|
69
|
-
for (const [k, e] of dissolving) {
|
|
70
|
-
const listed = peerOrg.find(row => row.url === e.url)?.org.some(t => t.name === e.name) === true
|
|
71
|
-
if (!listed || (e.acceptedAt !== undefined && now() - e.acceptedAt > DISSOLVE_HIDE_MS)) dissolving.delete(k)
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
}
|
|
75
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Owner vs mirror on the board (owner ruling 2026-10-29, PR#96: canvas sync
|
|
3
|
+
* is single owner + mirror). A team belongs to the host that made it; every
|
|
4
|
+
* other host renders it as a MIRROR of that host's published card and edits
|
|
5
|
+
* it through the fleet relay. The frame head says so: 「镜像 · <owner host>」,
|
|
6
|
+
* and 「同步中…」 from the moment a relayed edit is sent until the owner
|
|
7
|
+
* answers (the relay then re-reads the owner's card in the background, and
|
|
8
|
+
* the owner's own change ping backs it up). Local frames carry no marker —
|
|
9
|
+
* this host is their owner.
|
|
10
|
+
* @module nexus-stage/planning-mirror
|
|
11
|
+
*/
|
|
12
|
+
import { peerHostOf } from './federation'
|
|
13
|
+
|
|
14
|
+
export interface MirrorRoute {
|
|
15
|
+
readonly text: string
|
|
16
|
+
readonly title: string
|
|
17
|
+
readonly syncing: boolean
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** The route line of a remote (mirrored) frame; undefined for a local frame. */
|
|
21
|
+
export function mirrorRoute(ownerUrl: string | undefined, syncing: boolean): MirrorRoute | undefined {
|
|
22
|
+
if (ownerUrl === undefined) return undefined
|
|
23
|
+
const host = peerHostOf(ownerUrl)
|
|
24
|
+
return {
|
|
25
|
+
text: syncing ? `同步中… · ${host}` : `镜像 · ${host}`,
|
|
26
|
+
title: syncing
|
|
27
|
+
? `已把改动交给属主 ${host},等待它确认`
|
|
28
|
+
: `这个团队属于 ${host},这里显示的是它的镜像;拖入或移出成员会经中继交给 ${host} 执行`,
|
|
29
|
+
syncing,
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
type MirrorOrg = ReadonlyArray<{ readonly url: string; readonly org: ReadonlyArray<{ readonly name: string }> }>
|
|
34
|
+
|
|
35
|
+
/** After the owner accepted a dissolve, hide its team at most this long: a
|
|
36
|
+
* peer's late add-member re-creates the team on the owner, and then it is
|
|
37
|
+
* real again even though the owner's org never stopped listing it. */
|
|
38
|
+
export const DISSOLVE_HIDE_MS = 10_000
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* 解散 on a mirror frame: the frame stays gone from the moment the dissolve
|
|
42
|
+
* is sent until the owner's published org stops listing the team (or
|
|
43
|
+
* DISSOLVE_HIDE_MS after the owner accepted). Without this, a poll that lands
|
|
44
|
+
* while the relay is in flight — or before the owner's card is re-read —
|
|
45
|
+
* draws the frame again (and keeps its saved rect for a later team of the
|
|
46
|
+
* same name). Keyed by owner AND name: two owners may both have a team X.
|
|
47
|
+
*/
|
|
48
|
+
export function createDissolveGuard(now: () => number = Date.now) {
|
|
49
|
+
const key = (ownerUrl: string, name: string): string => `${ownerUrl}\u0000${name}`
|
|
50
|
+
const dissolving = new Map<string, { url: string; name: string; acceptedAt?: number }>()
|
|
51
|
+
return {
|
|
52
|
+
/** Mark the dissolve and return the action carrying its owner (the relay fork). */
|
|
53
|
+
fork<A extends { type: 'remove-team'; name: string }>(act: A, ownerUrl: string): A & { fleetPeer: string } {
|
|
54
|
+
dissolving.set(key(ownerUrl, act.name), { url: ownerUrl, name: act.name })
|
|
55
|
+
return { ...act, fleetPeer: ownerUrl }
|
|
56
|
+
},
|
|
57
|
+
/** The owner answered: a refusal (or a failed channel) lets the frame back now, an acceptance starts the clock. */
|
|
58
|
+
settled(act: { type: string; name?: string; fleetPeer?: string }, ok: boolean): void {
|
|
59
|
+
if (act.type !== 'remove-team' || act.name === undefined || act.fleetPeer === undefined) return
|
|
60
|
+
const entry = dissolving.get(key(act.fleetPeer, act.name))
|
|
61
|
+
if (entry === undefined) return
|
|
62
|
+
if (ok) entry.acceptedAt = now()
|
|
63
|
+
else dissolving.delete(key(act.fleetPeer, act.name))
|
|
64
|
+
},
|
|
65
|
+
/** True while this owner's team is being (or has just been) dissolved here. */
|
|
66
|
+
hides(name: string, ownerUrl: string): boolean { return dissolving.has(key(ownerUrl, name)) },
|
|
67
|
+
/** Forget a dissolve once its owner's org no longer lists the team, or once its time is up. */
|
|
68
|
+
sweep(peerOrg: MirrorOrg): void {
|
|
69
|
+
for (const [k, e] of dissolving) {
|
|
70
|
+
const listed = peerOrg.find(row => row.url === e.url)?.org.some(t => t.name === e.name) === true
|
|
71
|
+
if (!listed || (e.acceptedAt !== undefined && now() - e.acceptedAt > DISSOLVE_HIDE_MS)) dissolving.delete(k)
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
}
|
|
75
|
+
}
|