@kevisual/cnb 0.0.58 → 0.0.60

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.
@@ -32,7 +32,7 @@ app.route({
32
32
  let content = `
33
33
  cnb工作空间的访问uri为:${finalUri}
34
34
  `
35
- ctx.body = { content };
35
+ ctx.body = { content, data: { assistant: finalUri } };
36
36
  }).addTo(app);
37
37
 
38
38
  // 获取当前cnb工作空间的vscode代理uri,执行技能 get-cnb-vscode-uri
@@ -70,23 +70,30 @@ app.route({
70
70
 
71
71
  const webUri = CNB_ENV?.CNB_VSCODE_WEB_URL as string || '';
72
72
  const vscodeSchma = CNB_ENV?.CNB_VSCODE_REMOTE_SSH_SCHEMA as string || '';
73
+ let obj: any = {
74
+
75
+ }
73
76
  let content = `
74
77
  当前的cnb 仓库为:${CNB_ENV?.CNB_REPO_SLUG}
75
78
 
76
79
  `
77
80
  if (web) {
78
81
  content += `VS Code Web 访问 URI:${webUri}\n\n`;
82
+ obj.webUri = webUri;
79
83
  }
80
84
  if (vscode) {
81
85
  content += `VS Code 访问 URI:${vscodeSchma}\n\n`;
86
+ obj.vscodeUri = vscodeSchma;
82
87
  }
83
88
  if (codebuddy) {
84
89
  const codebuddyUri = vscodeSchma.replace('vscode://vscode-remote/ssh-remote+', 'codebuddycn://vscode-remote/codebuddy-remote');
85
90
  content += `CodeBuddy 访问 URI:${codebuddyUri}\n\n`;
91
+ obj.codebuddyUri = codebuddyUri;
86
92
  }
87
93
  if (cursor) {
88
94
  const cursorUri = vscodeSchma.replace('vscode://', 'cursor://');
89
95
  content += `Cursor 访问 URI:${cursorUri}\n\n`;
96
+ obj.cursorUri = cursorUri;
90
97
  }
91
98
  // if (trae) {
92
99
  // const traeUri = vscodeSchma.replace('vscode://vscode-remote/ssh-remote+', 'traecn://ssh-remote+');
@@ -94,6 +101,7 @@ app.route({
94
101
  // }
95
102
  if (ssh) {
96
103
  content += `VS Code Remote SSH 连接字符串:ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
104
+ obj.sshUri = `ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
97
105
  }
98
- ctx.body = { content };
106
+ ctx.body = { content, data: obj };
99
107
  }).addTo(app);
package/dist/cli.js CHANGED
@@ -4432,7 +4432,7 @@ var require_commander = __commonJS((exports) => {
4432
4432
  exports.InvalidOptionArgumentError = InvalidArgumentError3;
4433
4433
  });
4434
4434
 
4435
- // ../../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router.js
4435
+ // ../../node_modules/.pnpm/@kevisual+router@0.1.7/node_modules/@kevisual/router/dist/router.js
4436
4436
  import { createRequire as createRequire2 } from "node:module";
4437
4437
  import { webcrypto as crypto } from "node:crypto";
4438
4438
  import url2 from "node:url";
@@ -24946,6 +24946,24 @@ function useCommentEnv() {
24946
24946
  };
24947
24947
  }
24948
24948
 
24949
+ // src/issue/dashboard.ts
24950
+ class Dashboard extends CNBCore {
24951
+ constructor(options) {
24952
+ super(options);
24953
+ }
24954
+ getMineCreateIssue(params) {
24955
+ const url3 = `${this.hackURL}/user/dashboard/mine_create/issue`;
24956
+ return this.get({
24957
+ url: url3,
24958
+ params,
24959
+ useCookie: true,
24960
+ headers: {
24961
+ Accept: "application/vnd.cnb.web+json"
24962
+ }
24963
+ });
24964
+ }
24965
+ }
24966
+
24949
24967
  // src/issue/index.ts
24950
24968
  class Issue extends CNBCore {
24951
24969
  constructor(options) {
@@ -25415,6 +25433,7 @@ class CNB extends CNBCore {
25415
25433
  labels;
25416
25434
  packages;
25417
25435
  org;
25436
+ dashboard;
25418
25437
  constructor(options) {
25419
25438
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
25420
25439
  this.init(options);
@@ -25442,6 +25461,7 @@ class CNB extends CNBCore {
25442
25461
  package: new PackageManagement(options)
25443
25462
  };
25444
25463
  this.org = new Organization(options);
25464
+ this.dashboard = new Dashboard(options);
25445
25465
  }
25446
25466
  setToken(token) {
25447
25467
  this.token = token;
@@ -25456,6 +25476,7 @@ class CNB extends CNBCore {
25456
25476
  this.packages.registry.token = token;
25457
25477
  this.packages.package.token = token;
25458
25478
  this.org.token = token;
25479
+ this.dashboard.token = token;
25459
25480
  }
25460
25481
  setCookie(cookie) {
25461
25482
  this.cookie = cookie;
@@ -25470,6 +25491,7 @@ class CNB extends CNBCore {
25470
25491
  this.packages.registry.cookie = cookie;
25471
25492
  this.packages.package.cookie = cookie;
25472
25493
  this.org.cookie = cookie;
25494
+ this.dashboard.cookie = cookie;
25473
25495
  }
25474
25496
  getCNBVersion = getCNBVersion;
25475
25497
  }
@@ -47909,7 +47931,7 @@ app.route({
47909
47931
  let content = `
47910
47932
  cnb工作空间的访问uri为:${finalUri}
47911
47933
  `;
47912
- ctx.body = { content };
47934
+ ctx.body = { content, data: { assistant: finalUri } };
47913
47935
  }).addTo(app);
47914
47936
  app.route({
47915
47937
  path: "cnb",
@@ -47941,6 +47963,7 @@ app.route({
47941
47963
  const ssh = ctx.query?.ssh ?? false;
47942
47964
  const webUri = CNB_ENV?.CNB_VSCODE_WEB_URL || "";
47943
47965
  const vscodeSchma = CNB_ENV?.CNB_VSCODE_REMOTE_SSH_SCHEMA || "";
47966
+ let obj = {};
47944
47967
  let content = `
47945
47968
  当前的cnb 仓库为:${CNB_ENV?.CNB_REPO_SLUG}
47946
47969
 
@@ -47949,28 +47972,33 @@ app.route({
47949
47972
  content += `VS Code Web 访问 URI:${webUri}
47950
47973
 
47951
47974
  `;
47975
+ obj.webUri = webUri;
47952
47976
  }
47953
47977
  if (vscode) {
47954
47978
  content += `VS Code 访问 URI:${vscodeSchma}
47955
47979
 
47956
47980
  `;
47981
+ obj.vscodeUri = vscodeSchma;
47957
47982
  }
47958
47983
  if (codebuddy) {
47959
47984
  const codebuddyUri = vscodeSchma.replace("vscode://vscode-remote/ssh-remote+", "codebuddycn://vscode-remote/codebuddy-remote");
47960
47985
  content += `CodeBuddy 访问 URI:${codebuddyUri}
47961
47986
 
47962
47987
  `;
47988
+ obj.codebuddyUri = codebuddyUri;
47963
47989
  }
47964
47990
  if (cursor) {
47965
47991
  const cursorUri = vscodeSchma.replace("vscode://", "cursor://");
47966
47992
  content += `Cursor 访问 URI:${cursorUri}
47967
47993
 
47968
47994
  `;
47995
+ obj.cursorUri = cursorUri;
47969
47996
  }
47970
47997
  if (ssh) {
47971
47998
  content += `VS Code Remote SSH 连接字符串:ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
47999
+ obj.sshUri = `ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
47972
48000
  }
47973
- ctx.body = { content };
48001
+ ctx.body = { content, data: obj };
47974
48002
  }).addTo(app);
47975
48003
 
47976
48004
  // agent/routes/cnb-env/env.ts
@@ -56737,7 +56765,7 @@ class RemoteApp {
56737
56765
  }
56738
56766
  }
56739
56767
 
56740
- // ../../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/src/commander.ts
56768
+ // ../../node_modules/.pnpm/@kevisual+router@0.1.7/node_modules/@kevisual/router/src/commander.ts
56741
56769
  var groupByPath = (routes) => {
56742
56770
  return routes.reduce((acc, route) => {
56743
56771
  const path3 = route.path || "default";
@@ -56862,6 +56890,7 @@ var parse8 = async (opts) => {
56862
56890
  if (opts.remote) {
56863
56891
  const { token: token2, username, id } = opts.remote;
56864
56892
  const remoteApp = new RemoteApp({
56893
+ app: app3,
56865
56894
  token: token2,
56866
56895
  username,
56867
56896
  id
package/dist/npc.js CHANGED
@@ -4432,7 +4432,7 @@ var require_commander = __commonJS((exports) => {
4432
4432
  exports.InvalidOptionArgumentError = InvalidArgumentError3;
4433
4433
  });
4434
4434
 
4435
- // ../../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router.js
4435
+ // ../../node_modules/.pnpm/@kevisual+router@0.1.7/node_modules/@kevisual/router/dist/router.js
4436
4436
  import { createRequire as createRequire2 } from "node:module";
4437
4437
  import { webcrypto as crypto } from "node:crypto";
4438
4438
  import url2 from "node:url";
@@ -24980,6 +24980,24 @@ var useIssueEnv = () => {
24980
24980
  };
24981
24981
  };
24982
24982
 
24983
+ // src/issue/dashboard.ts
24984
+ class Dashboard extends CNBCore {
24985
+ constructor(options) {
24986
+ super(options);
24987
+ }
24988
+ getMineCreateIssue(params) {
24989
+ const url3 = `${this.hackURL}/user/dashboard/mine_create/issue`;
24990
+ return this.get({
24991
+ url: url3,
24992
+ params,
24993
+ useCookie: true,
24994
+ headers: {
24995
+ Accept: "application/vnd.cnb.web+json"
24996
+ }
24997
+ });
24998
+ }
24999
+ }
25000
+
24983
25001
  // src/issue/index.ts
24984
25002
  class Issue extends CNBCore {
24985
25003
  constructor(options) {
@@ -25449,6 +25467,7 @@ class CNB extends CNBCore {
25449
25467
  labels;
25450
25468
  packages;
25451
25469
  org;
25470
+ dashboard;
25452
25471
  constructor(options) {
25453
25472
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
25454
25473
  this.init(options);
@@ -25476,6 +25495,7 @@ class CNB extends CNBCore {
25476
25495
  package: new PackageManagement(options)
25477
25496
  };
25478
25497
  this.org = new Organization(options);
25498
+ this.dashboard = new Dashboard(options);
25479
25499
  }
25480
25500
  setToken(token) {
25481
25501
  this.token = token;
@@ -25490,6 +25510,7 @@ class CNB extends CNBCore {
25490
25510
  this.packages.registry.token = token;
25491
25511
  this.packages.package.token = token;
25492
25512
  this.org.token = token;
25513
+ this.dashboard.token = token;
25493
25514
  }
25494
25515
  setCookie(cookie) {
25495
25516
  this.cookie = cookie;
@@ -25504,6 +25525,7 @@ class CNB extends CNBCore {
25504
25525
  this.packages.registry.cookie = cookie;
25505
25526
  this.packages.package.cookie = cookie;
25506
25527
  this.org.cookie = cookie;
25528
+ this.dashboard.cookie = cookie;
25507
25529
  }
25508
25530
  getCNBVersion = getCNBVersion;
25509
25531
  }
@@ -47943,7 +47965,7 @@ app.route({
47943
47965
  let content = `
47944
47966
  cnb工作空间的访问uri为:${finalUri}
47945
47967
  `;
47946
- ctx.body = { content };
47968
+ ctx.body = { content, data: { assistant: finalUri } };
47947
47969
  }).addTo(app);
47948
47970
  app.route({
47949
47971
  path: "cnb",
@@ -47975,6 +47997,7 @@ app.route({
47975
47997
  const ssh = ctx.query?.ssh ?? false;
47976
47998
  const webUri = CNB_ENV?.CNB_VSCODE_WEB_URL || "";
47977
47999
  const vscodeSchma = CNB_ENV?.CNB_VSCODE_REMOTE_SSH_SCHEMA || "";
48000
+ let obj = {};
47978
48001
  let content = `
47979
48002
  当前的cnb 仓库为:${CNB_ENV?.CNB_REPO_SLUG}
47980
48003
 
@@ -47983,28 +48006,33 @@ app.route({
47983
48006
  content += `VS Code Web 访问 URI:${webUri}
47984
48007
 
47985
48008
  `;
48009
+ obj.webUri = webUri;
47986
48010
  }
47987
48011
  if (vscode) {
47988
48012
  content += `VS Code 访问 URI:${vscodeSchma}
47989
48013
 
47990
48014
  `;
48015
+ obj.vscodeUri = vscodeSchma;
47991
48016
  }
47992
48017
  if (codebuddy) {
47993
48018
  const codebuddyUri = vscodeSchma.replace("vscode://vscode-remote/ssh-remote+", "codebuddycn://vscode-remote/codebuddy-remote");
47994
48019
  content += `CodeBuddy 访问 URI:${codebuddyUri}
47995
48020
 
47996
48021
  `;
48022
+ obj.codebuddyUri = codebuddyUri;
47997
48023
  }
47998
48024
  if (cursor) {
47999
48025
  const cursorUri = vscodeSchma.replace("vscode://", "cursor://");
48000
48026
  content += `Cursor 访问 URI:${cursorUri}
48001
48027
 
48002
48028
  `;
48029
+ obj.cursorUri = cursorUri;
48003
48030
  }
48004
48031
  if (ssh) {
48005
48032
  content += `VS Code Remote SSH 连接字符串:ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
48033
+ obj.sshUri = `ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
48006
48034
  }
48007
- ctx.body = { content };
48035
+ ctx.body = { content, data: obj };
48008
48036
  }).addTo(app);
48009
48037
 
48010
48038
  // agent/routes/cnb-env/env.ts
@@ -56771,7 +56799,7 @@ class RemoteApp {
56771
56799
  }
56772
56800
  }
56773
56801
 
56774
- // ../../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/src/commander.ts
56802
+ // ../../node_modules/.pnpm/@kevisual+router@0.1.7/node_modules/@kevisual/router/src/commander.ts
56775
56803
  var groupByPath = (routes) => {
56776
56804
  return routes.reduce((acc, route) => {
56777
56805
  const path3 = route.path || "default";
@@ -56896,6 +56924,7 @@ var parse8 = async (opts) => {
56896
56924
  if (opts.remote) {
56897
56925
  const { token: token2, username, id } = opts.remote;
56898
56926
  const remoteApp = new RemoteApp({
56927
+ app: app3,
56899
56928
  token: token2,
56900
56929
  username,
56901
56930
  id
package/dist/opencode.js CHANGED
@@ -2339,7 +2339,7 @@ var require_src = __commonJS((exports) => {
2339
2339
  };
2340
2340
  });
2341
2341
 
2342
- // ../../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router.js
2342
+ // ../../node_modules/.pnpm/@kevisual+router@0.1.7/node_modules/@kevisual/router/dist/router.js
2343
2343
  import { createRequire as createRequire2 } from "node:module";
2344
2344
  import { webcrypto as crypto } from "node:crypto";
2345
2345
  import url2 from "node:url";
@@ -22853,6 +22853,24 @@ function useCommentEnv() {
22853
22853
  };
22854
22854
  }
22855
22855
 
22856
+ // src/issue/dashboard.ts
22857
+ class Dashboard extends CNBCore {
22858
+ constructor(options) {
22859
+ super(options);
22860
+ }
22861
+ getMineCreateIssue(params) {
22862
+ const url3 = `${this.hackURL}/user/dashboard/mine_create/issue`;
22863
+ return this.get({
22864
+ url: url3,
22865
+ params,
22866
+ useCookie: true,
22867
+ headers: {
22868
+ Accept: "application/vnd.cnb.web+json"
22869
+ }
22870
+ });
22871
+ }
22872
+ }
22873
+
22856
22874
  // src/issue/index.ts
22857
22875
  class Issue extends CNBCore {
22858
22876
  constructor(options) {
@@ -23322,6 +23340,7 @@ class CNB extends CNBCore {
23322
23340
  labels;
23323
23341
  packages;
23324
23342
  org;
23343
+ dashboard;
23325
23344
  constructor(options) {
23326
23345
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
23327
23346
  this.init(options);
@@ -23349,6 +23368,7 @@ class CNB extends CNBCore {
23349
23368
  package: new PackageManagement(options)
23350
23369
  };
23351
23370
  this.org = new Organization(options);
23371
+ this.dashboard = new Dashboard(options);
23352
23372
  }
23353
23373
  setToken(token) {
23354
23374
  this.token = token;
@@ -23363,6 +23383,7 @@ class CNB extends CNBCore {
23363
23383
  this.packages.registry.token = token;
23364
23384
  this.packages.package.token = token;
23365
23385
  this.org.token = token;
23386
+ this.dashboard.token = token;
23366
23387
  }
23367
23388
  setCookie(cookie) {
23368
23389
  this.cookie = cookie;
@@ -23377,6 +23398,7 @@ class CNB extends CNBCore {
23377
23398
  this.packages.registry.cookie = cookie;
23378
23399
  this.packages.package.cookie = cookie;
23379
23400
  this.org.cookie = cookie;
23401
+ this.dashboard.cookie = cookie;
23380
23402
  }
23381
23403
  getCNBVersion = getCNBVersion;
23382
23404
  }
@@ -45816,7 +45838,7 @@ app.route({
45816
45838
  let content = `
45817
45839
  cnb工作空间的访问uri为:${finalUri}
45818
45840
  `;
45819
- ctx.body = { content };
45841
+ ctx.body = { content, data: { assistant: finalUri } };
45820
45842
  }).addTo(app);
45821
45843
  app.route({
45822
45844
  path: "cnb",
@@ -45848,6 +45870,7 @@ app.route({
45848
45870
  const ssh = ctx.query?.ssh ?? false;
45849
45871
  const webUri = CNB_ENV?.CNB_VSCODE_WEB_URL || "";
45850
45872
  const vscodeSchma = CNB_ENV?.CNB_VSCODE_REMOTE_SSH_SCHEMA || "";
45873
+ let obj = {};
45851
45874
  let content = `
45852
45875
  当前的cnb 仓库为:${CNB_ENV?.CNB_REPO_SLUG}
45853
45876
 
@@ -45856,28 +45879,33 @@ app.route({
45856
45879
  content += `VS Code Web 访问 URI:${webUri}
45857
45880
 
45858
45881
  `;
45882
+ obj.webUri = webUri;
45859
45883
  }
45860
45884
  if (vscode) {
45861
45885
  content += `VS Code 访问 URI:${vscodeSchma}
45862
45886
 
45863
45887
  `;
45888
+ obj.vscodeUri = vscodeSchma;
45864
45889
  }
45865
45890
  if (codebuddy) {
45866
45891
  const codebuddyUri = vscodeSchma.replace("vscode://vscode-remote/ssh-remote+", "codebuddycn://vscode-remote/codebuddy-remote");
45867
45892
  content += `CodeBuddy 访问 URI:${codebuddyUri}
45868
45893
 
45869
45894
  `;
45895
+ obj.codebuddyUri = codebuddyUri;
45870
45896
  }
45871
45897
  if (cursor) {
45872
45898
  const cursorUri = vscodeSchma.replace("vscode://", "cursor://");
45873
45899
  content += `Cursor 访问 URI:${cursorUri}
45874
45900
 
45875
45901
  `;
45902
+ obj.cursorUri = cursorUri;
45876
45903
  }
45877
45904
  if (ssh) {
45878
45905
  content += `VS Code Remote SSH 连接字符串:ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
45906
+ obj.sshUri = `ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
45879
45907
  }
45880
- ctx.body = { content };
45908
+ ctx.body = { content, data: obj };
45881
45909
  }).addTo(app);
45882
45910
 
45883
45911
  // agent/routes/cnb-env/env.ts
@@ -54144,7 +54172,7 @@ app.route({
54144
54172
  }
54145
54173
  }).addTo(app, { overwrite: false });
54146
54174
 
54147
- // ../../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/opencode.js
54175
+ // ../../node_modules/.pnpm/@kevisual+router@0.1.7/node_modules/@kevisual/router/dist/opencode.js
54148
54176
  import { createRequire as createRequire4 } from "node:module";
54149
54177
  import { webcrypto as crypto2 } from "node:crypto";
54150
54178
  var __create4 = Object.create;
package/dist/routes.d.ts CHANGED
@@ -580,6 +580,52 @@ type StartBuildData = {
580
580
  tag?: string;
581
581
  };
582
582
 
583
+ type DashboardTodoStatus = 'pending' | 'processing' | 'completed';
584
+ type DashboardIssueItem = {
585
+ todo_id: string;
586
+ pinned: boolean;
587
+ number: number;
588
+ slug: string;
589
+ slug_freeze: boolean;
590
+ title: string;
591
+ state: string;
592
+ priority: string;
593
+ labels: {
594
+ name: string;
595
+ description: string;
596
+ color: string;
597
+ }[];
598
+ associated_pull_request_counts: number;
599
+ comment_count: number;
600
+ creator: {
601
+ username: string;
602
+ nickname: string;
603
+ freeze: boolean;
604
+ };
605
+ author_context: Record<string, any>;
606
+ created_time: string;
607
+ updated_time: string;
608
+ };
609
+ type DashboardMineCreateIssue = {
610
+ todo_type: string;
611
+ issue_datas: DashboardIssueItem[];
612
+ };
613
+ declare class Dashboard extends CNBCore {
614
+ constructor(options: CNBCoreOptions);
615
+ /**
616
+ * 获取我创建的 Issue 仪表盘
617
+ * @param params
618
+ * @param params.todoStatus - 待办状态: pending | processing | completed
619
+ * @param params.page - 页码,默认 1
620
+ * @param params.page_size - 每页数量,默认 20
621
+ */
622
+ getMineCreateIssue(params?: {
623
+ todoStatus?: DashboardTodoStatus;
624
+ page?: number;
625
+ page_size?: number;
626
+ }): Promise<Result<DashboardMineCreateIssue>>;
627
+ }
628
+
583
629
  type IssueAssignee = {
584
630
  nickname: string;
585
631
  username: string;
@@ -1714,6 +1760,7 @@ declare class CNB extends CNBCore {
1714
1760
  package: PackageManagement;
1715
1761
  };
1716
1762
  org: Organization;
1763
+ dashboard: Dashboard;
1717
1764
  constructor(options: CNBOptions);
1718
1765
  init(cnbOptions?: CNBOptions): void;
1719
1766
  setToken(token: string): void;
package/dist/routes.js CHANGED
@@ -2339,7 +2339,7 @@ var require_src = __commonJS((exports) => {
2339
2339
  };
2340
2340
  });
2341
2341
 
2342
- // ../../node_modules/.pnpm/@kevisual+router@0.1.6/node_modules/@kevisual/router/dist/router.js
2342
+ // ../../node_modules/.pnpm/@kevisual+router@0.1.7/node_modules/@kevisual/router/dist/router.js
2343
2343
  import { createRequire as createRequire2 } from "node:module";
2344
2344
  import { webcrypto as crypto } from "node:crypto";
2345
2345
  import url2 from "node:url";
@@ -22853,6 +22853,24 @@ function useCommentEnv() {
22853
22853
  };
22854
22854
  }
22855
22855
 
22856
+ // src/issue/dashboard.ts
22857
+ class Dashboard extends CNBCore {
22858
+ constructor(options) {
22859
+ super(options);
22860
+ }
22861
+ getMineCreateIssue(params) {
22862
+ const url3 = `${this.hackURL}/user/dashboard/mine_create/issue`;
22863
+ return this.get({
22864
+ url: url3,
22865
+ params,
22866
+ useCookie: true,
22867
+ headers: {
22868
+ Accept: "application/vnd.cnb.web+json"
22869
+ }
22870
+ });
22871
+ }
22872
+ }
22873
+
22856
22874
  // src/issue/index.ts
22857
22875
  class Issue extends CNBCore {
22858
22876
  constructor(options) {
@@ -23322,6 +23340,7 @@ class CNB extends CNBCore {
23322
23340
  labels;
23323
23341
  packages;
23324
23342
  org;
23343
+ dashboard;
23325
23344
  constructor(options) {
23326
23345
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
23327
23346
  this.init(options);
@@ -23349,6 +23368,7 @@ class CNB extends CNBCore {
23349
23368
  package: new PackageManagement(options)
23350
23369
  };
23351
23370
  this.org = new Organization(options);
23371
+ this.dashboard = new Dashboard(options);
23352
23372
  }
23353
23373
  setToken(token) {
23354
23374
  this.token = token;
@@ -23363,6 +23383,7 @@ class CNB extends CNBCore {
23363
23383
  this.packages.registry.token = token;
23364
23384
  this.packages.package.token = token;
23365
23385
  this.org.token = token;
23386
+ this.dashboard.token = token;
23366
23387
  }
23367
23388
  setCookie(cookie) {
23368
23389
  this.cookie = cookie;
@@ -23377,6 +23398,7 @@ class CNB extends CNBCore {
23377
23398
  this.packages.registry.cookie = cookie;
23378
23399
  this.packages.package.cookie = cookie;
23379
23400
  this.org.cookie = cookie;
23401
+ this.dashboard.cookie = cookie;
23380
23402
  }
23381
23403
  getCNBVersion = getCNBVersion;
23382
23404
  }
@@ -45816,7 +45838,7 @@ app.route({
45816
45838
  let content = `
45817
45839
  cnb工作空间的访问uri为:${finalUri}
45818
45840
  `;
45819
- ctx.body = { content };
45841
+ ctx.body = { content, data: { assistant: finalUri } };
45820
45842
  }).addTo(app);
45821
45843
  app.route({
45822
45844
  path: "cnb",
@@ -45848,6 +45870,7 @@ app.route({
45848
45870
  const ssh = ctx.query?.ssh ?? false;
45849
45871
  const webUri = CNB_ENV?.CNB_VSCODE_WEB_URL || "";
45850
45872
  const vscodeSchma = CNB_ENV?.CNB_VSCODE_REMOTE_SSH_SCHEMA || "";
45873
+ let obj = {};
45851
45874
  let content = `
45852
45875
  当前的cnb 仓库为:${CNB_ENV?.CNB_REPO_SLUG}
45853
45876
 
@@ -45856,28 +45879,33 @@ app.route({
45856
45879
  content += `VS Code Web 访问 URI:${webUri}
45857
45880
 
45858
45881
  `;
45882
+ obj.webUri = webUri;
45859
45883
  }
45860
45884
  if (vscode) {
45861
45885
  content += `VS Code 访问 URI:${vscodeSchma}
45862
45886
 
45863
45887
  `;
45888
+ obj.vscodeUri = vscodeSchma;
45864
45889
  }
45865
45890
  if (codebuddy) {
45866
45891
  const codebuddyUri = vscodeSchma.replace("vscode://vscode-remote/ssh-remote+", "codebuddycn://vscode-remote/codebuddy-remote");
45867
45892
  content += `CodeBuddy 访问 URI:${codebuddyUri}
45868
45893
 
45869
45894
  `;
45895
+ obj.codebuddyUri = codebuddyUri;
45870
45896
  }
45871
45897
  if (cursor) {
45872
45898
  const cursorUri = vscodeSchma.replace("vscode://", "cursor://");
45873
45899
  content += `Cursor 访问 URI:${cursorUri}
45874
45900
 
45875
45901
  `;
45902
+ obj.cursorUri = cursorUri;
45876
45903
  }
45877
45904
  if (ssh) {
45878
45905
  content += `VS Code Remote SSH 连接字符串:ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
45906
+ obj.sshUri = `ssh ${CNB_ENV.CNB_PIPELINE_ID}.${CNB_ENV.CNB_VSCODE_SSH_TOKEN}@cnb.space`;
45879
45907
  }
45880
- ctx.body = { content };
45908
+ ctx.body = { content, data: obj };
45881
45909
  }).addTo(app);
45882
45910
 
45883
45911
  // agent/routes/cnb-env/env.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kevisual/cnb",
3
- "version": "0.0.58",
3
+ "version": "0.0.60",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "basename": "/root/cnb",
package/src/index.ts CHANGED
@@ -4,7 +4,7 @@ import { KnowledgeBase } from "./knowledge/index.ts";
4
4
  import { Repo } from "./repo/index.ts";
5
5
  import { User } from "./user/index.ts";
6
6
  import { Build } from "./build/index.ts";
7
- import { Issue } from "./issue/index.ts";
7
+ import { Issue, Dashboard } from "./issue/index.ts";
8
8
  import { Mission } from "./mission/index.ts";
9
9
  import { AiBase } from "./ai/index.ts";
10
10
  import { RepoLabel, IssueLabel } from "./labels/index.ts";
@@ -32,6 +32,7 @@ export class CNB extends CNBCore {
32
32
  package: PackageManagement;
33
33
  };
34
34
  org!: Organization;
35
+ dashboard!: Dashboard;
35
36
  constructor(options: CNBOptions) {
36
37
  super({ ...options, token: options.token, cookie: options.cookie, cnb: options.cnb });
37
38
  this.init(options);
@@ -59,6 +60,7 @@ export class CNB extends CNBCore {
59
60
  package: new PackageManagement(options),
60
61
  };
61
62
  this.org = new Organization(options);
63
+ this.dashboard = new Dashboard(options);
62
64
  }
63
65
  setToken(token: string) {
64
66
  this.token = token;
@@ -73,6 +75,7 @@ export class CNB extends CNBCore {
73
75
  this.packages.registry.token = token;
74
76
  this.packages.package.token = token;
75
77
  this.org.token = token;
78
+ this.dashboard.token = token;
76
79
  }
77
80
  setCookie(cookie: string) {
78
81
  this.cookie = cookie;
@@ -87,6 +90,7 @@ export class CNB extends CNBCore {
87
90
  this.packages.registry.cookie = cookie;
88
91
  this.packages.package.cookie = cookie;
89
92
  this.org.cookie = cookie;
93
+ this.dashboard.cookie = cookie;
90
94
  }
91
95
  getCNBVersion = getCNBVersion
92
96
  }
@@ -0,0 +1,64 @@
1
+ import { CNBCore, CNBCoreOptions, Result } from "../cnb-core.ts";
2
+
3
+ export type DashboardTodoStatus = 'pending' | 'processing' | 'completed';
4
+
5
+ export type DashboardIssueItem = {
6
+ todo_id: string;
7
+ pinned: boolean;
8
+ number: number;
9
+ slug: string;
10
+ slug_freeze: boolean;
11
+ title: string;
12
+ state: string;
13
+ priority: string;
14
+ labels: {
15
+ name: string;
16
+ description: string;
17
+ color: string;
18
+ }[];
19
+ associated_pull_request_counts: number;
20
+ comment_count: number;
21
+ creator: {
22
+ username: string;
23
+ nickname: string;
24
+ freeze: boolean;
25
+ };
26
+ author_context: Record<string, any>;
27
+ created_time: string;
28
+ updated_time: string;
29
+ };
30
+
31
+ export type DashboardMineCreateIssue = {
32
+ // 'issue'
33
+ todo_type: string;
34
+ issue_datas: DashboardIssueItem[];
35
+ };
36
+
37
+ export class Dashboard extends CNBCore {
38
+ constructor(options: CNBCoreOptions) {
39
+ super(options);
40
+ }
41
+
42
+ /**
43
+ * 获取我创建的 Issue 仪表盘
44
+ * @param params
45
+ * @param params.todoStatus - 待办状态: pending | processing | completed
46
+ * @param params.page - 页码,默认 1
47
+ * @param params.page_size - 每页数量,默认 20
48
+ */
49
+ getMineCreateIssue(params?: {
50
+ todoStatus?: DashboardTodoStatus;
51
+ page?: number;
52
+ page_size?: number;
53
+ }): Promise<Result<DashboardMineCreateIssue>> {
54
+ const url = `${this.hackURL}/user/dashboard/mine_create/issue`;
55
+ return this.get({
56
+ url,
57
+ params,
58
+ useCookie: true,
59
+ headers: {
60
+ 'Accept': 'application/vnd.cnb.web+json',
61
+ },
62
+ });
63
+ }
64
+ }
@@ -1,6 +1,7 @@
1
1
  import { CNBCore, CNBCoreOptions, RequestOptions, Result } from "../cnb-core.ts";
2
2
  import { extractAliveInfo } from "./issue-alive.ts";
3
3
  import { useNPCEnv, useCommentEnv, usePullRequestEnv, useRepoInfoEnv } from "./npc/env.ts";
4
+ export { Dashboard, type DashboardIssueItem, type DashboardMineCreateIssue, type DashboardTodoStatus } from "./dashboard.ts";
4
5
  export type IssueAssignee = {
5
6
  nickname: string;
6
7
  username: string;