@mosse-ai/cli 0.1.3 → 0.1.4

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/index.js +56 -3
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -48,6 +48,9 @@ var exact = {
48
48
  "/v1/my/scope-overview": ["GET"],
49
49
  "/v1/my/keychain/overview": ["GET"],
50
50
  "/v1/connections": ["GET", "POST"],
51
+ "/v1/github/app/install": ["POST"],
52
+ "/v1/github/app/bind/start": ["POST"],
53
+ "/v1/github/app/installations": ["GET"],
51
54
  "/v1/connections-maintained": ["GET"],
52
55
  "/v1/my/keychain/drops": ["POST"],
53
56
  "/v1/my/connectors/oauth/status": ["GET"],
@@ -189,6 +192,36 @@ var patterns = [
189
192
  methods: ["GET", "DELETE"],
190
193
  sample: "/v1/my/scope-skills/sk-1"
191
194
  },
195
+ {
196
+ pattern: /^\/v1\/github\/app\/installations\/[A-Za-z0-9_-]+$/,
197
+ methods: ["DELETE"],
198
+ sample: "/v1/github/app/installations/c-1"
199
+ },
200
+ {
201
+ pattern: /^\/v1\/github\/app\/repositories\/[A-Za-z0-9_-]+\/branches$/,
202
+ methods: ["GET"],
203
+ sample: "/v1/github/app/repositories/r-1/branches"
204
+ },
205
+ {
206
+ pattern: /^\/v1\/github\/app\/repositories\/[A-Za-z0-9_-]+\/policy$/,
207
+ methods: ["PUT"],
208
+ sample: "/v1/github/app/repositories/r-1/policy"
209
+ },
210
+ {
211
+ pattern: /^\/v1\/github\/app\/repositories\/[A-Za-z0-9_-]+\/grants$/,
212
+ methods: ["PUT"],
213
+ sample: "/v1/github/app/repositories/r-1/grants"
214
+ },
215
+ {
216
+ pattern: /^\/v1\/github\/app\/installations\/[A-Za-z0-9_-]+\/repositories$/,
217
+ methods: ["GET"],
218
+ sample: "/v1/github/app/installations/c-1/repositories"
219
+ },
220
+ {
221
+ pattern: /^\/v1\/github\/app\/installations\/[A-Za-z0-9_-]+\/refresh$/,
222
+ methods: ["POST"],
223
+ sample: "/v1/github/app/installations/c-1/refresh"
224
+ },
192
225
  {
193
226
  pattern: /^\/v1\/connections\/[A-Za-z0-9_-]+\/rotate$/,
194
227
  methods: ["POST"],
@@ -21264,7 +21297,7 @@ function actionOf(id) {
21264
21297
  return id.slice(id.indexOf(".") + 1);
21265
21298
  }
21266
21299
  function patScopeOf(spec) {
21267
- return `${domainOf(spec.id)}:${spec.effect === "read" ? "read" : "write"}`;
21300
+ return spec.patScope ?? `${domainOf(spec.id)}:${spec.effect === "read" ? "read" : "write"}`;
21268
21301
  }
21269
21302
  function mcpToolNameOf(spec) {
21270
21303
  return spec.mcpName ?? spec.id.replace(".", "_");
@@ -21308,6 +21341,14 @@ function registryProblems(specs) {
21308
21341
  if (mcpNames.has(mcp))
21309
21342
  problems6.push(`${s.id}: duplicate MCP tool name ${mcp}`);
21310
21343
  mcpNames.add(mcp);
21344
+ if (s.patScope) {
21345
+ if (!s.patScope.startsWith(`${domainOf(s.id)}:`))
21346
+ problems6.push(`${s.id}: patScope ${s.patScope} must stay in domain ${domainOf(s.id)}`);
21347
+ if (!/^[a-z]+:(read|write|admin)$/.test(s.patScope))
21348
+ problems6.push(`${s.id}: invalid patScope ${s.patScope}`);
21349
+ if (s.effect === "read" && s.patScope !== `${domainOf(s.id)}:read`)
21350
+ problems6.push(`${s.id}: read capabilities cannot use patScope ${s.patScope}`);
21351
+ }
21311
21352
  if (s.principals && s.principals.length < 2 && !s.reason)
21312
21353
  problems6.push(`${s.id}: narrowed principals need a reason`);
21313
21354
  if (s.runScoped && (s.principals?.length !== 1 || s.principals[0] !== "agent"))
@@ -22390,6 +22431,7 @@ var KnowledgePurgeKb = defineCapability({
22390
22431
  summary: "Permanently delete an archived knowledge base with its documents and sharing. This cannot be undone. For in-product agents: this always asks the person you are talking with to confirm.",
22391
22432
  input: external_exports.strictObject({ kbId }),
22392
22433
  effect: "destructive",
22434
+ patScope: "knowledge:admin",
22393
22435
  external: true,
22394
22436
  highRisk: "always"
22395
22437
  });
@@ -22398,6 +22440,7 @@ var KnowledgeGrantKb = defineCapability({
22398
22440
  summary: "Share a knowledge base with a person's personal scope or a channel, for reading or writing. Takes effect immediately; setting it again changes the permission.",
22399
22441
  input: external_exports.strictObject({ kbId, granteeScopeId: scopeId, permission: external_exports.enum(["read", "write"]) }),
22400
22442
  effect: "write",
22443
+ patScope: "knowledge:admin",
22401
22444
  external: true,
22402
22445
  highRisk: "always",
22403
22446
  idempotent: true
@@ -22415,6 +22458,7 @@ var KnowledgeAddManager = defineCapability({
22415
22458
  summary: "Make a person a manager of a shared knowledge base you created. Managers can add files, share it and change its settings; only the creator can add or remove managers, archive or delete it. For in-product agents: this always asks the person you are talking with to confirm.",
22416
22459
  input: external_exports.strictObject({ kbId, userId: external_exports.uuid() }),
22417
22460
  effect: "write",
22461
+ patScope: "knowledge:admin",
22418
22462
  external: true,
22419
22463
  highRisk: "always",
22420
22464
  idempotent: true
@@ -22424,6 +22468,7 @@ var KnowledgeRemoveManager = defineCapability({
22424
22468
  summary: "Stop a person managing a shared knowledge base you created. For in-product agents: this always asks the person you are talking with to confirm.",
22425
22469
  input: external_exports.strictObject({ kbId, userId: external_exports.uuid() }),
22426
22470
  effect: "write",
22471
+ patScope: "knowledge:admin",
22427
22472
  external: true,
22428
22473
  highRisk: "always",
22429
22474
  idempotent: true
@@ -22433,6 +22478,7 @@ var KnowledgeRevokeKb = defineCapability({
22433
22478
  summary: "Stop sharing a knowledge base with a scope. The one it was shared with (yourself, or a channel you manage) can also use this to leave it.",
22434
22479
  input: external_exports.strictObject({ kbId, granteeScopeId: scopeId }),
22435
22480
  effect: "write",
22481
+ patScope: "knowledge:admin",
22436
22482
  external: true,
22437
22483
  highRisk: "always",
22438
22484
  idempotent: true
@@ -22495,6 +22541,7 @@ var KnowledgeSetModels = defineCapability({
22495
22541
  confirmKeyHandoff: external_exports.boolean().optional()
22496
22542
  }),
22497
22543
  effect: "write",
22544
+ patScope: "knowledge:admin",
22498
22545
  external: true,
22499
22546
  highRisk: "always",
22500
22547
  idempotent: true
@@ -23283,7 +23330,7 @@ function buildCommandTree(options = {}) {
23283
23330
  }
23284
23331
 
23285
23332
  // src/api.ts
23286
- var CLI_VERSION = true ? "0.1.3" : "0.0.0";
23333
+ var CLI_VERSION = true ? "0.1.4" : "0.0.0";
23287
23334
  var CLI_USER_AGENT = `mosse-cli/${CLI_VERSION}`;
23288
23335
  async function callApi(request) {
23289
23336
  const headers = {
@@ -24154,7 +24201,13 @@ var HTTP_ERROR_HINTS = [
24154
24201
  /can't depend on itself/i,
24155
24202
  "dependsOn \u7528\u300C\u6279\u5185\u4E0B\u6807\u300D(0 = \u6279\u91CC\u7B2C\u4E00\u4E2A\u4EFB\u52A1),\u4E0D\u662F\u4EFB\u52A1 id;\u4E24\u4E2A\u5DF2\u6709\u4EFB\u52A1\u4E4B\u95F4\u7528 board task dependency-add\u3002"
24156
24203
  ],
24157
- [/invalid arguments/i, "\u5165\u53C2\u5F62\u72B6\u4E0D\u5BF9:\u770B\u8BE5\u547D\u4EE4\u7684 --help \u793A\u4F8B;\u6570\u7EC4/\u5BF9\u8C61\u53C2\u6570\u53EF\u4EE5\u5199\u6210 --tasks @file(\u6587\u4EF6\u91CC\u653E JSON)\u3002"]
24204
+ [/invalid arguments/i, "\u5165\u53C2\u5F62\u72B6\u4E0D\u5BF9:\u770B\u8BE5\u547D\u4EE4\u7684 --help \u793A\u4F8B;\u6570\u7EC4/\u5BF9\u8C61\u53C2\u6570\u53EF\u4EE5\u5199\u6210 --tasks @file(\u6587\u4EF6\u91CC\u653E JSON)\u3002"],
24205
+ [
24206
+ /lacks the `?[a-z]+:(read|write|admin)`? permission/i,
24207
+ "\u4EE4\u724C\u7F3A\u8FD9\u4E2A\u6743\u9650\u6863:\u53BB Settings \u2192 Agent access \u65B0\u5EFA\u4E00\u4E2A\u5E26\u8BE5\u6863\u7684\u4EE4\u724C(\u4EE4\u724C\u7684\u6863\u4F4D\u4E0D\u4F1A\u968F\u89D2\u8272\u53D8\u5316)\u3002"
24208
+ ],
24209
+ [/invalid, expired or revoked/i, "\u91CD\u65B0\u767B\u5F55:mosse auth login;\u6216\u6362\u4E00\u628A MOSSE_TOKEN\u3002"],
24210
+ [/not a member of workspace/i, "\u4F60\u4E0D\u5728\u8FD9\u4E2A workspace(\u6216\u88AB\u79FB\u9664):\u8BA9\u7BA1\u7406\u5458\u52A0\u56DE,\u6216\u6362\u4E00\u4E2A --workspace\u3002"]
24158
24211
  ];
24159
24212
  function withHttpHint(message) {
24160
24213
  for (const [pattern, hint] of HTTP_ERROR_HINTS) if (pattern.test(message)) return `${message}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mosse-ai/cli",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "mosse": "./dist/index.js"
@@ -16,8 +16,8 @@
16
16
  "typescript": "^5.7.3",
17
17
  "esbuild": "^0.25.0",
18
18
  "get-east-asian-width": "1.7.0",
19
- "@mosse/contract": "0.0.0",
20
- "@mosse/tool-surface": "0.0.0"
19
+ "@mosse/tool-surface": "0.0.0",
20
+ "@mosse/contract": "0.0.0"
21
21
  },
22
22
  "description": "Mosse command-line client: boards, tasks, knowledge search, and agent-friendly device login.",
23
23
  "license": "UNLICENSED",