@agentteams/cli 0.1.76 → 0.1.78
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/.eslintcache +1 -1
- package/dist/api/convention.d.ts +11 -0
- package/dist/api/convention.d.ts.map +1 -0
- package/dist/api/convention.js +26 -0
- package/dist/api/convention.js.map +1 -0
- package/dist/api/document.d.ts +1 -1
- package/dist/api/document.d.ts.map +1 -1
- package/dist/api/document.js.map +1 -1
- package/dist/commands/agentConfig.d.ts.map +1 -1
- package/dist/commands/agentConfig.js +2 -1
- package/dist/commands/agentConfig.js.map +1 -1
- package/dist/commands/convention.d.ts.map +1 -1
- package/dist/commands/convention.js +9 -10
- package/dist/commands/convention.js.map +1 -1
- package/dist/commands/dependency.d.ts.map +1 -1
- package/dist/commands/dependency.js +2 -1
- package/dist/commands/dependency.js.map +1 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +1 -19
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +2 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcp.d.ts +13 -0
- package/dist/commands/mcp.d.ts.map +1 -0
- package/dist/commands/mcp.js +13 -0
- package/dist/commands/mcp.js.map +1 -0
- package/dist/commands/search.d.ts.map +1 -1
- package/dist/commands/search.js +8 -35
- package/dist/commands/search.js.map +1 -1
- package/dist/index.js +71 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/context.d.ts +15 -0
- package/dist/mcp/context.d.ts.map +1 -0
- package/dist/mcp/context.js +47 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/resources.d.ts +17 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +50 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +20 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +107 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +12 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +54 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp-registration/atomicWrite.d.ts +26 -0
- package/dist/mcp-registration/atomicWrite.d.ts.map +1 -0
- package/dist/mcp-registration/atomicWrite.js +58 -0
- package/dist/mcp-registration/atomicWrite.js.map +1 -0
- package/dist/mcp-registration/clients.d.ts +5 -0
- package/dist/mcp-registration/clients.d.ts.map +1 -0
- package/dist/mcp-registration/clients.js +300 -0
- package/dist/mcp-registration/clients.js.map +1 -0
- package/dist/mcp-registration/detect.d.ts +23 -0
- package/dist/mcp-registration/detect.d.ts.map +1 -0
- package/dist/mcp-registration/detect.js +48 -0
- package/dist/mcp-registration/detect.js.map +1 -0
- package/dist/mcp-registration/index.d.ts +50 -0
- package/dist/mcp-registration/index.d.ts.map +1 -0
- package/dist/mcp-registration/index.js +205 -0
- package/dist/mcp-registration/index.js.map +1 -0
- package/dist/mcp-registration/install.d.ts +66 -0
- package/dist/mcp-registration/install.d.ts.map +1 -0
- package/dist/mcp-registration/install.js +244 -0
- package/dist/mcp-registration/install.js.map +1 -0
- package/dist/mcp-registration/jsonc.d.ts +44 -0
- package/dist/mcp-registration/jsonc.d.ts.map +1 -0
- package/dist/mcp-registration/jsonc.js +266 -0
- package/dist/mcp-registration/jsonc.js.map +1 -0
- package/dist/mcp-registration/render.d.ts +18 -0
- package/dist/mcp-registration/render.d.ts.map +1 -0
- package/dist/mcp-registration/render.js +91 -0
- package/dist/mcp-registration/render.js.map +1 -0
- package/dist/mcp-registration/serverSpec.d.ts +31 -0
- package/dist/mcp-registration/serverSpec.d.ts.map +1 -0
- package/dist/mcp-registration/serverSpec.js +29 -0
- package/dist/mcp-registration/serverSpec.js.map +1 -0
- package/dist/mcp-registration/types.d.ts +98 -0
- package/dist/mcp-registration/types.d.ts.map +1 -0
- package/dist/mcp-registration/types.js +12 -0
- package/dist/mcp-registration/types.js.map +1 -0
- package/dist/mcp-registration/vendorCommand.d.ts +18 -0
- package/dist/mcp-registration/vendorCommand.d.ts.map +1 -0
- package/dist/mcp-registration/vendorCommand.js +27 -0
- package/dist/mcp-registration/vendorCommand.js.map +1 -0
- package/dist/utils/apiContext.d.ts +22 -0
- package/dist/utils/apiContext.d.ts.map +1 -0
- package/dist/utils/apiContext.js +39 -0
- package/dist/utils/apiContext.js.map +1 -0
- package/dist/utils/entityId.d.ts +12 -0
- package/dist/utils/entityId.d.ts.map +1 -1
- package/dist/utils/entityId.js +2 -4
- package/dist/utils/entityId.js.map +1 -1
- package/dist/utils/searchParams.d.ts +22 -0
- package/dist/utils/searchParams.d.ts.map +1 -0
- package/dist/utils/searchParams.js +32 -0
- package/dist/utils/searchParams.js.map +1 -0
- package/package.json +9 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/mcp-registration/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Client ids accepted by `--client`. Orca is not a client and GEMINI is a deprecated runner type, so neither appears here. */
|
|
2
|
+
export const MCP_CLIENT_IDS = [
|
|
3
|
+
'claude-code',
|
|
4
|
+
'codex',
|
|
5
|
+
'copilot-cli',
|
|
6
|
+
'opencode',
|
|
7
|
+
'amp',
|
|
8
|
+
'cursor-cli',
|
|
9
|
+
'kimi-cli',
|
|
10
|
+
'antigravity',
|
|
11
|
+
];
|
|
12
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/mcp-registration/types.ts"],"names":[],"mappings":"AAAA,+HAA+H;AAC/H,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,aAAa;IACb,OAAO;IACP,aAAa;IACb,UAAU;IACV,KAAK;IACL,YAAY;IACZ,UAAU;IACV,aAAa;CACL,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface VendorCommandResult {
|
|
2
|
+
status: number | null;
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
/** Set when the process could not be started at all (e.g. ENOENT). */
|
|
6
|
+
spawnError?: string;
|
|
7
|
+
}
|
|
8
|
+
export type VendorRunner = (executable: string, args: string[], options: {
|
|
9
|
+
cwd: string;
|
|
10
|
+
env: NodeJS.ProcessEnv;
|
|
11
|
+
}) => VendorCommandResult;
|
|
12
|
+
/**
|
|
13
|
+
* Vendor CLIs are invoked without a shell: the argument vector carries the
|
|
14
|
+
* user's API key for user-scope installs, and a shell would expose it to
|
|
15
|
+
* word-splitting and to shell history/tracing.
|
|
16
|
+
*/
|
|
17
|
+
export declare const runVendorCommand: VendorRunner;
|
|
18
|
+
//# sourceMappingURL=vendorCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorCommand.d.ts","sourceRoot":"","sources":["../../src/mcp-registration/vendorCommand.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,CACzB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAC7C,mBAAmB,CAAC;AAEzB;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,YAqB9B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process';
|
|
2
|
+
/**
|
|
3
|
+
* Vendor CLIs are invoked without a shell: the argument vector carries the
|
|
4
|
+
* user's API key for user-scope installs, and a shell would expose it to
|
|
5
|
+
* word-splitting and to shell history/tracing.
|
|
6
|
+
*/
|
|
7
|
+
export const runVendorCommand = (executable, args, options) => {
|
|
8
|
+
const result = spawnSync(executable, args, {
|
|
9
|
+
cwd: options.cwd,
|
|
10
|
+
env: options.env,
|
|
11
|
+
encoding: 'utf-8',
|
|
12
|
+
shell: false,
|
|
13
|
+
// Some registration commands prompt when they detect a TTY; an explicit
|
|
14
|
+
// empty stdin keeps them non-interactive.
|
|
15
|
+
input: '',
|
|
16
|
+
timeout: 120_000,
|
|
17
|
+
});
|
|
18
|
+
if (result.error) {
|
|
19
|
+
return { status: null, stdout: '', stderr: '', spawnError: result.error.message };
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
status: result.status,
|
|
23
|
+
stdout: result.stdout ?? '',
|
|
24
|
+
stderr: result.stderr ?? '',
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=vendorCommand.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vendorCommand.js","sourceRoot":"","sources":["../../src/mcp-registration/vendorCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAgB/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAiB,CAAC,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE;IAC1E,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE;QACzC,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,KAAK;QACZ,wEAAwE;QACxE,0CAA0C;QAC1C,KAAK,EAAE,EAAE;QACT,OAAO,EAAE,OAAO;KACjB,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;IACpF,CAAC;IAED,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;QAC3B,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;KAC5B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Config } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Collect config overrides passed as CLI options.
|
|
4
|
+
*
|
|
5
|
+
* Shared with long-running entry points (e.g. `mcp`) that never reach
|
|
6
|
+
* `executeCommand()` but must honour the same override contract.
|
|
7
|
+
*/
|
|
8
|
+
export declare function buildConfigOverrides(options: Record<string, unknown>): Partial<Config>;
|
|
9
|
+
/**
|
|
10
|
+
* Pick the header that matches the credential kind.
|
|
11
|
+
*
|
|
12
|
+
* The server gates `X-API-Key` on the `key_` prefix and rejects anything else
|
|
13
|
+
* before it looks the credential up, so a desktop personal access token
|
|
14
|
+
* (`atp_`) sent that way always fails as "Invalid API key". Personal tokens —
|
|
15
|
+
* and any other bearer credential — authenticate through `Authorization`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function buildAuthHeaders(apiKey: string): Record<string, string>;
|
|
18
|
+
export declare function resolveApiContext(config: Config): {
|
|
19
|
+
apiUrl: string;
|
|
20
|
+
headers: Record<string, string>;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=apiContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiContext.d.ts","sourceRoot":"","sources":["../../src/utils/apiContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAIhD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAStF;AAKD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEvE;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CAOrG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const CONFIG_OVERRIDE_KEYS = ['apiKey', 'apiUrl', 'teamId', 'projectId'];
|
|
2
|
+
/**
|
|
3
|
+
* Collect config overrides passed as CLI options.
|
|
4
|
+
*
|
|
5
|
+
* Shared with long-running entry points (e.g. `mcp`) that never reach
|
|
6
|
+
* `executeCommand()` but must honour the same override contract.
|
|
7
|
+
*/
|
|
8
|
+
export function buildConfigOverrides(options) {
|
|
9
|
+
const overrides = {};
|
|
10
|
+
for (const key of CONFIG_OVERRIDE_KEYS) {
|
|
11
|
+
const value = options[key];
|
|
12
|
+
if (typeof value === 'string' && value.length > 0) {
|
|
13
|
+
overrides[key] = value;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return overrides;
|
|
17
|
+
}
|
|
18
|
+
/** Agent API keys are the only credential the server accepts on `X-API-Key`. */
|
|
19
|
+
const AGENT_API_KEY_PREFIX = 'key_';
|
|
20
|
+
/**
|
|
21
|
+
* Pick the header that matches the credential kind.
|
|
22
|
+
*
|
|
23
|
+
* The server gates `X-API-Key` on the `key_` prefix and rejects anything else
|
|
24
|
+
* before it looks the credential up, so a desktop personal access token
|
|
25
|
+
* (`atp_`) sent that way always fails as "Invalid API key". Personal tokens —
|
|
26
|
+
* and any other bearer credential — authenticate through `Authorization`.
|
|
27
|
+
*/
|
|
28
|
+
export function buildAuthHeaders(apiKey) {
|
|
29
|
+
return apiKey.startsWith(AGENT_API_KEY_PREFIX) ? { 'X-API-Key': apiKey } : { Authorization: `Bearer ${apiKey}` };
|
|
30
|
+
}
|
|
31
|
+
export function resolveApiContext(config) {
|
|
32
|
+
const apiUrl = config.apiUrl.endsWith('/') ? config.apiUrl.slice(0, -1) : config.apiUrl;
|
|
33
|
+
const headers = {
|
|
34
|
+
...buildAuthHeaders(config.apiKey),
|
|
35
|
+
'Content-Type': 'application/json',
|
|
36
|
+
};
|
|
37
|
+
return { apiUrl, headers };
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=apiContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiContext.js","sourceRoot":"","sources":["../../src/utils/apiContext.ts"],"names":[],"mappings":"AAEA,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,CAAU,CAAC;AAElF;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAgC;IACnE,MAAM,SAAS,GAA2B,EAAE,CAAC;IAC7C,KAAK,MAAM,GAAG,IAAI,oBAAoB,EAAE,CAAC;QACvC,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC3B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAClD,SAAS,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACzB,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,gFAAgF;AAChF,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAEpC;;;;;;;GAOG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAc;IAC7C,OAAO,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,MAAM,EAAE,EAAE,CAAC;AACnH,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACxF,MAAM,OAAO,GAAG;QACd,GAAG,gBAAgB,CAAC,MAAM,CAAC,MAAM,CAAC;QAClC,cAAc,EAAE,kBAAkB;KACnC,CAAC;IACF,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
|
package/dist/utils/entityId.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AgentTeams web UI entity references embed a type prefix in the id
|
|
3
|
+
* (e.g. `agentteams_pln_<uuid>`). The CLI and API only accept the bare id,
|
|
4
|
+
* so any id pasted from an entity reference must be normalized before use.
|
|
5
|
+
*
|
|
6
|
+
* Canonical prefixes (see `.agentteams/convention.md`):
|
|
7
|
+
* agentteams_pln_ (plan) · agentteams_rpt_ (completionReport)
|
|
8
|
+
* agentteams_rev_ (codeReview) · agentteams_act_ (coAction)
|
|
9
|
+
* agentteams_cnv_ (convention) · agentteams_pmt_ (postMortem)
|
|
10
|
+
* agentteams_doc_ (document) · agentteams_rvf_ (codeReviewFinding)
|
|
11
|
+
* agentteams_tsk_ (planTask)
|
|
12
|
+
*/
|
|
1
13
|
/**
|
|
2
14
|
* Strip a known AgentTeams entity-id prefix from a value. Values without a
|
|
3
15
|
* recognized prefix (bare ids, undefined, non-strings) are returned unchanged.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityId.d.ts","sourceRoot":"","sources":["../../src/utils/entityId.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"entityId.d.ts","sourceRoot":"","sources":["../../src/utils/entityId.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAElD;AAkBD;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAclG"}
|
package/dist/utils/entityId.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { stripContextEntityIdPrefix } from '@agentteams/context-tools';
|
|
1
2
|
/**
|
|
2
3
|
* AgentTeams web UI entity references embed a type prefix in the id
|
|
3
4
|
* (e.g. `agentteams_pln_<uuid>`). The CLI and API only accept the bare id,
|
|
@@ -10,15 +11,12 @@
|
|
|
10
11
|
* agentteams_doc_ (document) · agentteams_rvf_ (codeReviewFinding)
|
|
11
12
|
* agentteams_tsk_ (planTask)
|
|
12
13
|
*/
|
|
13
|
-
const ENTITY_ID_PREFIX = /^agentteams_(?:pln|rpt|rev|act|cnv|pmt|doc|rvf|tsk)_/;
|
|
14
14
|
/**
|
|
15
15
|
* Strip a known AgentTeams entity-id prefix from a value. Values without a
|
|
16
16
|
* recognized prefix (bare ids, undefined, non-strings) are returned unchanged.
|
|
17
17
|
*/
|
|
18
18
|
export function stripEntityIdPrefix(value) {
|
|
19
|
-
|
|
20
|
-
return value;
|
|
21
|
-
return value.replace(ENTITY_ID_PREFIX, '');
|
|
19
|
+
return stripContextEntityIdPrefix(value);
|
|
22
20
|
}
|
|
23
21
|
/**
|
|
24
22
|
* Whether a CLI option key carries an entity id and should accept prefixed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entityId.js","sourceRoot":"","sources":["../../src/utils/entityId.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"entityId.js","sourceRoot":"","sources":["../../src/utils/entityId.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE;;;;;;;;;;;GAWG;AACH;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAI,KAAQ;IAC7C,OAAO,0BAA0B,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC;AAED;;;;;;;;;;;GAWG;AACH,SAAS,mBAAmB,CAAC,GAAW;IACtC,OAAO,GAAG,KAAK,IAAI,IAAI,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAgC;IACvE,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,MAAM,IAAI,GAA4B,EAAE,GAAG,OAAO,EAAE,CAAC;IACrD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACvC,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC;YAAE,SAAS;QACxC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,SAAS;QACxC,MAAM,UAAU,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAC;QAC9C,IAAI,UAAU,KAAK,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC;YACvB,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC;IACH,CAAC;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ContextToolSearchType } from '@agentteams/context-tools';
|
|
2
|
+
/**
|
|
3
|
+
* Entity types accepted by `GET /api/projects/:projectId/search`.
|
|
4
|
+
* Runtime catalog is owned by `@agentteams/context-tools`.
|
|
5
|
+
*/
|
|
6
|
+
export { CONTEXT_TOOL_SEARCH_TYPES as VALID_TYPES } from '@agentteams/context-tools';
|
|
7
|
+
export type SearchEntityType = ContextToolSearchType;
|
|
8
|
+
export interface SearchParamsInput {
|
|
9
|
+
query: string;
|
|
10
|
+
types?: readonly string[];
|
|
11
|
+
limit?: number;
|
|
12
|
+
maxTokens?: number;
|
|
13
|
+
}
|
|
14
|
+
/** Parse and validate a comma-separated `--types` value. */
|
|
15
|
+
export declare function parseSearchTypes(raw: string): string[];
|
|
16
|
+
/**
|
|
17
|
+
* Build the query params for the search endpoint. Shared by the `search`
|
|
18
|
+
* command and the MCP tool so both speak the same contract; optional values are
|
|
19
|
+
* omitted rather than defaulted, leaving the backend defaults authoritative.
|
|
20
|
+
*/
|
|
21
|
+
export declare function buildSearchParams(input: SearchParamsInput): Record<string, string | number | string[]>;
|
|
22
|
+
//# sourceMappingURL=searchParams.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchParams.d.ts","sourceRoot":"","sources":["../../src/utils/searchParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,KAAK,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAGlG;;;GAGG;AACH,OAAO,EAAE,yBAAyB,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAErF,MAAM,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAErD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAOtD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,CAQtG"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CONTEXT_TOOL_SEARCH_TYPES } from '@agentteams/context-tools';
|
|
2
|
+
import { splitCsv } from './parsers.js';
|
|
3
|
+
/**
|
|
4
|
+
* Entity types accepted by `GET /api/projects/:projectId/search`.
|
|
5
|
+
* Runtime catalog is owned by `@agentteams/context-tools`.
|
|
6
|
+
*/
|
|
7
|
+
export { CONTEXT_TOOL_SEARCH_TYPES as VALID_TYPES } from '@agentteams/context-tools';
|
|
8
|
+
/** Parse and validate a comma-separated `--types` value. */
|
|
9
|
+
export function parseSearchTypes(raw) {
|
|
10
|
+
const types = splitCsv(raw).map((type) => type.toUpperCase());
|
|
11
|
+
const invalid = types.filter((type) => !CONTEXT_TOOL_SEARCH_TYPES.includes(type));
|
|
12
|
+
if (invalid.length > 0) {
|
|
13
|
+
throw new Error(`Invalid type(s): ${invalid.join(', ')}. Valid types: ${CONTEXT_TOOL_SEARCH_TYPES.join(', ')}`);
|
|
14
|
+
}
|
|
15
|
+
return types;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Build the query params for the search endpoint. Shared by the `search`
|
|
19
|
+
* command and the MCP tool so both speak the same contract; optional values are
|
|
20
|
+
* omitted rather than defaulted, leaving the backend defaults authoritative.
|
|
21
|
+
*/
|
|
22
|
+
export function buildSearchParams(input) {
|
|
23
|
+
const params = { q: input.query };
|
|
24
|
+
if (input.types !== undefined)
|
|
25
|
+
params.types = [...input.types];
|
|
26
|
+
if (input.limit !== undefined)
|
|
27
|
+
params.limit = input.limit;
|
|
28
|
+
if (input.maxTokens !== undefined)
|
|
29
|
+
params.maxTokens = input.maxTokens;
|
|
30
|
+
return params;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=searchParams.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"searchParams.js","sourceRoot":"","sources":["../../src/utils/searchParams.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAA8B,MAAM,2BAA2B,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;;GAGG;AACH,OAAO,EAAE,yBAAyB,IAAI,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAWrF,4DAA4D;AAC5D,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC9D,MAAM,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,yBAAyB,CAAC,QAAQ,CAAC,IAAwB,CAAC,CAAC,CAAC;IACtG,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,kBAAkB,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAwB;IACxD,MAAM,MAAM,GAA+C,EAAE,CAAC,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;IAE9E,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/D,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IAC1D,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IAEtE,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentteams/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.78",
|
|
4
4
|
"description": "CLI tool for AgentTeams API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,6 +15,9 @@
|
|
|
15
15
|
"typecheck": "tsc --noEmit",
|
|
16
16
|
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
|
|
17
17
|
"test:watch": "node --experimental-vm-modules node_modules/jest/bin/jest.js --watch",
|
|
18
|
+
"test:file": "node --experimental-vm-modules node_modules/jest/bin/jest.js --runTestsByPath",
|
|
19
|
+
"test:related": "node --experimental-vm-modules node_modules/jest/bin/jest.js --findRelatedTests",
|
|
20
|
+
"test:changed": "node --experimental-vm-modules node_modules/jest/bin/jest.js --onlyChanged",
|
|
18
21
|
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\" --cache --cache-location .eslintcache --cache-strategy content",
|
|
19
22
|
"format": "prettier --write .",
|
|
20
23
|
"format:check": "prettier --check .",
|
|
@@ -36,17 +39,20 @@
|
|
|
36
39
|
},
|
|
37
40
|
"homepage": "https://agentteams.run",
|
|
38
41
|
"engines": {
|
|
39
|
-
"node": ">=
|
|
42
|
+
"node": ">=20.12.0"
|
|
40
43
|
},
|
|
41
44
|
"dependencies": {
|
|
45
|
+
"@agentteams/context-tools": "0.1.0",
|
|
42
46
|
"@clack/prompts": "^1.4.0",
|
|
47
|
+
"@modelcontextprotocol/server": "2.0.0-beta.5",
|
|
43
48
|
"axios": "^1.16.1",
|
|
44
49
|
"chalk": "^5.6.2",
|
|
45
50
|
"commander": "^12.1.0",
|
|
46
51
|
"diff": "^8.0.4",
|
|
47
52
|
"gray-matter": "^4.0.3",
|
|
48
53
|
"open": "^10.1.0",
|
|
49
|
-
"ora": "^9.4.0"
|
|
54
|
+
"ora": "^9.4.0",
|
|
55
|
+
"zod": "4.4.3"
|
|
50
56
|
},
|
|
51
57
|
"devDependencies": {
|
|
52
58
|
"@eslint/js": "^9.39.4",
|