@ampt/cli 1.2.0 → 1.3.2
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/build-loaders.mjs +11 -1
- package/dist/cli.js +1172 -167
- package/dist/cli.js.map +3 -3
- package/dist/ttyStub.js +1 -1
- package/dist/ttyStub.js.map +1 -1
- package/dist/webapi-polyfill.js +2 -2
- package/dist/webapi-polyfill.js.map +1 -1
- package/dist/workers/cli-update.js +1 -1
- package/dist/workers/cli-update.js.map +1 -1
- package/dist/workers/hash.js +1 -1
- package/dist/workers/hash.js.map +1 -1
- package/dist/workers/package-update.js +1 -1
- package/dist/workers/package-update.js.map +1 -1
- package/jest-md-transform.cjs +9 -0
- package/package.json +1 -1
- package/skills/ampt/SKILL.md +254 -0
- package/skills/ampt/cli-reference.md +199 -0
- package/skills/ampt/sdk-reference.md +541 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
var i=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},m=(t,e,a,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of u(e))!c.call(t,n)&&n!==a&&i(t,n,{get:()=>e[n],enumerable:!(r=f(e,n))||r.enumerable});return t};var g=t=>m(i({},"__esModule",{value:!0}),t);var k={};p(k,{default:()=>E});module.exports=g(k);var w=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};w.SENTRY_RELEASE={id:"1.3.2"};(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="f2a8737e-139d-4c46-9178-eedaf555e34d",t._sentryDebugIdIdentifier="sentry-dbid-f2a8737e-139d-4c46-9178-eedaf555e34d")}catch{}})();var o=require("worker_threads"),l=require("child_process");async function y(t,e=1e4){let a=`https://unpkg.com/${t}/package.json`;try{let r=new AbortController,n=setTimeout(()=>r.abort(),e),s=await fetch(a,{signal:r.signal});return clearTimeout(n),s.ok?(await s.json()).version:void 0}catch{return}}async function b(t=6e4){return new Promise((e,a)=>{let r=(0,l.spawn)("npm",["install","-g","@ampt/cli@latest"],{stdio:"ignore"}),n=setTimeout(()=>{r.kill(),a(new Error("npm install timed out"))},t);r.on("close",s=>{clearTimeout(n),s===0?e():a(new Error(`npm install failed with code ${s}`))}),r.on("error",s=>{clearTimeout(n),a(s)})})}o.parentPort.on("message",async({currentVersion:t})=>{try{let e=await y("@ampt/cli");if(!e){o.parentPort.postMessage({err:new Error("Failed to fetch latest version")});return}let a=t.split(".").map(Number),r=e.split(".").map(Number),n=!1;for(let s=0;s<3;s++)if(r[s]>a[s]){n=!0;break}else if(r[s]<a[s])break;if(!n){o.parentPort.postMessage({res:{hasUpdate:!1,currentVersion:t,latestVersion:e}});return}try{await b(),o.parentPort.postMessage({res:{hasUpdate:!0,currentVersion:t,latestVersion:e,installSuccess:!0}})}catch(s){o.parentPort.postMessage({res:{hasUpdate:!0,currentVersion:t,latestVersion:e,installSuccess:!1,installError:s.message}})}}catch(e){o.parentPort.postMessage({err:e})}});var d={};var E=d;
|
|
2
2
|
//# sourceMappingURL=cli-update.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/workers/cli-update.mjs", "../../_sentry-release-injection-stub", "sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=
|
|
3
|
+
"sources": ["../../src/workers/cli-update.mjs", "../../_sentry-release-injection-stub", "sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=fa7450a7-e9c0-434c-bd24-1c635db116d8", "../../src/workers/cli-update.mjs"],
|
|
4
4
|
"mappings": "4ZAAA,IAAAA,EAAA,GAAAC,EA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E,CAAC,CAE5D,CAAC,EAEDD,EAAW,GAAG,QAAUE,GAAQ,CAC9B,aAAaP,CAAS,EACtBI,EAAOG,CAAG,CACZ,CAAC,CACH,CAAC,CACH,CAEA,aAAW,GAAG,UAAW,MAAO,CAAE,eAAAC,CAAe,IAAM,CACrD,GAAI,CAEF,IAAMC,EAAgB,MAAMd,EAAmB,WAAW,EAE1D,GAAI,CAACc,EAAe,CAClB,aAAW,YAAY,CAAE,IAAK,IAAI,MAAM,gCAAgC,CAAE,CAAC,EAC3E,MACF,CAGA,IAAMC,EAAUF,EAAe,MAAM,GAAG,EAAE,IAAI,MAAM,EAC9CG,EAASF,EAAc,MAAM,GAAG,EAAE,IAAI,MAAM,EAE9CG,EAAY,GAChB,QAASC,EAAI,EAAGA,EAAI,EAAGA,IACrB,GAAIF,EAAOE,CAAC,EAAIH,EAAQG,CAAC,EAAG,CAC1BD,EAAY,GACZ,KACF,SAAWD,EAAOE,CAAC,EAAIH,EAAQG,CAAC,EAC9B,MAIJ,GAAI,CAACD,EAAW,CACd,aAAW,YAAY,CAAE,IAAK,CAAE,UAAW,GAAO,eAAAJ,EAAgB,cAAAC,CAAc,CAAE,CAAC,EACnF,MACF,CAGA,GAAI,CACF,MAAMP,EAAc,EACpB,aAAW,YAAY,CACrB,IAAK,CACH,UAAW,GACX,eAAAM,EACA,cAAAC,EACA,eAAgB,EAClB,CACF,CAAC,CACH,OAASK,EAAY,CACnB,aAAW,YAAY,CACrB,IAAK,CACH,UAAW,GACX,eAAAN,EACA,cAAAC,EACA,eAAgB,GAChB,aAAcK,EAAW,OAC3B,CACF,CAAC,CACH,CACF,OAASP,EAAK,CACZ,aAAW,YAAY,CAAE,IAAAA,CAAI,CAAC,CAChC,CACF,CAAC,EAMD,IAAOQ,EAAQ,CAAC,EH9GF,IAAOC,EAAuBA",
|
|
5
5
|
"names": ["cli_update_exports", "__export", "cli_update_default", "__toCommonJS", "_global", "e", "n", "import_worker_threads", "import_child_process", "fetchLatestVersion", "packageName", "timeout", "url", "controller", "timeoutId", "response", "installUpdate", "resolve", "reject", "npmProcess", "code", "err", "currentVersion", "latestVersion", "current", "latest", "hasUpdate", "i", "installErr", "cli_update_default", "cli_update_default"]
|
|
6
6
|
}
|
package/dist/workers/hash.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var q=Object.create;var p=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),C=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},M=(e,t,n,
|
|
1
|
+
var q=Object.create;var p=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var R=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty;var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var x=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),C=(e,t)=>{for(var n in t)p(e,n,{get:t[n],enumerable:!0})},M=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of P(t))!H.call(e,r)&&r!==n&&p(e,r,{get:()=>t[r],enumerable:!(a=L(t,r))||a.enumerable});return e};var b=(e,t,n)=>(n=e!=null?q(R(e)):{},M(t||!e||!e.__esModule?p(n,"default",{value:e,enumerable:!0}):n,e)),V=e=>M(p({},"__esModule",{value:!0}),e);var Y,f=B(()=>{Y=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Y.SENTRY_RELEASE={id:"1.3.2"}});var j=x((fe,d)=>{f();var E={};E.__wbindgen_placeholder__=d.exports;var o,{TextDecoder:G}=require("util"),I=new G("utf-8",{ignoreBOM:!0,fatal:!0});I.decode();var g=null;function h(){return(g===null||g.buffer!==o.memory.buffer)&&(g=new Uint8Array(o.memory.buffer)),g}function J(e,t){return I.decode(h().subarray(e,e+t))}var c=new Array(32).fill(void 0);c.push(void 0,null,!0,!1);var u=c.length;function K(e){u===c.length&&c.push(c.length+1);let t=u;return u=c[t],c[t]=e,t}var v=0;function A(e,t){let n=t(e.length*1);return h().set(e,n/1),v=e.length,n}var y=null;function l(){return(y===null||y.buffer!==o.memory.buffer)&&(y=new Int32Array(o.memory.buffer)),y}function O(e,t){return h().subarray(e/1,e/1+t)}d.exports.compress=function(e){try{let r=o.__wbindgen_add_to_stack_pointer(-16),s=A(e,o.__wbindgen_malloc),i=v;o.compress(r,s,i);var t=l()[r/4+0],n=l()[r/4+1],a=O(t,n).slice();return o.__wbindgen_free(t,n*1),a}finally{o.__wbindgen_add_to_stack_pointer(16)}};function Q(e){return c[e]}function X(e){e<36||(c[e]=u,u=e)}function Z(e){let t=Q(e);return X(e),t}d.exports.decompress=function(e){try{let i=o.__wbindgen_add_to_stack_pointer(-16),_=A(e,o.__wbindgen_malloc),m=v;o.decompress(i,_,m);var t=l()[i/4+0],n=l()[i/4+1],a=l()[i/4+2],r=l()[i/4+3];if(r)throw Z(a);var s=O(t,n).slice();return o.__wbindgen_free(t,n*1),s}finally{o.__wbindgen_add_to_stack_pointer(16)}};d.exports.__wbindgen_string_new=function(e,t){let n=J(e,t);return K(n)};var $=require("path").join(__dirname,"lz4_wasm_nodejs_bg.wasm"),ee=require("fs").readFileSync($),te=new WebAssembly.Module(ee),ne=new WebAssembly.Instance(te,E);o=ne.exports;d.exports.__wasm=o});var k=x((le,T)=>{f();T.exports=function(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var n=e.length;if(n<=1)return e;var a="";if(n>4&&e[3]==="\\"){var r=e[2];(r==="?"||r===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),a="//")}var s=e.split(/[/\\]+/);return t!==!1&&s[s.length-1]===""&&s.pop(),a+s.join("/")}});var se={};C(se,{default:()=>oe});module.exports=V(se);f();f();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3150d579-dc2f-4254-9563-a6fbacb8f8a7",e._sentryDebugIdIdentifier="sentry-dbid-3150d579-dc2f-4254-9563-a6fbacb8f8a7")}catch{}})();f();var D=b(require("crypto"),1),S=b(require("fs"),1),w=require("worker_threads"),W=b(j(),1),z=b(k(),1),F=require("path");w.parentPort.on("message",({workspaceRoot:e,task:t})=>{try{let n=[],a=t.map(r=>{let s=(0,z.default)(r);try{let i=(0,F.join)(e,s),_=S.default.readFileSync(i),m=W.default.compress(_),U=D.default.createHash("md5").update(_).digest("hex");return n.push(m.buffer),{normalizedPath:s,hash:U,data:m}}catch(i){if(i.code==="ENOENT")return{normalizedPath:s};throw i}});w.parentPort.postMessage({res:a},n)}catch(n){w.parentPort.postMessage({err:n})}});var N={};var oe=N;
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
normalize-path/index.js:
|
package/dist/workers/hash.js.map
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../_sentry-release-injection-stub", "../../../node_modules/lz4-wasm-nodejs/lz4_wasm_nodejs.js", "../../../node_modules/normalize-path/index.js", "../../src/workers/hash.mjs", "sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=
|
|
3
|
+
"sources": ["../../_sentry-release-injection-stub", "../../../node_modules/lz4-wasm-nodejs/lz4_wasm_nodejs.js", "../../../node_modules/normalize-path/index.js", "../../src/workers/hash.mjs", "sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=be03d449-ee78-429f-9bec-a05fc9f72208", "../../src/workers/hash.mjs"],
|
|
4
4
|
"mappings": "0oBAAA,IACQA,EADRC,EAAAC,EAAA,KACQF,EACF,OAAO,OAAW,IAChB,OACA,OAAO,OAAW,IAChB,OACA,OAAO,KAAS,IACd,KACA,CAAC,EAETA,E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s", "__commonJSMin", "exports", "module", "init_sentry_release_injection_stub", "imports", "wasm", "TextDecoder", "cachedTextDecoder", "cachegetUint8Memory0", "getUint8Memory0", "getStringFromWasm0", "ptr", "len", "heap", "heap_next", "addHeapObject", "obj", "idx", "WASM_VECTOR_LEN", "passArray8ToWasm0", "arg", "malloc", "cachegetInt32Memory0", "getInt32Memory0", "getArrayU8FromWasm0", "input", "retptr", "ptr0", "len0", "r0", "r1", "v1", "getObject", "dropObject", "takeObject", "ret", "r2", "r3", "arg0", "arg1", "path", "bytes", "wasmModule", "wasmInstance", "require_normalize_path", "__commonJSMin", "exports", "module", "init_sentry_release_injection_stub", "path", "stripTrailing", "len", "prefix", "ch", "segs", "hash_exports", "__export", "hash_default", "__toCommonJS", "init_sentry_release_injection_stub", "init_sentry_release_injection_stub", "n", "init_sentry_release_injection_stub", "import_crypto", "import_fs", "import_worker_threads", "import_lz4_wasm_nodejs", "import_normalize_path", "import_path", "workspaceRoot", "task", "transferList", "res", "filePath", "normalizedPath", "normalize", "fullPath", "contents", "fs", "data", "lz4", "hash", "crypto", "err", "hash_default", "hash_default"]
|
|
6
6
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var p=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var P=(e,n)=>{for(var s in n)p(e,s,{get:n[s],enumerable:!0})},N=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of I(n))!M.call(e,t)&&t!==s&&p(e,t,{get:()=>n[t],enumerable:!(a=O(n,t))||a.enumerable});return e};var _=e=>N(p({},"__esModule",{value:!0}),e);var T={};P(T,{default:()=>F});module.exports=_(T);var E=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};E.SENTRY_RELEASE={id:"1.2
|
|
1
|
+
var p=Object.defineProperty;var O=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var M=Object.prototype.hasOwnProperty;var P=(e,n)=>{for(var s in n)p(e,s,{get:n[s],enumerable:!0})},N=(e,n,s,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of I(n))!M.call(e,t)&&t!==s&&p(e,t,{get:()=>n[t],enumerable:!(a=O(n,t))||a.enumerable});return e};var _=e=>N(p({},"__esModule",{value:!0}),e);var T={};P(T,{default:()=>F});module.exports=_(T);var E=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};E.SENTRY_RELEASE={id:"1.3.2"};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="09500c71-2451-4060-92cd-a05b5519442d",e._sentryDebugIdIdentifier="sentry-dbid-09500c71-2451-4060-92cd-a05b5519442d")}catch{}})();var f=require("worker_threads"),d=require("fs"),g=require("path");async function J(e,n=5e3){let s=`https://unpkg.com/${e}/package.json`;try{let a=new AbortController,t=setTimeout(()=>a.abort(),n),r=await fetch(s,{signal:a.signal});return clearTimeout(t),r.ok?(await r.json()).version:void 0}catch{return}}function w(e){return parseInt(e.split(".")[0],10)}function S(e,n){let s=e.split(".").map(Number),a=n.split(".").map(Number);for(let t=0;t<3;t++){if(s[t]>a[t])return!0;if(s[t]<a[t])return!1}return!1}f.parentPort.on("message",async({packageJsonPath:e,nodeModulesPath:n,configDir:s})=>{try{let a=await d.promises.readFile(e,"utf-8"),t=JSON.parse(a),r=[];if(t.dependencies)for(let[o,i]of Object.entries(t.dependencies))o.startsWith("@ampt/")&&!o.includes("cli")&&!i.startsWith("file:")&&r.push({name:o,isDevDep:!1});if(t.devDependencies)for(let[o,i]of Object.entries(t.devDependencies))o.startsWith("@ampt/")&&!i.startsWith("file:")&&r.push({name:o,isDevDep:!0});let l=[];for(let{name:o,isDevDep:i}of r)try{let h=(0,g.join)(n,o,"package.json"),D=await d.promises.readFile(h,"utf-8"),u=JSON.parse(D).version,c=await J(o);if(!c)continue;let v=w(u),b=w(c),j=b>v&&b>1;S(c,u)&&l.push({name:o,currentVersion:u,latestVersion:c,isDevDep:i,majorChange:j})}catch{continue}let k=(0,g.join)(s,"package-updates-available.json"),m={packages:l,checkedAt:Date.now()};await d.promises.writeFile(k,JSON.stringify(m,null,2),"utf-8"),f.parentPort.postMessage({res:m})}catch(a){f.parentPort.postMessage({err:a})}});var y={};var F=y;
|
|
2
2
|
//# sourceMappingURL=package-update.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/workers/package-update.mjs", "../../_sentry-release-injection-stub", "sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=
|
|
3
|
+
"sources": ["../../src/workers/package-update.mjs", "../../_sentry-release-injection-stub", "sentry-debug-id-stub:_sentry-debug-id-injection-stub?sentry-module-id=0e2a77ce-1da0-4d8c-99cf-4809a03b73eb", "../../src/workers/package-update.mjs"],
|
|
4
4
|
"mappings": "4ZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GCCI,IAAII,EACF,OAAO,OAAW,IAChB,OACA,OAAO,OAAW,IAChB,OACA,OAAO,KAAS,IACd,KACA,CAAC,EAETA,EAAQ,eAAe,CAAC,GAAG,OAAO,GCVpC,UAAU,CAAC,GAAG,CAAC,IAAI,EAAe,OAAO,OAApB,IAA2B,OAAoB,OAAO,OAApB,IAA2B,OAAoB,OAAO,KAApB,IAAyB,KAAK,CAAC,EAAE,EAAG,IAAI,QAAO,MAAM,IAAI,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,EAAE,EAAE,gBAAgB,CAAC,EAAE,uCAAuC,EAAE,yBAAyB,mDAAmD,MAAS,CAAC,CAAC,GAAE,ECAnV,IAAAC,EAA2B,0BAC3BC,EAA+B,cAC/BC,EAAqB,gBAGrB,eAAeC,EAAmBC,EAAaC,EAAU,IAAM,CAC7D,IAAMC,EAAM,qBAAqBF,CAAW,gBAE5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d,EAAQ,WAAW,OAAO,GAC1Da,EAAa,KAAK,CAAE,KAAAC,EAAM,SAAU,EAAK,CAAC,EAMhD,IAAMC,EAAmB,CAAC,EAE1B,OAAW,CAAE,KAAAD,EAAM,SAAAE,CAAS,IAAKH,EAC/B,GAAI,CAEF,IAAMI,KAAc,QAAKT,EAAiBM,EAAM,cAAc,EACxDI,EAA0B,MAAM,EAAAP,SAAG,SAASM,EAAa,OAAO,EAEhEE,EADmB,KAAK,MAAMD,CAAuB,EACnB,QAGlCE,EAAgB,MAAM5B,EAAmBsB,CAAI,EAEnD,GAAI,CAACM,EACH,SAIF,IAAMC,EAAetB,EAAgBoB,CAAc,EAC7CG,EAAcvB,EAAgBqB,CAAa,EAC3CG,EAAcD,EAAcD,GAAgBC,EAAc,EAC9CrB,EAAmBmB,EAAeD,CAAc,GAGhEJ,EAAiB,KAAK,CACpB,KAAAD,EACA,eAAAK,EACA,cAAAC,EACA,SAAAJ,EACA,YAAAO,CACF,CAAC,CAEL,MAAc,CAEZ,QACF,CAIF,IAAMC,KAAY,QAAKf,EAAW,gCAAgC,EAC5DgB,EAAY,CAChB,SAAUV,EACV,UAAW,KAAK,IAAI,CACtB,EAEA,MAAM,EAAAJ,SAAG,UAAUa,EAAW,KAAK,UAAUC,EAAW,KAAM,CAAC,EAAG,OAAO,EAEzE,aAAW,YAAY,CAAE,IAAKA,CAAU,CAAC,CAC3C,OAASC,EAAK,CACZ,aAAW,YAAY,CAAE,IAAAA,CAAI,CAAC,CAChC,CACF,CAAC,EAID,IAAOC,EAAQ,CAAC,EH1HF,IAAOC,EAAuBA",
|
|
5
5
|
"names": ["package_update_exports", "__export", "package_update_default", "__toCommonJS", "_global", "import_worker_threads", "import_fs", "import_path", "fetchLatestVersion", "packageName", "timeout", "url", "controller", "timeoutId", "response", "getMajorVersion", "version", "versionGreaterThan", "v1", "v2", "parts1", "parts2", "i", "packageJsonPath", "nodeModulesPath", "configDir", "packageJsonContent", "fs", "packageJson", "amptPackages", "name", "outdatedPackages", "isDevDep", "packagePath", "installedPackageContent", "currentVersion", "latestVersion", "currentMajor", "latestMajor", "majorChange", "cacheFile", "cacheData", "err", "package_update_default", "package_update_default"]
|
|
6
6
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Mirrors the esbuild `.md` => `text` loader (see esbuild.mjs) so that
|
|
2
|
+
// `import skillMd from '../../skills/ampt/SKILL.md'` resolves to the file's
|
|
3
|
+
// raw contents as a string default export under Jest. Without this, Jest hands
|
|
4
|
+
// `.md` files to its default JS transform and chokes on the markdown.
|
|
5
|
+
module.exports = {
|
|
6
|
+
process(sourceText) {
|
|
7
|
+
return { code: `module.exports = ${JSON.stringify(sourceText)};` }
|
|
8
|
+
}
|
|
9
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: ampt
|
|
3
|
+
description: 'Use when working with Ampt cloud projects -- covers development workflows, debugging, deployment to stages, and parameter management with the Ampt SDK and CLI'
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Ampt Development Skills
|
|
7
|
+
|
|
8
|
+
Ampt is a cloud development platform where you write Node.js code (JavaScript/TypeScript) and Ampt automatically provisions and manages cloud infrastructure. No Terraform, no CloudFormation, no YAML configs.
|
|
9
|
+
|
|
10
|
+
**Project structure**: An Ampt project has a `package.json` with `@ampt/sdk` as a dependency. Static assets go in `static/`. Entry point is configured in package.json.
|
|
11
|
+
|
|
12
|
+
## Debugging with Ampt
|
|
13
|
+
|
|
14
|
+
### Interactive Sandbox
|
|
15
|
+
|
|
16
|
+
Run `ampt` (no arguments) to start a personal developer sandbox. Code changes sync in under 1 second. You get a unique public URL: `https://{unique-id}.ampt.app`.
|
|
17
|
+
|
|
18
|
+
From the interactive shell, commands drop the `ampt` prefix:
|
|
19
|
+
|
|
20
|
+
- `dev` -- start local dev server (requires `ampt:dev` script in package.json)
|
|
21
|
+
- `stop` -- stop dev server
|
|
22
|
+
- `import` / `export` -- move data in/out
|
|
23
|
+
- `deploy <stage>` -- deploy to a permanent stage
|
|
24
|
+
- `share` -- create a preview environment
|
|
25
|
+
|
|
26
|
+
### Logs
|
|
27
|
+
|
|
28
|
+
Use `ampt logs` to fetch and stream logs from your sandbox or a stage environment.
|
|
29
|
+
|
|
30
|
+
### Common Debugging Patterns
|
|
31
|
+
|
|
32
|
+
- **Static files not found in stages**: Static assets are NOT on the filesystem when deployed. Use `http.readStaticFile()` or `http.node.readStaticFile()` instead of `fs.readFile()`.
|
|
33
|
+
- **"Cannot use .listen()"**: Ampt manages the HTTP server. Do NOT call `.listen()` or `http.createServer()`. Use `http.node.use(app)` to mount your Express/framework app.
|
|
34
|
+
- **Timeout errors**: Default HTTP timeout is 29 seconds. Use `http.setTimeout(ms)` to change. For timeouts above 29s, response streaming must be enabled.
|
|
35
|
+
- **Data not appearing**: Each environment has isolated data. Sandbox data is separate from stage data. Use `ampt import` / `ampt export` to move data between environments.
|
|
36
|
+
|
|
37
|
+
## Developing with Ampt Services
|
|
38
|
+
|
|
39
|
+
### HTTP Interface
|
|
40
|
+
|
|
41
|
+
Mount any Node.js framework (Express, Fastify, Koa, etc.) without `.listen()`:
|
|
42
|
+
|
|
43
|
+
```javascript
|
|
44
|
+
import { http } from '@ampt/sdk'
|
|
45
|
+
import express from 'express'
|
|
46
|
+
|
|
47
|
+
const app = express()
|
|
48
|
+
app.get('/api/hello', (req, res) => res.json({ message: 'Hello!' }))
|
|
49
|
+
http.node.use(app)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
You can mount at a specific path prefix: `http.node.use("/api", app)`.
|
|
53
|
+
|
|
54
|
+
Custom error pages: `http.on(404, "404.html")`
|
|
55
|
+
|
|
56
|
+
For SPA routing, serve index.html as a fallback using `http.node.readStaticFile("index.html")`.
|
|
57
|
+
|
|
58
|
+
### REST API (@ampt/api)
|
|
59
|
+
|
|
60
|
+
A lightweight fetch-based API framework:
|
|
61
|
+
|
|
62
|
+
```javascript
|
|
63
|
+
import { api } from '@ampt/api'
|
|
64
|
+
const routes = api('public').router('/api')
|
|
65
|
+
|
|
66
|
+
routes.get('/users', async (event) => {
|
|
67
|
+
return event.status(200).body({ users: [] })
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
routes.post('/users', async (event) => {
|
|
71
|
+
const body = await event.request.body()
|
|
72
|
+
return event.status(201).body({ created: body })
|
|
73
|
+
})
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Dynamic params: `routes.get("/users/:id", handler)` -- access via `event.params.id`.
|
|
77
|
+
|
|
78
|
+
### Data (@ampt/data)
|
|
79
|
+
|
|
80
|
+
NoSQL database backed by DynamoDB:
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
import { data } from '@ampt/data'
|
|
84
|
+
|
|
85
|
+
await data.set('user:jane', { name: 'Jane', role: 'admin' })
|
|
86
|
+
const result = await data.get('user:jane')
|
|
87
|
+
await data.get('user:*') // all users (wildcard query)
|
|
88
|
+
await data.remove('user:jane')
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Key patterns: Use `namespace:key` format for collections (e.g., `user:jane`, `order:12345`).
|
|
92
|
+
|
|
93
|
+
Labels (up to 5 per item) enable secondary access patterns:
|
|
94
|
+
|
|
95
|
+
```javascript
|
|
96
|
+
await data.set('order:123', orderData, { label1: 'status:pending' })
|
|
97
|
+
await data.getByLabel('label1', 'status:pending') // query by label
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
See `sdk-reference.md` for full query syntax, batch operations, atomic counters, and event handlers.
|
|
101
|
+
|
|
102
|
+
### Storage (@ampt/sdk)
|
|
103
|
+
|
|
104
|
+
File storage with bucket organization:
|
|
105
|
+
|
|
106
|
+
```javascript
|
|
107
|
+
import { storage } from '@ampt/sdk'
|
|
108
|
+
const files = storage('uploads')
|
|
109
|
+
|
|
110
|
+
await files.write('/docs/report.pdf', buffer)
|
|
111
|
+
const stream = await files.read('/docs/report.pdf')
|
|
112
|
+
const url = await files.getDownloadUrl('/docs/report.pdf')
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Public bucket served via CDN at `/public` route:
|
|
116
|
+
|
|
117
|
+
```javascript
|
|
118
|
+
const pub = storage('public')
|
|
119
|
+
await pub.write('/logo.svg', svgData, { maxAge: 3600 })
|
|
120
|
+
// Accessible at https://[url].ampt.app/public/logo.svg
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Events and Tasks
|
|
124
|
+
|
|
125
|
+
**Events** -- async message passing with at-least-once delivery:
|
|
126
|
+
|
|
127
|
+
```javascript
|
|
128
|
+
import { events } from '@ampt/sdk'
|
|
129
|
+
events.publish('user.joined', { userId: '123' })
|
|
130
|
+
events.on('user.joined', async (event) => {
|
|
131
|
+
/* handle */
|
|
132
|
+
})
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
**Tasks** -- scheduled and periodic execution:
|
|
136
|
+
|
|
137
|
+
```javascript
|
|
138
|
+
import { task } from '@ampt/sdk'
|
|
139
|
+
const cleanup = task('cleanup', async () => {
|
|
140
|
+
/* ... */
|
|
141
|
+
})
|
|
142
|
+
cleanup.every('1 hour')
|
|
143
|
+
cleanup.cron('0 0 ? * MON *') // every Monday at midnight
|
|
144
|
+
await cleanup.run({ immediate: true }) // one-off
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### WebSockets
|
|
148
|
+
|
|
149
|
+
```javascript
|
|
150
|
+
import { ws } from '@ampt/sdk'
|
|
151
|
+
ws.on('connected', (conn) => conn.send('Welcome!'))
|
|
152
|
+
ws.on('message', (conn, data) => ws.send(conn.connectionId, data))
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
See `sdk-reference.md` for detailed API reference on all modules.
|
|
156
|
+
|
|
157
|
+
## Deploying New Stages
|
|
158
|
+
|
|
159
|
+
### Permanent Stages
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
ampt deploy prod # deploy to "prod" stage
|
|
163
|
+
ampt deploy staging # deploy to "staging" stage
|
|
164
|
+
ampt deploy dev # deploy to "dev" stage
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
Each stage is fully isolated with its own data, storage, params, and URL. Region is locked once created.
|
|
168
|
+
|
|
169
|
+
### Preview Environments
|
|
170
|
+
|
|
171
|
+
```bash
|
|
172
|
+
ampt share # random name, auto-expires
|
|
173
|
+
ampt share my-preview # named preview
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Preview environments include both code AND data from your sandbox -- useful for QA review.
|
|
177
|
+
|
|
178
|
+
### Region Selection
|
|
179
|
+
|
|
180
|
+
Available regions: `us-east-1`, `us-west-2`, `eu-west-1`, `eu-west-2`, `eu-central-1`, `ap-northeast-1`, `sa-east-1`
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
ampt deploy prod --region eu-west-1
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Region cannot be changed after environment creation. Region hierarchy: Org default -> App default -> CLI flag.
|
|
187
|
+
|
|
188
|
+
### CI/CD
|
|
189
|
+
|
|
190
|
+
Deploy from CI pipelines:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
ampt deploy prod --org my-org --app my-app
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Use `--org` and `--app` flags in non-interactive environments.
|
|
197
|
+
|
|
198
|
+
## Setting Parameters
|
|
199
|
+
|
|
200
|
+
### CLI Parameter Management
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
ampt params get # list all params
|
|
204
|
+
ampt params get MY_KEY # get specific param
|
|
205
|
+
ampt params set MY_KEY value # set param
|
|
206
|
+
ampt params set MY_KEY value --description "API key for service X"
|
|
207
|
+
ampt params delete MY_KEY # delete param
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### SDK Usage in Code
|
|
211
|
+
|
|
212
|
+
```javascript
|
|
213
|
+
import { params } from '@ampt/sdk'
|
|
214
|
+
|
|
215
|
+
const apiKey = params('API_KEY')
|
|
216
|
+
const allParams = params().list()
|
|
217
|
+
|
|
218
|
+
// Export to process.env (avoid for secrets)
|
|
219
|
+
params().export()
|
|
220
|
+
|
|
221
|
+
// Parameter groups
|
|
222
|
+
const aws = params().group('AWS')
|
|
223
|
+
const region = aws('REGION')
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Scoping
|
|
227
|
+
|
|
228
|
+
Parameters follow a three-tier hierarchy:
|
|
229
|
+
|
|
230
|
+
1. **Organization** -- applies to all apps in the org
|
|
231
|
+
2. **App** -- applies to all environments of the app
|
|
232
|
+
3. **Environment** -- overrides inherited values for a specific stage
|
|
233
|
+
|
|
234
|
+
### Reserved Parameters (auto-populated)
|
|
235
|
+
|
|
236
|
+
| Parameter | Description |
|
|
237
|
+
| ------------- | ----------------- |
|
|
238
|
+
| `APP_NAME` | Application name |
|
|
239
|
+
| `ENV_NAME` | Environment name |
|
|
240
|
+
| `AMPT_URL` | Application URL |
|
|
241
|
+
| `AMPT_REGION` | Deployment region |
|
|
242
|
+
| `AMPT_STAGE` | Stage name |
|
|
243
|
+
| `ORG_NAME` | Organization name |
|
|
244
|
+
|
|
245
|
+
## Key Constraints
|
|
246
|
+
|
|
247
|
+
- **HTTP timeout**: 29s default, configurable with `http.setTimeout()`, streaming required above 29s
|
|
248
|
+
- **Storage API**: 6MB payload limit through API endpoints; use HTTP PUT with upload URLs for larger files
|
|
249
|
+
- **Data batch ops**: Max 25 items per batch get/set/remove
|
|
250
|
+
- **Data query results**: Max 1000 records or 1MB per request
|
|
251
|
+
- **Task timeout**: 30s default; max varies by plan (30s Preview, 1hr Developer/Team, 4hr Enterprise)
|
|
252
|
+
- **Event retry**: Failed events retry every 6 minutes for up to 14 days
|
|
253
|
+
- **WebSocket limits**: Sandbox: 10 concurrent/10 msg/s; Stage: 5000 concurrent/10000 msg/s
|
|
254
|
+
- **Task names**: Max 64 characters, must be unique
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# Ampt CLI Reference
|
|
2
|
+
|
|
3
|
+
Complete command reference for the Ampt CLI.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g @ampt/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires Node.js v18+.
|
|
12
|
+
|
|
13
|
+
## Authentication
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
ampt login # Opens browser for authentication (device confirmation code, valid 15 min)
|
|
17
|
+
ampt logout # Removes session
|
|
18
|
+
ampt whoami # Shows current user info
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Interactive Development
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ampt # Start interactive sandbox (personal dev environment)
|
|
25
|
+
ampt --seed # Start sandbox and seed data from data file
|
|
26
|
+
ampt --reseed # Auto-reseed data when data file changes
|
|
27
|
+
ampt --org my-org # Specify organization
|
|
28
|
+
ampt --app my-app # Specify application
|
|
29
|
+
ampt --region us-west-2 # Specify region for new environments
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Once in the interactive shell, commands drop the `ampt` prefix:
|
|
33
|
+
|
|
34
|
+
| Shell Command | Description |
|
|
35
|
+
| ----------------- | ----------------------------------------------------------------- |
|
|
36
|
+
| `dev` | Start local dev server (runs `ampt:dev` script from package.json) |
|
|
37
|
+
| `stop` | Stop running dev server |
|
|
38
|
+
| `deploy <stage>` | Deploy sandbox to permanent stage |
|
|
39
|
+
| `share [name]` | Create preview environment |
|
|
40
|
+
| `import [file]` | Import data (default: data.json) |
|
|
41
|
+
| `export [file]` | Export data |
|
|
42
|
+
| `install [pkg]` | Install npm packages |
|
|
43
|
+
| `uninstall [pkg]` | Remove npm packages |
|
|
44
|
+
| `url` | Show current environment URL |
|
|
45
|
+
| `open` | Open dashboard in browser |
|
|
46
|
+
| `docs` | Open Ampt docs |
|
|
47
|
+
| `help` | Show help |
|
|
48
|
+
| `clear` | Clear terminal |
|
|
49
|
+
| `quit` / `exit` | Exit shell |
|
|
50
|
+
|
|
51
|
+
## Deployment
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
ampt deploy <stage> # Deploy to permanent stage
|
|
55
|
+
ampt deploy prod # Deploy to production
|
|
56
|
+
ampt deploy staging --region eu-west-1 # Deploy with specific region
|
|
57
|
+
ampt deploy prod --container # Lambda container packaging (beta)
|
|
58
|
+
ampt deploy prod --org my-org --app my-app # Non-interactive (CI/CD)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Available Regions
|
|
62
|
+
|
|
63
|
+
`us-east-1`, `us-west-2`, `eu-west-1`, `eu-west-2`, `eu-central-1`, `ap-northeast-1`, `sa-east-1`
|
|
64
|
+
|
|
65
|
+
Region is locked once an environment is created. To change region, create a new environment.
|
|
66
|
+
|
|
67
|
+
## Preview Environments
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
ampt share # Create with random name (auto-expires)
|
|
71
|
+
ampt share my-preview # Create with specific name
|
|
72
|
+
ampt share --container # Lambda container packaging
|
|
73
|
+
ampt share --region us-west-2 # Specific region
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Preview environments contain both code AND data from your sandbox.
|
|
77
|
+
|
|
78
|
+
## Parameter Management
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
ampt params get # List all parameters
|
|
82
|
+
ampt params get API_KEY # Show specific parameter
|
|
83
|
+
ampt params set API_KEY sk-abc123 # Set parameter value
|
|
84
|
+
ampt params set API_KEY value --description "My API key" # Set with description
|
|
85
|
+
ampt params delete API_KEY # Delete parameter
|
|
86
|
+
ampt params delete API_KEY --yes # Delete without confirmation
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Parameters are encrypted at rest and in transit. Changes take effect instantly without restarts.
|
|
90
|
+
|
|
91
|
+
## Data Management
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
ampt import # Import from data.json
|
|
95
|
+
ampt import mydata.json # Import from specific file
|
|
96
|
+
ampt import --overwrite # Overwrite existing data
|
|
97
|
+
|
|
98
|
+
ampt export # Export to data.json
|
|
99
|
+
ampt export mydata.json # Export to specific file
|
|
100
|
+
ampt export --overwrite # Overwrite existing file
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Package Management
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
ampt install # Install all dependencies (npm install)
|
|
107
|
+
ampt install express # Install package (npm install --save)
|
|
108
|
+
ampt install vitest --dev # Install dev dependency (npm install --save-dev)
|
|
109
|
+
ampt uninstall express # Remove package
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Scripts
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
ampt run <script> # Run ampt:<script> from package.json
|
|
116
|
+
ampt run ./scripts/migrate.js # Run a script file directly
|
|
117
|
+
ampt run migrate --env staging # Run against specific environment
|
|
118
|
+
ampt run migrate -- --if-present -- script-arg # Pass args to npm and script
|
|
119
|
+
ampt dev # Alias for "ampt run dev"
|
|
120
|
+
ampt build # Alias for "ampt run build"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Scripts in package.json use the `ampt:` prefix:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"scripts": {
|
|
128
|
+
"ampt:dev": "next dev",
|
|
129
|
+
"ampt:build": "next build",
|
|
130
|
+
"ampt:migrate": "node scripts/migrate.js"
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
## Environment Management
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
ampt stages # List all stages
|
|
139
|
+
ampt delete <stage> # Delete a stage environment
|
|
140
|
+
ampt url # Show current environment URL
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Logs
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
ampt logs # Fetch and stream logs from current environment
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Other Commands
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
ampt version # Show CLI version
|
|
153
|
+
ampt help # Show help
|
|
154
|
+
ampt open # Open dashboard in browser
|
|
155
|
+
ampt docs # Open documentation
|
|
156
|
+
ampt clone # Clone an existing Ampt app
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Configuration
|
|
160
|
+
|
|
161
|
+
### package.json Ampt Config
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
{
|
|
165
|
+
"ampt": {
|
|
166
|
+
"org": "my-org",
|
|
167
|
+
"app": "my-app",
|
|
168
|
+
"static": ["static", "public-assets"],
|
|
169
|
+
"ignore": ["tests/**", "docs/**"]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Static Assets
|
|
175
|
+
|
|
176
|
+
Files in `static/` directory are served automatically. Additional directories can be configured in package.json under `ampt.static`. The `/public` route is reserved for the storage public bucket.
|
|
177
|
+
|
|
178
|
+
### Node.js Version
|
|
179
|
+
|
|
180
|
+
Supported: v18.x, v20.x, v22.x (default). Configure in package.json:
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"engines": {
|
|
185
|
+
"node": "20.x"
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## CI/CD Integration
|
|
191
|
+
|
|
192
|
+
For non-interactive CI/CD pipelines, use flags to skip prompts:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
ampt login # Auth first (uses browser redirect)
|
|
196
|
+
ampt deploy prod --org my-org --app my-app # Deploy with explicit org/app
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Use `--org` and `--app` flags to avoid interactive prompts in automated environments.
|