@caatinga/core 2.0.2 → 2.2.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.
package/dist/index.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as CaatingaArtifacts, a as ContractArtifact, b as CaatingaErrorCodeValue, c as CaatingaError } from './browser-djYObNl8.cjs';
2
- export { d as CaatingaArtifactsSchema, e as CaatingaErrorCode, t as toCaatingaError } from './browser-djYObNl8.cjs';
1
+ import { C as CaatingaArtifacts, a as ContractArtifact, b as CaatingaErrorCodeValue, c as CaatingaError } from './browser-Cq4ZofIq.cjs';
2
+ export { d as CaatingaArtifactsSchema, e as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './browser-Cq4ZofIq.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
- declare const CAATINGA_CORE_VERSION = "2.0.2";
5
+ declare const CAATINGA_CORE_VERSION = "2.2.0";
6
6
 
7
7
  declare const ContractConfigSchema: z.ZodObject<{
8
8
  path: z.ZodString;
@@ -144,6 +144,78 @@ declare function updateArtifact(artifacts: CaatingaArtifacts, networkName: strin
144
144
  dependencyGraph?: Record<string, string[]>;
145
145
  }): CaatingaArtifacts;
146
146
 
147
+ declare const BINDING_MARKER_FILENAME = ".caatinga-bindings.json";
148
+ declare const BindingMarkerSchema: z.ZodObject<{
149
+ version: z.ZodLiteral<1>;
150
+ contractId: z.ZodString;
151
+ wasmHash: z.ZodString;
152
+ network: z.ZodString;
153
+ generatedAt: z.ZodString;
154
+ }, "strip", z.ZodTypeAny, {
155
+ contractId: string;
156
+ wasmHash: string;
157
+ version: 1;
158
+ network: string;
159
+ generatedAt: string;
160
+ }, {
161
+ contractId: string;
162
+ wasmHash: string;
163
+ version: 1;
164
+ network: string;
165
+ generatedAt: string;
166
+ }>;
167
+ type BindingMarker = z.infer<typeof BindingMarkerSchema>;
168
+ declare function writeBindingMarker(outputDir: string, marker: BindingMarker): Promise<void>;
169
+ /** Returns null when the marker is absent or unreadable — freshness degrades, never throws. */
170
+ declare function readBindingMarker(outputDir: string): Promise<BindingMarker | null>;
171
+
172
+ type BindingFreshnessStatus = "fresh" | "stale" | "missing" | "unknown";
173
+ type BindingFreshness = {
174
+ contractName: string;
175
+ status: BindingFreshnessStatus;
176
+ outputDir: string;
177
+ marker: BindingMarker | null;
178
+ reason?: string;
179
+ };
180
+ type EvaluateBindingFreshnessOptions = {
181
+ config: CaatingaConfig;
182
+ artifacts: CaatingaArtifacts;
183
+ networkName: string;
184
+ contractName: string;
185
+ cwd?: string;
186
+ };
187
+ declare function evaluateBindingFreshness(options: EvaluateBindingFreshnessOptions): Promise<BindingFreshness>;
188
+ declare function evaluateBindingsFreshness(options: {
189
+ config: CaatingaConfig;
190
+ artifacts: CaatingaArtifacts;
191
+ networkName: string;
192
+ cwd?: string;
193
+ }): Promise<BindingFreshness[]>;
194
+
195
+ type ContractStatusEntry = {
196
+ name: string;
197
+ deployed: boolean;
198
+ contractId?: string;
199
+ wasmHash?: string;
200
+ deployedAt?: string;
201
+ dependencies: string[];
202
+ bindings: BindingFreshness;
203
+ };
204
+ type NetworkStatus = {
205
+ network: string;
206
+ contracts: ContractStatusEntry[];
207
+ };
208
+ type ProjectStatus = {
209
+ project: string;
210
+ networks: NetworkStatus[];
211
+ };
212
+ type CollectProjectStatusOptions = {
213
+ config: CaatingaConfig;
214
+ networkName?: string;
215
+ cwd?: string;
216
+ };
217
+ declare function collectProjectStatus(options: CollectProjectStatusOptions): Promise<ProjectStatus>;
218
+
147
219
  declare const WELL_KNOWN_NETWORKS: Record<string, NetworkConfig>;
148
220
 
149
221
  type ResolvedNetwork = {
@@ -327,9 +399,28 @@ declare function generateBindings(options: GenerateBindingsOptions): Promise<{
327
399
  outputDir: string;
328
400
  importPath: string;
329
401
  legacyStubRemoved: boolean;
402
+ marker: {
403
+ contractId: string;
404
+ wasmHash: string;
405
+ version: 1;
406
+ network: string;
407
+ generatedAt: string;
408
+ };
330
409
  output: string;
331
410
  }>;
332
411
 
412
+ type GenerateBindingsGraphResult = {
413
+ network: ResolvedNetwork;
414
+ results: Array<Awaited<ReturnType<typeof generateBindings>>>;
415
+ };
416
+ declare function generateBindingsGraph(options: {
417
+ config: CaatingaConfig;
418
+ contractName?: string;
419
+ contractNames?: string[];
420
+ networkName?: string;
421
+ cwd?: string;
422
+ }): Promise<GenerateBindingsGraphResult>;
423
+
333
424
  type InvokeTarget = {
334
425
  contractName: string;
335
426
  method: string;
@@ -468,4 +559,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
468
559
 
469
560
  declare function isTransientTestnetSmokeFailure(logText: string): boolean;
470
561
 
471
- export { type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type CreateInitialArtifactsOptions, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type EvaluateStellarCliCompatibilityInput, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, checkBinary, checkStellarCliVersion, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, evaluateStellarCliCompatibility, generateBindings, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, resolveContract, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, updateArtifact, validateSourceShape, writeArtifacts };
562
+ export { BINDING_MARKER_FILENAME, type BindingFreshness, type BindingFreshnessStatus, type BindingMarker, BindingMarkerSchema, type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type EvaluateBindingFreshnessOptions, type EvaluateStellarCliCompatibilityInput, type GenerateBindingsGraphResult, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type NetworkStatus, type ProjectStatus, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, checkBinary, checkStellarCliVersion, collectProjectStatus, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, evaluateBindingFreshness, evaluateBindingsFreshness, evaluateStellarCliCompatibility, generateBindings, generateBindingsGraph, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, readBindingMarker, resolveContract, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, updateArtifact, validateSourceShape, writeArtifacts, writeBindingMarker };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { C as CaatingaArtifacts, a as ContractArtifact, b as CaatingaErrorCodeValue, c as CaatingaError } from './browser-djYObNl8.js';
2
- export { d as CaatingaArtifactsSchema, e as CaatingaErrorCode, t as toCaatingaError } from './browser-djYObNl8.js';
1
+ import { C as CaatingaArtifacts, a as ContractArtifact, b as CaatingaErrorCodeValue, c as CaatingaError } from './browser-Cq4ZofIq.js';
2
+ export { d as CaatingaArtifactsSchema, e as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './browser-Cq4ZofIq.js';
3
3
  import { z } from 'zod';
4
4
 
5
- declare const CAATINGA_CORE_VERSION = "2.0.2";
5
+ declare const CAATINGA_CORE_VERSION = "2.2.0";
6
6
 
7
7
  declare const ContractConfigSchema: z.ZodObject<{
8
8
  path: z.ZodString;
@@ -144,6 +144,78 @@ declare function updateArtifact(artifacts: CaatingaArtifacts, networkName: strin
144
144
  dependencyGraph?: Record<string, string[]>;
145
145
  }): CaatingaArtifacts;
146
146
 
147
+ declare const BINDING_MARKER_FILENAME = ".caatinga-bindings.json";
148
+ declare const BindingMarkerSchema: z.ZodObject<{
149
+ version: z.ZodLiteral<1>;
150
+ contractId: z.ZodString;
151
+ wasmHash: z.ZodString;
152
+ network: z.ZodString;
153
+ generatedAt: z.ZodString;
154
+ }, "strip", z.ZodTypeAny, {
155
+ contractId: string;
156
+ wasmHash: string;
157
+ version: 1;
158
+ network: string;
159
+ generatedAt: string;
160
+ }, {
161
+ contractId: string;
162
+ wasmHash: string;
163
+ version: 1;
164
+ network: string;
165
+ generatedAt: string;
166
+ }>;
167
+ type BindingMarker = z.infer<typeof BindingMarkerSchema>;
168
+ declare function writeBindingMarker(outputDir: string, marker: BindingMarker): Promise<void>;
169
+ /** Returns null when the marker is absent or unreadable — freshness degrades, never throws. */
170
+ declare function readBindingMarker(outputDir: string): Promise<BindingMarker | null>;
171
+
172
+ type BindingFreshnessStatus = "fresh" | "stale" | "missing" | "unknown";
173
+ type BindingFreshness = {
174
+ contractName: string;
175
+ status: BindingFreshnessStatus;
176
+ outputDir: string;
177
+ marker: BindingMarker | null;
178
+ reason?: string;
179
+ };
180
+ type EvaluateBindingFreshnessOptions = {
181
+ config: CaatingaConfig;
182
+ artifacts: CaatingaArtifacts;
183
+ networkName: string;
184
+ contractName: string;
185
+ cwd?: string;
186
+ };
187
+ declare function evaluateBindingFreshness(options: EvaluateBindingFreshnessOptions): Promise<BindingFreshness>;
188
+ declare function evaluateBindingsFreshness(options: {
189
+ config: CaatingaConfig;
190
+ artifacts: CaatingaArtifacts;
191
+ networkName: string;
192
+ cwd?: string;
193
+ }): Promise<BindingFreshness[]>;
194
+
195
+ type ContractStatusEntry = {
196
+ name: string;
197
+ deployed: boolean;
198
+ contractId?: string;
199
+ wasmHash?: string;
200
+ deployedAt?: string;
201
+ dependencies: string[];
202
+ bindings: BindingFreshness;
203
+ };
204
+ type NetworkStatus = {
205
+ network: string;
206
+ contracts: ContractStatusEntry[];
207
+ };
208
+ type ProjectStatus = {
209
+ project: string;
210
+ networks: NetworkStatus[];
211
+ };
212
+ type CollectProjectStatusOptions = {
213
+ config: CaatingaConfig;
214
+ networkName?: string;
215
+ cwd?: string;
216
+ };
217
+ declare function collectProjectStatus(options: CollectProjectStatusOptions): Promise<ProjectStatus>;
218
+
147
219
  declare const WELL_KNOWN_NETWORKS: Record<string, NetworkConfig>;
148
220
 
149
221
  type ResolvedNetwork = {
@@ -327,9 +399,28 @@ declare function generateBindings(options: GenerateBindingsOptions): Promise<{
327
399
  outputDir: string;
328
400
  importPath: string;
329
401
  legacyStubRemoved: boolean;
402
+ marker: {
403
+ contractId: string;
404
+ wasmHash: string;
405
+ version: 1;
406
+ network: string;
407
+ generatedAt: string;
408
+ };
330
409
  output: string;
331
410
  }>;
332
411
 
412
+ type GenerateBindingsGraphResult = {
413
+ network: ResolvedNetwork;
414
+ results: Array<Awaited<ReturnType<typeof generateBindings>>>;
415
+ };
416
+ declare function generateBindingsGraph(options: {
417
+ config: CaatingaConfig;
418
+ contractName?: string;
419
+ contractNames?: string[];
420
+ networkName?: string;
421
+ cwd?: string;
422
+ }): Promise<GenerateBindingsGraphResult>;
423
+
333
424
  type InvokeTarget = {
334
425
  contractName: string;
335
426
  method: string;
@@ -468,4 +559,4 @@ type TemplateManifest = z.infer<typeof TemplateManifestSchema>;
468
559
 
469
560
  declare function isTransientTestnetSmokeFailure(logText: string): boolean;
470
561
 
471
- export { type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type CreateInitialArtifactsOptions, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type EvaluateStellarCliCompatibilityInput, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, checkBinary, checkStellarCliVersion, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, evaluateStellarCliCompatibility, generateBindings, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, resolveContract, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, updateArtifact, validateSourceShape, writeArtifacts };
562
+ export { BINDING_MARKER_FILENAME, type BindingFreshness, type BindingFreshnessStatus, type BindingMarker, BindingMarkerSchema, type BuildContractOptions, CAATINGA_CORE_VERSION, CaatingaArtifacts, type CaatingaConfig, CaatingaConfigSchema, CaatingaError, type CheckStellarCliVersionOptions, type CollectProjectStatusOptions, type CompatibilityReport, type CompatibilityStatus, type CompatibilityWarning, type CompatibilityWarningCode, ContractArtifact, type ContractConfig, type ContractStatusEntry, type CreateInitialArtifactsOptions, type CreateProjectFromTemplateOptions, type DeployArgValue, type DeployContractGraphResult, type DeployContractOptions, type EvaluateBindingFreshnessOptions, type EvaluateStellarCliCompatibilityInput, type GenerateBindingsGraphResult, type GenerateBindingsOptions, type InvokeContractOptions, type InvokeTarget, type LoadConfigOptions, type NetworkConfig, type NetworkStatus, type ProjectStatus, type ResolvedContract, type ResolvedNetwork, type RunCommandResult, STELLAR_CLI_LAST_TESTED_VERSION, STELLAR_CLI_MIN_VERSION, type SkippedContract, type TemplateManifest, TemplateManifestSchema, WELL_KNOWN_NETWORKS, buildContract, buildDependencyGraph, checkBinary, checkStellarCliVersion, collectProjectStatus, createInitialArtifacts, createProjectFromTemplate, defineConfig, deployContract, deployContractGraph, evaluateBindingFreshness, evaluateBindingsFreshness, evaluateStellarCliCompatibility, generateBindings, generateBindingsGraph, invokeContract, isTransientTestnetSmokeFailure, loadConfig, parseContractId, parseInvokeTarget, parseStellarCliVersion, readArtifacts, readBindingMarker, resolveContract, resolveDeployArgs, resolveDeployOrder, resolveNetwork, runCommand, updateArtifact, validateSourceShape, writeArtifacts, writeBindingMarker };