@justfortytwo/installer 1.0.0-7 → 1.0.0-8
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/README.md +2 -1
- package/dist/shim.d.ts +1 -1
- package/dist/shim.d.ts.map +1 -1
- package/dist/shim.js +9 -2
- package/dist/shim.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,7 +35,8 @@ working after `npx` exits:
|
|
|
35
35
|
The launcher holds no version and no project path. It finds the Fortytwo project
|
|
36
36
|
you are in (the nearest directory, from the current one upward, that contains
|
|
37
37
|
`.fortytwo/`) and runs that project's own `node_modules/.bin/fortytwo` from the
|
|
38
|
-
project root
|
|
38
|
+
project root (only if you own that project's `.fortytwo/` and CLI, so code
|
|
39
|
+
another user plants in a shared directory such as `/tmp` is never run), so several projects can sit side by side on different versions.
|
|
39
40
|
Outside a project it exits with an error and runs nothing. It is one shared
|
|
40
41
|
file, refreshed on every `init`, and it never replaces a `fortytwo` it did not
|
|
41
42
|
write. If no directory on your `PATH` is writable, `init` says so and tells you to
|
package/dist/shim.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Identifies a launcher we wrote, so we only ever replace our own file. */
|
|
2
2
|
export declare const SHIM_MARKER = "fortytwo-shim";
|
|
3
|
-
export declare const SHIM_SCRIPT = "#!/bin/sh\n# fortytwo \u2014 user-level launcher installed by @justfortytwo/installer (fortytwo-shim
|
|
3
|
+
export declare const SHIM_SCRIPT = "#!/bin/sh\n# fortytwo \u2014 user-level launcher installed by @justfortytwo/installer (fortytwo-shim v2).\n# It holds no version and no project path. It finds the Fortytwo project you are\n# in (the nearest directory, from here upward, that contains .fortytwo/) and runs\n# that project's own CLI, node_modules/.bin/fortytwo, from the project root \u2014\n# only if both are owned by you.\n# Safe to delete: `npx @justfortytwo/installer init` puts it back.\nd=$(pwd -P) || exit 1\nwhile :; do\n if [ -d \"$d/.fortytwo\" ]; then\n if [ -x \"$d/node_modules/.bin/fortytwo\" ]; then\n # Only run code you own: a .fortytwo/ or CLI planted by another user (e.g.\n # in a shared /tmp above you) is refused, never executed.\n if [ ! -O \"$d/.fortytwo\" ] || [ ! -O \"$d/node_modules/.bin/fortytwo\" ]; then\n echo \"fortytwo: refusing to run $d/node_modules/.bin/fortytwo: it or $d/.fortytwo is not owned by you.\" >&2\n exit 1\n fi\n cd \"$d\" && exec \"$d/node_modules/.bin/fortytwo\" \"$@\"\n fi\n echo \"fortytwo: $d is a Fortytwo project, but its CLI is not installed there.\" >&2\n echo \"Install it with: (cd \\\"$d\\\" && npm install @justfortytwo/installer)\" >&2\n exit 1\n fi\n [ \"$d\" = / ] && break\n d=$(dirname \"$d\")\ndone\necho \"fortytwo: not inside a Fortytwo project (no .fortytwo/ here or in any parent directory).\" >&2\necho \"Create one with: npx @justfortytwo/installer init\" >&2\nexit 1\n";
|
|
4
4
|
export type ShimResult = {
|
|
5
5
|
status: 'installed' | 'updated' | 'unchanged';
|
|
6
6
|
path: string;
|
package/dist/shim.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../src/shim.ts"],"names":[],"mappings":"AAmBA,4EAA4E;AAC5E,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"shim.d.ts","sourceRoot":"","sources":["../src/shim.ts"],"names":[],"mappings":"AAmBA,4EAA4E;AAC5E,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAE3C,eAAO,MAAM,WAAW,i8CA6BvB,CAAC;AAEF,MAAM,MAAM,UAAU,GAClB;IAAE,MAAM,EAAE,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACjE,+FAA+F;GAC7F;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE;AACrC,sDAAsD;GACpD;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GACpB;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEhD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,iFAAiF;IACjF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAM/C;AAMD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAItD;AAED,+DAA+D;AAC/D,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQvE;AAYD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAYzD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,UAAU,CA4BpD;AAED,8FAA8F;AAC9F,wBAAgB,YAAY,IAAI,MAAM,GAAG,IAAI,CAI5C"}
|
package/dist/shim.js
CHANGED
|
@@ -18,15 +18,22 @@ import { delimiter, join, resolve } from 'node:path';
|
|
|
18
18
|
/** Identifies a launcher we wrote, so we only ever replace our own file. */
|
|
19
19
|
export const SHIM_MARKER = 'fortytwo-shim';
|
|
20
20
|
export const SHIM_SCRIPT = `#!/bin/sh
|
|
21
|
-
# fortytwo — user-level launcher installed by @justfortytwo/installer (${SHIM_MARKER}
|
|
21
|
+
# fortytwo — user-level launcher installed by @justfortytwo/installer (${SHIM_MARKER} v2).
|
|
22
22
|
# It holds no version and no project path. It finds the Fortytwo project you are
|
|
23
23
|
# in (the nearest directory, from here upward, that contains .fortytwo/) and runs
|
|
24
|
-
# that project's own CLI, node_modules/.bin/fortytwo, from the project root
|
|
24
|
+
# that project's own CLI, node_modules/.bin/fortytwo, from the project root —
|
|
25
|
+
# only if both are owned by you.
|
|
25
26
|
# Safe to delete: \`npx @justfortytwo/installer init\` puts it back.
|
|
26
27
|
d=$(pwd -P) || exit 1
|
|
27
28
|
while :; do
|
|
28
29
|
if [ -d "$d/.fortytwo" ]; then
|
|
29
30
|
if [ -x "$d/node_modules/.bin/fortytwo" ]; then
|
|
31
|
+
# Only run code you own: a .fortytwo/ or CLI planted by another user (e.g.
|
|
32
|
+
# in a shared /tmp above you) is refused, never executed.
|
|
33
|
+
if [ ! -O "$d/.fortytwo" ] || [ ! -O "$d/node_modules/.bin/fortytwo" ]; then
|
|
34
|
+
echo "fortytwo: refusing to run $d/node_modules/.bin/fortytwo: it or $d/.fortytwo is not owned by you." >&2
|
|
35
|
+
exit 1
|
|
36
|
+
fi
|
|
30
37
|
cd "$d" && exec "$d/node_modules/.bin/fortytwo" "$@"
|
|
31
38
|
fi
|
|
32
39
|
echo "fortytwo: $d is a Fortytwo project, but its CLI is not installed there." >&2
|
package/dist/shim.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shim.js","sourceRoot":"","sources":["../src/shim.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,qEAAqE;AACrE,6EAA6E;AAC7E,6EAA6E;AAC7E,0EAA0E;AAC1E,8EAA8E;AAC9E,6EAA6E;AAC7E,2CAA2C;AAC3C,EAAE;AACF,6EAA6E;AAC7E,mEAAmE;AAEnE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SA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QAAQ,EAAE,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IACrE,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACzD,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC7C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@justfortytwo/installer",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-8",
|
|
4
4
|
"description": "All-in-one installer and lifecycle CLI for fortytwo — scaffolds the persona surface and provisions the npm engine (memory MCP, safety gate, channel adapters, embedder).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|