@morehao/trendradar-contract 0.5.0 → 0.6.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/CHANGELOG.md CHANGED
@@ -3,9 +3,21 @@
3
3
  All notable changes to `@morehao/trendradar-contract` are documented here.
4
4
  This project adheres to a `contract/vX.Y.Z` tag per release (npm + Go submodule).
5
5
 
6
- ## Unreleased
6
+ ## 0.6.0
7
7
 
8
- _Nothing yet._
8
+ Digest inlined in `RunResult`. **Breaking wire bump**: `ipcSchema` 2 → 3
9
+ (`digestSchema` stays 2). A core/plugin pair must both move to this contract
10
+ line; the plugin's handshake hard-rejects the mismatch.
11
+
12
+ ### Added
13
+ - `RunResult.digest` (optional): the digest document this run rendered —
14
+ `{ path, bytes, sha256, text }`. `bytes`/`sha256` describe `text`'s UTF-8 bytes
15
+ exactly as written to `path`; `text` is capped at 1 MiB.
16
+ Present whenever the digest stage rendered a document (including
17
+ `skipped=unchanged` and the `merged` / `pr-closed` early exits, which render
18
+ before the PR pre-check); absent for dry runs, release-only runs, and failures
19
+ before rendering. Consumers no longer need to read the output repository to
20
+ display the digest.
9
21
 
10
22
  ## 0.5.0
11
23
 
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @morehao/trendradar-contract (0.4.0)
1
+ # @morehao/trendradar-contract (0.6.0)
2
2
 
3
3
  The single source of truth for the data shapes shared by the **trendradar Go
4
4
  core** (`github.com/morehao/trendradar`) and the **DSH plugin**
@@ -12,16 +12,17 @@ artifacts from one tag:
12
12
 
13
13
  Both are released together by the tag `contract/v0.Y.Z` (see `CHANGELOG.md`).
14
14
 
15
- > Version model: the **package** is `0.4.0`, while the
16
- > **wire format** it carries is the second generation — `ipcSchema=2`,
17
- > `digestSchema=2`. The integers 2 distinguish this contract from the legacy
18
- > in-repo v1; they are intentionally decoupled from the package semver.
15
+ > Version model: the **package** is `0.6.0`, while the
16
+ > **wire format** it carries is the third generation — `ipcSchema=3`,
17
+ > `digestSchema=2`. The integers distinguish this contract from the legacy
18
+ > in-repo v1 and the pre-inline `ipcSchema=2`; they are intentionally decoupled
19
+ > from the package semver.
19
20
 
20
21
  ## Install
21
22
 
22
23
  ```bash
23
- npm i @morehao/trendradar-contract@0.4.0
24
- go get github.com/morehao/trendradar/contract@v0.4.0 # resolves tag contract/v0.4.0
24
+ npm i @morehao/trendradar-contract@0.6.0
25
+ go get github.com/morehao/trendradar/contract@v0.6.0 # resolves tag contract/v0.6.0
25
26
  ```
26
27
 
27
28
  ## Layout
@@ -29,7 +30,7 @@ go get github.com/morehao/trendradar/contract@v0.4.0 # resolves tag contract/v
29
30
  | Path | Purpose |
30
31
  |---|---|
31
32
  | `schema/model.v2.json` | `RepoSnapshot`; `RepoDigest` composes it via `allOf` |
32
- | `schema/ipc.v2.json` | `RunRequest` (strict), `RunResult`, `ErrorInfo`, `State`, `FileArtifact` |
33
+ | `schema/ipc.v3.json` | `RunRequest` (strict), `RunResult` (incl. inlined `DigestArtifact`), `ErrorInfo`, `State`, `FileArtifact` |
33
34
  | `schema/digest.v2.json` | rendered digest document, incl. `contentHashAlgo` |
34
35
  | `schema/releases.v2.json` | release-subscription document + `ReleasesReport` (run cost) |
35
36
  | `schema/errors.v2.json` | 17 error codes with `retriable`/`description` (single source of truth) |
package/gen/ts/index.d.ts CHANGED
@@ -36,8 +36,16 @@ export interface FileArtifact {
36
36
  [k: string]: unknown;
37
37
  }
38
38
 
39
+ export interface DigestArtifact {
40
+ "path": string;
41
+ "bytes": number;
42
+ "sha256": string;
43
+ "text": string;
44
+ [k: string]: unknown;
45
+ }
46
+
39
47
  export interface RunRequest {
40
- "ipcSchema": 2;
48
+ "ipcSchema": 3;
41
49
  "command": "run" | "serve" | "config" | "version" | "subscribe";
42
50
  "configPath"?: string;
43
51
  "date"?: string;
@@ -50,13 +58,14 @@ export interface RunRequest {
50
58
  }
51
59
 
52
60
  export interface RunResult {
53
- "ipcSchema": 2;
61
+ "ipcSchema": 3;
54
62
  "ok": boolean;
55
63
  "command": "run" | "serve" | "config" | "version" | "subscribe";
56
64
  "startedAt": string;
57
65
  "finishedAt": string;
58
66
  "skipped": boolean;
59
67
  "files": Array<FileArtifact>;
68
+ "digest"?: DigestArtifact;
60
69
  "branch"?: string;
61
70
  "commit"?: string;
62
71
  "prUrl"?: string;
@@ -92,8 +101,8 @@ export interface StateRun {
92
101
  }
93
102
 
94
103
  export interface State {
95
- "ipcSchema": 2;
96
- "stateSchema": 2;
104
+ "ipcSchema": 3;
105
+ "stateSchema": 3;
97
106
  "lastRun"?: StateRun;
98
107
  [k: string]: unknown;
99
108
  }
@@ -225,7 +234,7 @@ export interface ReleaseDigest {
225
234
  export interface VersionInfo {
226
235
  "version": string;
227
236
  "commit": string;
228
- "ipcSchema": 2;
237
+ "ipcSchema": 3;
229
238
  "digestSchema": 2;
230
239
  "contractVersion": string;
231
240
  "supportedProviders": Array<string>;
package/gen/ts/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import Ajv from 'ajv/dist/2020.js'
3
3
  import addFormats from 'ajv-formats'
4
4
 
5
- export const contractVersion = "0.5.0"
5
+ export const contractVersion = "0.6.0"
6
6
 
7
7
  export const errorCatalog = {
8
8
  "INTERNAL": {
@@ -979,9 +979,9 @@ const model = {
979
979
  }
980
980
  const ipc = {
981
981
  "$schema": "https://json-schema.org/draft/2020-12/schema",
982
- "$id": "https://github.com/morehao/trendradar/contract/schema/ipc.v2.json",
983
- "title": "trendradar ipc v2",
984
- "description": "Envelope exchanged between the trendradar core binary and the DSH plugin. Only RunRequest forbids extra fields. ipcSchema is const 2.",
982
+ "$id": "https://github.com/morehao/trendradar/contract/schema/ipc.v3.json",
983
+ "title": "trendradar ipc v3",
984
+ "description": "Envelope exchanged between the trendradar core binary and the DSH plugin. Only RunRequest forbids extra fields. ipcSchema is const 3.",
985
985
  "oneOf": [
986
986
  {
987
987
  "$ref": "#/$defs/RunRequest"
@@ -1058,6 +1058,35 @@ const ipc = {
1058
1058
  }
1059
1059
  }
1060
1060
  },
1061
+ "DigestArtifact": {
1062
+ "type": "object",
1063
+ "additionalProperties": true,
1064
+ "description": "The digest document rendered by this run, inlined so the caller never reads the output repository. bytes/sha256 describe the UTF-8 bytes of text exactly as written to path.",
1065
+ "required": [
1066
+ "path",
1067
+ "bytes",
1068
+ "sha256",
1069
+ "text"
1070
+ ],
1071
+ "properties": {
1072
+ "path": {
1073
+ "type": "string"
1074
+ },
1075
+ "bytes": {
1076
+ "type": "integer",
1077
+ "minimum": 0,
1078
+ "maximum": 1048576
1079
+ },
1080
+ "sha256": {
1081
+ "type": "string",
1082
+ "pattern": "^sha256:[0-9a-f]{64}$"
1083
+ },
1084
+ "text": {
1085
+ "type": "string",
1086
+ "maxLength": 1048576
1087
+ }
1088
+ }
1089
+ },
1061
1090
  "RunRequest": {
1062
1091
  "type": "object",
1063
1092
  "additionalProperties": false,
@@ -1067,7 +1096,7 @@ const ipc = {
1067
1096
  ],
1068
1097
  "properties": {
1069
1098
  "ipcSchema": {
1070
- "const": 2
1099
+ "const": 3
1071
1100
  },
1072
1101
  "command": {
1073
1102
  "type": "string",
@@ -1353,7 +1382,7 @@ const ipc = {
1353
1382
  ],
1354
1383
  "properties": {
1355
1384
  "ipcSchema": {
1356
- "const": 2
1385
+ "const": 3
1357
1386
  },
1358
1387
  "ok": {
1359
1388
  "type": "boolean"
@@ -1385,6 +1414,9 @@ const ipc = {
1385
1414
  "$ref": "#/$defs/FileArtifact"
1386
1415
  }
1387
1416
  },
1417
+ "digest": {
1418
+ "$ref": "#/$defs/DigestArtifact"
1419
+ },
1388
1420
  "branch": {
1389
1421
  "type": "string"
1390
1422
  },
@@ -1508,10 +1540,10 @@ const ipc = {
1508
1540
  ],
1509
1541
  "properties": {
1510
1542
  "ipcSchema": {
1511
- "const": 2
1543
+ "const": 3
1512
1544
  },
1513
1545
  "stateSchema": {
1514
- "const": 2
1546
+ "const": 3
1515
1547
  },
1516
1548
  "lastRun": {
1517
1549
  "$ref": "#/$defs/StateRun"
@@ -1836,7 +1868,7 @@ const releases = {
1836
1868
  "minimum": 0
1837
1869
  },
1838
1870
  "usage": {
1839
- "$ref": "https://github.com/morehao/trendradar/contract/schema/ipc.v2.json#/$defs/Usage"
1871
+ "$ref": "https://github.com/morehao/trendradar/contract/schema/ipc.v3.json#/$defs/Usage"
1840
1872
  }
1841
1873
  }
1842
1874
  },
@@ -2014,7 +2046,7 @@ const versionInfo = {
2014
2046
  "$schema": "https://json-schema.org/draft/2020-12/schema",
2015
2047
  "$id": "https://github.com/morehao/trendradar/contract/schema/version-info.v2.json",
2016
2048
  "title": "trendradar version info v2",
2017
- "description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===2 && digestSchema===2 && contractVersion major===2.",
2049
+ "description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===3 && digestSchema===2 && contractVersion major===0.",
2018
2050
  "type": "object",
2019
2051
  "additionalProperties": true,
2020
2052
  "required": [
@@ -2033,7 +2065,7 @@ const versionInfo = {
2033
2065
  "type": "string"
2034
2066
  },
2035
2067
  "ipcSchema": {
2036
- "const": 2
2068
+ "const": 3
2037
2069
  },
2038
2070
  "digestSchema": {
2039
2071
  "const": 2
@@ -2053,7 +2085,7 @@ const errors = {
2053
2085
  "$schema": "https://json-schema.org/draft/2020-12/schema",
2054
2086
  "$id": "https://github.com/morehao/trendradar/contract/schema/errors.v2.json",
2055
2087
  "title": "trendradar errors v2",
2056
- "description": "Canonical error-code catalog. Each property is one error code whose retriable/description are consts, so this file is the single source of truth for retriability. ipc.v2.json ErrorCode enum must match these keys exactly.",
2088
+ "description": "Canonical error-code catalog. Each property is one error code whose retriable/description are consts, so this file is the single source of truth for retriability. ipc.v3.json ErrorCode enum must match these keys exactly.",
2057
2089
  "type": "object",
2058
2090
  "additionalProperties": false,
2059
2091
  "required": [
@@ -2390,7 +2422,7 @@ const errors = {
2390
2422
  }
2391
2423
  }
2392
2424
  }
2393
- const api = "openapi: 3.1.0\ninfo:\n title: trendradar serve API\n version: 0.5.0\n description: |\n Read-only HTTP surface exposed by `trendradar serve`. All payloads reuse the\n contract schemas, so the plugin and any web UI consume the same shapes\n whether data comes from the filesystem or over HTTP. Historical v1 digests\n read from disk are normalized to the v2 shape with\n contentHashAlgo=legacy-struct-marshal-v1.\n\n Release endpoints are read-only. Token cost for a releases run is NOT part of\n a stored document (it describes one run and cannot be reproduced); it is\n reported in `releases.usage` of `trendradar run --json` and appended to\n `<repo>/.git/trendradar-usage.jsonl` with stage=\"releases\".\nservers:\n - url: http://127.0.0.1:8787\npaths:\n /api/v2/digests/{date}:\n get:\n operationId: getDigest\n summary: Fetch one day's digest\n parameters:\n - name: date\n in: path\n required: true\n schema:\n type: string\n format: date\n responses:\n \"200\":\n description: The digest document\n content:\n application/json:\n schema:\n $ref: \"./digest.v2.json\"\n \"404\":\n description: No digest for that date\n /api/v2/manifest:\n get:\n operationId: getManifest\n summary: List available dates and their content identity\n responses:\n \"200\":\n description: Manifest of available digests\n content:\n application/json:\n schema:\n type: object\n required: [entries]\n properties:\n coreVersion:\n type: string\n entries:\n type: array\n items:\n type: object\n required: [date, contentHash, schema, contentHashAlgo]\n properties:\n date:\n type: string\n format: date\n contentHash:\n type: string\n schema:\n type: integer\n contentHashAlgo:\n type: string\n enum: [jcs-sha256-v1, legacy-struct-marshal-v1]\n degraded:\n type: boolean\n /api/v2/releases:\n get:\n operationId: listReleases\n summary: List available release digests (newest first)\n description: |\n Returns an empty array (not 404) when no release digest exists yet.\n Entries carry no token cost because stored documents do not record it.\n parameters:\n - name: period\n in: query\n required: false\n schema:\n type: string\n enum: [daily, weekly, monthly]\n responses:\n \"200\":\n description: Manifest of release digests\n content:\n application/json:\n schema:\n type: array\n items:\n $ref: \"./releases.v2.json#/$defs/ReleaseManifestEntry\"\n /api/v2/releases/{date}:\n get:\n operationId: getReleases\n summary: Fetch one period's release digest\n parameters:\n - name: date\n in: path\n required: true\n schema:\n type: string\n format: date\n - name: period\n in: query\n required: false\n schema:\n type: string\n enum: [daily, weekly, monthly]\n responses:\n \"200\":\n description: The release digest document\n content:\n application/json:\n schema:\n $ref: \"./releases.v2.json\"\n \"404\":\n description: No release digest for that date\n /api/v2/subscriptions:\n get:\n operationId: listSubscriptions\n summary: List the repo subscriptions the core will poll\n description: |\n Read-only mirror of the IPC `subscribe list` command: both return the\n same SubscriptionList. `repos` is the legacy field; `items` adds the\n per-repo row detail (latest tag, last summary date, check status) and is\n optional, so an older core still satisfies this schema. Writing\n subscriptions stays on the CLI / IPC subscribe command and is never\n exposed over HTTP.\n responses:\n \"200\":\n description: Current subscription list\n content:\n application/json:\n schema:\n $ref: \"./releases.v2.json#/$defs/SubscriptionList\"\n /api/v2/repos/{owner}/{repo}/releases:\n get:\n operationId: getSubscriptionDoc\n summary: Read one repo's release document\n description: |\n Read-only mirror of the IPC `subscribe releases` command. Returns the\n exact markdown file content (plus the volume index) so a client renders\n what the data repo stores instead of re-summarizing it. `volume`\n defaults to the newest volume. Only repos matching\n ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ are served: the path is resolved\n inside the releases document root and never escapes it.\n parameters:\n - name: owner\n in: path\n required: true\n schema:\n type: string\n pattern: \"^[A-Za-z0-9_.-]+$\"\n - name: repo\n in: path\n required: true\n schema:\n type: string\n pattern: \"^[A-Za-z0-9_.-]+$\"\n - name: volume\n in: query\n required: false\n schema:\n type: integer\n minimum: 1\n responses:\n \"200\":\n description: The repo's release document\n content:\n application/json:\n schema:\n $ref: \"./releases.v2.json#/$defs/SubscriptionDoc\"\n \"400\":\n description: Malformed owner/repo or non-positive volume\n \"404\":\n description: The repo has no release document, or that volume is absent\n /feed.xml:\n get:\n operationId: getFeed\n summary: RSS feed of the most recent digests\n responses:\n \"200\":\n description: RSS 2.0 feed\n content:\n application/rss+xml:\n schema:\n type: string\n"
2425
+ const api = "openapi: 3.1.0\ninfo:\n title: trendradar serve API\n version: 0.6.0\n description: |\n Read-only HTTP surface exposed by `trendradar serve`. All payloads reuse the\n contract schemas, so the plugin and any web UI consume the same shapes\n whether data comes from the filesystem or over HTTP. Historical v1 digests\n read from disk are normalized to the v2 shape with\n contentHashAlgo=legacy-struct-marshal-v1.\n\n Release endpoints are read-only. Token cost for a releases run is NOT part of\n a stored document (it describes one run and cannot be reproduced); it is\n reported in `releases.usage` of `trendradar run --json` and appended to\n `<repo>/.git/trendradar-usage.jsonl` with stage=\"releases\".\nservers:\n - url: http://127.0.0.1:8787\npaths:\n /api/v2/digests/{date}:\n get:\n operationId: getDigest\n summary: Fetch one day's digest\n parameters:\n - name: date\n in: path\n required: true\n schema:\n type: string\n format: date\n responses:\n \"200\":\n description: The digest document\n content:\n application/json:\n schema:\n $ref: \"./digest.v2.json\"\n \"404\":\n description: No digest for that date\n /api/v2/manifest:\n get:\n operationId: getManifest\n summary: List available dates and their content identity\n responses:\n \"200\":\n description: Manifest of available digests\n content:\n application/json:\n schema:\n type: object\n required: [entries]\n properties:\n coreVersion:\n type: string\n entries:\n type: array\n items:\n type: object\n required: [date, contentHash, schema, contentHashAlgo]\n properties:\n date:\n type: string\n format: date\n contentHash:\n type: string\n schema:\n type: integer\n contentHashAlgo:\n type: string\n enum: [jcs-sha256-v1, legacy-struct-marshal-v1]\n degraded:\n type: boolean\n /api/v2/releases:\n get:\n operationId: listReleases\n summary: List available release digests (newest first)\n description: |\n Returns an empty array (not 404) when no release digest exists yet.\n Entries carry no token cost because stored documents do not record it.\n parameters:\n - name: period\n in: query\n required: false\n schema:\n type: string\n enum: [daily, weekly, monthly]\n responses:\n \"200\":\n description: Manifest of release digests\n content:\n application/json:\n schema:\n type: array\n items:\n $ref: \"./releases.v2.json#/$defs/ReleaseManifestEntry\"\n /api/v2/releases/{date}:\n get:\n operationId: getReleases\n summary: Fetch one period's release digest\n parameters:\n - name: date\n in: path\n required: true\n schema:\n type: string\n format: date\n - name: period\n in: query\n required: false\n schema:\n type: string\n enum: [daily, weekly, monthly]\n responses:\n \"200\":\n description: The release digest document\n content:\n application/json:\n schema:\n $ref: \"./releases.v2.json\"\n \"404\":\n description: No release digest for that date\n /api/v2/subscriptions:\n get:\n operationId: listSubscriptions\n summary: List the repo subscriptions the core will poll\n description: |\n Read-only mirror of the IPC `subscribe list` command: both return the\n same SubscriptionList. `repos` is the legacy field; `items` adds the\n per-repo row detail (latest tag, last summary date, check status) and is\n optional, so an older core still satisfies this schema. Writing\n subscriptions stays on the CLI / IPC subscribe command and is never\n exposed over HTTP.\n responses:\n \"200\":\n description: Current subscription list\n content:\n application/json:\n schema:\n $ref: \"./releases.v2.json#/$defs/SubscriptionList\"\n /api/v2/repos/{owner}/{repo}/releases:\n get:\n operationId: getSubscriptionDoc\n summary: Read one repo's release document\n description: |\n Read-only mirror of the IPC `subscribe releases` command. Returns the\n exact markdown file content (plus the volume index) so a client renders\n what the data repo stores instead of re-summarizing it. `volume`\n defaults to the newest volume. Only repos matching\n ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ are served: the path is resolved\n inside the releases document root and never escapes it.\n parameters:\n - name: owner\n in: path\n required: true\n schema:\n type: string\n pattern: \"^[A-Za-z0-9_.-]+$\"\n - name: repo\n in: path\n required: true\n schema:\n type: string\n pattern: \"^[A-Za-z0-9_.-]+$\"\n - name: volume\n in: query\n required: false\n schema:\n type: integer\n minimum: 1\n responses:\n \"200\":\n description: The repo's release document\n content:\n application/json:\n schema:\n $ref: \"./releases.v2.json#/$defs/SubscriptionDoc\"\n \"400\":\n description: Malformed owner/repo or non-positive volume\n \"404\":\n description: The repo has no release document, or that volume is absent\n /feed.xml:\n get:\n operationId: getFeed\n summary: RSS feed of the most recent digests\n responses:\n \"200\":\n description: RSS 2.0 feed\n content:\n application/rss+xml:\n schema:\n type: string\n"
2394
2426
 
2395
2427
  export const rawSchema = { model, ipc, digest, releases, errors, versionInfo, api }
2396
2428
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morehao/trendradar-contract",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "Language-neutral contract (JSON Schema, fixtures, generated Go & TypeScript types) shared by the trendradar Go core and its DSH plugin.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,7 +1,7 @@
1
1
  openapi: 3.1.0
2
2
  info:
3
3
  title: trendradar serve API
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  description: |
6
6
  Read-only HTTP surface exposed by `trendradar serve`. All payloads reuse the
7
7
  contract schemas, so the plugin and any web UI consume the same shapes
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://github.com/morehao/trendradar/contract/schema/errors.v2.json",
4
4
  "title": "trendradar errors v2",
5
- "description": "Canonical error-code catalog. Each property is one error code whose retriable/description are consts, so this file is the single source of truth for retriability. ipc.v2.json ErrorCode enum must match these keys exactly.",
5
+ "description": "Canonical error-code catalog. Each property is one error code whose retriable/description are consts, so this file is the single source of truth for retriability. ipc.v3.json ErrorCode enum must match these keys exactly.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "required": [
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
- "$id": "https://github.com/morehao/trendradar/contract/schema/ipc.v2.json",
4
- "title": "trendradar ipc v2",
5
- "description": "Envelope exchanged between the trendradar core binary and the DSH plugin. Only RunRequest forbids extra fields. ipcSchema is const 2.",
3
+ "$id": "https://github.com/morehao/trendradar/contract/schema/ipc.v3.json",
4
+ "title": "trendradar ipc v3",
5
+ "description": "Envelope exchanged between the trendradar core binary and the DSH plugin. Only RunRequest forbids extra fields. ipcSchema is const 3.",
6
6
  "oneOf": [
7
7
  {
8
8
  "$ref": "#/$defs/RunRequest"
@@ -79,6 +79,35 @@
79
79
  }
80
80
  }
81
81
  },
82
+ "DigestArtifact": {
83
+ "type": "object",
84
+ "additionalProperties": true,
85
+ "description": "The digest document rendered by this run, inlined so the caller never reads the output repository. bytes/sha256 describe the UTF-8 bytes of text exactly as written to path.",
86
+ "required": [
87
+ "path",
88
+ "bytes",
89
+ "sha256",
90
+ "text"
91
+ ],
92
+ "properties": {
93
+ "path": {
94
+ "type": "string"
95
+ },
96
+ "bytes": {
97
+ "type": "integer",
98
+ "minimum": 0,
99
+ "maximum": 1048576
100
+ },
101
+ "sha256": {
102
+ "type": "string",
103
+ "pattern": "^sha256:[0-9a-f]{64}$"
104
+ },
105
+ "text": {
106
+ "type": "string",
107
+ "maxLength": 1048576
108
+ }
109
+ }
110
+ },
82
111
  "RunRequest": {
83
112
  "type": "object",
84
113
  "additionalProperties": false,
@@ -88,7 +117,7 @@
88
117
  ],
89
118
  "properties": {
90
119
  "ipcSchema": {
91
- "const": 2
120
+ "const": 3
92
121
  },
93
122
  "command": {
94
123
  "type": "string",
@@ -374,7 +403,7 @@
374
403
  ],
375
404
  "properties": {
376
405
  "ipcSchema": {
377
- "const": 2
406
+ "const": 3
378
407
  },
379
408
  "ok": {
380
409
  "type": "boolean"
@@ -406,6 +435,9 @@
406
435
  "$ref": "#/$defs/FileArtifact"
407
436
  }
408
437
  },
438
+ "digest": {
439
+ "$ref": "#/$defs/DigestArtifact"
440
+ },
409
441
  "branch": {
410
442
  "type": "string"
411
443
  },
@@ -529,10 +561,10 @@
529
561
  ],
530
562
  "properties": {
531
563
  "ipcSchema": {
532
- "const": 2
564
+ "const": 3
533
565
  },
534
566
  "stateSchema": {
535
- "const": 2
567
+ "const": 3
536
568
  },
537
569
  "lastRun": {
538
570
  "$ref": "#/$defs/StateRun"
@@ -240,7 +240,7 @@
240
240
  "minimum": 0
241
241
  },
242
242
  "usage": {
243
- "$ref": "ipc.v2.json#/$defs/Usage"
243
+ "$ref": "ipc.v3.json#/$defs/Usage"
244
244
  }
245
245
  }
246
246
  },
@@ -2,14 +2,14 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://github.com/morehao/trendradar/contract/schema/version-info.v2.json",
4
4
  "title": "trendradar version info v2",
5
- "description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===2 && digestSchema===2 && contractVersion major===2.",
5
+ "description": "Handshake payload returned by `trendradar version --json`. The plugin requires ipcSchema===3 && digestSchema===2 && contractVersion major===0.",
6
6
  "type": "object",
7
7
  "additionalProperties": true,
8
8
  "required": ["version", "commit", "ipcSchema", "digestSchema", "contractVersion", "supportedProviders"],
9
9
  "properties": {
10
10
  "version": { "type": "string" },
11
11
  "commit": { "type": "string" },
12
- "ipcSchema": { "const": 2 },
12
+ "ipcSchema": { "const": 3 },
13
13
  "digestSchema": { "const": 2 },
14
14
  "contractVersion": { "type": "string" },
15
15
  "supportedProviders": { "type": "array", "items": { "type": "string" } }
package/version-map.json CHANGED
@@ -1,12 +1,4 @@
1
1
  {
2
- "ipc.v2.json": {
3
- "wireKey": "ipcSchema",
4
- "current": 2,
5
- "breakingBump": [
6
- "ipcSchema",
7
- "packageMajor"
8
- ]
9
- },
10
2
  "digest.v2.json": {
11
3
  "wireKey": "digestSchema",
12
4
  "current": 2,
@@ -34,14 +26,14 @@
34
26
  },
35
27
  "version-info.v2.json": {
36
28
  "wireKey": "contractVersion",
37
- "current": "0.5.0",
29
+ "current": "0.6.0",
38
30
  "breakingBump": [
39
31
  "packageMajor"
40
32
  ]
41
33
  },
42
34
  "api.v2.yaml": {
43
35
  "wireKey": "info.version",
44
- "current": "0.5.0",
36
+ "current": "0.6.0",
45
37
  "breakingBump": [
46
38
  "packageMajor"
47
39
  ]
@@ -53,5 +45,13 @@
53
45
  "breakingBump": [
54
46
  "packageMajor"
55
47
  ]
48
+ },
49
+ "ipc.v3.json": {
50
+ "wireKey": "ipcSchema",
51
+ "current": 3,
52
+ "breakingBump": [
53
+ "ipcSchema",
54
+ "packageMajor"
55
+ ]
56
56
  }
57
57
  }