@skaft/octet 0.0.0 → 0.8.1
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/LICENSE +21 -0
- package/README.md +21 -2
- package/bin/octet +26 -0
- package/bin/octet-host +25 -0
- package/lib/launch.sh +117 -0
- package/package.json +17 -13
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Achuthan Mukundan and Skaft Software contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# octet npm launcher
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@skaft/octet` is a small, shell-only launcher for the native octet
|
|
4
|
+
runtime. npm selects one exact-version platform package through
|
|
5
|
+
`optionalDependencies`; the normal `octet` and `octet-host` paths immediately `exec`
|
|
6
|
+
the selected native binary.
|
|
7
|
+
|
|
8
|
+
These scoped names are source packaging identities, not proof of registry rights
|
|
9
|
+
or availability. Use the installation command only after an authorized release
|
|
10
|
+
has published the packages.
|
|
11
|
+
|
|
12
|
+
The launcher does not run Node, access the network, download an archive, or
|
|
13
|
+
execute an install lifecycle hook. Install it with scripts, audit, and funding
|
|
14
|
+
requests disabled:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
npm install --global --ignore-scripts --no-audit --no-fund @skaft/octet@0.8.1
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
GNU/Linux uses the glibc x64 package. macOS uses the arm64 or x64 package that
|
|
21
|
+
matches the running executable. `octet doctor` reports a missing `rg`
|
|
22
|
+
prerequisite.
|
package/bin/octet
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
# npm may expose bin/octet through a symlink in its global bin directory. Resolve
|
|
5
|
+
# that link without changing the caller's cwd before handing off to the common
|
|
6
|
+
# shell-only launcher.
|
|
7
|
+
script=$0
|
|
8
|
+
case "$script" in
|
|
9
|
+
/*) ;;
|
|
10
|
+
*) script=$(pwd -P)/$script ;;
|
|
11
|
+
esac
|
|
12
|
+
while [ -L "$script" ]; do
|
|
13
|
+
link=$(readlink "$script") || {
|
|
14
|
+
printf '%s\n' 'octet npm launcher could not resolve its executable path' >&2
|
|
15
|
+
exit 1
|
|
16
|
+
}
|
|
17
|
+
case "$link" in
|
|
18
|
+
/*) script=$link ;;
|
|
19
|
+
*) script=$(dirname "$script")/$link ;;
|
|
20
|
+
esac
|
|
21
|
+
done
|
|
22
|
+
script_directory=$(CDPATH= cd -P -- "$(dirname "$script")" 2>/dev/null && pwd -P) || {
|
|
23
|
+
printf '%s\n' 'octet npm launcher could not resolve its package directory' >&2
|
|
24
|
+
exit 1
|
|
25
|
+
}
|
|
26
|
+
exec "$script_directory/../lib/launch.sh" octet "$@"
|
package/bin/octet-host
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
# npm may expose bin/octet-host through a symlink in its global bin directory.
|
|
5
|
+
# Resolve it before exec so package lookup remains independent of PATH.
|
|
6
|
+
script=$0
|
|
7
|
+
case "$script" in
|
|
8
|
+
/*) ;;
|
|
9
|
+
*) script=$(pwd -P)/$script ;;
|
|
10
|
+
esac
|
|
11
|
+
while [ -L "$script" ]; do
|
|
12
|
+
link=$(readlink "$script") || {
|
|
13
|
+
printf '%s\n' 'octet npm launcher could not resolve its executable path' >&2
|
|
14
|
+
exit 1
|
|
15
|
+
}
|
|
16
|
+
case "$link" in
|
|
17
|
+
/*) script=$link ;;
|
|
18
|
+
*) script=$(dirname "$script")/$link ;;
|
|
19
|
+
esac
|
|
20
|
+
done
|
|
21
|
+
script_directory=$(CDPATH= cd -P -- "$(dirname "$script")" 2>/dev/null && pwd -P) || {
|
|
22
|
+
printf '%s\n' 'octet npm launcher could not resolve its package directory' >&2
|
|
23
|
+
exit 1
|
|
24
|
+
}
|
|
25
|
+
exec "$script_directory/../lib/launch.sh" octet-host "$@"
|
package/lib/launch.sh
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
set -eu
|
|
3
|
+
|
|
4
|
+
package_version="0.8.1"
|
|
5
|
+
|
|
6
|
+
fail() {
|
|
7
|
+
printf '%s\n' "$1" >&2
|
|
8
|
+
exit 1
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
command_name=${1-}
|
|
12
|
+
case "$command_name" in
|
|
13
|
+
octet|octet-host) ;;
|
|
14
|
+
*) fail 'octet npm launcher received an invalid native command' ;;
|
|
15
|
+
esac
|
|
16
|
+
shift
|
|
17
|
+
|
|
18
|
+
# npm exposes each bin entry through a symlink in its global bin directory.
|
|
19
|
+
# Resolve it without changing the caller's working directory before locating
|
|
20
|
+
# the package-local launcher.
|
|
21
|
+
script=$0
|
|
22
|
+
case "$script" in
|
|
23
|
+
/*) ;;
|
|
24
|
+
*) script=$(pwd -P)/$script ;;
|
|
25
|
+
esac
|
|
26
|
+
while [ -L "$script" ]; do
|
|
27
|
+
link=$(readlink "$script") || fail 'octet npm launcher could not resolve its executable path'
|
|
28
|
+
case "$link" in
|
|
29
|
+
/*) script=$link ;;
|
|
30
|
+
*) script=$(dirname "$script")/$link ;;
|
|
31
|
+
esac
|
|
32
|
+
done
|
|
33
|
+
launch_directory=$(CDPATH= cd -P -- "$(dirname "$script")" 2>/dev/null && pwd -P) || \
|
|
34
|
+
fail 'octet npm launcher could not resolve its package directory'
|
|
35
|
+
launcher_root=$(CDPATH= cd -P -- "$launch_directory/.." 2>/dev/null && pwd -P) || \
|
|
36
|
+
fail 'octet npm launcher could not resolve its package root'
|
|
37
|
+
[ -d "$launcher_root" ] && [ ! -L "$launcher_root" ] || \
|
|
38
|
+
fail 'octet npm launcher package root is not a real directory'
|
|
39
|
+
|
|
40
|
+
operating_system=$(uname -s 2>/dev/null) || fail 'octet npm launcher requires uname'
|
|
41
|
+
machine=$(uname -m 2>/dev/null) || fail 'octet npm launcher could not determine the CPU architecture'
|
|
42
|
+
platform_package=
|
|
43
|
+
case "$operating_system:$machine" in
|
|
44
|
+
Darwin:arm64|Darwin:aarch64)
|
|
45
|
+
platform_package='@skaft/octet-darwin-arm64'
|
|
46
|
+
;;
|
|
47
|
+
Darwin:x86_64|Darwin:amd64)
|
|
48
|
+
# Select the package matching the executable ABI. An x86_64 octet under
|
|
49
|
+
# Rosetta is still an x86_64 binary and must not exec arm64 code.
|
|
50
|
+
platform_package='@skaft/octet-darwin-x64'
|
|
51
|
+
;;
|
|
52
|
+
Linux:x86_64|Linux:amd64)
|
|
53
|
+
glibc_available=false
|
|
54
|
+
if command -v getconf >/dev/null 2>&1; then
|
|
55
|
+
glibc_version=$(getconf GNU_LIBC_VERSION 2>/dev/null || true)
|
|
56
|
+
case "$glibc_version" in
|
|
57
|
+
glibc\ *|GNU\ libc\ *) glibc_available=true ;;
|
|
58
|
+
esac
|
|
59
|
+
fi
|
|
60
|
+
if [ "$glibc_available" != true ] && command -v ldd >/dev/null 2>&1; then
|
|
61
|
+
ldd_version=$(ldd --version 2>&1 || true)
|
|
62
|
+
case "$ldd_version" in
|
|
63
|
+
*glibc*|*GLIBC*|*'GNU libc'*|*'GNU C Library'*) glibc_available=true ;;
|
|
64
|
+
esac
|
|
65
|
+
fi
|
|
66
|
+
[ "$glibc_available" = true ] || \
|
|
67
|
+
fail 'octet npm package requires GNU libc on Linux; musl is not supported'
|
|
68
|
+
platform_package='@skaft/octet-linux-x64-gnu'
|
|
69
|
+
;;
|
|
70
|
+
Darwin:*) fail "octet npm package does not support macOS architecture: $machine" ;;
|
|
71
|
+
Linux:*) fail "octet npm package does not support Linux architecture: $machine" ;;
|
|
72
|
+
*) fail "octet npm package does not support operating system: $operating_system" ;;
|
|
73
|
+
esac
|
|
74
|
+
|
|
75
|
+
platform_name=${platform_package#*/}
|
|
76
|
+
platform_root=
|
|
77
|
+
# npm may nest optional dependencies below the public package or hoist them to
|
|
78
|
+
# the sibling scope directory. Both layouts are explicit; there is no network
|
|
79
|
+
# resolver or fallback package.
|
|
80
|
+
for candidate in \
|
|
81
|
+
"$launcher_root/node_modules/$platform_package" \
|
|
82
|
+
"$launcher_root/../$platform_name"; do
|
|
83
|
+
if [ -d "$candidate" ] && [ ! -L "$candidate" ]; then
|
|
84
|
+
platform_root=$candidate
|
|
85
|
+
break
|
|
86
|
+
fi
|
|
87
|
+
done
|
|
88
|
+
[ -n "$platform_root" ] || \
|
|
89
|
+
fail "octet npm package is missing the selected platform runtime: $platform_package"
|
|
90
|
+
|
|
91
|
+
for required in \
|
|
92
|
+
"$platform_root/package.json" \
|
|
93
|
+
"$platform_root/README.md" \
|
|
94
|
+
"$platform_root/LICENSE" \
|
|
95
|
+
"$platform_root/bin/$command_name" \
|
|
96
|
+
"$platform_root/share/octet/.octet-version" \
|
|
97
|
+
"$platform_root/share/octet/README.md"; do
|
|
98
|
+
[ -f "$required" ] && [ ! -L "$required" ] || \
|
|
99
|
+
fail "octet npm platform package is incomplete: $platform_root"
|
|
100
|
+
done
|
|
101
|
+
for required_directory in \
|
|
102
|
+
"$platform_root/bin" \
|
|
103
|
+
"$platform_root/share/octet" \
|
|
104
|
+
"$platform_root/share/octet/docs" \
|
|
105
|
+
"$platform_root/share/octet/examples" \
|
|
106
|
+
"$platform_root/share/octet/sdk"; do
|
|
107
|
+
[ -d "$required_directory" ] && [ ! -L "$required_directory" ] || \
|
|
108
|
+
fail "octet npm platform package is incomplete: $platform_root"
|
|
109
|
+
done
|
|
110
|
+
[ -x "$platform_root/bin/$command_name" ] || \
|
|
111
|
+
fail "octet npm platform executable is not executable: $platform_root/bin/$command_name"
|
|
112
|
+
[ "$(cat "$platform_root/share/octet/.octet-version")" = "$package_version" ] || \
|
|
113
|
+
fail "octet npm platform version does not match launcher version $package_version"
|
|
114
|
+
|
|
115
|
+
# Do not print on the successful path: octet-host stdout is a protocol stream.
|
|
116
|
+
# exec preserves cwd, argv, environment, stdio, signal delivery, and status.
|
|
117
|
+
exec "$platform_root/bin/$command_name" "$@"
|
package/package.json
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skaft/octet",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.8.1",
|
|
4
|
+
"description": "Native octet coding agent launcher",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"repository":
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/skaft-software/octet.git"
|
|
9
|
-
},
|
|
10
|
-
"publishConfig": {
|
|
11
|
-
"access": "public",
|
|
12
|
-
"tag": "reserved",
|
|
13
|
-
"registry": "https://registry.npmjs.org/"
|
|
14
|
-
},
|
|
6
|
+
"repository": "https://github.com/skaft-software/octet",
|
|
15
7
|
"files": [
|
|
16
|
-
"README.md"
|
|
17
|
-
|
|
8
|
+
"README.md",
|
|
9
|
+
"LICENSE",
|
|
10
|
+
"bin/",
|
|
11
|
+
"lib/"
|
|
12
|
+
],
|
|
13
|
+
"bin": {
|
|
14
|
+
"octet": "bin/octet",
|
|
15
|
+
"octet-host": "bin/octet-host"
|
|
16
|
+
},
|
|
17
|
+
"optionalDependencies": {
|
|
18
|
+
"@skaft/octet-darwin-arm64": "0.8.1",
|
|
19
|
+
"@skaft/octet-darwin-x64": "0.8.1",
|
|
20
|
+
"@skaft/octet-linux-x64-gnu": "0.8.1"
|
|
21
|
+
}
|
|
18
22
|
}
|