@yaks/visualize 0.0.0-stage → 0.2.36

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 (83) hide show
  1. package/ActivityView.tsx +370 -0
  2. package/AnatomyList.tsx +183 -0
  3. package/Atlas.tsx +490 -0
  4. package/Detail.tsx +464 -0
  5. package/LICENSE +202 -0
  6. package/README.md +180 -2
  7. package/SectionHead.tsx +18 -0
  8. package/Topology.tsx +596 -0
  9. package/_dist/activity.d.ts +15 -0
  10. package/_dist/activity.d.ts.map +1 -0
  11. package/_dist/capture.d.ts +19 -0
  12. package/_dist/capture.d.ts.map +1 -0
  13. package/_dist/cli.d.ts +6 -0
  14. package/_dist/cli.d.ts.map +1 -0
  15. package/_dist/front.d.ts +6 -0
  16. package/_dist/front.d.ts.map +1 -0
  17. package/_dist/http.d.ts +21 -0
  18. package/_dist/http.d.ts.map +1 -0
  19. package/_dist/main.d.ts +2 -0
  20. package/_dist/main.d.ts.map +1 -0
  21. package/_dist/mod.d.ts +6 -0
  22. package/_dist/mod.d.ts.map +1 -0
  23. package/_dist/model.d.ts +55 -0
  24. package/_dist/model.d.ts.map +1 -0
  25. package/_dist/parts.d.ts +19 -0
  26. package/_dist/parts.d.ts.map +1 -0
  27. package/_dist/routes.d.ts +7 -0
  28. package/_dist/routes.d.ts.map +1 -0
  29. package/_dist/snapshot.d.ts +38 -0
  30. package/_dist/snapshot.d.ts.map +1 -0
  31. package/_dist/stream.d.ts +3 -0
  32. package/_dist/stream.d.ts.map +1 -0
  33. package/_dist/tools.d.ts +10 -0
  34. package/_dist/tools.d.ts.map +1 -0
  35. package/_dist/vocab.d.ts +5 -0
  36. package/_dist/vocab.d.ts.map +1 -0
  37. package/activity.js +73 -0
  38. package/activity.js.map +1 -0
  39. package/activity.ts +104 -0
  40. package/capture.js +46 -0
  41. package/capture.js.map +1 -0
  42. package/capture.ts +68 -0
  43. package/cli.js +173 -0
  44. package/cli.js.map +1 -0
  45. package/cli.ts +200 -0
  46. package/deno.json +1 -0
  47. package/front.js +21 -0
  48. package/front.js.map +1 -0
  49. package/front.json +210 -0
  50. package/front.ts +22 -0
  51. package/http.js +290 -0
  52. package/http.js.map +1 -0
  53. package/http.ts +338 -0
  54. package/main.js +51 -0
  55. package/main.js.map +1 -0
  56. package/main.ts +50 -0
  57. package/mod.js +6 -0
  58. package/mod.js.map +1 -0
  59. package/mod.ts +15 -0
  60. package/model.js +551 -0
  61. package/model.js.map +1 -0
  62. package/model.ts +543 -0
  63. package/package.json +76 -4
  64. package/parts.js +70 -0
  65. package/parts.js.map +1 -0
  66. package/parts.ts +113 -0
  67. package/routes.js +53 -0
  68. package/routes.js.map +1 -0
  69. package/routes.ts +76 -0
  70. package/snapshot.js +117 -0
  71. package/snapshot.js.map +1 -0
  72. package/snapshot.ts +157 -0
  73. package/stream.js +73 -0
  74. package/stream.js.map +1 -0
  75. package/stream.ts +95 -0
  76. package/tools.js +64 -0
  77. package/tools.js.map +1 -0
  78. package/tools.ts +79 -0
  79. package/visualize.css +1787 -0
  80. package/vocab.js +13 -0
  81. package/vocab.js.map +1 -0
  82. package/vocab.json +97 -0
  83. package/vocab.ts +14 -0
package/cli.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sources":["./cli.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAMvE,SAAS,MAAM,wBAAsC;AAErD,IAAI,UAAU,CAAC;EACb,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG;EAC9B,IAAI,QAAQ;IAAC,CAAC,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;GAAC;EAC1E,IAAI,WAAW;IACb,MAAM,IAAI,CACR,CAAC,OAAO,EAAE,UAAU,KAAK,CAAC,QAAQ,EAAE,UAAU,OAAO,CAAC,UAAU,CAAC,GAC/D,GAAG,UAAU,KAAK,CAAC,MAAM,EAAE,UAAU,SAA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C,GAAG,CAAC,KAAK,OAAO;UACnC;QACF;QACA,IAAI,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC;QAChC,IAAI,QAAQ,MAAM,SAAS,KAAK;UAAE,GAAG,OAAO;UAAE;UAAK;QAAM;QACzD,QAAQ,GAAG,CACT,QAAQ,IAAI,IAAI,KAAK,IAAI,GACrB,KAAK,SAAS,CAAC,SACf,QAAQ,YACR,QAAQ,SACR,SAAS;QAEf,OAAO;MACT,EAAE,OAAO,OAAO;QACd,QAAQ,IAAI,CACV,CAAC,WAAW,EAAE,iBAAiB,QAAQ,MAAM,OAAO,GAAG,OAAO,QAAQ;QAExE,OAAO;MACT;IACF;EACF,CAAsB,EAAC;AAEvB,OAAO,IAAI,WAAyB;EAAC;CAAU,CAAA"}
package/cli.ts ADDED
@@ -0,0 +1,200 @@
1
+ // The command reads the serving process, not a freshly composed graph.
2
+
3
+ import type { AccountOptions, Ctx } from '@yaks/cli'
4
+ import type { Host } from 'jsr:@yaks/host@0.2.36'
5
+ import type { CliCommand } from 'jsr:@yaks/cli@0.2.36/host'
6
+ import type { Capture } from './capture.ts'
7
+ import { GROUPS, type Snapshot } from './snapshot.js'
8
+
9
+ let anatomy = (value: Snapshot): string => {
10
+ let { selection, coverage } = value
11
+ let lines = [`anatomy: ${value.anatomy.host} (snapshot ${value.takenAt})`]
12
+ if (selection) {
13
+ lines.push(
14
+ `nodes: ${selection.shown} shown, ${selection.matched} matched, ` +
15
+ `${selection.total} total${selection.truncated ? ' (truncated)' : ''}`,
16
+ )
17
+ }
18
+ for (let group of GROUPS) {
19
+ let parts = value.anatomy[group]
20
+ if (!parts.length) continue
21
+ lines.push(
22
+ `${group}: ${parts.length}; ` +
23
+ `declared ${parts.filter((p) => p.declared).length}, ` +
24
+ `loaded ${parts.filter((p) => p.loaded).length}, ` +
25
+ `bound ${parts.filter((p) => p.bound).length}`,
26
+ )
27
+ }
28
+ lines.push(`edges: ${value.anatomy.edges.length}`)
29
+ lines.push(
30
+ `coverage: ${coverage.scope}; activity ${coverage.activity}; ` +
31
+ `recording ${coverage.recording}`,
32
+ )
33
+ let unknown = Object.entries(coverage.observed)
34
+ .filter(([, observed]) => !observed).map(([group]) => group)
35
+ if (unknown.length) lines.push(`unobserved: ${unknown.join(', ')}`)
36
+ return lines.join('\n')
37
+ }
38
+
39
+ let activity = (value: Capture): string => {
40
+ let lines = [
41
+ `activity: ${value.epoch}; ${value.events.length} events; omitted records ${value.gap}`,
42
+ `coverage: ${value.coverage}; recording is subscriber-only`,
43
+ ]
44
+ let recent = value.events.slice(-8)
45
+ if (recent.length < value.events.length) {
46
+ lines.push(
47
+ `latest ${recent.length} events (use --json for the full capture)`,
48
+ )
49
+ }
50
+ for (let event of recent) {
51
+ lines.push(
52
+ `${event.seq} ${event.stage} ${event.kind}:${event.name} span ${event.id}` +
53
+ (event.parent ? ` parent ${event.parent}` : '') +
54
+ (event.duration == null ? '' : ` ${event.duration}ms`) +
55
+ (event.outcome ? ` ${event.outcome}` : ''),
56
+ )
57
+ }
58
+ if (!recent.length) lines.push('no recorded events in this capture')
59
+ return lines.join('\n')
60
+ }
61
+
62
+ /** The CLI door into the same served snapshots used by the page. */
63
+ export let command = ({ fetch = globalThis.fetch, env }: {
64
+ fetch?: typeof globalThis.fetch
65
+ env?: AccountOptions['env']
66
+ } = {}) => ({
67
+ name: 'visualize',
68
+ description:
69
+ 'Read the serving platform’s anatomy or bounded causal activity. ' +
70
+ 'The page is /visualize; these snapshots carry explicit coverage.',
71
+ inputSchema: {
72
+ type: 'object',
73
+ additionalProperties: false,
74
+ properties: {
75
+ what: {
76
+ type: 'string',
77
+ enum: ['anatomy', 'activity'],
78
+ default: 'anatomy',
79
+ description: 'which served snapshot to read',
80
+ },
81
+ group: {
82
+ type: 'string',
83
+ enum: [
84
+ 'packages',
85
+ 'roles',
86
+ 'facets',
87
+ 'comps',
88
+ 'tools',
89
+ 'commands',
90
+ 'effects',
91
+ 'rules',
92
+ 'hooks',
93
+ 'routes',
94
+ 'views',
95
+ 'inspectViews',
96
+ 'tui',
97
+ 'kits',
98
+ 'themes',
99
+ 'skills',
100
+ 'secrets',
101
+ ],
102
+ description: 'one anatomy group; omitted means all groups',
103
+ },
104
+ search: {
105
+ type: 'string',
106
+ description: 'plain-text anatomy search, not a graph query',
107
+ },
108
+ id: {
109
+ type: 'string',
110
+ description: 'an exact anatomy part id, not a stored entity id',
111
+ },
112
+ limit: {
113
+ type: 'integer',
114
+ minimum: 1,
115
+ maximum: 5000,
116
+ description:
117
+ 'maximum nodes (default 1000, max 5000) or activity events ' +
118
+ '(default and max 256)',
119
+ },
120
+ wait: {
121
+ type: 'integer',
122
+ minimum: 0,
123
+ maximum: 2000,
124
+ default: 0,
125
+ description:
126
+ 'activity capture milliseconds; zero reads available history',
127
+ },
128
+ json: {
129
+ type: 'boolean',
130
+ description: 'print the exact returned JSON snapshot or capture',
131
+ },
132
+ url: {
133
+ type: 'string',
134
+ description: 'HTTP(S) origin of yak serve; defaults to native config',
135
+ },
136
+ },
137
+ },
138
+ positional: ['what'],
139
+ run: async (
140
+ args: Record<string, unknown>,
141
+ host: Pick<Host, 'config'>,
142
+ context: Pick<
143
+ Ctx,
144
+ 'host' | 'config' | 'as' | 'json' | 'state' | 'via' | 'out' | 'note'
145
+ >,
146
+ ): Promise<number> => {
147
+ try {
148
+ let what = args.what ?? 'anatomy'
149
+ if (what != 'anatomy' && what != 'activity') {
150
+ throw new Error('choose anatomy or activity')
151
+ }
152
+ if (
153
+ what == 'activity' && ['group', 'search', 'id'].some((k) => k in args)
154
+ ) {
155
+ throw new Error('--group, --search and --id apply only to anatomy')
156
+ }
157
+ if (what == 'anatomy' && args.wait != null && args.wait != 0) {
158
+ throw new Error('--wait applies only to activity')
159
+ }
160
+ let base = args.url
161
+ if (typeof base != 'string') {
162
+ base = (await import('@yaks/api/address')).served(host.config)
163
+ }
164
+ let origin = new URL(base as string)
165
+ if (!['http:', 'https:'].includes(origin.protocol)) {
166
+ throw new Error('--url must be an HTTP(S) origin')
167
+ }
168
+ if (origin.username || origin.password) {
169
+ throw new Error('--url must not contain credentials')
170
+ }
171
+ let url = new URL(`/visualize/${what}`, origin)
172
+ let keys = what == 'anatomy'
173
+ ? ['group', 'search', 'id', 'limit']
174
+ : ['limit', 'wait']
175
+ for (let key of keys) {
176
+ let value = args[key]
177
+ if (typeof value == 'string' || typeof value == 'number') {
178
+ url.searchParams.set(key, String(value))
179
+ }
180
+ }
181
+ let { readJson } = await import('@yaks/cli')
182
+ let value = await readJson(url, { ...context, env, fetch })
183
+ context.out(
184
+ context.json || args.json
185
+ ? JSON.stringify(value)
186
+ : what == 'anatomy'
187
+ ? anatomy(value as Snapshot)
188
+ : activity(value as Capture),
189
+ )
190
+ return 0
191
+ } catch (error) {
192
+ context.note(
193
+ `visualize: ${error instanceof Error ? error.message : String(error)}`,
194
+ )
195
+ return 1
196
+ }
197
+ },
198
+ } satisfies CliCommand)
199
+
200
+ export let commands: CliCommand[] = [command()]
package/deno.json ADDED
@@ -0,0 +1 @@
1
+ {"publish":{"exclude":["**/*_test.ts","./testing.ts"]},"name":"@yaks/visualize","version":"0.2.36","license":"Apache-2.0","description":"A value-free atlas of a composed platform and its subscriber-owned live causal activity, on /visualize and through agent doors.","exports":{".":"./mod.ts","./snapshot":"./snapshot.ts","./activity":"./activity.ts","./capture":"./capture.ts","./http":"./http.ts","./front":"./front.ts","./model":"./model.ts","./routes":"./routes.ts","./cli":"./cli.ts","./tools":"./tools.ts","./vocab":"./vocab.ts","./main":"./main.ts"},"imports":{"@yaks/visualize":"./mod.ts","@yaks/visualize/snapshot":"./snapshot.ts","@yaks/visualize/activity":"./activity.ts","@yaks/visualize/capture":"./capture.ts","@yaks/visualize/http":"./http.ts","@yaks/visualize/front":"./front.ts","@yaks/visualize/model":"./model.ts","@yaks/visualize/routes":"./routes.ts","@yaks/visualize/cli":"./cli.ts","@yaks/visualize/tools":"./tools.ts","@yaks/visualize/vocab":"./vocab.ts","@yaks/visualize/main":"./main.ts"}}
package/front.js ADDED
@@ -0,0 +1,21 @@
1
+ /** Page-private vocabulary, not the host's ./vocab facet. */ import { docs as sharedDraftDocs } from "@yaks/draft";
2
+ import doc from './front.json' with {
3
+ type: 'json'
4
+ };
5
+ export let frontDoc = doc;
6
+ export let docs = [
7
+ frontDoc
8
+ ];
9
+ /** Reuse the draft contract, changing only this local graph's lifetimes.
10
+ * No duplicate component declaration and no host vocabulary override. */ export let draftDocs = sharedDraftDocs.map((source)=>({
11
+ ...source,
12
+ $defs: Object.fromEntries(Object.entries(source.$defs ?? {}).map(([name, schema])=>[
13
+ name,
14
+ {
15
+ ...schema,
16
+ sync: 'none',
17
+ durable: name == 'typed' ? '0s' : 'connection'
18
+ }
19
+ ]))
20
+ }));
21
+ //# sourceMappingURL=front.js.map
package/front.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"front.js","sources":["./front.ts"],"names":[],"mappings":"AAAA,2DAA2D,GAC3D,SAAS,QAAQ,eAAe,2BAAgC;AAEhE,OAAO,SAAS,oBAAoB;EAAE,MAAM;AAAO,EAAC;AAEpD,OAAO,IAAI,WAAW,IAA0B;AAChD,OAAO,IAAI,OAAmB;EAAC;CAAS,CAAA;AAExC;uEACuE,GACvE,OAAO,IAAI,YAAwB,gBAAgB,GAAG,CAAC,CAAC,SAAW,CAAC;IAClE,GAAG,MAAM;IACT,OAAO,OAAO,WAAW,CACvB,OAAO,OAAO,CAAC,OAAO,KAAK,IAAI,CAAC,GAAG,GAAG,CACpC,CAAC,CAAC,MAAM,OAAO,GAAK;QAAC;QAAM;UACzB,GAAG,MAAM;UACT,MAAM;UACN,SAAS,QAAQ,UAAU,OAAO;QACpC;OAAE;EAGR,CAAC,GAAE"}
package/front.json ADDED
@@ -0,0 +1,210 @@
1
+ {
2
+ "$vocabulary": {
3
+ "https://yak.sh/vocab/core": true
4
+ },
5
+ "title": "visualize front",
6
+ "description": "The MRI page's own state. Never synced or stored past the connection; not a host vocabulary facet.",
7
+ "$defs": {
8
+ "Visualize": {
9
+ "component": true,
10
+ "type": "object",
11
+ "sync": "none",
12
+ "durable": "connection",
13
+ "description": "Navigation, camera, appearance and observation status of one MRI page.",
14
+ "properties": {
15
+ "selected": {
16
+ "type": "string",
17
+ "ref": "entity",
18
+ "death": "detach"
19
+ },
20
+ "cause": {
21
+ "type": "string",
22
+ "ref": "entity",
23
+ "death": "detach"
24
+ },
25
+ "group": {
26
+ "type": "string"
27
+ },
28
+ "listPage": {
29
+ "type": "integer",
30
+ "minimum": 0
31
+ },
32
+ "paused": {
33
+ "type": "boolean"
34
+ },
35
+ "view": {
36
+ "type": "string",
37
+ "enum": [
38
+ "map",
39
+ "list"
40
+ ]
41
+ },
42
+ "theme": {
43
+ "type": "string",
44
+ "enum": [
45
+ "everforest",
46
+ "rosepine"
47
+ ]
48
+ },
49
+ "scheme": {
50
+ "type": "string",
51
+ "enum": [
52
+ "dark",
53
+ "light"
54
+ ]
55
+ },
56
+ "x": {
57
+ "type": "number"
58
+ },
59
+ "y": {
60
+ "type": "number"
61
+ },
62
+ "zoom": {
63
+ "type": "number",
64
+ "minimum": 0.35,
65
+ "maximum": 3
66
+ },
67
+ "connected": {
68
+ "type": "string",
69
+ "enum": [
70
+ "connecting",
71
+ "live",
72
+ "reconnecting",
73
+ "paused",
74
+ "offline"
75
+ ]
76
+ },
77
+ "gap": {
78
+ "type": "integer",
79
+ "minimum": 0
80
+ },
81
+ "received": {
82
+ "type": "integer",
83
+ "minimum": 0
84
+ },
85
+ "error": {
86
+ "type": "string"
87
+ },
88
+ "host": {
89
+ "type": "string"
90
+ }
91
+ }
92
+ },
93
+ "AtlasPart": {
94
+ "component": true,
95
+ "type": "object",
96
+ "sync": "none",
97
+ "durable": "connection",
98
+ "description": "One value-free anatomy part, with the supplier's public identity and contract.",
99
+ "properties": {
100
+ "id": {
101
+ "type": "string"
102
+ },
103
+ "name": {
104
+ "type": "string"
105
+ },
106
+ "group": {
107
+ "type": "string"
108
+ },
109
+ "package": {
110
+ "type": "string"
111
+ },
112
+ "facet": {
113
+ "type": "string"
114
+ },
115
+ "description": {
116
+ "type": "string"
117
+ },
118
+ "declared": {
119
+ "type": "boolean"
120
+ },
121
+ "loaded": {
122
+ "type": "boolean"
123
+ },
124
+ "bound": {
125
+ "type": "boolean"
126
+ },
127
+ "detail": {
128
+ "type": "object"
129
+ }
130
+ }
131
+ },
132
+ "AtlasRelation": {
133
+ "component": true,
134
+ "type": "object",
135
+ "sync": "none",
136
+ "durable": "connection",
137
+ "description": "A supplier's relationship, with real references to page-local anatomy entities.",
138
+ "properties": {
139
+ "id": {
140
+ "type": "string"
141
+ },
142
+ "kind": {
143
+ "type": "string"
144
+ },
145
+ "from": {
146
+ "type": "string",
147
+ "ref": "entity",
148
+ "death": "detach"
149
+ },
150
+ "to": {
151
+ "type": "string",
152
+ "ref": "entity",
153
+ "death": "detach"
154
+ }
155
+ }
156
+ },
157
+ "AtlasEvent": {
158
+ "component": true,
159
+ "type": "object",
160
+ "sync": "none",
161
+ "durable": "connection",
162
+ "description": "A retained shared-channel observation. At most 256 records; no entity data.",
163
+ "properties": {
164
+ "seq": {
165
+ "type": "integer"
166
+ },
167
+ "epoch": {
168
+ "type": "string"
169
+ },
170
+ "span": {
171
+ "type": "string"
172
+ },
173
+ "parent": {
174
+ "type": "string",
175
+ "ref": "entity",
176
+ "death": "detach"
177
+ },
178
+ "node": {
179
+ "type": "string",
180
+ "ref": "entity",
181
+ "death": "detach"
182
+ },
183
+ "data": {
184
+ "type": "object"
185
+ }
186
+ }
187
+ },
188
+ "AtlasCoverage": {
189
+ "component": true,
190
+ "type": "object",
191
+ "sync": "none",
192
+ "durable": "connection",
193
+ "description": "Whether the supplier actually observed each composition category, not inferred absence.",
194
+ "properties": {
195
+ "scope": {
196
+ "type": "string"
197
+ },
198
+ "observed": {
199
+ "type": "object"
200
+ },
201
+ "takenAt": {
202
+ "type": "string"
203
+ },
204
+ "epoch": {
205
+ "type": "string"
206
+ }
207
+ }
208
+ }
209
+ }
210
+ }
package/front.ts ADDED
@@ -0,0 +1,22 @@
1
+ /** Page-private vocabulary, not the host's ./vocab facet. */
2
+ import { docs as sharedDraftDocs } from '@yaks/draft'
3
+ import type { VocabDoc } from 'jsr:@yaks/vocab@0.2.36'
4
+ import doc from './front.json' with { type: 'json' }
5
+
6
+ export let frontDoc = doc as unknown as VocabDoc
7
+ export let docs: VocabDoc[] = [frontDoc]
8
+
9
+ /** Reuse the draft contract, changing only this local graph's lifetimes.
10
+ * No duplicate component declaration and no host vocabulary override. */
11
+ export let draftDocs: VocabDoc[] = sharedDraftDocs.map((source) => ({
12
+ ...source,
13
+ $defs: Object.fromEntries(
14
+ Object.entries(source.$defs ?? {}).map(
15
+ ([name, schema]) => [name, {
16
+ ...schema,
17
+ sync: 'none',
18
+ durable: name == 'typed' ? '0s' : 'connection',
19
+ }],
20
+ ),
21
+ ),
22
+ }))