create-agentmark 0.10.8 → 1.0.1

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.d.ts CHANGED
@@ -1,2 +1,106 @@
1
+ /**
2
+ * Shared MCP-config builder for the scaffolders.
3
+ *
4
+ * Writes the project-local IDE config (mcp.json / settings.json) for
5
+ * the four supported clients. Every scaffolded project gets THREE
6
+ * MCP servers wired up by default:
7
+ *
8
+ * 1. `agentmark-docs` (remote HTTP) — read-only docs / reference,
9
+ * hosted at `https://docs.agentmark.co/mcp`.
10
+ *
11
+ * 2. `agentmark` (stdio, `@agentmark-ai/mcp-server`) — AgentMark
12
+ * Cloud surface. Defaults to `https://api.agentmark.co`; pass a
13
+ * custom URL via `customApiUrl` (the undocumented `--api-url`
14
+ * flag on the CLI) to point at a non-prod gateway (staging,
15
+ * self-hosted).
16
+ *
17
+ * 3. `agentmark-local` (stdio, `@agentmark-ai/mcp-server`) — the
18
+ * same MCP binary, pointed at the local `agentmark dev` server
19
+ * (`http://localhost:9418`). The local dev server serves the
20
+ * same OpenAPI contract under `/v1/openapi.json`, so the same
21
+ * tool surface (`list_traces`, `get_trace`, …) is available
22
+ * against local SQLite traces.
23
+ *
24
+ * Why both `agentmark` and `agentmark-local`: workflows like "pull
25
+ * failing traces from AgentMark Cloud, fix locally, re-verify against
26
+ * `agentmark dev` traces" need BOTH endpoints reachable in the same
27
+ * conversation. MCP clients namespace tools by server name, so the
28
+ * agent calls `agentmark/list_traces` for cloud and
29
+ * `agentmark-local/list_traces` for local — same tool, explicit
30
+ * destination.
31
+ *
32
+ * Auth chain is endpoint-agnostic:
33
+ *
34
+ * - `AGENTMARK_API_KEY` env (CI / dedicated agents) wins
35
+ * - falls back to `~/.agentmark/auth.json` from
36
+ * `agentmark login [--base-url <matching-endpoint>]`
37
+ * - local dev calls are unauthenticated by design (the local dev
38
+ * server doesn't validate auth headers)
39
+ *
40
+ * Shell `export AGENTMARK_API_URL=…` still wins at runtime when the
41
+ * IDE inherits the shell — what we write here is the default for
42
+ * cold-launched IDEs.
43
+ */
44
+ type McpClient = "vscode" | "zed" | "cursor" | "claude-code" | "skip";
1
45
 
2
- export { }
46
+ /**
47
+ * `npm create agentmark` — minimal init.
48
+ *
49
+ * Scope is deliberately small. The CLI does NOT scaffold example code,
50
+ * pick an LLM adapter, or handle login. Its job is:
51
+ *
52
+ * 1. Write `agentmark.json` (the SDK loader's config root)
53
+ * 2. Create an empty `agentmark/` directory (where prompts go)
54
+ * 3. Wire MCP configs for any IDE clients the user selects
55
+ * 4. Install the AgentMark agent skill (`npx skills add agentmark-ai/skills`)
56
+ * 5. Hand off to the AI tool: "Open Claude Code / Cursor and say:
57
+ * Set up AgentMark in this project."
58
+ *
59
+ * Everything else — framework detection, package install, code wiring,
60
+ * first prompt — is the job of the `setup-and-integration` skill workflow,
61
+ * which runs inside the user's IDE agent. That keeps integration adaptive
62
+ * to whatever stack the user already has, instead of forcing a template.
63
+ */
64
+ interface CliArgs {
65
+ path?: string;
66
+ clients?: McpClient[];
67
+ /**
68
+ * Undocumented escape hatch for internal staging
69
+ * (`https://api-stg.agentmark.co`) and rare self-hosters. Defaults to
70
+ * `https://api.agentmark.co`. The `agentmark-local` MCP entry always
71
+ * points at `http://localhost:9418` regardless of this flag.
72
+ */
73
+ apiUrl?: string;
74
+ overwrite?: boolean;
75
+ }
76
+ declare const ALL_CLIENTS: readonly McpClient[];
77
+ declare const AGENTMARK_JSON: Record<string, unknown>;
78
+ declare const parseArgs: (argv?: string[]) => CliArgs;
79
+ declare const clientLabel: (id: string) => string;
80
+ /**
81
+ * Resolves the target folder via positional/flag arg or interactive prompt.
82
+ * Default to "." when cwd looks like an existing project (the common case
83
+ * for "wire AgentMark into my repo"); fall back to a fresh folder name when
84
+ * cwd is empty (the greenfield case).
85
+ */
86
+ declare const resolveTargetPath: (cliPath: string | undefined) => Promise<{
87
+ targetPath: string;
88
+ isCurrentDir: boolean;
89
+ } | null>;
90
+ /**
91
+ * Resolves which IDE clients to wire MCP into. All 4 are pre-selected on
92
+ * the prompt so the typical "I use everything" case is one keystroke
93
+ * (Enter). Empty selection is equivalent to the old "Skip" option — the
94
+ * caller just writes nothing.
95
+ */
96
+ declare const resolveClients: (cliClients: McpClient[] | undefined) => Promise<McpClient[]>;
97
+ /**
98
+ * agentmark.json is the only file we conflict on (the others — MCP config
99
+ * dirs, agentmark/, .gitkeep — are either additive or no-ops if present).
100
+ * Default to "skip" so we never silently clobber an existing project's
101
+ * config; `--overwrite` is the explicit opt-in for re-init scripts.
102
+ */
103
+ declare const shouldWriteAgentmarkJson: (filePath: string, overwrite: boolean | undefined) => Promise<boolean>;
104
+ declare const main: () => Promise<void>;
105
+
106
+ export { AGENTMARK_JSON, ALL_CLIENTS, type CliArgs, clientLabel, main, parseArgs, resolveClients, resolveTargetPath, shouldWriteAgentmarkJson };