@khanglvm/outline-cli 0.1.4 → 0.1.6
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/CHANGELOG.md +10 -0
- package/README.md +2 -3
- package/package.json +7 -1
- package/src/entry-integrity-manifest.generated.js +1 -1
- package/.env.test.example +0 -2
- package/AGENTS.md +0 -107
- package/docs/TOOL_CONTRACTS.md +0 -8
- package/scripts/generate-entry-integrity.mjs +0 -123
- package/scripts/release.mjs +0 -353
- package/test/action-gate.unit.test.js +0 -157
- package/test/agent-skills.unit.test.js +0 -144
- package/test/config-store.unit.test.js +0 -121
- package/test/hardening.unit.test.js +0 -3803
- package/test/live.integration.test.js +0 -5136
- package/test/profile-selection.unit.test.js +0 -289
- package/test/security.unit.test.js +0 -113
- package/test/tool-resolution.unit.test.js +0 -333
- package/test/version.unit.test.js +0 -21
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import test from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import {
|
|
4
|
-
buildProfile,
|
|
5
|
-
getProfile,
|
|
6
|
-
normalizeBaseUrlWithHints,
|
|
7
|
-
suggestProfileMetadata,
|
|
8
|
-
suggestProfiles,
|
|
9
|
-
} from "../src/config-store.js";
|
|
10
|
-
|
|
11
|
-
test("normalizeBaseUrlWithHints auto-corrects official and document URLs", () => {
|
|
12
|
-
const official = normalizeBaseUrlWithHints("https://www.getoutline.com");
|
|
13
|
-
assert.equal(official.baseUrl, "https://app.getoutline.com");
|
|
14
|
-
assert.equal(official.corrected, true);
|
|
15
|
-
assert.ok(official.corrections.includes("mapped_official_outline_host"));
|
|
16
|
-
|
|
17
|
-
const docUrl = normalizeBaseUrlWithHints(
|
|
18
|
-
"https://handbook.acme.example/doc/event-tracking-data-A7hLXuHZJl#d-A7hLXuHZJl"
|
|
19
|
-
);
|
|
20
|
-
assert.equal(docUrl.baseUrl, "https://handbook.acme.example");
|
|
21
|
-
assert.equal(docUrl.corrected, true);
|
|
22
|
-
assert.ok(docUrl.corrections.includes("trimmed_ui_path"));
|
|
23
|
-
|
|
24
|
-
const reverseProxy = normalizeBaseUrlWithHints("https://wiki.example.com/outline/api/auth.info");
|
|
25
|
-
assert.equal(reverseProxy.baseUrl, "https://wiki.example.com/outline");
|
|
26
|
-
assert.ok(reverseProxy.corrections.includes("trimmed_path_after_api"));
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
test("buildProfile persists optional description and keywords metadata", () => {
|
|
30
|
-
const profile = buildProfile({
|
|
31
|
-
id: "acme-handbook",
|
|
32
|
-
name: "Acme Handbook",
|
|
33
|
-
description: "Tracking and campaign specs",
|
|
34
|
-
keywords: ["tracking", "campaign", "tracking", " event "],
|
|
35
|
-
baseUrl: "https://handbook.acme.example/doc/event-tracking-data-A7hLXuHZJl",
|
|
36
|
-
authType: "apiKey",
|
|
37
|
-
apiKey: "ol_api_example",
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
assert.equal(profile.description, "Tracking and campaign specs");
|
|
41
|
-
assert.deepEqual(profile.keywords, ["tracking", "campaign", "event"]);
|
|
42
|
-
assert.equal(profile.baseUrl, "https://handbook.acme.example");
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
test("suggestProfiles ranks profiles by keywords/description/host signals", () => {
|
|
46
|
-
const config = {
|
|
47
|
-
version: 1,
|
|
48
|
-
defaultProfile: "engineering",
|
|
49
|
-
profiles: {
|
|
50
|
-
engineering: {
|
|
51
|
-
name: "Engineering",
|
|
52
|
-
baseUrl: "https://wiki.example.com",
|
|
53
|
-
description: "Runbooks and incident policy",
|
|
54
|
-
keywords: ["incident", "runbook", "sre"],
|
|
55
|
-
auth: { type: "apiKey", apiKey: "ol_api_eng" },
|
|
56
|
-
},
|
|
57
|
-
marketing: {
|
|
58
|
-
name: "Acme Handbook",
|
|
59
|
-
baseUrl: "https://handbook.acme.example",
|
|
60
|
-
description: "Marketing campaign and event tracking handbook",
|
|
61
|
-
keywords: ["tracking", "campaign", "analytics"],
|
|
62
|
-
auth: { type: "apiKey", apiKey: "ol_api_marketing" },
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const result = suggestProfiles(config, "campaign tracking handbook", { limit: 2 });
|
|
68
|
-
assert.equal(result.matches.length, 2);
|
|
69
|
-
assert.equal(result.matches[0].id, "marketing");
|
|
70
|
-
assert.ok(result.matches[0].score > result.matches[1].score);
|
|
71
|
-
assert.ok(Array.isArray(result.matches[0].matchedOn));
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
test("getProfile can auto-select a strong read-only match when query context is provided", () => {
|
|
75
|
-
const config = {
|
|
76
|
-
version: 1,
|
|
77
|
-
profiles: {
|
|
78
|
-
engineering: {
|
|
79
|
-
name: "Engineering",
|
|
80
|
-
baseUrl: "https://wiki.example.com",
|
|
81
|
-
description: "Runbooks and incident policy",
|
|
82
|
-
keywords: ["incident", "runbook", "sre"],
|
|
83
|
-
auth: { type: "apiKey", apiKey: "ol_api_eng" },
|
|
84
|
-
},
|
|
85
|
-
marketing: {
|
|
86
|
-
name: "Acme Handbook",
|
|
87
|
-
baseUrl: "https://handbook.acme.example",
|
|
88
|
-
description: "Marketing campaign and event tracking handbook",
|
|
89
|
-
keywords: ["tracking", "campaign", "analytics"],
|
|
90
|
-
auth: { type: "apiKey", apiKey: "ol_api_marketing" },
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const selected = getProfile(config, undefined, {
|
|
96
|
-
query: "documents search incident runbook sre",
|
|
97
|
-
allowAutoSelect: true,
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
assert.equal(selected.id, "engineering");
|
|
101
|
-
assert.equal(selected.selection?.autoSelected, true);
|
|
102
|
-
assert.equal(selected.selection?.query, "documents search incident runbook sre");
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
test("suggestProfileMetadata can generate and enrich metadata from hints", () => {
|
|
106
|
-
const next = suggestProfileMetadata({
|
|
107
|
-
id: "acme-handbook",
|
|
108
|
-
name: "Acme Handbook",
|
|
109
|
-
baseUrl: "https://handbook.acme.example",
|
|
110
|
-
hints: [
|
|
111
|
-
"implement tracking collection for landing page",
|
|
112
|
-
"campaign detail page",
|
|
113
|
-
],
|
|
114
|
-
}, { maxKeywords: 12 });
|
|
115
|
-
|
|
116
|
-
assert.ok(next.description.includes("Acme Handbook"));
|
|
117
|
-
assert.ok(next.keywords.includes("tracking"));
|
|
118
|
-
assert.ok(next.keywords.includes("landing page"));
|
|
119
|
-
assert.ok(next.keywords.includes("campaign detail"));
|
|
120
|
-
assert.equal(next.generated.hintsUsed, 2);
|
|
121
|
-
});
|