ozmoz 0.1.38 → 0.1.39

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +1 -1
  2. package/package.json +1 -1
package/dist/cli.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var s=require("fs"),a=require("path"),W=require("https"),oe=require("http"),A=require("os"),{exec:re,spawnSync:_}=require("child_process"),se=[a.join(__dirname,"..","scripts","setup-lib.cjs"),a.join(__dirname,"..","..","scripts","setup-lib.cjs"),a.join(__dirname,"scripts","setup-lib.cjs")],ie=se.find(s.existsSync)||a.join(__dirname,"..","scripts","setup-lib.cjs"),{runFullSetup:Y,handleAuthAndEnv:K,touchTsConfig:ae,attemptViteAutoImportPatch:ce,injectUniversalRuntime:le,writeBrowserConfig:de,patchAllowScripts:ue}=require(ie),me=!!(process.stdout&&process.stdout.isTTY&&typeof process.stdout.hasColors=="function"&&process.stdout.hasColors(16777216)),pe=me?"\x1B[38;2;15;156;140m":"\x1B[36m",fe="\x1B[31m",q="\x1B[0m";function u(e){console.log(e.replace(/OZmoz|\[|\]|→/g,t=>`${pe}${t}${q}`))}function y(e){console.error(`${fe}${e}${q}`)}var x="ozmoz",G=/<!--\s*(?:ozmoz|fleetbo|OZmoz):start[^>]*-->[\s\S]*?<!--\s*(?:ozmoz|fleetbo|OZmoz):end\s*-->/i,he="<!-- OZmoz:end -->",H="# OZMOZ DATA OS \u2014 DIRECTIVES SYST\xC8ME",M={claude:"Claude Code",cursor:"Cursor",windsurf:"Windsurf",devin:"Devin",codex:"Codex CLI",gemini:"Gemini CLI",antigravity:"Antigravity CLI",copilot:"GitHub Copilot"},D={created:"created",updated:"updated",unchanged:"already up to date",appended:"OZmoz block appended (your own content was kept)",migrated:"old file replaced (backup: <file>.ozmoz-legacy.bak)",invalid:"skipped: the file is not valid JSON, fix or delete it first"};function ge(){try{return JSON.parse(s.readFileSync(a.join(__dirname,"..","package.json"),"utf8")).version||"dev"}catch{return"dev"}}var ye=Buffer.from("QUl6YVN5QUM1Uk94STNibklPMUR5TmZsTWhGUnJ0blItNDVwNFJF","base64").toString("utf8");function Oe(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1],"base64url").toString("utf8"));return typeof t.exp=="number"&&t.exp*1e3<Date.now()+6e4}catch{return!1}}async function ze(e,t){let r=await fetch(`https://securetoken.googleapis.com/v1/token?key=${ye}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`grant_type=refresh_token&refresh_token=${encodeURIComponent(t)}`});if(!r.ok)return null;let n=await r.json();return n.id_token?(s.writeFileSync(e,JSON.stringify({devToken:n.id_token,refreshToken:n.refresh_token||t,updatedAt:new Date().toISOString()},null,2)),n.id_token):null}async function X(){if(process.env.FLEETBO_DEV_TOKEN)return process.env.FLEETBO_DEV_TOKEN;try{let e=a.join(A.homedir(),".fleetbo","credentials.json");if(s.existsSync(e)){let t=JSON.parse(s.readFileSync(e,"utf8"));if(t.devToken&&!Oe(t.devToken))return t.devToken;if(t.refreshToken)try{let r=await ze(e,t.refreshToken);if(r)return r}catch{}}}catch{}return null}async function Q(){let e=a.join(A.homedir(),".fleetbo","guidelines.json"),t=await X();t||y('[OZmoz] Not logged in: run "npx ozmoz login" first to load the full instructions. Using local cache if available.');try{u(" [OZmoz] Fetching instructions from Cloud...");let r=await fetch("https://getagentdirectives-jqycakhlxa-uc.a.run.app",{method:"POST",headers:Object.assign({"Content-Type":"application/json"},t?{Authorization:`Bearer ${t}`}:{}),body:JSON.stringify({data:{}})});if(!r.ok)y(" [OZmoz] Cloud error HTTP "+r.status);else{let n=await r.json(),i=n.result?.data||n.result||n.data;if(i&&i.protocol&&i.directives)return u(" [OZmoz] Instructions loaded successfully."),s.existsSync(a.dirname(e))||s.mkdirSync(a.dirname(e),{recursive:!0}),s.writeFileSync(e,JSON.stringify(i,null,2),"utf8"),i;y("[OZmoz] Empty Cloud response.")}}catch(r){y("[OZmoz] Network error: "+r.message)}if(s.existsSync(e)){u("[OZmoz] Using local cache (~/.fleetbo/guidelines.json)");try{return JSON.parse(s.readFileSync(e,"utf8"))}catch{}}return{protocol:"",directives:"",version:"1.0.0"}}function J(e,t){return"<!-- ozmoz:start v"+e+` -->
2
+ var s=require("fs"),a=require("path"),W=require("https"),oe=require("http"),A=require("os"),{exec:re,spawnSync:_}=require("child_process"),se=[a.join(__dirname,"..","scripts","setup-lib.cjs"),a.join(__dirname,"..","..","scripts","setup-lib.cjs"),a.join(__dirname,"scripts","setup-lib.cjs")],ie=se.find(s.existsSync)||a.join(__dirname,"..","scripts","setup-lib.cjs"),{runFullSetup:Y,handleAuthAndEnv:K,touchTsConfig:ae,attemptViteAutoImportPatch:ce,injectUniversalRuntime:le,writeBrowserConfig:de,patchAllowScripts:ue}=require(ie),me=!!(process.stdout&&process.stdout.isTTY&&typeof process.stdout.hasColors=="function"&&process.stdout.hasColors(16777216)),pe=me?"\x1B[38;2;15;156;140m":"\x1B[36m",fe="\x1B[31m",q="\x1B[0m";function u(e){console.log(e.replace(/OZmoz|\[|\]|→/g,t=>`${pe}${t}${q}`))}function y(e){console.error(`${fe}${e}${q}`)}var x="ozmoz",G=/<!--\s*(?:ozmoz|fleetbo|OZmoz):start[^>]*-->[\s\S]*?<!--\s*(?:ozmoz|fleetbo|OZmoz):end\s*-->/i,he="<!-- OZmoz:end -->",H="# OZMOZ DATA OS \u2014 DIRECTIVES SYST\xC8ME",M={claude:"Claude Code",cursor:"Cursor",windsurf:"Windsurf",devin:"Devin",codex:"Codex CLI",gemini:"Gemini CLI",antigravity:"Antigravity CLI",copilot:"GitHub Copilot"},D={created:"created",updated:"updated",unchanged:"already up to date",appended:"OZmoz block appended (your own content was kept)",migrated:"old file replaced (backup: <file>.ozmoz-legacy.bak)",invalid:"skipped: the file is not valid JSON, fix or delete it first"};function ge(){try{return JSON.parse(s.readFileSync(a.join(__dirname,"..","package.json"),"utf8")).version||"dev"}catch{return"dev"}}var ye=Buffer.from("QUl6YVN5QUM1Uk94STNibklPMUR5TmZsTWhGUnJ0blItNDVwNFJF","base64").toString("utf8");function Oe(e){try{let t=JSON.parse(Buffer.from(e.split(".")[1],"base64url").toString("utf8"));return typeof t.exp=="number"&&t.exp*1e3<Date.now()+6e4}catch{return!1}}async function ze(e,t){let r=await fetch(`https://securetoken.googleapis.com/v1/token?key=${ye}`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`grant_type=refresh_token&refresh_token=${encodeURIComponent(t)}`});if(!r.ok)return null;let n=await r.json();return n.id_token?(s.writeFileSync(e,JSON.stringify({devToken:n.id_token,refreshToken:n.refresh_token||t,updatedAt:new Date().toISOString()},null,2)),n.id_token):null}async function X(){if(process.env.FLEETBO_DEV_TOKEN)return process.env.FLEETBO_DEV_TOKEN;try{let e=a.join(A.homedir(),".fleetbo","credentials.json");if(s.existsSync(e)){let t=JSON.parse(s.readFileSync(e,"utf8"));if(t.devToken&&!Oe(t.devToken))return t.devToken;if(t.refreshToken)try{let r=await ze(e,t.refreshToken);if(r)return r}catch{}}}catch{}return null}async function Q(){let e=a.join(A.homedir(),".fleetbo","guidelines.json"),t=await X();t||y('[OZmoz] Not logged in: run "npx ozmoz login" first to load the full instructions. Using local cache if available.');try{u("[OZmoz] Fetching instructions from Cloud...");let r=await fetch("https://getagentdirectives-jqycakhlxa-uc.a.run.app",{method:"POST",headers:Object.assign({"Content-Type":"application/json"},t?{Authorization:`Bearer ${t}`}:{}),body:JSON.stringify({data:{}})});if(!r.ok)y("[OZmoz] Cloud error HTTP "+r.status);else{let n=await r.json(),i=n.result?.data||n.result||n.data;if(i&&i.protocol&&i.directives)return u("[OZmoz] Instructions loaded successfully."),s.existsSync(a.dirname(e))||s.mkdirSync(a.dirname(e),{recursive:!0}),s.writeFileSync(e,JSON.stringify(i,null,2),"utf8"),i;y("[OZmoz] Empty Cloud response.")}}catch(r){y("[OZmoz] Network error: "+r.message)}if(s.existsSync(e)){u("[OZmoz] Using local cache (~/.fleetbo/guidelines.json)");try{return JSON.parse(s.readFileSync(e,"utf8"))}catch{}}return{protocol:"",directives:"",version:"1.0.0"}}function J(e,t){return"<!-- ozmoz:start v"+e+` -->
3
3
  `+t.trim()+`
4
4
  `+he+`
5
5
  `}function ve(e,t,r){let n=s.existsSync(e)?s.readFileSync(e,"utf8"):null,i,o;return n===null?(i="created",o=t):G.test(n)?(o=n.replace(G,()=>t.trimEnd()),i=o===n?"unchanged":"updated"):n.includes(H)?(i="migrated",o=t):(i="appended",o=n.replace(/\s*$/,`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ozmoz",
3
- "version": "0.1.38",
3
+ "version": "0.1.39",
4
4
  "description": "SDK and CLI for the oz.* data API and the <oz-*> web components.",
5
5
  "license": "UNLICENSED",
6
6
  "keywords": [