@yyopc/yyork 0.1.0-alpha.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/.agents/skills/yyork-cli/SKILL.md +128 -0
- package/.agents/skills/yyork-cli/agents/openai.yaml +4 -0
- package/LICENSE +76 -0
- package/README.md +96 -0
- package/bin/install-yyork.mjs +71 -0
- package/bin/native-package.mjs +129 -0
- package/bin/yyork.mjs +20 -0
- package/package.json +90 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: yyork-cli
|
|
3
|
+
description: Operate yyork's CLI correctly for local agent orchestration. Use when an agent needs to start or reason about the yyork dashboard/server, spawn yyork worker or orchestrator sessions, list sessions, send follow-up messages, stop sessions, work with yyork.localhost/portless dev startup, or avoid planned-but-unimplemented yyork commands.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# yyork CLI
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Use this skill to choose yyork commands from the actual CLI surface, not from guessed orchestration terminology. If a command or flag is unclear, run `yyork <command> --help` first; in the yyork source checkout, use `go run . <command> --help` when testing the local CLI implementation.
|
|
11
|
+
|
|
12
|
+
## Command Surface
|
|
13
|
+
|
|
14
|
+
Implemented public operational verbs:
|
|
15
|
+
|
|
16
|
+
- `yyork [projectPath] [--addr <host:port>] [--open=false]`: start the local dashboard/API server. `projectPath` must resolve inside a git repo. There is no public `start` or `dashboard` verb.
|
|
17
|
+
- `yyork spawn [--json] [--flags]`: spawn a session. Defaults to `--type worker` and `--agent claude-code`.
|
|
18
|
+
- `yyork session list [--json] [--project <absolute-project-path>]`: list known sessions.
|
|
19
|
+
- `yyork send [--json] --session <id> [--project <absolute-project-path>] "<message>"`: send a follow-up message to a session.
|
|
20
|
+
- `yyork stop [--json] <sessionID>`: terminate a session, remove its worktree when applicable, and delete its store row.
|
|
21
|
+
|
|
22
|
+
Hidden/internal or dev-only surfaces:
|
|
23
|
+
|
|
24
|
+
- `yyork dev` is driven by `pnpm dev` in the yyork repo. Prefer `pnpm dev`; it runs `portless run`, which launches `go run . dev`.
|
|
25
|
+
- `yyork hooks ...` is the machine hook entrypoint for Codex/Claude Code lifecycle hooks. Do not call it manually except for explicit hook cleanup work.
|
|
26
|
+
|
|
27
|
+
Commands shown under `PLANNED` in help, such as `status`, `open`, `batch-spawn`, `plugin`, `review`, or `verify`, are not implemented. Do not use a planned command until help shows it under `COMMANDS`.
|
|
28
|
+
|
|
29
|
+
## Starting yyork
|
|
30
|
+
|
|
31
|
+
For normal use:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
yyork /absolute/path/to/project
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Use `--open=false` when running headless or when a browser launch would be noisy:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
yyork /absolute/path/to/project --open=false
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
In the yyork source checkout, start the dev stack with:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pnpm dev
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Under portless, use `https://yyork.localhost` as the stable local URL after the ready banner appears. The hidden `dev` command gets web host/port from `PORTLESS_URL`, `PORT`, `HOST`, `VITE_HOST`, and `VITE_PORT`; backend port is ephemeral unless `YYORK_BACKEND_PORT` is set.
|
|
50
|
+
|
|
51
|
+
## Spawning Sessions
|
|
52
|
+
|
|
53
|
+
Orchestrators coordinate; workers implement scoped tasks.
|
|
54
|
+
|
|
55
|
+
Spawn a worker:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
yyork spawn --json --type worker --prompt "Implement the focused task, run the relevant checks, and summarize the result."
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Rules:
|
|
62
|
+
|
|
63
|
+
- Worker sessions require a non-empty `--prompt`.
|
|
64
|
+
- `--type` accepts only `worker` or `orchestrator`.
|
|
65
|
+
- `--workspace` accepts only `new-worktree` or `local`, and matters for workers. Orchestrator sessions always run in the main project worktree.
|
|
66
|
+
- If isolation matters, pass `--workspace new-worktree` explicitly. Use `--workspace local` only when the worker should continue in the main worktree.
|
|
67
|
+
- Workers spawned from an orchestrator inherit `YYORK_PROJECT_PATH`; do not override it unless intentionally targeting a different absolute project path.
|
|
68
|
+
- Project IDs are absolute project paths, not slugs. Use the path shown by `yyork session list` or `$YYORK_PROJECT_PATH` for `--project`.
|
|
69
|
+
- Use `--agent codex` only when the Codex plugin is the intended runtime; otherwise the default is `claude-code`.
|
|
70
|
+
- Use `--permissions <mode>` only when the target agent plugin supports the mode you are passing. Check `yyork spawn --help` and local plugin code if unsure.
|
|
71
|
+
- Use `--json` whenever you need to parse yyork output. Human output is for display only.
|
|
72
|
+
|
|
73
|
+
For multi-line prompts, build a shell variable to avoid quoting mistakes:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
prompt=$(cat <<'EOF'
|
|
77
|
+
Implement the scoped change described here.
|
|
78
|
+
|
|
79
|
+
Include:
|
|
80
|
+
- exact files to inspect
|
|
81
|
+
- constraints
|
|
82
|
+
- checks to run
|
|
83
|
+
- expected final summary
|
|
84
|
+
EOF
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
yyork spawn --json --type worker --workspace new-worktree --prompt "$prompt"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Coordinating Sessions
|
|
91
|
+
|
|
92
|
+
List sessions before sending or stopping:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
yyork session list --json
|
|
96
|
+
yyork session list --json --project "$YYORK_PROJECT_PATH"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The JSON shape is `{"sessions":[...],"count":N}`. Use each session's `id`, `projectPath`, `kind`, `agent`, and `state` fields for follow-up commands.
|
|
100
|
+
|
|
101
|
+
Send a follow-up:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
yyork send --json --session <id> "Please run the missing test and report the output."
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Add `--project <absolute-project-path>` when IDs may be ambiguous across projects:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
yyork send --json --project "$YYORK_PROJECT_PATH" --session <id> "Continue with the narrower fix."
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Stop only when intentionally ending work:
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
yyork stop --json <sessionID>
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`stop` is idempotent for missing IDs, but for real sessions it kills the Zellij session, removes the session worktree when applicable, and deletes the store row. Make sure useful changes are pushed, merged, or otherwise preserved before stopping a worker.
|
|
120
|
+
|
|
121
|
+
## Orchestrator Habits
|
|
122
|
+
|
|
123
|
+
- Inspect repository and session context before spawning workers.
|
|
124
|
+
- Spawn small, independently checkable worker tasks rather than broad vague goals.
|
|
125
|
+
- Put enough context in each prompt: task, relevant paths, constraints, verification command, and expected final answer.
|
|
126
|
+
- Avoid implementing directly from the orchestrator unless explicitly asked; use workers for code changes.
|
|
127
|
+
- Prefer CLI commands over direct edits to `~/.yyork/state.db`. Inspect the database only for debugging store-level issues.
|
|
128
|
+
- If `yyork` is unavailable, ask the user before installing missing tools. In the yyork source checkout, use `go run .` for local CLI testing.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
YYOIT License
|
|
2
|
+
Version 1.0
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 yyopc
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to use,
|
|
8
|
+
copy, study, and modify the Software for private or internal purposes, subject
|
|
9
|
+
to the following conditions.
|
|
10
|
+
|
|
11
|
+
1. Definitions
|
|
12
|
+
|
|
13
|
+
"Original Author" means yyopc, the original author and owner of yyork.
|
|
14
|
+
|
|
15
|
+
"Fork" means any copy, modification, adaptation, derivative work, renamed
|
|
16
|
+
version, reimplementation substantially based on the Software, or product or
|
|
17
|
+
service that incorporates a substantial portion of the Software.
|
|
18
|
+
|
|
19
|
+
"Redistribute" means to publish, sell, sublicense, host for third-party access,
|
|
20
|
+
transfer, provide, package, release, or otherwise make a Fork available to any
|
|
21
|
+
third party, whether in source, binary, hosted, or bundled form.
|
|
22
|
+
|
|
23
|
+
2. Private Use Grant
|
|
24
|
+
|
|
25
|
+
You may use, copy, study, and modify the Software privately or inside your own
|
|
26
|
+
organization. You may create private Forks for evaluation, development, and
|
|
27
|
+
internal use.
|
|
28
|
+
|
|
29
|
+
3. Fork Redistribution Condition
|
|
30
|
+
|
|
31
|
+
You may Redistribute a Fork only if, before the first Redistribution, you and
|
|
32
|
+
the Original Author have entered into a separate written agreement, signed by
|
|
33
|
+
both parties, that makes the Original Author a cofounder of the project,
|
|
34
|
+
company, organization, or other venture responsible for the Fork.
|
|
35
|
+
|
|
36
|
+
That written agreement must define, at minimum, the Original Author's title,
|
|
37
|
+
ownership or equity share, vesting or revenue rights, governance or voting
|
|
38
|
+
rights, responsibilities, termination terms, and intellectual-property rights.
|
|
39
|
+
|
|
40
|
+
If no such written agreement exists, this license grants you no permission to
|
|
41
|
+
Redistribute the Fork.
|
|
42
|
+
|
|
43
|
+
4. Original Copies
|
|
44
|
+
|
|
45
|
+
You may share an unmodified copy of the Software only if you include this
|
|
46
|
+
license and all copyright, permission, limitation, and warranty notices.
|
|
47
|
+
|
|
48
|
+
5. No Trademark Grant
|
|
49
|
+
|
|
50
|
+
This license does not grant permission to use the names "yyork", "yyopc",
|
|
51
|
+
"YYOIT", or any related names, logos, marks, or branding to imply endorsement,
|
|
52
|
+
partnership, or official status.
|
|
53
|
+
|
|
54
|
+
6. No Implied Cofounder Relationship
|
|
55
|
+
|
|
56
|
+
Redistributing a Fork without the written agreement required by Section 3 does
|
|
57
|
+
not make the Original Author your cofounder. It is an unlicensed act. The
|
|
58
|
+
Original Author has no obligation to accept any proposed cofounder role or enter
|
|
59
|
+
into any agreement.
|
|
60
|
+
|
|
61
|
+
7. Existing MIT-Licensed Copies
|
|
62
|
+
|
|
63
|
+
This license applies only to copies or versions of the Software that expressly
|
|
64
|
+
include this YYOIT License. Copies of the Software that were previously received
|
|
65
|
+
under another license remain governed by the license under which they were
|
|
66
|
+
received.
|
|
67
|
+
|
|
68
|
+
8. Warranty Disclaimer
|
|
69
|
+
|
|
70
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
71
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
72
|
+
FOR A PARTICULAR PURPOSE, TITLE, AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
73
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
|
|
74
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM,
|
|
75
|
+
OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
76
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="internal/web/public/favicon.svg" alt="yyork" width="84" />
|
|
3
|
+
</p>
|
|
4
|
+
<h1 align="center">yyork</h1>
|
|
5
|
+
<p align="center">Run AI coding agents in parallel, each inside its own durable workspace.</p>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="yyork-light.png#gh-light-mode-only" alt="yyork app showing parallel AI coding agents in isolated workspaces" width="100%" />
|
|
9
|
+
<img src="yyork-dark.png#gh-dark-mode-only" alt="yyork app showing parallel AI coding agents in isolated workspaces" width="100%" />
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
> [!WARNING]
|
|
13
|
+
> yyork is still being built. Expect rough edges, breaking changes, and unfinished workflows. There is no merge flow yet, and cleanup commands can remove session worktrees and branches. Push or merge anything important before stopping a session.
|
|
14
|
+
|
|
15
|
+
## What it does
|
|
16
|
+
|
|
17
|
+
yyork is a local app for supervising multiple AI coding agents at once.
|
|
18
|
+
|
|
19
|
+
- Each session runs in its own `git worktree` and branch.
|
|
20
|
+
- [Zellij](https://zellij.dev) keeps agent sessions durable, invisibly — a session looks like a bare terminal running the agent CLI.
|
|
21
|
+
- The app shows live session state from your machine.
|
|
22
|
+
- A per-session canvas adds the workspace file tree, a review diff of the session's changes, and an embedded browser preview of your dev server.
|
|
23
|
+
- Annotations dropped on the previewed page go straight back to the session's agent.
|
|
24
|
+
- Claude Code and Codex run as their normal CLIs; yyork wraps the workspace around them.
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm i -g @yyopc/yyork
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The npm package installs a prebuilt native `yyork` binary for your OS/CPU
|
|
33
|
+
through optional platform packages such as `@yyopc/yyork-darwin-arm64` and
|
|
34
|
+
`@yyopc/yyork-linux-x64`. It also installs the bundled `yyork-cli` agent skill
|
|
35
|
+
into `~/.agents/skills/yyork-cli` and runs `yyork doctor` as a warning-only
|
|
36
|
+
postinstall check.
|
|
37
|
+
|
|
38
|
+
Requirements: npm/Node.js for the npm launcher, plus git and at least one
|
|
39
|
+
supported agent CLI on your `PATH` to run sessions. Native packages carry a
|
|
40
|
+
pinned bundled Zellij runtime for yyork's private session management.
|
|
41
|
+
|
|
42
|
+
## Basic flow
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
yyork ~/Projects/my-app
|
|
46
|
+
|
|
47
|
+
# optional/manual worker spawn
|
|
48
|
+
yyork spawn --type worker --prompt "add a health-check endpoint"
|
|
49
|
+
yyork session list
|
|
50
|
+
yyork stop <sessionId>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`yyork ~/Projects/my-app` starts the app and ensures the project has a
|
|
54
|
+
yyork-owned orchestrator in its own worktree and Zellij session. That
|
|
55
|
+
orchestrator can delegate workers with `yyork spawn --type worker --prompt ...`;
|
|
56
|
+
nested spawns keep targeting the original project.
|
|
57
|
+
Session state stays in `~/.yyork/state.db`, with no external orchestrator
|
|
58
|
+
runtime required.
|
|
59
|
+
|
|
60
|
+
## Development
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
nix develop
|
|
64
|
+
# or, with direnv:
|
|
65
|
+
direnv allow
|
|
66
|
+
|
|
67
|
+
pnpm install
|
|
68
|
+
pnpm dev
|
|
69
|
+
pnpm test
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The Nix dev shell supplies the repo-local Go, Node.js, pnpm, and helper tooling.
|
|
73
|
+
Inside that shell, `yyork` is a development shortcut for `pnpm dev`.
|
|
74
|
+
|
|
75
|
+
## Release
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
nix develop
|
|
79
|
+
pnpm release:check
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
`release:check` builds the app, stages the native package for the current
|
|
83
|
+
OS/CPU, packs the thin `@yyopc/yyork` wrapper, installs both into an isolated
|
|
84
|
+
temp prefix with `go` intentionally unavailable, and runs the installed
|
|
85
|
+
`yyork` binary. The native package step fetches and caches the pinned Zellij
|
|
86
|
+
binary under `third_party/zellij/<platform>/` before copying it into the
|
|
87
|
+
tarball.
|
|
88
|
+
|
|
89
|
+
Distribution builds run in GitHub Actions. The release workflow uses
|
|
90
|
+
GoReleaser to build stripped platform-specific `yyork` archives and publish
|
|
91
|
+
the GitHub release assets. A dependent npm packaging job wraps those exact
|
|
92
|
+
archives into native npm packages with bundled Zellij, smoke-tests install with
|
|
93
|
+
`go` unavailable, uploads the npm tarballs, and publishes the native packages
|
|
94
|
+
before the `@yyopc/yyork` wrapper.
|
|
95
|
+
|
|
96
|
+
YYOIT © [yyopc](https://github.com/yyopc)
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// postinstall: finish package-level setup for @yyopc/yyork. The actual app is
|
|
3
|
+
// shipped as a prebuilt native package; this step only installs the bundled
|
|
4
|
+
// agent skill and runs a warning-only runtime check.
|
|
5
|
+
import { spawnSync } from 'node:child_process';
|
|
6
|
+
import { cpSync, existsSync, mkdirSync, rmSync } from 'node:fs';
|
|
7
|
+
import { homedir } from 'node:os';
|
|
8
|
+
import { dirname, resolve, sep } from 'node:path';
|
|
9
|
+
import { fileURLToPath } from 'node:url';
|
|
10
|
+
|
|
11
|
+
import { resolveYyorkBinary } from './native-package.mjs';
|
|
12
|
+
|
|
13
|
+
const rootDir = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
14
|
+
|
|
15
|
+
if (!isPackageInstall() && process.env.YYORK_FORCE_POSTINSTALL !== '1') {
|
|
16
|
+
process.exit(0);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let binaryPath;
|
|
20
|
+
try {
|
|
21
|
+
binaryPath = resolveYyorkBinary();
|
|
22
|
+
} catch (error) {
|
|
23
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
installGlobalAgentSkill();
|
|
28
|
+
runInstallDoctor(binaryPath);
|
|
29
|
+
|
|
30
|
+
function isPackageInstall() {
|
|
31
|
+
return rootDir.split(sep).includes('node_modules');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function installGlobalAgentSkill() {
|
|
35
|
+
const sourceDir = resolve(rootDir, '.agents', 'skills', 'yyork-cli');
|
|
36
|
+
if (!existsSync(sourceDir)) {
|
|
37
|
+
console.warn(
|
|
38
|
+
'yyork CLI skill was not bundled; skipping global skill install.'
|
|
39
|
+
);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const targetDir = resolve(homedir(), '.agents', 'skills', 'yyork-cli');
|
|
44
|
+
mkdirSync(resolve(targetDir, '..'), { recursive: true });
|
|
45
|
+
rmSync(targetDir, { recursive: true, force: true });
|
|
46
|
+
cpSync(sourceDir, targetDir, { recursive: true });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function runInstallDoctor(binaryPath) {
|
|
50
|
+
console.log('\nyyork doctor: checking local runtime dependencies...');
|
|
51
|
+
const result = spawnSync(binaryPath, ['doctor'], {
|
|
52
|
+
cwd: rootDir,
|
|
53
|
+
shell: process.platform === 'win32',
|
|
54
|
+
stdio: 'inherit',
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (result.error) {
|
|
58
|
+
console.warn(`yyork doctor could not run: ${result.error.message}`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (result.signal) {
|
|
62
|
+
console.warn(`yyork doctor stopped with signal ${result.signal}.`);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (result.status !== 0) {
|
|
66
|
+
console.warn(
|
|
67
|
+
'yyork installed, but doctor found missing dependencies. ' +
|
|
68
|
+
'Install the missing tools before running sessions.'
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
import { accessSync, constants } from 'node:fs';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
import { dirname, resolve } from 'node:path';
|
|
5
|
+
|
|
6
|
+
const nativePackages = {
|
|
7
|
+
'darwin arm64': {
|
|
8
|
+
target: 'darwin-arm64',
|
|
9
|
+
name: '@yyopc/yyork-darwin-arm64',
|
|
10
|
+
os: 'darwin',
|
|
11
|
+
cpu: 'arm64',
|
|
12
|
+
goos: 'darwin',
|
|
13
|
+
goarch: 'arm64',
|
|
14
|
+
},
|
|
15
|
+
'darwin x64': {
|
|
16
|
+
target: 'darwin-x64',
|
|
17
|
+
name: '@yyopc/yyork-darwin-x64',
|
|
18
|
+
os: 'darwin',
|
|
19
|
+
cpu: 'x64',
|
|
20
|
+
goos: 'darwin',
|
|
21
|
+
goarch: 'amd64',
|
|
22
|
+
},
|
|
23
|
+
'linux arm64': {
|
|
24
|
+
target: 'linux-arm64',
|
|
25
|
+
name: '@yyopc/yyork-linux-arm64',
|
|
26
|
+
os: 'linux',
|
|
27
|
+
cpu: 'arm64',
|
|
28
|
+
goos: 'linux',
|
|
29
|
+
goarch: 'arm64',
|
|
30
|
+
},
|
|
31
|
+
'linux x64': {
|
|
32
|
+
target: 'linux-x64',
|
|
33
|
+
name: '@yyopc/yyork-linux-x64',
|
|
34
|
+
os: 'linux',
|
|
35
|
+
cpu: 'x64',
|
|
36
|
+
goos: 'linux',
|
|
37
|
+
goarch: 'amd64',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const nativePackagesByTarget = Object.fromEntries(
|
|
42
|
+
Object.values(nativePackages).map((metadata) => [metadata.target, metadata])
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
export function nativePackageMetadata(
|
|
46
|
+
platform = process.platform,
|
|
47
|
+
arch = process.arch
|
|
48
|
+
) {
|
|
49
|
+
const metadata = nativePackages[`${platform} ${arch}`];
|
|
50
|
+
if (!metadata) {
|
|
51
|
+
throw new Error(
|
|
52
|
+
`yyork does not publish a native npm package for ${platform}/${arch}. ` +
|
|
53
|
+
`Supported platforms: ${supportedNativePackages().join(', ')}.`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
return metadata;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function nativePackageMetadataForTarget(target) {
|
|
60
|
+
const metadata = nativePackagesByTarget[target];
|
|
61
|
+
if (!metadata) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
`yyork does not publish a native npm package for target ${target}. ` +
|
|
64
|
+
`Supported targets: ${supportedNativePackageTargets().join(', ')}.`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
return metadata;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function supportedNativePackages() {
|
|
71
|
+
return Object.values(nativePackages).map((metadata) => metadata.name);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function supportedNativePackageTargets() {
|
|
75
|
+
return Object.keys(nativePackagesByTarget);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export function yyorkBinaryName(platform = process.platform) {
|
|
79
|
+
return platform === 'win32' ? 'yyork.exe' : 'yyork';
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
export function zellijBinaryName(platform = process.platform) {
|
|
83
|
+
return platform === 'win32' ? 'zellij.exe' : 'zellij';
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function resolveYyorkBinary() {
|
|
87
|
+
const metadata = nativePackageMetadata();
|
|
88
|
+
const require = createRequire(import.meta.url);
|
|
89
|
+
|
|
90
|
+
let packageJSONPath;
|
|
91
|
+
try {
|
|
92
|
+
packageJSONPath = require.resolve(`${metadata.name}/package.json`);
|
|
93
|
+
} catch (_error) {
|
|
94
|
+
throw new Error(
|
|
95
|
+
`Unable to find ${metadata.name}, the native yyork package for ` +
|
|
96
|
+
`${process.platform}/${process.arch}. Reinstall @yyopc/yyork with ` +
|
|
97
|
+
`optional dependencies enabled.`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const binaryPath = resolve(
|
|
102
|
+
dirname(packageJSONPath),
|
|
103
|
+
'bin',
|
|
104
|
+
yyorkBinaryName()
|
|
105
|
+
);
|
|
106
|
+
try {
|
|
107
|
+
accessSync(
|
|
108
|
+
binaryPath,
|
|
109
|
+
process.platform === 'win32' ? constants.F_OK : constants.X_OK
|
|
110
|
+
);
|
|
111
|
+
} catch (_error) {
|
|
112
|
+
throw new Error(
|
|
113
|
+
`The native yyork package ${metadata.name} is installed, but its ` +
|
|
114
|
+
`binary is missing or not executable at ${binaryPath}.`
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return binaryPath;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function runYyork(args, options = {}) {
|
|
122
|
+
const binaryPath = resolveYyorkBinary();
|
|
123
|
+
return spawnSync(binaryPath, args, {
|
|
124
|
+
shell: process.platform === 'win32',
|
|
125
|
+
stdio: options.stdio ?? 'inherit',
|
|
126
|
+
cwd: options.cwd,
|
|
127
|
+
env: options.env,
|
|
128
|
+
});
|
|
129
|
+
}
|
package/bin/yyork.mjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Thin launcher for the published @yyopc/yyork package: resolve the native
|
|
3
|
+
// package for this OS/CPU and exec its prebuilt yyork binary. Everything else
|
|
4
|
+
// lives in the Go binary. From a source checkout, run the CLI with `go run .`
|
|
5
|
+
// or the repo's `yyork` pnpm script.
|
|
6
|
+
import { runYyork } from './native-package.mjs';
|
|
7
|
+
|
|
8
|
+
let result;
|
|
9
|
+
try {
|
|
10
|
+
result = runYyork(process.argv.slice(2));
|
|
11
|
+
} catch (error) {
|
|
12
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (result.signal) {
|
|
17
|
+
process.kill(process.pid, result.signal);
|
|
18
|
+
} else {
|
|
19
|
+
process.exit(result.status ?? 1);
|
|
20
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yyopc/yyork",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "Agent routing platform with an interface to the agent router.",
|
|
6
|
+
"homepage": "https://github.com/yyopc/yyork#readme",
|
|
7
|
+
"bugs": {
|
|
8
|
+
"url": "https://github.com/yyopc/yyork/issues"
|
|
9
|
+
},
|
|
10
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
11
|
+
"author": {
|
|
12
|
+
"name": "yyopc",
|
|
13
|
+
"email": "itsyyopc@gmail.com",
|
|
14
|
+
"url": "https://github.com/yyopc"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/yyopc/yyork.git"
|
|
19
|
+
},
|
|
20
|
+
"bin": {
|
|
21
|
+
"yyork": "./bin/yyork.mjs"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
".agents/skills/yyork-cli/**",
|
|
25
|
+
"bin/yyork.mjs",
|
|
26
|
+
"bin/install-yyork.mjs",
|
|
27
|
+
"bin/native-package.mjs"
|
|
28
|
+
],
|
|
29
|
+
"type": "module",
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"npm-run-all": "4.1.5",
|
|
35
|
+
"openapi-zod-client": "^1.18.3",
|
|
36
|
+
"portless": "0.14.0"
|
|
37
|
+
},
|
|
38
|
+
"optionalDependencies": {
|
|
39
|
+
"@yyopc/yyork-darwin-arm64": "0.1.0-alpha.1",
|
|
40
|
+
"@yyopc/yyork-darwin-x64": "0.1.0-alpha.1",
|
|
41
|
+
"@yyopc/yyork-linux-arm64": "0.1.0-alpha.1",
|
|
42
|
+
"@yyopc/yyork-linux-x64": "0.1.0-alpha.1"
|
|
43
|
+
},
|
|
44
|
+
"engines": {
|
|
45
|
+
"node": ">=18"
|
|
46
|
+
},
|
|
47
|
+
"portless": {
|
|
48
|
+
"name": "yyork",
|
|
49
|
+
"script": "dev:app"
|
|
50
|
+
},
|
|
51
|
+
"scripts": {
|
|
52
|
+
"postinstall": "node ./bin/install-yyork.mjs",
|
|
53
|
+
"release:check": "node ./bin/check-release.mjs",
|
|
54
|
+
"release:fetch-zellij": "node ./bin/fetch-zellij.mjs",
|
|
55
|
+
"release:fetch-zellij:all": "node ./bin/fetch-zellij.mjs --all",
|
|
56
|
+
"release:pack:native": "pnpm web:build && node ./bin/pack-native-package.mjs",
|
|
57
|
+
"release:pack:npm": "node ./bin/pack-npm-release.mjs",
|
|
58
|
+
"release:dry-run": "pnpm release:check",
|
|
59
|
+
"release:publish": "echo \"Use the GitHub Actions Release workflow; release publishing is disabled locally.\" && exit 1",
|
|
60
|
+
"api:generate": "pnpm api:generate:openapi && pnpm api:generate:zod",
|
|
61
|
+
"api:generate:openapi": "go run ./api/generate-workspace-contract.go",
|
|
62
|
+
"api:generate:zod": "openapi-zod-client ./api/openapi.generated.json -o ./internal/web/src/features/home/domain/session-workspace-contract.generated.ts -t ./api/session-workspace-contract.hbs --export-schemas && pnpm --filter @yyork/web exec oxfmt src/features/home/domain/session-workspace-contract.generated.ts",
|
|
63
|
+
"yyork": "go run .",
|
|
64
|
+
"dev": "run-p dev:stack docs:dev mock:dev",
|
|
65
|
+
"dev:stack": "portless run",
|
|
66
|
+
"dev:app": "go run . dev",
|
|
67
|
+
"web:dev": "pnpm --filter @yyork/web dev",
|
|
68
|
+
"web:build": "pnpm --filter @yyork/web build",
|
|
69
|
+
"web:lint": "pnpm --filter @yyork/web lint",
|
|
70
|
+
"web:test": "pnpm --filter @yyork/web test:ci",
|
|
71
|
+
"docs:dev": "portless docs.yyork -- pnpm --filter @yyork/docs exec react-router dev",
|
|
72
|
+
"docs:dev:direct": "pnpm --filter @yyork/docs dev",
|
|
73
|
+
"storybook:dev": "portless storybook.yyork -- pnpm --filter @yyork/web storybook",
|
|
74
|
+
"storybook:dev:direct": "pnpm --filter @yyork/web storybook:direct",
|
|
75
|
+
"mock:dev": "portless mock.yyork --force -- pnpm --filter @yyork/web mock:dev",
|
|
76
|
+
"mock:dev:direct": "pnpm --filter @yyork/web mock:dev:direct",
|
|
77
|
+
"docs:build": "pnpm --filter @yyork/docs build",
|
|
78
|
+
"backend:build": "pnpm web:build && go build -o ./yyork .",
|
|
79
|
+
"backend:test": "go test ./...",
|
|
80
|
+
"build": "pnpm web:build && pnpm backend:build",
|
|
81
|
+
"lint": "pnpm backend:test && pnpm web:lint",
|
|
82
|
+
"lint:ts": "pnpm --filter @yyork/web lint:ts",
|
|
83
|
+
"test": "pnpm backend:test && pnpm web:test",
|
|
84
|
+
"test:ci": "pnpm --filter @yyork/web test:ci",
|
|
85
|
+
"doctor": "pnpm --filter @yyork/web run doctor",
|
|
86
|
+
"doctor:full": "pnpm --filter @yyork/web run doctor:full",
|
|
87
|
+
"e2e": "pnpm --filter @yyork/web e2e",
|
|
88
|
+
"e2e:live-terminal": "pnpm --dir internal/web e2e:live-terminal"
|
|
89
|
+
}
|
|
90
|
+
}
|