@sweny-ai/core 0.1.46 → 0.1.47

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.
@@ -196,4 +196,91 @@ describe("docs action code blocks", () => {
196
196
  allIssues.map((i) => ` ${i}`).join("\n"));
197
197
  }
198
198
  });
199
+ it("every swenyai/sweny@v5 code block has a workflow: input", () => {
200
+ const issues = [];
201
+ for (const f of ACTION_DOC_FILES) {
202
+ const filePath = resolve(ROOT, f);
203
+ if (!existsSync(filePath))
204
+ continue;
205
+ const content = readFileSync(filePath, "utf-8");
206
+ const blocks = content.match(/```ya?ml[\s\S]*?```/g) || [];
207
+ for (const block of blocks) {
208
+ if (!block.includes(`swenyai/sweny@${CURRENT_ACTION_VERSION}`))
209
+ continue;
210
+ if (!block.includes("workflow:")) {
211
+ issues.push(`${relative(ROOT, filePath)}: code block uses swenyai/sweny@${CURRENT_ACTION_VERSION} without workflow: input`);
212
+ }
213
+ }
214
+ }
215
+ if (issues.length > 0) {
216
+ expect.fail(`The generic runner requires a workflow: input.\n` + issues.map((i) => ` ${i}`).join("\n"));
217
+ }
218
+ });
219
+ });
220
+ // ─── 5. Internal doc links resolve ──────────────────────────────────
221
+ describe("docs internal links", () => {
222
+ const DOCS_ROOT = resolve(ROOT, "packages/web/src/content/docs");
223
+ /**
224
+ * Extract markdown links like [text](/path/) and verify the target exists.
225
+ * Only checks internal absolute links (starting with /).
226
+ */
227
+ function findBrokenLinks(filePath) {
228
+ if (!existsSync(filePath))
229
+ return [];
230
+ const content = readFileSync(filePath, "utf-8");
231
+ const broken = [];
232
+ // Match [text](/path/) and [text](/path/#anchor) but skip external URLs
233
+ const linkPattern = /\[([^\]]*)\]\(\/([^)#]*?)\/?\)/g;
234
+ let match;
235
+ while ((match = linkPattern.exec(content)) !== null) {
236
+ const linkPath = match[2];
237
+ // Map /action/ → action/index.md, /action/inputs/ → action/inputs.md
238
+ const candidates = [
239
+ resolve(DOCS_ROOT, linkPath, "index.md"),
240
+ resolve(DOCS_ROOT, linkPath, "index.mdx"),
241
+ resolve(DOCS_ROOT, `${linkPath}.md`),
242
+ resolve(DOCS_ROOT, `${linkPath}.mdx`),
243
+ ];
244
+ if (!candidates.some((c) => existsSync(c))) {
245
+ broken.push(`${relative(ROOT, filePath)}: broken link [${match[1]}](/${linkPath}/)`);
246
+ }
247
+ }
248
+ return broken;
249
+ }
250
+ const KEY_DOCS = [
251
+ "packages/web/src/content/docs/action/index.md",
252
+ "packages/web/src/content/docs/action/inputs.md",
253
+ "packages/web/src/content/docs/action/examples.md",
254
+ "packages/web/src/content/docs/action/scheduling.md",
255
+ "packages/web/src/content/docs/action/service-map.md",
256
+ "packages/web/src/content/docs/index.mdx",
257
+ "packages/web/src/content/docs/getting-started/quick-start.md",
258
+ ];
259
+ it("key action docs have no broken internal links", () => {
260
+ const allBroken = KEY_DOCS.flatMap((f) => findBrokenLinks(resolve(ROOT, f)));
261
+ if (allBroken.length > 0) {
262
+ expect.fail(`Found ${allBroken.length} broken link(s):\n` + allBroken.map((b) => ` ${b}`).join("\n"));
263
+ }
264
+ });
265
+ });
266
+ // ─── 6. Three-action architecture documented ────────────────────────
267
+ describe("three-action architecture", () => {
268
+ it("action/index.md documents all three actions", () => {
269
+ const content = readFileSync(resolve(ROOT, "packages/web/src/content/docs/action/index.md"), "utf-8");
270
+ expect(content).toContain("swenyai/triage@v1");
271
+ expect(content).toContain("swenyai/e2e@v1");
272
+ expect(content).toContain(`swenyai/sweny@${CURRENT_ACTION_VERSION}`);
273
+ });
274
+ it("action/inputs.md has sections for all three actions", () => {
275
+ const content = readFileSync(resolve(ROOT, "packages/web/src/content/docs/action/inputs.md"), "utf-8");
276
+ expect(content).toMatch(/## Generic runner inputs/);
277
+ expect(content).toMatch(/## Triage action inputs/);
278
+ expect(content).toMatch(/## E2E action inputs/);
279
+ });
280
+ it("README Actions table lists all three actions", () => {
281
+ const readme = readFileSync(resolve(ROOT, "README.md"), "utf-8");
282
+ expect(readme).toContain("swenyai/triage@v1");
283
+ expect(readme).toContain("swenyai/e2e@v1");
284
+ expect(readme).toContain(`swenyai/sweny@${CURRENT_ACTION_VERSION}`);
285
+ });
199
286
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sweny-ai/core",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "sweny": "./dist/cli/main.js"