@aria-cli/tools 1.0.9 → 1.0.11
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/package.json +9 -5
- package/src/__tests__/web-fetch-download.test.ts +0 -433
- package/src/__tests__/web-tools.test.ts +0 -619
- package/src/ask-user-interaction.ts +0 -33
- package/src/cache/web-cache.ts +0 -110
- package/src/definitions/arion.ts +0 -118
- package/src/definitions/browser/browser.ts +0 -502
- package/src/definitions/browser/index.ts +0 -5
- package/src/definitions/browser/pw-downloads.ts +0 -142
- package/src/definitions/browser/pw-interactions.ts +0 -282
- package/src/definitions/browser/pw-responses.ts +0 -98
- package/src/definitions/browser/pw-session.ts +0 -405
- package/src/definitions/browser/pw-shared.ts +0 -85
- package/src/definitions/browser/pw-snapshot.ts +0 -383
- package/src/definitions/browser/pw-state.ts +0 -101
- package/src/definitions/browser/types.ts +0 -203
- package/src/definitions/code-intelligence.ts +0 -526
- package/src/definitions/core.ts +0 -118
- package/src/definitions/delegation.ts +0 -567
- package/src/definitions/deploy.ts +0 -73
- package/src/definitions/filesystem.ts +0 -217
- package/src/definitions/frg.ts +0 -67
- package/src/definitions/index.ts +0 -28
- package/src/definitions/memory.ts +0 -150
- package/src/definitions/messaging.ts +0 -734
- package/src/definitions/meta.ts +0 -392
- package/src/definitions/network.ts +0 -179
- package/src/definitions/outlook.ts +0 -318
- package/src/definitions/patch/apply-patch.ts +0 -235
- package/src/definitions/patch/fuzzy-match.ts +0 -217
- package/src/definitions/patch/index.ts +0 -1
- package/src/definitions/patch/patch-parser.ts +0 -297
- package/src/definitions/patch/sandbox-paths.ts +0 -129
- package/src/definitions/process/index.ts +0 -5
- package/src/definitions/process/process-registry.ts +0 -303
- package/src/definitions/process/process.ts +0 -456
- package/src/definitions/process/pty-keys.ts +0 -298
- package/src/definitions/process/session-slug.ts +0 -147
- package/src/definitions/quip.ts +0 -225
- package/src/definitions/search.ts +0 -67
- package/src/definitions/session-history.ts +0 -79
- package/src/definitions/shell.ts +0 -202
- package/src/definitions/slack.ts +0 -211
- package/src/definitions/web.ts +0 -119
- package/src/executors/apply-patch.ts +0 -1035
- package/src/executors/arion.ts +0 -199
- package/src/executors/code-intelligence.ts +0 -1179
- package/src/executors/deploy.ts +0 -1066
- package/src/executors/filesystem.ts +0 -1428
- package/src/executors/frg-freshness.ts +0 -743
- package/src/executors/frg.ts +0 -394
- package/src/executors/index.ts +0 -280
- package/src/executors/learning-meta.ts +0 -1367
- package/src/executors/lsp-client.ts +0 -355
- package/src/executors/memory.ts +0 -978
- package/src/executors/meta.ts +0 -293
- package/src/executors/process-registry.ts +0 -570
- package/src/executors/pty-session-store.ts +0 -43
- package/src/executors/pty.ts +0 -342
- package/src/executors/restart.ts +0 -133
- package/src/executors/search-freshness.ts +0 -249
- package/src/executors/search-types.ts +0 -98
- package/src/executors/search.ts +0 -89
- package/src/executors/self-diagnose.ts +0 -552
- package/src/executors/session-history.ts +0 -435
- package/src/executors/shell-safety.ts +0 -519
- package/src/executors/shell.ts +0 -1243
- package/src/executors/utils.ts +0 -40
- package/src/executors/web.ts +0 -786
- package/src/extraction/content-extraction.ts +0 -281
- package/src/extraction/index.ts +0 -5
- package/src/headless-control-contract.ts +0 -1149
- package/src/index.ts +0 -788
- package/src/local-control-http-auth.ts +0 -2
- package/src/mcp/client.ts +0 -218
- package/src/mcp/connection.ts +0 -568
- package/src/mcp/index.ts +0 -11
- package/src/mcp/jsonrpc.ts +0 -195
- package/src/mcp/types.ts +0 -199
- package/src/network-control-adapter.ts +0 -88
- package/src/network-runtime/address-types.ts +0 -218
- package/src/network-runtime/db-owner-fencing.ts +0 -91
- package/src/network-runtime/delivery-receipts.ts +0 -372
- package/src/network-runtime/direct-endpoint-authority.ts +0 -35
- package/src/network-runtime/index.ts +0 -316
- package/src/network-runtime/local-control-contract.ts +0 -784
- package/src/network-runtime/node-store-contract.ts +0 -46
- package/src/network-runtime/pair-route-contract.ts +0 -97
- package/src/network-runtime/peer-capabilities.ts +0 -48
- package/src/network-runtime/peer-principal-ref.ts +0 -20
- package/src/network-runtime/peer-state-machine.ts +0 -160
- package/src/network-runtime/protocol-schemas.ts +0 -265
- package/src/network-runtime/runtime-bootstrap-contract.ts +0 -83
- package/src/outlook/desktop-session.ts +0 -409
- package/src/policy.ts +0 -171
- package/src/providers/brave.ts +0 -80
- package/src/providers/duckduckgo.ts +0 -199
- package/src/providers/exa.ts +0 -85
- package/src/providers/firecrawl.ts +0 -77
- package/src/providers/index.ts +0 -8
- package/src/providers/jina.ts +0 -70
- package/src/providers/router.ts +0 -121
- package/src/providers/search-provider.ts +0 -74
- package/src/providers/tavily.ts +0 -74
- package/src/quip/desktop-session.ts +0 -435
- package/src/registry/index.ts +0 -1
- package/src/registry/registry.ts +0 -905
- package/src/runtime-socket-local-control-client.ts +0 -632
- package/src/security/dns-normalization.ts +0 -34
- package/src/security/dns-pinning.ts +0 -138
- package/src/security/external-content.ts +0 -129
- package/src/security/ssrf.ts +0 -207
- package/src/slack/desktop-session.ts +0 -493
- package/src/tool-factory.ts +0 -91
- package/src/types.ts +0 -1341
- package/src/utils/retry.ts +0 -163
- package/src/utils/safe-parse-json.ts +0 -176
- package/src/utils/url.ts +0 -20
- package/tests/benchmarks/registry.bench.ts +0 -57
- package/tests/cache/web-cache.test.ts +0 -147
- package/tests/critical-integration.test.ts +0 -1465
- package/tests/definitions/apply-patch.test.ts +0 -586
- package/tests/definitions/browser.test.ts +0 -495
- package/tests/definitions/delegation-pause-resume.test.ts +0 -758
- package/tests/definitions/execution.test.ts +0 -671
- package/tests/definitions/messaging-inbox-scope.test.ts +0 -229
- package/tests/definitions/messaging.test.ts +0 -1468
- package/tests/definitions/outlook.test.ts +0 -30
- package/tests/definitions/process.test.ts +0 -469
- package/tests/definitions/slack.test.ts +0 -28
- package/tests/definitions/tool-inventory.test.ts +0 -218
- package/tests/e2e/delegation-quest-orchestration.e2e.test.ts +0 -433
- package/tests/e2e/memory-tool-discovery-contract.e2e.test.ts +0 -81
- package/tests/executors/apply-patch.test.ts +0 -538
- package/tests/executors/arion.test.ts +0 -309
- package/tests/executors/conversation-primitives.test.ts +0 -250
- package/tests/executors/deploy.test.ts +0 -746
- package/tests/executors/filesystem-tools.test.ts +0 -357
- package/tests/executors/filesystem.test.ts +0 -959
- package/tests/executors/frg-freshness.test.ts +0 -136
- package/tests/executors/frg-merge.test.ts +0 -70
- package/tests/executors/frg-session-content.test.ts +0 -40
- package/tests/executors/frg.test.ts +0 -56
- package/tests/executors/memory-bugfixes.test.ts +0 -257
- package/tests/executors/memory-real-memoria.integration.test.ts +0 -316
- package/tests/executors/memory.test.ts +0 -853
- package/tests/executors/meta-tools.test.ts +0 -411
- package/tests/executors/meta.test.ts +0 -683
- package/tests/executors/path-containment.test.ts +0 -51
- package/tests/executors/process-registry.test.ts +0 -505
- package/tests/executors/pty.test.ts +0 -664
- package/tests/executors/quest-security.test.ts +0 -249
- package/tests/executors/read-file-media.test.ts +0 -230
- package/tests/executors/recall-knowledge-schema.test.ts +0 -209
- package/tests/executors/recall-tags.test.ts +0 -278
- package/tests/executors/remember-null-safety.contract.test.ts +0 -41
- package/tests/executors/restart.test.ts +0 -67
- package/tests/executors/search-unified.test.ts +0 -381
- package/tests/executors/session-history.test.ts +0 -340
- package/tests/executors/session-transcript.test.ts +0 -561
- package/tests/executors/shell-abort.test.ts +0 -416
- package/tests/executors/shell-env-blocklist.test.ts +0 -648
- package/tests/executors/shell-env-process.test.ts +0 -245
- package/tests/executors/shell-process-registry.test.ts +0 -334
- package/tests/executors/shell-tools.test.ts +0 -393
- package/tests/executors/shell.test.ts +0 -690
- package/tests/executors/web-abort-vs-timeout.test.ts +0 -213
- package/tests/executors/web-integration.test.ts +0 -633
- package/tests/executors/web-symlink.test.ts +0 -18
- package/tests/executors/web.test.ts +0 -1400
- package/tests/executors/write-stdin.test.ts +0 -145
- package/tests/extraction/content-extraction.test.ts +0 -153
- package/tests/guards/tools-default-test-lane.integration.test.ts +0 -21
- package/tests/guards/tools-package-test-commands.e2e.test.ts +0 -43
- package/tests/guards/tools-test-lane-manifest.contract.test.ts +0 -76
- package/tests/guards/tools-vitest-workspace-alias.contract.test.ts +0 -63
- package/tests/helpers/async-waits.ts +0 -53
- package/tests/integration/headless-control-contract.integration.test.ts +0 -153
- package/tests/integration/memory-tool-schema-parity.integration.test.ts +0 -67
- package/tests/integration/meta-tools-round-trip.integration.test.ts +0 -506
- package/tests/integration/quest-round-trip.test.ts +0 -303
- package/tests/integration/registry-executor-flow.test.ts +0 -85
- package/tests/integration.test.ts +0 -177
- package/tests/loading-tier.test.ts +0 -126
- package/tests/mcp/client-reconnect.test.ts +0 -267
- package/tests/mcp/connection.test.ts +0 -846
- package/tests/mcp/injectable-logger.test.ts +0 -83
- package/tests/mcp/jsonrpc.test.ts +0 -109
- package/tests/mcp/lifecycle.test.ts +0 -879
- package/tests/network-runtime/address-types.contract.test.ts +0 -143
- package/tests/network-runtime/continuity-bind-schema.contract.test.ts +0 -203
- package/tests/network-runtime/local-control-contract.test.ts +0 -869
- package/tests/network-runtime/local-control-invite-token.contract.test.ts +0 -146
- package/tests/network-runtime/node-store-contract.test.ts +0 -11
- package/tests/network-runtime/pair-protocol-nodeid.contract.test.ts +0 -15
- package/tests/network-runtime/peer-state-machine.contract.test.ts +0 -148
- package/tests/network-runtime/protocol-schemas.contract.test.ts +0 -512
- package/tests/network-runtime/relay-pending-nodeid.contract.test.ts +0 -62
- package/tests/network-runtime/runtime-bootstrap-contract.test.ts +0 -227
- package/tests/network-runtime/runtime-socket-local-control-client.test.ts +0 -621
- package/tests/network-runtime/wait-for-message-script.test.ts +0 -288
- package/tests/parallel.test.ts +0 -71
- package/tests/policy.test.ts +0 -184
- package/tests/print-default-test-lane.ts +0 -14
- package/tests/print-test-lane-manifest.ts +0 -22
- package/tests/providers/brave.test.ts +0 -159
- package/tests/providers/duckduckgo.test.ts +0 -207
- package/tests/providers/exa.test.ts +0 -175
- package/tests/providers/firecrawl.test.ts +0 -168
- package/tests/providers/jina.test.ts +0 -144
- package/tests/providers/router.test.ts +0 -328
- package/tests/providers/tavily.test.ts +0 -165
- package/tests/registry/discovery.test.ts +0 -154
- package/tests/registry/injectable-logger.test.ts +0 -230
- package/tests/registry/input-validation.test.ts +0 -361
- package/tests/registry/interface-completeness.test.ts +0 -85
- package/tests/registry/mcp-integration.test.ts +0 -103
- package/tests/registry/mcp-read-only-hint.test.ts +0 -60
- package/tests/registry/memoria-discovery.test.ts +0 -390
- package/tests/registry/nested-validation.test.ts +0 -283
- package/tests/registry/pseudo-tool-filtering.test.ts +0 -258
- package/tests/registry/registration-lifecycle.test.ts +0 -133
- package/tests/registry-validation.test.ts +0 -424
- package/tests/registry.test.ts +0 -460
- package/tests/security/dns-pinning.test.ts +0 -162
- package/tests/security/external-content.test.ts +0 -144
- package/tests/security/ssrf.test.ts +0 -118
- package/tests/shell-safety-integration.test.ts +0 -32
- package/tests/shell-safety.test.ts +0 -365
- package/tests/slack/desktop-session.test.ts +0 -50
- package/tests/test-lane-manifest.ts +0 -440
- package/tests/test-utils.ts +0 -27
- package/tests/tool-factory.test.ts +0 -188
- package/tests/utils/retry.test.ts +0 -231
- package/tests/utils/url.test.ts +0 -63
- package/tsconfig.cjs.json +0 -24
- package/tsconfig.json +0 -12
- package/vitest.config.ts +0 -55
- package/vitest.e2e.config.ts +0 -24
- package/vitest.integration.config.ts +0 -24
- package/vitest.native.config.ts +0 -24
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
extractCachedSlackDesktopState,
|
|
4
|
-
extractLiveSlackTokenFromMultipartBody,
|
|
5
|
-
extractWorkspaceHostFromAppHtml,
|
|
6
|
-
} from "../../src/slack/desktop-session.js";
|
|
7
|
-
|
|
8
|
-
describe("Slack desktop session helpers", () => {
|
|
9
|
-
it("extracts cached team ids and cached token from desktop local storage text", () => {
|
|
10
|
-
const levelDbText = [
|
|
11
|
-
"prefix localConfig_v2",
|
|
12
|
-
'teams! T04L44BRZ something {"name":"Axon Enterprise, Inc.","token":"xoxc-4684147883-2782313908196-9922914813107-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}',
|
|
13
|
-
"more-bytes",
|
|
14
|
-
'teams! T1234567890 something {"name":"Sandbox","token":"xoxc-1234567890-1111111111111-2222222222222-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"}',
|
|
15
|
-
].join("");
|
|
16
|
-
|
|
17
|
-
expect(extractCachedSlackDesktopState(levelDbText)).toEqual({
|
|
18
|
-
cachedToken:
|
|
19
|
-
"xoxc-4684147883-2782313908196-9922914813107-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
|
|
20
|
-
teamIds: ["T04L44BRZ", "T1234567890"],
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
it("extracts the workspace host from authenticated app html", () => {
|
|
25
|
-
const html = [
|
|
26
|
-
'<script src="https://a.slack-edge.com/bv1-13/application.123.min.js"></script>',
|
|
27
|
-
'<meta content="https://api.slack.com">',
|
|
28
|
-
'<div data-team-host="https://axon.enterprise.slack.com"></div>',
|
|
29
|
-
].join("");
|
|
30
|
-
|
|
31
|
-
expect(extractWorkspaceHostFromAppHtml(html)).toBe("axon.enterprise.slack.com");
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it("extracts the live token from a captured Slack multipart request body", () => {
|
|
35
|
-
const requestBody = [
|
|
36
|
-
"------WebKitFormBoundary123",
|
|
37
|
-
'Content-Disposition: form-data; name="token"',
|
|
38
|
-
"",
|
|
39
|
-
"xoxc-8458081292387-2782313908196-9922914813107-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
40
|
-
"------WebKitFormBoundary123",
|
|
41
|
-
'Content-Disposition: form-data; name="channel"',
|
|
42
|
-
"",
|
|
43
|
-
"C04L44C27",
|
|
44
|
-
].join("\r\n");
|
|
45
|
-
|
|
46
|
-
expect(extractLiveSlackTokenFromMultipartBody(requestBody)).toBe(
|
|
47
|
-
"xoxc-8458081292387-2782313908196-9922914813107-cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc",
|
|
48
|
-
);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1,440 +0,0 @@
|
|
|
1
|
-
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { fileURLToPath } from "node:url";
|
|
4
|
-
import { getMaxWorkers } from "../../../vitest.shared.ts";
|
|
5
|
-
|
|
6
|
-
export type ToolsTestLaneId = "unit" | "integration" | "native" | "e2e";
|
|
7
|
-
export type ToolsTestProofClassId = "gate" | "system" | "live";
|
|
8
|
-
|
|
9
|
-
export interface ToolsTestPlacement {
|
|
10
|
-
lane: ToolsTestLaneId;
|
|
11
|
-
proofClass: ToolsTestProofClassId;
|
|
12
|
-
resourceKeys: string[];
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface ToolsTestLaneManifest {
|
|
16
|
-
defaultLane: "unit";
|
|
17
|
-
lanes: Record<ToolsTestLaneId, string[]>;
|
|
18
|
-
setupFiles: Record<ToolsTestLaneId, string[]>;
|
|
19
|
-
maxWorkers: Record<ToolsTestLaneId, number>;
|
|
20
|
-
pool: Record<ToolsTestLaneId, "forks">;
|
|
21
|
-
fileParallelism: Record<ToolsTestLaneId, boolean>;
|
|
22
|
-
unclassified: string[];
|
|
23
|
-
proofClasses: Record<ToolsTestProofClassId, string[]>;
|
|
24
|
-
resourceKeysByFile: Record<string, string[]>;
|
|
25
|
-
unclassifiedProofClasses: string[];
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const packageRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
29
|
-
const scanRoots = [path.join(packageRoot, "tests"), path.join(packageRoot, "src")];
|
|
30
|
-
const SAFE_UNIT_WORKERS = Math.min(4, getMaxWorkers());
|
|
31
|
-
const EMPTY_SETUP: string[] = [];
|
|
32
|
-
const UNIT_ALLOWLIST = new Set([
|
|
33
|
-
"src/__tests__/web-fetch-download.test.ts",
|
|
34
|
-
"src/__tests__/web-tools.test.ts",
|
|
35
|
-
"tests/cache/web-cache.test.ts",
|
|
36
|
-
"tests/definitions/apply-patch.test.ts",
|
|
37
|
-
"tests/definitions/browser.test.ts",
|
|
38
|
-
"tests/definitions/messaging-address-space.contract.test.ts",
|
|
39
|
-
"tests/definitions/delegation-pause-resume.test.ts",
|
|
40
|
-
"tests/definitions/messaging-address-space.contract.test.ts",
|
|
41
|
-
"tests/definitions/process.test.ts",
|
|
42
|
-
"tests/definitions/slack.test.ts",
|
|
43
|
-
"tests/definitions/tool-inventory.test.ts",
|
|
44
|
-
"tests/executors/apply-patch.test.ts",
|
|
45
|
-
"tests/executors/arion.test.ts",
|
|
46
|
-
"tests/executors/conversation-primitives.test.ts",
|
|
47
|
-
"tests/executors/deploy.test.ts",
|
|
48
|
-
"tests/executors/filesystem-tools.test.ts",
|
|
49
|
-
"tests/executors/frg.test.ts",
|
|
50
|
-
"tests/executors/frg-freshness.test.ts",
|
|
51
|
-
"tests/executors/frg-merge.test.ts",
|
|
52
|
-
"tests/executors/frg-session-content.test.ts",
|
|
53
|
-
"tests/executors/filesystem.test.ts",
|
|
54
|
-
"tests/executors/memory-bugfixes.test.ts",
|
|
55
|
-
"tests/executors/memory.test.ts",
|
|
56
|
-
"tests/executors/meta-tools.test.ts",
|
|
57
|
-
"tests/executors/meta.test.ts",
|
|
58
|
-
"tests/executors/path-containment.test.ts",
|
|
59
|
-
"tests/executors/quest-security.test.ts",
|
|
60
|
-
"tests/executors/read-file-media.test.ts",
|
|
61
|
-
"tests/executors/recall-knowledge-schema.test.ts",
|
|
62
|
-
"tests/executors/recall-tags.test.ts",
|
|
63
|
-
"tests/executors/remember-null-safety.contract.test.ts",
|
|
64
|
-
"tests/executors/restart.test.ts",
|
|
65
|
-
"tests/executors/search-unified.test.ts",
|
|
66
|
-
"tests/executors/session-history.test.ts",
|
|
67
|
-
"tests/executors/session-transcript.test.ts",
|
|
68
|
-
"tests/executors/shell-env-blocklist.test.ts",
|
|
69
|
-
"tests/executors/shell-env-process.test.ts",
|
|
70
|
-
"tests/executors/web-abort-vs-timeout.test.ts",
|
|
71
|
-
"tests/executors/web-symlink.test.ts",
|
|
72
|
-
"tests/executors/web.test.ts",
|
|
73
|
-
"tests/executors/write-stdin.test.ts",
|
|
74
|
-
"tests/extraction/content-extraction.test.ts",
|
|
75
|
-
"tests/guards/tools-default-test-lane.integration.test.ts",
|
|
76
|
-
"tests/guards/tools-test-lane-manifest.contract.test.ts",
|
|
77
|
-
"tests/loading-tier.test.ts",
|
|
78
|
-
"tests/mcp/client-reconnect.test.ts",
|
|
79
|
-
"tests/mcp/connection.test.ts",
|
|
80
|
-
"tests/mcp/injectable-logger.test.ts",
|
|
81
|
-
"tests/mcp/jsonrpc.test.ts",
|
|
82
|
-
"tests/mcp/lifecycle.test.ts",
|
|
83
|
-
"tests/network-runtime/address-advertisement-revisions.contract.test.ts",
|
|
84
|
-
"tests/network-runtime/accept-invite-request.contract.test.ts",
|
|
85
|
-
"tests/network-runtime/address-types.contract.test.ts",
|
|
86
|
-
"tests/network-runtime/control-endpoint-advertisement.contract.test.ts",
|
|
87
|
-
"tests/network-runtime/delegation-peer-principal-surface.contract.test.ts",
|
|
88
|
-
"tests/network-runtime/delivery-ack-principal.contract.test.ts",
|
|
89
|
-
"tests/network-runtime/delivery-api-surface.contract.test.ts",
|
|
90
|
-
"tests/network-runtime/deploy-runtime-owner.contract.test.ts",
|
|
91
|
-
"tests/network-runtime/durable-receipt-semantics.contract.test.ts",
|
|
92
|
-
"tests/network-runtime/local-control-api.contract.test.ts",
|
|
93
|
-
"tests/network-runtime/local-control-invite-token.contract.test.ts",
|
|
94
|
-
"tests/network-runtime/local-control-contract.test.ts",
|
|
95
|
-
"tests/network-runtime/local-control-operations.contract.test.ts",
|
|
96
|
-
"tests/network-runtime/local-control-pairing-request.contract.test.ts",
|
|
97
|
-
"tests/network-runtime/local-control-peer-view.contract.test.ts",
|
|
98
|
-
"tests/network-runtime/local-control-principal-identity.contract.test.ts",
|
|
99
|
-
"tests/network-runtime/local-control-repair-peerid.contract.test.ts",
|
|
100
|
-
"tests/network-runtime/local-control-repair-revisions.contract.test.ts",
|
|
101
|
-
"tests/network-runtime/local-control-revoke-peerid.contract.test.ts",
|
|
102
|
-
"tests/network-runtime/local-control-run-policy.contract.test.ts",
|
|
103
|
-
"tests/network-runtime/runtime-socket-local-control-client.test.ts",
|
|
104
|
-
"tests/network-runtime/local-runtime-summary.contract.test.ts",
|
|
105
|
-
"tests/network-runtime/network-control-peerid.contract.test.ts",
|
|
106
|
-
"tests/network-runtime/network-control-principal-surface.contract.test.ts",
|
|
107
|
-
"tests/network-runtime/network-control-revoke-peerid.contract.test.ts",
|
|
108
|
-
"tests/network-runtime/network-runtime-surface-leakage.contract.test.ts",
|
|
109
|
-
"tests/network-runtime/nearby-peer-principal.contract.test.ts",
|
|
110
|
-
"tests/network-runtime/node-store-contract.test.ts",
|
|
111
|
-
"tests/network-runtime/peer-principal-ref.contract.test.ts",
|
|
112
|
-
"tests/network-runtime/peer-state-machine.contract.test.ts",
|
|
113
|
-
"tests/network-runtime/pending-pair-request-view.contract.test.ts",
|
|
114
|
-
"tests/network-runtime/pair-protocol-nodeid.contract.test.ts",
|
|
115
|
-
"tests/network-runtime/relay-pending-nodeid.contract.test.ts",
|
|
116
|
-
"tests/network-runtime/relay-pending-response.contract.test.ts",
|
|
117
|
-
"tests/network-runtime/persisted-inbox-identity.contract.test.ts",
|
|
118
|
-
"tests/network-runtime/pair-protocol-nodeid.contract.test.ts",
|
|
119
|
-
"tests/network-runtime/continuity-bind-schema.contract.test.ts",
|
|
120
|
-
"tests/network-runtime/protocol-schemas.contract.test.ts",
|
|
121
|
-
"tests/network-runtime/runtime-bootstrap-contract.test.ts",
|
|
122
|
-
"tests/network-runtime/wait-for-message-script.test.ts",
|
|
123
|
-
"tests/network-runtime/runtime-contract-removal.contract.test.ts",
|
|
124
|
-
"tests/network-runtime/runtime-journal.contract.test.ts",
|
|
125
|
-
"tests/network-runtime/runtime-outbox.contract.test.ts",
|
|
126
|
-
"tests/network-runtime/runtime-owner-record.contract.test.ts",
|
|
127
|
-
"tests/network-runtime/runtime-revision-types.contract.test.ts",
|
|
128
|
-
"tests/parallel.test.ts",
|
|
129
|
-
"tests/policy.test.ts",
|
|
130
|
-
"tests/providers/brave.test.ts",
|
|
131
|
-
"tests/providers/duckduckgo.test.ts",
|
|
132
|
-
"tests/providers/exa.test.ts",
|
|
133
|
-
"tests/providers/firecrawl.test.ts",
|
|
134
|
-
"tests/providers/jina.test.ts",
|
|
135
|
-
"tests/providers/router.test.ts",
|
|
136
|
-
"tests/providers/tavily.test.ts",
|
|
137
|
-
"tests/registry-validation.test.ts",
|
|
138
|
-
"tests/registry.test.ts",
|
|
139
|
-
"tests/registry/discovery.test.ts",
|
|
140
|
-
"tests/registry/injectable-logger.test.ts",
|
|
141
|
-
"tests/registry/input-validation.test.ts",
|
|
142
|
-
"tests/registry/interface-completeness.test.ts",
|
|
143
|
-
"tests/registry/mcp-read-only-hint.test.ts",
|
|
144
|
-
"tests/registry/memoria-discovery.test.ts",
|
|
145
|
-
"tests/registry/nested-validation.test.ts",
|
|
146
|
-
"tests/registry/pseudo-tool-filtering.test.ts",
|
|
147
|
-
"tests/registry/registration-lifecycle.test.ts",
|
|
148
|
-
"tests/security/dns-pinning.test.ts",
|
|
149
|
-
"tests/security/external-content.test.ts",
|
|
150
|
-
"tests/security/ssrf.test.ts",
|
|
151
|
-
"tests/shell-safety.test.ts",
|
|
152
|
-
"tests/slack/desktop-session.test.ts",
|
|
153
|
-
"tests/tool-factory.test.ts",
|
|
154
|
-
"tests/utils/retry.test.ts",
|
|
155
|
-
"tests/utils/url.test.ts",
|
|
156
|
-
]);
|
|
157
|
-
const NATIVE_PATTERNS = [
|
|
158
|
-
/better-sqlite3/,
|
|
159
|
-
/from\s*["']@aria\/memoria(?:\/storage)?["']/,
|
|
160
|
-
/await\s+import\(["']node-pty["']\)/,
|
|
161
|
-
/from\s*["']node-pty["']/,
|
|
162
|
-
/from\s*["'][^"']*\/executors\/pty\.js["']/,
|
|
163
|
-
/\bcreatePTYSession\(/,
|
|
164
|
-
/\brunInPTY\(/,
|
|
165
|
-
];
|
|
166
|
-
|
|
167
|
-
let cachedManifest: ToolsTestLaneManifest | null = null;
|
|
168
|
-
const contentCache = new Map<string, string>();
|
|
169
|
-
|
|
170
|
-
function normalizeRelativePath(filePath: string): string {
|
|
171
|
-
return path.relative(packageRoot, filePath).split(path.sep).join("/");
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
function statSafe(targetPath: string): ReturnType<typeof statSync> | null {
|
|
175
|
-
try {
|
|
176
|
-
return statSync(targetPath);
|
|
177
|
-
} catch {
|
|
178
|
-
return null;
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function collectTestFiles(dir: string, out: string[]): void {
|
|
183
|
-
if (!statSafe(dir)?.isDirectory()) return;
|
|
184
|
-
|
|
185
|
-
for (const entry of readdirSync(dir)) {
|
|
186
|
-
if (entry === "node_modules" || entry === "dist" || entry === ".worktrees") continue;
|
|
187
|
-
|
|
188
|
-
const fullPath = path.join(dir, entry);
|
|
189
|
-
const stat = statSync(fullPath);
|
|
190
|
-
if (stat.isDirectory()) {
|
|
191
|
-
collectTestFiles(fullPath, out);
|
|
192
|
-
continue;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
if (entry.endsWith(".test.ts") || entry.endsWith(".test.tsx")) {
|
|
196
|
-
out.push(normalizeRelativePath(fullPath));
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
function basename(relativePath: string): string {
|
|
202
|
-
return path.posix.basename(relativePath);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function readRelativeFile(relativePath: string): string {
|
|
206
|
-
const normalized = relativePath.split(path.sep).join("/");
|
|
207
|
-
const cached = contentCache.get(normalized);
|
|
208
|
-
if (cached !== undefined) {
|
|
209
|
-
return cached;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
const content = readFileSync(path.join(packageRoot, normalized), "utf8");
|
|
213
|
-
contentCache.set(normalized, content);
|
|
214
|
-
return content;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function isE2ESuite(relativePath: string): boolean {
|
|
218
|
-
const name = basename(relativePath);
|
|
219
|
-
return relativePath.includes("/e2e/") || /(^|[.-])e2e\./.test(name);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function isNativeSuite(relativePath: string): boolean {
|
|
223
|
-
const name = basename(relativePath);
|
|
224
|
-
if (relativePath.includes("/native/") || /(^|[.-])native\./.test(name)) {
|
|
225
|
-
return true;
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
const content = readRelativeFile(relativePath);
|
|
229
|
-
return NATIVE_PATTERNS.some((pattern) => pattern.test(content));
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function isIntegrationSuite(relativePath: string): boolean {
|
|
233
|
-
const name = basename(relativePath);
|
|
234
|
-
return relativePath.includes("/integration/") || /(^|[.-])integration\./.test(name);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function cloneStringArray(values: string[]): string[] {
|
|
238
|
-
return [...values];
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function cloneLaneRecord<T>(record: Record<ToolsTestLaneId, T>): Record<ToolsTestLaneId, T> {
|
|
242
|
-
return {
|
|
243
|
-
unit: record.unit,
|
|
244
|
-
integration: record.integration,
|
|
245
|
-
native: record.native,
|
|
246
|
-
e2e: record.e2e,
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function defaultProofClassForLane(lane: ToolsTestLaneId): ToolsTestProofClassId {
|
|
251
|
-
return lane === "unit" ? "gate" : "system";
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
export function classifyToolsTestPlacement(relativePath: string): ToolsTestPlacement | null {
|
|
255
|
-
const normalized = relativePath.split(path.sep).join("/");
|
|
256
|
-
if (!normalized.endsWith(".test.ts") && !normalized.endsWith(".test.tsx")) {
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
let lane: ToolsTestLaneId;
|
|
261
|
-
if (UNIT_ALLOWLIST.has(normalized)) {
|
|
262
|
-
lane = "unit";
|
|
263
|
-
} else if (isE2ESuite(normalized)) {
|
|
264
|
-
lane = "e2e";
|
|
265
|
-
} else if (isIntegrationSuite(normalized)) {
|
|
266
|
-
lane = "integration";
|
|
267
|
-
} else if (isNativeSuite(normalized)) {
|
|
268
|
-
lane = "native";
|
|
269
|
-
} else {
|
|
270
|
-
lane = "integration";
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return {
|
|
274
|
-
lane,
|
|
275
|
-
proofClass: defaultProofClassForLane(lane),
|
|
276
|
-
resourceKeys: [],
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export function classifyToolsTestFile(relativePath: string): ToolsTestLaneId | null {
|
|
281
|
-
return classifyToolsTestPlacement(relativePath)?.lane ?? null;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
export function classifyToolsTestProofClass(relativePath: string): ToolsTestProofClassId | null {
|
|
285
|
-
return classifyToolsTestPlacement(relativePath)?.proofClass ?? null;
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
export function loadToolsTestLaneManifest(): ToolsTestLaneManifest {
|
|
289
|
-
if (cachedManifest) {
|
|
290
|
-
return {
|
|
291
|
-
...cachedManifest,
|
|
292
|
-
lanes: Object.fromEntries(
|
|
293
|
-
Object.entries(cachedManifest.lanes).map(([lane, files]) => [
|
|
294
|
-
lane,
|
|
295
|
-
cloneStringArray(files),
|
|
296
|
-
]),
|
|
297
|
-
) as Record<ToolsTestLaneId, string[]>,
|
|
298
|
-
setupFiles: Object.fromEntries(
|
|
299
|
-
Object.entries(cachedManifest.setupFiles).map(([lane, files]) => [
|
|
300
|
-
lane,
|
|
301
|
-
cloneStringArray(files),
|
|
302
|
-
]),
|
|
303
|
-
) as Record<ToolsTestLaneId, string[]>,
|
|
304
|
-
maxWorkers: cloneLaneRecord(cachedManifest.maxWorkers),
|
|
305
|
-
pool: cloneLaneRecord(cachedManifest.pool),
|
|
306
|
-
fileParallelism: cloneLaneRecord(cachedManifest.fileParallelism),
|
|
307
|
-
unclassified: cloneStringArray(cachedManifest.unclassified),
|
|
308
|
-
proofClasses: {
|
|
309
|
-
gate: cloneStringArray(cachedManifest.proofClasses.gate),
|
|
310
|
-
system: cloneStringArray(cachedManifest.proofClasses.system),
|
|
311
|
-
live: cloneStringArray(cachedManifest.proofClasses.live),
|
|
312
|
-
},
|
|
313
|
-
resourceKeysByFile: Object.fromEntries(
|
|
314
|
-
Object.entries(cachedManifest.resourceKeysByFile).map(([file, resourceKeys]) => [
|
|
315
|
-
file,
|
|
316
|
-
cloneStringArray(resourceKeys),
|
|
317
|
-
]),
|
|
318
|
-
),
|
|
319
|
-
unclassifiedProofClasses: cloneStringArray(cachedManifest.unclassifiedProofClasses),
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
const files: string[] = [];
|
|
324
|
-
for (const scanRoot of scanRoots) {
|
|
325
|
-
collectTestFiles(scanRoot, files);
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
const manifest: ToolsTestLaneManifest = {
|
|
329
|
-
defaultLane: "unit",
|
|
330
|
-
lanes: {
|
|
331
|
-
unit: [],
|
|
332
|
-
integration: [],
|
|
333
|
-
native: [],
|
|
334
|
-
e2e: [],
|
|
335
|
-
},
|
|
336
|
-
setupFiles: {
|
|
337
|
-
unit: EMPTY_SETUP,
|
|
338
|
-
integration: EMPTY_SETUP,
|
|
339
|
-
native: EMPTY_SETUP,
|
|
340
|
-
e2e: EMPTY_SETUP,
|
|
341
|
-
},
|
|
342
|
-
maxWorkers: {
|
|
343
|
-
unit: SAFE_UNIT_WORKERS,
|
|
344
|
-
integration: 1,
|
|
345
|
-
native: 1,
|
|
346
|
-
e2e: 1,
|
|
347
|
-
},
|
|
348
|
-
pool: {
|
|
349
|
-
unit: "forks",
|
|
350
|
-
integration: "forks",
|
|
351
|
-
native: "forks",
|
|
352
|
-
e2e: "forks",
|
|
353
|
-
},
|
|
354
|
-
fileParallelism: {
|
|
355
|
-
unit: true,
|
|
356
|
-
integration: false,
|
|
357
|
-
native: false,
|
|
358
|
-
e2e: false,
|
|
359
|
-
},
|
|
360
|
-
unclassified: [],
|
|
361
|
-
proofClasses: {
|
|
362
|
-
gate: [],
|
|
363
|
-
system: [],
|
|
364
|
-
live: [],
|
|
365
|
-
},
|
|
366
|
-
resourceKeysByFile: {},
|
|
367
|
-
unclassifiedProofClasses: [],
|
|
368
|
-
};
|
|
369
|
-
|
|
370
|
-
for (const relativePath of files) {
|
|
371
|
-
const placement = classifyToolsTestPlacement(relativePath);
|
|
372
|
-
if (!placement) {
|
|
373
|
-
manifest.unclassified.push(relativePath);
|
|
374
|
-
manifest.unclassifiedProofClasses.push(relativePath);
|
|
375
|
-
continue;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
manifest.lanes[placement.lane].push(relativePath);
|
|
379
|
-
manifest.proofClasses[placement.proofClass].push(relativePath);
|
|
380
|
-
manifest.resourceKeysByFile[relativePath] = [...placement.resourceKeys];
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
for (const lane of Object.keys(manifest.lanes) as ToolsTestLaneId[]) {
|
|
384
|
-
manifest.lanes[lane].sort();
|
|
385
|
-
}
|
|
386
|
-
manifest.unclassified.sort();
|
|
387
|
-
|
|
388
|
-
cachedManifest = manifest;
|
|
389
|
-
return loadToolsTestLaneManifest();
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
export function getToolsTestLaneFiles(lane: ToolsTestLaneId): string[] {
|
|
393
|
-
return cloneStringArray(loadToolsTestLaneManifest().lanes[lane]);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
export function getToolsTestLaneSetupFiles(lane: ToolsTestLaneId): string[] {
|
|
397
|
-
return cloneStringArray(loadToolsTestLaneManifest().setupFiles[lane]);
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
export function getToolsTestLaneMaxWorkers(lane: ToolsTestLaneId): number {
|
|
401
|
-
return loadToolsTestLaneManifest().maxWorkers[lane];
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
export function getToolsTestLanePool(lane: ToolsTestLaneId): "forks" {
|
|
405
|
-
return loadToolsTestLaneManifest().pool[lane];
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
export function getToolsTestLaneFileParallelism(lane: ToolsTestLaneId): boolean {
|
|
409
|
-
return loadToolsTestLaneManifest().fileParallelism[lane];
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
export function getToolsDiagnosticBreadthFiles(
|
|
413
|
-
view: "unit" | "integration" | "e2e" | "native",
|
|
414
|
-
): string[] {
|
|
415
|
-
switch (view) {
|
|
416
|
-
case "unit":
|
|
417
|
-
return getToolsTestLaneFiles("unit");
|
|
418
|
-
case "integration":
|
|
419
|
-
return getToolsTestLaneFiles("integration");
|
|
420
|
-
case "e2e":
|
|
421
|
-
return getToolsTestLaneFiles("e2e");
|
|
422
|
-
case "native":
|
|
423
|
-
return getToolsTestLaneFiles("native");
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
export function getToolsTestProofClassFiles(proofClass: ToolsTestProofClassId): string[] {
|
|
428
|
-
return [...loadToolsTestLaneManifest().proofClasses[proofClass]];
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
export const PACKAGE_TEST_AUTHORITY = {
|
|
432
|
-
classifyPlacement: classifyToolsTestPlacement,
|
|
433
|
-
classifyLane: classifyToolsTestFile,
|
|
434
|
-
classifyProofClass: classifyToolsTestProofClass,
|
|
435
|
-
loadManifest: loadToolsTestLaneManifest,
|
|
436
|
-
getLaneFiles: getToolsTestLaneFiles,
|
|
437
|
-
getLaneGlobalSetup: () => [],
|
|
438
|
-
getDiagnosticBreadthFiles: getToolsDiagnosticBreadthFiles,
|
|
439
|
-
getProofClassFiles: getToolsTestProofClassFiles,
|
|
440
|
-
};
|
package/tests/test-utils.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Test Utilities
|
|
3
|
-
*
|
|
4
|
-
* Shared utilities for test files
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Create a conditional skip wrapper for test functions.
|
|
9
|
-
*
|
|
10
|
-
* Usage: `it("name", skipIf(condition, reason)(async () => { ... }))`
|
|
11
|
-
*
|
|
12
|
-
* When condition is true, returns an empty async function (test passes trivially).
|
|
13
|
-
* When condition is false, returns the original test function unchanged.
|
|
14
|
-
*
|
|
15
|
-
* Note: Tests skipped this way will show as "passed" not "skipped" in vitest output.
|
|
16
|
-
* For proper skip reporting, use `it.skipIf(condition)` directly.
|
|
17
|
-
*/
|
|
18
|
-
export function skipIf(condition: boolean, _reason: string) {
|
|
19
|
-
return (testFn: () => Promise<void>): (() => Promise<void>) => {
|
|
20
|
-
if (condition) {
|
|
21
|
-
return async () => {
|
|
22
|
-
// Silently pass — API key not available
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
return testFn;
|
|
26
|
-
};
|
|
27
|
-
}
|