@creator-notes/cnotes 0.61.0 → 0.62.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/dist/cn.js +10 -2
- package/dist/cn.js.map +1 -1
- package/dist/commands/canvas.js +4 -4
- package/dist/commands/canvas.js.map +1 -1
- package/dist/commands/files.js +16 -16
- package/dist/commands/files.js.map +1 -1
- package/dist/commands/focus.js +4 -4
- package/dist/commands/focus.js.map +1 -1
- package/dist/commands/notes.d.ts.map +1 -1
- package/dist/commands/notes.js +6 -6
- package/dist/commands/notes.js.map +1 -1
- package/dist/commands/operations.js +8 -8
- package/dist/commands/operations.js.map +1 -1
- package/dist/commands/review.js +24 -24
- package/dist/commands/review.js.map +1 -1
- package/dist/commands/shared.js +4 -4
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/timeline.js +8 -8
- package/dist/commands/timeline.js.map +1 -1
- package/dist/lib/config.d.ts +4 -0
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +16 -10
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/output.d.ts +22 -1
- package/dist/lib/output.d.ts.map +1 -1
- package/dist/lib/output.js +86 -3
- package/dist/lib/output.js.map +1 -1
- package/package.json +1 -1
- package/skills/cnotes/SKILL.md +26 -13
- package/skills/fat-marker-flows/SKILL.md +40 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/commands/shared.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EACL,YAAY,EACZ,eAAe,GAEhB,MAAM,uBAAuB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CAAC;QAC/B,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -88,16 +88,16 @@ Examples:
|
|
|
88
88
|
noteFilter: opts.note,
|
|
89
89
|
};
|
|
90
90
|
const data = await api.get("/api/timeline", params);
|
|
91
|
-
if (cfg.json) {
|
|
92
|
-
outputJson(data);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
91
|
if (cfg.quiet) {
|
|
96
92
|
for (const item of data.items) {
|
|
97
93
|
console.log(item.versionId);
|
|
98
94
|
}
|
|
99
95
|
return;
|
|
100
96
|
}
|
|
97
|
+
if (cfg.json) {
|
|
98
|
+
outputJson(data);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
101
|
if (data.items.length === 0) {
|
|
102
102
|
console.log("No changes found in the specified time range.");
|
|
103
103
|
return;
|
|
@@ -135,15 +135,15 @@ async function runSearch(api, cfg, opts) {
|
|
|
135
135
|
limit: String(opts.limit),
|
|
136
136
|
};
|
|
137
137
|
const data = await api.get("/api/timeline", params);
|
|
138
|
-
if (cfg.json) {
|
|
139
|
-
outputJson(data);
|
|
140
|
-
return;
|
|
141
|
-
}
|
|
142
138
|
if (cfg.quiet) {
|
|
143
139
|
for (const r of data.results)
|
|
144
140
|
console.log(r.versionId);
|
|
145
141
|
return;
|
|
146
142
|
}
|
|
143
|
+
if (cfg.json) {
|
|
144
|
+
outputJson(data);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
147
|
if (data.results.length === 0) {
|
|
148
148
|
console.log(`No matching changes found for "${opts.query}".`);
|
|
149
149
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timeline.js","sourceRoot":"","sources":["../../src/commands/timeline.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,kBAAkB,C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,QAAQ,CAAC,CAAC,CAAC,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC;QACrE,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;KACrB,CAAC,CAAC;IACH,WAAW,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;IAEnD,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC;IAClE,OAAO,CAAC,GAAG,CACT,KAAK,IAAI,CAAC,OAAO,CAAC,MAAM,0BAA0B,IAAI,CAAC,KAAK,MAAM,GAAG,GAAG,CACzE,CAAC;AACJ,CAAC"}
|
package/dist/lib/config.d.ts
CHANGED
|
@@ -13,6 +13,10 @@ interface GlobalOpts {
|
|
|
13
13
|
quiet?: boolean;
|
|
14
14
|
fields?: string;
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Parse a `--fields a,b,c` option into a trimmed list, or undefined when unset.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseFields(fields?: string): string[] | undefined;
|
|
16
20
|
/**
|
|
17
21
|
* Resolve server URL, token, and workspace from env vars, flags, and config file.
|
|
18
22
|
* Priority: flags > env vars > config file.
|
package/dist/lib/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAIjE;AAiBD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,cAAc,CA+B9D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,CAclH"}
|
package/dist/lib/config.js
CHANGED
|
@@ -3,12 +3,25 @@ import { AuthError, ValidationError } from "./errors.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Parse a `--fields a,b,c` option into a trimmed list, or undefined when unset.
|
|
5
5
|
*/
|
|
6
|
-
function parseFields(fields) {
|
|
6
|
+
export function parseFields(fields) {
|
|
7
7
|
if (!fields)
|
|
8
8
|
return undefined;
|
|
9
9
|
const list = fields.split(",").map((f) => f.trim()).filter(Boolean);
|
|
10
10
|
return list.length > 0 ? list : undefined;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Output format. JSON is the default off a TTY (agents, pipes). `-q` also
|
|
14
|
+
* takes the JSON path: commands with their own quiet output check `quiet`
|
|
15
|
+
* first, and everything else reaches outputJson, which prints one handle per
|
|
16
|
+
* line in quiet mode. `-q --fields a,b` turns `quiet` off here so every
|
|
17
|
+
* command lands in outputJson and prints those fields as TSV.
|
|
18
|
+
*/
|
|
19
|
+
function resolveOutput(opts) {
|
|
20
|
+
const fields = parseFields(opts.fields);
|
|
21
|
+
const quiet = opts.quiet ?? false;
|
|
22
|
+
const json = opts.json || process.env.CNOTES_JSON === "1" || !process.stdout.isTTY || quiet;
|
|
23
|
+
return { json: json ?? false, quiet: quiet && !fields, fields };
|
|
24
|
+
}
|
|
12
25
|
/**
|
|
13
26
|
* Resolve server URL, token, and workspace from env vars, flags, and config file.
|
|
14
27
|
* Priority: flags > env vars > config file.
|
|
@@ -31,15 +44,11 @@ export function resolveConfig(opts) {
|
|
|
31
44
|
if (!workspaceId) {
|
|
32
45
|
throw new ValidationError("No workspace selected. Run `cnotes workspace select` or pass --workspace <id>");
|
|
33
46
|
}
|
|
34
|
-
// Output format
|
|
35
|
-
const json = opts.json || process.env.CNOTES_JSON === "1" || !process.stdout.isTTY;
|
|
36
47
|
return {
|
|
37
48
|
serverUrl,
|
|
38
49
|
token,
|
|
39
50
|
workspaceId,
|
|
40
|
-
|
|
41
|
-
quiet: opts.quiet ?? false,
|
|
42
|
-
fields: parseFields(opts.fields),
|
|
51
|
+
...resolveOutput(opts),
|
|
43
52
|
};
|
|
44
53
|
}
|
|
45
54
|
/**
|
|
@@ -52,14 +61,11 @@ export function resolveBaseConfig(opts) {
|
|
|
52
61
|
const configToken = getServerConfig(config, serverUrl)?.token;
|
|
53
62
|
const token = envToken || configToken || "";
|
|
54
63
|
const configWorkspace = getServerConfig(config, serverUrl)?.workspaceId;
|
|
55
|
-
const json = opts.json || process.env.CNOTES_JSON === "1" || !process.stdout.isTTY;
|
|
56
64
|
return {
|
|
57
65
|
serverUrl,
|
|
58
66
|
token,
|
|
59
67
|
workspaceId: opts.workspace || process.env.CNOTES_WORKSPACE || configWorkspace,
|
|
60
|
-
|
|
61
|
-
quiet: opts.quiet ?? false,
|
|
62
|
-
fields: parseFields(opts.fields),
|
|
68
|
+
...resolveOutput(opts),
|
|
63
69
|
};
|
|
64
70
|
}
|
|
65
71
|
//# sourceMappingURL=config.js.map
|
package/dist/lib/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmBzD;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAmBzD;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,MAAe;IACzC,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACpE,OAAO,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CA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AC;QACjB,MAAM,IAAI,eAAe,CACvB,+EAA+E,CAChF,CAAC;IACJ,CAAC;IAED,OAAO;QACL,SAAS;QACT,KAAK;QACL,WAAW;QACX,GAAG,aAAa,CAAC,IAAI,CAAC;KACvB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAgB;IAChD,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;IAC5B,MAAM,SAAS,GACb,IAAI,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,CAAC;IACnE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;IAC1C,MAAM,WAAW,GAAG,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,KAAK,CAAC;IAC9D,MAAM,KAAK,GAAG,QAAQ,IAAI,WAAW,IAAI,EAAE,CAAC;IAC5C,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,WAAW,CAAC;IACxE,OAAO;QACL,SAAS;QACT,KAAK;QACL,WAAW,EAAE,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,eAAe;QAC9E,GAAG,aAAa,CAAC,IAAI,CAAC;KACvB,CAAC;AACJ,CAAC"}
|
package/dist/lib/output.d.ts
CHANGED
|
@@ -5,13 +5,33 @@
|
|
|
5
5
|
* Human mode: formatted tables/text.
|
|
6
6
|
* Quiet mode: minimal output (IDs only).
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Global output mode, set once per invocation from the root `-q` / `--fields`
|
|
10
|
+
* flags (see the preAction hook in cn.ts). Every command prints JSON through
|
|
11
|
+
* outputJson, so honouring the flags here makes them work on every command
|
|
12
|
+
* instead of only on the ones that remembered to pass them through.
|
|
13
|
+
*/
|
|
14
|
+
interface OutputMode {
|
|
15
|
+
quiet: boolean;
|
|
16
|
+
fields?: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function setOutputMode(next: OutputMode): void;
|
|
8
19
|
/**
|
|
9
20
|
* Project an object (or array of objects) down to a set of top-level fields.
|
|
10
21
|
* No-op when `fields` is empty/undefined. Lets agents trim list/get output to
|
|
11
22
|
* just the keys they need (e.g. `--fields displayId,title`) instead of paying
|
|
12
|
-
* for the full record in their context window.
|
|
23
|
+
* for the full record in their context window. When none of the fields sit on
|
|
24
|
+
* an envelope itself, they are applied to its rows instead, so
|
|
25
|
+
* `notes create --fields key,displayId` trims `.results[]`.
|
|
13
26
|
*/
|
|
14
27
|
export declare function projectFields(data: unknown, fields?: string[]): unknown;
|
|
28
|
+
/**
|
|
29
|
+
* Quiet rendering of a JSON payload. With `--fields`, one tab-separated line
|
|
30
|
+
* per row holding those fields in the order given; without, one handle per
|
|
31
|
+
* line. Returns null when the payload has no recognisable rows or handle, so
|
|
32
|
+
* the caller can fall back to JSON rather than print nothing.
|
|
33
|
+
*/
|
|
34
|
+
export declare function quietLines(data: unknown, fields?: string[]): string[] | null;
|
|
15
35
|
export declare function outputJson(data: unknown, fields?: string[]): void;
|
|
16
36
|
export declare function outputQuiet(value: string): void;
|
|
17
37
|
/**
|
|
@@ -33,4 +53,5 @@ export declare function formatAgo(startedAtMs: number): string;
|
|
|
33
53
|
* Truncate a string to a max length with ellipsis.
|
|
34
54
|
*/
|
|
35
55
|
export declare function truncate(str: string, max: number): string;
|
|
56
|
+
export {};
|
|
36
57
|
//# sourceMappingURL=output.d.ts.map
|
package/dist/lib/output.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;GAKG;AACH,UAAU,UAAU;IAClB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAID,wBAAgB,aAAa,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAEpD;AAmBD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAkBvE;AAuBD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAY5E;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAUjE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EAAE,EACjB,IAAI,EAAE,MAAM,EAAE,EAAE,GACf,IAAI,CAeN;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAa1D;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAOrD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAGzD"}
|
package/dist/lib/output.js
CHANGED
|
@@ -5,11 +5,35 @@
|
|
|
5
5
|
* Human mode: formatted tables/text.
|
|
6
6
|
* Quiet mode: minimal output (IDs only).
|
|
7
7
|
*/
|
|
8
|
+
let mode = { quiet: false };
|
|
9
|
+
export function setOutputMode(next) {
|
|
10
|
+
mode = next;
|
|
11
|
+
}
|
|
12
|
+
/** Envelope keys that hold a response's rows, in the order we look for them. */
|
|
13
|
+
const ROW_KEYS = ["results", "items", "comments", "plans", "all", "keys"];
|
|
14
|
+
/**
|
|
15
|
+
* Find the rows in a response: the array itself, or the array inside a known
|
|
16
|
+
* envelope key (`notes create` → results, `comments list` → comments, …).
|
|
17
|
+
*/
|
|
18
|
+
function findRows(data) {
|
|
19
|
+
if (Array.isArray(data))
|
|
20
|
+
return { rows: data };
|
|
21
|
+
if (!data || typeof data !== "object")
|
|
22
|
+
return null;
|
|
23
|
+
const rec = data;
|
|
24
|
+
for (const key of ROW_KEYS) {
|
|
25
|
+
if (Array.isArray(rec[key]))
|
|
26
|
+
return { rows: rec[key], key };
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
8
30
|
/**
|
|
9
31
|
* Project an object (or array of objects) down to a set of top-level fields.
|
|
10
32
|
* No-op when `fields` is empty/undefined. Lets agents trim list/get output to
|
|
11
33
|
* just the keys they need (e.g. `--fields displayId,title`) instead of paying
|
|
12
|
-
* for the full record in their context window.
|
|
34
|
+
* for the full record in their context window. When none of the fields sit on
|
|
35
|
+
* an envelope itself, they are applied to its rows instead, so
|
|
36
|
+
* `notes create --fields key,displayId` trims `.results[]`.
|
|
13
37
|
*/
|
|
14
38
|
export function projectFields(data, fields) {
|
|
15
39
|
if (!fields || fields.length === 0)
|
|
@@ -25,10 +49,69 @@ export function projectFields(data, fields) {
|
|
|
25
49
|
}
|
|
26
50
|
return out;
|
|
27
51
|
};
|
|
28
|
-
|
|
52
|
+
if (Array.isArray(data))
|
|
53
|
+
return data.map(pick);
|
|
54
|
+
const found = findRows(data);
|
|
55
|
+
const rec = data;
|
|
56
|
+
if (found?.key && rec && !fields.some((f) => f in rec)) {
|
|
57
|
+
return { ...rec, [found.key]: found.rows.map(pick) };
|
|
58
|
+
}
|
|
59
|
+
return pick(data);
|
|
60
|
+
}
|
|
61
|
+
/** The one handle `-q` prints for a row: what the next command takes as input. */
|
|
62
|
+
const HANDLE_KEYS = ["displayId", "name", "value", "id", "_id", "requestId", "planId", "storageId"];
|
|
63
|
+
function handleOf(row) {
|
|
64
|
+
if (row === null || row === undefined)
|
|
65
|
+
return undefined;
|
|
66
|
+
if (typeof row !== "object")
|
|
67
|
+
return String(row);
|
|
68
|
+
const rec = row;
|
|
69
|
+
for (const k of HANDLE_KEYS) {
|
|
70
|
+
const v = rec[k];
|
|
71
|
+
if (typeof v === "string" || typeof v === "number")
|
|
72
|
+
return String(v);
|
|
73
|
+
}
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
/** A field value as one TSV cell: strings verbatim, objects as JSON, no tabs or newlines. */
|
|
77
|
+
function cell(value) {
|
|
78
|
+
if (value === null || value === undefined)
|
|
79
|
+
return "";
|
|
80
|
+
const s = typeof value === "string" ? value : JSON.stringify(value);
|
|
81
|
+
return s.replace(/[\t\r\n]+/g, " ");
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Quiet rendering of a JSON payload. With `--fields`, one tab-separated line
|
|
85
|
+
* per row holding those fields in the order given; without, one handle per
|
|
86
|
+
* line. Returns null when the payload has no recognisable rows or handle, so
|
|
87
|
+
* the caller can fall back to JSON rather than print nothing.
|
|
88
|
+
*/
|
|
89
|
+
export function quietLines(data, fields) {
|
|
90
|
+
const rows = findRows(data)?.rows ?? (data && typeof data === "object" ? [data] : null);
|
|
91
|
+
if (!rows)
|
|
92
|
+
return null;
|
|
93
|
+
if (fields && fields.length > 0) {
|
|
94
|
+
return rows.map((row) => {
|
|
95
|
+
const rec = (row && typeof row === "object" ? row : {});
|
|
96
|
+
return fields.map((f) => cell(rec[f])).join("\t");
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
const handles = rows.map(handleOf);
|
|
100
|
+
if (handles.some((h) => h === undefined))
|
|
101
|
+
return null;
|
|
102
|
+
return handles;
|
|
29
103
|
}
|
|
30
104
|
export function outputJson(data, fields) {
|
|
31
|
-
|
|
105
|
+
const effectiveFields = fields ?? mode.fields;
|
|
106
|
+
if (mode.quiet) {
|
|
107
|
+
const lines = quietLines(data, effectiveFields);
|
|
108
|
+
if (lines) {
|
|
109
|
+
for (const line of lines)
|
|
110
|
+
console.log(line);
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
console.log(JSON.stringify(projectFields(data, effectiveFields), null, 2));
|
|
32
115
|
}
|
|
33
116
|
export function outputQuiet(value) {
|
|
34
117
|
console.log(value);
|
package/dist/lib/output.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/lib/output.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAaH,IAAI,IAAI,GAAe,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAExC,MAAM,UAAU,aAAa,CAAC,IAAgB;IAC5C,IAAI,GAAG,IAAI,CAAC;AACd,CAAC;AAED,gFAAgF;AAChF,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAE1E;;;GAGG;AACH,SAAS,QAAQ,CAAC,IAAa;IAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IAC/C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACnD,MAAM,GAAG,GAAG,IAA+B,CAAC;IAC5C,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,GAAG,CAAC,GAAG,CAAc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CAAC;IAChC,OAAO,GAAG,EAAE,OAAO,CAAC;AACtB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW,EAAE,GAAW;IAC/C,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IAClC,OAAO,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC;AAC1C,CAAC"}
|
package/package.json
CHANGED
package/skills/cnotes/SKILL.md
CHANGED
|
@@ -97,8 +97,10 @@ The CLI never charges a card: `create` returns a Stripe Checkout URL a HUMAN mus
|
|
|
97
97
|
|
|
98
98
|
### Global Flags (apply to ALL commands)
|
|
99
99
|
```
|
|
100
|
-
--json Output raw JSON (
|
|
101
|
-
-q, --quiet
|
|
100
|
+
--json Output raw JSON (the default whenever stdout is not a terminal)
|
|
101
|
+
-q, --quiet One handle per line (displayId, else name, else id) — on every command
|
|
102
|
+
--fields <list> Keep only these comma-separated fields in JSON output — on every command
|
|
103
|
+
-q --fields a,b Those fields as tab-separated lines, one row per line (no JSON at all)
|
|
102
104
|
-w, --workspace <id> Override active workspace
|
|
103
105
|
--server <url> Override server URL (default: https://creatornotes.app)
|
|
104
106
|
```
|
|
@@ -122,11 +124,23 @@ The CLI never charges a card: `create` returns a Stripe Checkout URL a HUMAN mus
|
|
|
122
124
|
|
|
123
125
|
Exit `8` is specific: CLI/API **writes** require a Pro workspace, but **reads work on any plan**. The `--json` error carries `serverCode: "subscription_required"`, an `upgradeUrl` (the workspace's billing page), and a `hint`. **You are not stuck here.** If the caller owns the workspace and hasn't used its one-time trial, `cnotes upgrade` unlocks writes in a single command — free, no credit card, no browser. Ask the user first (it burns the one-time trial), run it, then retry the write. Only when the trial is already spent does this become a hand-off to the `upgradeUrl`. Full playbook, including the not-the-owner case: [Paid actions](#paid-actions-writes-need-pro).
|
|
124
126
|
|
|
125
|
-
2. **Reads return their data directly; writes return an envelope.** `cnotes notes list/get/search --json` emit a bare array
|
|
127
|
+
2. **Reads return their data directly; writes return an envelope.** `cnotes notes list/get/search --json` emit a bare array. `cnotes notes create --json` returns an object: `{ results, relationshipsCreated, relationshipTypesCreated, rubrics? }`. The created notes live under **`results`** (not `notes`, not `ok`). Each result carries `key`, `displayId`, `title`, `type`, and `rubric` (null when the type has no validationPrompt). `--fields displayId,type,rubric` trims each result to those keys — do not cut down to only `displayId` until you have checked the rubric; a sibling top-level `rubrics` array is easy to miss.
|
|
126
128
|
|
|
127
|
-
**`cnotes canvas create --json`** returns a single-resource envelope: `{ canvas: { id, displayId, url, … } }`, with the same `id`, `displayId`, and `url` **also mirrored at the top level
|
|
129
|
+
**`cnotes canvas create --json`** returns a single-resource envelope: `{ canvas: { id, displayId, url, … } }`, with the same `id`, `displayId`, and `url` **also mirrored at the top level**, so `--fields id,displayId,url` gives all three. Simplest of all: `CANVAS=$(cnotes canvas create "<name>" -q)` prints the bare Convex id and nothing else (best for scripts). Do **not** assume `.id` on the raw *server* response — that top-level mirror is a CLI convenience; downstream `canvas place`/`bulk-add` want the Convex id you captured here.
|
|
128
130
|
|
|
129
|
-
3. **
|
|
131
|
+
3. **You do not need `jq`.** It is often not installed, and nothing here requires it. Read output with the CLI's own flags, which work on every command:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
cnotes types list -q # Insight, Decision, … one per line
|
|
135
|
+
cnotes notes list --type Decision -q # one displayId per line
|
|
136
|
+
cnotes notes list -q --fields displayId,title,type # tab-separated rows
|
|
137
|
+
cnotes notes create --notes '[…]' -q --fields key,displayId # batch key → new displayId, for a place spec
|
|
138
|
+
cnotes canvas digest <canvasId> --fields digest,themes # trim JSON to what you need
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
`--fields` on an envelope applies to its rows (`notes create` → `.results[]`, `comments list` → `.comments[]`) unless a field you named sits on the envelope itself. Reach for a JSON parser (`python3 -c`, `node -e`, or `jq` if present) only for nested values these flags cannot reach.
|
|
142
|
+
|
|
143
|
+
4. **Errors hand you the next move.** A failed command prints `{ error, code, exitCode, hint }` to stderr in `--json` mode. The `hint` is actionable: a wrong workspace id returns a 404 with `resource: "workspace"` and the hint `Run \`cnotes workspace list\``, rather than an opaque 500. Read the `hint` before retrying.
|
|
130
144
|
|
|
131
145
|
### Notes (`cnotes notes` / `cnotes n`)
|
|
132
146
|
```bash
|
|
@@ -144,9 +158,7 @@ cnotes notes get MEETING-12 PRD-3 IDEA-7
|
|
|
144
158
|
# JSON line. Best for transcripts you want to read or chunk.
|
|
145
159
|
cnotes notes get TRANSCRIPT-1 --content-only
|
|
146
160
|
cnotes notes get TRANSCRIPT-1 --content-only > /tmp/transcript.md # then chunk the file
|
|
147
|
-
#
|
|
148
|
-
# cnotes notes get TRANSCRIPT-1 --json | jq -r '.[0].content'
|
|
149
|
-
# (Reads are a bare array, so a single note is always at .[0].)
|
|
161
|
+
# Reads are a bare array, so in JSON a single note is always at .[0].
|
|
150
162
|
|
|
151
163
|
# Which canvases is this note on? The agent mirror of the editor's "Canvases"
|
|
152
164
|
# affordance. Container-aware: counts the note whether it's placed directly OR
|
|
@@ -609,7 +621,7 @@ is by design, not a bug — there is nothing to open.
|
|
|
609
621
|
# relatedNote: { displayId, title, type, workspaceName },
|
|
610
622
|
# relationshipType: { name, label } }
|
|
611
623
|
cnotes rel list --note <displayId>
|
|
612
|
-
cnotes rel list --note INSIGHT-1 --json
|
|
624
|
+
cnotes rel list --note INSIGHT-1 --json --fields incoming # just the backlinks
|
|
613
625
|
|
|
614
626
|
# By default you see links that hold RIGHT NOW. --history adds the superseded ones.
|
|
615
627
|
cnotes rel list --note <displayId> --history
|
|
@@ -812,7 +824,7 @@ For any canvas you only *added to* (you already hold its id, so you didn't re-`g
|
|
|
812
824
|
|
|
813
825
|
### Note Types
|
|
814
826
|
- The `--type` parameter must reference an **existing supertag** in the workspace. Free-text type strings are rejected.
|
|
815
|
-
- **Pick the type, then read its rubric, then write to it — in that order.** Each type carries a `validationPrompt` (its quality rubric: what a good instance contains). Once you know the type, run `cnotes types show <Type>` (or read `typeRubrics` from `cnotes operations begin --json` / `validationPrompt` from `cnotes types list --json`) and author to that rubric so the note lands well-formed instead of getting nudged after save. Example: a Decision needs the alternatives weighed, the rationale, and a revisit trigger. `cnotes notes create --json` also puts the rubric on **each** `.results[]` item (`type` + `rubric`) and as a top-level `rubrics` array — revise in-loop if a note falls short. Do not
|
|
827
|
+
- **Pick the type, then read its rubric, then write to it — in that order.** Each type carries a `validationPrompt` (its quality rubric: what a good instance contains). Once you know the type, run `cnotes types show <Type>` (or read `typeRubrics` from `cnotes operations begin --json` / `validationPrompt` from `cnotes types list --json`) and author to that rubric so the note lands well-formed instead of getting nudged after save. Example: a Decision needs the alternatives weighed, the rationale, and a revisit trigger. `cnotes notes create --json` also puts the rubric on **each** `.results[]` item (`type` + `rubric`) and as a top-level `rubrics` array — revise in-loop if a note falls short. Do not cut the output down to only `displayId` until you have checked `.results[].rubric`.
|
|
816
828
|
- If the type you need doesn't exist, create it first: `cnotes types create "MyType" --display-name "My Type"`
|
|
817
829
|
- Type names are **case-sensitive** and use PascalCase (e.g., `Update`, `PainPoint`, `Meeting`).
|
|
818
830
|
- The display ID prefix is **auto-derived** from the display name: spaces become hyphens, all uppercase (e.g., display name "Pain Point" → prefix `PAIN-POINT`, display name "Idea" → prefix `IDEA`).
|
|
@@ -847,11 +859,12 @@ For any canvas you only *added to* (you already hold its id, so you didn't re-`g
|
|
|
847
859
|
- These are separate operations by design.
|
|
848
860
|
|
|
849
861
|
### JSON Mode for Scripting
|
|
850
|
-
- Use `--json` to get raw JSON output for
|
|
862
|
+
- Use `--json` to get raw JSON output for piping between commands, and `-q` / `--fields` to read it without a JSON parser. See [Reading output](#reading-output-start-here) for the contract behind these shapes.
|
|
851
863
|
- Reads emit a bare array; writes emit an envelope. Read created notes from `results`, never from `notes`/`ok`:
|
|
852
864
|
```bash
|
|
853
865
|
# Capture the display IDs a batch create produced
|
|
854
|
-
IDS=$(cnotes notes create --
|
|
866
|
+
IDS=$(cnotes notes create --notes '[…]' -q) # one displayId per line
|
|
867
|
+
cnotes notes create --notes '[…]' -q --fields key,displayId # key<TAB>displayId per line
|
|
855
868
|
```
|
|
856
869
|
- Treat a `0` exit code as the only success signal. Do not re-run a write because an expected key looked empty; re-running a successful `notes create` duplicates the batch.
|
|
857
870
|
- On validation failure with `--json`, the per-item errors come back in `details.items` (array of `{index, key?, field, message}`) so they can be parsed and surfaced precisely.
|
|
@@ -865,7 +878,7 @@ For any canvas you only *added to* (you already hold its id, so you didn't re-`g
|
|
|
865
878
|
|
|
866
879
|
**Always start canvas work with `cnotes canvas digest <canvasId> --json`.** The digest returns the narrative summary, key themes, and a per-note summary list covering every note on the canvas. Use this as your single source of context before making any changes — do not read each note individually unless you need full content.
|
|
867
880
|
|
|
868
|
-
**`--json` field names** (they aren't what you'd guess — the narrative is **`.digest`**, *not* `.narrative` or `.summary`). Top-level shape: `{ status, canvasName, digest, themes[], notes[], noteCount, generatedAt }`. So
|
|
881
|
+
**`--json` field names** (they aren't what you'd guess — the narrative is **`.digest`**, *not* `.narrative` or `.summary`). Top-level shape: `{ status, canvasName, digest, themes[], notes[], noteCount, generatedAt }`. So `--fields digest` gets the narrative, `.canvasName` the title, `.themes[]` the key themes, and `.notes[]` the per-note list (shape below).
|
|
869
882
|
|
|
870
883
|
The `notes` array entries have the shape `{ displayId, title, type, summary }`. When `summary` is `null`, the AI summary hasn't been generated yet (fresh note, or too short to summarize); run `cnotes notes get <displayId> [<displayId>...]` (batch-fetch in one call) if you need full content.
|
|
871
884
|
|
|
@@ -44,9 +44,23 @@ A keyframe is a **key moment in a single flow**, not a screen inventory. Before
|
|
|
44
44
|
2. List 4–7 keyframes. Each is a state where **something changed** from the prior frame.
|
|
45
45
|
3. Decide the **shared chrome** that stays identical across every frame (same window, same tab bar, same panel). Only the changed thing differs frame to frame. Consistent chrome is what makes the set read as one continuous journey.
|
|
46
46
|
4. For each frame, write: a circled number, a short title, what the user just did, the one element to highlight, and a one-line caption that states the *promise* of that step.
|
|
47
|
+
5. Write the frame's **explainer** before its prompt: two or three plain sentences a stranger reads under the sketch. What the person did, what they now see, why it matters to them. If you cannot write that in the person's own words, it is not a keyframe. The explainer is placed under the tile in Step 3; it is not optional.
|
|
47
48
|
|
|
48
49
|
Keep captions free of em dashes (house style).
|
|
49
50
|
|
|
51
|
+
### The meaning test (run it on every frame before you generate)
|
|
52
|
+
|
|
53
|
+
A frame that passes the style check can still be slop: a picture with no readable cause and effect, labelled with words only the builder knows. Two frames failed this way on a real board (2026-09-26): one showed a card sliding out of a frame with a tag saying "noted", the other a pushpin saying "live" and a question bubble. The reader could not tell what the person had done or what they got. Both were drawings of a *mechanism* (a label written, a standing question saved), not of a *moment*.
|
|
54
|
+
|
|
55
|
+
Every frame must pass all four:
|
|
56
|
+
|
|
57
|
+
- **One visible cause, one visible effect.** The person does something you can draw (says a sentence, drags a card, points), and something on screen changes because of it. A frame that shows only the effect ("noted") or only a state ("live") fails.
|
|
58
|
+
- **Only the person's words.** Speech bubbles, labels and captions use words the person would say or read on screen. No internal vocabulary: no "label", "flag", "unsure band", "standing question", "live", no probabilities. If a concept needs a term, it goes in the explainer card, defined.
|
|
59
|
+
- **Only what the chosen shape delivers.** Draw the slices, not the vision. A frame of a feature that is not in the shape's parts is a promise nobody made.
|
|
60
|
+
- **Readable cold.** Imagine the frame with no title and no caption. Can a stranger say what just happened? If not, redraw the scene so the cause is in the picture (put the sentence in the bubble, draw the card that was wrong with its title).
|
|
61
|
+
|
|
62
|
+
Cut a frame that fails rather than fixing it with a longer caption. Four honest frames beat six vague ones.
|
|
63
|
+
|
|
50
64
|
---
|
|
51
65
|
|
|
52
66
|
## Step 1 — The reusable style preamble
|
|
@@ -122,8 +136,17 @@ cnotes files gen-image --aspect 16:9 -w "$WS" --json <<'PROMPT' \
|
|
|
122
136
|
PROMPT
|
|
123
137
|
```
|
|
124
138
|
|
|
125
|
-
Then look at every frame
|
|
126
|
-
|
|
139
|
+
Then look at every frame twice.
|
|
140
|
+
|
|
141
|
+
**Style check:** same chrome across all, coral only on the changed thing, numbers in order,
|
|
142
|
+
captions legible, the sequence tells the story.
|
|
143
|
+
|
|
144
|
+
**Cold read (the one that catches slop):** for each frame, before re-reading your own prompt,
|
|
145
|
+
write one sentence describing what a stranger sees: "the person said X and Y appeared". If
|
|
146
|
+
that sentence names neither a cause nor an effect, or uses a word that is not in the picture,
|
|
147
|
+
the frame fails the meaning test in Step 0. Regenerate it with the cause drawn into the scene,
|
|
148
|
+
or cut it. The image model draws what you asked for; a meaningless frame is a meaningless
|
|
149
|
+
prompt, not a model miss.
|
|
127
150
|
|
|
128
151
|
> **Admins** generate server-side with no local key. **Everyone else** adds `--byo-key` after
|
|
129
152
|
> setting `GOOGLE_GENERATIVE_AI_API_KEY` (get a key at ai.google.dev): the image is then generated
|
|
@@ -146,16 +169,24 @@ cnotes operations begin -w "$WS" --prompt "Add fat-marker user-journey keyframes
|
|
|
146
169
|
# urls.txt already holds one fullUrl per line, in frame order, from Step 2.
|
|
147
170
|
```
|
|
148
171
|
|
|
149
|
-
Build a `place` spec where each frame is
|
|
172
|
+
Build a `place` spec where each frame is **one `richtext` item holding the image and then its
|
|
173
|
+
explainer**: the content is ``, a blank line, then the two-or-three
|
|
174
|
+
sentence explainer you wrote in Step 0. A text element is rich text, so the image and the words
|
|
175
|
+
live in the same node and move together; never split them into a tile plus a second card. The
|
|
176
|
+
frames go in a horizontal stack for up to 4 frames, or a 3-column grid for 5 to 6, with a
|
|
177
|
+
header richtext above. A bare image with only its in-image caption is the shape that produced
|
|
178
|
+
unreadable frames; the paragraph under the image is what a cold reader actually reads.
|
|
150
179
|
|
|
151
180
|
```js
|
|
152
181
|
// build-journey.js — writes journey.json
|
|
153
182
|
const fs = require('fs');
|
|
154
183
|
const urls = fs.readFileSync('urls.txt','utf8').trim().split('\n');
|
|
155
|
-
const
|
|
184
|
+
const explainers = JSON.parse(fs.readFileSync('explainers.json','utf8')); // one string per frame, in order
|
|
185
|
+
const frames = urls.map((u,i)=>({kind:'item',type:'richtext',size:'medium',key:`kf${i+1}`,
|
|
186
|
+
content:`\n\n${explainers[i]}`}));
|
|
156
187
|
const spec = { root: { kind:'stack', axis:'vertical', gap:'medium', align:'start', items:[
|
|
157
|
-
{kind:'item',type:'richtext',size:'medium',content:'# User journey: <flow>\n\nFat-marker keyframes (broad strokes). Read
|
|
158
|
-
{kind:'
|
|
188
|
+
{kind:'item',type:'richtext',size:'medium',content:'# User journey: <flow>\n\nFat-marker keyframes (broad strokes). Read 1 to N. Coral marks the one thing that changed; the card under each sketch says what you did and what you see.'},
|
|
189
|
+
{kind:'grid', columns: 3, gap:'medium', items:frames},
|
|
159
190
|
]}};
|
|
160
191
|
fs.writeFileSync('journey.json', JSON.stringify(spec));
|
|
161
192
|
```
|
|
@@ -197,6 +228,9 @@ cnotes operations end -w $WS
|
|
|
197
228
|
- **No local key needed (admin).** `cnotes files gen-image` generates server-side, so there's nothing to export. Non-admins pass `--byo-key` after setting `GOOGLE_GENERATIVE_AI_API_KEY`; the image is generated locally and the key never leaves the machine.
|
|
198
229
|
- **Internal/working mockups go in the Private workspace.** Use `-w <privateId>` and verify with `cnotes workspace current`.
|
|
199
230
|
- **One change per frame.** If two things differ between adjacent frames, split into two frames. Ambiguity about "what changed" is what makes a storyboard unreadable.
|
|
231
|
+
- **A tag is not a moment.** "noted", "live", "saved", a pin, a checkmark on its own: these are the builder's bookkeeping, invisible to the person. Draw what the person did and what the screen did back. The mechanism belongs in the shape's parts table, not in the sketch.
|
|
232
|
+
- **Never place an image without its explainer, and keep both in ONE node.** The in-image caption is a promise in six words; the paragraph after the image is the sentence a stranger reads to know what happened. A filmstrip of bare tiles was rejected as "visual AI slop" on 2026-09-26, and a follow-up that put the text in a separate card under each tile was corrected the same day: the node is rich text, so the words go after the image inside it.
|
|
233
|
+
- **Grid order follows measured y, not your item order.** When frames in one row measure a few pixels apart in height, a later read-back sorts them by position and the row can come out 6, 4, 5. After placing, read the positions back and `bulk-move` any row whose x order does not match the circled numbers.
|
|
200
234
|
|
|
201
235
|
---
|
|
202
236
|
|