shiplightai 0.1.49 → 0.1.50

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/dist/cli.js CHANGED
@@ -1019,9 +1019,9 @@ Merged ${c.length} tests from ${p} shards into: ${g}`),await so(u,o),r&&En(c),t)
1019
1019
  `;for(let c of a)s+=`- ${c}
1020
1020
  `;s+=`
1021
1021
  </details>
1022
- `}return s}function En(e){let t=process.env.GITHUB_STEP_SUMMARY;if(!t){console.warn("Warning: $GITHUB_STEP_SUMMARY not set, skipping GitHub summary.");return}T.appendFileSync(t,ao(e)),console.log("GitHub step summary written.")}var lo=_(()=>{"use strict";Qr();oo()});var po,uo=_(()=>{"use strict";po="0.1.49"});var ho={};te(ho,{runTranspile:()=>$n});import*as Be from"path";import{glob as Pn}from"glob";async function $n(e){(e.includes("--help")||e.includes("-h"))&&(console.log("Usage: shiplight transpile [glob]"),console.log(""),console.log("Transpiles YAML test files to Playwright spec files (.yaml.spec.ts)."),console.log("Validates syntax and reports action coverage warnings."),console.log("Default glob: **/*.test.yaml"),console.log(""),console.log("Examples:"),console.log(" shiplight transpile # transpile all YAML tests"),console.log(' shiplight transpile "tests/**/*.test.yaml" # transpile specific directory'),console.log(" shiplight transpile tests/login.test.yaml # transpile a single file"),process.exit(0));let t=e[0]||"**/*.test.yaml",r=process.cwd(),o=await Pn(t,{cwd:r,ignore:["node_modules/**","*.yaml.spec.ts"]});o.length===0&&(console.log(`No files matched: ${t}`),process.exit(0));let i=0,n=0,s=0;for(let a of o.sort()){let c=Be.resolve(r,a),l=Or(c,{version:po});if(!l.valid){i++,console.log(`
1022
+ `}return s}function En(e){let t=process.env.GITHUB_STEP_SUMMARY;if(!t){console.warn("Warning: $GITHUB_STEP_SUMMARY not set, skipping GitHub summary.");return}T.appendFileSync(t,ao(e)),console.log("GitHub step summary written.")}var lo=_(()=>{"use strict";Qr();oo()});var po,uo=_(()=>{"use strict";po="0.1.50"});var ho={};te(ho,{runTranspile:()=>$n});import*as Be from"path";import{glob as Pn}from"glob";async function $n(e){(e.includes("--help")||e.includes("-h"))&&(console.log("Usage: shiplight transpile [glob]"),console.log(""),console.log("Transpiles YAML test files to Playwright spec files (.yaml.spec.ts)."),console.log("Validates syntax and reports action coverage warnings."),console.log("Default glob: **/*.test.yaml"),console.log(""),console.log("Examples:"),console.log(" shiplight transpile # transpile all YAML tests"),console.log(' shiplight transpile "tests/**/*.test.yaml" # transpile specific directory'),console.log(" shiplight transpile tests/login.test.yaml # transpile a single file"),process.exit(0));let t=e[0]||"**/*.test.yaml",r=process.cwd(),o=await Pn(t,{cwd:r,ignore:["node_modules/**","*.yaml.spec.ts"]});o.length===0&&(console.log(`No files matched: ${t}`),process.exit(0));let i=0,n=0,s=0;for(let a of o.sort()){let c=Be.resolve(r,a),l=Or(c,{version:po});if(!l.valid){i++,console.log(`
1023
1023
  \u2717 ${a}`);for(let u of l.errors)console.log(` ERROR: ${u}`);continue}s++;let p=Be.basename(l.specFile);if(l.warnings.length>0){n++,console.log(`\u26A0 ${a} \u2192 ${p}`);for(let u of l.warnings)console.log(` WARNING: ${u}`)}else console.log(`\u2713 ${a} \u2192 ${p}`)}console.log(`
1024
- ${o.length} file(s): ${s} transpiled, ${i} error(s), ${n} warning(s)`),process.exit(i>0?1:0)}var fo=_(()=>{"use strict";ct();uo()});var yo={};te(yo,{runInspect:()=>Mn});import*as Ge from"fs";import*as go from"path";async function Mn(e){(e.includes("--help")||e.includes("-h")||e.length===0)&&(console.log("Usage: shiplight inspect <file.test.yaml> [options]"),console.log(""),console.log("Parse a YAML test file and output the resulting TestFlow JSON."),console.log("Useful for verifying YAML \u2192 JSON conversion."),console.log(""),console.log("Options:"),console.log(" --pretty Pretty-print JSON (default)"),console.log(" --compact Compact JSON output"),console.log(" --stats Show statement statistics only"),console.log(""),console.log("Examples:"),console.log(" shiplight inspect tests/login.test.yaml"),console.log(" shiplight inspect tests/suite.test.yaml --stats"),console.log(" shiplight inspect tests/login.test.yaml --compact | jq ."),process.exit(e.length===0?1:0));let t=e.includes("--compact"),r=e.includes("--stats"),o=e.find(s=>!s.startsWith("--"));o||(console.error("Error: no file specified"),process.exit(1));let i=go.resolve(process.cwd(),o);Ge.existsSync(i)||(console.error(`Error: file not found: ${i}`),process.exit(1));let n=Ge.readFileSync(i,"utf-8");try{let s=we(n),a=L(n);if(r)In(a,s);else{let c={...s.test_case_id!==void 0?{test_case_id:s.test_case_id}:{},...s.name?{name:s.name}:{},testFlow:a};console.log(JSON.stringify(c,null,t?0:2))}}catch(s){console.error(`Error parsing ${o}: ${s.message}`),process.exit(1)}}function In(e,t){if(console.log(`File: ${t.name||"(unnamed)"}`),t.test_case_id!==void 0&&console.log(`Cloud ID: ${t.test_case_id}`),console.log(`Version: ${e.version||"unknown"}`),e.testGroup){let r=e.testGroup;console.log("Type: suite (testGroup)"),console.log(`Tests: ${r.tests.length}`);for(let o of r.tests){let i=o.skip?` [SKIP${typeof o.skip=="string"?`: ${o.skip}`:""}]`:"";console.log(` - ${o.name}: ${o.statements.length} statements${o.teardown?`, ${o.teardown.length} teardown`:""}${i}`)}r.beforeAll?.length&&console.log(`Hooks: beforeAll (${r.beforeAll.length})`),r.afterAll?.length&&console.log(`Hooks: afterAll (${r.afterAll.length})`),r.beforeEach?.length&&console.log(`Hooks: beforeEach (${r.beforeEach.length})`),r.afterEach?.length&&console.log(`Hooks: afterEach (${r.afterEach.length})`)}else{console.log("Type: single test"),console.log(`Goal: ${e.goal}`),e.url&&console.log(`URL: ${e.url}`),e.baseURL&&console.log(`Base URL: ${e.baseURL}`),console.log(`Statements: ${e.statements?.length??0}`),e.teardown?.length&&console.log(`Teardown: ${e.teardown.length}`);let r=mo(e.statements??[]);console.log(` DRAFT: ${r.drafts}, ACTION: ${r.actions}, STEP: ${r.steps}`)}}function mo(e){let t={drafts:0,actions:0,steps:0};for(let r of e)if(r.type==="DRAFT")t.drafts++;else if(r.type==="ACTION")t.actions++;else if(r.type==="STEP"){t.steps++;let o=mo(r.statements??[]);t.drafts+=o.drafts,t.actions+=o.actions,t.steps+=o.steps}return t}var wo=_(()=>{"use strict";se()});var bo=ko((hl,On)=>{On.exports={name:"shiplightai",version:"0.1.49",type:"module",description:"Shiplight CLI for running and debugging .test.yaml files",main:"dist/index.js",types:"dist/index.d.ts",bin:{shiplight:"dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/cjs/index.cjs",default:"./dist/index.js"},"./fixture":{types:"./dist/fixture.d.ts",import:"./dist/fixture.js",require:"./dist/cjs/fixture.cjs",default:"./dist/fixture.js"},"./debugger-pw":{types:"./dist/debugger-pw.d.ts",import:"./dist/debugger-pw.js",require:"./dist/cjs/debugger-pw.cjs",default:"./dist/debugger-pw.js"},"./reporter":{types:"./dist/reporter.d.ts",import:"./dist/reporter.js",require:"./dist/cjs/reporter.cjs",default:"./dist/reporter.js"}},files:["dist","!dist/**/*.map","README.md"],publishConfig:{registry:"https://registry.npmjs.org",access:"public"},scripts:{prebuild:"pnpm typecheck",build:"tsup",pack:"pnpm build && pnpm pack",clean:"rm -rf dist",dev:"tsup --watch",test:"playwright test","test:unit":"tsx --test 'src/**/*.test.ts'",typecheck:"tsc --noEmit"},dependencies:{"@ai-sdk/anthropic":"^3.0.1","@ai-sdk/google":"^3.0.1","@ai-sdk/google-vertex":"^4.0.1","@ai-sdk/openai":"^3.0.1","@ai-sdk/provider":"^3.0.1","@anthropic-ai/claude-agent-sdk":"^0.1.72","@babel/parser":"^7.28.5","@babel/plugin-transform-typescript":"^7.27.0","@google/genai":"^1.34.0","google-auth-library":"^10.0.0","@babel/preset-env":"^7.26.9","@babel/preset-typescript":"^7.27.0","@modelcontextprotocol/sdk":"^1.29.0",ai:"^6.0.3",axios:"^1.15.0",chalk:"^4.1.2",commander:"^11.0.0",dotenv:"^16.0.3",express:"^5.2.1","fs-extra":"^11.2.0",glob:"^13.0.0","html-to-text":"^9.0.5",open:"^10.1.0",openai:"^6.25.0",ora:"^5.4.1",otplib:"^13.4.0","p-retry":"^6.2.1",sharp:"^0.34.5",uuid:"^11.1.0",yaml:"^2.8.3",zod:"^3.22.0","zod-to-json-schema":"^3.24.6"},devDependencies:{"@playwright/test":"1.58.2","@types/express":"^4.17.21","@types/node":"^24.0.0","mcp-tools":"workspace:*","sdk-core":"workspace:*","sdk-internal":"workspace:*","shiplight-tools":"workspace:*","shiplight-types":"workspace:*","@loggia/common":"workspace:*",tsup:"^8.3.5",typescript:"5.5.4"},peerDependencies:{"@playwright/test":"1.58.2"},engines:{node:">=22.0.0"},keywords:["playwright","yaml","testing","automation","ai","shiplight","mcp"],author:"Shiplight",license:"MIT"}});import Ln from"dotenv";import*as M from"fs";import*as W from"path";import*as We from"os";import{execFileSync as Ao}from"child_process";var Eo="0.1.49",Po="https://registry.npmjs.org/shiplightai/latest",$o=3600*1e3,Mo=10080*60*1e3;function Ke(){return W.join(We.homedir(),".shiplight","version-check.json")}function Io(){return W.join(We.homedir(),".shiplight","npm-prefix.json")}function Oo(e=Io()){try{let r=M.readFileSync(e,"utf-8"),o=JSON.parse(r);if(typeof o.prefix=="string"&&typeof o.fetchedAt=="number"&&Date.now()-o.fetchedAt<Mo)return o.prefix}catch{}let t;try{t=Ao("npm",["config","get","prefix"],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return null}if(!t)return null;try{M.mkdirSync(W.dirname(e),{recursive:!0}),M.writeFileSync(e,JSON.stringify({prefix:t,fetchedAt:Date.now()}))}catch{}return t}function Tt(e={}){let t=e.scriptPath??process.argv[1],r=e.getPrefix??(()=>Oo()),o=e.warn??(s=>console.warn(s)),i=e.error??(s=>console.error(s)),n=e.exit??(s=>process.exit(s));try{if(!t)return;let s=r();if(!s)return;let a,c;try{a=M.realpathSync(t),c=M.realpathSync(s)}catch{return}if(a.startsWith(c+W.sep)){i(`
1024
+ ${o.length} file(s): ${s} transpiled, ${i} error(s), ${n} warning(s)`),process.exit(i>0?1:0)}var fo=_(()=>{"use strict";ct();uo()});var yo={};te(yo,{runInspect:()=>Mn});import*as Ge from"fs";import*as go from"path";async function Mn(e){(e.includes("--help")||e.includes("-h")||e.length===0)&&(console.log("Usage: shiplight inspect <file.test.yaml> [options]"),console.log(""),console.log("Parse a YAML test file and output the resulting TestFlow JSON."),console.log("Useful for verifying YAML \u2192 JSON conversion."),console.log(""),console.log("Options:"),console.log(" --pretty Pretty-print JSON (default)"),console.log(" --compact Compact JSON output"),console.log(" --stats Show statement statistics only"),console.log(""),console.log("Examples:"),console.log(" shiplight inspect tests/login.test.yaml"),console.log(" shiplight inspect tests/suite.test.yaml --stats"),console.log(" shiplight inspect tests/login.test.yaml --compact | jq ."),process.exit(e.length===0?1:0));let t=e.includes("--compact"),r=e.includes("--stats"),o=e.find(s=>!s.startsWith("--"));o||(console.error("Error: no file specified"),process.exit(1));let i=go.resolve(process.cwd(),o);Ge.existsSync(i)||(console.error(`Error: file not found: ${i}`),process.exit(1));let n=Ge.readFileSync(i,"utf-8");try{let s=we(n),a=L(n);if(r)In(a,s);else{let c={...s.test_case_id!==void 0?{test_case_id:s.test_case_id}:{},...s.name?{name:s.name}:{},testFlow:a};console.log(JSON.stringify(c,null,t?0:2))}}catch(s){console.error(`Error parsing ${o}: ${s.message}`),process.exit(1)}}function In(e,t){if(console.log(`File: ${t.name||"(unnamed)"}`),t.test_case_id!==void 0&&console.log(`Cloud ID: ${t.test_case_id}`),console.log(`Version: ${e.version||"unknown"}`),e.testGroup){let r=e.testGroup;console.log("Type: suite (testGroup)"),console.log(`Tests: ${r.tests.length}`);for(let o of r.tests){let i=o.skip?` [SKIP${typeof o.skip=="string"?`: ${o.skip}`:""}]`:"";console.log(` - ${o.name}: ${o.statements.length} statements${o.teardown?`, ${o.teardown.length} teardown`:""}${i}`)}r.beforeAll?.length&&console.log(`Hooks: beforeAll (${r.beforeAll.length})`),r.afterAll?.length&&console.log(`Hooks: afterAll (${r.afterAll.length})`),r.beforeEach?.length&&console.log(`Hooks: beforeEach (${r.beforeEach.length})`),r.afterEach?.length&&console.log(`Hooks: afterEach (${r.afterEach.length})`)}else{console.log("Type: single test"),console.log(`Goal: ${e.goal}`),e.url&&console.log(`URL: ${e.url}`),e.baseURL&&console.log(`Base URL: ${e.baseURL}`),console.log(`Statements: ${e.statements?.length??0}`),e.teardown?.length&&console.log(`Teardown: ${e.teardown.length}`);let r=mo(e.statements??[]);console.log(` DRAFT: ${r.drafts}, ACTION: ${r.actions}, STEP: ${r.steps}`)}}function mo(e){let t={drafts:0,actions:0,steps:0};for(let r of e)if(r.type==="DRAFT")t.drafts++;else if(r.type==="ACTION")t.actions++;else if(r.type==="STEP"){t.steps++;let o=mo(r.statements??[]);t.drafts+=o.drafts,t.actions+=o.actions,t.steps+=o.steps}return t}var wo=_(()=>{"use strict";se()});var bo=ko((hl,On)=>{On.exports={name:"shiplightai",version:"0.1.50",type:"module",description:"Shiplight CLI for running and debugging .test.yaml files",main:"dist/index.js",types:"dist/index.d.ts",bin:{shiplight:"dist/cli.js"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js",require:"./dist/cjs/index.cjs",default:"./dist/index.js"},"./fixture":{types:"./dist/fixture.d.ts",import:"./dist/fixture.js",require:"./dist/cjs/fixture.cjs",default:"./dist/fixture.js"},"./debugger-pw":{types:"./dist/debugger-pw.d.ts",import:"./dist/debugger-pw.js",require:"./dist/cjs/debugger-pw.cjs",default:"./dist/debugger-pw.js"},"./reporter":{types:"./dist/reporter.d.ts",import:"./dist/reporter.js",require:"./dist/cjs/reporter.cjs",default:"./dist/reporter.js"}},files:["dist","!dist/**/*.map","README.md"],publishConfig:{registry:"https://registry.npmjs.org",access:"public"},scripts:{prebuild:"pnpm typecheck",build:"tsup",pack:"pnpm build && pnpm pack",clean:"rm -rf dist",dev:"tsup --watch",test:"playwright test","test:unit":"tsx --test 'src/**/*.test.ts'",typecheck:"tsc --noEmit"},dependencies:{"@ai-sdk/anthropic":"^3.0.1","@ai-sdk/google":"^3.0.1","@ai-sdk/google-vertex":"^4.0.1","@ai-sdk/openai":"^3.0.1","@ai-sdk/provider":"^3.0.1","@anthropic-ai/claude-agent-sdk":"^0.1.72","@babel/parser":"^7.28.5","@babel/plugin-transform-typescript":"^7.27.0","@google/genai":"^1.34.0","google-auth-library":"^10.0.0","@babel/preset-env":"^7.26.9","@babel/preset-typescript":"^7.27.0","@modelcontextprotocol/sdk":"^1.29.0",ai:"^6.0.3",axios:"^1.15.0",chalk:"^4.1.2",commander:"^11.0.0",dotenv:"^16.0.3",express:"^5.2.1","fs-extra":"^11.2.0",glob:"^13.0.0","html-to-text":"^9.0.5",open:"^10.1.0",openai:"^6.25.0",ora:"^5.4.1",otplib:"^13.4.0","p-retry":"^6.2.1",sharp:"^0.34.5",uuid:"^11.1.0",yaml:"^2.8.3",zod:"^3.22.0","zod-to-json-schema":"^3.24.6"},devDependencies:{"@playwright/test":"1.58.2","@types/express":"^4.17.21","@types/node":"^24.0.0","mcp-tools":"workspace:*","sdk-core":"workspace:*","sdk-internal":"workspace:*","shiplight-tools":"workspace:*","shiplight-types":"workspace:*","@loggia/common":"workspace:*",tsup:"^8.3.5",typescript:"5.5.4"},peerDependencies:{"@playwright/test":"1.58.2"},engines:{node:">=22.0.0"},keywords:["playwright","yaml","testing","automation","ai","shiplight","mcp"],author:"Shiplight",license:"MIT"}});import Ln from"dotenv";import*as M from"fs";import*as W from"path";import*as We from"os";import{execFileSync as Ao}from"child_process";var Eo="0.1.50",Po="https://registry.npmjs.org/shiplightai/latest",$o=3600*1e3,Mo=10080*60*1e3;function Ke(){return W.join(We.homedir(),".shiplight","version-check.json")}function Io(){return W.join(We.homedir(),".shiplight","npm-prefix.json")}function Oo(e=Io()){try{let r=M.readFileSync(e,"utf-8"),o=JSON.parse(r);if(typeof o.prefix=="string"&&typeof o.fetchedAt=="number"&&Date.now()-o.fetchedAt<Mo)return o.prefix}catch{}let t;try{t=Ao("npm",["config","get","prefix"],{encoding:"utf-8",stdio:["ignore","pipe","ignore"]}).trim()}catch{return null}if(!t)return null;try{M.mkdirSync(W.dirname(e),{recursive:!0}),M.writeFileSync(e,JSON.stringify({prefix:t,fetchedAt:Date.now()}))}catch{}return t}function Tt(e={}){let t=e.scriptPath??process.argv[1],r=e.getPrefix??(()=>Oo()),o=e.warn??(s=>console.warn(s)),i=e.error??(s=>console.error(s)),n=e.exit??(s=>process.exit(s));try{if(!t)return;let s=r();if(!s)return;let a,c;try{a=M.realpathSync(t),c=M.realpathSync(s)}catch{return}if(a.startsWith(c+W.sep)){i(`
1025
1025
  shiplightai cannot be run from a global install.
1026
1026
  Global installs don't auto-update and cause version skew.
1027
1027