@ycodium-ai/plugin-pull-requests 0.2.2488 → 0.2.2526

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/dist/index.js CHANGED
@@ -3387,6 +3387,7 @@ var claimTable = (apis) => {
3387
3387
  }
3388
3388
  return claims;
3389
3389
  };
3390
+ var isArchivedWorkspaceProject = (project) => project.archivedAt != null;
3390
3391
  var listWorkspaceProjects = async (input) => {
3391
3392
  const projects = await input.listProjects();
3392
3393
  const claims = claimTable(input.apis);
@@ -3399,6 +3400,7 @@ var listWorkspaceProjects = async (input) => {
3399
3400
  if (input.filter.projectId !== void 0 && project.projectId !== input.filter.projectId) {
3400
3401
  continue;
3401
3402
  }
3403
+ if (input.filter.projectId === void 0 && isArchivedWorkspaceProject(project)) continue;
3402
3404
  if (input.filter.projectIds !== void 0 && !input.filter.projectIds.includes(project.projectId)) {
3403
3405
  continue;
3404
3406
  }
@@ -4419,6 +4421,38 @@ ${cursorOf(project)?.updatedBefore ?? ""}`;
4419
4421
  // src/index.ts
4420
4422
  var as = (payload) => payload;
4421
4423
  var DIFF_CHUNK_CHARS = 256 * 1024;
4424
+ var WORKSPACE_PROJECT_SCHEMA = {
4425
+ type: "object",
4426
+ additionalProperties: false,
4427
+ required: ["projectId", "title", "workspaceRoot"],
4428
+ properties: {
4429
+ projectId: { type: "string", minLength: 1 },
4430
+ title: { type: "string" },
4431
+ workspaceRoot: { type: "string" },
4432
+ archivedAt: { type: "string" },
4433
+ repositoryIdentity: {
4434
+ type: ["object", "null"],
4435
+ additionalProperties: false,
4436
+ properties: {
4437
+ provider: { type: "string" },
4438
+ canonicalKey: { type: "string" },
4439
+ remoteName: { type: "string" },
4440
+ remoteUrl: { type: "string" },
4441
+ displayName: { type: "string" },
4442
+ owner: { type: "string" },
4443
+ name: { type: "string" },
4444
+ rootPath: { type: "string" }
4445
+ }
4446
+ }
4447
+ }
4448
+ };
4449
+ var workspaceProjectOf = (project) => ({
4450
+ projectId: project.projectId,
4451
+ title: project.title,
4452
+ workspaceRoot: project.workspaceRoot,
4453
+ repositoryIdentity: project.repositoryIdentity,
4454
+ ...project.archivedAt == null ? {} : { archivedAt: project.archivedAt }
4455
+ });
4422
4456
  var DIFF_STREAM_ITEM_SCHEMA = {
4423
4457
  oneOf: [
4424
4458
  {
@@ -4597,55 +4631,45 @@ var index_default = definePlugin({
4597
4631
  );
4598
4632
  ctx.command({
4599
4633
  name: "workspaceProjects",
4600
- description: "Git repositories in this machine's workspace, with their remote identity.",
4634
+ description: "Unarchived git repositories in this machine's workspace, with their remote identity.",
4601
4635
  scope: "read",
4602
4636
  payloadSchema: { type: "object", properties: {}, additionalProperties: false },
4603
4637
  resultSchema: {
4604
4638
  type: "object",
4605
4639
  additionalProperties: false,
4606
4640
  required: ["projects"],
4607
- properties: {
4608
- projects: {
4609
- type: "array",
4610
- items: {
4611
- type: "object",
4612
- additionalProperties: false,
4613
- required: ["projectId", "title", "workspaceRoot"],
4614
- properties: {
4615
- projectId: { type: "string", minLength: 1 },
4616
- title: { type: "string" },
4617
- workspaceRoot: { type: "string" },
4618
- repositoryIdentity: {
4619
- type: ["object", "null"],
4620
- additionalProperties: false,
4621
- properties: {
4622
- provider: { type: "string" },
4623
- canonicalKey: { type: "string" },
4624
- remoteName: { type: "string" },
4625
- remoteUrl: { type: "string" },
4626
- displayName: { type: "string" },
4627
- owner: { type: "string" },
4628
- name: { type: "string" },
4629
- rootPath: { type: "string" }
4630
- }
4631
- }
4632
- }
4633
- }
4634
- }
4635
- }
4641
+ properties: { projects: { type: "array", items: WORKSPACE_PROJECT_SCHEMA } }
4636
4642
  },
4637
4643
  handle: async () => {
4638
4644
  const projects = await ctx.projections.listProjects();
4639
4645
  return {
4640
- projects: projects.map((project) => ({
4641
- projectId: project.projectId,
4642
- title: project.title,
4643
- workspaceRoot: project.workspaceRoot,
4644
- repositoryIdentity: project.repositoryIdentity
4645
- }))
4646
+ projects: projects.filter((project) => !isArchivedWorkspaceProject(project)).map(workspaceProjectOf)
4646
4647
  };
4647
4648
  }
4648
4649
  });
4650
+ ctx.command({
4651
+ name: "workspaceProject",
4652
+ description: "One project of this machine's workspace by id, archived or not, with its archive time.",
4653
+ scope: "read",
4654
+ payloadSchema: {
4655
+ type: "object",
4656
+ additionalProperties: false,
4657
+ required: ["projectId"],
4658
+ properties: { projectId: { type: "string", minLength: 1 } }
4659
+ },
4660
+ resultSchema: {
4661
+ type: "object",
4662
+ additionalProperties: false,
4663
+ required: ["project"],
4664
+ properties: { project: { oneOf: [WORKSPACE_PROJECT_SCHEMA, { type: "null" }] } }
4665
+ },
4666
+ handle: async (payload) => {
4667
+ const project = await ctx.projections.getProject(
4668
+ as(payload).projectId
4669
+ );
4670
+ return { project: project === null ? null : workspaceProjectOf(project) };
4671
+ }
4672
+ });
4649
4673
  ctx.settingsCard({
4650
4674
  title: "Pull requests",
4651
4675
  description: "Pull and merge requests are read and written straight over the host API, with a token you paste here.",
package/locales/en.json CHANGED
@@ -159,6 +159,7 @@
159
159
  },
160
160
  "handoff": {
161
161
  "unsupported": "This client cannot start a thread or save a review draft from this page.",
162
+ "projectArchived": "The project is archived. Restore it to use this.",
162
163
  "fixInThisThread": "Fix in this thread",
163
164
  "fixFindingsInThisThread": "Fix findings in this thread",
164
165
  "fix": "Fix",
@@ -159,6 +159,7 @@
159
159
  },
160
160
  "handoff": {
161
161
  "unsupported": "此客户端无法从此页面启动会话或保存审查草稿。",
162
+ "projectArchived": "项目已归档,恢复后才能用。",
162
163
  "fixInThisThread": "在当前会话中修复",
163
164
  "fixFindingsInThisThread": "在当前会话中修复这些问题",
164
165
  "fix": "修复",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/plugin-pull-requests",
3
- "version": "0.2.2488",
3
+ "version": "0.2.2526",
4
4
  "description": "The pull request page, for GitHub and GitLab.",
5
5
  "keywords": [
6
6
  "pull-requests",
@@ -30,7 +30,7 @@
30
30
  "tailwindcss": "^4.0.0",
31
31
  "typescript": "~6.0.3",
32
32
  "vite-plus": "0.2.2",
33
- "@ycodium-ai/plugin-api": "0.2.2488"
33
+ "@ycodium-ai/plugin-api": "0.2.2526"
34
34
  },
35
35
  "ycodium": {
36
36
  "plugin": "./dist/index.js",