@seamward/cli 0.1.0-alpha.9

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 (46) hide show
  1. package/LICENSE +31 -0
  2. package/README.md +428 -0
  3. package/dist/cli.d.ts +11 -0
  4. package/dist/cli.js +659 -0
  5. package/dist/cli.js.map +1 -0
  6. package/dist/connection-key.d.ts +6 -0
  7. package/dist/connection-key.js +13 -0
  8. package/dist/connection-key.js.map +1 -0
  9. package/dist/contract-sync.d.ts +134 -0
  10. package/dist/contract-sync.js +603 -0
  11. package/dist/contract-sync.js.map +1 -0
  12. package/dist/discovery.d.ts +47 -0
  13. package/dist/discovery.js +496 -0
  14. package/dist/discovery.js.map +1 -0
  15. package/dist/existing-webhook-binding.d.ts +9 -0
  16. package/dist/existing-webhook-binding.js +196 -0
  17. package/dist/existing-webhook-binding.js.map +1 -0
  18. package/dist/index.d.ts +9 -0
  19. package/dist/index.js +10 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/observation-sync.d.ts +28 -0
  22. package/dist/observation-sync.js +101 -0
  23. package/dist/observation-sync.js.map +1 -0
  24. package/dist/project-metadata.d.ts +7 -0
  25. package/dist/project-metadata.js +104 -0
  26. package/dist/project-metadata.js.map +1 -0
  27. package/dist/remote-api.d.ts +10 -0
  28. package/dist/remote-api.js +61 -0
  29. package/dist/remote-api.js.map +1 -0
  30. package/dist/setup-engine.d.ts +127 -0
  31. package/dist/setup-engine.js +765 -0
  32. package/dist/setup-engine.js.map +1 -0
  33. package/dist/setup-plan.d.ts +197 -0
  34. package/dist/setup-plan.js +1240 -0
  35. package/dist/setup-plan.js.map +1 -0
  36. package/dist/source-instrumentation.d.ts +10 -0
  37. package/dist/source-instrumentation.js +291 -0
  38. package/dist/source-instrumentation.js.map +1 -0
  39. package/dist/version.d.ts +1 -0
  40. package/dist/version.js +8 -0
  41. package/dist/version.js.map +1 -0
  42. package/examples/node-service/README.md +42 -0
  43. package/examples/node-service/contracts/orders.openapi.yaml +18 -0
  44. package/examples/node-service/package.json +11 -0
  45. package/examples/node-service/src/server.ts +13 -0
  46. package/package.json +58 -0
@@ -0,0 +1,127 @@
1
+ import { scanProject } from "./discovery.js";
2
+ import { type ProjectMetadata } from "./project-metadata.js";
3
+ import { discoverIntegrationScopes, inspectSetupActionEvidence, inspectSetupRemoteLifecycle, type ApplySetupResult, type IntegrationProtocol, type SetupPlan } from "./setup-plan.js";
4
+ export interface LocalSetupEngineOptions {
5
+ root: string;
6
+ setupId?: string;
7
+ }
8
+ export interface SetupSelection {
9
+ direction: "inbound" | "outbound";
10
+ protocol: IntegrationProtocol;
11
+ contractFiles?: string[];
12
+ findingIds?: string[];
13
+ }
14
+ export interface SetupAnalysis {
15
+ project: ProjectMetadata;
16
+ discovery: Awaited<ReturnType<typeof scanProject>>;
17
+ integrationScopes: ReturnType<typeof discoverIntegrationScopes>;
18
+ privacy: {
19
+ sourceContentReturned: false;
20
+ environmentFilesRead: false;
21
+ absolutePathsReturned: false;
22
+ credentialsReturned: false;
23
+ };
24
+ }
25
+ export interface SetupVerification {
26
+ planFingerprint: string;
27
+ stateFingerprint: string;
28
+ artifactsValid: boolean;
29
+ collectorDependency: {
30
+ present: boolean;
31
+ compatible: boolean;
32
+ version: string | null;
33
+ minimumVersion: string;
34
+ };
35
+ generatedFiles: Array<{
36
+ file: string;
37
+ present: boolean;
38
+ matches: boolean;
39
+ }>;
40
+ instrumentationActions: Awaited<ReturnType<typeof inspectSetupActionEvidence>>;
41
+ contractActions: Awaited<ReturnType<typeof inspectSetupActionEvidence>>;
42
+ sourceBackedComplete: boolean;
43
+ localSetupComplete: boolean;
44
+ setupComplete: boolean;
45
+ remoteLifecycle: Awaited<ReturnType<typeof inspectSetupRemoteLifecycle>>;
46
+ blockers: Array<{
47
+ code: string;
48
+ file?: string;
49
+ }>;
50
+ }
51
+ export type LocalApplyResult = {
52
+ status: "verified";
53
+ files: string[];
54
+ verification: SetupVerification;
55
+ } | {
56
+ status: "source_changes_required";
57
+ files: string[];
58
+ sourceChanges: Array<{
59
+ file: string;
60
+ line: number;
61
+ adapter: string;
62
+ }>;
63
+ verification: SetupVerification;
64
+ };
65
+ export declare class LocalSetupEngineError extends Error {
66
+ readonly code: "plan_not_found" | "legacy_plan_requires_replan" | "confirmation_required" | "no_matching_actions" | "generated_file_conflict" | "apply_in_progress" | "verification_failed" | "internal_error";
67
+ constructor(code: "plan_not_found" | "legacy_plan_requires_replan" | "confirmation_required" | "no_matching_actions" | "generated_file_conflict" | "apply_in_progress" | "verification_failed" | "internal_error", message: string, options?: ErrorOptions);
68
+ }
69
+ export declare function readSetupPlan(root: string, expectedFingerprint?: string, setupId?: string): Promise<SetupPlan>;
70
+ export declare function readSetupPlans(root: string): Promise<SetupPlan[]>;
71
+ export declare function verifySetup(root: string, plan: SetupPlan): Promise<SetupVerification>;
72
+ export interface LocalSetupEngine {
73
+ analyze(): Promise<SetupAnalysis>;
74
+ plan(selection: SetupSelection): Promise<{
75
+ plan: SetupPlan;
76
+ applyPreview: ApplySetupResult;
77
+ }>;
78
+ applyGenerated(input: {
79
+ planFingerprint: string;
80
+ confirmation: "write_generated_setup";
81
+ }): Promise<ApplySetupResult>;
82
+ replaceGenerated(input: {
83
+ previousPlanFingerprint: string;
84
+ planFingerprint: string;
85
+ confirmation: "replace_generated_setup";
86
+ }): Promise<ApplySetupResult>;
87
+ recordEvidence(input: {
88
+ planFingerprint: string;
89
+ expectedStateFingerprint: string;
90
+ implementationFiles: string[];
91
+ note?: string;
92
+ confirmation: "record_source_evidence";
93
+ }): Promise<{
94
+ applied: true;
95
+ planFingerprint: string;
96
+ recordedActions: Array<{
97
+ file: string | null;
98
+ status: "recorded";
99
+ }>;
100
+ }>;
101
+ applyLocal(input: {
102
+ planFingerprint: string;
103
+ }): Promise<LocalApplyResult>;
104
+ verify(input: {
105
+ planFingerprint: string;
106
+ }): Promise<SetupVerification>;
107
+ }
108
+ export declare function applyLocalSetupBatch(rootDirectory: string, entries: Array<{
109
+ engine: LocalSetupEngine;
110
+ plan: SetupPlan;
111
+ }>, retiredPlans?: SetupPlan[]): Promise<{
112
+ applied: Array<{
113
+ setupId?: string;
114
+ result: LocalApplyResult;
115
+ }>;
116
+ retired: Array<{
117
+ setupId: string;
118
+ files: string[];
119
+ remoteAction: "left_active";
120
+ }>;
121
+ }>;
122
+ export declare function retireLocalSetupBindings(rootDirectory: string, plans: SetupPlan[]): Promise<Array<{
123
+ setupId: string;
124
+ files: string[];
125
+ remoteAction: "left_active";
126
+ }>>;
127
+ export declare function createLocalSetupEngine(options: LocalSetupEngineOptions): Promise<LocalSetupEngine>;