@robbeverhelst/do 1.166.1 → 1.167.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.
Files changed (2) hide show
  1. package/dist/do.js +55 -6
  2. package/package.json +1 -1
package/dist/do.js CHANGED
@@ -3576,6 +3576,9 @@ var agents = pgTable("agents", {
3576
3576
  name: text("name").notNull(),
3577
3577
  revokedAt: timestamp("revoked_at", { withTimezone: true }),
3578
3578
  trustedDesks: text("trusted_desks").array().notNull().default([]),
3579
+ gatewayConnectedAt: timestamp("gateway_connected_at", { withTimezone: true }),
3580
+ gatewaySeenAt: timestamp("gateway_seen_at", { withTimezone: true }),
3581
+ gatewayDisconnectedAt: timestamp("gateway_disconnected_at", { withTimezone: true }),
3579
3582
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
3580
3583
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
3581
3584
  }, (t) => [
@@ -18189,6 +18192,9 @@ var reflectionKindSchema = _enum2(reflectionKind.enumValues);
18189
18192
  var agentSchema = createSelectSchema(agents, {
18190
18193
  trustedDesks: array(string2()).default([]),
18191
18194
  revokedAt: exports_coerce.date().nullable(),
18195
+ gatewayConnectedAt: exports_coerce.date().nullable().default(null),
18196
+ gatewaySeenAt: exports_coerce.date().nullable().default(null),
18197
+ gatewayDisconnectedAt: exports_coerce.date().nullable().default(null),
18192
18198
  createdAt: exports_coerce.date(),
18193
18199
  updatedAt: exports_coerce.date()
18194
18200
  });
@@ -18618,6 +18624,10 @@ var collectionCoverResultSchema = object({
18618
18624
  found: boolean3(),
18619
18625
  item: collectionItemViewSchema
18620
18626
  });
18627
+ var COVER_CANDIDATES_LIMIT = 6;
18628
+ var collectionCoverCandidatesSchema = object({
18629
+ candidates: array(object({ url: string2().url() })).max(COVER_CANDIDATES_LIMIT)
18630
+ });
18621
18631
  var collectionCoverBackfillResultSchema = object({
18622
18632
  checked: number2().int().min(0),
18623
18633
  found: number2().int().min(0),
@@ -19864,6 +19874,13 @@ var timeBlockRangeQuerySchema = object({
19864
19874
 
19865
19875
  // ../../packages/schema/src/contracts/agent-chat.ts
19866
19876
  var agentConnectionSourceSchema = _enum2(["space", "env"]);
19877
+ var agentGatewayStatusSchema = _enum2(["connected", "offline", "not_connected"]);
19878
+ var agentGatewayStateSchema = object({
19879
+ status: agentGatewayStatusSchema,
19880
+ connectedAt: exports_coerce.date().nullable(),
19881
+ seenAt: exports_coerce.date().nullable(),
19882
+ disconnectedAt: exports_coerce.date().nullable()
19883
+ });
19867
19884
  var agentConnectionSchema = object({
19868
19885
  connected: boolean3(),
19869
19886
  source: agentConnectionSourceSchema.nullable(),
@@ -19871,17 +19888,22 @@ var agentConnectionSchema = object({
19871
19888
  model: string2().nullable(),
19872
19889
  hasKey: boolean3(),
19873
19890
  agentId: string2().nullable(),
19891
+ agentName: string2().nullable().default(null),
19874
19892
  autoFile: boolean3(),
19875
- updatedAt: exports_coerce.date().nullable()
19893
+ updatedAt: exports_coerce.date().nullable(),
19894
+ gateway: agentGatewayStateSchema.nullable().default(null)
19876
19895
  });
19877
19896
  var agentEndpointSchema = string2().trim().max(2000).url().refine((value) => /^https?:\/\//i.test(value), "endpoint must be an http(s) URL");
19878
19897
  var saveAgentConnectionInputSchema = object({
19879
- endpoint: agentEndpointSchema,
19898
+ endpoint: agentEndpointSchema.nullable(),
19880
19899
  apiKey: string2().trim().min(1).max(4000).nullable().optional(),
19881
19900
  model: string2().trim().min(1).max(200).nullable().optional(),
19882
19901
  agentId: string2().trim().min(1).max(64).nullable().optional(),
19883
19902
  autoFile: boolean3().optional()
19884
- }).strict();
19903
+ }).strict().refine((input) => input.endpoint !== null || Boolean(input.agentId), {
19904
+ message: "a connection without an endpoint names its agent",
19905
+ path: ["agentId"]
19906
+ });
19885
19907
  var agentPageContextSchema = object({
19886
19908
  route: string2().trim().min(1).max(500).startsWith("/"),
19887
19909
  nodeId: string2().trim().min(1).max(64).nullable()
@@ -19900,7 +19922,13 @@ var agentChatEventSchema = discriminatedUnion("type", [
19900
19922
  }),
19901
19923
  object({ type: literal("delta"), text: string2() }),
19902
19924
  object({ type: literal("done") }),
19903
- object({ type: literal("error"), message: string2() })
19925
+ object({ type: literal("error"), message: string2() }),
19926
+ object({
19927
+ type: literal("posted"),
19928
+ threadId: string2(),
19929
+ postId: string2(),
19930
+ delivery: _enum2(["sent", "waiting"])
19931
+ })
19904
19932
  ]);
19905
19933
  var agentChangeValueSchema = union([
19906
19934
  string2(),
@@ -20825,9 +20853,15 @@ function blankMatches(input, regexes) {
20825
20853
 
20826
20854
  // ../../packages/schema/src/presets/collection-types.ts
20827
20855
  var coverUrl = string2().url().max(2048).nullish();
20856
+ var COVER_SOURCES_REJECTED_MAX = 50;
20857
+ var coverSourcesSchema = object({
20858
+ current: string2().url().max(2048).nullish(),
20859
+ rejected: array(string2().url().max(2048)).max(COVER_SOURCES_REJECTED_MAX).optional()
20860
+ }).strict();
20828
20861
  var bookFacetSchema = object({
20829
20862
  author: string2().min(1).max(200).nullish(),
20830
20863
  coverUrl,
20864
+ coverSources: coverSourcesSchema.nullish(),
20831
20865
  pageCount: number2().int().min(1).max(1e5).nullish(),
20832
20866
  currentPage: number2().int().min(0).max(1e5).nullish(),
20833
20867
  isbn: string2().regex(/^[0-9Xx][0-9Xx\s-]{8,20}$/, "must be an ISBN").nullish()
@@ -20843,6 +20877,7 @@ var filmFacetSchema = object({
20843
20877
  var gameFacetSchema = object({
20844
20878
  platform: string2().min(1).max(120).nullish(),
20845
20879
  coverUrl,
20880
+ coverSources: coverSourcesSchema.nullish(),
20846
20881
  completion: number2().int().min(0).max(100).nullish()
20847
20882
  }).strict();
20848
20883
  var musicFacetSchema = object({
@@ -21264,7 +21299,7 @@ function parseCapture2(input, now) {
21264
21299
 
21265
21300
  // src/meta.ts
21266
21301
  var CLI_NAME = "do";
21267
- var VERSION = "1.166.1";
21302
+ var VERSION = "1.167.0";
21268
21303
  var API_PREFIX = "/api/v1";
21269
21304
  var DEFAULT_API_URL = "http://localhost:3001";
21270
21305
 
@@ -22872,7 +22907,16 @@ var COMMAND_SPECS = [
22872
22907
  ],
22873
22908
  scopes: ["collections:write"],
22874
22909
  returns: "CollectionCoverResult",
22875
- notes: "Without --url: books from Open Library, games from IGDB then Steam; replaces the current cover when one is found. Returns { found, item }."
22910
+ notes: "Without --url: books from Open Library, games from IGDB then Steam; replaces the current cover with the next one (the one showing and ones passed over before are skipped). found: false when no other is left. Returns { found, item }."
22911
+ },
22912
+ {
22913
+ path: ["collection", "cover-candidates"],
22914
+ summary: "List other covers for an Item, best first (up to 6).",
22915
+ args: [{ name: "id", required: true, description: "Item ULID." }],
22916
+ flags: [],
22917
+ scopes: ["collections:read"],
22918
+ returns: "CollectionCoverCandidates",
22919
+ notes: "The providers' image URLs without the one showing and the ones passed over. Nothing is fetched; use one with `do collection cover <id> --url <url>`. Returns { candidates: [{ url }] }."
22876
22920
  },
22877
22921
  {
22878
22922
  path: ["collection", "covers"],
@@ -25102,6 +25146,11 @@ var HANDLERS = {
25102
25146
  render: renderRecord
25103
25147
  };
25104
25148
  },
25149
+ "collection cover-candidates": async ({ args, requireClient }) => {
25150
+ const id = requireArg(args, 0, "item id");
25151
+ const result = collectionCoverCandidatesSchema.parse(await requireClient().get(`/collection/${id}/cover/candidates`));
25152
+ return { data: result, render: renderRecord };
25153
+ },
25105
25154
  "collection covers": async ({ requireClient }) => {
25106
25155
  const result = collectionCoverBackfillResultSchema.parse(await requireClient().post("/collection/covers", undefined));
25107
25156
  return { data: result, render: renderRecord };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robbeverhelst/do",
3
- "version": "1.166.1",
3
+ "version": "1.167.0",
4
4
  "private": false,
5
5
  "description": "do — the agent-drivable CLI over the public /api/v1 surface",
6
6
  "homepage": "https://github.com/robbeverhelst/do/tree/main/apps/cli",