@catheadowl/ukp 0.2.3 → 0.2.5
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 +5 -2
- package/bin/ukp.js +31 -11
- package/docs/remote-deployment.md +7 -0
- package/package.json +1 -1
- package/src/capabilities/propose.ts +1 -1
- package/src/capabilities/read.ts +1 -1
- package/src/capabilities/remote-client.ts +361 -70
- package/src/capabilities/rg.ts +148 -21
- package/src/capabilities/search.ts +2 -2
- package/src/cli.ts +73 -4
- package/src/commands/guide-content/propose.txt +1 -1
- package/src/commands/guide-content/remote.txt +9 -7
- package/src/commands/guide-content/rg.txt +35 -0
- package/src/commands/guide-content/service-qmd.txt +1 -1
- package/src/commands/guide.ts +11 -4
- package/src/commands/inventory.ts +182 -36
- package/src/commands/propose.ts +1 -1
- package/src/commands/read.ts +6 -6
- package/src/commands/rg.ts +45 -14
- package/src/commands/serve-task.ts +17 -17
- package/src/commands/serve.ts +22 -22
- package/src/registry.ts +2 -2
- package/src/server.ts +41 -26
- package/src/spawn-relay.ts +57 -0
package/README.md
CHANGED
|
@@ -61,7 +61,9 @@ predictable scope, and a single command surface. Use UKP when:
|
|
|
61
61
|
Requirements). `read` and `nav` are derived defaults of every local
|
|
62
62
|
Service.
|
|
63
63
|
- Run base lexical search with `rg` across endpoint files — no search
|
|
64
|
-
provider needed, on by default, shaped into `read`-ready references
|
|
64
|
+
provider needed, on by default, shaped into `read`-ready references —
|
|
65
|
+
or enumerate them with `rg --files` (a tree walk: empty and binary files
|
|
66
|
+
included, hidden files behind `-- --hidden`).
|
|
65
67
|
- Search indexed content, QMD-backed: one endpoint, the workspace default
|
|
66
68
|
scope, or the whole local Registry. `--recursive` additionally searches
|
|
67
69
|
the endpoints a Service declares in its manifest `dependencies` —
|
|
@@ -143,7 +145,7 @@ Endpoint commands:
|
|
|
143
145
|
| `ukp search` | Indexed search through the endpoint's provider (QMD today); `--recursive` expands the manifest's declared `dependencies`. Results hand off via docid session keys and verified `ukp://` references. |
|
|
144
146
|
| `ukp read` | Reads an endpoint-scoped resource — exact path, `ukp://` URI, or a `docid` handed off by search results. |
|
|
145
147
|
| `ukp nav` | Markdown outline of an endpoint (`--depth`, respects `.gitignore`); on by default, configurable via `[capabilities.nav]`. |
|
|
146
|
-
| `ukp rg` | Lexical grep (ripgrep) across endpoint files — provider-free, on by default;
|
|
148
|
+
| `ukp rg` | Lexical grep (ripgrep) across endpoint files — provider-free, on by default; `--files` enumerates them instead of searching. Results become `read`-ready `ukp://` references. A missing rg binary skips the endpoint with a warning. |
|
|
147
149
|
| `ukp propose` | Submits an idempotent change proposal (suggestion box — the owner decides what happens next). Created/unchanged/updated; the revision bumps only on `updated`. |
|
|
148
150
|
|
|
149
151
|
Registry commands:
|
|
@@ -171,6 +173,7 @@ Help commands:
|
|
|
171
173
|
| `ukp guide service` | Provider-agnostic Service setup path. |
|
|
172
174
|
| `ukp guide service qmd` | Provider-owned setup for the QMD provider. |
|
|
173
175
|
| `ukp guide client` | How a workspace uses registered Services by default. |
|
|
176
|
+
| `ukp guide rg` | The rg quickstart: modes, glob semantics, visibility tiers. |
|
|
174
177
|
| `ukp guide remote` | How to serve and consume endpoints across machines. |
|
|
175
178
|
| `ukp guide propose` | The propose quickstart. |
|
|
176
179
|
|
package/bin/ukp.js
CHANGED
|
@@ -12,7 +12,7 @@ import { spawnSync } from "node:child_process";
|
|
|
12
12
|
import { existsSync } from "node:fs";
|
|
13
13
|
import { homedir } from "node:os";
|
|
14
14
|
import { dirname, join } from "node:path";
|
|
15
|
-
import { fileURLToPath } from "node:url";
|
|
15
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
16
16
|
|
|
17
17
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
18
18
|
const cli = join(here, "..", "src", "cli.ts");
|
|
@@ -68,15 +68,35 @@ function fail(detail) {
|
|
|
68
68
|
|
|
69
69
|
const bunPath = bunCandidates().find((candidate) => existsSync(candidate));
|
|
70
70
|
if (bunPath === undefined) {
|
|
71
|
-
fail("looked
|
|
71
|
+
fail("looked at UKP_BUN, the standard install locations, and PATH");
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
73
|
+
|
|
74
|
+
// In-process handoff when this launcher already runs under bun (bun's own
|
|
75
|
+
// bin links and `bunx`): importing the CLI keeps it in THIS process, where
|
|
76
|
+
// stdout/stderr keep their real TTY identity (columns, isTTY) — a spawnSync
|
|
77
|
+
// grandchild re-inherits duplicated handles, and on some hosts that layer
|
|
78
|
+
// degraded TTY detection (the third dogfood round: progress/wrap silently
|
|
79
|
+
// skipped while a direct run on the same console had both). One process
|
|
80
|
+
// also starts faster. The node-interpreted path (npm shims) keeps spawning.
|
|
81
|
+
if (runningUnderBun) {
|
|
82
|
+
const { runCli } = await import(pathToFileURL(cli).href);
|
|
83
|
+
const exit = runCli(process.argv.slice(2));
|
|
84
|
+
if (exit instanceof Promise) {
|
|
85
|
+
exit.then((code) => {
|
|
86
|
+
process.exitCode = code;
|
|
87
|
+
});
|
|
88
|
+
} else {
|
|
89
|
+
process.exitCode = exit;
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
const result = spawnSync(bunPath, [cli, ...process.argv.slice(2)], {
|
|
93
|
+
stdio: "inherit",
|
|
94
|
+
env: process.env,
|
|
95
|
+
});
|
|
96
|
+
if (result.error) {
|
|
97
|
+
// bunPath existed on disk a moment ago; a spawn failure here is exotic,
|
|
98
|
+
// but it must still land in the remedy, never a stack trace.
|
|
99
|
+
fail(`spawning '${bunPath}' failed: ${String(result.error.message ?? result.error)}`);
|
|
100
|
+
}
|
|
101
|
+
process.exit(result.status === null ? (result.signal !== null ? 130 : 1) : result.status);
|
|
81
102
|
}
|
|
82
|
-
process.exit(result.status === null ? (result.signal !== null ? 130 : 1) : result.status);
|
|
@@ -65,6 +65,13 @@ Notes:
|
|
|
65
65
|
wake — the client chooses the door port per invocation, which a fixed
|
|
66
66
|
forced command cannot express.
|
|
67
67
|
|
|
68
|
+
Windows note: some antivirus setups (Windows Defender behavioral inspection
|
|
69
|
+
included) delay a process spawned directly by the runtime by several seconds
|
|
70
|
+
per call — 5-10s per ssh/rg spawn was measured before ukp routed its
|
|
71
|
+
Windows tool spawns through a one-level relay. ukp does this automatically;
|
|
72
|
+
if you also add your own exclusion for your package manager's runtimes the
|
|
73
|
+
residual per-call cost is just the real ssh handshake plus the door spawn.
|
|
74
|
+
|
|
68
75
|
Windows hosts work out of the box: when the host's OpenSSH default shell
|
|
69
76
|
(cmd.exe) rejects the POSIX wake form, the client detects the signature and
|
|
70
77
|
resends the pinned cmd.exe form automatically — nothing to configure beyond
|
package/package.json
CHANGED
|
@@ -442,7 +442,7 @@ export function runPropose(request: ProposeRequest, context: ProposeContext): Pr
|
|
|
442
442
|
failure: {
|
|
443
443
|
errorClass: "capability-undeclared",
|
|
444
444
|
message: `endpoint '${binding.name}' does not declare the propose capability`
|
|
445
|
-
+ `
|
|
445
|
+
+ ` - declare [capabilities.propose] in the Service Manifest (.ukp/service.toml); 'ukp guide propose' walks through it`,
|
|
446
446
|
},
|
|
447
447
|
};
|
|
448
448
|
}
|
package/src/capabilities/read.ts
CHANGED
|
@@ -870,7 +870,7 @@ function executeResolvedRead(
|
|
|
870
870
|
return readFailure(
|
|
871
871
|
"resource-missing",
|
|
872
872
|
`resource-missing '${request.path}' in endpoint '${binding.name}'`
|
|
873
|
-
+ ` (absolute paths address files exactly; the mapped route does not exist
|
|
873
|
+
+ ` (absolute paths address files exactly; the mapped route does not exist - the target may live one level deeper, e.g. under src/)\n`
|
|
874
874
|
+ formatRecoveryCandidates(recovered.recovery.candidates).trimEnd(),
|
|
875
875
|
recovered.recovery,
|
|
876
876
|
);
|