archal 0.9.13 → 0.9.15

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 (53) hide show
  1. package/README.md +81 -73
  2. package/bin/archal.cjs +1 -1
  3. package/clone-assets/apify/tools.json +668 -0
  4. package/{twin-assets → clone-assets}/discord/fidelity.json +1 -1
  5. package/{twin-assets → clone-assets}/discord/tools.json +510 -510
  6. package/clone-assets/github/fidelity.json +31 -0
  7. package/{twin-assets → clone-assets}/github/tools.json +113 -3
  8. package/{twin-assets → clone-assets}/google-workspace/fidelity.json +2 -2
  9. package/{twin-assets → clone-assets}/google-workspace/tools.json +10 -10
  10. package/{twin-assets → clone-assets}/jira/fidelity.json +44 -4
  11. package/{twin-assets → clone-assets}/jira/tools.json +1 -1
  12. package/clone-assets/linear/fidelity.json +36 -0
  13. package/{twin-assets → clone-assets}/linear/tools.json +1 -1
  14. package/{twin-assets → clone-assets}/ramp/fidelity.json +1 -1
  15. package/{twin-assets → clone-assets}/ramp/tools.json +1 -1
  16. package/clone-assets/slack/fidelity.json +38 -0
  17. package/{twin-assets → clone-assets}/slack/tools.json +1 -1
  18. package/clone-assets/stripe/fidelity.json +67 -0
  19. package/{twin-assets → clone-assets}/stripe/tools.json +42 -11
  20. package/clone-assets/supabase/fidelity.json +31 -0
  21. package/{twin-assets → clone-assets}/supabase/tools.json +1 -1
  22. package/clone-assets/tavily/tools.json +115 -0
  23. package/dist/cli.cjs +97917 -0
  24. package/dist/cli.d.cts +1 -0
  25. package/dist/harness.cjs +62 -0
  26. package/dist/harness.d.cts +20 -0
  27. package/dist/index.cjs +5 -87878
  28. package/dist/index.d.cts +3 -1
  29. package/dist/seed/dynamic-generator.cjs +8796 -9201
  30. package/dist/seed/dynamic-generator.d.cts +39 -0
  31. package/dist/vitest/chunk-2GY4SFKE.js +29279 -0
  32. package/dist/vitest/{chunk-KTMNDJFB.js → chunk-WVRVNHAX.js} +45255 -44440
  33. package/dist/vitest/index.cjs +56408 -31519
  34. package/dist/vitest/index.d.ts +61 -27
  35. package/dist/vitest/index.js +145 -1807
  36. package/dist/vitest/runtime/hosted-session-reaper.cjs +34766 -28922
  37. package/dist/vitest/runtime/hosted-session-reaper.js +1 -2
  38. package/dist/vitest/runtime/setup-files.js +2 -3
  39. package/package.json +19 -10
  40. package/skills/eval/SKILL.md +113 -0
  41. package/skills/onboard/SKILL.md +67 -36
  42. package/skills/scenario/SKILL.md +22 -20
  43. package/skills/vitest/SKILL.md +25 -24
  44. package/dist/vitest/chunk-L6HSMJ3F.js +0 -2216
  45. package/dist/vitest/chunk-YJICENME.js +0 -1230
  46. package/dist/vitest/src-JGHX6UKK.js +0 -94
  47. package/skills/audit/SKILL.md +0 -55
  48. package/skills/test/SKILL.md +0 -109
  49. package/twin-assets/github/fidelity.json +0 -13
  50. package/twin-assets/linear/fidelity.json +0 -18
  51. package/twin-assets/slack/fidelity.json +0 -20
  52. package/twin-assets/stripe/fidelity.json +0 -22
  53. package/twin-assets/supabase/fidelity.json +0 -13
package/dist/cli.d.cts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/harness.ts
21
+ var harness_exports = {};
22
+ __export(harness_exports, {
23
+ reportAgentMetrics: () => reportAgentMetrics
24
+ });
25
+ module.exports = __toCommonJS(harness_exports);
26
+ var import_promises = require("fs/promises");
27
+ var import_node_path = require("path");
28
+ async function reportAgentMetrics(metrics, options = {}) {
29
+ assertNonNegativeInteger("inputTokens", metrics.inputTokens);
30
+ assertNonNegativeInteger("outputTokens", metrics.outputTokens);
31
+ assertNonNegativeInteger("llmCallCount", metrics.llmCallCount);
32
+ const metricsFile = options.metricsFile ?? process.env["AGENT_METRICS_FILE"] ?? process.env["ARCHAL_METRICS_FILE"];
33
+ if (!metricsFile) {
34
+ return false;
35
+ }
36
+ await (0, import_promises.mkdir)((0, import_node_path.dirname)(metricsFile), { recursive: true });
37
+ await (0, import_promises.writeFile)(
38
+ metricsFile,
39
+ JSON.stringify({
40
+ version: 1,
41
+ inputTokens: metrics.inputTokens,
42
+ outputTokens: metrics.outputTokens,
43
+ llmCallCount: metrics.llmCallCount,
44
+ ...nonEmptyString(metrics.provider) ? { provider: metrics.provider.trim() } : {},
45
+ ...nonEmptyString(metrics.model) ? { model: metrics.model.trim() } : {}
46
+ }),
47
+ "utf8"
48
+ );
49
+ return true;
50
+ }
51
+ function nonEmptyString(value) {
52
+ return typeof value === "string" && value.trim().length > 0;
53
+ }
54
+ function assertNonNegativeInteger(name, value) {
55
+ if (!Number.isSafeInteger(value) || value < 0) {
56
+ throw new TypeError(`${name} must be a non-negative safe integer`);
57
+ }
58
+ }
59
+ // Annotate the CommonJS export names for ESM import in node:
60
+ 0 && (module.exports = {
61
+ reportAgentMetrics
62
+ });
@@ -0,0 +1,20 @@
1
+ interface AgentMetrics {
2
+ inputTokens: number;
3
+ outputTokens: number;
4
+ llmCallCount: number;
5
+ provider?: string;
6
+ model?: string;
7
+ }
8
+ interface ReportAgentMetricsOptions {
9
+ metricsFile?: string;
10
+ }
11
+ /**
12
+ * Write agent-side token usage for `archal run`.
13
+ *
14
+ * Archal sets AGENT_METRICS_FILE when it launches a harness. Calling this
15
+ * helper before the harness exits lets the dashboard show agent input/output
16
+ * token counts without exposing the artifact wire format to user code.
17
+ */
18
+ declare function reportAgentMetrics(metrics: AgentMetrics, options?: ReportAgentMetricsOptions): Promise<boolean>;
19
+
20
+ export { type AgentMetrics, type ReportAgentMetricsOptions, reportAgentMetrics };