@skill-map/cli 0.53.2 → 0.53.4

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 (27) hide show
  1. package/dist/cli/tutorial/sm-tutorial/SKILL.md +112 -52
  2. package/dist/cli/tutorial/sm-tutorial/references/_core.md +65 -15
  3. package/dist/cli/tutorial/sm-tutorial/references/_manifest.yml +31 -16
  4. package/dist/cli/tutorial/sm-tutorial/references/fixtures.md +50 -27
  5. package/dist/cli/tutorial/sm-tutorial/references/part-authoring.md +7 -7
  6. package/dist/cli/tutorial/sm-tutorial/references/part-cli.md +2 -2
  7. package/dist/cli/tutorial/sm-tutorial/references/part-connect-harness.md +14 -11
  8. package/dist/cli/tutorial/sm-tutorial/references/part-fundamentals.md +16 -22
  9. package/dist/cli/tutorial/sm-tutorial/references/part-live-site.md +111 -112
  10. package/dist/cli/tutorial/sm-tutorial/references/part-maintain.md +19 -4
  11. package/dist/cli/tutorial/sm-tutorial/references/part-mcp.md +4 -4
  12. package/dist/cli/tutorial/sm-tutorial/references/part-plugins.md +5 -4
  13. package/dist/cli/tutorial/sm-tutorial/references/part-project-kickoff.md +11 -13
  14. package/dist/cli/tutorial/sm-tutorial/references/part-run-harness.md +155 -0
  15. package/dist/cli/tutorial/sm-tutorial/references/part-settings.md +6 -5
  16. package/dist/cli.js +3 -3
  17. package/dist/index.js +3 -3
  18. package/dist/kernel/index.js +3 -3
  19. package/dist/ui/{chunk-OFDQMBSJ.js → chunk-4CXAL43H.js} +1 -1
  20. package/dist/ui/{chunk-IUZM6XLN.js → chunk-HWQTV6ZL.js} +1 -1
  21. package/dist/ui/{chunk-UHNBYD6J.js → chunk-JQE4N6JU.js} +3 -3
  22. package/dist/ui/{chunk-EQ72PEHT.js → chunk-NBXEOYS4.js} +1 -1
  23. package/dist/ui/{chunk-UV5Q423S.js → chunk-R2IJXS47.js} +3 -3
  24. package/dist/ui/index.html +2 -2
  25. package/dist/ui/{main-TXPLL7VU.js → main-ZXOCLPLS.js} +3 -3
  26. package/dist/ui/{styles-Q4NCOJQY.css → styles-L6FZYH7X.css} +1 -1
  27. package/package.json +1 -1
@@ -0,0 +1,155 @@
1
+ # Part 3: Run the harness (your site, live) (step library, `generate` + `serve`)
2
+
3
+ The first payoff: the harness you built and wired in the earlier parts
4
+ finally does its job and you see a real site running, without waiting
5
+ for the finale. Pace `auto-advance`, preflight `seed` (`harness-connected`,
6
+ so a tester can jump straight here). Two chapters, in order:
7
+ `generate` (the agent writes the HTML pages) then `serve` (the tester
8
+ runs the site and sees it next to the graph). This is a deliberately
9
+ simple, working pass: maintenance, MCP and the full publish pipeline
10
+ come in the parts after it. Shared conventions live in `_core.md`.
11
+
12
+ These two HTML pages are the canonical site fixture: the full
13
+ publish finale (`live-site`) lays the same `public/index.html` and
14
+ `public/about.html` from here before adding its own extra page, so keep
15
+ them in sync here only.
16
+
17
+ ## Chapter `generate` - The agent generates the HTML in public/ (~3 min)
18
+
19
+ **Context**: the `content-editor` agent exists to write the site's
20
+ pages, so now you (playing that agent) generate the actual HTML into
21
+ `public/`. The honest beat the tester must hear: writing HTML does NOT
22
+ move the skill-map graph. The graph is Layer 1, the `.md` harness that
23
+ builds the site; the HTML is Layer 2, the harness's OUTPUT, and
24
+ skill-map does not map it (HTML is not `.md`). So the Map will sit
25
+ still while real files land on disk, and that is correct, not a bug.
26
+ Keep the markup plain per the style guide: no framework, no client JS,
27
+ one H1 per page, every page links back home.
28
+
29
+ **Preparation**: `Write` two static pages into `public/`. The
30
+ pre-flight already left a placeholder `public/index.html`; this
31
+ overwrites it with the real home page and adds an about page. Keep the
32
+ markup plain.
33
+
34
+ `public/index.html`:
35
+ ```html
36
+ <!doctype html>
37
+ <html lang="en">
38
+ <head>
39
+ <meta charset="utf-8" />
40
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
41
+ <title>My Portfolio</title>
42
+ </head>
43
+ <body>
44
+ <h1>My Portfolio</h1>
45
+ <p>Hi, I build small, sturdy things on the web.</p>
46
+ <nav>
47
+ <a href="/">Home</a> ·
48
+ <a href="/about.html">About</a>
49
+ </nav>
50
+ </body>
51
+ </html>
52
+ ```
53
+
54
+ `public/about.html`:
55
+ ```html
56
+ <!doctype html>
57
+ <html lang="en">
58
+ <head>
59
+ <meta charset="utf-8" />
60
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
61
+ <title>About</title>
62
+ </head>
63
+ <body>
64
+ <h1>About</h1>
65
+ <p>A short page about the person behind the portfolio.</p>
66
+ <nav>
67
+ <a href="/">Home</a>
68
+ </nav>
69
+ </body>
70
+ </html>
71
+ ```
72
+
73
+ ```bash
74
+ # Nothing for you to run yet. Look at both halves of your screen.
75
+ ```
76
+
77
+ Tell the tester:
78
+
79
+ > Your `content-editor` agent just did its real job: it wrote the
80
+ > actual web pages. Two HTML files landed in your project under
81
+ > `public/`: the home page (`public/index.html`) and an about page
82
+ > (`public/about.html`), plain static markup that follows the style
83
+ > guide you set up earlier.
84
+ >
85
+ > Now glance at the Map. It did not change, and that is exactly
86
+ > right. Everything you watched grow on the canvas is your harness:
87
+ > the `.md` files and how they reference each other (call that
88
+ > Layer 1). The HTML pages are Layer 2, what the harness PRODUCES.
89
+ > skill-map maps the harness, not the pages it outputs (HTML is not
90
+ > `.md`), so writing real site files leaves the graph untouched. Two
91
+ > layers, one project: the graph that builds the site, and the site
92
+ > itself.
93
+ >
94
+ > Ready to see the site running?
95
+
96
+ Wait for confirmation. Mark `generate`: done. Auto-advance to `serve`.
97
+
98
+ ## Chapter `serve` - node server.js: your portfolio, live next to the graph (~3 min)
99
+
100
+ **Context**: the tester installs the single dependency (Express) and
101
+ starts the tiny server that the pre-flight already left in
102
+ `server.js`, then opens the site in the browser. They end with two
103
+ things side by side: the real portfolio they can click through, and
104
+ the skill-map graph of the harness that built it. Express runs on
105
+ Node, which the tester has from pre-flight (Node 24+), so no new
106
+ install beyond `npm install`. This chapter is one of the few where the
107
+ tester runs a non-`sm` command themselves (`npm install`,
108
+ `node server.js`); guide them, do not run it for them.
109
+
110
+ **Preparation**: none. `server.js` and `package.json` already exist
111
+ from the kickoff pre-flight; the pages exist from the `generate`
112
+ chapter. The tester runs everything in this chapter.
113
+
114
+ ```bash
115
+ npm install
116
+ node server.js
117
+ ```
118
+
119
+ Tell the tester:
120
+
121
+ > You have the pages; now let's serve them. In your terminal, run
122
+ > these two commands:
123
+ >
124
+ > The first, `npm install`, downloads the one small library the
125
+ > server needs (Express, a tiny web server). It runs on Node, which
126
+ > you already installed at the very start, so there is nothing new to
127
+ > set up.
128
+ >
129
+ > The second, `node server.js`, starts the server. It prints a line
130
+ > telling you it is listening, something like `Listening on
131
+ > http://localhost:3000`.
132
+ >
133
+ > Open `http://localhost:3000` in your browser. There it is: your
134
+ > portfolio, live. Click the **About** link, then the **Home** link
135
+ > to come back. Those are the very pages your harness produced.
136
+ >
137
+ > Take a second to look at both halves: on one side the running site
138
+ > you can click through, on the other the skill-map graph of the
139
+ > harness that built it. You built the harness, wired it, and now you
140
+ > have run it once end to end.
141
+ >
142
+ > Does the site load, and can you click between Home and About?
143
+
144
+ Wait for confirmation. The tester runs the commands; do not run them
145
+ for them. If `npm install` fails, check they are in the project root
146
+ (the cwd they have used all along) and that Node is on PATH (`node
147
+ --version` should print 24 or higher). If the port is busy, they can
148
+ stop the server with Ctrl+C and the edge case for ports applies the
149
+ same as elsewhere. Remind them they can leave the server running or
150
+ stop it with Ctrl+C; either way the next parts do not need it.
151
+
152
+ Mark `serve`: done. Last chapter of the part: apply §Closing a part
153
+ (the close names the part by its title and routes back to the menu;
154
+ this is a mid-campaign payoff, NOT the campaign finale, so do not
155
+ sign the campaign off here).
@@ -1,6 +1,6 @@
1
- # Parte 6 (a): Extender skill-map - settings (step library, `settings-*` ids)
1
+ # Part 7 (a): Extend skill-map - settings (step library, `settings-*` ids)
2
2
 
3
- Step bodies for the settings chapters of Part 6 (config layers, the
3
+ Step bodies for the settings chapters of Part 7 (config layers, the
4
4
  `sm config` verbs, the active provider lens), plus the shared step
5
5
  `settings-6-contributions` that the plugin-authoring chapters reuse.
6
6
  The SKILL.md orchestrator dispatches each `settings-*` chapter id
@@ -14,9 +14,10 @@ system and the `sm config` verbs.
14
14
  ## Precondition check
15
15
 
16
16
  Same as the authoring chapters: `.skill-map/` must exist in the
17
- cwd (the orchestrator's backstage-init pre-flight ran `sm init
18
- --no-scan` and appended the tutorial's internal entries to
19
- `.skillmapignore`, so this is the expected state). If
17
+ cwd (the `extend` part's `backstage-init` preflight ran `sm init
18
+ --no-scan` to provision it; the universal `.skillmapignore` from
19
+ pre-flight keeps the tutorial's own files out of the scan, so this
20
+ is the expected state). If
20
21
  `.skill-map/` is missing, surface the bootstrap mismatch and
21
22
  stop, do not try to re-init mid-chapter.
22
23
 
package/dist/cli.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // cli/entry.ts
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9f7f5ec7-60d4-5ef5-bd36-0d8c26efb81e")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="888d57e8-17f0-5013-89d1-f60f3ef2828b")}catch(e){}}();
4
4
  import { existsSync as existsSync33 } from "fs";
5
5
  import { Builtins, Cli as Cli2 } from "clipanion";
6
6
 
@@ -246,7 +246,7 @@ function bucketByKind(kind, instance, bag) {
246
246
  // package.json
247
247
  var package_default = {
248
248
  name: "@skill-map/cli",
249
- version: "0.53.2",
249
+ version: "0.53.4",
250
250
  description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
251
251
  license: "MIT",
252
252
  type: "module",
@@ -30251,4 +30251,4 @@ function resolveBareDefault() {
30251
30251
  process.exit(ExitCode.Error);
30252
30252
  }
30253
30253
  //# sourceMappingURL=cli.js.map
30254
- //# debugId=9f7f5ec7-60d4-5ef5-bd36-0d8c26efb81e
30254
+ //# debugId=888d57e8-17f0-5013-89d1-f60f3ef2828b
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // kernel/i18n/registry.texts.ts
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9afb619c-58ce-5ee8-a032-63a47cced7ce")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="66543317-554b-53e5-b2d4-5ed32dfdc81a")}catch(e){}}();
4
4
  var REGISTRY_TEXTS = {
5
5
  duplicateExtension: "Extension already registered: {{kind}}:{{qualifiedId}}",
6
6
  unknownKind: "Unknown extension kind: {{kind}}",
@@ -102,7 +102,7 @@ import { Tiktoken as Tiktoken2 } from "js-tiktoken/lite";
102
102
  // package.json
103
103
  var package_default = {
104
104
  name: "@skill-map/cli",
105
- version: "0.53.2",
105
+ version: "0.53.4",
106
106
  description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
107
107
  license: "MIT",
108
108
  type: "module",
@@ -3632,4 +3632,4 @@ export {
3632
3632
  runScanWithRenames
3633
3633
  };
3634
3634
  //# sourceMappingURL=index.js.map
3635
- //# debugId=9afb619c-58ce-5ee8-a032-63a47cced7ce
3635
+ //# debugId=66543317-554b-53e5-b2d4-5ed32dfdc81a
@@ -1,6 +1,6 @@
1
1
  // kernel/i18n/registry.texts.ts
2
2
 
3
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2b25d909-dbb1-5543-aa71-06c3d77320aa")}catch(e){}}();
3
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3034c153-d87d-57ef-9e51-8770d99ad465")}catch(e){}}();
4
4
  var REGISTRY_TEXTS = {
5
5
  duplicateExtension: "Extension already registered: {{kind}}:{{qualifiedId}}",
6
6
  unknownKind: "Unknown extension kind: {{kind}}",
@@ -102,7 +102,7 @@ import { Tiktoken as Tiktoken2 } from "js-tiktoken/lite";
102
102
  // package.json
103
103
  var package_default = {
104
104
  name: "@skill-map/cli",
105
- version: "0.53.2",
105
+ version: "0.53.4",
106
106
  description: "skill-map reference implementation \u2014 kernel + CLI + adapters.",
107
107
  license: "MIT",
108
108
  type: "module",
@@ -3632,4 +3632,4 @@ export {
3632
3632
  runScanWithRenames
3633
3633
  };
3634
3634
  //# sourceMappingURL=index.js.map
3635
- //# debugId=2b25d909-dbb1-5543-aa71-06c3d77320aa
3635
+ //# debugId=3034c153-d87d-57ef-9e51-8770d99ad465
@@ -1 +1 @@
1
- import{$ as l,B as C,E as A,H as k,K as g,N as h,P as c,_ as j,c as S,d as R,f as O,ga as d,ia as y,sc as p,u as _}from"./chunk-Q2A6FWC7.js";import{a as m,b}from"./chunk-WCABR6TI.js";function w(t){t||(t=c(l));let r=new S(e=>{if(t.destroyed){e.next();return}return t.onDestroy(e.next.bind(e))});return e=>e.pipe(A(r))}function Ee(t,r){let n=!r?.manualCleanup?r?.injector?.get(l)??c(l):null,o=G(r?.equal),s;r?.requireSync?s=d({kind:0},{equal:o}):s=d({kind:1,value:r?.initialValue},{equal:o});let a,i=t.subscribe({next:u=>s.set({kind:1,value:u}),error:u=>{s.set({kind:2,error:u}),a?.()},complete:()=>{a?.()}});if(r?.requireSync&&s().kind===0)throw new k(601,!1);return a=n?.onDestroy(i.unsubscribe.bind(i)),p(()=>{let u=s();switch(u.kind){case 1:return u.value;case 2:throw u.error;case 0:throw new k(601,!1)}},{equal:r?.equal})}function G(t=Object.is){return(r,e)=>r.kind===1&&e.kind===1&&t(r.value,e.value)}var N=new h("DATA_SOURCE"),F=class extends Error{code;details;constructor(r,e,n){super(e),this.name="DataSourceError",this.code=r,this.details=n}};var U=new h("SKILL_MAP_MODE");function Te(){return typeof document>"u"?"live":document.querySelector('meta[name="skill-map-mode"]')?.content==="demo"?"demo":"live"}function D(t){if(typeof t!="object"||t===null)return!1;let r=t;if(typeof r.type!="string"||r.type.length===0)return!1;let e=r.timestamp;return!(typeof e!="number"&&typeof e!="string"||!("data"in r))}function L(t){if(!D(t)||t.type!=="sidecar.bumped")return!1;let r=t.data;if(typeof r!="object"||r===null||typeof r.nodePath!="string"||r.nodePath.length===0)return!1;let e=r.version;return!(e!==null&&typeof e!="number"||r.status!=="fresh")}var f={connected:t=>`[ws] connected to ${t}`,closed:(t,r)=>`[ws] closed (code=${t}, reason="${r}")`,malformedFrame:t=>`[ws] malformed frame dropped: ${t}`,socketError:t=>`[ws] socket error: ${t}`,reconnectScheduled:(t,r)=>`[ws] reconnect attempt ${r} scheduled in ${t}ms`,reconnectGiveUp:t=>`[ws] giving up after ${t} failed reconnect attempts`};var P=[1e3,2e3,4e3,8e3,16e3,3e4],$=10,X=new Set([1e3]);function z(){return typeof window>"u"||!window.location?"ws://127.0.0.1:4242/ws":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}var J=new h("WS_SOCKET_FACTORY",{providedIn:"root",factory:()=>t=>new WebSocket(t)}),Z=new h("WS_URL",{providedIn:"root",factory:()=>z()}),K=(()=>{class t{mode=c(U);destroyRef=c(l);subject=new R;socket=null;reconnectTimer=null;reconnectAttempt=0;disposed=!1;_connectionState=d("connecting");connectionState=this._connectionState.asReadonly();socketFactory=c(J);url=c(Z);events$;scanCompleted$;sidecarBumped$;constructor(){this.mode!=="live"?this.events$=O:this.events$=new S(e=>{!this.socket&&!this.disposed&&this.connect();let n=this.subject.subscribe(e);return()=>n.unsubscribe()}).pipe(C({resetOnRefCountZero:!1})),this.scanCompleted$=this.events$.pipe(_(e=>e.type==="scan.completed")),this.sidecarBumped$=this.events$.pipe(_(L)),this.destroyRef.onDestroy(()=>this.disconnect())}disconnect(){if(!this.disposed){if(this.disposed=!0,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.socket){try{this.socket.close(1e3,"client disconnect")}catch{}this.socket=null}this.subject.complete()}}reconnect(){this.disposed||this.socket||(this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectAttempt=0,this._connectionState.set("connecting"),this.connect())}ngOnDestroy(){this.disconnect()}connect(){if(this.disposed)return;let e;try{e=this.socketFactory(this.url)}catch(n){let o=n instanceof Error?n.message:String(n);console.warn(f.socketError(o)),this.scheduleReconnect();return}this.socket=e,e.onopen=()=>{this.reconnectAttempt=0,this._connectionState.set("open"),console.info(f.connected(this.url))},e.onmessage=n=>{this.handleFrame(n.data)},e.onerror=n=>{let o=typeof n=="object"&&n!==null&&"message"in n?String(n.message??"unknown"):"unknown";console.warn(f.socketError(o))},e.onclose=n=>{console.info(f.closed(n.code,n.reason)),this.socket=null,!this.disposed&&(X.has(n.code)||this.scheduleReconnect())}}handleFrame(e){if(typeof e!="string"){console.warn(f.malformedFrame("non-string frame"));return}let n;try{n=JSON.parse(e)}catch(o){let s=o instanceof Error?o.message:String(o);console.warn(f.malformedFrame(s));return}if(!D(n)){console.warn(f.malformedFrame("envelope shape"));return}this.subject.next(n)}scheduleReconnect(){if(this.disposed)return;if(this.reconnectAttempt>=$){console.warn(f.reconnectGiveUp($)),this._connectionState.set("lost");return}this._connectionState.set("reconnecting");let e=Math.min(this.reconnectAttempt,P.length-1),n=P[e];this.reconnectAttempt+=1,console.info(f.reconnectScheduled(n,this.reconnectAttempt)),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}get _reconnectAttempt(){return this.reconnectAttempt}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Be=(()=>{class t{dataSource=c(N);wsEvents=c(K);destroyRef=c(l);_nodes=d([]);_scan=d(null);_loading=d(!1);_error=d(null);pendingRefresh=!1;wsConnectedBefore=!1;nodes=this._nodes.asReadonly();scan=this._scan.asReadonly();loading=this._loading.asReadonly();error=this._error.asReadonly();count=p(()=>this._nodes().length);byKind=p(()=>{let e=new Map;for(let n of this._nodes()){let o=e.get(n.kind);o?o.push(n):e.set(n.kind,[n])}return e});hasAnyFavorites=p(()=>this._nodes().some(e=>e.isFavorite===!0));constructor(){this.wsEvents.scanCompleted$.pipe(w(this.destroyRef)).subscribe(()=>{this.load()}),this.wsEvents.sidecarBumped$.pipe(w(this.destroyRef)).subscribe(e=>{this.patchSidecarFromBump({nodePath:e.data.nodePath,version:e.data.version,status:e.data.status})}),y(()=>{this.wsEvents.connectionState()==="open"&&(this.wsConnectedBefore&&this.load(),this.wsConnectedBefore=!0)})}setFavoriteLocal(e,n){this._nodes.update(o=>{let s=!1,a=o.map(i=>i.path!==e||i.isFavorite===n?i:(s=!0,b(m({},i),{isFavorite:n})));return s?a:o})}async toggleFavorite(e,n){this.setFavoriteLocal(e,n);try{return n?await this.dataSource.setFavorite(e):await this.dataSource.unsetFavorite(e),n}catch(o){this.setFavoriteLocal(e,!n);let s=o instanceof Error?o.message:String(o);return this._error.set(s),!n}}patchSidecarFromBump(e){this._nodes.update(n=>{let o=!1,s=n.map(a=>{if(a.path!==e.nodePath)return a;o=!0;let i=a.sidecar,u=m({},i?.annotations??{});return e.version!==null&&(u.version=e.version),b(m({},a),{sidecar:m({present:!0,status:e.status,annotations:u},i?.root===void 0?{}:{root:i.root})})});return o?s:n})}async load(){if(this._loading()){this.pendingRefresh=!0;return}this._loading.set(!0),this._error.set(null);try{let e=await this.dataSource.loadScan();this._scan.set(e),this._nodes.set(e.nodes.map(Q))}catch(e){let n=e instanceof Error?e.message:String(e);this._error.set(n)}finally{this._loading.set(!1),this.pendingRefresh&&(this.pendingRefresh=!1,queueMicrotask(()=>{this.load()}))}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Q(t){let r=t.kind,e=t.frontmatter??{},n=b(m({},e),{name:typeof e.name=="string"?e.name:"",description:typeof e.description=="string"?e.description:""}),o={path:t.path,kind:r,provider:t.provider,frontmatter:n,linksOutCount:t.linksOutCount,linksInCount:t.linksInCount,externalRefsCount:t.externalRefsCount,bytesTotal:t.bytes?.total,tokensTotal:t.tokens?.total,bodyHash:t.bodyHash,frontmatterHash:t.frontmatterHash,isFavorite:t.isFavorite===!0};return t.sidecar&&(o.sidecar=m({},t.sidecar)),t.contributions&&(o.contributions=[...t.contributions]),o}var Ve="https://bb9dce0fd2cb4ab27ac0475aa394aeb4@o4511475590037504.ingest.de.sentry.io/4511475725959248",x="phc_vMX3PcNeDsacWNg2hYEbKVXDijSWcjKFzabCkzU7RNEr",q="https://eu.i.posthog.com";var ee="<HOME>",te=["server_name","user"],ne=[/[A-Za-z]:[\\/]Users[\\/][^\\/\s:*?"<>|]+/g,/\/(?:home|Users)\/[^/\s:]+/g,/\/root(?=\/|\b)/g];function re(t){let r=t;for(let e of ne)r=r.replace(e,ee);return r}function B(t){let r=T(t);if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let e=r;for(let n of te)n in e&&delete e[n]}return r}function T(t){if(typeof t=="string")return re(t);if(Array.isArray(t))return t.map(r=>T(r));if(t!==null&&typeof t=="object"){let r={};for(let[e,n]of Object.entries(t))r[e]=T(n);return r}return t}var W=!1,v=null;async function Ze(t){if(W||x===""||!t.consentEnabled||t.distinctId===null)return;let{default:r}=await import("./chunk-P3SNMV4X.js");r.init(x,{api_host:q,autocapture:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0,person_profiles:"identified_only",bootstrap:{distinctID:t.distinctId},before_send:e=>e===null?null:B(e)}),v=r,W=!0}function Qe(t,r={}){v!==null&&v.capture(t,r)}function et(t){v!==null&&v.register(t)}var M=[{id:"matrix",htmlClass:"app-matrix",forcesDark:!0,favicon:"favicon-matrix.svg",fontHref:"https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap",fontLinkId:"sm-matrix-font",label:"Matrix",description:"Cyber-green retint on the dark palette."}];function E(t){return t?M.find(r=>r.id===t)??null:null}var Y="skill-map.ui.theme",I="skill-map.ui.extra-theme",oe="app-dark",se="dark",V="(prefers-color-scheme: dark)",ie="favicon.svg",ce='link[rel="icon"][type="image/svg+xml"]',ct=(()=>{class t{doc=c(j);destroyRef=c(l);mode=d(this.readInitialMode());extraTheme=d(this.readInitialExtra());systemPrefersDark=d(this.readSystemPref());resolved=p(()=>{let e=this.mode();return e==="auto"?this.systemPrefersDark()?"dark":"light":e});constructor(){this.subscribeToSystemPref(),y(()=>{let e=this.extraTheme(),n=E(e),s=this.resolved()==="dark"||n?.forcesDark===!0,a=this.doc.documentElement;a.classList.toggle(oe,s),a.classList.toggle(se,s);for(let i of M)a.classList.toggle(i.htmlClass,n?.id===i.id);this.applyFavicon(n?.favicon??ie),n&&this.ensureExtraThemeFont(n);try{let i=this.doc.defaultView?.localStorage;i?.setItem(Y,this.mode()),n===null?i?.removeItem(I):i?.setItem(I,n.id)}catch{}})}toggle(){this.extraTheme()!==null&&this.extraTheme.set(null),this.mode.update(e=>e==="auto"?"light":e==="light"?"dark":"auto")}set(e){this.mode.set(e)}setExtraTheme(e){this.extraTheme.set(E(e)?.id??null)}readInitialMode(){try{let e=this.doc.defaultView?.localStorage.getItem(Y);if(e==="auto"||e==="light"||e==="dark")return e}catch{}return"auto"}readInitialExtra(){try{let e=this.doc.defaultView?.localStorage.getItem(I);return E(e)?.id??null}catch{return null}}readSystemPref(){try{return this.doc.defaultView?.matchMedia(V).matches??!1}catch{return!1}}ensureExtraThemeFont(e){if(!e.fontHref||!e.fontLinkId||this.doc.getElementById(e.fontLinkId))return;let n=this.doc.head;if(!n)return;let o=this.doc.createElement("link");o.id=e.fontLinkId,o.rel="stylesheet",o.href=e.fontHref,n.appendChild(o)}applyFavicon(e){let n=this.doc.querySelector(ce);n&&n.getAttribute("href")!==e&&n.setAttribute("href",e)}subscribeToSystemPref(){let e=this.doc.defaultView;if(!e||typeof e.matchMedia!="function")return;let n=e.matchMedia(V),o=s=>{this.systemPrefersDark.set(s.matches)};n.addEventListener("change",o),this.destroyRef.onDestroy(()=>n.removeEventListener("change",o))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{w as a,Ee as b,N as c,F as d,U as e,Te as f,K as g,Be as h,Ve as i,B as j,Ze as k,Qe as l,et as m,M as n,ct as o};
1
+ import{$ as l,B as O,E as A,H as _,K as g,N as h,P as c,_ as j,c as S,d as R,f as C,ga as d,ia as y,sc as p,u as k}from"./chunk-Q2A6FWC7.js";import{a as m,b}from"./chunk-WCABR6TI.js";function w(t){t||(t=c(l));let r=new S(e=>{if(t.destroyed){e.next();return}return t.onDestroy(e.next.bind(e))});return e=>e.pipe(A(r))}function Ee(t,r){let n=!r?.manualCleanup?r?.injector?.get(l)??c(l):null,o=V(r?.equal),s;r?.requireSync?s=d({kind:0},{equal:o}):s=d({kind:1,value:r?.initialValue},{equal:o});let a,i=t.subscribe({next:u=>s.set({kind:1,value:u}),error:u=>{s.set({kind:2,error:u}),a?.()},complete:()=>{a?.()}});if(r?.requireSync&&s().kind===0)throw new _(601,!1);return a=n?.onDestroy(i.unsubscribe.bind(i)),p(()=>{let u=s();switch(u.kind){case 1:return u.value;case 2:throw u.error;case 0:throw new _(601,!1)}},{equal:r?.equal})}function V(t=Object.is){return(r,e)=>r.kind===1&&e.kind===1&&t(r.value,e.value)}var N=new h("DATA_SOURCE"),F=class extends Error{code;details;constructor(r,e,n){super(e),this.name="DataSourceError",this.code=r,this.details=n}};var U=new h("SKILL_MAP_MODE");function Te(){return typeof document>"u"?"live":document.querySelector('meta[name="skill-map-mode"]')?.content==="demo"?"demo":"live"}function D(t){if(typeof t!="object"||t===null)return!1;let r=t;if(typeof r.type!="string"||r.type.length===0)return!1;let e=r.timestamp;return!(typeof e!="number"&&typeof e!="string"||!("data"in r))}function L(t){if(!D(t)||t.type!=="sidecar.bumped")return!1;let r=t.data;if(typeof r!="object"||r===null||typeof r.nodePath!="string"||r.nodePath.length===0)return!1;let e=r.version;return!(e!==null&&typeof e!="number"||r.status!=="fresh")}var f={connected:t=>`[ws] connected to ${t}`,closed:(t,r)=>`[ws] closed (code=${t}, reason="${r}")`,malformedFrame:t=>`[ws] malformed frame dropped: ${t}`,socketError:t=>`[ws] socket error: ${t}`,reconnectScheduled:(t,r)=>`[ws] reconnect attempt ${r} scheduled in ${t}ms`,reconnectGiveUp:t=>`[ws] giving up after ${t} failed reconnect attempts`};var P=[1e3,2e3,4e3,8e3,16e3,3e4],$=10,X=new Set([1e3]);function z(){return typeof window>"u"||!window.location?"ws://127.0.0.1:4242/ws":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}var J=new h("WS_SOCKET_FACTORY",{providedIn:"root",factory:()=>t=>new WebSocket(t)}),Z=new h("WS_URL",{providedIn:"root",factory:()=>z()}),K=(()=>{class t{mode=c(U);destroyRef=c(l);subject=new R;socket=null;reconnectTimer=null;reconnectAttempt=0;disposed=!1;_connectionState=d("connecting");connectionState=this._connectionState.asReadonly();socketFactory=c(J);url=c(Z);events$;scanCompleted$;sidecarBumped$;constructor(){this.mode!=="live"?this.events$=C:this.events$=new S(e=>{!this.socket&&!this.disposed&&this.connect();let n=this.subject.subscribe(e);return()=>n.unsubscribe()}).pipe(O({resetOnRefCountZero:!1})),this.scanCompleted$=this.events$.pipe(k(e=>e.type==="scan.completed")),this.sidecarBumped$=this.events$.pipe(k(L)),this.destroyRef.onDestroy(()=>this.disconnect())}disconnect(){if(!this.disposed){if(this.disposed=!0,this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.socket){try{this.socket.close(1e3,"client disconnect")}catch{}this.socket=null}this.subject.complete()}}reconnect(){this.disposed||this.socket||(this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectAttempt=0,this._connectionState.set("connecting"),this.connect())}ngOnDestroy(){this.disconnect()}connect(){if(this.disposed)return;let e;try{e=this.socketFactory(this.url)}catch(n){let o=n instanceof Error?n.message:String(n);console.warn(f.socketError(o)),this.scheduleReconnect();return}this.socket=e,e.onopen=()=>{this.reconnectAttempt=0,this._connectionState.set("open"),console.info(f.connected(this.url))},e.onmessage=n=>{this.handleFrame(n.data)},e.onerror=n=>{let o=typeof n=="object"&&n!==null&&"message"in n?String(n.message??"unknown"):"unknown";console.warn(f.socketError(o))},e.onclose=n=>{console.info(f.closed(n.code,n.reason)),this.socket=null,!this.disposed&&(X.has(n.code)||this.scheduleReconnect())}}handleFrame(e){if(typeof e!="string"){console.warn(f.malformedFrame("non-string frame"));return}let n;try{n=JSON.parse(e)}catch(o){let s=o instanceof Error?o.message:String(o);console.warn(f.malformedFrame(s));return}if(!D(n)){console.warn(f.malformedFrame("envelope shape"));return}this.subject.next(n)}scheduleReconnect(){if(this.disposed)return;if(this.reconnectAttempt>=$){console.warn(f.reconnectGiveUp($)),this._connectionState.set("lost");return}this._connectionState.set("reconnecting");let e=Math.min(this.reconnectAttempt,P.length-1),n=P[e];this.reconnectAttempt+=1,console.info(f.reconnectScheduled(n,this.reconnectAttempt)),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}get _reconnectAttempt(){return this.reconnectAttempt}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var Be=(()=>{class t{dataSource=c(N);wsEvents=c(K);destroyRef=c(l);_nodes=d([]);_scan=d(null);_loading=d(!1);_error=d(null);pendingRefresh=!1;wsConnectedBefore=!1;nodes=this._nodes.asReadonly();scan=this._scan.asReadonly();loading=this._loading.asReadonly();error=this._error.asReadonly();count=p(()=>this._nodes().length);byKind=p(()=>{let e=new Map;for(let n of this._nodes()){let o=e.get(n.kind);o?o.push(n):e.set(n.kind,[n])}return e});hasAnyFavorites=p(()=>this._nodes().some(e=>e.isFavorite===!0));constructor(){this.wsEvents.scanCompleted$.pipe(w(this.destroyRef)).subscribe(()=>{this.load()}),this.wsEvents.sidecarBumped$.pipe(w(this.destroyRef)).subscribe(e=>{this.patchSidecarFromBump({nodePath:e.data.nodePath,version:e.data.version,status:e.data.status})}),y(()=>{this.wsEvents.connectionState()==="open"&&(this.wsConnectedBefore&&this.load(),this.wsConnectedBefore=!0)})}setFavoriteLocal(e,n){this._nodes.update(o=>{let s=!1,a=o.map(i=>i.path!==e||i.isFavorite===n?i:(s=!0,b(m({},i),{isFavorite:n})));return s?a:o})}async toggleFavorite(e,n){this.setFavoriteLocal(e,n);try{return n?await this.dataSource.setFavorite(e):await this.dataSource.unsetFavorite(e),n}catch(o){this.setFavoriteLocal(e,!n);let s=o instanceof Error?o.message:String(o);return this._error.set(s),!n}}patchSidecarFromBump(e){this._nodes.update(n=>{let o=!1,s=n.map(a=>{if(a.path!==e.nodePath)return a;o=!0;let i=a.sidecar,u=m({},i?.annotations??{});return e.version!==null&&(u.version=e.version),b(m({},a),{sidecar:m({present:!0,status:e.status,annotations:u},i?.root===void 0?{}:{root:i.root})})});return o?s:n})}async load(){if(this._loading()){this.pendingRefresh=!0;return}this._loading.set(!0),this._error.set(null);try{let e=await this.dataSource.loadScan();this._scan.set(e),this._nodes.set(e.nodes.map(Q))}catch(e){let n=e instanceof Error?e.message:String(e);this._error.set(n)}finally{this._loading.set(!1),this.pendingRefresh&&(this.pendingRefresh=!1,queueMicrotask(()=>{this.load()}))}}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Q(t){let r=t.kind,e=t.frontmatter??{},n=b(m({},e),{name:typeof e.name=="string"?e.name:"",description:typeof e.description=="string"?e.description:""}),o={path:t.path,kind:r,provider:t.provider,frontmatter:n,linksOutCount:t.linksOutCount,linksInCount:t.linksInCount,externalRefsCount:t.externalRefsCount,bytesTotal:t.bytes?.total,tokensTotal:t.tokens?.total,bodyHash:t.bodyHash,frontmatterHash:t.frontmatterHash,isFavorite:t.isFavorite===!0};return t.sidecar&&(o.sidecar=m({},t.sidecar)),t.contributions&&(o.contributions=[...t.contributions]),o}var Ge="https://bb9dce0fd2cb4ab27ac0475aa394aeb4@o4511475590037504.ingest.de.sentry.io/4511475725959248",x="phc_vMX3PcNeDsacWNg2hYEbKVXDijSWcjKFzabCkzU7RNEr",q="https://eu.i.posthog.com";var ee="<HOME>",te=["server_name","user"],ne=[/[A-Za-z]:[\\/]Users[\\/][^\\/\s:*?"<>|]+/g,/\/(?:home|Users)\/[^/\s:]+/g,/\/root(?=\/|\b)/g];function re(t){let r=t;for(let e of ne)r=r.replace(e,ee);return r}function B(t){let r=T(t);if(r!==null&&typeof r=="object"&&!Array.isArray(r)){let e=r;for(let n of te)n in e&&delete e[n]}return r}function T(t){if(typeof t=="string")return re(t);if(Array.isArray(t))return t.map(r=>T(r));if(t!==null&&typeof t=="object"){let r={};for(let[e,n]of Object.entries(t))r[e]=T(n);return r}return t}var W=!1,v=null;async function Ze(t){if(W||x===""||!t.consentEnabled||t.distinctId===null)return;let{default:r}=await import("./chunk-P3SNMV4X.js");r.init(x,{api_host:q,autocapture:!1,capture_pageview:!1,capture_pageleave:!1,disable_session_recording:!0,person_profiles:"identified_only",bootstrap:{distinctID:t.distinctId},before_send:e=>e===null?null:B(e)}),v=r,W=!0}function Qe(t,r={}){v!==null&&v.capture(t,r)}function et(t){v!==null&&v.register(t)}var M=[{id:"matrix",htmlClass:"app-matrix",forcesDark:!0,favicon:"favicon-matrix.svg",fontHref:"https://fonts.googleapis.com/css2?family=JetBrains+Mono&display=swap",fontLinkId:"sm-matrix-font",label:"Matrix",description:"Cyber-green retint on the dark palette."},{id:"neon-red",htmlClass:"app-neon-red",forcesDark:!0,label:"Neon R",description:"Electric-red glow on a deep console."},{id:"neon-green",htmlClass:"app-neon-green",forcesDark:!0,label:"Neon G",description:"Electric-green glow on a deep console."},{id:"neon",htmlClass:"app-neon",forcesDark:!0,label:"Neon B",description:"Electric-cyan glow on a deep-navy console."}];function E(t){return t?M.find(r=>r.id===t)??null:null}var Y="skill-map.ui.theme",I="skill-map.ui.extra-theme",oe="app-dark",se="dark",G="(prefers-color-scheme: dark)",ie="favicon.svg",ce='link[rel="icon"][type="image/svg+xml"]',ct=(()=>{class t{doc=c(j);destroyRef=c(l);mode=d(this.readInitialMode());extraTheme=d(this.readInitialExtra());systemPrefersDark=d(this.readSystemPref());resolved=p(()=>{let e=this.mode();return e==="auto"?this.systemPrefersDark()?"dark":"light":e});constructor(){this.subscribeToSystemPref(),y(()=>{let e=this.extraTheme(),n=E(e),s=this.resolved()==="dark"||n?.forcesDark===!0,a=this.doc.documentElement;a.classList.toggle(oe,s),a.classList.toggle(se,s);for(let i of M)a.classList.toggle(i.htmlClass,n?.id===i.id);this.applyFavicon(n?.favicon??ie),n&&this.ensureExtraThemeFont(n);try{let i=this.doc.defaultView?.localStorage;i?.setItem(Y,this.mode()),n===null?i?.removeItem(I):i?.setItem(I,n.id)}catch{}})}toggle(){this.extraTheme()!==null&&this.extraTheme.set(null),this.mode.update(e=>e==="auto"?"light":e==="light"?"dark":"auto")}set(e){this.mode.set(e)}setExtraTheme(e){this.extraTheme.set(E(e)?.id??null)}readInitialMode(){try{let e=this.doc.defaultView?.localStorage.getItem(Y);if(e==="auto"||e==="light"||e==="dark")return e}catch{}return"auto"}readInitialExtra(){try{let e=this.doc.defaultView?.localStorage.getItem(I);return E(e)?.id??null}catch{return null}}readSystemPref(){try{return this.doc.defaultView?.matchMedia(G).matches??!1}catch{return!1}}ensureExtraThemeFont(e){if(!e.fontHref||!e.fontLinkId||this.doc.getElementById(e.fontLinkId))return;let n=this.doc.head;if(!n)return;let o=this.doc.createElement("link");o.id=e.fontLinkId,o.rel="stylesheet",o.href=e.fontHref,n.appendChild(o)}applyFavicon(e){let n=this.doc.querySelector(ce);n&&n.getAttribute("href")!==e&&n.setAttribute("href",e)}subscribeToSystemPref(){let e=this.doc.defaultView;if(!e||typeof e.matchMedia!="function")return;let n=e.matchMedia(G),o=s=>{this.systemPrefersDark.set(s.matches)};n.addEventListener("change",o),this.destroyRef.onDestroy(()=>n.removeEventListener("change",o))}static \u0275fac=function(n){return new(n||t)};static \u0275prov=g({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();export{w as a,Ee as b,N as c,F as d,U as e,Te as f,K as g,Be as h,Ge as i,B as j,Ze as k,Qe as l,et as m,M as n,ct as o};