palabre 0.8.0 → 0.9.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 +13 -15
- package/dist/adapters/cli-pty.js +1 -1
- package/dist/adapters/cli.js +33 -3
- package/dist/adapters/index.js +2 -2
- package/dist/adapters/ollama.js +9 -7
- package/dist/agentRegistry.js +7 -2
- package/dist/args.js +5 -2
- package/dist/config.js +33 -25
- package/dist/context.js +5 -1
- package/dist/discovery.js +30 -9
- package/dist/doctor.js +19 -5
- package/dist/history.js +85 -0
- package/dist/index.js +450 -205
- package/dist/messages/common.js +6 -0
- package/dist/messages/config.js +2 -0
- package/dist/messages/doctor.js +2 -2
- package/dist/messages/help.js +64 -8
- package/dist/messages/init.js +2 -2
- package/dist/messages/tui.js +78 -28
- package/dist/ollamaUrl.js +76 -0
- package/dist/orchestrator.js +34 -13
- package/dist/presets.js +25 -52
- package/dist/renderers/tui.js +242 -77
- package/dist/tuiState.js +32 -0
- package/package.json +1 -1
- package/palabre.config.example.json +0 -17
package/dist/messages/common.js
CHANGED
|
@@ -15,6 +15,9 @@ export const commonMessages = {
|
|
|
15
15
|
configInvalidShape: (configPath) => `Config invalide: ${configPath} ne contient pas un objet JSON. Relance palabre init ou corrige le fichier.`,
|
|
16
16
|
configMissingAgents: (configPath) => `Config invalide: ${configPath} ne déclare pas de bloc "agents". Relance palabre init ou ajoute au moins un agent.`,
|
|
17
17
|
configEmptyAgents: (configPath) => `Config invalide: ${configPath} ne déclare aucun agent. Ajoute au moins un agent ou relance palabre init.`,
|
|
18
|
+
ollamaUrlEmpty: "L'adresse Ollama ne peut pas être vide.",
|
|
19
|
+
ollamaUrlInvalid: (value) => `Adresse Ollama invalide: ${value}.`,
|
|
20
|
+
ollamaUrlProtocol: (protocol) => `Protocole Ollama invalide: ${protocol}. Utilise http: ou https:.`,
|
|
18
21
|
errorPrefix: "Erreur"
|
|
19
22
|
},
|
|
20
23
|
en: {
|
|
@@ -33,6 +36,9 @@ export const commonMessages = {
|
|
|
33
36
|
configInvalidShape: (configPath) => `Invalid config: ${configPath} does not contain a JSON object. Run palabre init or fix the file.`,
|
|
34
37
|
configMissingAgents: (configPath) => `Invalid config: ${configPath} has no "agents" block. Run palabre init or add at least one agent.`,
|
|
35
38
|
configEmptyAgents: (configPath) => `Invalid config: ${configPath} declares no agent. Add at least one agent or run palabre init.`,
|
|
39
|
+
ollamaUrlEmpty: "The Ollama address cannot be empty.",
|
|
40
|
+
ollamaUrlInvalid: (value) => `Invalid Ollama address: ${value}.`,
|
|
41
|
+
ollamaUrlProtocol: (protocol) => `Invalid Ollama protocol: ${protocol}. Use http: or https:.`,
|
|
36
42
|
errorPrefix: "Error"
|
|
37
43
|
}
|
|
38
44
|
};
|
package/dist/messages/config.js
CHANGED
|
@@ -3,6 +3,7 @@ export const configMessages = {
|
|
|
3
3
|
createdForConfig: (path) => `${path} créé. Édite la config puis relance palabre config.`,
|
|
4
4
|
syncNoMissing: (path) => `Aucun agent détecté manquant dans ${path}.`,
|
|
5
5
|
syncAdded: (path, agents) => `Agents ajoutés dans ${path}: ${agents}.`,
|
|
6
|
+
syncRefreshed: (path) => `Agents détectés rafraîchis dans ${path}.`,
|
|
6
7
|
ollamaModelNoChange: (path, model) => `Modèle Ollama inchangé dans ${path}: ${model ?? "aucun"}.`,
|
|
7
8
|
ollamaModelUpdated: (path, previousModel, nextModel) => `Modèle Ollama mis à jour dans ${path}: ${previousModel} -> ${nextModel}.`,
|
|
8
9
|
ollamaModelUnavailable: (model) => `Modèle Ollama non installé: ${model}. Action: choisis un modèle installé ou lance \`ollama pull ${model}\`.`,
|
|
@@ -56,6 +57,7 @@ export const configMessages = {
|
|
|
56
57
|
createdForConfig: (path) => `${path} created. Edit the config, then run palabre config again.`,
|
|
57
58
|
syncNoMissing: (path) => `No missing detected agent in ${path}.`,
|
|
58
59
|
syncAdded: (path, agents) => `Agents added to ${path}: ${agents}.`,
|
|
60
|
+
syncRefreshed: (path) => `Detected agents refreshed in ${path}.`,
|
|
59
61
|
ollamaModelNoChange: (path, model) => `Ollama model unchanged in ${path}: ${model ?? "none"}.`,
|
|
60
62
|
ollamaModelUpdated: (path, previousModel, nextModel) => `Ollama model updated in ${path}: ${previousModel} -> ${nextModel}.`,
|
|
61
63
|
ollamaModelUnavailable: (model) => `Ollama model is not installed: ${model}. Action: choose an installed model or run \`ollama pull ${model}\`.`,
|
package/dist/messages/doctor.js
CHANGED
|
@@ -41,7 +41,7 @@ export const doctorMessages = {
|
|
|
41
41
|
promptModeInvalid: (name, value) => `${name}: promptMode invalide (${value}). Valeurs attendues: stdin ou argument.`,
|
|
42
42
|
positiveTimeout: (name, field) => `${name}: ${field} doit être un nombre positif.`,
|
|
43
43
|
ollamaModelMissing: (name) => `${name}: modèle Ollama absent.`,
|
|
44
|
-
ollamaBaseUrlInvalid: (name, value) => `${name}: baseUrl Ollama invalide (${value}). Attendu:
|
|
44
|
+
ollamaBaseUrlInvalid: (name, value) => `${name}: baseUrl Ollama invalide (${value}). Attendu: une adresse HTTP(S), avec ou sans schema.`,
|
|
45
45
|
customCommand: (prefix) => `${prefix} (commande custom non vérifiée par doctor)`,
|
|
46
46
|
cliDetected: (prefix, path) => `${prefix} détectée (${path})`,
|
|
47
47
|
cliMissing: (prefix) => `${prefix} non détectée dans PATH. Action: installe/authentifie la CLI ou corrige command dans la config.`,
|
|
@@ -107,7 +107,7 @@ export const doctorMessages = {
|
|
|
107
107
|
promptModeInvalid: (name, value) => `${name}: invalid promptMode (${value}). Expected values: stdin or argument.`,
|
|
108
108
|
positiveTimeout: (name, field) => `${name}: ${field} must be a positive number.`,
|
|
109
109
|
ollamaModelMissing: (name) => `${name}: missing Ollama model.`,
|
|
110
|
-
ollamaBaseUrlInvalid: (name, value) => `${name}: invalid Ollama baseUrl (${value}). Expected:
|
|
110
|
+
ollamaBaseUrlInvalid: (name, value) => `${name}: invalid Ollama baseUrl (${value}). Expected: an HTTP(S) address, with or without a scheme.`,
|
|
111
111
|
customCommand: (prefix) => `${prefix} (custom command not checked by doctor)`,
|
|
112
112
|
cliDetected: (prefix, path) => `${prefix} detected (${path})`,
|
|
113
113
|
cliMissing: (prefix) => `${prefix} not detected in PATH. Action: install/authenticate the CLI or fix command in the config.`,
|
package/dist/messages/help.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
const frCommandHelp = {
|
|
2
2
|
init: `
|
|
3
|
-
Initialise une configuration Palabre.
|
|
3
|
+
Initialise explicitement une configuration Palabre.
|
|
4
|
+
|
|
5
|
+
Note:
|
|
6
|
+
palabre sans argument cree deja la configuration globale au premier lancement TUI.
|
|
4
7
|
|
|
5
8
|
Usage:
|
|
6
9
|
palabre init [flags]
|
|
@@ -19,6 +22,7 @@ Usage:
|
|
|
19
22
|
Flags:
|
|
20
23
|
--config <path> chemin de config explicite
|
|
21
24
|
--language <fr|en> force la langue
|
|
25
|
+
--json sortie JSON pour les integrations
|
|
22
26
|
`,
|
|
23
27
|
presets: `
|
|
24
28
|
Liste les presets de paires d'agents.
|
|
@@ -26,6 +30,28 @@ Liste les presets de paires d'agents.
|
|
|
26
30
|
Usage:
|
|
27
31
|
palabre presets [flags]
|
|
28
32
|
|
|
33
|
+
Flags:
|
|
34
|
+
--json sortie structuree pour integrations
|
|
35
|
+
--config <path> chemin de config explicite
|
|
36
|
+
`,
|
|
37
|
+
history: `
|
|
38
|
+
Liste les derniers exports Palabre.
|
|
39
|
+
|
|
40
|
+
Usage:
|
|
41
|
+
palabre history [flags]
|
|
42
|
+
palabre historique [flags]
|
|
43
|
+
|
|
44
|
+
Flags:
|
|
45
|
+
--json sortie structuree pour integrations
|
|
46
|
+
--config <path> chemin de config explicite
|
|
47
|
+
`,
|
|
48
|
+
historique: `
|
|
49
|
+
Liste les derniers exports Palabre.
|
|
50
|
+
|
|
51
|
+
Usage:
|
|
52
|
+
palabre history [flags]
|
|
53
|
+
palabre historique [flags]
|
|
54
|
+
|
|
29
55
|
Flags:
|
|
30
56
|
--json sortie structuree pour integrations
|
|
31
57
|
--config <path> chemin de config explicite
|
|
@@ -56,7 +82,7 @@ Usage:
|
|
|
56
82
|
|
|
57
83
|
Flags:
|
|
58
84
|
--clear-defaults supprime les parametres par defaut
|
|
59
|
-
--sync-agents ajoute les agents detectes manquants
|
|
85
|
+
--sync-agents ajoute les agents detectes manquants et rafraichit les commandes connues
|
|
60
86
|
--config <path> chemin de config explicite
|
|
61
87
|
`,
|
|
62
88
|
new: `
|
|
@@ -104,6 +130,7 @@ Flags:
|
|
|
104
130
|
--preset <name> preset d'agents
|
|
105
131
|
--agent-a <name> premier agent
|
|
106
132
|
--agent-b <name> second agent
|
|
133
|
+
--ollama-url <url> surcharge l'adresse Ollama pour cette session
|
|
107
134
|
--tui force l'interface TUI
|
|
108
135
|
--terminal force le rendu terminal brut
|
|
109
136
|
--renderer <kind> auto, pretty, plain, tui ou ndjson
|
|
@@ -119,6 +146,7 @@ Usage:
|
|
|
119
146
|
Flags:
|
|
120
147
|
--agents <names...> agents qui repondent, 4 maximum
|
|
121
148
|
--summary-agent <n> agent de synthese pour ce lancement
|
|
149
|
+
--ollama-url <url> surcharge l'adresse Ollama pour cette session
|
|
122
150
|
--tui force l'interface TUI
|
|
123
151
|
--terminal force le rendu terminal brut
|
|
124
152
|
--renderer <kind> auto, pretty, plain, tui ou ndjson
|
|
@@ -127,7 +155,10 @@ Flags:
|
|
|
127
155
|
};
|
|
128
156
|
const enCommandHelp = {
|
|
129
157
|
init: `
|
|
130
|
-
|
|
158
|
+
Explicitly initializes a Palabre configuration.
|
|
159
|
+
|
|
160
|
+
Note:
|
|
161
|
+
palabre without arguments already creates the global configuration on first TUI launch.
|
|
131
162
|
|
|
132
163
|
Usage:
|
|
133
164
|
palabre init [flags]
|
|
@@ -146,6 +177,7 @@ Usage:
|
|
|
146
177
|
Flags:
|
|
147
178
|
--config <path> explicit config path
|
|
148
179
|
--language <fr|en> forces the language
|
|
180
|
+
--json JSON output for integrations
|
|
149
181
|
`,
|
|
150
182
|
presets: `
|
|
151
183
|
Lists agent-pair presets.
|
|
@@ -153,6 +185,28 @@ Lists agent-pair presets.
|
|
|
153
185
|
Usage:
|
|
154
186
|
palabre presets [flags]
|
|
155
187
|
|
|
188
|
+
Flags:
|
|
189
|
+
--json structured output for integrations
|
|
190
|
+
--config <path> explicit config path
|
|
191
|
+
`,
|
|
192
|
+
history: `
|
|
193
|
+
Lists recent Palabre exports.
|
|
194
|
+
|
|
195
|
+
Usage:
|
|
196
|
+
palabre history [flags]
|
|
197
|
+
palabre historique [flags]
|
|
198
|
+
|
|
199
|
+
Flags:
|
|
200
|
+
--json structured output for integrations
|
|
201
|
+
--config <path> explicit config path
|
|
202
|
+
`,
|
|
203
|
+
historique: `
|
|
204
|
+
Lists recent Palabre exports.
|
|
205
|
+
|
|
206
|
+
Usage:
|
|
207
|
+
palabre history [flags]
|
|
208
|
+
palabre historique [flags]
|
|
209
|
+
|
|
156
210
|
Flags:
|
|
157
211
|
--json structured output for integrations
|
|
158
212
|
--config <path> explicit config path
|
|
@@ -183,7 +237,7 @@ Usage:
|
|
|
183
237
|
|
|
184
238
|
Flags:
|
|
185
239
|
--clear-defaults clears default settings
|
|
186
|
-
--sync-agents adds missing detected agents
|
|
240
|
+
--sync-agents adds missing detected agents and refreshes known commands
|
|
187
241
|
--config <path> explicit config path
|
|
188
242
|
`,
|
|
189
243
|
new: `
|
|
@@ -231,6 +285,7 @@ Flags:
|
|
|
231
285
|
--preset <name> agent preset
|
|
232
286
|
--agent-a <name> first agent
|
|
233
287
|
--agent-b <name> second agent
|
|
288
|
+
--ollama-url <url> overrides the Ollama address for this session
|
|
234
289
|
--tui forces the TUI interface
|
|
235
290
|
--terminal forces raw terminal rendering
|
|
236
291
|
--renderer <kind> auto, pretty, plain, tui, or ndjson
|
|
@@ -246,6 +301,7 @@ Usage:
|
|
|
246
301
|
Flags:
|
|
247
302
|
--agents <names...> responding agents, 4 maximum
|
|
248
303
|
--summary-agent <n> summary agent for this run
|
|
304
|
+
--ollama-url <url> overrides the Ollama address for this session
|
|
249
305
|
--tui forces the TUI interface
|
|
250
306
|
--terminal forces raw terminal rendering
|
|
251
307
|
--renderer <kind> auto, pretty, plain, tui, or ndjson
|
|
@@ -268,18 +324,18 @@ Usage:
|
|
|
268
324
|
palabre ask "Sujet" --agents codex claude
|
|
269
325
|
|
|
270
326
|
Demarrage rapide:
|
|
271
|
-
palabre init
|
|
272
327
|
palabre
|
|
273
328
|
palabre new
|
|
274
329
|
palabre "Faut-il ajouter une TUI a Palabre ?"
|
|
275
330
|
palabre codex-claude "Comparer deux solutions" -t 4
|
|
276
331
|
|
|
277
332
|
Commandes:
|
|
278
|
-
init Creer une configuration
|
|
333
|
+
init Creer explicitement une configuration
|
|
279
334
|
new Assistant interactif de debat
|
|
280
335
|
ask Demande multi-agents independante
|
|
281
336
|
agents Lister les agents configures
|
|
282
337
|
presets Lister les presets disponibles
|
|
338
|
+
history Lister les derniers exports
|
|
283
339
|
context Scanner le contexte projet
|
|
284
340
|
config Modifier les parametres par defaut
|
|
285
341
|
doctor Verifier la config et les outils locaux
|
|
@@ -319,18 +375,18 @@ Usage:
|
|
|
319
375
|
palabre ask "Subject" --agents codex claude
|
|
320
376
|
|
|
321
377
|
Quick start:
|
|
322
|
-
palabre init
|
|
323
378
|
palabre
|
|
324
379
|
palabre new
|
|
325
380
|
palabre "Should Palabre add a TUI?"
|
|
326
381
|
palabre codex-claude "Compare two solutions" -t 4
|
|
327
382
|
|
|
328
383
|
Commands:
|
|
329
|
-
init
|
|
384
|
+
init Explicitly create a configuration
|
|
330
385
|
new Interactive debate assistant
|
|
331
386
|
ask Independent multi-agent request
|
|
332
387
|
agents List configured agents
|
|
333
388
|
presets List available presets
|
|
389
|
+
history List recent exports
|
|
334
390
|
context Scan project context
|
|
335
391
|
config Edit default settings
|
|
336
392
|
doctor Check config and local tools
|
package/dist/messages/init.js
CHANGED
|
@@ -10,7 +10,7 @@ export const initMessages = {
|
|
|
10
10
|
ollamaMissing: "non détecté",
|
|
11
11
|
ollamaDetected: (modelCount) => `détectée (${modelCount} modèle${modelCount > 1 ? "s" : ""})`,
|
|
12
12
|
defaults: (agentA, agentB) => `Défauts: ${agentA} <-> ${agentB}`,
|
|
13
|
-
noDefaultPair: (detectedAgents) => `Défauts: ${detectedAgents}. Palabre a besoin d'au moins deux agents.\nAgents compatibles: Codex CLI, Claude CLI,
|
|
13
|
+
noDefaultPair: (detectedAgents) => `Défauts: ${detectedAgents}. Palabre a besoin d'au moins deux agents.\nAgents compatibles: Codex CLI, Claude CLI, Antigravity CLI, OpenCode CLI, Mistral Vibe CLI, Ollama local.\nGuide: https://palab.re/fr/agents/overview`,
|
|
14
14
|
languageHint: (language) => `Langue: ${language}\nEnglish > palabre config --language en`
|
|
15
15
|
},
|
|
16
16
|
en: {
|
|
@@ -24,7 +24,7 @@ export const initMessages = {
|
|
|
24
24
|
ollamaMissing: "not detected",
|
|
25
25
|
ollamaDetected: (modelCount) => `detected (${modelCount} model${modelCount > 1 ? "s" : ""})`,
|
|
26
26
|
defaults: (agentA, agentB) => `Defaults: ${agentA} <-> ${agentB}`,
|
|
27
|
-
noDefaultPair: (detectedAgents) => `Defaults: ${detectedAgents}. Palabre needs at least two agents.\nCompatible agents: Codex CLI, Claude CLI,
|
|
27
|
+
noDefaultPair: (detectedAgents) => `Defaults: ${detectedAgents}. Palabre needs at least two agents.\nCompatible agents: Codex CLI, Claude CLI, Antigravity CLI, OpenCode CLI, Mistral Vibe CLI, local Ollama.\nGuide: https://palab.re/en/agents/overview`,
|
|
28
28
|
languageHint: (language) => `Language: ${language}\nFrançais > palabre config --language fr`
|
|
29
29
|
}
|
|
30
30
|
};
|
package/dist/messages/tui.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export const tuiMessages = {
|
|
2
2
|
fr: {
|
|
3
3
|
tagline: "Orchestrez des conversations entre agents IA",
|
|
4
|
+
updateAvailable: (current, latest) => `Mise a jour disponible: ${current} -> ${latest}. Utilise /update.`,
|
|
4
5
|
modeLabel: (mode) => mode === "ask" ? "Ask" : "Debat",
|
|
5
6
|
modeValue: (mode) => mode === "ask" ? "Ask" : "Debat",
|
|
6
7
|
noValue: "non definis",
|
|
7
8
|
lastAskAgent: "dernier agent ask",
|
|
8
9
|
roles: "Roles",
|
|
9
10
|
summary: "Synthese",
|
|
10
|
-
|
|
11
|
+
ollamaModel: "Modele Ollama",
|
|
12
|
+
ollamaUrl: "Adresse Ollama configuree",
|
|
13
|
+
ollamaUrlEffective: "Adresse Ollama effective",
|
|
14
|
+
responses: "Tours",
|
|
11
15
|
folder: "Dossier",
|
|
12
16
|
docs: "Docs",
|
|
13
17
|
commands: "commandes",
|
|
@@ -15,15 +19,25 @@ export const tuiMessages = {
|
|
|
15
19
|
changeMode: "changer de mode",
|
|
16
20
|
tipContext: "* Tip Ajoute du contexte avec --context <dossier> ou --files <fichier>.",
|
|
17
21
|
helpTitle: "Commandes TUI",
|
|
18
|
-
helpAsk: "
|
|
19
|
-
helpDebate: "
|
|
20
|
-
helpAgents: "
|
|
21
|
-
helpRoles: "
|
|
22
|
-
helpConfig: "
|
|
23
|
-
helpNew: "
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
helpAsk: "mode Ask",
|
|
23
|
+
helpDebate: "mode Debat",
|
|
24
|
+
helpAgents: "choisir les agents",
|
|
25
|
+
helpRoles: "choisir les roles",
|
|
26
|
+
helpConfig: "reglages",
|
|
27
|
+
helpNew: "assistant guide",
|
|
28
|
+
helpRetry: "relancer la derniere session",
|
|
29
|
+
helpHistory: "voir les derniers exports",
|
|
30
|
+
helpUpdate: "voir les informations de mise a jour",
|
|
31
|
+
helpHelp: "aide",
|
|
32
|
+
helpQuit: "quitter",
|
|
33
|
+
helpFallback: "Tape un sujet ou une commande.",
|
|
34
|
+
historyTitle: "Historique Palabre",
|
|
35
|
+
historyEmpty: "Aucun export trouve pour le moment.",
|
|
36
|
+
historyOpenHint: "Le chemin du fichier est cliquable dans les terminaux compatibles.",
|
|
37
|
+
historyFile: "Fichier",
|
|
38
|
+
historyMode: (mode) => mode === "ask" ? "Mode ask" : "Mode debat",
|
|
39
|
+
historyCount: (mode) => mode === "ask" ? "Reponses" : "Tours",
|
|
40
|
+
retryUnavailable: "Aucune session a relancer pour le moment.",
|
|
27
41
|
agentsTitle: "Agents Palabre",
|
|
28
42
|
activeMode: "Mode actif",
|
|
29
43
|
activeAgents: "Agents actifs",
|
|
@@ -46,8 +60,7 @@ export const tuiMessages = {
|
|
|
46
60
|
availableCommands: "Commandes disponibles",
|
|
47
61
|
noConfiguredAgents: "aucun agent configure",
|
|
48
62
|
or: "ou",
|
|
49
|
-
|
|
50
|
-
modeConfigCommand: "changer de mode de configuration",
|
|
63
|
+
modeConfigCommand: "basculer et definir par defaut",
|
|
51
64
|
backCommand: "revenir a l'accueil",
|
|
52
65
|
quitCommand: "quitter",
|
|
53
66
|
subject: "Sujet",
|
|
@@ -55,6 +68,7 @@ export const tuiMessages = {
|
|
|
55
68
|
agentsPrompt: "Agents",
|
|
56
69
|
rolesPrompt: "Roles",
|
|
57
70
|
sessionDone: "Session terminee",
|
|
71
|
+
sessionHistoryHint: "Retrouvez vos exports avec /history.",
|
|
58
72
|
askResponse: (response, totalResponses) => `reponse ${response}/${totalResponses}`,
|
|
59
73
|
turnLabel: (turn) => `tour ${turn}`,
|
|
60
74
|
planTitle: "Plan de session",
|
|
@@ -64,9 +78,17 @@ export const tuiMessages = {
|
|
|
64
78
|
planSummaryDisabled: "Synthese desactivee",
|
|
65
79
|
planExport: "Export Markdown",
|
|
66
80
|
ptyNotice: (agents) => `Note: ${agents} utilise un pseudo-terminal; une fenetre peut apparaitre brievement.`,
|
|
67
|
-
unknownCommand: "Commande inconnue. Utilise /
|
|
68
|
-
turnsUsage: "Usage: /turns <
|
|
81
|
+
unknownCommand: "Commande inconnue. Utilise /home pour revenir.",
|
|
82
|
+
turnsUsage: "Usage: /turns <tours>",
|
|
69
83
|
summaryUsage: "Usage: /summary <agent|none>",
|
|
84
|
+
ollamaModelUsage: "Usage: /ollama-model <modele>",
|
|
85
|
+
ollamaUrlUsage: "Usage: /ollama-url <url|default>",
|
|
86
|
+
interfaceUsage: "Usage: /interface <tui|terminal>",
|
|
87
|
+
languageUsage: "Usage: /language <fr|en>",
|
|
88
|
+
rolesUsage: "Usage: /roles <role...>",
|
|
89
|
+
ollamaInfoCommand: "afficher modeles installes",
|
|
90
|
+
ollamaUrlCommand: "modifier l'adresse (<url|default>)",
|
|
91
|
+
ollamaSyncCommand: "choisir un modele installe disponible",
|
|
70
92
|
interfaceDefault: (value) => `Interface par defaut: ${value}.`,
|
|
71
93
|
languageUpdated: (value) => `Langue mise a jour: ${value}.`,
|
|
72
94
|
askConfigMode: "Configuration Ask.",
|
|
@@ -81,6 +103,9 @@ export const tuiMessages = {
|
|
|
81
103
|
debateSummaryFallback: "Synthese Debat revenue au fallback.",
|
|
82
104
|
askSummaryAgent: (value) => `Synthese Ask: ${value}.`,
|
|
83
105
|
debateSummaryAgent: (value) => `Synthese Debat: ${value}.`,
|
|
106
|
+
ollamaInfo: (current, installed, api) => `Ollama ${api}. Modele actuel: ${current}. Modeles installes: ${installed}.`,
|
|
107
|
+
ollamaUrlUpdated: (configured, effective) => configured === effective ? `Adresse Ollama mise a jour: ${configured}.` : `Adresse Ollama configuree: ${configured}. Adresse effective via OLLAMA_HOST: ${effective}.`,
|
|
108
|
+
ollamaUnavailable: (baseUrl) => `API Ollama indisponible (${baseUrl}). Lance ollama serve puis reessaie /ollama.`,
|
|
84
109
|
askAgentsUpdated: (value) => `Agents Ask mis a jour: ${value}.`,
|
|
85
110
|
debateAgentsUpdated: (value) => `Agents Debat mis a jour: ${value}.`,
|
|
86
111
|
askRolesUpdated: (value) => `Roles Ask mis a jour: ${value}.`,
|
|
@@ -96,13 +121,17 @@ export const tuiMessages = {
|
|
|
96
121
|
},
|
|
97
122
|
en: {
|
|
98
123
|
tagline: "Orchestrate conversations between AI agents",
|
|
124
|
+
updateAvailable: (current, latest) => `Update available: ${current} -> ${latest}. Use /update.`,
|
|
99
125
|
modeLabel: (mode) => mode === "ask" ? "Ask" : "Debate",
|
|
100
126
|
modeValue: (mode) => mode === "ask" ? "Ask" : "Debate",
|
|
101
127
|
noValue: "not set",
|
|
102
128
|
lastAskAgent: "last ask agent",
|
|
103
129
|
roles: "Roles",
|
|
104
130
|
summary: "Summary",
|
|
105
|
-
|
|
131
|
+
ollamaModel: "Ollama model",
|
|
132
|
+
ollamaUrl: "Configured Ollama address",
|
|
133
|
+
ollamaUrlEffective: "Effective Ollama address",
|
|
134
|
+
responses: "Turns",
|
|
106
135
|
folder: "Folder",
|
|
107
136
|
docs: "Docs",
|
|
108
137
|
commands: "commands",
|
|
@@ -110,15 +139,25 @@ export const tuiMessages = {
|
|
|
110
139
|
changeMode: "change mode",
|
|
111
140
|
tipContext: "* Tip Add context with --context <folder> or --files <file>.",
|
|
112
141
|
helpTitle: "TUI Commands",
|
|
113
|
-
helpAsk: "
|
|
114
|
-
helpDebate: "
|
|
115
|
-
helpAgents: "
|
|
116
|
-
helpRoles: "
|
|
117
|
-
helpConfig: "
|
|
118
|
-
helpNew: "
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
142
|
+
helpAsk: "Ask mode",
|
|
143
|
+
helpDebate: "Debate mode",
|
|
144
|
+
helpAgents: "choose agents",
|
|
145
|
+
helpRoles: "choose roles",
|
|
146
|
+
helpConfig: "settings",
|
|
147
|
+
helpNew: "guided assistant",
|
|
148
|
+
helpRetry: "rerun the last session",
|
|
149
|
+
helpHistory: "show recent exports",
|
|
150
|
+
helpUpdate: "show update information",
|
|
151
|
+
helpHelp: "help",
|
|
152
|
+
helpQuit: "quit",
|
|
153
|
+
helpFallback: "Type a topic or a command.",
|
|
154
|
+
historyTitle: "Palabre History",
|
|
155
|
+
historyEmpty: "No export found yet.",
|
|
156
|
+
historyOpenHint: "The file path is clickable in compatible terminals.",
|
|
157
|
+
historyFile: "File",
|
|
158
|
+
historyMode: (mode) => mode === "ask" ? "Ask mode" : "Debate mode",
|
|
159
|
+
historyCount: (mode) => mode === "ask" ? "Responses" : "Turns",
|
|
160
|
+
retryUnavailable: "No session to retry yet.",
|
|
122
161
|
agentsTitle: "Palabre Agents",
|
|
123
162
|
activeMode: "Active mode",
|
|
124
163
|
activeAgents: "Active agents",
|
|
@@ -141,8 +180,7 @@ export const tuiMessages = {
|
|
|
141
180
|
availableCommands: "Available commands",
|
|
142
181
|
noConfiguredAgents: "no configured agent",
|
|
143
182
|
or: "or",
|
|
144
|
-
|
|
145
|
-
modeConfigCommand: "change configuration mode",
|
|
183
|
+
modeConfigCommand: "switch and set as default",
|
|
146
184
|
backCommand: "return to home",
|
|
147
185
|
quitCommand: "quit",
|
|
148
186
|
subject: "Subject",
|
|
@@ -150,6 +188,7 @@ export const tuiMessages = {
|
|
|
150
188
|
agentsPrompt: "Agents",
|
|
151
189
|
rolesPrompt: "Roles",
|
|
152
190
|
sessionDone: "Session complete",
|
|
191
|
+
sessionHistoryHint: "Find your exports again with /history.",
|
|
153
192
|
askResponse: (response, totalResponses) => `response ${response}/${totalResponses}`,
|
|
154
193
|
turnLabel: (turn) => `turn ${turn}`,
|
|
155
194
|
planTitle: "Session plan",
|
|
@@ -159,9 +198,17 @@ export const tuiMessages = {
|
|
|
159
198
|
planSummaryDisabled: "Summary disabled",
|
|
160
199
|
planExport: "Markdown export",
|
|
161
200
|
ptyNotice: (agents) => `Note: ${agents} uses a pseudo-terminal; a window may briefly appear.`,
|
|
162
|
-
unknownCommand: "Unknown command. Use /
|
|
163
|
-
turnsUsage: "Usage: /turns <
|
|
201
|
+
unknownCommand: "Unknown command. Use /home to return.",
|
|
202
|
+
turnsUsage: "Usage: /turns <turns>",
|
|
164
203
|
summaryUsage: "Usage: /summary <agent|none>",
|
|
204
|
+
ollamaModelUsage: "Usage: /ollama-model <model>",
|
|
205
|
+
ollamaUrlUsage: "Usage: /ollama-url <url|default>",
|
|
206
|
+
interfaceUsage: "Usage: /interface <tui|terminal>",
|
|
207
|
+
languageUsage: "Usage: /language <fr|en>",
|
|
208
|
+
rolesUsage: "Usage: /roles <role...>",
|
|
209
|
+
ollamaInfoCommand: "show installed models",
|
|
210
|
+
ollamaUrlCommand: "change the address (<url|default>)",
|
|
211
|
+
ollamaSyncCommand: "choose an available installed model",
|
|
165
212
|
interfaceDefault: (value) => `Default interface: ${value}.`,
|
|
166
213
|
languageUpdated: (value) => `Language updated: ${value}.`,
|
|
167
214
|
askConfigMode: "Ask configuration.",
|
|
@@ -176,6 +223,9 @@ export const tuiMessages = {
|
|
|
176
223
|
debateSummaryFallback: "Debate summary returned to fallback.",
|
|
177
224
|
askSummaryAgent: (value) => `Ask summary: ${value}.`,
|
|
178
225
|
debateSummaryAgent: (value) => `Debate summary: ${value}.`,
|
|
226
|
+
ollamaInfo: (current, installed, api) => `Ollama ${api}. Current model: ${current}. Installed models: ${installed}.`,
|
|
227
|
+
ollamaUrlUpdated: (configured, effective) => configured === effective ? `Ollama address updated: ${configured}.` : `Ollama address configured: ${configured}. Effective address from OLLAMA_HOST: ${effective}.`,
|
|
228
|
+
ollamaUnavailable: (baseUrl) => `Ollama API unavailable (${baseUrl}). Run ollama serve, then try /ollama again.`,
|
|
179
229
|
askAgentsUpdated: (value) => `Ask agents updated: ${value}.`,
|
|
180
230
|
debateAgentsUpdated: (value) => `Debate agents updated: ${value}.`,
|
|
181
231
|
askRolesUpdated: (value) => `Ask roles updated: ${value}.`,
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export const DEFAULT_OLLAMA_BASE_URL = "http://localhost:11434";
|
|
2
|
+
export class OllamaUrlError extends Error {
|
|
3
|
+
kind;
|
|
4
|
+
value;
|
|
5
|
+
protocol;
|
|
6
|
+
constructor(kind, value, protocol) {
|
|
7
|
+
super(kind === "empty"
|
|
8
|
+
? "Invalid Ollama URL: the value is empty."
|
|
9
|
+
: kind === "protocol"
|
|
10
|
+
? `Invalid Ollama URL protocol: ${protocol ?? ""}`
|
|
11
|
+
: `Invalid Ollama URL: ${value}`);
|
|
12
|
+
this.kind = kind;
|
|
13
|
+
this.value = value;
|
|
14
|
+
this.protocol = protocol;
|
|
15
|
+
this.name = "OllamaUrlError";
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Résout l'adresse client Ollama selon la priorité produit :
|
|
20
|
+
* flag CLI > OLLAMA_HOST > config agent > serveur local par défaut.
|
|
21
|
+
*/
|
|
22
|
+
export function resolveOllamaBaseUrl(sources = {}) {
|
|
23
|
+
const value = firstNonEmpty(sources.cliUrl, sources.envUrl ?? process.env.OLLAMA_HOST, sources.configUrl, DEFAULT_OLLAMA_BASE_URL);
|
|
24
|
+
return normalizeOllamaBaseUrl(value);
|
|
25
|
+
}
|
|
26
|
+
/** Normalise les formats acceptés par Ollama en URL HTTP(S) utilisable par fetch. */
|
|
27
|
+
export function normalizeOllamaBaseUrl(value) {
|
|
28
|
+
const trimmed = value.trim();
|
|
29
|
+
if (!trimmed) {
|
|
30
|
+
throw new OllamaUrlError("empty", value);
|
|
31
|
+
}
|
|
32
|
+
const withHost = trimmed.startsWith(":") ? `127.0.0.1${trimmed}` : trimmed;
|
|
33
|
+
const hasExplicitScheme = withHost.includes("://");
|
|
34
|
+
const withScheme = hasExplicitScheme ? withHost : `http://${withHost}`;
|
|
35
|
+
let url;
|
|
36
|
+
try {
|
|
37
|
+
url = new URL(withScheme);
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
throw new OllamaUrlError("invalid", value);
|
|
41
|
+
}
|
|
42
|
+
if (url.protocol !== "http:" && url.protocol !== "https:") {
|
|
43
|
+
throw new OllamaUrlError("protocol", value, url.protocol);
|
|
44
|
+
}
|
|
45
|
+
if (!url.hostname || url.username || url.password || url.search || url.hash) {
|
|
46
|
+
throw new OllamaUrlError("invalid", value);
|
|
47
|
+
}
|
|
48
|
+
if (!hasExplicitScheme && !url.port) {
|
|
49
|
+
url.port = "11434";
|
|
50
|
+
}
|
|
51
|
+
if (url.hostname === "0.0.0.0") {
|
|
52
|
+
url.hostname = "127.0.0.1";
|
|
53
|
+
}
|
|
54
|
+
else if (url.hostname === "[::]") {
|
|
55
|
+
url.hostname = "[::1]";
|
|
56
|
+
}
|
|
57
|
+
return url.toString().replace(/\/+$/, "");
|
|
58
|
+
}
|
|
59
|
+
/** Retourne l'URL configurée pour l'agent Ollama principal, puis le premier agent Ollama. */
|
|
60
|
+
export function configuredOllamaBaseUrl(config) {
|
|
61
|
+
const primary = config.agents["ollama-local"];
|
|
62
|
+
if (primary?.type === "ollama" && primary.baseUrl) {
|
|
63
|
+
return primary.baseUrl;
|
|
64
|
+
}
|
|
65
|
+
const configured = Object.values(config.agents).find((agent) => agent.type === "ollama" && agent.baseUrl);
|
|
66
|
+
return configured?.type === "ollama" ? configured.baseUrl : undefined;
|
|
67
|
+
}
|
|
68
|
+
/** Retourne les URL configurées par nom d'agent Ollama. */
|
|
69
|
+
export function configuredOllamaTargets(config) {
|
|
70
|
+
return Object.fromEntries(Object.entries(config.agents)
|
|
71
|
+
.filter(([, agent]) => agent.type === "ollama")
|
|
72
|
+
.map(([name, agent]) => [name, agent.type === "ollama" ? agent.baseUrl : undefined]));
|
|
73
|
+
}
|
|
74
|
+
function firstNonEmpty(...values) {
|
|
75
|
+
return values.find((value) => Boolean(value?.trim())) ?? DEFAULT_OLLAMA_BASE_URL;
|
|
76
|
+
}
|