@enactprotocol/shared 1.0.12 → 1.0.14

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.
@@ -15,7 +15,7 @@ export class EnactCore {
15
15
  this.options = {
16
16
  apiUrl: "https://enact.tools",
17
17
  supabaseUrl: "https://xjnhhxwxovjifdxdwzih.supabase.co",
18
- executionProvider: "direct",
18
+ executionProvider: "dagger",
19
19
  defaultTimeout: "30s",
20
20
  verificationPolicy: "permissive",
21
21
  ...options,
@@ -584,11 +584,11 @@ export class EnactCore {
584
584
  */
585
585
  createExecutionProvider() {
586
586
  switch (this.options.executionProvider) {
587
- case "dagger":
588
- return new DaggerExecutionProvider(this.options.daggerOptions);
589
587
  case "direct":
590
- default:
591
588
  return new DirectExecutionProvider();
589
+ case "dagger":
590
+ default:
591
+ return new DaggerExecutionProvider(this.options.daggerOptions);
592
592
  }
593
593
  }
594
594
  /**
@@ -1,11 +1,32 @@
1
1
  // src/utils/version.ts
2
2
  import pc from "picocolors";
3
+ import { readFileSync } from "fs";
4
+ import { join, dirname } from "path";
5
+ import { fileURLToPath } from "url";
3
6
  /**
4
7
  * Displays the CLI version with nice formatting
5
8
  */
6
9
  export function showVersion() {
7
- // Bun automatically sets npm_package_version when running scripts via package.json
8
- const version = process.env.npm_package_version || "0.0.1-dev";
10
+ let version = "0.0.1-dev";
11
+ try {
12
+ // Try to get version from environment first (for npm scripts)
13
+ if (process.env.npm_package_version) {
14
+ version = process.env.npm_package_version;
15
+ }
16
+ else {
17
+ // When running as installed binary, read from package.json
18
+ // Go up from shared/dist/utils/version.js to find package.json
19
+ const currentFile = typeof __filename !== 'undefined' ? __filename : fileURLToPath(import.meta.url);
20
+ const sharedDir = dirname(dirname(dirname(currentFile)));
21
+ const packageJsonPath = join(sharedDir, 'package.json');
22
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
23
+ version = packageJson.version;
24
+ }
25
+ }
26
+ catch (error) {
27
+ // Fall back to default version if anything fails
28
+ version = "1.0.14";
29
+ }
9
30
  const versionText = `v${version}`;
10
31
  console.error(`
11
32
  ${pc.bold("Enact CLI")} ${pc.cyan(versionText)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enactprotocol/shared",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Shared utilities and core functionality for Enact Protocol",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -75,7 +75,7 @@ export class EnactCore {
75
75
  this.options = {
76
76
  apiUrl: "https://enact.tools",
77
77
  supabaseUrl: "https://xjnhhxwxovjifdxdwzih.supabase.co",
78
- executionProvider: "direct",
78
+ executionProvider: "dagger",
79
79
  defaultTimeout: "30s",
80
80
  verificationPolicy: "permissive",
81
81
  ...options,
@@ -805,11 +805,11 @@ export class EnactCore {
805
805
  | DirectExecutionProvider
806
806
  | DaggerExecutionProvider {
807
807
  switch (this.options.executionProvider) {
808
- case "dagger":
809
- return new DaggerExecutionProvider(this.options.daggerOptions);
810
808
  case "direct":
811
- default:
812
809
  return new DirectExecutionProvider();
810
+ case "dagger":
811
+ default:
812
+ return new DaggerExecutionProvider(this.options.daggerOptions);
813
813
  }
814
814
  }
815
815
 
@@ -1,12 +1,33 @@
1
1
  // src/utils/version.ts
2
2
  import pc from "picocolors";
3
+ import { readFileSync } from "fs";
4
+ import { join, dirname } from "path";
5
+ import { fileURLToPath } from "url";
3
6
 
4
7
  /**
5
8
  * Displays the CLI version with nice formatting
6
9
  */
7
10
  export function showVersion(): void {
8
- // Bun automatically sets npm_package_version when running scripts via package.json
9
- const version = process.env.npm_package_version || "0.0.1-dev";
11
+ let version = "0.0.1-dev";
12
+
13
+ try {
14
+ // Try to get version from environment first (for npm scripts)
15
+ if (process.env.npm_package_version) {
16
+ version = process.env.npm_package_version;
17
+ } else {
18
+ // When running as installed binary, read from package.json
19
+ // Go up from shared/dist/utils/version.js to find package.json
20
+ const currentFile = typeof __filename !== 'undefined' ? __filename : fileURLToPath(import.meta.url);
21
+ const sharedDir = dirname(dirname(dirname(currentFile)));
22
+ const packageJsonPath = join(sharedDir, 'package.json');
23
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'));
24
+ version = packageJson.version;
25
+ }
26
+ } catch (error) {
27
+ // Fall back to default version if anything fails
28
+ version = "1.0.14";
29
+ }
30
+
10
31
  const versionText = `v${version}`;
11
32
 
12
33
  console.error(`