@younndai/lyt-mesh 0.9.0

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 (96) hide show
  1. package/LICENSE +200 -0
  2. package/NOTICE +23 -0
  3. package/README.md +135 -0
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +34 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/commands/clone-all.d.ts +3 -0
  9. package/dist/commands/clone-all.d.ts.map +1 -0
  10. package/dist/commands/clone-all.js +66 -0
  11. package/dist/commands/clone-all.js.map +1 -0
  12. package/dist/commands/mesh-init.d.ts +3 -0
  13. package/dist/commands/mesh-init.d.ts.map +1 -0
  14. package/dist/commands/mesh-init.js +70 -0
  15. package/dist/commands/mesh-init.js.map +1 -0
  16. package/dist/commands/pod-status.d.ts +3 -0
  17. package/dist/commands/pod-status.d.ts.map +1 -0
  18. package/dist/commands/pod-status.js +67 -0
  19. package/dist/commands/pod-status.js.map +1 -0
  20. package/dist/commands/source.d.ts +3 -0
  21. package/dist/commands/source.d.ts.map +1 -0
  22. package/dist/commands/source.js +83 -0
  23. package/dist/commands/source.js.map +1 -0
  24. package/dist/commands/status.d.ts +4 -0
  25. package/dist/commands/status.d.ts.map +1 -0
  26. package/dist/commands/status.js +121 -0
  27. package/dist/commands/status.js.map +1 -0
  28. package/dist/commands/sync.d.ts +3 -0
  29. package/dist/commands/sync.d.ts.map +1 -0
  30. package/dist/commands/sync.js +234 -0
  31. package/dist/commands/sync.js.map +1 -0
  32. package/dist/commands/validate.d.ts +3 -0
  33. package/dist/commands/validate.d.ts.map +1 -0
  34. package/dist/commands/validate.js +66 -0
  35. package/dist/commands/validate.js.map +1 -0
  36. package/dist/discovery/github.d.ts +19 -0
  37. package/dist/discovery/github.d.ts.map +1 -0
  38. package/dist/discovery/github.js +90 -0
  39. package/dist/discovery/github.js.map +1 -0
  40. package/dist/discovery/walk.d.ts +28 -0
  41. package/dist/discovery/walk.d.ts.map +1 -0
  42. package/dist/discovery/walk.js +78 -0
  43. package/dist/discovery/walk.js.map +1 -0
  44. package/dist/flows/clone-all.d.ts +53 -0
  45. package/dist/flows/clone-all.d.ts.map +1 -0
  46. package/dist/flows/clone-all.js +123 -0
  47. package/dist/flows/clone-all.js.map +1 -0
  48. package/dist/flows/mesh-init-validate.d.ts +22 -0
  49. package/dist/flows/mesh-init-validate.d.ts.map +1 -0
  50. package/dist/flows/mesh-init-validate.js +195 -0
  51. package/dist/flows/mesh-init-validate.js.map +1 -0
  52. package/dist/flows/mesh-init.d.ts +46 -0
  53. package/dist/flows/mesh-init.d.ts.map +1 -0
  54. package/dist/flows/mesh-init.js +302 -0
  55. package/dist/flows/mesh-init.js.map +1 -0
  56. package/dist/flows/pod-status.d.ts +37 -0
  57. package/dist/flows/pod-status.d.ts.map +1 -0
  58. package/dist/flows/pod-status.js +269 -0
  59. package/dist/flows/pod-status.js.map +1 -0
  60. package/dist/flows/status.d.ts +16 -0
  61. package/dist/flows/status.d.ts.map +1 -0
  62. package/dist/flows/status.js +76 -0
  63. package/dist/flows/status.js.map +1 -0
  64. package/dist/flows/sync-check.d.ts +38 -0
  65. package/dist/flows/sync-check.d.ts.map +1 -0
  66. package/dist/flows/sync-check.js +180 -0
  67. package/dist/flows/sync-check.js.map +1 -0
  68. package/dist/flows/sync-watch.d.ts +24 -0
  69. package/dist/flows/sync-watch.d.ts.map +1 -0
  70. package/dist/flows/sync-watch.js +217 -0
  71. package/dist/flows/sync-watch.js.map +1 -0
  72. package/dist/flows/sync.d.ts +45 -0
  73. package/dist/flows/sync.d.ts.map +1 -0
  74. package/dist/flows/sync.js +513 -0
  75. package/dist/flows/sync.js.map +1 -0
  76. package/dist/flows/validate.d.ts +22 -0
  77. package/dist/flows/validate.d.ts.map +1 -0
  78. package/dist/flows/validate.js +62 -0
  79. package/dist/flows/validate.js.map +1 -0
  80. package/dist/index.d.ts +35 -0
  81. package/dist/index.d.ts.map +1 -0
  82. package/dist/index.js +39 -0
  83. package/dist/index.js.map +1 -0
  84. package/dist/mesh-command.d.ts +3 -0
  85. package/dist/mesh-command.d.ts.map +1 -0
  86. package/dist/mesh-command.js +31 -0
  87. package/dist/mesh-command.js.map +1 -0
  88. package/dist/source/repo.d.ts +14 -0
  89. package/dist/source/repo.d.ts.map +1 -0
  90. package/dist/source/repo.js +71 -0
  91. package/dist/source/repo.js.map +1 -0
  92. package/dist/source/types.d.ts +22 -0
  93. package/dist/source/types.d.ts.map +1 -0
  94. package/dist/source/types.js +49 -0
  95. package/dist/source/types.js.map +1 -0
  96. package/package.json +77 -0
@@ -0,0 +1,35 @@
1
+ export { buildMeshSubcommand } from "./mesh-command.js";
2
+ export { addSource, listSources, getSourceByName, removeSource, withRegistry, } from "./source/repo.js";
3
+ export type { AddSourceArgs } from "./source/repo.js";
4
+ export { parseScope, serializeScope } from "./source/types.js";
5
+ export type { VaultSource, VaultSourceScope, VaultSourceRow } from "./source/types.js";
6
+ export { walkGithub } from "./discovery/github.js";
7
+ export type { DiscoveredRepo, GhExecutor, WalkGithubOptions } from "./discovery/github.js";
8
+ export { walk, buildDefaultAdapters } from "./discovery/walk.js";
9
+ export type { SourceAdapter, MeshDiscoveryResult, WalkOptions, WalkResult, } from "./discovery/walk.js";
10
+ export { cloneAllFlow } from "./flows/clone-all.js";
11
+ export type { CloneAllOptions, CloneAllOutcome, CloneAllResult, CloneAllNoSources, GitCloneFn, } from "./flows/clone-all.js";
12
+ export { buildCloneAllCommand } from "./commands/clone-all.js";
13
+ export { buildSourceCommand } from "./commands/source.js";
14
+ export { buildValidateCommand } from "./commands/validate.js";
15
+ export { buildStatusCommand } from "./commands/status.js";
16
+ export { buildPodStatusCommand } from "./commands/pod-status.js";
17
+ export { podStatusFlow } from "./flows/pod-status.js";
18
+ export type { PodStatusResult, PodStatusArgs, VaultDriftReport, VaultDriftStatus, PodDriftReport, PodDriftStatus, } from "./flows/pod-status.js";
19
+ export { validateFlow } from "./flows/validate.js";
20
+ export type { ValidateFinding, ValidateOutcome, ValidateOptions, ValidateIssueStatus, ValidateEdgeKind, } from "./flows/validate.js";
21
+ export { statusFlow } from "./flows/status.js";
22
+ export type { StatusOutcome, StatusOptions, StatusCluster } from "./flows/status.js";
23
+ export { meshInitFlow, traverseMeshFromRoot } from "./flows/mesh-init.js";
24
+ export type { MeshInitOptions, MeshInitOutcome, MeshInitResult, MeshInitBlocked, MeshInitVaultResult, MeshInitEdgeResult, } from "./flows/mesh-init.js";
25
+ export { validateMeshInit } from "./flows/mesh-init-validate.js";
26
+ export type { ValidateIssue, ValidateOutcome as MeshInitValidateOutcome, ValidateOptions as MeshInitValidateOptions, ValidateSeverity, } from "./flows/mesh-init-validate.js";
27
+ export { buildMeshInitCommand } from "./commands/mesh-init.js";
28
+ export { syncFlow, classifyCheckStatus } from "./flows/sync.js";
29
+ export type { SyncFlowArgs, SyncFlowResult, SyncFrictionHint, VaultSyncReport, VaultSyncStatus, } from "./flows/sync.js";
30
+ export { syncCheckFlow } from "./flows/sync-check.js";
31
+ export type { SyncCheckArgs, SyncCheckResult, VaultCheckReport } from "./flows/sync-check.js";
32
+ export { syncWatchFlow, DEFAULT_COMMIT_DEBOUNCE_MS } from "./flows/sync-watch.js";
33
+ export type { SyncWatchHandle, SyncWatchOptions } from "./flows/sync-watch.js";
34
+ export { buildSyncCommand } from "./commands/sync.js";
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,SAAS,EACT,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AA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Y,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC1E,YAAY,EACV,eAAe,EACf,eAAe,EACf,cAAc,EACd,eAAe,EACf,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,YAAY,EACV,aAAa,EACb,eAAe,IAAI,uBAAuB,EAC1C,eAAe,IAAI,uBAAuB,EAC1C,gBAAgB,GACjB,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAChE,YAAY,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,eAAe,GAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE9F,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAClF,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright 2026 MARLINK TRADING SRL (YounndAI)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export { buildMeshSubcommand } from "./mesh-command.js";
17
+ export { addSource, listSources, getSourceByName, removeSource, withRegistry, } from "./source/repo.js";
18
+ export { parseScope, serializeScope } from "./source/types.js";
19
+ export { walkGithub } from "./discovery/github.js";
20
+ export { walk, buildDefaultAdapters } from "./discovery/walk.js";
21
+ export { cloneAllFlow } from "./flows/clone-all.js";
22
+ export { buildCloneAllCommand } from "./commands/clone-all.js";
23
+ export { buildSourceCommand } from "./commands/source.js";
24
+ export { buildValidateCommand } from "./commands/validate.js";
25
+ export { buildStatusCommand } from "./commands/status.js";
26
+ // Brief B (B.4) — the top-level `lyt status` publish-drift trust surface
27
+ // (distinct from `lyt mesh status`, the mesh-graph renderer above).
28
+ export { buildPodStatusCommand } from "./commands/pod-status.js";
29
+ export { podStatusFlow } from "./flows/pod-status.js";
30
+ export { validateFlow } from "./flows/validate.js";
31
+ export { statusFlow } from "./flows/status.js";
32
+ export { meshInitFlow, traverseMeshFromRoot } from "./flows/mesh-init.js";
33
+ export { validateMeshInit } from "./flows/mesh-init-validate.js";
34
+ export { buildMeshInitCommand } from "./commands/mesh-init.js";
35
+ export { syncFlow, classifyCheckStatus } from "./flows/sync.js";
36
+ export { syncCheckFlow } from "./flows/sync-check.js";
37
+ export { syncWatchFlow, DEFAULT_COMMIT_DEBOUNCE_MS } from "./flows/sync-watch.js";
38
+ export { buildSyncCommand } from "./commands/sync.js";
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EACL,SAAS,EACT,WAAW,EACX,eAAe,EACf,YAAY,EACZ,YAAY,GACb,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAQjE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AASpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,yEAAyE;AACzE,oEAAoE;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAUtD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASnD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAG/C,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAU1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAQjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAShE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AAGlF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Command } from "commander";
2
+ export declare function buildMeshSubcommand(): Command;
3
+ //# sourceMappingURL=mesh-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mesh-command.d.ts","sourceRoot":"","sources":["../src/mesh-command.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,mBAAmB,IAAI,OAAO,CAU7C"}
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Copyright 2026 MARLINK TRADING SRL (YounndAI)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Command } from "commander";
17
+ import { buildCloneAllCommand } from "./commands/clone-all.js";
18
+ import { buildMeshInitCommand } from "./commands/mesh-init.js";
19
+ import { buildSourceCommand } from "./commands/source.js";
20
+ import { buildStatusCommand } from "./commands/status.js";
21
+ import { buildValidateCommand } from "./commands/validate.js";
22
+ export function buildMeshSubcommand() {
23
+ const mesh = new Command("mesh").description("Multi-org clone-all, vault source management, mesh validate/status, manifest-driven init");
24
+ mesh.addCommand(buildCloneAllCommand());
25
+ mesh.addCommand(buildSourceCommand());
26
+ mesh.addCommand(buildValidateCommand());
27
+ mesh.addCommand(buildStatusCommand());
28
+ mesh.addCommand(buildMeshInitCommand());
29
+ return mesh;
30
+ }
31
+ //# sourceMappingURL=mesh-command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mesh-command.js","sourceRoot":"","sources":["../src/mesh-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,MAAM,UAAU,mBAAmB;IACjC,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAC1C,0FAA0F,CAC3F,CAAC;IACF,IAAI,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACxC,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACtC,IAAI,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACxC,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACtC,IAAI,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACxC,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Client } from "@libsql/client";
2
+ import { type VaultSource, type VaultSourceRow } from "./types.js";
3
+ export interface AddSourceArgs {
4
+ name: string;
5
+ host: string;
6
+ owner: string;
7
+ scope: VaultSource["scope"];
8
+ }
9
+ export declare function addSource(db: Client, args: AddSourceArgs): Promise<VaultSourceRow>;
10
+ export declare function listSources(db: Client): Promise<VaultSourceRow[]>;
11
+ export declare function getSourceByName(db: Client, name: string): Promise<VaultSourceRow | null>;
12
+ export declare function removeSource(db: Client, name: string): Promise<boolean>;
13
+ export declare function withRegistry<T>(fn: (db: Client) => Promise<T>): Promise<T>;
14
+ //# sourceMappingURL=repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/source/repo.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAI7C,OAAO,EAA8B,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/F,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CAC7B;AAaD,wBAAsB,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CASxF;AAED,wBAAsB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAGvE;AAED,wBAAsB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAO9F;AAED,wBAAsB,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ7E;AAED,wBAAsB,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAOhF"}
@@ -0,0 +1,71 @@
1
+ /*
2
+ * Copyright 2026 MARLINK TRADING SRL (YounndAI)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { openRegistry, closeRegistry } from "@younndai/lyt-vault";
17
+ import { parseScope, serializeScope } from "./types.js";
18
+ function rowToVaultSource(row) {
19
+ return {
20
+ id: Number(row["id"]),
21
+ name: String(row["name"]),
22
+ host: String(row["host"]),
23
+ owner: String(row["owner"]),
24
+ scope: parseScope(String(row["scope"])),
25
+ addedAt: String(row["added_at"]),
26
+ };
27
+ }
28
+ export async function addSource(db, args) {
29
+ await db.execute({
30
+ sql: `INSERT INTO vault_sources (name, host, owner, scope, added_at)
31
+ VALUES (?, ?, ?, ?, ?)`,
32
+ args: [args.name, args.host, args.owner, serializeScope(args.scope), new Date().toISOString()],
33
+ });
34
+ const got = await getSourceByName(db, args.name);
35
+ if (!got)
36
+ throw new Error(`Failed to read back source '${args.name}'.`);
37
+ return got;
38
+ }
39
+ export async function listSources(db) {
40
+ const r = await db.execute("SELECT * FROM vault_sources ORDER BY name ASC");
41
+ return r.rows.map((row) => rowToVaultSource(row));
42
+ }
43
+ export async function getSourceByName(db, name) {
44
+ const r = await db.execute({
45
+ sql: "SELECT * FROM vault_sources WHERE name = ?",
46
+ args: [name],
47
+ });
48
+ if (r.rows.length === 0)
49
+ return null;
50
+ return rowToVaultSource(r.rows[0]);
51
+ }
52
+ export async function removeSource(db, name) {
53
+ const existing = await getSourceByName(db, name);
54
+ if (!existing)
55
+ return false;
56
+ await db.execute({
57
+ sql: "DELETE FROM vault_sources WHERE name = ?",
58
+ args: [name],
59
+ });
60
+ return true;
61
+ }
62
+ export async function withRegistry(fn) {
63
+ const db = await openRegistry();
64
+ try {
65
+ return await fn(db);
66
+ }
67
+ finally {
68
+ await closeRegistry(db);
69
+ }
70
+ }
71
+ //# sourceMappingURL=repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repo.js","sourceRoot":"","sources":["../../src/source/repo.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAyC,MAAM,YAAY,CAAC;AAS/F,SAAS,gBAAgB,CAAC,GAA4B;IACpD,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC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CAAC,OAAO,CAAC;QACzB,GAAG,EAAE,4CAA4C;QACjD,IAAI,EAAE,CAAC,IAAI,CAAC;KACb,CAAC,CAAC;IACH,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACrC,OAAO,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAuC,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,EAAU,EAAE,IAAY;IACzD,MAAM,QAAQ,GAAG,MAAM,eAAe,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACjD,IAAI,CAAC,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5B,MAAM,EAAE,CAAC,OAAO,CAAC;QACf,GAAG,EAAE,0CAA0C;QAC/C,IAAI,EAAE,CAAC,IAAI,CAAC;KACb,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,YAAY,CAAI,EAA8B;IAClE,MAAM,EAAE,GAAG,MAAM,YAAY,EAAE,CAAC;IAChC,IAAI,CAAC;QACH,OAAO,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IACtB,CAAC;YAAS,CAAC;QACT,MAAM,aAAa,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;AACH,CAAC"}
@@ -0,0 +1,22 @@
1
+ export type VaultSourceScope = "all" | {
2
+ topic: string;
3
+ } | {
4
+ repos: readonly string[];
5
+ };
6
+ export interface VaultSource {
7
+ name: string;
8
+ host: string;
9
+ owner: string;
10
+ scope: VaultSourceScope;
11
+ }
12
+ export interface VaultSourceRow {
13
+ id: number;
14
+ name: string;
15
+ host: string;
16
+ owner: string;
17
+ scope: VaultSourceScope;
18
+ addedAt: string;
19
+ }
20
+ export declare function serializeScope(scope: VaultSourceScope): string;
21
+ export declare function parseScope(raw: string): VaultSourceScope;
22
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/source/types.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAExF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,gBAAgB,CAAC;CACzB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,gBAAgB,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAI9D;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAuBxD"}
@@ -0,0 +1,49 @@
1
+ /*
2
+ * Copyright 2026 MARLINK TRADING SRL (YounndAI)
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export function serializeScope(scope) {
17
+ if (scope === "all")
18
+ return "all";
19
+ if ("topic" in scope)
20
+ return `topic=${scope.topic}`;
21
+ return `repos=${scope.repos.join(",")}`;
22
+ }
23
+ export function parseScope(raw) {
24
+ if (raw === "all" || raw === "")
25
+ return "all";
26
+ const eq = raw.indexOf("=");
27
+ if (eq === -1) {
28
+ throw new Error(`Invalid scope '${raw}'. Use 'all', 'topic=<tag>', or 'repos=<a,b,c>'.`);
29
+ }
30
+ const key = raw.slice(0, eq).trim();
31
+ const val = raw.slice(eq + 1).trim();
32
+ if (key === "topic") {
33
+ if (!val)
34
+ throw new Error("scope 'topic=' requires a tag value.");
35
+ return { topic: val };
36
+ }
37
+ if (key === "repos") {
38
+ const repos = val
39
+ .split(",")
40
+ .map((s) => s.trim())
41
+ .filter((s) => s.length > 0);
42
+ if (repos.length === 0) {
43
+ throw new Error("scope 'repos=' requires at least one repo name.");
44
+ }
45
+ return { repos };
46
+ }
47
+ throw new Error(`Unknown scope key '${key}'. Use 'all', 'topic=<tag>', or 'repos=<a,b,c>'.`);
48
+ }
49
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/source/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAoBH,MAAM,UAAU,cAAc,CAAC,KAAuB;IACpD,IAAI,KAAK,KAAK,KAAK;QAAE,OAAO,KAAK,CAAC;IAClC,IAAI,OAAO,IAAI,KAAK;QAAE,OAAO,SAAS,KAAK,CAAC,KAAK,EAAE,CAAC;IACpD,OAAO,SAAS,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,GAAW;IACpC,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IAC9C,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,kBAAkB,GAAG,kDAAkD,CAAC,CAAC;IAC3F,CAAC;IACD,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACpC,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IACrC,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QACpB,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QAClE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IACxB,CAAC;IACD,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QACpB,MAAM,KAAK,GAAG,GAAG;aACd,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACrE,CAAC;QACD,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,GAAG,kDAAkD,CAAC,CAAC;AAC/F,CAAC"}
package/package.json ADDED
@@ -0,0 +1,77 @@
1
+ {
2
+ "name": "@younndai/lyt-mesh",
3
+ "version": "0.9.0",
4
+ "description": "Lyt mesh layer — weave markdown vaults into shared knowledge meshes: multi-vault clone-all, subscriptions, edges and rollups, topology validation, and the sync engine.",
5
+ "homepage": "https://linkyourthink.com",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/younndai/lyt",
9
+ "directory": "packages/lyt-mesh"
10
+ },
11
+ "author": {
12
+ "name": "MARLINK TRADING SRL (YounndAI)",
13
+ "url": "https://younndai.com"
14
+ },
15
+ "contributors": [
16
+ {
17
+ "name": "Alexandru Mareș",
18
+ "url": "https://allemaar.com"
19
+ }
20
+ ],
21
+ "license": "Apache-2.0",
22
+ "engines": {
23
+ "node": ">=20.9",
24
+ "npm": ">=10"
25
+ },
26
+ "type": "module",
27
+ "main": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
29
+ "exports": {
30
+ ".": {
31
+ "types": "./dist/index.d.ts",
32
+ "import": "./dist/index.js"
33
+ }
34
+ },
35
+ "bin": {
36
+ "lyt-mesh": "./dist/cli.js"
37
+ },
38
+ "files": [
39
+ "dist",
40
+ "README.md",
41
+ "LICENSE",
42
+ "NOTICE"
43
+ ],
44
+ "scripts": {
45
+ "build": "tsc",
46
+ "typecheck": "tsc --noEmit",
47
+ "test": "vitest run",
48
+ "test:watch": "vitest",
49
+ "clean": "rimraf --glob dist .turbo *.tsbuildinfo",
50
+ "prepack": "npm run clean && npm run build",
51
+ "prepublishOnly": "node ../../scripts/check-no-vendored-deps.mjs --root ../.."
52
+ },
53
+ "dependencies": {
54
+ "@libsql/client": "^0.15.15",
55
+ "@younndai/lyt-vault": "^0.9.0",
56
+ "chokidar": "^4.0.3",
57
+ "commander": "^12.1.0"
58
+ },
59
+ "devDependencies": {
60
+ "@lyt/typescript-config": "*",
61
+ "@types/node": "^22.10.5",
62
+ "rimraf": "*",
63
+ "typescript": "*",
64
+ "vitest": "*"
65
+ },
66
+ "publishConfig": {
67
+ "access": "public"
68
+ },
69
+ "keywords": [
70
+ "lyt",
71
+ "mesh",
72
+ "federation",
73
+ "git",
74
+ "cli",
75
+ "younndai"
76
+ ]
77
+ }