aimeat 2.6.1 → 2.7.0
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/README.md +57 -0
- package/dist/build-stamp.json +4 -4
- package/dist/public/changelog.json +13 -0
- package/dist/src/cli/connect/clients/claude.d.ts +22 -0
- package/dist/src/cli/connect/clients/claude.d.ts.map +1 -0
- package/dist/src/cli/connect/clients/claude.js +105 -0
- package/dist/src/cli/connect/clients/claude.js.map +1 -0
- package/dist/src/cli/connect/clients/cursor-vscode.d.ts +17 -0
- package/dist/src/cli/connect/clients/cursor-vscode.d.ts.map +1 -0
- package/dist/src/cli/connect/clients/cursor-vscode.js +88 -0
- package/dist/src/cli/connect/clients/cursor-vscode.js.map +1 -0
- package/dist/src/cli/connect/clients/fs-merge.d.ts +35 -0
- package/dist/src/cli/connect/clients/fs-merge.d.ts.map +1 -0
- package/dist/src/cli/connect/clients/fs-merge.js +87 -0
- package/dist/src/cli/connect/clients/fs-merge.js.map +1 -0
- package/dist/src/cli/connect/clients/goose.d.ts +15 -0
- package/dist/src/cli/connect/clients/goose.d.ts.map +1 -0
- package/dist/src/cli/connect/clients/goose.js +67 -0
- package/dist/src/cli/connect/clients/goose.js.map +1 -0
- package/dist/src/cli/connect/clients/index.d.ts +23 -0
- package/dist/src/cli/connect/clients/index.d.ts.map +1 -0
- package/dist/src/cli/connect/clients/index.js +148 -0
- package/dist/src/cli/connect/clients/index.js.map +1 -0
- package/dist/src/cli/connect/clients/launcher.d.ts +33 -0
- package/dist/src/cli/connect/clients/launcher.d.ts.map +1 -0
- package/dist/src/cli/connect/clients/launcher.js +94 -0
- package/dist/src/cli/connect/clients/launcher.js.map +1 -0
- package/dist/src/cli/connect/clients/types.d.ts +63 -0
- package/dist/src/cli/connect/clients/types.d.ts.map +1 -0
- package/dist/src/cli/connect/clients/types.js +16 -0
- package/dist/src/cli/connect/clients/types.js.map +1 -0
- package/dist/src/generated/api-types.d.ts +117 -3
- package/dist/src/generated/api-types.d.ts.map +1 -1
- package/dist/src/index-connect.d.ts.map +1 -1
- package/dist/src/index-connect.js +4 -0
- package/dist/src/index-connect.js.map +1 -1
- package/dist/src/index-help.d.ts +2 -2
- package/dist/src/index-help.d.ts.map +1 -1
- package/dist/src/index-help.js +16 -0
- package/dist/src/index-help.js.map +1 -1
- package/dist/src/routes/workflows.d.ts.map +1 -1
- package/dist/src/routes/workflows.js +25 -0
- package/dist/src/routes/workflows.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file index.ts
|
|
3
|
+
* @description `aimeat connect client <id>` — one command that points a chat client at this node:
|
|
4
|
+
* it authorizes a dedicated agent into its own connector home, writes the client's MCP config,
|
|
5
|
+
* and leaves a launcher that supplies the token at run time. The point is that talking to AIMEAT
|
|
6
|
+
* from a client of your choice should be one command, not a page of manual steps.
|
|
7
|
+
* @structure
|
|
8
|
+
* - CLIENTS — the adapter registry (goose, claude-code, cursor, vscode, claude-desktop).
|
|
9
|
+
* - runConnectClient() — resolve client, ensure credential, apply adapter, report.
|
|
10
|
+
* - resolveTarget() — flags + defaults into a ClientTarget (home, workdir, server name, surface).
|
|
11
|
+
* @usage Dispatched from src/index-connect.ts on `aimeat connect client <id> [flags]`.
|
|
12
|
+
* @version-history
|
|
13
|
+
* v1.0.0 — 2026-08-02 — Initial creation: one-command client connect.
|
|
14
|
+
*/
|
|
15
|
+
import { existsSync, mkdirSync, readdirSync } from 'node:fs';
|
|
16
|
+
import { homedir } from 'node:os';
|
|
17
|
+
import { join } from 'node:path';
|
|
18
|
+
import { gooseAdapter } from './goose.js';
|
|
19
|
+
import { cursorAdapter, vscodeAdapter } from './cursor-vscode.js';
|
|
20
|
+
import { claudeCodeAdapter, claudeDesktopAdapter } from './claude.js';
|
|
21
|
+
export const CLIENTS = [
|
|
22
|
+
gooseAdapter, claudeCodeAdapter, cursorAdapter, vscodeAdapter, claudeDesktopAdapter,
|
|
23
|
+
];
|
|
24
|
+
const DEFAULT_NODE_URL = 'https://aimeat.io';
|
|
25
|
+
const SURFACES = ['appdev', 'agent', 'service', 'admin'];
|
|
26
|
+
/** Strip a trailing slash so `${nodeUrl}/v1/mcp` never doubles it. */
|
|
27
|
+
function normalizeUrl(url) {
|
|
28
|
+
return url.replace(/\/+$/, '');
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Each client gets its OWN connector home holding exactly one agent. Two reasons, both learned the
|
|
32
|
+
* hard way: a home with two credentials makes every tool call demand an `agent_name`, and sharing a
|
|
33
|
+
* home with an existing fleet means one client's re-auth can disturb agents it knows nothing about.
|
|
34
|
+
*/
|
|
35
|
+
function defaultHome(clientId) {
|
|
36
|
+
return join(homedir(), `.aimeat-${clientId}`);
|
|
37
|
+
}
|
|
38
|
+
/** The agent writes files where it is launched, so give it somewhere that is not a source repo. */
|
|
39
|
+
function defaultWorkdir() {
|
|
40
|
+
return join(homedir(), 'aimeat-work');
|
|
41
|
+
}
|
|
42
|
+
function tokenFileIn(home) {
|
|
43
|
+
const dir = join(home, 'tokens');
|
|
44
|
+
if (!existsSync(dir))
|
|
45
|
+
return null;
|
|
46
|
+
const file = readdirSync(dir).find((n) => n.endsWith('.token'));
|
|
47
|
+
return file ? join(dir, file) : null;
|
|
48
|
+
}
|
|
49
|
+
function resolveTarget(client, flags) {
|
|
50
|
+
const nodeUrl = normalizeUrl(flags.url ?? DEFAULT_NODE_URL);
|
|
51
|
+
const home = flags.home ?? defaultHome(client.id);
|
|
52
|
+
const agent = flags.agent ?? client.id;
|
|
53
|
+
const surface = SURFACES.includes(flags.surface)
|
|
54
|
+
? flags.surface
|
|
55
|
+
: undefined;
|
|
56
|
+
return {
|
|
57
|
+
nodeUrl,
|
|
58
|
+
mcpUrl: `${nodeUrl}/v1/mcp`,
|
|
59
|
+
agent,
|
|
60
|
+
owner: flags.owner ?? '',
|
|
61
|
+
home,
|
|
62
|
+
tokenFile: tokenFileIn(home) ?? join(home, 'tokens', `${agent}@${flags.owner ?? 'owner'}.token`),
|
|
63
|
+
serverName: flags.name ?? 'aimeat',
|
|
64
|
+
workdir: flags.workdir ?? defaultWorkdir(),
|
|
65
|
+
surface,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
function usage() {
|
|
69
|
+
const ids = CLIENTS.map((c) => c.id).join(' | ');
|
|
70
|
+
return [
|
|
71
|
+
`Usage: aimeat connect client <${ids}> [options]`,
|
|
72
|
+
'',
|
|
73
|
+
' --url <node-url> AIMEAT node (default https://aimeat.io)',
|
|
74
|
+
' --owner <handle> Your owner handle (prompted when omitted)',
|
|
75
|
+
' --agent <name> Agent name to create (default: the client id)',
|
|
76
|
+
' --workdir <path> Where the client starts (default ~/aimeat-work)',
|
|
77
|
+
' --home <path> Connector home for this client (default ~/.aimeat-<client>)',
|
|
78
|
+
' --surface <role> appdev | agent | service | admin (default: the full toolset)',
|
|
79
|
+
' --name <server> Name the MCP server gets in the client config (default: aimeat)',
|
|
80
|
+
' --reuse Skip device authorization and use the credential already in --home',
|
|
81
|
+
].join('\n');
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Run the one-command connect. Device authorization happens FIRST and inside the client's own
|
|
85
|
+
* home, so a failed or cancelled login never leaves a config pointing at an agent that does not
|
|
86
|
+
* exist.
|
|
87
|
+
*/
|
|
88
|
+
export async function runConnectClient(clientId, flags) {
|
|
89
|
+
if (!clientId || clientId === 'help' || flags.help === 'true') {
|
|
90
|
+
console.log(usage());
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const client = CLIENTS.find((c) => c.id === clientId);
|
|
94
|
+
if (!client) {
|
|
95
|
+
console.error(`Unknown client "${clientId}".`);
|
|
96
|
+
console.error(usage());
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
const target = resolveTarget(client, flags);
|
|
100
|
+
if (!existsSync(target.home))
|
|
101
|
+
mkdirSync(target.home, { recursive: true });
|
|
102
|
+
// config.ts captures AIMEAT_HOME at module load, so it must be set before anything under
|
|
103
|
+
// connect/ is imported — hence the dynamic imports below.
|
|
104
|
+
process.env.AIMEAT_HOME = target.home;
|
|
105
|
+
const existingToken = tokenFileIn(target.home);
|
|
106
|
+
if (existingToken && flags.reuse !== 'true') {
|
|
107
|
+
console.log(`An agent credential already exists in ${target.home}.`);
|
|
108
|
+
console.log('Reusing it. Pass --reuse to silence this, or --home <path> to authorize a separate one.\n');
|
|
109
|
+
}
|
|
110
|
+
if (!existingToken) {
|
|
111
|
+
const { runAuth } = await import('../auth.js');
|
|
112
|
+
await runAuth({ url: target.nodeUrl, owner: flags.owner, agent: target.agent });
|
|
113
|
+
}
|
|
114
|
+
const token = tokenFileIn(target.home);
|
|
115
|
+
if (!token) {
|
|
116
|
+
console.error('\nNo credential was stored, so nothing was written to the client config.');
|
|
117
|
+
console.error('Re-run once the device authorization completes.');
|
|
118
|
+
process.exit(1);
|
|
119
|
+
}
|
|
120
|
+
target.tokenFile = token;
|
|
121
|
+
// `{agent}@{owner}.token` — split on the FIRST '@' so an owner handle containing one survives.
|
|
122
|
+
const stem = token.split(/[\\/]/).pop().replace(/\.token$/, '');
|
|
123
|
+
const at = stem.indexOf('@');
|
|
124
|
+
if (at > 0) {
|
|
125
|
+
target.agent = stem.slice(0, at);
|
|
126
|
+
target.owner = stem.slice(at + 1);
|
|
127
|
+
}
|
|
128
|
+
const result = await client.apply(target);
|
|
129
|
+
console.log('');
|
|
130
|
+
console.log(`${client.label} is connected to ${target.nodeUrl} as ${target.agent}@${target.owner}.`);
|
|
131
|
+
console.log(` MCP endpoint : ${client.transport === 'http' ? target.mcpUrl : 'local connector (stdio)'}`);
|
|
132
|
+
console.log(` Tool surface : ${target.surface ?? 'full'}`);
|
|
133
|
+
console.log(` Working dir : ${target.workdir}`);
|
|
134
|
+
for (const f of result.written)
|
|
135
|
+
console.log(` wrote : ${f}`);
|
|
136
|
+
for (const b of result.backedUp)
|
|
137
|
+
console.log(` backup : ${b}`);
|
|
138
|
+
if (result.manual) {
|
|
139
|
+
console.log('');
|
|
140
|
+
console.log(result.manual);
|
|
141
|
+
}
|
|
142
|
+
if (result.nextSteps.length) {
|
|
143
|
+
console.log('');
|
|
144
|
+
for (const line of result.nextSteps)
|
|
145
|
+
console.log(` ${line}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/cli/connect/clients/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEtE,MAAM,CAAC,MAAM,OAAO,GAAoB;IACpC,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB;CACtF,CAAC;AAEF,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAC7C,MAAM,QAAQ,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAElE,sEAAsE;AACtE,SAAS,YAAY,CAAC,GAAW;IAC7B,OAAO,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,QAAgB;IACjC,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,QAAQ,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,mGAAmG;AACnG,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C1B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,SAAS;YAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAClE,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file launcher.ts
|
|
3
|
+
* @description Generates the two small scripts a connected client needs, so a token never has to
|
|
4
|
+
* live inside a config file: a LAUNCHER that exports the agent token and starts the client in a
|
|
5
|
+
* sane working directory, and a HEADERS HELPER that prints an Authorization header on stdout for
|
|
6
|
+
* clients that can call one (Claude Code's `headersHelper`).
|
|
7
|
+
* @structure
|
|
8
|
+
* - writeLauncher() — `<home>/launch-<client>.ps1` + `.sh`, chmod +x on POSIX.
|
|
9
|
+
* - writeHeadersHelper() — `<home>/auth-header.ps1` + `.sh`, prints `Authorization: Bearer <token>`.
|
|
10
|
+
* @usage Called by clients/*.ts via the shared connect flow.
|
|
11
|
+
* @version-history
|
|
12
|
+
* v1.0.0 — 2026-08-02 — Initial creation: one-command client connect.
|
|
13
|
+
*/
|
|
14
|
+
import type { ClientTarget } from './types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Write the launcher pair for one client. The launcher reads the token from the connector home at
|
|
17
|
+
* run time (so a re-authenticated agent is picked up with no config edit), sets the working
|
|
18
|
+
* directory, and execs the client's own command.
|
|
19
|
+
*
|
|
20
|
+
* Returns the path of the script that is actually usable on this platform first.
|
|
21
|
+
*/
|
|
22
|
+
export declare function writeLauncher(target: ClientTarget, clientId: string, command: string, args?: string[]): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Write the headers-helper pair. Claude Code runs this at connection time and merges its stdout
|
|
25
|
+
* into the request headers, which keeps the token out of ~/.claude.json entirely and picks up a
|
|
26
|
+
* refreshed token automatically.
|
|
27
|
+
*/
|
|
28
|
+
export declare function writeHeadersHelper(target: ClientTarget): {
|
|
29
|
+
ps1: string;
|
|
30
|
+
sh: string;
|
|
31
|
+
preferred: string;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=launcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../../../../../src/cli/connect/clients/launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,EAAO,GAAG,MAAM,EAAE,CAsCpH;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAwBvG"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file launcher.ts
|
|
3
|
+
* @description Generates the two small scripts a connected client needs, so a token never has to
|
|
4
|
+
* live inside a config file: a LAUNCHER that exports the agent token and starts the client in a
|
|
5
|
+
* sane working directory, and a HEADERS HELPER that prints an Authorization header on stdout for
|
|
6
|
+
* clients that can call one (Claude Code's `headersHelper`).
|
|
7
|
+
* @structure
|
|
8
|
+
* - writeLauncher() — `<home>/launch-<client>.ps1` + `.sh`, chmod +x on POSIX.
|
|
9
|
+
* - writeHeadersHelper() — `<home>/auth-header.ps1` + `.sh`, prints `Authorization: Bearer <token>`.
|
|
10
|
+
* @usage Called by clients/*.ts via the shared connect flow.
|
|
11
|
+
* @version-history
|
|
12
|
+
* v1.0.0 — 2026-08-02 — Initial creation: one-command client connect.
|
|
13
|
+
*/
|
|
14
|
+
import { chmodSync, writeFileSync } from 'node:fs';
|
|
15
|
+
import { join } from 'node:path';
|
|
16
|
+
/** True on Windows, where the .ps1 variant is the one that gets used. */
|
|
17
|
+
const isWindows = process.platform === 'win32';
|
|
18
|
+
/**
|
|
19
|
+
* Write the launcher pair for one client. The launcher reads the token from the connector home at
|
|
20
|
+
* run time (so a re-authenticated agent is picked up with no config edit), sets the working
|
|
21
|
+
* directory, and execs the client's own command.
|
|
22
|
+
*
|
|
23
|
+
* Returns the path of the script that is actually usable on this platform first.
|
|
24
|
+
*/
|
|
25
|
+
export function writeLauncher(target, clientId, command, args = []) {
|
|
26
|
+
const argLine = args.length ? ` ${args.join(' ')}` : '';
|
|
27
|
+
const ps1 = join(target.home, `launch-${clientId}.ps1`);
|
|
28
|
+
const sh = join(target.home, `launch-${clientId}.sh`);
|
|
29
|
+
writeFileSync(ps1, [
|
|
30
|
+
`# Starts ${clientId} with the AIMEAT agent "${target.agent}@${target.owner}" attached.`,
|
|
31
|
+
`# Generated by: aimeat connect client ${clientId}`,
|
|
32
|
+
`$ErrorActionPreference = 'Stop'`,
|
|
33
|
+
`$env:AIMEAT_HOME = '${target.home}'`,
|
|
34
|
+
`$tokenFile = '${target.tokenFile}'`,
|
|
35
|
+
`if (-not (Test-Path $tokenFile)) { Write-Error "No token at $tokenFile. Run: aimeat connect client ${clientId}"; exit 1 }`,
|
|
36
|
+
`$env:AIMEAT_AGENT_TOKEN = (Get-Content $tokenFile -Raw).Trim()`,
|
|
37
|
+
`$workdir = '${target.workdir}'`,
|
|
38
|
+
`if (-not (Test-Path $workdir)) { New-Item -ItemType Directory -Force $workdir | Out-Null }`,
|
|
39
|
+
`Set-Location $workdir`,
|
|
40
|
+
`${command}${argLine} @args`,
|
|
41
|
+
'',
|
|
42
|
+
].join('\r\n'), 'utf8');
|
|
43
|
+
writeFileSync(sh, [
|
|
44
|
+
'#!/usr/bin/env bash',
|
|
45
|
+
`# Starts ${clientId} with the AIMEAT agent "${target.agent}@${target.owner}" attached.`,
|
|
46
|
+
`# Generated by: aimeat connect client ${clientId}`,
|
|
47
|
+
'set -euo pipefail',
|
|
48
|
+
`export AIMEAT_HOME="${target.home.replace(/\\/g, '/')}"`,
|
|
49
|
+
`TOKEN_FILE="${target.tokenFile.replace(/\\/g, '/')}"`,
|
|
50
|
+
`[ -f "$TOKEN_FILE" ] || { echo "No token at $TOKEN_FILE. Run: aimeat connect client ${clientId}" >&2; exit 1; }`,
|
|
51
|
+
'export AIMEAT_AGENT_TOKEN="$(tr -d "\\r\\n" < "$TOKEN_FILE")"',
|
|
52
|
+
`mkdir -p "${target.workdir.replace(/\\/g, '/')}"`,
|
|
53
|
+
`cd "${target.workdir.replace(/\\/g, '/')}"`,
|
|
54
|
+
`exec ${command}${argLine} "$@"`,
|
|
55
|
+
'',
|
|
56
|
+
].join('\n'), 'utf8');
|
|
57
|
+
// eslint-disable-next-line aimeat/no-silent-catch -- Windows has no exec bit; the .ps1 is the usable script there and a failed chmod changes nothing.
|
|
58
|
+
try {
|
|
59
|
+
chmodSync(sh, 0o755);
|
|
60
|
+
}
|
|
61
|
+
catch { /* no exec bit on this platform */ }
|
|
62
|
+
return isWindows ? [ps1, sh] : [sh, ps1];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Write the headers-helper pair. Claude Code runs this at connection time and merges its stdout
|
|
66
|
+
* into the request headers, which keeps the token out of ~/.claude.json entirely and picks up a
|
|
67
|
+
* refreshed token automatically.
|
|
68
|
+
*/
|
|
69
|
+
export function writeHeadersHelper(target) {
|
|
70
|
+
const ps1 = join(target.home, 'auth-header.ps1');
|
|
71
|
+
const sh = join(target.home, 'auth-header.sh');
|
|
72
|
+
writeFileSync(ps1, [
|
|
73
|
+
'# Prints the AIMEAT Authorization header for an MCP client that asks for one.',
|
|
74
|
+
'# Generated by: aimeat connect client',
|
|
75
|
+
`$t = (Get-Content '${target.tokenFile}' -Raw).Trim()`,
|
|
76
|
+
`Write-Output "Authorization: Bearer $t"`,
|
|
77
|
+
'',
|
|
78
|
+
].join('\r\n'), 'utf8');
|
|
79
|
+
writeFileSync(sh, [
|
|
80
|
+
'#!/usr/bin/env bash',
|
|
81
|
+
'# Prints the AIMEAT Authorization header for an MCP client that asks for one.',
|
|
82
|
+
'# Generated by: aimeat connect client',
|
|
83
|
+
'set -euo pipefail',
|
|
84
|
+
`echo "Authorization: Bearer $(tr -d '\\r\\n' < "${target.tokenFile.replace(/\\/g, '/')}")"`,
|
|
85
|
+
'',
|
|
86
|
+
].join('\n'), 'utf8');
|
|
87
|
+
// eslint-disable-next-line aimeat/no-silent-catch -- same as above: no exec bit on Windows, the .ps1 variant is what gets used.
|
|
88
|
+
try {
|
|
89
|
+
chmodSync(sh, 0o755);
|
|
90
|
+
}
|
|
91
|
+
catch { /* no exec bit on this platform */ }
|
|
92
|
+
return { ps1, sh, preferred: isWindows ? ps1 : sh };
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../../../../../src/cli/connect/clients/launcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,yEAAyE;AACzE,MAAM,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,MAAoB,EAAE,QAAgB,EAAE,OAAe,EAAE,OAAiB,EAAE;IACtG,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,QAAQ,MAAM,CAAC,CAAC;IACxD,MAAM,EAAE,GAAG,IAAI,CAAC,M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MAAM,CAAC,CAAC,kCAAkC,CAAC,CAAC;IAC1E,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;AAC7C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAoB;IACnD,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,iBAAiB,CAAC,CAAC;IACjD,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAE/C,aAAa,CAAC,GAAG,EAAE;QACf,+EAA+E;QAC/E,uCAAuC;QACvC,sBAAsB,MAAM,CAAC,SAAS,gBAAgB;QACtD,yCAAyC;QACzC,EAAE;KACL,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAExB,aAAa,CAAC,EAAE,EAAE;QACd,qBAAqB;QACrB,+EAA+E;QAC/E,uCAAuC;QACvC,mBAAmB;QACnB,mDAAmD,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,KAAK;QAC5F,EAAE;KACL,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;IAEtB,gIAAgI;IAChI,IAAI,CAAC;QAAC,SAAS,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAAC,CAAC;IAAC,MAAM,CAAC,CAAC,kCAAkC,CAAC,CAAC;IAC1E,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACxD,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types.ts
|
|
3
|
+
* @description Shared contract for `aimeat connect client <id>` — the one command that points a
|
|
4
|
+
* chat client (Goose, Claude Code, Cursor, VS Code, Claude Desktop) at this node's MCP surface.
|
|
5
|
+
* Each client is one adapter: where its config lives, how an MCP server is spelled in it, and how
|
|
6
|
+
* its user launches it afterwards.
|
|
7
|
+
* @structure
|
|
8
|
+
* - ClientTarget — the resolved node + agent a client is being pointed at.
|
|
9
|
+
* - WriteResult — what the adapter did, so the caller can report it truthfully.
|
|
10
|
+
* - ClientAdapter — the per-client contract (id, label, configPath, apply, launchHint).
|
|
11
|
+
* @usage Implemented by clients/goose.ts, claude-code.ts, cursor.ts, vscode.ts, claude-desktop.ts.
|
|
12
|
+
* @version-history
|
|
13
|
+
* v1.0.0 — 2026-08-02 — Initial creation: one-command client connect.
|
|
14
|
+
*/
|
|
15
|
+
/** The node + agent identity a client is being connected to. */
|
|
16
|
+
export interface ClientTarget {
|
|
17
|
+
/** Node base URL, e.g. `https://aimeat.io` (no trailing slash). */
|
|
18
|
+
nodeUrl: string;
|
|
19
|
+
/** Streamable-HTTP MCP endpoint, e.g. `https://aimeat.io/v1/mcp`. */
|
|
20
|
+
mcpUrl: string;
|
|
21
|
+
/** Agent name inside the dedicated connector home, e.g. `goose`. */
|
|
22
|
+
agent: string;
|
|
23
|
+
/** Owner handle the agent belongs to. */
|
|
24
|
+
owner: string;
|
|
25
|
+
/** Dedicated connector home holding exactly this one agent's credential. */
|
|
26
|
+
home: string;
|
|
27
|
+
/** Absolute path to the agent's token file inside `home`. */
|
|
28
|
+
tokenFile: string;
|
|
29
|
+
/**
|
|
30
|
+
* Name the MCP server gets in the client's config. Defaults to `aimeat`; a second node
|
|
31
|
+
* is connected as `aimeat-<something>` so the two never overwrite each other.
|
|
32
|
+
*/
|
|
33
|
+
serverName: string;
|
|
34
|
+
/** Working directory the client should start in (agents write files where they are launched). */
|
|
35
|
+
workdir: string;
|
|
36
|
+
/** Optional purpose-scoped surface. Undefined = the full toolset. */
|
|
37
|
+
surface?: 'appdev' | 'agent' | 'service' | 'admin';
|
|
38
|
+
}
|
|
39
|
+
/** What an adapter actually did — the caller reports these, it never assumes. */
|
|
40
|
+
export interface WriteResult {
|
|
41
|
+
/** Files created or modified, absolute paths. */
|
|
42
|
+
written: string[];
|
|
43
|
+
/** Backup copies taken before modifying an existing file. */
|
|
44
|
+
backedUp: string[];
|
|
45
|
+
/** Lines to print under "next steps", already client-specific. */
|
|
46
|
+
nextSteps: string[];
|
|
47
|
+
/** Set when the adapter could not write and the user must act manually. */
|
|
48
|
+
manual?: string;
|
|
49
|
+
}
|
|
50
|
+
/** One chat client's integration. */
|
|
51
|
+
export interface ClientAdapter {
|
|
52
|
+
/** Stable id used on the command line, e.g. `goose`. */
|
|
53
|
+
id: string;
|
|
54
|
+
/** Human label for output, e.g. `Goose`. */
|
|
55
|
+
label: string;
|
|
56
|
+
/** Transport this client uses to reach the node. */
|
|
57
|
+
transport: 'http' | 'stdio';
|
|
58
|
+
/** Where this client keeps the config we edit, on the current platform. */
|
|
59
|
+
configPath(): string;
|
|
60
|
+
/** Point the client at the node. Must merge, never clobber other servers. */
|
|
61
|
+
apply(target: ClientTarget): Promise<WriteResult>;
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/cli/connect/clients/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,gEAAgE;AAChE,MAAM,WAAW,YAAY;IACzB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,KAAK,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,iGAAiG;IACjG,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,OAAO,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;CACtD;AAED,iFAAiF;AACjF,MAAM,WAAW,WAAW;IACxB,iDAAiD;IACjD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,kEAAkE;IAClE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC1B,wDAAwD;IACxD,EAAE,EAAE,MAAM,CAAC;IACX,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,2EAA2E;IAC3E,UAAU,IAAI,MAAM,CAAC;IACrB,6EAA6E;IAC7E,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file types.ts
|
|
3
|
+
* @description Shared contract for `aimeat connect client <id>` — the one command that points a
|
|
4
|
+
* chat client (Goose, Claude Code, Cursor, VS Code, Claude Desktop) at this node's MCP surface.
|
|
5
|
+
* Each client is one adapter: where its config lives, how an MCP server is spelled in it, and how
|
|
6
|
+
* its user launches it afterwards.
|
|
7
|
+
* @structure
|
|
8
|
+
* - ClientTarget — the resolved node + agent a client is being pointed at.
|
|
9
|
+
* - WriteResult — what the adapter did, so the caller can report it truthfully.
|
|
10
|
+
* - ClientAdapter — the per-client contract (id, label, configPath, apply, launchHint).
|
|
11
|
+
* @usage Implemented by clients/goose.ts, claude-code.ts, cursor.ts, vscode.ts, claude-desktop.ts.
|
|
12
|
+
* @version-history
|
|
13
|
+
* v1.0.0 — 2026-08-02 — Initial creation: one-command client connect.
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/cli/connect/clients/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG"}
|
|
@@ -2321,6 +2321,7 @@ export interface paths {
|
|
|
2321
2321
|
* @description PROVENANCE VISIBILITY FOLLOWS THE CONTENT. A record resolves for anyone - anonymous callers included - exactly while some item pointing at it is itself publicly readable: a public memory record (which is how workspace records, agent faces and WebMCP manifests are stored too) or a published, unparked, unhidden, code-free app. Publish the content and the record resolves; make it private again and this returns to the identical 404, with nothing to remember to do. There is no stored visibility flag on the record and no way for a caller to set one. The owner can always resolve their own records.
|
|
2322
2322
|
* Returns an IDENTICAL 404 for "no such record", "that record is not yours" and "its content is not public" - different answers would turn this into an oracle for which ids exist on this node.
|
|
2323
2323
|
* `AIMEAT_AI_PROVENANCE_DETAIL=minimal` reduces what a NON-owner is served to the four required fields plus the disclosure block. It never reduces what is stored, and the owner always sees the whole record.
|
|
2324
|
+
* CONTENT NEGOTIATED. A visible AI label's "how this was made" link lands here, so a PERSON arrives at this URL. A client that ranks `text/html` above `application/json` - a browser - gets a readable page carrying the record's own disclosure sentence, its fields, the content fingerprint and the correction route. Everything else, including curl, `fetch()` and agents, gets the JSON below unchanged. The 404 is identical in both formats for the same three cases; the HTML variant takes no argument about the record and so has nothing to differ on.
|
|
2324
2325
|
*/
|
|
2325
2326
|
get: operations["aiProvenanceResolve"];
|
|
2326
2327
|
put?: never;
|
|
@@ -15008,6 +15009,30 @@ export interface paths {
|
|
|
15008
15009
|
patch?: never;
|
|
15009
15010
|
trace?: never;
|
|
15010
15011
|
};
|
|
15012
|
+
"/v1/connections/publish": {
|
|
15013
|
+
parameters: {
|
|
15014
|
+
query?: never;
|
|
15015
|
+
header?: never;
|
|
15016
|
+
path?: never;
|
|
15017
|
+
cookie?: never;
|
|
15018
|
+
};
|
|
15019
|
+
get?: never;
|
|
15020
|
+
put?: never;
|
|
15021
|
+
/**
|
|
15022
|
+
* Publish to a connected account
|
|
15023
|
+
* @description Two ways in. `connection_id` publishes to an account the CALLER connected, which needs no delegation because the publisher and the account holder are the same person. `app_id` + `action` publishes through a delegation an app owner granted over a shared channel.
|
|
15024
|
+
*
|
|
15025
|
+
* The attempt is recorded BEFORE anything leaves the node, keyed by a hash of publisher, connection, file and caption. A repeat of the same request returns the FIRST attempt's outcome with `replay: true` and starts no second publish.
|
|
15026
|
+
*
|
|
15027
|
+
* Two 200 responses are waiting states rather than successes: `held` is moderation and `queued` is a spent provider allowance. Neither is an error, because reporting them as one teaches a caller to retry, and retrying makes both worse.
|
|
15028
|
+
*/
|
|
15029
|
+
post: operations["publishToConnection"];
|
|
15030
|
+
delete?: never;
|
|
15031
|
+
options?: never;
|
|
15032
|
+
head?: never;
|
|
15033
|
+
patch?: never;
|
|
15034
|
+
trace?: never;
|
|
15035
|
+
};
|
|
15011
15036
|
"/v1/connections/callback": {
|
|
15012
15037
|
parameters: {
|
|
15013
15038
|
query?: never;
|
|
@@ -18782,6 +18807,10 @@ export interface components {
|
|
|
18782
18807
|
provider?: string;
|
|
18783
18808
|
/** @description For synthesized content, where the material came from. */
|
|
18784
18809
|
sources?: {
|
|
18810
|
+
/**
|
|
18811
|
+
* Format: uri
|
|
18812
|
+
* @description http or https ONLY, checked at the door. A declaration carrying any other scheme is refused with a validation error rather than minted.
|
|
18813
|
+
*/
|
|
18785
18814
|
url: string;
|
|
18786
18815
|
title?: string;
|
|
18787
18816
|
/** Format: date-time */
|
|
@@ -18840,7 +18869,10 @@ export interface components {
|
|
|
18840
18869
|
upstreamMarks?: "yes" | "no" | "unknown";
|
|
18841
18870
|
};
|
|
18842
18871
|
sources?: {
|
|
18843
|
-
/**
|
|
18872
|
+
/**
|
|
18873
|
+
* Format: uri
|
|
18874
|
+
* @description http or https ONLY. Zod's URL validation accepts `javascript:` and `data:` because they parse, so the scheme is checked separately. A source is a place a reader can go and look.
|
|
18875
|
+
*/
|
|
18844
18876
|
url: string;
|
|
18845
18877
|
title?: string;
|
|
18846
18878
|
/** Format: date-time */
|
|
@@ -18860,8 +18892,17 @@ export interface components {
|
|
|
18860
18892
|
/** @description Computed by the node, never hand-written by a caller. */
|
|
18861
18893
|
disclosure?: {
|
|
18862
18894
|
required: boolean;
|
|
18863
|
-
/**
|
|
18864
|
-
|
|
18895
|
+
/**
|
|
18896
|
+
* @description Why a visible disclosure is (or is not) owed. Three of these are easy to confuse:
|
|
18897
|
+
*
|
|
18898
|
+
* `art50_4_public_interest` — the content IS stated to inform the public on a matter of public interest, so Article 50(4)'s text limb applies.
|
|
18899
|
+
*
|
|
18900
|
+
* `art50_4_precautionary` — nobody stated whether it is. The node labels anyway (over-labelling is the safe direction), but the record does not borrow a statutory basis to justify a precaution.
|
|
18901
|
+
*
|
|
18902
|
+
* `policy` — the law positively EXEMPTED this content and the operator labelled it regardless. Distinct from `precautionary`, where applicability was never established rather than decided.
|
|
18903
|
+
* @enum {string}
|
|
18904
|
+
*/
|
|
18905
|
+
reason: "art50_1_interaction" | "art50_2_synthetic_output" | "art50_4_deepfake" | "art50_4_public_interest" | "art50_4_precautionary" | "policy" | "none";
|
|
18865
18906
|
short: {
|
|
18866
18907
|
[key: string]: string;
|
|
18867
18908
|
};
|
|
@@ -47412,6 +47453,79 @@ export interface operations {
|
|
|
47412
47453
|
};
|
|
47413
47454
|
};
|
|
47414
47455
|
};
|
|
47456
|
+
publishToConnection: {
|
|
47457
|
+
parameters: {
|
|
47458
|
+
query?: never;
|
|
47459
|
+
header?: never;
|
|
47460
|
+
path?: never;
|
|
47461
|
+
cookie?: never;
|
|
47462
|
+
};
|
|
47463
|
+
requestBody: {
|
|
47464
|
+
content: {
|
|
47465
|
+
"application/json": {
|
|
47466
|
+
/** @description Publish to your own connected account. Mutually exclusive with app_id. */
|
|
47467
|
+
connection_id?: string;
|
|
47468
|
+
/** @description With `action`, publish through a delegation over someone's shared channel. */
|
|
47469
|
+
app_id?: string;
|
|
47470
|
+
/** @example publish-video */
|
|
47471
|
+
action?: string;
|
|
47472
|
+
/** @description A file you have in storage. Omit for a text-only post. */
|
|
47473
|
+
storage_key?: string;
|
|
47474
|
+
caption?: string;
|
|
47475
|
+
/** @description Provider options (title, description, visibility, privacyStatus, alt). A delegation's fixed values are merged OVER these, so a delegated app cannot retarget what the channel owner decided. */
|
|
47476
|
+
params?: {
|
|
47477
|
+
[key: string]: unknown;
|
|
47478
|
+
};
|
|
47479
|
+
};
|
|
47480
|
+
};
|
|
47481
|
+
};
|
|
47482
|
+
responses: {
|
|
47483
|
+
/** @description Published, replayed, held for moderation, or queued behind a full allowance. Check `attempt.status` and `replay` rather than the status code. */
|
|
47484
|
+
200: {
|
|
47485
|
+
headers: {
|
|
47486
|
+
[name: string]: unknown;
|
|
47487
|
+
};
|
|
47488
|
+
content: {
|
|
47489
|
+
"application/json": components["schemas"]["AimeatEnvelope"] & {
|
|
47490
|
+
data?: {
|
|
47491
|
+
/** @description Where it landed at the provider. Absent when nothing was published. */
|
|
47492
|
+
url?: string;
|
|
47493
|
+
replay?: boolean;
|
|
47494
|
+
attempt?: {
|
|
47495
|
+
id?: string;
|
|
47496
|
+
/** @enum {string} */
|
|
47497
|
+
status?: "in_flight" | "held" | "queued" | "done" | "failed" | "rejected";
|
|
47498
|
+
externalRef?: string | null;
|
|
47499
|
+
error?: string | null;
|
|
47500
|
+
};
|
|
47501
|
+
};
|
|
47502
|
+
};
|
|
47503
|
+
};
|
|
47504
|
+
};
|
|
47505
|
+
/** @description The gate refused: no delegation, the delegation is disabled, a per-publisher cap is spent, or the account needs reconnecting. */
|
|
47506
|
+
400: {
|
|
47507
|
+
headers: {
|
|
47508
|
+
[name: string]: unknown;
|
|
47509
|
+
};
|
|
47510
|
+
content?: never;
|
|
47511
|
+
};
|
|
47512
|
+
401: components["responses"]["Unauthorized"];
|
|
47513
|
+
/** @description No such connection, or no such stored file. A connection belonging to someone else is this same 404. */
|
|
47514
|
+
404: {
|
|
47515
|
+
headers: {
|
|
47516
|
+
[name: string]: unknown;
|
|
47517
|
+
};
|
|
47518
|
+
content?: never;
|
|
47519
|
+
};
|
|
47520
|
+
/** @description The provider refused. `REJECTED` is permanent and must not be retried; `PUBLISH_FAILED` is transport-shaped and may be. */
|
|
47521
|
+
502: {
|
|
47522
|
+
headers: {
|
|
47523
|
+
[name: string]: unknown;
|
|
47524
|
+
};
|
|
47525
|
+
content?: never;
|
|
47526
|
+
};
|
|
47527
|
+
};
|
|
47528
|
+
};
|
|
47415
47529
|
connectionCallback: {
|
|
47416
47530
|
parameters: {
|
|
47417
47531
|
query?: {
|