@neta-art/cohub 2.11.2 → 2.12.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.
@@ -568,6 +568,7 @@ declare class ReferencesApi {
568
568
  groupBy?: ReferenceAggregateGroupBy;
569
569
  kinds?: ReferenceKind[];
570
570
  days?: number;
571
+ limit?: number;
571
572
  }, customFetch?: Fetch): Promise<ReferenceAggregateResponse>;
572
573
  }
573
574
  //#endregion
@@ -817,6 +818,11 @@ declare class SpacesApi {
817
818
  private readonly transport;
818
819
  constructor(transport: HttpTransport);
819
820
  list(customFetch?: Fetch): Promise<SpaceRecord[]>;
821
+ /**
822
+ * Resolve the user's default space (owned/member home, else most recent).
823
+ * When the account has no accessible space, the API creates a blank Home
824
+ * space (`slug=home`) and returns it.
825
+ */
820
826
  getDefault(customFetch?: Fetch): Promise<SpaceDefaultResponse>;
821
827
  get(spaceId: string, customFetch?: Fetch): Promise<SpaceRecord>;
822
828
  getBySlug(username: string, slug: string, customFetch?: Fetch): Promise<SpaceRecord>;
@@ -311,6 +311,7 @@ var ReferencesApi = class {
311
311
  if (input.groupBy) params.set("groupBy", input.groupBy);
312
312
  if (input.kinds && input.kinds.length > 0) params.set("kinds", input.kinds.join(","));
313
313
  if (input.days !== void 0) params.set("days", String(input.days));
314
+ if (input.limit !== void 0) params.set("limit", String(input.limit));
314
315
  return this.transport.request(`/api/references/aggregate?${params.toString()}`, { fetch: customFetch });
315
316
  }
316
317
  };
@@ -1357,6 +1358,11 @@ var SpacesApi = class {
1357
1358
  fetch: customFetch
1358
1359
  });
1359
1360
  }
1361
+ /**
1362
+ * Resolve the user's default space (owned/member home, else most recent).
1363
+ * When the account has no accessible space, the API creates a blank Home
1364
+ * space (`slug=home`) and returns it.
1365
+ */
1360
1366
  getDefault(customFetch) {
1361
1367
  return this.transport.request("/api/spaces/default", {
1362
1368
  method: "GET",
@@ -2205,7 +2205,7 @@ type ExploreSpacesResponse = {
2205
2205
  sections: ExploreSection[];
2206
2206
  spaces: ExploreSpaceItem[];
2207
2207
  };
2208
- type Permission = "space.view" | "space.edit" | "space.label.view" | "space.label.manage" | "space.label.assign" | "session.view" | "session.edit" | "session.prompt.readonly" | "session.prompt.fullaccess" | "generation.create" | "file.view" | "file.view.filtered" | "file.edit" | "checkpoint.view" | "checkpoint.edit" | "member.view" | "member.manage" | "channel.view" | "channel.manage" | "cronjob.view" | "cronjob.manage" | "taskrun.view" | "sandbox.view" | "sandbox.manage" | "mod.view" | "mod.manage" | "user.space.list" | "user.session.list" | "user.usage.read";
2208
+ type Permission = "space.view" | "space.edit" | "space.label.view" | "space.label.manage" | "space.label.assign" | "session.view" | "session.edit" | "session.prompt.readonly" | "session.prompt.fullaccess" | "generation.create" | "file.view" | "file.view.filtered" | "file.edit" | "checkpoint.view" | "checkpoint.edit" | "member.view" | "member.manage" | "references.view" | "channel.view" | "channel.manage" | "cronjob.view" | "cronjob.manage" | "taskrun.view" | "sandbox.view" | "sandbox.manage" | "mod.view" | "mod.manage" | "user.space.list" | "user.session.list" | "user.usage.read";
2209
2209
  type SpaceAccess = {
2210
2210
  role: SpaceRole | null;
2211
2211
  permissions: Permission[];
@@ -2339,23 +2339,23 @@ type AcceptInvitationResponse = {
2339
2339
  spaceName: string;
2340
2340
  role: SpaceRole;
2341
2341
  };
2342
- type ReferenceResourceType = "space" | "session" | "checkpoint" | "user" | "file" | "tool";
2342
+ type ReferenceResourceType = "turn" | "session" | "space" | "checkpoint" | "file";
2343
2343
  /**
2344
- * Resource types usable as a query `source`. Only these have an owning space to
2345
- * authorize against; user/file/tool appear only as reference targets.
2344
+ * Resource types usable as a query `source`: they resolve to an owning space to
2345
+ * authorize against. `turn` gives the finest precision; session/space roll up.
2346
+ * `file` appears only as an edge target, never as a queryable source.
2346
2347
  */
2347
- type ReferenceQueryableType = "space" | "session" | "checkpoint";
2348
- type ReferenceKind = "session_fork" | "space_fork" | "checkpoint_fork" | "mention" | "tool_call" | "mod" | "participant";
2348
+ type ReferenceQueryableType = "turn" | "session" | "space" | "checkpoint";
2349
+ type ReferenceKind = "session_fork" | "space_fork" | "checkpoint_fork" | "mod" | "mention" | "tool_call" | "agent_tool_file_read" | "agent_tool_file_write" | "agent_tool_file_edit" | "agent_tool_file_ls" | "agent_tool_file_find" | "agent_tool_file_grep";
2349
2350
  type ReferenceDirection = "out" | "in" | "both";
2350
2351
  type ReferenceRecord = {
2351
2352
  kind: ReferenceKind;
2352
2353
  sourceType: ReferenceResourceType;
2353
2354
  sourceId: string;
2354
- sourceTurnId: string | null;
2355
2355
  targetType: ReferenceResourceType;
2356
2356
  targetId: string;
2357
- spaceId: string;
2358
- sessionId: string | null;
2357
+ sourceSpaceId: string;
2358
+ sourceSessionId: string | null;
2359
2359
  count: number;
2360
2360
  createdAt: string;
2361
2361
  updatedAt: string;
@@ -2366,7 +2366,7 @@ type ReferenceQueryResponse = {
2366
2366
  direction: ReferenceDirection;
2367
2367
  references: ReferenceRecord[];
2368
2368
  };
2369
- type ReferenceAggregateGroupBy = "kind" | "targetType" | "sourceType" | "day";
2369
+ type ReferenceAggregateGroupBy = "kind" | "targetType" | "target" | "sourceType" | "day";
2370
2370
  type ReferenceAggregateGroup = {
2371
2371
  group: string;
2372
2372
  references: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neta-art/cohub",
3
- "version": "2.11.2",
3
+ "version": "2.12.0",
4
4
  "description": "Cohub SDK for spaces, sessions, checkpoints, and realtime agent collaboration.",
5
5
  "license": "Apache-2.0",
6
6
  "private": false,