archal 0.9.20 → 0.10.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/README.md +59 -159
- package/agents/openclaw/Dockerfile +2 -1
- package/agents/openclaw/README.md +10 -17
- package/agents/openclaw/drive.mjs +21 -31
- package/agents/openclaw/extract-openclaw-response-text.mjs +49 -0
- package/agents/openclaw/scenarios/acceptance/github-escalation-and-cleanup.md +43 -0
- package/agents/openclaw/scenarios/acceptance/jira-linear-release-triage.md +39 -0
- package/agents/openclaw/scenarios/acceptance/multi-clone-customer-risk-review.md +45 -0
- package/agents/openclaw/scenarios/acceptance/slack-incident-handoff.md +42 -0
- package/agents/openclaw/scenarios/acceptance/stripe-dunning-remediation.md +40 -0
- package/agents/openclaw/scenarios/close-stale-issues.md +35 -0
- package/agents/openclaw/workspace/TOOLS.md +19 -0
- package/clone-assets/calcom/tools.json +1705 -153
- package/clone-assets/clickup/tools.json +2528 -541
- package/clone-assets/customerio/tools.json +2108 -144
- package/clone-assets/github/tools.json +1 -2
- package/clone-assets/gitlab/tools.json +10087 -398
- package/clone-assets/hubspot/tools.json +198 -0
- package/clone-assets/linear/tools.json +41 -1
- package/clone-assets/sentry/tools.json +2264 -188
- package/clone-assets/stripe/tools.json +114 -0
- package/clone-assets/webflow/tools.json +1895 -125
- package/dist/{autoloop-worker-types-BEb_E44z.d.cts → autoloop-worker-types-CHaclqtD.d.cts} +23 -59
- package/dist/cli.cjs +107175 -126959
- package/dist/commands/{autoloop-hosted-worker.cjs → autoloop-hosted-control-plane-client.cjs} +25657 -42736
- package/dist/commands/{autoloop-hosted-worker.d.cts → autoloop-hosted-control-plane-client.d.cts} +32 -42
- package/dist/commands/autoloop-pr-verification.cjs +607 -522
- package/dist/commands/autoloop-pr-verification.d.cts +3 -1
- package/dist/commands/autoloop-result-parser.cjs +2474 -2373
- package/dist/commands/autoloop-result-parser.d.cts +159 -2
- package/dist/commands/autoloop-worker.cjs +14565 -12240
- package/dist/commands/autoloop-worker.d.cts +10 -5
- package/dist/eval-shim.mjs +216 -0
- package/dist/index.cjs +15 -2
- package/dist/index.d.cts +3 -1
- package/dist/layer-1-ziaLpfLr.d.cts +62 -0
- package/dist/metafile-cjs.json +1 -0
- package/dist/reporter-entry.js +3 -0
- package/dist/{replay.cjs → sdk/index.cjs} +42979 -40973
- package/dist/sdk/index.d.cts +626 -0
- package/dist/vitest/{chunk-6CBYFCFK.js → chunk-2PDHTPZC.js} +289 -89
- package/dist/vitest/{chunk-ARVS45PP.js → chunk-7L4BBB6M.js} +123 -274
- package/dist/vitest/index.cjs +500 -816
- package/dist/vitest/index.d.ts +16 -81
- package/dist/vitest/index.js +40 -409
- package/dist/vitest/runtime/hosted-session-reaper.cjs +143 -293
- package/dist/vitest/runtime/hosted-session-reaper.js +1 -1
- package/dist/vitest/runtime/setup-files.js +2 -2
- package/manifest.json +9 -0
- package/package.json +14 -13
- package/skills/archal-agent/SKILL.md +0 -1
- package/skills/autoloop/SKILL.md +288 -273
- package/skills/autoloop/references/hosted-sources.md +49 -17
- package/skills/autoloop/references/trace-schema-mapping.md +83 -52
- package/skills/eval/SKILL.md +16 -48
- package/skills/free-account/SKILL.md +103 -0
- package/skills/install-agent/SKILL.md +16 -35
- package/skills/onboard/SKILL.md +13 -70
- package/skills/scenario/SKILL.md +30 -27
- package/skills/seed/SKILL.md +7 -6
- package/skills/vitest/SKILL.md +3 -2
- package/agents/github-octokit/.archal.json +0 -8
- package/agents/github-octokit/Dockerfile +0 -8
- package/agents/github-octokit/README.md +0 -113
- package/agents/github-octokit/agent.mjs +0 -54
- package/agents/github-octokit/package.json +0 -9
- package/agents/github-octokit/scenarios/test-repo-access.md +0 -27
- package/agents/google-workspace-local-tools/Dockerfile +0 -6
- package/agents/google-workspace-local-tools/README.md +0 -58
- package/agents/google-workspace-local-tools/agent.mjs +0 -196
- package/agents/google-workspace-local-tools/archal-harness.json +0 -7
- package/agents/google-workspace-local-tools/run-input.yaml +0 -16
- package/agents/google-workspace-local-tools/scenario.md +0 -29
- package/agents/hermes/.archal.json +0 -8
- package/agents/hermes/Dockerfile +0 -46
- package/agents/hermes/README.md +0 -87
- package/agents/hermes/SOUL.md +0 -27
- package/agents/hermes/config.yaml +0 -34
- package/agents/hermes/drive.mjs +0 -113
- package/agents/hermes/scenarios/stripe-customers-read-only.md +0 -32
- package/agents/pagination-test/README.md +0 -24
- package/agents/pagination-test/scenario.md +0 -24
- package/agents/replay-capsule-harness/README.md +0 -29
- package/agents/replay-capsule-harness/observability-install-offline-e2e.mts +0 -1517
- package/agents/replay-capsule-harness/replay-capsule-e2e.mjs +0 -104
- package/dist/harness.cjs +0 -63
- package/dist/harness.d.cts +0 -20
- package/dist/replay.d.cts +0 -4625
- package/dist/scenarios.cjs +0 -80343
- package/dist/scenarios.d.cts +0 -562
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { randomBytes } from 'node:crypto';
|
|
3
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
4
|
-
import { dirname, resolve } from 'node:path';
|
|
5
|
-
|
|
6
|
-
const repo = process.env.ARCHAL_REPLAY_E2E_REPO || 'vercel/next.js';
|
|
7
|
-
const outputPath = resolve(
|
|
8
|
-
process.env.ARCHAL_REPLAY_E2E_OUT || '/tmp/archal-replay-capsule-otlp.json',
|
|
9
|
-
);
|
|
10
|
-
|
|
11
|
-
function nowNanos(offsetMs = 0) {
|
|
12
|
-
return String((Date.now() + offsetMs) * 1_000_000);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function attr(key, value) {
|
|
16
|
-
return { key, value: { stringValue: typeof value === 'string' ? value : JSON.stringify(value) } };
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async function fetchRepoSnapshot() {
|
|
20
|
-
const response = await fetch(`https://api.github.com/repos/${repo}`, {
|
|
21
|
-
headers: {
|
|
22
|
-
accept: 'application/vnd.github+json',
|
|
23
|
-
'user-agent': 'archal-replay-capsule-e2e',
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
if (!response.ok) {
|
|
27
|
-
throw new Error(`GitHub repo snapshot failed: ${response.status} ${response.statusText}`);
|
|
28
|
-
}
|
|
29
|
-
const body = await response.json();
|
|
30
|
-
return {
|
|
31
|
-
id: body.id,
|
|
32
|
-
fullName: body.full_name,
|
|
33
|
-
private: body.private,
|
|
34
|
-
archived: body.archived,
|
|
35
|
-
defaultBranch: body.default_branch,
|
|
36
|
-
pushedAt: body.pushed_at,
|
|
37
|
-
openIssuesCount: body.open_issues_count,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const beforeRepo = await fetchRepoSnapshot();
|
|
42
|
-
const afterRepo = { ...beforeRepo };
|
|
43
|
-
const traceId = randomBytes(16).toString('hex');
|
|
44
|
-
const spanId = randomBytes(8).toString('hex');
|
|
45
|
-
const prompt = `Report whether ${repo} is archived.`;
|
|
46
|
-
// Deliberately wrong when the repository is not archived, so the generated
|
|
47
|
-
// trace is a reproducible failed behavior with a real service snapshot.
|
|
48
|
-
const completion = `${repo} is archived: ${String(!beforeRepo.archived)}`;
|
|
49
|
-
|
|
50
|
-
const replayCapsule = {
|
|
51
|
-
schema: 'archal.trace.replay-capsule',
|
|
52
|
-
version: 1,
|
|
53
|
-
stateBefore: { github: { repositories: [beforeRepo] } },
|
|
54
|
-
stateAfter: { github: { repositories: [afterRepo] } },
|
|
55
|
-
stateDiff: { github: {} },
|
|
56
|
-
serviceReadSet: [{ service: 'github', type: 'repository', id: beforeRepo.fullName }],
|
|
57
|
-
resourceRefs: [{ service: 'github', type: 'repository', id: beforeRepo.fullName }],
|
|
58
|
-
serviceOperations: [{
|
|
59
|
-
service: 'github',
|
|
60
|
-
operation: 'repos.get',
|
|
61
|
-
resourceRefs: [{ service: 'github', type: 'repository', id: beforeRepo.fullName }],
|
|
62
|
-
response: beforeRepo,
|
|
63
|
-
}],
|
|
64
|
-
authPrincipal: { kind: 'anonymous', scopes: [] },
|
|
65
|
-
modelConfig: { provider: 'local-harness', model: 'deterministic-fixture' },
|
|
66
|
-
promptBundle: { task: prompt },
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const otlpPayload = {
|
|
70
|
-
resourceSpans: [{
|
|
71
|
-
resource: {
|
|
72
|
-
attributes: [
|
|
73
|
-
attr('service.name', 'archal-replay-capsule-e2e'),
|
|
74
|
-
],
|
|
75
|
-
},
|
|
76
|
-
scopeSpans: [{
|
|
77
|
-
scope: { attributes: [] },
|
|
78
|
-
spans: [{
|
|
79
|
-
traceId,
|
|
80
|
-
spanId,
|
|
81
|
-
name: 'github.repos.get',
|
|
82
|
-
startTimeUnixNano: nowNanos(-250),
|
|
83
|
-
endTimeUnixNano: nowNanos(),
|
|
84
|
-
attributes: [
|
|
85
|
-
attr('gen_ai.prompt', prompt),
|
|
86
|
-
attr('gen_ai.completion', completion),
|
|
87
|
-
attr('archal.replay.capsule', replayCapsule),
|
|
88
|
-
],
|
|
89
|
-
}],
|
|
90
|
-
}],
|
|
91
|
-
}],
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
await mkdir(dirname(outputPath), { recursive: true });
|
|
95
|
-
await writeFile(outputPath, `${JSON.stringify(otlpPayload, null, 2)}\n`);
|
|
96
|
-
|
|
97
|
-
process.stdout.write(JSON.stringify({
|
|
98
|
-
ok: true,
|
|
99
|
-
outputPath,
|
|
100
|
-
traceId,
|
|
101
|
-
repo: beforeRepo.fullName,
|
|
102
|
-
archived: beforeRepo.archived,
|
|
103
|
-
}, null, 2));
|
|
104
|
-
process.stdout.write('\n');
|
package/dist/harness.cjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const import_meta_url = require('url').pathToFileURL(__filename).href;
|
|
2
|
-
"use strict";
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/harness.ts
|
|
22
|
-
var harness_exports = {};
|
|
23
|
-
__export(harness_exports, {
|
|
24
|
-
reportAgentMetrics: () => reportAgentMetrics
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(harness_exports);
|
|
27
|
-
var import_promises = require("fs/promises");
|
|
28
|
-
var import_node_path = require("path");
|
|
29
|
-
async function reportAgentMetrics(metrics, options = {}) {
|
|
30
|
-
assertNonNegativeInteger("inputTokens", metrics.inputTokens);
|
|
31
|
-
assertNonNegativeInteger("outputTokens", metrics.outputTokens);
|
|
32
|
-
assertNonNegativeInteger("llmCallCount", metrics.llmCallCount);
|
|
33
|
-
const metricsFile = options.metricsFile ?? process.env["AGENT_METRICS_FILE"] ?? process.env["ARCHAL_METRICS_FILE"];
|
|
34
|
-
if (!metricsFile) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
await (0, import_promises.mkdir)((0, import_node_path.dirname)(metricsFile), { recursive: true });
|
|
38
|
-
await (0, import_promises.writeFile)(
|
|
39
|
-
metricsFile,
|
|
40
|
-
JSON.stringify({
|
|
41
|
-
version: 1,
|
|
42
|
-
inputTokens: metrics.inputTokens,
|
|
43
|
-
outputTokens: metrics.outputTokens,
|
|
44
|
-
llmCallCount: metrics.llmCallCount,
|
|
45
|
-
...nonEmptyString(metrics.provider) ? { provider: metrics.provider.trim() } : {},
|
|
46
|
-
...nonEmptyString(metrics.model) ? { model: metrics.model.trim() } : {}
|
|
47
|
-
}),
|
|
48
|
-
"utf8"
|
|
49
|
-
);
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
function nonEmptyString(value) {
|
|
53
|
-
return typeof value === "string" && value.trim().length > 0;
|
|
54
|
-
}
|
|
55
|
-
function assertNonNegativeInteger(name, value) {
|
|
56
|
-
if (!Number.isSafeInteger(value) || value < 0) {
|
|
57
|
-
throw new TypeError(`${name} must be a non-negative safe integer`);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
-
0 && (module.exports = {
|
|
62
|
-
reportAgentMetrics
|
|
63
|
-
});
|
package/dist/harness.d.cts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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 };
|