archal 0.9.7 → 0.9.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 (39) hide show
  1. package/README.md +163 -93
  2. package/bin/archal.cjs +3 -3
  3. package/dist/index.cjs +82301 -0
  4. package/dist/index.d.cts +1 -0
  5. package/dist/seed/dynamic-generator.cjs +45640 -0
  6. package/dist/seed/dynamic-generator.d.cts +67 -0
  7. package/dist/vitest/chunk-RKYS44AS.js +2216 -0
  8. package/dist/vitest/chunk-YJICENME.js +1230 -0
  9. package/dist/vitest/chunk-YV6BH6DO.js +45974 -0
  10. package/dist/vitest/index.cjs +51963 -0
  11. package/dist/vitest/index.d.ts +398 -0
  12. package/dist/vitest/index.js +2669 -0
  13. package/dist/vitest/runtime/hosted-session-reaper.cjs +29349 -0
  14. package/dist/vitest/runtime/hosted-session-reaper.d.ts +2 -0
  15. package/dist/vitest/runtime/hosted-session-reaper.js +58 -0
  16. package/dist/vitest/runtime/setup-files.d.ts +2 -0
  17. package/dist/vitest/runtime/setup-files.js +27 -0
  18. package/dist/vitest/src-JGHX6UKK.js +94 -0
  19. package/package.json +19 -22
  20. package/twin-assets/discord/fidelity.json +113 -0
  21. package/twin-assets/discord/tools.json +1953 -0
  22. package/twin-assets/github/fidelity.json +13 -0
  23. package/twin-assets/github/tools.json +21818 -0
  24. package/twin-assets/google-workspace/fidelity.json +19 -0
  25. package/twin-assets/google-workspace/tools.json +10191 -0
  26. package/twin-assets/jira/fidelity.json +40 -0
  27. package/twin-assets/jira/tools.json +17387 -0
  28. package/twin-assets/linear/fidelity.json +18 -0
  29. package/twin-assets/linear/tools.json +6496 -0
  30. package/twin-assets/ramp/fidelity.json +22 -0
  31. package/twin-assets/ramp/tools.json +2610 -0
  32. package/twin-assets/slack/fidelity.json +20 -0
  33. package/twin-assets/slack/tools.json +7301 -0
  34. package/twin-assets/stripe/fidelity.json +22 -0
  35. package/twin-assets/stripe/tools.json +15284 -0
  36. package/twin-assets/supabase/fidelity.json +13 -0
  37. package/twin-assets/supabase/tools.json +2973 -0
  38. package/dist/vitest.d.ts +0 -1
  39. package/dist/vitest.js +0 -23
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,58 @@
1
+ import {
2
+ DEFAULT_RENEW_INTERVAL_MS,
3
+ MIN_RENEW_INTERVAL_MS,
4
+ createHostedAuthLease,
5
+ parsePositiveInteger,
6
+ runHostedSessionReaper
7
+ } from "../chunk-YV6BH6DO.js";
8
+ import "../chunk-YJICENME.js";
9
+
10
+ // src/runtime/hosted-session-reaper.ts
11
+ var VITEST_AUTH_LEASE_OPTIONS = {
12
+ apiUrlEnvVar: "ARCHAL_VITEST_API_URL"
13
+ };
14
+ function requireEnv(name) {
15
+ const value = process.env[name]?.trim();
16
+ if (!value) {
17
+ throw new Error(`Missing ${name} for hosted-session reaper.`);
18
+ }
19
+ return value;
20
+ }
21
+ function parsePid(value, name) {
22
+ const parsed = Number.parseInt(value, 10);
23
+ if (!Number.isInteger(parsed) || parsed <= 0) {
24
+ throw new Error(`Invalid ${name} for hosted-session reaper.`);
25
+ }
26
+ return parsed;
27
+ }
28
+ async function main() {
29
+ const auth = await createHostedAuthLease(VITEST_AUTH_LEASE_OPTIONS);
30
+ try {
31
+ await runHostedSessionReaper({
32
+ apiBaseUrl: requireEnv("ARCHAL_VITEST_REAPER_API_BASE_URL"),
33
+ auth,
34
+ sessionId: requireEnv("ARCHAL_VITEST_REAPER_SESSION_ID"),
35
+ runnerPid: parsePid(
36
+ requireEnv("ARCHAL_VITEST_REAPER_RUNNER_PID"),
37
+ "ARCHAL_VITEST_REAPER_RUNNER_PID"
38
+ ),
39
+ renewIntervalMs: Math.max(
40
+ MIN_RENEW_INTERVAL_MS,
41
+ parsePositiveInteger(
42
+ process.env["ARCHAL_VITEST_REAPER_RENEW_INTERVAL_MS"],
43
+ DEFAULT_RENEW_INTERVAL_MS,
44
+ 1
45
+ )
46
+ ),
47
+ coordinatorDirectory: requireEnv("ARCHAL_VITEST_REAPER_COORDINATOR_DIR"),
48
+ lockDirectory: requireEnv("ARCHAL_VITEST_REAPER_LOCK_DIR"),
49
+ statePath: requireEnv("ARCHAL_VITEST_REAPER_STATE_PATH"),
50
+ pidPath: requireEnv("ARCHAL_VITEST_REAPER_PID_PATH")
51
+ });
52
+ } finally {
53
+ auth.stop();
54
+ }
55
+ }
56
+ void main().catch(() => {
57
+ process.exitCode = 1;
58
+ });
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,27 @@
1
+ import {
2
+ bootstrapArchalVitestRouting
3
+ } from "../chunk-RKYS44AS.js";
4
+ import "../chunk-YV6BH6DO.js";
5
+ import "../chunk-YJICENME.js";
6
+
7
+ // src/runtime/setup-files.ts
8
+ import { existsSync, rmSync } from "fs";
9
+ var markerPath = process.env["ARCHAL_VITEST_WIRING_MARKER"];
10
+ if (markerPath && existsSync(markerPath)) {
11
+ try {
12
+ rmSync(markerPath);
13
+ } catch {
14
+ }
15
+ }
16
+ function toBootstrapError(err) {
17
+ const message = err instanceof Error ? err.message : String(err);
18
+ if (err instanceof Error) {
19
+ return new Error(`Archal vitest bootstrap failed: ${message}`, { cause: err });
20
+ }
21
+ return new Error(`Archal vitest bootstrap failed: ${message}`);
22
+ }
23
+ try {
24
+ await bootstrapArchalVitestRouting();
25
+ } catch (err) {
26
+ throw toBootstrapError(err);
27
+ }
@@ -0,0 +1,94 @@
1
+ import {
2
+ AUTH_RETRY_OPTIONS,
3
+ AUTH_TOKEN_ENV_VAR,
4
+ CLI_LOOPBACK_CALLBACK_HOST,
5
+ CREDENTIALS_FILE,
6
+ CREDENTIALS_KEY_FILE,
7
+ CREDENTIALS_MASTER_KEY_ENV_VAR,
8
+ ENV_TOKEN_FALLBACK_TTL_SECONDS,
9
+ ExpiredEnvTokenError,
10
+ HOSTED_DEFAULT_API_BASE_URL,
11
+ HOSTED_DEFAULT_AUTH_BASE_URL,
12
+ HOSTED_DEFAULT_RUNTIME_BASE_URL,
13
+ KEYCHAIN_ACCOUNT,
14
+ KEYCHAIN_SERVICE,
15
+ REQUEST_TIMEOUT_MS,
16
+ STRICT_ENDPOINTS_ENV_VAR,
17
+ TOKEN_ENCRYPTION_PREFIX,
18
+ buildAuthRequestHeaders,
19
+ buildLoopbackCallbackUrl,
20
+ decodeJwtPayload,
21
+ deleteCredentials,
22
+ errorMessage,
23
+ exchangeCliAuthCode,
24
+ getArchalDir,
25
+ getConfiguredApiBaseUrl,
26
+ getConfiguredAuthBaseUrl,
27
+ getConfiguredRuntimeBaseUrl,
28
+ getCredentials,
29
+ getJwtExpiry,
30
+ getRealHomeStoredCredentials,
31
+ getStoredCredentials,
32
+ isEntitled,
33
+ isLoopbackHostname,
34
+ isLoopbackHttpUrl,
35
+ isLoopbackRedirectUri,
36
+ isPlan,
37
+ pollCliDeviceAuth,
38
+ refreshAuthFromServer,
39
+ refreshAuthFromServerWithValidation,
40
+ refreshCliSession,
41
+ resolveWhoamiAuthState,
42
+ revokeCliSession,
43
+ saveCredentials,
44
+ saveRealHomeCredentials,
45
+ startCliDeviceAuth,
46
+ validateTokenWithServer
47
+ } from "./chunk-YJICENME.js";
48
+ export {
49
+ AUTH_RETRY_OPTIONS,
50
+ AUTH_TOKEN_ENV_VAR,
51
+ CLI_LOOPBACK_CALLBACK_HOST,
52
+ CREDENTIALS_FILE,
53
+ CREDENTIALS_KEY_FILE,
54
+ CREDENTIALS_MASTER_KEY_ENV_VAR,
55
+ ENV_TOKEN_FALLBACK_TTL_SECONDS,
56
+ ExpiredEnvTokenError,
57
+ HOSTED_DEFAULT_API_BASE_URL,
58
+ HOSTED_DEFAULT_AUTH_BASE_URL,
59
+ HOSTED_DEFAULT_RUNTIME_BASE_URL,
60
+ KEYCHAIN_ACCOUNT,
61
+ KEYCHAIN_SERVICE,
62
+ REQUEST_TIMEOUT_MS,
63
+ STRICT_ENDPOINTS_ENV_VAR,
64
+ TOKEN_ENCRYPTION_PREFIX,
65
+ buildAuthRequestHeaders,
66
+ buildLoopbackCallbackUrl,
67
+ decodeJwtPayload,
68
+ deleteCredentials,
69
+ errorMessage,
70
+ exchangeCliAuthCode,
71
+ getArchalDir,
72
+ getConfiguredApiBaseUrl,
73
+ getConfiguredAuthBaseUrl,
74
+ getConfiguredRuntimeBaseUrl,
75
+ getCredentials,
76
+ getJwtExpiry,
77
+ getRealHomeStoredCredentials,
78
+ getStoredCredentials,
79
+ isEntitled,
80
+ isLoopbackHostname,
81
+ isLoopbackHttpUrl,
82
+ isLoopbackRedirectUri,
83
+ isPlan,
84
+ pollCliDeviceAuth,
85
+ refreshAuthFromServer,
86
+ refreshAuthFromServerWithValidation,
87
+ refreshCliSession,
88
+ resolveWhoamiAuthState,
89
+ revokeCliSession,
90
+ saveCredentials,
91
+ saveRealHomeCredentials,
92
+ startCliDeviceAuth,
93
+ validateTokenWithServer
94
+ };
package/package.json CHANGED
@@ -1,18 +1,25 @@
1
1
  {
2
2
  "name": "archal",
3
- "version": "0.9.7",
4
- "description": "Pre-deployment testing for AI agents",
3
+ "version": "0.9.9",
4
+ "description": "Test your agents & integrations against digital twins",
5
5
  "type": "module",
6
+ "main": "dist/index.cjs",
7
+ "types": "dist/index.d.cts",
6
8
  "bin": {
7
9
  "archal": "bin/archal.cjs"
8
10
  },
9
11
  "exports": {
12
+ ".": {
13
+ "types": "./dist/index.d.cts",
14
+ "default": "./dist/index.cjs"
15
+ },
10
16
  "./vitest": {
11
- "types": "./dist/vitest.d.ts",
12
- "import": "./dist/vitest.js"
17
+ "types": "./dist/vitest/index.d.ts",
18
+ "import": "./dist/vitest/index.js",
19
+ "require": "./dist/vitest/index.cjs"
13
20
  }
14
21
  },
15
- "license": "MIT",
22
+ "license": "SEE LICENSE IN LICENSE",
16
23
  "repository": {
17
24
  "type": "git",
18
25
  "url": "git+https://github.com/Archal-Labs/archal.git"
@@ -33,26 +40,16 @@
33
40
  },
34
41
  "files": [
35
42
  "bin",
36
- "dist"
43
+ "dist",
44
+ "twin-assets",
45
+ "LICENSE"
37
46
  ],
38
47
  "dependencies": {
39
- "@archal/cli": "^0.9.7",
40
- "@archal/vitest": "^0.1.2"
41
- },
42
- "peerDependencies": {
43
- "vitest": ">=2.0.0"
44
- },
45
- "peerDependenciesMeta": {
46
- "vitest": {
47
- "optional": true
48
- }
49
- },
50
- "devDependencies": {
51
- "tsup": "^8.5.0",
52
- "typescript": "^5.9.0"
48
+ "vitest": "^2.1.0"
53
49
  },
54
50
  "scripts": {
55
- "build": "tsup",
56
- "typecheck": "tsc --noEmit"
51
+ "verify:artifacts": "node scripts/assert-artifacts.mjs",
52
+ "typecheck:raw": "node --check bin/archal.cjs && node --check scripts/assert-artifacts.mjs && node --check scripts/prepare.cjs",
53
+ "typecheck": "pnpm run typecheck:raw"
57
54
  }
58
55
  }
@@ -0,0 +1,113 @@
1
+ {
2
+ "twin": "discord",
3
+ "api": "discord-rest-api",
4
+ "version": "0.1.0",
5
+ "capabilities": [
6
+ {
7
+ "name": "get current bot user",
8
+ "supported": true
9
+ },
10
+ {
11
+ "name": "get current application metadata",
12
+ "supported": true
13
+ },
14
+ {
15
+ "name": "get guild metadata",
16
+ "supported": true
17
+ },
18
+ {
19
+ "name": "list, create, edit, and delete guild roles",
20
+ "supported": true
21
+ },
22
+ {
23
+ "name": "get and list guild members",
24
+ "supported": true
25
+ },
26
+ {
27
+ "name": "assign and remove guild member roles",
28
+ "supported": true
29
+ },
30
+ {
31
+ "name": "list, create, edit, and delete guild text channels",
32
+ "supported": true
33
+ },
34
+ {
35
+ "name": "list, create, get, and delete channel invites",
36
+ "supported": true
37
+ },
38
+ {
39
+ "name": "get channel metadata",
40
+ "supported": true
41
+ },
42
+ {
43
+ "name": "get channel messages (limit/before/after/around)",
44
+ "supported": true
45
+ },
46
+ {
47
+ "name": "get one channel message",
48
+ "supported": true
49
+ },
50
+ {
51
+ "name": "create and edit rich messages with embeds and replies",
52
+ "supported": true
53
+ },
54
+ {
55
+ "name": "delete single messages and bulk delete message batches",
56
+ "supported": true
57
+ },
58
+ {
59
+ "name": "list, create, get, edit, execute, and delete channel webhooks",
60
+ "supported": true
61
+ },
62
+ {
63
+ "name": "get, edit, and delete webhook-authored messages",
64
+ "supported": true
65
+ },
66
+ {
67
+ "name": "add, list, and remove own reactions",
68
+ "supported": true
69
+ },
70
+ {
71
+ "name": "pin, list pinned, and unpin messages",
72
+ "supported": true
73
+ },
74
+ {
75
+ "name": "start public threads from messages",
76
+ "supported": true
77
+ },
78
+ {
79
+ "name": "start standalone public and private threads",
80
+ "supported": true
81
+ },
82
+ {
83
+ "name": "list active, archived public, archived private, and joined archived private threads",
84
+ "supported": true
85
+ },
86
+ {
87
+ "name": "get and list thread members",
88
+ "supported": true
89
+ },
90
+ {
91
+ "name": "add, join, remove, leave, and delete threads",
92
+ "supported": true
93
+ },
94
+ {
95
+ "name": "list guild application commands for the current app",
96
+ "supported": true
97
+ },
98
+ {
99
+ "name": "get, create, edit, and delete guild application commands for the current app",
100
+ "supported": true
101
+ },
102
+ {
103
+ "name": "bulk overwrite guild application commands for the current app",
104
+ "supported": true
105
+ }
106
+ ],
107
+ "thresholds": {
108
+ "minReplaySteps": 64,
109
+ "minScenarioWindows": 40,
110
+ "scenarioWindowSize": 24,
111
+ "maxValueDifferences": 0
112
+ }
113
+ }