nyte-ai 0.0.16-dev.4 → 0.0.19

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nyte 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/bin/nyte.js CHANGED
@@ -3,7 +3,7 @@
3
3
  import { launch } from "../src/launcher.js";
4
4
 
5
5
  try {
6
- process.exitCode = await launch();
6
+ process.exitCode = await launch(process.argv.slice(2));
7
7
  } catch (error) {
8
8
  process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`);
9
9
  process.exitCode = 1;
package/docs/README.md CHANGED
@@ -4,7 +4,6 @@ This guide and its source examples ship with the Nyte release you installed.
4
4
  The npm package records its version in `package.json`; a native archive records
5
5
  it in `VERSION` beside the executable.
6
6
 
7
- - [Run a conversation or one prompt](usage.md)
8
7
  - [Source examples](examples/README.md)
9
8
 
10
9
  For npm installs, this guide is inside `nyte-ai/docs`. For native installs it is
@@ -1,7 +1,6 @@
1
1
  # Source examples
2
2
 
3
- Run these from the workspace you want Nyte to inspect, after login and workspace
4
- trust setup. Put `nyte` on `PATH`. Each script starts one prompt run and
3
+ Run these from the workspace you want Nyte to inspect, after login. Put `nyte` on `PATH`. Each script starts one prompt run and
5
4
  returns Nyte's exit status. Neither script changes your shell settings.
6
5
 
7
6
  - [ask.sh](ask.sh) passes prompt arguments without shell evaluation.
@@ -15,4 +14,4 @@ sh /path/to/docs/examples/prompt-file.sh ./prompt.txt
15
14
  ```
16
15
 
17
16
  These are ordinary shell source files you can copy and adapt. See the
18
- [usage guide](../usage.md) for setup and the [front door](../README.md) for locations.
17
+ [front door](../README.md) for locations.
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "nyte-ai",
3
- "version": "0.0.16-dev.4",
3
+ "version": "0.0.19",
4
4
  "private": false,
5
- "description": "Headless agent runner and terminal client for Nyte",
5
+ "description": "Installs the nyte command: downloads, verifies and runs the native Nyte terminal client",
6
6
  "keywords": [
7
7
  "agent",
8
8
  "ai",
@@ -27,17 +27,18 @@
27
27
  ],
28
28
  "type": "module",
29
29
  "publishConfig": {
30
- "access": "public"
31
- },
32
- "scripts": {
33
- "clean": "rm -rf node_modules .turbo dist",
34
- "package": "pnpm pack --pack-destination dist",
35
- "test": "vitest --run"
30
+ "access": "public",
31
+ "provenance": true
36
32
  },
37
33
  "devDependencies": {
38
- "vitest": "^5.0.2"
34
+ "vitest": "^5.0.5"
39
35
  },
40
36
  "engines": {
41
37
  "node": ">=26"
38
+ },
39
+ "scripts": {
40
+ "clean": "rm -rf node_modules .turbo dist",
41
+ "package": "pnpm pack --pack-destination dist",
42
+ "test": "vitest --run"
42
43
  }
43
- }
44
+ }
package/src/launcher.js CHANGED
@@ -1,27 +1,37 @@
1
1
  import { spawn } from "node:child_process";
2
2
  import { createHash } from "node:crypto";
3
- import { chmod, mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
3
+ import {
4
+ chmod,
5
+ mkdir,
6
+ readFile,
7
+ readlink,
8
+ rename,
9
+ rm,
10
+ stat,
11
+ symlink,
12
+ writeFile,
13
+ } from "node:fs/promises";
4
14
  import { homedir } from "node:os";
5
- import { dirname, join } from "node:path";
15
+ import { dirname, join, relative } from "node:path";
6
16
  import process from "node:process";
7
17
 
8
18
  import packageJson from "../package.json" with { type: "json" };
9
19
 
10
- export const REPOSITORY = "interfaces-lab/nyte";
20
+ const REPOSITORY = "interfaces-lab/nyte";
21
+
22
+ const RELEASE_TARGETS = ["darwin-arm64", "linux-arm64", "linux-x64"];
11
23
 
12
24
  export function platformTarget(platform = process.platform, arch = process.arch) {
13
- if ((platform !== "darwin" && platform !== "linux") || (arch !== "arm64" && arch !== "x64")) {
14
- return undefined;
15
- }
25
+ const target = `${platform}-${arch}`;
16
26
 
17
- return `${platform}-${arch}`;
27
+ return RELEASE_TARGETS.includes(target) ? target : undefined;
18
28
  }
19
29
 
20
30
  export function releaseAssetName(version, target) {
21
31
  return `nyte-v${version.replace(/^v/u, "")}-${target}`;
22
32
  }
23
33
 
24
- export function cacheRoot(env = process.env) {
34
+ function cacheRoot(env = process.env) {
25
35
  return env["NYTE_BIN_DIR"] ?? join(homedir(), ".nyte", "bin");
26
36
  }
27
37
 
@@ -56,7 +66,11 @@ export async function ensureBinary(options = {}) {
56
66
  const root = options.root ?? cacheRoot(options.env);
57
67
  const binary = join(root, version, "nyte");
58
68
 
59
- if ((await stat(binary).catch(() => undefined))?.isFile()) return binary;
69
+ if ((await stat(binary).catch(() => undefined))?.isFile()) {
70
+ await linkCurrent(root, binary);
71
+
72
+ return binary;
73
+ }
60
74
 
61
75
  const fetchFn = options.fetchFn ?? globalThis.fetch;
62
76
  const asset = releaseAssetName(version, target);
@@ -97,14 +111,27 @@ export async function ensureBinary(options = {}) {
97
111
  }
98
112
 
99
113
  await chmod(binary, 0o755);
100
-
101
- return binary;
102
114
  } catch (error) {
103
115
  await rm(binary, { force: true });
104
116
  throw error;
105
117
  } finally {
106
118
  await rm(archive, { force: true });
107
119
  }
120
+
121
+ await linkCurrent(root, binary);
122
+
123
+ return binary;
124
+ }
125
+
126
+ async function linkCurrent(root, binary) {
127
+ const link = join(root, "nyte");
128
+ const target = relative(root, binary);
129
+
130
+ if ((await readlink(link).catch(() => undefined)) === target) return;
131
+ const temporary = `${link}.${process.pid}.tmp`;
132
+ await rm(temporary, { force: true });
133
+ await symlink(target, temporary);
134
+ await rename(temporary, link);
108
135
  }
109
136
 
110
137
  export async function launch(args = process.argv.slice(2), options = {}) {
package/docs/usage.md DELETED
@@ -1,46 +0,0 @@
1
- # Run Nyte
2
-
3
- Log in once, then start a conversation from your project directory:
4
-
5
- ```sh
6
- nyte login
7
- nyte
8
- ```
9
-
10
- `nyte login` lists the providers you can sign in to. `nyte login github-copilot` signs in with a
11
- GitHub device code: open the URL it prints, enter the code, and Nyte loads the models your Copilot
12
- account can use. This uses the GitHub Copilot OAuth app used by Pi, not a Nyte or OpenCode app.
13
- Nyte exchanges the GitHub token for a short-lived Copilot session token and refreshes it as needed.
14
- Existing direct-token Copilot logins need a fresh sign-in after upgrading. Nyte is not an officially
15
- supported Copilot client; the account needs Copilot access.
16
-
17
- Nyte asks whether you trust the directory. A trusted workspace lets tools read,
18
- edit, and run commands with your process's access. There are no per-tool prompts.
19
- Use an isolated environment when the workspace needs stronger boundaries.
20
-
21
- To send one prompt and exit:
22
-
23
- ```sh
24
- nyte --print -- "Summarize this project's README"
25
- ```
26
-
27
- Use `--provider <provider>` and `--model <model>` before `--` to select a model.
28
- These requests use your configured provider and may incur charges. Run `nyte login`
29
- interactively before using scripts. A script must also run in a trusted workspace.
30
-
31
- Use `nyte --resume` in a terminal to continue the latest conversation.
32
- Installed copies can update with `nyte update`. Run `nyte update --models` to refresh the model catalog without updating Nyte. The update command installs the new
33
- release's docs beside the executable when the release archive carries them.
34
-
35
- ## Delegated tasks
36
-
37
- The agent waits for a delegated task by default. It can start independent work in the
38
- background, then use `wait_task` with that job's ID when it needs the report. The parent
39
- continues after the existing task finishes; it does not launch a replacement or poll.
40
- `stop_task` cancels the task. These are agent tools, not terminal commands.
41
-
42
- A background report cannot restart a finished or stopped conversation. If the parent
43
- already finished, the report stays queued for your next message.
44
-
45
- The [source examples](examples/README.md) demonstrate quoted arguments and stdin.
46
- Return to the [guide](README.md).