flipstream 0.5.0 → 0.6.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/README.md +168 -12
- package/dist/commands/auth/clear-all.d.ts +1 -0
- package/dist/commands/auth/clear-all.js +91 -24
- package/dist/commands/auth/login.js +8 -2
- package/dist/commands/auth/logout.js +2 -2
- package/dist/commands/auth/status.js +35 -8
- package/dist/commands/catalog.d.ts +15 -0
- package/dist/commands/catalog.js +110 -0
- package/dist/commands/connections/list.d.ts +1 -0
- package/dist/commands/connections/list.js +28 -2
- package/dist/commands/contract.d.ts +11 -0
- package/dist/commands/contract.js +35 -0
- package/dist/commands/health.d.ts +10 -0
- package/dist/commands/health.js +31 -0
- package/dist/commands/log/add.js +7 -3
- package/dist/commands/log/list.js +1 -1
- package/dist/commands/query.d.ts +15 -2
- package/dist/commands/query.js +256 -43
- package/dist/commands/skills/install.d.ts +16 -0
- package/dist/commands/skills/install.js +55 -0
- package/dist/commands/workspaces/connections.js +4 -2
- package/dist/commands/workspaces/get.js +5 -3
- package/dist/commands/workspaces/list.js +4 -1
- package/dist/lib/api/errors.d.ts +1 -0
- package/dist/lib/api/errors.js +13 -2
- package/dist/lib/api/http.d.ts +2 -0
- package/dist/lib/api/http.js +40 -4
- package/dist/lib/api/ids.d.ts +1 -0
- package/dist/lib/api/ids.js +5 -0
- package/dist/lib/api/retry.d.ts +1 -1
- package/dist/lib/api/retry.js +1 -1
- package/dist/lib/api/short-uuid.d.ts +1 -0
- package/dist/lib/api/short-uuid.js +30 -0
- package/dist/lib/auth/claims.d.ts +1 -1
- package/dist/lib/auth/claims.js +2 -2
- package/dist/lib/auth/flow.js +10 -2
- package/dist/lib/auth/headless.js +14 -10
- package/dist/lib/auth/refresh.js +33 -3
- package/dist/lib/auth/session.js +1 -1
- package/dist/lib/command/base.d.ts +4 -0
- package/dist/lib/command/base.js +102 -3
- package/dist/lib/command/flags.d.ts +4 -0
- package/dist/lib/command/flags.js +11 -0
- package/dist/lib/command/planner.d.ts +9 -0
- package/dist/lib/command/planner.js +14 -0
- package/dist/lib/config/constants.d.ts +3 -1
- package/dist/lib/config/constants.js +14 -1
- package/dist/lib/config/xdg.d.ts +4 -0
- package/dist/lib/config/xdg.js +56 -1
- package/dist/lib/errors.d.ts +20 -1
- package/dist/lib/errors.js +125 -17
- package/dist/lib/output/dialogs.d.ts +27 -0
- package/dist/lib/output/dialogs.js +94 -0
- package/dist/lib/output/interactivity.d.ts +11 -0
- package/dist/lib/output/interactivity.js +54 -0
- package/dist/lib/output/machine-mode.d.ts +2 -0
- package/dist/lib/output/machine-mode.js +25 -0
- package/dist/lib/output/redact.d.ts +1 -0
- package/dist/lib/output/redact.js +12 -0
- package/dist/lib/output/runlog.d.ts +3 -0
- package/dist/lib/output/runlog.js +72 -0
- package/dist/lib/output/sanitize.d.ts +2 -0
- package/dist/lib/output/sanitize.js +57 -0
- package/dist/lib/output/sidecar.d.ts +30 -0
- package/dist/lib/output/sidecar.js +58 -0
- package/dist/lib/output/table.js +5 -1
- package/dist/lib/output/trace.d.ts +11 -0
- package/dist/lib/output/trace.js +89 -0
- package/dist/lib/planner/catalog.d.ts +26 -0
- package/dist/lib/planner/catalog.js +60 -0
- package/dist/lib/planner/client.d.ts +14 -0
- package/dist/lib/planner/client.js +47 -0
- package/dist/lib/planner/connection.d.ts +14 -0
- package/dist/lib/planner/connection.js +139 -0
- package/dist/lib/planner/diagnose.d.ts +8 -0
- package/dist/lib/planner/diagnose.js +50 -0
- package/dist/lib/planner/errors.d.ts +14 -0
- package/dist/lib/planner/errors.js +129 -0
- package/dist/lib/planner/filters.d.ts +8 -0
- package/dist/lib/planner/filters.js +74 -0
- package/dist/lib/planner/request.d.ts +24 -0
- package/dist/lib/planner/request.js +51 -0
- package/dist/lib/planner/suggest.d.ts +2 -0
- package/dist/lib/planner/suggest.js +45 -0
- package/dist/lib/planner/vocabulary.d.ts +9 -0
- package/dist/lib/planner/vocabulary.js +95 -0
- package/dist/lib/skills/install.d.ts +24 -0
- package/dist/lib/skills/install.js +69 -0
- package/dist/lib/store/keychain-child.d.ts +11 -0
- package/dist/lib/store/keychain-child.js +135 -0
- package/dist/lib/store/keyring.d.ts +27 -10
- package/dist/lib/store/keyring.js +288 -17
- package/dist/lib/store/memory-store.d.ts +6 -5
- package/dist/lib/store/memory-store.js +14 -6
- package/docs/AGENT-CONTRACT.md +238 -0
- package/oclif.manifest.json +392 -8
- package/package.json +7 -3
- package/skill/SKILL.md +55 -0
package/oclif.manifest.json
CHANGED
|
@@ -1,13 +1,232 @@
|
|
|
1
1
|
{
|
|
2
2
|
"commands": {
|
|
3
|
+
"catalog": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {
|
|
6
|
+
"source": {
|
|
7
|
+
"description": "A source name (omit to list every source).",
|
|
8
|
+
"name": "source",
|
|
9
|
+
"required": false
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"description": "Print the request vocabulary the query planner accepts. The names shown ARE what `query` takes: `-d` and `-m` and filter keys use an item's `name` (the wire name, e.g. search_date), never its `label` (what a human reads, e.g. Date). Read from the SERVICE, never from a local data-model checkout — the two differ exactly when it matters most, right after a version bump.",
|
|
13
|
+
"examples": [
|
|
14
|
+
"<%= config.bin %> catalog",
|
|
15
|
+
"<%= config.bin %> catalog gsc",
|
|
16
|
+
"<%= config.bin %> catalog gsc --json"
|
|
17
|
+
],
|
|
18
|
+
"flags": {
|
|
19
|
+
"json": {
|
|
20
|
+
"description": "Format output as json.",
|
|
21
|
+
"helpGroup": "GLOBAL",
|
|
22
|
+
"name": "json",
|
|
23
|
+
"allowNo": false,
|
|
24
|
+
"type": "boolean"
|
|
25
|
+
},
|
|
26
|
+
"host": {
|
|
27
|
+
"char": "H",
|
|
28
|
+
"description": "OAuth provider host (defaults to the prod issuer).",
|
|
29
|
+
"name": "host",
|
|
30
|
+
"hasDynamicHelp": false,
|
|
31
|
+
"multiple": false,
|
|
32
|
+
"type": "option"
|
|
33
|
+
},
|
|
34
|
+
"ndjson": {
|
|
35
|
+
"description": "Stream output as NDJSON (one compact JSON object per line).",
|
|
36
|
+
"name": "ndjson",
|
|
37
|
+
"allowNo": false,
|
|
38
|
+
"type": "boolean"
|
|
39
|
+
},
|
|
40
|
+
"timeout": {
|
|
41
|
+
"description": "Network timeout in milliseconds.",
|
|
42
|
+
"name": "timeout",
|
|
43
|
+
"hasDynamicHelp": false,
|
|
44
|
+
"multiple": false,
|
|
45
|
+
"type": "option"
|
|
46
|
+
},
|
|
47
|
+
"verbose": {
|
|
48
|
+
"aliases": [
|
|
49
|
+
"debug"
|
|
50
|
+
],
|
|
51
|
+
"description": "Print redacted diagnostics to stderr.",
|
|
52
|
+
"name": "verbose",
|
|
53
|
+
"allowNo": false,
|
|
54
|
+
"type": "boolean"
|
|
55
|
+
},
|
|
56
|
+
"auth-host": {
|
|
57
|
+
"description": "OAuth issuer host for credentials/refresh (defaults to the prod issuer).",
|
|
58
|
+
"name": "auth-host",
|
|
59
|
+
"hasDynamicHelp": false,
|
|
60
|
+
"multiple": false,
|
|
61
|
+
"type": "option"
|
|
62
|
+
},
|
|
63
|
+
"url": {
|
|
64
|
+
"description": "Query-planner base URL (default: the prod planner; env FLIPSTREAM_PLANNER_URL).",
|
|
65
|
+
"name": "url",
|
|
66
|
+
"hasDynamicHelp": false,
|
|
67
|
+
"multiple": false,
|
|
68
|
+
"type": "option"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"hasDynamicHelp": false,
|
|
72
|
+
"hiddenAliases": [],
|
|
73
|
+
"id": "catalog",
|
|
74
|
+
"pluginAlias": "flipstream",
|
|
75
|
+
"pluginName": "flipstream",
|
|
76
|
+
"pluginType": "core",
|
|
77
|
+
"strict": true,
|
|
78
|
+
"summary": "Show the dimensions and metrics a source accepts.",
|
|
79
|
+
"enableJsonFlag": true,
|
|
80
|
+
"isESM": true,
|
|
81
|
+
"relativePath": [
|
|
82
|
+
"dist",
|
|
83
|
+
"commands",
|
|
84
|
+
"catalog.js"
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
"contract": {
|
|
88
|
+
"aliases": [],
|
|
89
|
+
"args": {},
|
|
90
|
+
"description": "Print docs/AGENT-CONTRACT.md — the frozen machine contract (output modes, exit codes, error envelope, per-command JSON shapes) — to stdout, from the installed package, no network needed. Context self-service for agents: read this before driving the CLI programmatically.",
|
|
91
|
+
"examples": [
|
|
92
|
+
"<%= config.bin %> contract",
|
|
93
|
+
"<%= config.bin %> contract --json"
|
|
94
|
+
],
|
|
95
|
+
"flags": {
|
|
96
|
+
"json": {
|
|
97
|
+
"description": "Format output as json.",
|
|
98
|
+
"helpGroup": "GLOBAL",
|
|
99
|
+
"name": "json",
|
|
100
|
+
"allowNo": false,
|
|
101
|
+
"type": "boolean"
|
|
102
|
+
},
|
|
103
|
+
"host": {
|
|
104
|
+
"char": "H",
|
|
105
|
+
"description": "OAuth provider host (defaults to the prod issuer).",
|
|
106
|
+
"name": "host",
|
|
107
|
+
"hasDynamicHelp": false,
|
|
108
|
+
"multiple": false,
|
|
109
|
+
"type": "option"
|
|
110
|
+
},
|
|
111
|
+
"ndjson": {
|
|
112
|
+
"description": "Stream output as NDJSON (one compact JSON object per line).",
|
|
113
|
+
"name": "ndjson",
|
|
114
|
+
"allowNo": false,
|
|
115
|
+
"type": "boolean"
|
|
116
|
+
},
|
|
117
|
+
"timeout": {
|
|
118
|
+
"description": "Network timeout in milliseconds.",
|
|
119
|
+
"name": "timeout",
|
|
120
|
+
"hasDynamicHelp": false,
|
|
121
|
+
"multiple": false,
|
|
122
|
+
"type": "option"
|
|
123
|
+
},
|
|
124
|
+
"verbose": {
|
|
125
|
+
"aliases": [
|
|
126
|
+
"debug"
|
|
127
|
+
],
|
|
128
|
+
"description": "Print redacted diagnostics to stderr.",
|
|
129
|
+
"name": "verbose",
|
|
130
|
+
"allowNo": false,
|
|
131
|
+
"type": "boolean"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
"hasDynamicHelp": false,
|
|
135
|
+
"hiddenAliases": [],
|
|
136
|
+
"id": "contract",
|
|
137
|
+
"pluginAlias": "flipstream",
|
|
138
|
+
"pluginName": "flipstream",
|
|
139
|
+
"pluginType": "core",
|
|
140
|
+
"strict": true,
|
|
141
|
+
"summary": "Print the agent contract (machine-facing promises) to stdout.",
|
|
142
|
+
"enableJsonFlag": true,
|
|
143
|
+
"isESM": true,
|
|
144
|
+
"relativePath": [
|
|
145
|
+
"dist",
|
|
146
|
+
"commands",
|
|
147
|
+
"contract.js"
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
"health": {
|
|
151
|
+
"aliases": [],
|
|
152
|
+
"args": {},
|
|
153
|
+
"description": "Check that the query planner is answering. This is the ONE endpoint that takes no token, so it separates \"the service is down\" from \"my credentials are wrong\" before any auth debugging starts.",
|
|
154
|
+
"examples": [
|
|
155
|
+
"<%= config.bin %> health",
|
|
156
|
+
"<%= config.bin %> health --json",
|
|
157
|
+
"<%= config.bin %> health --url http://localhost:8080"
|
|
158
|
+
],
|
|
159
|
+
"flags": {
|
|
160
|
+
"json": {
|
|
161
|
+
"description": "Format output as json.",
|
|
162
|
+
"helpGroup": "GLOBAL",
|
|
163
|
+
"name": "json",
|
|
164
|
+
"allowNo": false,
|
|
165
|
+
"type": "boolean"
|
|
166
|
+
},
|
|
167
|
+
"host": {
|
|
168
|
+
"char": "H",
|
|
169
|
+
"description": "OAuth provider host (defaults to the prod issuer).",
|
|
170
|
+
"name": "host",
|
|
171
|
+
"hasDynamicHelp": false,
|
|
172
|
+
"multiple": false,
|
|
173
|
+
"type": "option"
|
|
174
|
+
},
|
|
175
|
+
"ndjson": {
|
|
176
|
+
"description": "Stream output as NDJSON (one compact JSON object per line).",
|
|
177
|
+
"name": "ndjson",
|
|
178
|
+
"allowNo": false,
|
|
179
|
+
"type": "boolean"
|
|
180
|
+
},
|
|
181
|
+
"timeout": {
|
|
182
|
+
"description": "Network timeout in milliseconds.",
|
|
183
|
+
"name": "timeout",
|
|
184
|
+
"hasDynamicHelp": false,
|
|
185
|
+
"multiple": false,
|
|
186
|
+
"type": "option"
|
|
187
|
+
},
|
|
188
|
+
"verbose": {
|
|
189
|
+
"aliases": [
|
|
190
|
+
"debug"
|
|
191
|
+
],
|
|
192
|
+
"description": "Print redacted diagnostics to stderr.",
|
|
193
|
+
"name": "verbose",
|
|
194
|
+
"allowNo": false,
|
|
195
|
+
"type": "boolean"
|
|
196
|
+
},
|
|
197
|
+
"url": {
|
|
198
|
+
"description": "Query-planner base URL (default: the prod planner; env FLIPSTREAM_PLANNER_URL).",
|
|
199
|
+
"name": "url",
|
|
200
|
+
"hasDynamicHelp": false,
|
|
201
|
+
"multiple": false,
|
|
202
|
+
"type": "option"
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"hasDynamicHelp": false,
|
|
206
|
+
"hiddenAliases": [],
|
|
207
|
+
"id": "health",
|
|
208
|
+
"pluginAlias": "flipstream",
|
|
209
|
+
"pluginName": "flipstream",
|
|
210
|
+
"pluginType": "core",
|
|
211
|
+
"strict": true,
|
|
212
|
+
"summary": "Check that the query planner is reachable.",
|
|
213
|
+
"enableJsonFlag": true,
|
|
214
|
+
"isESM": true,
|
|
215
|
+
"relativePath": [
|
|
216
|
+
"dist",
|
|
217
|
+
"commands",
|
|
218
|
+
"health.js"
|
|
219
|
+
]
|
|
220
|
+
},
|
|
3
221
|
"query": {
|
|
4
222
|
"aliases": [],
|
|
5
223
|
"args": {},
|
|
6
|
-
"description": "Send
|
|
224
|
+
"description": "Send a LOGICAL query (source + dimensions + metrics + filters) to the Flipstream query planner, which resolves which physical table answers it and returns the rows. Run `flipstream catalog <source>` first — the names it prints ARE what -d, -m and filter keys take. --body/--body-file/stdin still forwards a JSON body verbatim for shapes the flags cannot express.",
|
|
7
225
|
"examples": [
|
|
8
|
-
"<%= config.bin %>
|
|
9
|
-
"
|
|
10
|
-
"<%= config.bin %> query --
|
|
226
|
+
"<%= config.bin %> catalog gsc",
|
|
227
|
+
"<%= config.bin %> query --source gsc --connection-id <id|name> -d search_date -d query -m clicks -f 'search_date=2026-01-01..2026-02-01' --rows 20",
|
|
228
|
+
"<%= config.bin %> query --source gsc --connection-id <id> -d query -m clicks --dry-run",
|
|
229
|
+
"<%= config.bin %> query --body-file request.json --json"
|
|
11
230
|
],
|
|
12
231
|
"flags": {
|
|
13
232
|
"json": {
|
|
@@ -54,8 +273,15 @@
|
|
|
54
273
|
"multiple": false,
|
|
55
274
|
"type": "option"
|
|
56
275
|
},
|
|
276
|
+
"url": {
|
|
277
|
+
"description": "Query-planner base URL (default: the prod planner; env FLIPSTREAM_PLANNER_URL).",
|
|
278
|
+
"name": "url",
|
|
279
|
+
"hasDynamicHelp": false,
|
|
280
|
+
"multiple": false,
|
|
281
|
+
"type": "option"
|
|
282
|
+
},
|
|
57
283
|
"body": {
|
|
58
|
-
"description": "
|
|
284
|
+
"description": "Send this JSON body verbatim.",
|
|
59
285
|
"exclusive": [
|
|
60
286
|
"body-file"
|
|
61
287
|
],
|
|
@@ -65,11 +291,84 @@
|
|
|
65
291
|
"type": "option"
|
|
66
292
|
},
|
|
67
293
|
"body-file": {
|
|
68
|
-
"description": "Path to a file holding the
|
|
294
|
+
"description": "Path to a file holding the JSON body verbatim (\"-\" reads stdin).",
|
|
69
295
|
"name": "body-file",
|
|
70
296
|
"hasDynamicHelp": false,
|
|
71
297
|
"multiple": false,
|
|
72
298
|
"type": "option"
|
|
299
|
+
},
|
|
300
|
+
"connection-id": {
|
|
301
|
+
"description": "Connection UUID, or a name to look up.",
|
|
302
|
+
"name": "connection-id",
|
|
303
|
+
"hasDynamicHelp": false,
|
|
304
|
+
"multiple": false,
|
|
305
|
+
"type": "option"
|
|
306
|
+
},
|
|
307
|
+
"dimension": {
|
|
308
|
+
"char": "d",
|
|
309
|
+
"description": "Dimension name (repeatable).",
|
|
310
|
+
"name": "dimension",
|
|
311
|
+
"hasDynamicHelp": false,
|
|
312
|
+
"multiple": true,
|
|
313
|
+
"type": "option"
|
|
314
|
+
},
|
|
315
|
+
"dry-run": {
|
|
316
|
+
"description": "Print the request body and send nothing.",
|
|
317
|
+
"name": "dry-run",
|
|
318
|
+
"allowNo": false,
|
|
319
|
+
"type": "boolean"
|
|
320
|
+
},
|
|
321
|
+
"filter": {
|
|
322
|
+
"char": "f",
|
|
323
|
+
"description": "Filter as col=a,b | col=from..to | col=<json> (repeatable). 'col=' is refused.",
|
|
324
|
+
"name": "filter",
|
|
325
|
+
"hasDynamicHelp": false,
|
|
326
|
+
"multiple": true,
|
|
327
|
+
"type": "option"
|
|
328
|
+
},
|
|
329
|
+
"metric": {
|
|
330
|
+
"char": "m",
|
|
331
|
+
"description": "Metric name (repeatable).",
|
|
332
|
+
"name": "metric",
|
|
333
|
+
"hasDynamicHelp": false,
|
|
334
|
+
"multiple": true,
|
|
335
|
+
"type": "option"
|
|
336
|
+
},
|
|
337
|
+
"offset": {
|
|
338
|
+
"description": "Row offset.",
|
|
339
|
+
"name": "offset",
|
|
340
|
+
"hasDynamicHelp": false,
|
|
341
|
+
"multiple": false,
|
|
342
|
+
"type": "option"
|
|
343
|
+
},
|
|
344
|
+
"rows": {
|
|
345
|
+
"description": "Row limit (default 100).",
|
|
346
|
+
"name": "rows",
|
|
347
|
+
"hasDynamicHelp": false,
|
|
348
|
+
"multiple": false,
|
|
349
|
+
"type": "option"
|
|
350
|
+
},
|
|
351
|
+
"sort": {
|
|
352
|
+
"char": "s",
|
|
353
|
+
"description": "FIELD[:asc|desc] (repeatable).",
|
|
354
|
+
"name": "sort",
|
|
355
|
+
"hasDynamicHelp": false,
|
|
356
|
+
"multiple": true,
|
|
357
|
+
"type": "option"
|
|
358
|
+
},
|
|
359
|
+
"source": {
|
|
360
|
+
"description": "The dataset discriminator, e.g. gsc.",
|
|
361
|
+
"name": "source",
|
|
362
|
+
"hasDynamicHelp": false,
|
|
363
|
+
"multiple": false,
|
|
364
|
+
"type": "option"
|
|
365
|
+
},
|
|
366
|
+
"table": {
|
|
367
|
+
"description": "Physical table — honoured only for an unmodelled source.",
|
|
368
|
+
"name": "table",
|
|
369
|
+
"hasDynamicHelp": false,
|
|
370
|
+
"multiple": false,
|
|
371
|
+
"type": "option"
|
|
73
372
|
}
|
|
74
373
|
},
|
|
75
374
|
"hasDynamicHelp": false,
|
|
@@ -79,7 +378,7 @@
|
|
|
79
378
|
"pluginName": "flipstream",
|
|
80
379
|
"pluginType": "core",
|
|
81
380
|
"strict": true,
|
|
82
|
-
"summary": "Run
|
|
381
|
+
"summary": "Run a logical query against the Flipstream query planner.",
|
|
83
382
|
"enableJsonFlag": true,
|
|
84
383
|
"isESM": true,
|
|
85
384
|
"relativePath": [
|
|
@@ -756,6 +1055,91 @@
|
|
|
756
1055
|
"list.js"
|
|
757
1056
|
]
|
|
758
1057
|
},
|
|
1058
|
+
"skills:install": {
|
|
1059
|
+
"aliases": [],
|
|
1060
|
+
"args": {},
|
|
1061
|
+
"description": "Install the flipstream skill (SKILL.md) into the global skills directory of every detected AI coding agent (Claude Code, Codex, Cursor, OpenCode). Detection is local env/dir inspection only — nothing is reported anywhere. The skill teaches an agent to retrieve the command surface and data vocabulary from the CLI instead of guessing.",
|
|
1062
|
+
"examples": [
|
|
1063
|
+
"<%= config.bin %> skills install",
|
|
1064
|
+
"<%= config.bin %> skills install --yes",
|
|
1065
|
+
"<%= config.bin %> skills install --agent claude-code --agent codex"
|
|
1066
|
+
],
|
|
1067
|
+
"flags": {
|
|
1068
|
+
"json": {
|
|
1069
|
+
"description": "Format output as json.",
|
|
1070
|
+
"helpGroup": "GLOBAL",
|
|
1071
|
+
"name": "json",
|
|
1072
|
+
"allowNo": false,
|
|
1073
|
+
"type": "boolean"
|
|
1074
|
+
},
|
|
1075
|
+
"host": {
|
|
1076
|
+
"char": "H",
|
|
1077
|
+
"description": "OAuth provider host (defaults to the prod issuer).",
|
|
1078
|
+
"name": "host",
|
|
1079
|
+
"hasDynamicHelp": false,
|
|
1080
|
+
"multiple": false,
|
|
1081
|
+
"type": "option"
|
|
1082
|
+
},
|
|
1083
|
+
"ndjson": {
|
|
1084
|
+
"description": "Stream output as NDJSON (one compact JSON object per line).",
|
|
1085
|
+
"name": "ndjson",
|
|
1086
|
+
"allowNo": false,
|
|
1087
|
+
"type": "boolean"
|
|
1088
|
+
},
|
|
1089
|
+
"timeout": {
|
|
1090
|
+
"description": "Network timeout in milliseconds.",
|
|
1091
|
+
"name": "timeout",
|
|
1092
|
+
"hasDynamicHelp": false,
|
|
1093
|
+
"multiple": false,
|
|
1094
|
+
"type": "option"
|
|
1095
|
+
},
|
|
1096
|
+
"verbose": {
|
|
1097
|
+
"aliases": [
|
|
1098
|
+
"debug"
|
|
1099
|
+
],
|
|
1100
|
+
"description": "Print redacted diagnostics to stderr.",
|
|
1101
|
+
"name": "verbose",
|
|
1102
|
+
"allowNo": false,
|
|
1103
|
+
"type": "boolean"
|
|
1104
|
+
},
|
|
1105
|
+
"agent": {
|
|
1106
|
+
"description": "Install for this agent id only (repeatable). Known: claude-code, codex, cursor, opencode.",
|
|
1107
|
+
"name": "agent",
|
|
1108
|
+
"hasDynamicHelp": false,
|
|
1109
|
+
"multiple": true,
|
|
1110
|
+
"options": [
|
|
1111
|
+
"claude-code",
|
|
1112
|
+
"codex",
|
|
1113
|
+
"cursor",
|
|
1114
|
+
"opencode"
|
|
1115
|
+
],
|
|
1116
|
+
"type": "option"
|
|
1117
|
+
},
|
|
1118
|
+
"yes": {
|
|
1119
|
+
"char": "y",
|
|
1120
|
+
"description": "Install without asking.",
|
|
1121
|
+
"name": "yes",
|
|
1122
|
+
"allowNo": false,
|
|
1123
|
+
"type": "boolean"
|
|
1124
|
+
}
|
|
1125
|
+
},
|
|
1126
|
+
"hasDynamicHelp": false,
|
|
1127
|
+
"hiddenAliases": [],
|
|
1128
|
+
"id": "skills:install",
|
|
1129
|
+
"pluginAlias": "flipstream",
|
|
1130
|
+
"pluginName": "flipstream",
|
|
1131
|
+
"pluginType": "core",
|
|
1132
|
+
"strict": true,
|
|
1133
|
+
"summary": "Install the flipstream skill for detected AI coding agents.",
|
|
1134
|
+
"enableJsonFlag": true,
|
|
1135
|
+
"isESM": true,
|
|
1136
|
+
"relativePath": [
|
|
1137
|
+
"dist",
|
|
1138
|
+
"commands",
|
|
1139
|
+
"skills",
|
|
1140
|
+
"install.js"
|
|
1141
|
+
]
|
|
1142
|
+
},
|
|
759
1143
|
"workspaces:connections": {
|
|
760
1144
|
"aliases": [
|
|
761
1145
|
"ws:connections"
|
|
@@ -1061,5 +1445,5 @@
|
|
|
1061
1445
|
]
|
|
1062
1446
|
}
|
|
1063
1447
|
},
|
|
1064
|
-
"version": "0.
|
|
1448
|
+
"version": "0.6.1"
|
|
1065
1449
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flipstream",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Flipstream CLI — query your Flipstream data from the terminal.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"flipstream",
|
|
@@ -20,7 +20,9 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"bin",
|
|
22
22
|
"dist",
|
|
23
|
-
"oclif.manifest.json"
|
|
23
|
+
"oclif.manifest.json",
|
|
24
|
+
"skill",
|
|
25
|
+
"docs/AGENT-CONTRACT.md"
|
|
24
26
|
],
|
|
25
27
|
"engines": {
|
|
26
28
|
"node": ">=20"
|
|
@@ -35,7 +37,8 @@
|
|
|
35
37
|
"posttest": "eslint .",
|
|
36
38
|
"prepare": "husky || true",
|
|
37
39
|
"smoke": "bun scripts/smoke.ts",
|
|
38
|
-
"test": "bun test"
|
|
40
|
+
"test": "bun test",
|
|
41
|
+
"schema:planner": "bun scripts/refresh-planner-schema.ts"
|
|
39
42
|
},
|
|
40
43
|
"lint-staged": {
|
|
41
44
|
"*.ts": [
|
|
@@ -51,6 +54,7 @@
|
|
|
51
54
|
"@oclif/core": "^4",
|
|
52
55
|
"@oclif/plugin-commands": "^4.1.59",
|
|
53
56
|
"@oclif/table": "^0.5.9",
|
|
57
|
+
"am-i-vibing": "^0.5.0",
|
|
54
58
|
"open": "^11.0.0"
|
|
55
59
|
},
|
|
56
60
|
"devDependencies": {
|
package/skill/SKILL.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flipstream
|
|
3
|
+
description: Flipstream CLI for querying Flipstream data (query planner, catalog, connections, workspaces, auth). Load before running flipstream commands. Prefer retrieval over pre-training — enumerate the command surface and data vocabulary from the CLI itself instead of guessing flags or names.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flipstream CLI
|
|
7
|
+
|
|
8
|
+
Your knowledge of flipstream flags, sources, dimensions and metrics may be
|
|
9
|
+
outdated. **Prefer retrieval over pre-training** for any flipstream task.
|
|
10
|
+
|
|
11
|
+
## Retrieval sources (run these instead of guessing)
|
|
12
|
+
|
|
13
|
+
| What | Command |
|
|
14
|
+
|---|---|
|
|
15
|
+
| The whole command surface (ids, flags, args, aliases) | `flipstream commands --json` |
|
|
16
|
+
| The machine contract (output modes, exit codes, error envelope) | `flipstream contract` |
|
|
17
|
+
| The data vocabulary for queries | `flipstream catalog` then `flipstream catalog <source>` |
|
|
18
|
+
| Your connections (ids for `--connection-id`) | `flipstream connections list --json` |
|
|
19
|
+
| Session state, scopes | `flipstream auth status --json` |
|
|
20
|
+
|
|
21
|
+
## Ground rules
|
|
22
|
+
|
|
23
|
+
- **stdout is data, stderr is narration.** Under `--json`/`--ndjson`, stdout carries exactly one JSON document (or NDJSON lines) — even on failure: `flipstream <cmd> --json 2>/dev/null | jq .` always parses.
|
|
24
|
+
- **Failures are envelopes.** `{error:{code, message, exit, hint?, next?, docs?, retryable?, retry_after_ms?, upstream_code?}}`. Branch on `code` and the exit code, never on message wording. If `next` is present, **run those commands** instead of guessing. If `retryable` is `false`, do not re-run unchanged. If `retryable` is `true` with `retry_after_ms`, wait that long and retry.
|
|
25
|
+
- **Exit codes:** 0 ok · 1 generic · 2 usage · 4 auth needed (`flipstream auth login`) · 5 auth failed · 7 network/upstream (retryable) · 8 timeout.
|
|
26
|
+
- **Auth is browser-based and keyring-only.** Never ask for, echo, or pass tokens; there is no `--token` flag. If a command exits 4, tell the user to run `flipstream auth login` in a terminal with a browser.
|
|
27
|
+
|
|
28
|
+
## Querying
|
|
29
|
+
|
|
30
|
+
1. `flipstream catalog <source>` FIRST — the `name` fields it prints ARE the only valid values for `-d`, `-m`, and filter keys (`label` is for humans; aliases do not exist).
|
|
31
|
+
2. Build: `flipstream query --source <source> --connection-id <id|name> -d <dim> -m <metric> --json`
|
|
32
|
+
3. Filters: `-f 'col=a,b'` (list), `-f 'col=from..to'` (inclusive range), `-f 'col=<json>'` (verbatim). Add `--dry-run` to print the request body without sending.
|
|
33
|
+
|
|
34
|
+
### The filter gotcha (silent, load-bearing)
|
|
35
|
+
|
|
36
|
+
The planner routes by selection LENGTH: `col=[]` (length 0) is inactive and
|
|
37
|
+
routes to the SUMMARY table; `col=[""]` (length 1) is active and routes to the
|
|
38
|
+
DIMENSION's table. They return different numbers and nothing warns. The CLI
|
|
39
|
+
therefore refuses bare `col=` — when you mean one of those, write the JSON form
|
|
40
|
+
explicitly, and don't "fix" the refusal by inventing a value.
|
|
41
|
+
|
|
42
|
+
## Recipes
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
# Discover, then query
|
|
46
|
+
flipstream catalog --json | jq '.sources[].name'
|
|
47
|
+
flipstream connections list --json | jq '.records[] | {id, name}'
|
|
48
|
+
flipstream query --source gsc --connection-id <id> -d search_date -m clicks --json 2>/dev/null | jq '.rows'
|
|
49
|
+
|
|
50
|
+
# Stream large results
|
|
51
|
+
flipstream workspaces list --ndjson
|
|
52
|
+
|
|
53
|
+
# Inspect a failure programmatically
|
|
54
|
+
flipstream query ... --json 2>/dev/null | jq '.error | {code, next, retryable}'
|
|
55
|
+
```
|