poad 2.46.0 → 2.47.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/package.json +1 -1
- package/project/logs.js +6 -0
- package/test/logs.test.js +11 -0
- package/utils/help-details.js +2 -0
- package/utils/logline.js +2 -2
package/package.json
CHANGED
package/project/logs.js
CHANGED
|
@@ -21,6 +21,12 @@
|
|
|
21
21
|
// poad logs ai provider=openai les appels au socle IA (engine 0.30+) d'un fournisseur ;
|
|
22
22
|
// model=gpt-5 ; outcome= vaut aussi pour eux (ok, provider_error,
|
|
23
23
|
// budget_exceeded, no_credential, forbidden, invalid)
|
|
24
|
+
// poad logs data table=notes le temps réel d'une table (engine 0.32+) : abonnements,
|
|
25
|
+
// changements livrés (opération, clé, destinataires après le RLS)
|
|
26
|
+
// poad logs data channel=notes un canal temps réel : abonnements, entrées et sorties
|
|
27
|
+
// poad logs data event=realtime_change les changements livrés (realtime_subscribed,
|
|
28
|
+
// realtime_unsubscribed, realtime_joined, realtime_left,
|
|
29
|
+
// realtime_closed, realtime_error, realtime_change_summary)
|
|
24
30
|
// poad logs limit=500 nombre de lignes (100 par défaut)
|
|
25
31
|
// poad logs -f | --follow suivi en direct
|
|
26
32
|
// poad logs --json une ligne JSON par entrée (pour jq)
|
package/test/logs.test.js
CHANGED
|
@@ -23,6 +23,17 @@ test('logs : tool= et outcome= portent sur les attributs du même nom', () => {
|
|
|
23
23
|
assert.match(attrConditions({ outcome: '' }).error, /outcome=<outcome>/);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
+
test('logs : table= et channel= (temps réel, engine 0.32+) portent sur les attributs du même nom', () => {
|
|
27
|
+
const r = attrConditions({ table: 'rt_notes', channel: 'notes', event: 'realtime_change' });
|
|
28
|
+
assert.deepStrictEqual(r.conditions, [
|
|
29
|
+
["attrs->>'event' = ?", 'realtime_change'],
|
|
30
|
+
["attrs->>'table' = ?", 'rt_notes'],
|
|
31
|
+
["attrs->>'channel' = ?", 'notes'],
|
|
32
|
+
]);
|
|
33
|
+
assert.match(attrConditions({ table: true }).error, /table=<name>: a value is expected, such as table=notes/);
|
|
34
|
+
assert.match(attrConditions({ channel: '' }).error, /channel=<name>: a value is expected, such as channel=notes/);
|
|
35
|
+
});
|
|
36
|
+
|
|
26
37
|
test('logs : token= par le nom, le préfixe, l’id entier ou son début', () => {
|
|
27
38
|
assert.deepStrictEqual(parseToken('Claude Code de Marie'), { name: 'Claude Code de Marie', prefix: null, id: null, idStart: null });
|
|
28
39
|
assert.deepStrictEqual(parseToken('ab12cd34'), { name: 'ab12cd34', prefix: 'ab12cd34', id: null, idStart: 'ab12cd34' });
|
package/utils/help-details.js
CHANGED
|
@@ -95,6 +95,8 @@ const sheets = {
|
|
|
95
95
|
['provider=<provider>', 'calls to an AI provider (engine 0.30+), e.g. poad logs ai provider=openai'],
|
|
96
96
|
['model=<model>', 'calls to an AI model'],
|
|
97
97
|
['event=<event>', 'an event, e.g. ai_default_model_changed'],
|
|
98
|
+
['table=<table>', 'lines about a table: realtime subscriptions and changes delivered (engine 0.32+), data errors'],
|
|
99
|
+
['channel=<name>', 'a realtime channel (engine 0.32+): joins, leaves, subscriptions, deliveries'],
|
|
98
100
|
['limit=100', 'number of lines'],
|
|
99
101
|
['-f, --follow', 'follow live'],
|
|
100
102
|
['--json', 'one JSON line per entry (for jq)'],
|
package/utils/logline.js
CHANGED
|
@@ -5,8 +5,8 @@ const LEVELS = ['debug', 'info', 'warn', 'error', 'fatal'];
|
|
|
5
5
|
|
|
6
6
|
// Options de filtre → attribut de la ligne (attrs). Mêmes noms et même sens
|
|
7
7
|
// que les paramètres de /logs/v1 (services/logs/src/api.ts de l'infra).
|
|
8
|
-
const ATTR_OPTIONS = { flow: 'flow', step: 'step', function: 'function', tool: 'tool', outcome: 'outcome', provider: 'provider', model: 'model', event: 'event' };
|
|
9
|
-
const EXAMPLES = { flow: 'demo-flux', step: 'appel', function: 'demo-stats', tool: 'select_rows', outcome: 'refused', provider: 'anthropic', model: 'claude-opus-5-5', event: 'ai_default_model_changed' };
|
|
8
|
+
const ATTR_OPTIONS = { flow: 'flow', step: 'step', function: 'function', tool: 'tool', outcome: 'outcome', provider: 'provider', model: 'model', event: 'event', table: 'table', channel: 'channel' };
|
|
9
|
+
const EXAMPLES = { flow: 'demo-flux', step: 'appel', function: 'demo-stats', tool: 'select_rows', outcome: 'refused', provider: 'anthropic', model: 'claude-opus-5-5', event: 'ai_default_model_changed', table: 'notes', channel: 'notes' };
|
|
10
10
|
// Identifiant d'exécution (UUID) entier, ou son début : 8 caractères au moins
|
|
11
11
|
const RUN_RE = /^[0-9a-f-]{8,36}$/;
|
|
12
12
|
|