@wrongstack/techstack 0.289.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 (74) hide show
  1. package/LICENSE +21 -0
  2. package/dist/adapters/cpp.d.ts +16 -0
  3. package/dist/adapters/cpp.d.ts.map +1 -0
  4. package/dist/adapters/dart.d.ts +20 -0
  5. package/dist/adapters/dart.d.ts.map +1 -0
  6. package/dist/adapters/dotnet.d.ts +19 -0
  7. package/dist/adapters/dotnet.d.ts.map +1 -0
  8. package/dist/adapters/elixir.d.ts +16 -0
  9. package/dist/adapters/elixir.d.ts.map +1 -0
  10. package/dist/adapters/go.d.ts +20 -0
  11. package/dist/adapters/go.d.ts.map +1 -0
  12. package/dist/adapters/interface.d.ts +104 -0
  13. package/dist/adapters/interface.d.ts.map +1 -0
  14. package/dist/adapters/maven.d.ts +17 -0
  15. package/dist/adapters/maven.d.ts.map +1 -0
  16. package/dist/adapters/npm.d.ts +21 -0
  17. package/dist/adapters/npm.d.ts.map +1 -0
  18. package/dist/adapters/paths.d.ts +37 -0
  19. package/dist/adapters/paths.d.ts.map +1 -0
  20. package/dist/adapters/php.d.ts +20 -0
  21. package/dist/adapters/php.d.ts.map +1 -0
  22. package/dist/adapters/python.d.ts +26 -0
  23. package/dist/adapters/python.d.ts.map +1 -0
  24. package/dist/adapters/ruby.d.ts +16 -0
  25. package/dist/adapters/ruby.d.ts.map +1 -0
  26. package/dist/adapters/rust.d.ts +20 -0
  27. package/dist/adapters/rust.d.ts.map +1 -0
  28. package/dist/advisory/native-audit.d.ts +61 -0
  29. package/dist/advisory/native-audit.d.ts.map +1 -0
  30. package/dist/advisory/osv.d.ts +41 -0
  31. package/dist/advisory/osv.d.ts.map +1 -0
  32. package/dist/delivery/coordinator.d.ts +46 -0
  33. package/dist/delivery/coordinator.d.ts.map +1 -0
  34. package/dist/discovery/index.d.ts +58 -0
  35. package/dist/discovery/index.d.ts.map +1 -0
  36. package/dist/discovery/workspace.d.ts +49 -0
  37. package/dist/discovery/workspace.d.ts.map +1 -0
  38. package/dist/index.d.ts +49 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +4287 -0
  41. package/dist/index.js.map +7 -0
  42. package/dist/policy/status.d.ts +60 -0
  43. package/dist/policy/status.d.ts.map +1 -0
  44. package/dist/registry/client.d.ts +61 -0
  45. package/dist/registry/client.d.ts.map +1 -0
  46. package/dist/registry/purl.d.ts +106 -0
  47. package/dist/registry/purl.d.ts.map +1 -0
  48. package/dist/remediation.d.ts +54 -0
  49. package/dist/remediation.d.ts.map +1 -0
  50. package/dist/research/index.d.ts +11 -0
  51. package/dist/research/index.d.ts.map +1 -0
  52. package/dist/research/llm.d.ts +37 -0
  53. package/dist/research/llm.d.ts.map +1 -0
  54. package/dist/research/researcher.d.ts +31 -0
  55. package/dist/research/researcher.d.ts.map +1 -0
  56. package/dist/research/search.d.ts +19 -0
  57. package/dist/research/search.d.ts.map +1 -0
  58. package/dist/research/triage.d.ts +33 -0
  59. package/dist/research/triage.d.ts.map +1 -0
  60. package/dist/research/types.d.ts +77 -0
  61. package/dist/research/types.d.ts.map +1 -0
  62. package/dist/sbom.d.ts +52 -0
  63. package/dist/sbom.d.ts.map +1 -0
  64. package/dist/service.d.ts +110 -0
  65. package/dist/service.d.ts.map +1 -0
  66. package/dist/snapshot-diff.d.ts +27 -0
  67. package/dist/snapshot-diff.d.ts.map +1 -0
  68. package/dist/store/schema.d.ts +20 -0
  69. package/dist/store/schema.d.ts.map +1 -0
  70. package/dist/store/sqlite.d.ts +57 -0
  71. package/dist/store/sqlite.d.ts.map +1 -0
  72. package/dist/types.d.ts +123 -0
  73. package/dist/types.d.ts.map +1 -0
  74. package/package.json +45 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ECOSTACK TECHNOLOGY OÜ
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * TechStack — C/C++ ecosystem adapter (Tier C).
3
+ *
4
+ * Best-effort: parses conanfile.txt / conanfile.py for `[requires]` and
5
+ * vcpkg.json for dependencies. No lockfile resolution; coverage='unsupported'.
6
+ *
7
+ * @see docs/specs/techstack-sdd.md §6 Tier C
8
+ */
9
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
10
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
11
+ export declare class CppAdapter implements EcosystemAdapter {
12
+ readonly ecosystem: EcosystemId;
13
+ inventory(workspace: Workspace, _options: InventoryOptions): Promise<readonly DependencyObservation[]>;
14
+ }
15
+ export declare const cppAdapter: CppAdapter;
16
+ //# sourceMappingURL=cpp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cpp.d.ts","sourceRoot":"","sources":["../../src/adapters/cpp.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACV,qBAAqB,EAErB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAiDzE,qBAAa,UAAW,YAAW,gBAAgB;IACjD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAS;IAElC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAiD3C;CACF;AAED,eAAO,MAAM,UAAU,YAAmB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * TechStack — Dart ecosystem adapter.
3
+ *
4
+ * Parses pubspec.yaml and pubspec.lock to produce
5
+ * DependencyObservation[] for Dart/Flutter workspaces.
6
+ *
7
+ * @see docs/specs/techstack-sdd.md §6 Tier A
8
+ */
9
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
10
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
11
+ export declare class DartAdapter implements EcosystemAdapter {
12
+ readonly ecosystem: EcosystemId;
13
+ inventory(workspace: Workspace, options: InventoryOptions): Promise<readonly DependencyObservation[]>;
14
+ private fileExists;
15
+ }
16
+ /**
17
+ * Default singleton instance.
18
+ */
19
+ export declare const dartAdapter: DartAdapter;
20
+ //# sourceMappingURL=dart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dart.d.ts","sourceRoot":"","sources":["../../src/adapters/dart.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EACV,qBAAqB,EAGrB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAsHxB,qBAAa,WAAY,YAAW,gBAAgB;IAClD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAU;IAEnC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAmG3C;IAED,OAAO,CAAC,UAAU;CAQnB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,aAAoB,CAAC"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * TechStack — .NET ecosystem adapter.
3
+ *
4
+ * Parses .csproj files and project.assets.json to produce
5
+ * DependencyObservation[] for .NET workspaces.
6
+ *
7
+ * @see docs/specs/techstack-sdd.md §6 Tier A
8
+ */
9
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
10
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
11
+ export declare class DotNetAdapter implements EcosystemAdapter {
12
+ readonly ecosystem: EcosystemId;
13
+ inventory(workspace: Workspace, options: InventoryOptions): Promise<readonly DependencyObservation[]>;
14
+ }
15
+ /**
16
+ * Default singleton instance.
17
+ */
18
+ export declare const dotNetAdapter: DotNetAdapter;
19
+ //# sourceMappingURL=dotnet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dotnet.d.ts","sourceRoot":"","sources":["../../src/adapters/dotnet.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EACV,qBAAqB,EAErB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAgFxB,qBAAa,aAAc,YAAW,gBAAgB;IACpD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAY;IAErC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAwE3C;CACF;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,eAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * TechStack — Elixir/Hex ecosystem adapter (Tier B).
3
+ *
4
+ * Parses mix.exs for direct dependencies and mix.lock for resolved versions.
5
+ * Partial support — no registry API; OSV-only advisory enrichment.
6
+ *
7
+ * @see docs/specs/techstack-sdd.md §6 Tier B
8
+ */
9
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
10
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
11
+ export declare class ElixirAdapter implements EcosystemAdapter {
12
+ readonly ecosystem: EcosystemId;
13
+ inventory(workspace: Workspace, _options: InventoryOptions): Promise<readonly DependencyObservation[]>;
14
+ }
15
+ export declare const elixirAdapter: ElixirAdapter;
16
+ //# sourceMappingURL=elixir.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elixir.d.ts","sourceRoot":"","sources":["../../src/adapters/elixir.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACV,qBAAqB,EAGrB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAuCzE,qBAAa,aAAc,YAAW,gBAAgB;IACpD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAY;IAErC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CA4D3C;CACF;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * TechStack — Go ecosystem adapter.
3
+ *
4
+ * Parses go.mod manifests and go.sum to produce DependencyObservation[]
5
+ * for Go workspaces.
6
+ *
7
+ * @see docs/specs/techstack-sdd.md §6 Tier A
8
+ */
9
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
10
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
11
+ export declare class GoAdapter implements EcosystemAdapter {
12
+ readonly ecosystem: EcosystemId;
13
+ inventory(workspace: Workspace, options: InventoryOptions): Promise<readonly DependencyObservation[]>;
14
+ private fileExists;
15
+ }
16
+ /**
17
+ * Default singleton instance.
18
+ */
19
+ export declare const goAdapter: GoAdapter;
20
+ //# sourceMappingURL=go.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"go.d.ts","sourceRoot":"","sources":["../../src/adapters/go.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACV,qBAAqB,EAGrB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AA6HxB,qBAAa,SAAU,YAAW,gBAAgB;IAChD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAQ;IAEjC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CA4E3C;IAED,OAAO,CAAC,UAAU;CAQnB;AAED;;GAEG;AACH,eAAO,MAAM,SAAS,WAAkB,CAAC"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * TechStack — Ecosystem adapter interface.
3
+ *
4
+ * Every ecosystem (npm, Python, Rust, Go, etc.) implements this contract.
5
+ * The inventory engine discovers workspaces via detectLanguageWorkspaces(),
6
+ * then dispatches to the matching adapter for each workspace.
7
+ *
8
+ * @see docs/specs/techstack-sdd.md §3.2, §6
9
+ */
10
+ import type { DependencyObservation, EcosystemId, Evidence, Workspace } from '../types.js';
11
+ /**
12
+ * Options passed to inventory() controlling what data the adapter collects.
13
+ */
14
+ export interface InventoryOptions {
15
+ /**
16
+ * Absolute path of the project being analyzed. `Workspace.relativeRoot` is
17
+ * resolved against it.
18
+ *
19
+ * Without this, adapters resolve against `process.cwd()` and read nothing
20
+ * whenever the server was started from anywhere but the project root.
21
+ *
22
+ * @see ./paths.ts
23
+ */
24
+ readonly projectRoot?: string | undefined;
25
+ /** Include transitive dependencies from lockfiles, not just direct. */
26
+ readonly includeTransitive?: boolean | undefined;
27
+ /** Abort signal for cancellation. */
28
+ readonly signal?: AbortSignal | undefined;
29
+ }
30
+ /**
31
+ * Options passed to enrich() for online registry lookups.
32
+ */
33
+ export interface EnrichOptions {
34
+ /** Skip network calls; use only cached/offline data. */
35
+ readonly offline?: boolean | undefined;
36
+ /** Abort signal for cancellation. */
37
+ readonly signal?: AbortSignal | undefined;
38
+ }
39
+ /**
40
+ * Options passed to audit() for security advisory checks.
41
+ */
42
+ export interface AuditOptions {
43
+ /** Skip network calls; use only cached/offline data. */
44
+ readonly offline?: boolean | undefined;
45
+ /** Abort signal for cancellation. */
46
+ readonly signal?: AbortSignal | undefined;
47
+ }
48
+ /**
49
+ * Result of enriching a single dependency with registry metadata.
50
+ */
51
+ export interface RegistryEvidence {
52
+ readonly latestStable?: string | undefined;
53
+ readonly license?: string | undefined;
54
+ readonly deprecated?: boolean | undefined;
55
+ readonly yanked?: boolean | undefined;
56
+ readonly evidence: readonly Evidence[];
57
+ }
58
+ /**
59
+ * Result of auditing a single dependency for vulnerabilities.
60
+ */
61
+ export interface AdvisoryEvidence {
62
+ readonly hasAdvisory: boolean;
63
+ readonly severity: 'info' | 'low' | 'medium' | 'high' | 'critical' | undefined;
64
+ readonly summary?: string | undefined;
65
+ readonly url?: string | undefined;
66
+ readonly evidence: readonly Evidence[];
67
+ }
68
+ /**
69
+ * The contract every ecosystem adapter must implement.
70
+ *
71
+ * Adapters are pure data-extraction/enrichment modules. They never:
72
+ * - Modify any files (analysis is read-only).
73
+ * - Execute arbitrary project code (commands that do are permission-gated).
74
+ * - Set version fields without evidence.
75
+ * - Classify private/unresolved packages (404) as "dead" or "deprecated".
76
+ */
77
+ export interface EcosystemAdapter {
78
+ /** The ecosystem this adapter handles. */
79
+ readonly ecosystem: EcosystemId;
80
+ /**
81
+ * Extract all dependencies from a workspace's manifests and lockfiles.
82
+ *
83
+ * This is the deterministic offline pass — no network calls.
84
+ * Returns one DependencyObservation per package/version combination.
85
+ * Each observation must carry at least one Evidence entry (manifest or lockfile).
86
+ */
87
+ inventory(workspace: Workspace, options: InventoryOptions): Promise<readonly DependencyObservation[]>;
88
+ /**
89
+ * Enrich dependencies with registry metadata (latest version, license, deprecation).
90
+ *
91
+ * May make network calls to package registries.
92
+ * Must not fabricate version numbers — only return data backed by registry evidence.
93
+ * Must handle 404/401 gracefully → status stays `private_or_unresolved`.
94
+ */
95
+ enrich?(dependencies: readonly DependencyObservation[], options: EnrichOptions): Promise<readonly RegistryEvidence[]>;
96
+ /**
97
+ * Check dependencies for known security advisories.
98
+ *
99
+ * Uses ecosystem-native audit commands and/or OSV batch queries.
100
+ * Must not classify a package as vulnerable without advisory evidence.
101
+ */
102
+ audit?(dependencies: readonly DependencyObservation[], options: AuditOptions): Promise<readonly AdvisoryEvidence[]>;
103
+ }
104
+ //# sourceMappingURL=interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/adapters/interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,QAAQ,EACR,SAAS,EACV,MAAM,aAAa,CAAC;AAErB;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;OAQG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,uEAAuE;IACvE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACjD,qCAAqC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,qCAAqC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACvC,qCAAqC;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC/E,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,QAAQ,EAAE,CAAC;CACxC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0CAA0C;IAC1C,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC;IAEhC;;;;;;OAMG;IACH,SAAS,CACP,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAAC;IAE7C;;;;;;OAMG;IACH,MAAM,CAAC,CACL,YAAY,EAAE,SAAS,qBAAqB,EAAE,EAC9C,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAAC;IAExC;;;;;OAKG;IACH,KAAK,CAAC,CACJ,YAAY,EAAE,SAAS,qBAAqB,EAAE,EAC9C,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,SAAS,gBAAgB,EAAE,CAAC,CAAC;CACzC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * TechStack — Maven ecosystem adapter (Tier B).
3
+ *
4
+ * Parses pom.xml for direct dependencies. Partial support — no lockfile
5
+ * parsing (Maven has no standardized lockfile); version resolution
6
+ * requires `mvn dependency:tree` which is not invoked here.
7
+ *
8
+ * @see docs/specs/techstack-sdd.md §6 Tier B
9
+ */
10
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
11
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
12
+ export declare class MavenAdapter implements EcosystemAdapter {
13
+ readonly ecosystem: EcosystemId;
14
+ inventory(workspace: Workspace, _options: InventoryOptions): Promise<readonly DependencyObservation[]>;
15
+ }
16
+ export declare const mavenAdapter: MavenAdapter;
17
+ //# sourceMappingURL=maven.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maven.d.ts","sourceRoot":"","sources":["../../src/adapters/maven.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,KAAK,EACV,qBAAqB,EAGrB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AA6CzE,qBAAa,YAAa,YAAW,gBAAgB;IACnD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAW;IAEpC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAyC3C;CACF;AAED,eAAO,MAAM,YAAY,cAAqB,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * TechStack — npm ecosystem adapter.
3
+ *
4
+ * Parses package.json manifests and pnpm-lock.yaml (or package-lock.json /
5
+ * yarn.lock) to produce DependencyObservation[] for Node.js workspaces.
6
+ *
7
+ * Supports: pnpm, npm, yarn, bun — determined by lockfile presence.
8
+ *
9
+ * @see docs/specs/techstack-sdd.md §6 Tier A
10
+ */
11
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
12
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
13
+ export declare class NpmAdapter implements EcosystemAdapter {
14
+ readonly ecosystem: EcosystemId;
15
+ inventory(workspace: Workspace, options: InventoryOptions): Promise<readonly DependencyObservation[]>;
16
+ }
17
+ /**
18
+ * Default singleton instance.
19
+ */
20
+ export declare const npmAdapter: NpmAdapter;
21
+ //# sourceMappingURL=npm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npm.d.ts","sourceRoot":"","sources":["../../src/adapters/npm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EACV,qBAAqB,EAIrB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAmQxB,qBAAa,UAAW,YAAW,gBAAgB;IACjD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAS;IAElC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CA0G3C;CACF;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,YAAmB,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * TechStack — adapter path resolution.
3
+ *
4
+ * `Workspace.relativeRoot` is deliberately project-relative: snapshots are
5
+ * persisted and shipped to the browser, so they must stay portable across
6
+ * machines. Adapters, however, have to actually open files, and a relative
7
+ * root resolves against `process.cwd()` — which is only the project root by
8
+ * coincidence. The server can be started from anywhere, and switching projects
9
+ * mid-session doesn't move `cwd` at all.
10
+ *
11
+ * So the absolute base travels alongside the workspace, via
12
+ * `InventoryOptions.projectRoot`, instead of being baked into the persisted
13
+ * type.
14
+ *
15
+ * @see docs/specs/techstack-sdd.md §3.2
16
+ */
17
+ import type { Workspace } from '../types.js';
18
+ import type { InventoryOptions } from './interface.js';
19
+ /**
20
+ * Absolute filesystem root of a workspace.
21
+ *
22
+ * Falls back to resolving against `cwd` when no `projectRoot` is supplied, to
23
+ * keep older direct callers working.
24
+ */
25
+ export declare function workspaceRoot(workspace: Workspace, options: InventoryOptions): string;
26
+ /**
27
+ * Resolve a manifest/lockfile path that may arrive either absolute (as
28
+ * `Workspace.manifests` entries do, straight from discovery) or as a bare
29
+ * filename (as adapter fallbacks use).
30
+ *
31
+ * Use this instead of `join`: `join('/a/b', '/a/b/package.json')` yields
32
+ * `/a/b/a/b/package.json`, which is exactly the bug that silently emptied the
33
+ * npm, Go, and Rust inventories — every workspace threw on read and the
34
+ * engine's `catch { deps = [] }` swallowed it.
35
+ */
36
+ export declare function resolveIn(root: string, candidate: string): string;
37
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/adapters/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAGrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAEjE"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * TechStack — PHP ecosystem adapter.
3
+ *
4
+ * Parses composer.json and composer.lock to produce
5
+ * DependencyObservation[] for PHP workspaces.
6
+ *
7
+ * @see docs/specs/techstack-sdd.md §6 Tier A
8
+ */
9
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
10
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
11
+ export declare class PhpAdapter implements EcosystemAdapter {
12
+ readonly ecosystem: EcosystemId;
13
+ inventory(workspace: Workspace, options: InventoryOptions): Promise<readonly DependencyObservation[]>;
14
+ private fileExists;
15
+ }
16
+ /**
17
+ * Default singleton instance.
18
+ */
19
+ export declare const phpAdapter: PhpAdapter;
20
+ //# sourceMappingURL=php.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"php.d.ts","sourceRoot":"","sources":["../../src/adapters/php.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EACV,qBAAqB,EAGrB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAwExB,qBAAa,UAAW,YAAW,gBAAgB;IACjD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAS;IAElC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAmF3C;IAED,OAAO,CAAC,UAAU;CAQnB;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,YAAmB,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * TechStack — Python ecosystem adapter.
3
+ *
4
+ * Parses pyproject.toml (PEP 621), requirements.txt, and Pipfile to produce
5
+ * DependencyObservation[] for Python workspaces.
6
+ *
7
+ * Supports: pip, pipenv, poetry, uv — determined by manifest/lockfile presence.
8
+ */
9
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
10
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
11
+ /**
12
+ * Parse poetry.lock to extract resolved versions.
13
+ * Format:
14
+ * [[package]]
15
+ * name = "flask"
16
+ * version = "3.0.3"
17
+ */
18
+ export declare function parsePoetryLock(content: string): Map<string, string>;
19
+ export declare class PythonAdapter implements EcosystemAdapter {
20
+ readonly ecosystem: EcosystemId;
21
+ inventory(workspace: Workspace, options: InventoryOptions): Promise<readonly DependencyObservation[]>;
22
+ private fileExists;
23
+ private detectLockfile;
24
+ }
25
+ export declare const pythonAdapter: PythonAdapter;
26
+ //# sourceMappingURL=python.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../src/adapters/python.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EACV,qBAAqB,EAGrB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AAqKxB;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAiBpE;AAYD,qBAAa,aAAc,YAAW,gBAAgB;IACpD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAY;IAErC,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAqG1G;IAED,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,cAAc;CAMvB;AAED,eAAO,MAAM,aAAa,eAAsB,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * TechStack — Ruby/Bundler ecosystem adapter (Tier B).
3
+ *
4
+ * Parses Gemfile and Gemfile.lock for direct and transitive dependencies.
5
+ * Partial support — no registry API; OSV-only advisory enrichment.
6
+ *
7
+ * @see docs/specs/techstack-sdd.md §6 Tier B
8
+ */
9
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
10
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
11
+ export declare class RubyAdapter implements EcosystemAdapter {
12
+ readonly ecosystem: EcosystemId;
13
+ inventory(workspace: Workspace, _options: InventoryOptions): Promise<readonly DependencyObservation[]>;
14
+ }
15
+ export declare const rubyAdapter: RubyAdapter;
16
+ //# sourceMappingURL=ruby.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ruby.d.ts","sourceRoot":"","sources":["../../src/adapters/ruby.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACV,qBAAqB,EAGrB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAgDzE,qBAAa,WAAY,YAAW,gBAAgB;IAClD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAU;IAEnC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CA4D3C;CACF;AAED,eAAO,MAAM,WAAW,aAAoB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * TechStack — Rust ecosystem adapter.
3
+ *
4
+ * Parses Cargo.toml manifests and Cargo.lock lockfiles to produce
5
+ * DependencyObservation[] for Rust workspaces.
6
+ *
7
+ * @see docs/specs/techstack-sdd.md §6 Tier A
8
+ */
9
+ import type { DependencyObservation, EcosystemId, Workspace } from '../types.js';
10
+ import type { EcosystemAdapter, InventoryOptions } from './interface.js';
11
+ export declare class RustAdapter implements EcosystemAdapter {
12
+ readonly ecosystem: EcosystemId;
13
+ inventory(workspace: Workspace, options: InventoryOptions): Promise<readonly DependencyObservation[]>;
14
+ private fileExists;
15
+ }
16
+ /**
17
+ * Default singleton instance.
18
+ */
19
+ export declare const rustAdapter: RustAdapter;
20
+ //# sourceMappingURL=rust.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rust.d.ts","sourceRoot":"","sources":["../../src/adapters/rust.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EACV,qBAAqB,EAGrB,WAAW,EACX,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,gBAAgB,CAAC;AA2JxB,qBAAa,WAAY,YAAW,gBAAgB;IAClD,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAU;IAEnC,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAoG3C;IAED,OAAO,CAAC,UAAU;CAQnB;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,aAAoB,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * TechStack — Native audit command wrappers.
3
+ *
4
+ * Spawns ecosystem-native audit tools (npm audit, pip-audit, cargo-audit,
5
+ * govulncheck, composer audit, dotnet package audit) and parses their
6
+ * output into the TechStack advisory model.
7
+ *
8
+ * @see docs/specs/techstack-sdd.md §6, §7
9
+ */
10
+ import type { EcosystemId, Evidence } from '../types.js';
11
+ export interface NativeAdvisory {
12
+ readonly id: string;
13
+ readonly packageName: string;
14
+ readonly severity: 'info' | 'low' | 'medium' | 'high' | 'critical';
15
+ readonly summary: string;
16
+ readonly fixVersion?: string | undefined;
17
+ readonly url?: string | undefined;
18
+ readonly aliases: readonly string[];
19
+ }
20
+ export interface NativeAuditResult {
21
+ readonly advisories: readonly NativeAdvisory[];
22
+ readonly evidence: Evidence;
23
+ }
24
+ /**
25
+ * Run npm audit in the given workspace directory and parse JSON output.
26
+ */
27
+ export declare function runNpmAudit(workspaceRoot: string): NativeAuditResult;
28
+ /**
29
+ * Run pip-audit in the given workspace directory.
30
+ * pip-audit supports --requirement, --format json flags.
31
+ */
32
+ export declare function runPipAudit(workspaceRoot: string): NativeAuditResult;
33
+ /**
34
+ * Run cargo-audit in the given workspace directory.
35
+ */
36
+ export declare function runCargoAudit(workspaceRoot: string): NativeAuditResult;
37
+ /**
38
+ * Run govulncheck in the given workspace directory.
39
+ * Output is JSON with vulnerabilities in the format:
40
+ * { vulns: [{ id, details, osv, ... }] }
41
+ */
42
+ export declare function runGoVulncheck(workspaceRoot: string): NativeAuditResult;
43
+ /**
44
+ * Run composer audit in the given workspace directory.
45
+ */
46
+ export declare function runComposerAudit(workspaceRoot: string): NativeAuditResult;
47
+ /**
48
+ * Run `dotnet package audit` in the given workspace directory.
49
+ * .NET 8+ supports `dotnet package audit --format json`.
50
+ */
51
+ export declare function runDotnetAudit(workspaceRoot: string): NativeAuditResult;
52
+ /**
53
+ * Run the native audit command for the given ecosystem.
54
+ * Returns advisories found by the native tool.
55
+ */
56
+ export declare function runNativeAudit(ecosystem: EcosystemId, workspaceRoot: string): NativeAuditResult;
57
+ /**
58
+ * Check if the native audit tool is available for the given ecosystem.
59
+ */
60
+ export declare function isNativeAuditAvailable(ecosystem: EcosystemId): boolean;
61
+ //# sourceMappingURL=native-audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-audit.d.ts","sourceRoot":"","sources":["../../src/advisory/native-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIzD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IACnE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,UAAU,EAAE,SAAS,cAAc,EAAE,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AA6BD;;GAEG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,CA0DpE;AAID;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,CAkBpE;AAuCD;;GAEG;AACH,wBAAgB,aAAa,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,CAGtE;AAgDD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,CA2CvE;AAID;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,CAwCzE;AAID;;;GAGG;AACH,wBAAgB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,iBAAiB,CA4DvE;AA0CD;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,WAAW,EACtB,aAAa,EAAE,MAAM,GACpB,iBAAiB,CA0BnB;AAID;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAatE"}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * TechStack — OSV (Open Source Vulnerabilities) advisory client.
3
+ *
4
+ * Uses the OSV /v1/querybatch endpoint to batch-query vulnerability
5
+ * information for lists of PackageURLs. Chunks requests into batches
6
+ * of at most 500 packages per the OSV API limits.
7
+ *
8
+ * @see https://osv.dev/docs/
9
+ */
10
+ import type { Evidence } from '../types.js';
11
+ /** Parsed advisory for a single package */
12
+ export interface OsvAdvisory {
13
+ readonly id: string;
14
+ readonly summary: string;
15
+ readonly severity: 'info' | 'low' | 'medium' | 'high' | 'critical';
16
+ readonly aliases: readonly string[];
17
+ }
18
+ /** Result of querying OSV for a batch of packages */
19
+ export interface OsvBatchResult {
20
+ /** Map from PURL to advisories found for that package */
21
+ readonly advisories: Map<string, readonly OsvAdvisory[]>;
22
+ readonly evidence: Evidence;
23
+ }
24
+ /**
25
+ * Query OSV for advisories matching a list of PackageURLs.
26
+ *
27
+ * Chunks requests into batches of at most 500 PURLs per the OSV API limits.
28
+ * Returns a map from each queried PURL to its list of advisories (empty array
29
+ * means no advisories found).
30
+ */
31
+ export declare function queryOsvBatch(purls: readonly string[], options?: {
32
+ signal?: AbortSignal | undefined;
33
+ }): Promise<OsvBatchResult>;
34
+ /**
35
+ * Query OSV for a single PURL.
36
+ * Convenience wrapper around queryOsvBatch.
37
+ */
38
+ export declare function queryOsvSingle(purl: string, options?: {
39
+ signal?: AbortSignal | undefined;
40
+ }): Promise<readonly OsvAdvisory[]>;
41
+ //# sourceMappingURL=osv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"osv.d.ts","sourceRoot":"","sources":["../../src/advisory/osv.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAqC5C,2CAA2C;AAC3C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;IACnE,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACrC;AAED,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,QAAQ,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC,CAAC;IACzD,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;CAC7B;AA2FD;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;CAAO,GACjD,OAAO,CAAC,cAAc,CAAC,CAiGzB;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,CAAA;CAAO,GACjD,OAAO,CAAC,SAAS,WAAW,EAAE,CAAC,CAGjC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * TechStack — DeliveryCoordinator.
3
+ *
4
+ * Per-session idle-delivery coordinator for TechStack reports.
5
+ *
6
+ * Guarantees (per SDD §5):
7
+ * 1. Idle-only: report is never injected while a run is in progress.
8
+ * 2. Exactly-once visible delivery: duplicate outbox entries → single delivery.
9
+ * 3. Durable: survives store close/reopen; pending entries retry on recovery.
10
+ * 4. Bounded: at most one delivery per report per session.
11
+ *
12
+ * @see docs/specs/techstack-sdd.md §5
13
+ */
14
+ import type { TechStackStore } from '../store/sqlite.js';
15
+ export interface DeliveryCoordinatorOptions {
16
+ readonly store: TechStackStore;
17
+ /** Check whether an agent run is currently in progress. */
18
+ readonly isRunInProgress: () => boolean;
19
+ /** Deliver the report summary to the chat session (append to journal). */
20
+ readonly deliverToSession: (sessionId: string, reportId: string, summary: string) => Promise<boolean>;
21
+ /** Called when a delivery completes (for WS event broadcasting). */
22
+ readonly onDelivered?: ((deliveryId: string, sessionId: string) => void) | undefined;
23
+ /** Poll interval in ms. Default: 2000. */
24
+ readonly pollIntervalMs?: number | undefined;
25
+ }
26
+ export interface DeliveryResult {
27
+ deliveryId: string;
28
+ sessionId: string;
29
+ delivered: boolean;
30
+ }
31
+ /**
32
+ * Attempt to deliver a single pending outbox entry.
33
+ *
34
+ * Returns `{ delivered: false }` if the run is still in progress or the
35
+ * entry has already been delivered. Returns `{ delivered: true }` on success.
36
+ *
37
+ * This function is idempotent: calling it twice for the same deliveryId
38
+ * will deliver exactly once (the CAS in claimOutbox prevents double-claim).
39
+ */
40
+ export declare function attemptDelivery(deliveryId: string, opts: DeliveryCoordinatorOptions): Promise<DeliveryResult>;
41
+ /**
42
+ * Process all pending outbox entries for a given session.
43
+ * Called by the coordinator loop when the session becomes idle.
44
+ */
45
+ export declare function drainPendingDeliveries(sessionId: string, opts: DeliveryCoordinatorOptions): Promise<number>;
46
+ //# sourceMappingURL=coordinator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordinator.d.ts","sourceRoot":"","sources":["../../src/delivery/coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGzD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,eAAe,EAAE,MAAM,OAAO,CAAC;IACxC,0EAA0E;IAC1E,QAAQ,CAAC,gBAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACtG,oEAAoE;IACpE,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IACrF,0CAA0C;IAC1C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC9C;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,cAAc,CAAC,CAoCzB;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,0BAA0B,GAC/B,OAAO,CAAC,MAAM,CAAC,CAYjB"}