@buildinternet/releases-api-types 0.8.0 → 0.8.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buildinternet/releases-api-types",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Wire protocol — request/response types for the Releases registry API. Shared by web, workers, and clients.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -17,7 +17,7 @@
17
17
  "README.md"
18
18
  ],
19
19
  "dependencies": {
20
- "@buildinternet/releases-core": "workspace:*",
20
+ "@buildinternet/releases-core": "^0.18.0",
21
21
  "zod": "^4.3.6"
22
22
  },
23
23
  "publishConfig": {
package/src/api-types.ts CHANGED
@@ -620,6 +620,13 @@ export interface OrgReleasesResponse {
620
620
  pagination: { nextCursor: string | null; limit: number };
621
621
  }
622
622
 
623
+ // Source-scoped release feed — the source identity is encoded in the URL, so
624
+ // items omit the redundant `source` block carried by the org feed.
625
+ export interface SourceReleasesResponse {
626
+ releases: ReleaseItem[];
627
+ pagination: { nextCursor: string | null; limit: number };
628
+ }
629
+
623
630
  // ── Products ──
624
631
 
625
632
  // `Category` lives in @buildinternet/releases-core/categories — import it from
@@ -780,8 +787,28 @@ export interface Session {
780
787
  sessionId: string;
781
788
  company: string;
782
789
  type: "onboard" | "update";
790
+ /**
791
+ * Sub-agent **role** label that ran this session — `"coordinator"` is the
792
+ * parent orchestrator (typically Sonnet) when a multi-agent session
793
+ * delegates, `"sonnet"` / `"haiku"` are direct single-agent runs.
794
+ * Surfaces on the detail GET.
795
+ *
796
+ * This is a logical role label, not the runtime model identifier. The
797
+ * resolved Anthropic model string (e.g. `claude-sonnet-4-6`,
798
+ * `claude-haiku-4-5`) lives on `usage.model` when the session reported
799
+ * one — consult that field for the concrete model.
800
+ */
801
+ agent?: "sonnet" | "haiku" | "coordinator";
802
+ /** Identifies the client that started this session (e.g. hostname). */
803
+ runner?: string;
804
+ /** Correlation ID for end-to-end tracing across CLI → API → managed agent. */
805
+ correlationId?: string;
806
+ /** Anthropic session ID for linking to console logs. */
807
+ anthropicSessionId?: string;
783
808
  status: "running" | "complete" | "error" | "cancelled";
784
809
  step?: string;
810
+ sourcesFound?: number;
811
+ sourcesValidated?: number;
785
812
  totalSources?: number;
786
813
  sourcesFetched?: number;
787
814
  releasesFound?: number;
@@ -798,6 +825,40 @@ export interface Session {
798
825
  stopReason?: string;
799
826
  /** Number of provider `session.error` events observed before terminal. */
800
827
  retryCount?: number;
828
+ /** Non-fatal warnings collected during the session. */
829
+ warnings?: string[];
830
+ /**
831
+ * Token usage + estimated cost from the managed-agents session. `estimatedUsd`
832
+ * is a snapshot of Anthropic list prices at session-completion time.
833
+ */
834
+ usage?: {
835
+ inputTokens?: number;
836
+ outputTokens?: number;
837
+ cacheWriteTokens?: number;
838
+ cacheReadTokens?: number;
839
+ model?: string;
840
+ estimatedUsd?: number;
841
+ };
842
+ /**
843
+ * Final agent-reported state for terminal `onboard` sessions — the JSON
844
+ * blob the agent passed to its `releases_report_state` tool, plus an
845
+ * `agentSessionId` field stitched in server-side. Empty on `update`
846
+ * sessions and pre-report errors. Typed as `Record<string, unknown>`
847
+ * because the shape is owned by the discovery system prompt and may
848
+ * grow new fields without a wire bump; the keys produced today are:
849
+ *
850
+ * - `product` (`string`) — company name
851
+ * - `domain` (`string | null`) — discovered domain
852
+ * - `githubOrg` (`string | null`) — discovered GitHub org
853
+ * - `startedAt`, `updatedAt` (ISO strings)
854
+ * - `status` (e.g. `"awaiting_review"`)
855
+ * - `sources` (`Array<{ url, type, slug, label, confidence,
856
+ * validated, validationError?, releaseCount, releasesFetched,
857
+ * fetched, contentDepth }>`)
858
+ * - `agentSessionId` (`string`) — Anthropic session ID, useful for
859
+ * cross-referencing console logs
860
+ */
861
+ result?: Record<string, unknown>;
801
862
  activeSources?: string[];
802
863
  cancelRequested?: boolean;
803
864
  }
@@ -88,18 +88,31 @@ export const UpdateProductBodySchema = z.object({
88
88
  aliases: z.array(z.string()).optional(),
89
89
  });
90
90
 
91
- /** Body accepted by `POST /v1/products/adopt`. */
91
+ /**
92
+ * Body accepted by `POST /v1/products/adopt`.
93
+ *
94
+ * `mergeInto` (slug or `prod_…` ID) folds the source org into an existing
95
+ * product under `targetOrgSlug` instead of creating a new one. When set,
96
+ * `slug` and `url` must be omitted (the existing product's values stand).
97
+ */
92
98
  export const AdoptProductBodySchema = z.object({
93
99
  sourceOrgSlug: z.string().min(1),
94
100
  targetOrgSlug: z.string().min(1),
95
101
  slug: z.string().optional(),
96
102
  url: z.string().optional(),
103
+ mergeInto: z.string().optional(),
97
104
  dryRun: z.boolean().optional(),
98
105
  });
99
106
 
100
- /** Live (non-dryRun) result from `POST /v1/products/adopt`. */
107
+ /**
108
+ * Live (non-dryRun) result from `POST /v1/products/adopt`.
109
+ *
110
+ * `mergedInto` is set when the request used `mergeInto` — its value is the
111
+ * existing product's slug, signalling that no new product was created.
112
+ */
101
113
  export const ProductAdoptResultSchema = z.object({
102
114
  product: ProductRowSchema,
115
+ mergedInto: z.string().optional(),
103
116
  sourcesMoved: z.number().int().min(0),
104
117
  accountsMoved: z.number().int().min(0),
105
118
  sourceOrgDeleted: z.string(),
@@ -108,6 +121,7 @@ export const ProductAdoptResultSchema = z.object({
108
121
  /** Dry-run preview from `POST /v1/products/adopt` with `dryRun: true`. */
109
122
  export const ProductAdoptDryRunSchema = z.object({
110
123
  dryRun: z.literal(true),
124
+ mergeInto: z.string().optional(),
111
125
  product: z.object({
112
126
  name: z.string(),
113
127
  slug: z.string(),