@jpkme/diff-review 0.1.4 → 0.1.5

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.
Files changed (71) hide show
  1. package/README.md +4 -4
  2. package/bin/diff-review.mjs +231 -89
  3. package/lib/autocomplete-es.mjs +143 -0
  4. package/lib/output-name.mjs +18 -30
  5. package/lib/output-name.test.mjs +10 -27
  6. package/lib/prompt.mjs +13 -7
  7. package/package.json +3 -2
  8. package/schema.json +12 -0
  9. package/web/build/client/_app/immutable/chunks/{CAnYe5db.js → CO0mUwMJ.js} +1 -1
  10. package/web/build/client/_app/immutable/chunks/CO0mUwMJ.js.br +2 -0
  11. package/web/build/client/_app/immutable/chunks/CO0mUwMJ.js.gz +0 -0
  12. package/web/build/client/_app/immutable/chunks/{BaYDuTXu.js → CdHZDAAo.js} +26 -23
  13. package/web/build/client/_app/immutable/chunks/CdHZDAAo.js.br +0 -0
  14. package/web/build/client/_app/immutable/chunks/CdHZDAAo.js.gz +0 -0
  15. package/web/build/client/_app/immutable/chunks/{Gya4IU1I.js → DzqTpz7_.js} +2 -2
  16. package/web/build/client/_app/immutable/chunks/DzqTpz7_.js.br +0 -0
  17. package/web/build/client/_app/immutable/chunks/DzqTpz7_.js.gz +0 -0
  18. package/web/build/client/_app/immutable/entry/{app.e96uPVtl.js → app.BRzz8J51.js} +2 -2
  19. package/web/build/client/_app/immutable/entry/app.BRzz8J51.js.br +0 -0
  20. package/web/build/client/_app/immutable/entry/app.BRzz8J51.js.gz +0 -0
  21. package/web/build/client/_app/immutable/entry/start.BSioRkqK.js +1 -0
  22. package/web/build/client/_app/immutable/entry/start.BSioRkqK.js.br +0 -0
  23. package/web/build/client/_app/immutable/entry/start.BSioRkqK.js.gz +0 -0
  24. package/web/build/client/_app/immutable/nodes/{1.V-g5-sfL.js → 1.ws8Khan5.js} +1 -1
  25. package/web/build/client/_app/immutable/nodes/1.ws8Khan5.js.br +1 -0
  26. package/web/build/client/_app/immutable/nodes/1.ws8Khan5.js.gz +0 -0
  27. package/web/build/client/_app/immutable/nodes/2.CsD5xqRB.js +66 -0
  28. package/web/build/client/_app/immutable/nodes/2.CsD5xqRB.js.br +0 -0
  29. package/web/build/client/_app/immutable/nodes/2.CsD5xqRB.js.gz +0 -0
  30. package/web/build/client/_app/immutable/nodes/3.ByTmpJQZ.js +170 -0
  31. package/web/build/client/_app/immutable/nodes/3.ByTmpJQZ.js.br +0 -0
  32. package/web/build/client/_app/immutable/nodes/3.ByTmpJQZ.js.gz +0 -0
  33. package/web/build/client/_app/version.json +1 -1
  34. package/web/build/client/_app/version.json.br +0 -0
  35. package/web/build/client/_app/version.json.gz +0 -0
  36. package/web/build/handler.js +3 -3
  37. package/web/build/index.js +3 -3
  38. package/web/build/server/chunks/1-qrn24yN5.js +7 -0
  39. package/web/build/server/chunks/{1-DCKScL3A.js.map → 1-qrn24yN5.js.map} +1 -1
  40. package/web/build/server/chunks/{2-BpBQQ02B.js → 2-C7_Loqyn.js} +2 -2
  41. package/web/build/server/chunks/{2-BpBQQ02B.js.map → 2-C7_Loqyn.js.map} +1 -1
  42. package/web/build/server/chunks/{3-rGkcNCVz.js → 3-DZ5PBhOc.js} +2 -2
  43. package/web/build/server/chunks/{3-rGkcNCVz.js.map → 3-DZ5PBhOc.js.map} +1 -1
  44. package/web/build/server/chunks/{handler-BaT-QavL.js → handler-DD4vP3bU.js} +3 -3
  45. package/web/build/server/chunks/{handler-BaT-QavL.js.map → handler-DD4vP3bU.js.map} +1 -1
  46. package/web/build/server/chunks/{index.js-C-K0YDBJ.js → index.js-IhFPHwmp.js} +2 -2
  47. package/web/build/server/chunks/{index.js-C-K0YDBJ.js.map → index.js-IhFPHwmp.js.map} +1 -1
  48. package/web/build/server/chunks/{manifest.js-CDz-Fem4.js → manifest.js-Dk3RuAA5.js} +6 -6
  49. package/web/build/server/chunks/{manifest.js-CDz-Fem4.js.map → manifest.js-Dk3RuAA5.js.map} +1 -1
  50. package/web/build/server/chunks/{remote-1g4ayag-DXdFe1BG.js → remote-1g4ayag-BRL-uaKE.js} +27 -40
  51. package/web/build/server/chunks/{remote-1g4ayag-DXdFe1BG.js.map → remote-1g4ayag-BRL-uaKE.js.map} +1 -1
  52. package/web/build/client/_app/immutable/chunks/BaYDuTXu.js.br +0 -0
  53. package/web/build/client/_app/immutable/chunks/BaYDuTXu.js.gz +0 -0
  54. package/web/build/client/_app/immutable/chunks/CAnYe5db.js.br +0 -1
  55. package/web/build/client/_app/immutable/chunks/CAnYe5db.js.gz +0 -0
  56. package/web/build/client/_app/immutable/chunks/Gya4IU1I.js.br +0 -0
  57. package/web/build/client/_app/immutable/chunks/Gya4IU1I.js.gz +0 -0
  58. package/web/build/client/_app/immutable/entry/app.e96uPVtl.js.br +0 -0
  59. package/web/build/client/_app/immutable/entry/app.e96uPVtl.js.gz +0 -0
  60. package/web/build/client/_app/immutable/entry/start.D-D-7QPy.js +0 -1
  61. package/web/build/client/_app/immutable/entry/start.D-D-7QPy.js.br +0 -0
  62. package/web/build/client/_app/immutable/entry/start.D-D-7QPy.js.gz +0 -0
  63. package/web/build/client/_app/immutable/nodes/1.V-g5-sfL.js.br +0 -0
  64. package/web/build/client/_app/immutable/nodes/1.V-g5-sfL.js.gz +0 -0
  65. package/web/build/client/_app/immutable/nodes/2.lcRePHZ5.js +0 -66
  66. package/web/build/client/_app/immutable/nodes/2.lcRePHZ5.js.br +0 -0
  67. package/web/build/client/_app/immutable/nodes/2.lcRePHZ5.js.gz +0 -0
  68. package/web/build/client/_app/immutable/nodes/3.GZPWeD9I.js +0 -170
  69. package/web/build/client/_app/immutable/nodes/3.GZPWeD9I.js.br +0 -0
  70. package/web/build/client/_app/immutable/nodes/3.GZPWeD9I.js.gz +0 -0
  71. package/web/build/server/chunks/1-DCKScL3A.js +0 -7
@@ -1,54 +1,37 @@
1
1
  import assert from "node:assert/strict";
2
2
  import { describe, it } from "node:test";
3
3
  import {
4
- formatOutputStamp,
5
4
  isOutputFilename,
6
5
  makeOutputFilename,
7
6
  OUTPUT_FILENAME_LEGACY,
8
7
  } from "./output-name.mjs";
9
8
 
10
9
  describe("output-name", () => {
11
- const when = new Date(2026, 8, 15, 14, 30, 45);
12
- const stamp = "20260915-143045";
13
-
14
- it("formats stamp", () => {
15
- assert.equal(formatOutputStamp(when), stamp);
16
- });
17
-
18
10
  it("builds name with short tip hashes", () => {
19
11
  const name = makeOutputFilename({
20
12
  branchSha: "aaaaaaaaaa1111111111",
21
13
  baseSha: "bbbbbbbbbb2222222222",
22
- when,
23
14
  });
24
- assert.equal(name, "diff-report_aaaaaaaaaa-bbbbbbbbbb_20260915-143045.json");
15
+ assert.equal(name, "diff-rev_aaaaaaaaaa_bbbbbbbbbb.json");
25
16
  assert.equal(isOutputFilename(name), true);
26
17
  });
27
18
 
28
- it("reuses an explicit stamp", () => {
29
- const name = makeOutputFilename({
30
- branchSha: "abcdef0123456789",
31
- baseSha: "fedcba9876543210",
32
- stamp: "20260101-000000",
33
- });
34
- assert.equal(name, "diff-report_abcdef0123-fedcba9876_20260101-000000.json");
35
- });
36
-
37
- it("falls back to legacy stamp without tips", () => {
38
- const name = makeOutputFilename({ when });
39
- assert.equal(name, "diff-review-output-20260915-143045.json");
40
- assert.equal(isOutputFilename(name), true);
19
+ it("falls back to legacy without tips", () => {
20
+ assert.equal(makeOutputFilename({}), OUTPUT_FILENAME_LEGACY);
21
+ assert.equal(isOutputFilename(OUTPUT_FILENAME_LEGACY), true);
41
22
  });
42
23
 
43
- it("accepts legacy names", () => {
44
- assert.equal(OUTPUT_FILENAME_LEGACY, "diff-review-output.json");
45
- assert.equal(isOutputFilename(OUTPUT_FILENAME_LEGACY), true);
24
+ it("accepts legacy stamped and report names", () => {
46
25
  assert.equal(isOutputFilename("diff-review-output-20260915-143045.json"), true);
26
+ assert.equal(
27
+ isOutputFilename("diff-report_aaaaaaaaaa-bbbbbbbbbb_20260915-143045.json"),
28
+ true
29
+ );
47
30
  });
48
31
 
49
32
  it("rejects other names", () => {
50
33
  assert.equal(isOutputFilename("review.json"), false);
51
34
  assert.equal(isOutputFilename("diff-review-output-foo.json"), false);
52
- assert.equal(isOutputFilename("diff-report_short-tips_20260915-143045.json"), false);
35
+ assert.equal(isOutputFilename("diff-rev_short_tips.json"), false);
53
36
  });
54
37
  });
package/lib/prompt.mjs CHANGED
@@ -4,14 +4,12 @@
4
4
  */
5
5
  import {
6
6
  makeOutputFilename,
7
- formatOutputStamp,
8
7
  isOutputFilename,
9
8
  OUTPUT_FILENAME_LEGACY,
10
9
  } from "./output-name.mjs";
11
10
 
12
11
  export {
13
12
  makeOutputFilename,
14
- formatOutputStamp,
15
13
  isOutputFilename,
16
14
  OUTPUT_FILENAME_LEGACY,
17
15
  };
@@ -22,7 +20,10 @@ export const OUTPUT_SCHEMA_BLOCK = `{
22
20
  "repo": "<absolute path or git URL>",
23
21
  "branch": "<branch under review>",
24
22
  "base": "develop",
25
- "remoteUrl": "<origin URL; optional when source=url>"
23
+ "remoteUrl": "<origin URL; optional when source=url>",
24
+ "generatedAt": "<ISO-8601 datetime; optional, informational>",
25
+ "agent": "<tool name e.g. Claude Code / Cursor; optional, informational>",
26
+ "model": "<model id e.g. claude-opus-…; optional, informational>"
26
27
  },
27
28
  "intent": "string",
28
29
  "groups": [
@@ -108,9 +109,14 @@ export function outputSchemaBlock(meta) {
108
109
  ` "source": ${JSON.stringify(source)},`,
109
110
  ` "repo": ${JSON.stringify(repo)},`,
110
111
  ` "branch": ${JSON.stringify(branch)},`,
111
- ` "base": ${JSON.stringify(base)}${remoteUrl ? "," : ""}`,
112
+ ` "base": ${JSON.stringify(base)},`,
112
113
  ];
113
- if (remoteUrl) metaLines.push(` "remoteUrl": ${JSON.stringify(remoteUrl)}`);
114
+ if (remoteUrl) metaLines.push(` "remoteUrl": ${JSON.stringify(remoteUrl)},`);
115
+ metaLines.push(
116
+ ` "generatedAt": "<ISO-8601 datetime>",`,
117
+ ` "agent": "<tool name, e.g. Claude Code / Cursor>",`,
118
+ ` "model": "<model id>"`
119
+ );
114
120
  const metaBlock = `"meta": {\n${metaLines.join("\n")}\n }`;
115
121
  return OUTPUT_SCHEMA_BLOCK.replace(/"meta": \{[\s\S]*?\n \}/, metaBlock);
116
122
  }
@@ -142,11 +148,11 @@ ${RULES}
142
148
  Write the result to \`${outputFilename}\` at the repo root.
143
149
  - One JSON object only: first character \`{\`, last character \`}\`.
144
150
  - No prose before/after, no markdown fences.
145
- - Shape (copy "meta" exactly as given):
151
+ - Shape (copy "meta" source/repo/branch/base/remoteUrl as given; fill generatedAt/agent/model):
146
152
 
147
153
  ${outputSchemaBlock(meta)}
148
154
 
149
- Include "meta" with the source/repo/branch/base above (and origin "remoteUrl" when local). That lets someone reopen the report elsewhere without re-picking the repo.
155
+ Include "meta" with the source/repo/branch/base above (and origin "remoteUrl" when local). Also set informational fields: "generatedAt" (ISO-8601 now), "agent" (tool name), "model" (model id). That lets someone reopen the report elsewhere without re-picking the repo.
150
156
 
151
157
  Do NOT include diffs or a "files" array — the tool computes them with git when opening the report. Do not invent hunks or paste patches into the JSON.
152
158
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jpkme/diff-review",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Local UI to prompt a coding agent for a branch review and browse the result.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -49,6 +49,7 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@bindrs/rfd": "^2.2.2"
52
+ "@bindrs/rfd": "^2.2.2",
53
+ "@clack/prompts": "^1.8.1"
53
54
  }
54
55
  }
package/schema.json CHANGED
@@ -21,6 +21,18 @@
21
21
  "remoteUrl": {
22
22
  "type": "string",
23
23
  "description": "URL del remote (origin). Fallback si la carpeta local no existe en otra máquina."
24
+ },
25
+ "generatedAt": {
26
+ "type": "string",
27
+ "description": "ISO-8601 de cuándo se escribió la review (informativo)."
28
+ },
29
+ "agent": {
30
+ "type": "string",
31
+ "description": "Nombre del tool/agente (informativo), ej. Claude Code / Cursor."
32
+ },
33
+ "model": {
34
+ "type": "string",
35
+ "description": "Id del modelo usado (informativo)."
24
36
  }
25
37
  }
26
38
  },
@@ -1 +1 @@
1
- import"./Dur-vdUf.js";import{c as e}from"./Gya4IU1I.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
1
+ import"./Dur-vdUf.js";import{c as e}from"./DzqTpz7_.js";var t={get data(){return e.data},get error(){return e.error},get form(){return e.form},get params(){return e.params},get route(){return e.route},get state(){return e.state},get status(){return e.status},get url(){return e.url}};export{t};
@@ -0,0 +1,2 @@
1
+ %@�r[�Kbqh#DȢ;��ʬ�8x 4 ��Bzo�*�����+!�I��8���͊l~�)�+�B�)�ٟJ�}s�2� ���o����\@F�
2
+ J&��|R��|k��u��u�/�jbij/��`���_:���