palabre 0.6.4 → 0.8.0
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 +99 -63
- package/dist/adapters/cli-pty.js +14 -0
- package/dist/adapters/cli.js +32 -4
- package/dist/adapters/ollama.js +15 -0
- package/dist/agentRegistry.js +3 -2
- package/dist/args.js +22 -1
- package/dist/config.js +78 -4
- package/dist/configWizard.js +29 -6
- package/dist/discovery.js +3 -1
- package/dist/doctor.js +18 -0
- package/dist/index.js +593 -55
- package/dist/messages/agents.js +4 -2
- package/dist/messages/common.js +4 -0
- package/dist/messages/config.js +28 -8
- package/dist/messages/doctor.js +8 -0
- package/dist/messages/help.js +58 -2
- package/dist/messages/index.js +2 -0
- package/dist/messages/init.js +2 -2
- package/dist/messages/new.js +14 -0
- package/dist/messages/orchestrator.js +2 -0
- package/dist/messages/output.js +10 -0
- package/dist/messages/preview.js +4 -2
- package/dist/messages/prompt.js +46 -2
- package/dist/messages/renderers.js +2 -2
- package/dist/messages/tui.js +192 -0
- package/dist/messages/update.js +16 -2
- package/dist/new.js +158 -4
- package/dist/orchestrator.js +199 -6
- package/dist/output.js +31 -8
- package/dist/presets.js +48 -0
- package/dist/prompt.js +61 -10
- package/dist/renderers/console.js +39 -3
- package/dist/renderers/ndjson.js +30 -1
- package/dist/renderers/tui.js +932 -0
- package/dist/update.js +2 -0
- package/dist/version.js +54 -0
- package/package.json +2 -1
package/dist/update.js
CHANGED
|
@@ -2,11 +2,13 @@ import { spawn } from "node:child_process";
|
|
|
2
2
|
import { access } from "node:fs/promises";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { getLatestPackageVersion } from "./version.js";
|
|
5
6
|
/** Détecte le mode d'installation (source ou package) à partir de la présence d'un dossier `.git`. */
|
|
6
7
|
export async function getUpdateInfo(version) {
|
|
7
8
|
const projectRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
8
9
|
return {
|
|
9
10
|
version,
|
|
11
|
+
latestVersion: await getLatestPackageVersion(),
|
|
10
12
|
projectRoot,
|
|
11
13
|
sourceCheckout: await exists(path.join(projectRoot, ".git"))
|
|
12
14
|
};
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
/** Lit la version depuis `package.json` adjacent au bundle compilé. */
|
|
5
|
+
export async function getPackageVersion() {
|
|
6
|
+
const packageJsonPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "package.json");
|
|
7
|
+
const raw = await readFile(packageJsonPath, "utf8");
|
|
8
|
+
const packageJson = JSON.parse(raw);
|
|
9
|
+
return packageJson.version ?? "0.0.0";
|
|
10
|
+
}
|
|
11
|
+
/** Compare deux versions semver simples `major.minor.patch`. */
|
|
12
|
+
export function compareSemver(left, right) {
|
|
13
|
+
const a = parseSemverParts(left);
|
|
14
|
+
const b = parseSemverParts(right);
|
|
15
|
+
for (let index = 0; index < 3; index += 1) {
|
|
16
|
+
const diff = a[index] - b[index];
|
|
17
|
+
if (diff !== 0) {
|
|
18
|
+
return diff;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
23
|
+
/** Lit la dernière version publiée sur npm. Retourne `undefined` hors ligne ou si le registre ne répond pas. */
|
|
24
|
+
export async function getLatestPackageVersion(timeoutMs = 1_500) {
|
|
25
|
+
const controller = new AbortController();
|
|
26
|
+
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
27
|
+
try {
|
|
28
|
+
const response = await fetch("https://registry.npmjs.org/palabre/latest", {
|
|
29
|
+
signal: controller.signal,
|
|
30
|
+
headers: {
|
|
31
|
+
accept: "application/json"
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
if (!response.ok) {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
const data = await response.json();
|
|
38
|
+
return typeof data.version === "string" ? data.version : undefined;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
clearTimeout(timeout);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function parseSemverParts(value) {
|
|
48
|
+
const match = value.match(/(\d+)\.(\d+)\.(\d+)/);
|
|
49
|
+
return [
|
|
50
|
+
Number(match?.[1] ?? 0),
|
|
51
|
+
Number(match?.[2] ?? 0),
|
|
52
|
+
Number(match?.[3] ?? 0)
|
|
53
|
+
];
|
|
54
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "palabre",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Orchestrateur de debat entre agents IA locaux, CLIs et Ollama.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"codex",
|
|
22
22
|
"claude",
|
|
23
23
|
"opencode",
|
|
24
|
+
"vibe",
|
|
24
25
|
"debate",
|
|
25
26
|
"orchestrator"
|
|
26
27
|
],
|