maritime-cli 1.7.0 → 1.9.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/AGENTS.md +100 -19
- package/SKILL.md +181 -0
- package/dist/api.d.ts +5 -1
- package/dist/api.js +15 -3
- package/dist/bundled.d.ts +11 -0
- package/dist/bundled.js +25 -0
- package/dist/commands/create.js +40 -39
- package/dist/commands/env.js +15 -6
- package/dist/commands/guide.js +6 -16
- package/dist/commands/info.js +5 -0
- package/dist/commands/init.js +31 -2
- package/dist/commands/list.js +8 -1
- package/dist/commands/login.js +199 -11
- package/dist/commands/signup.js +45 -17
- package/dist/commands/status.js +0 -3
- package/dist/commands/triggers.js +12 -2
- package/dist/index.js +1 -3
- package/dist/interactive.js +0 -1
- package/dist/output.js +8 -1
- package/package.json +3 -2
- package/dist/commands/blueprint.d.ts +0 -2
- package/dist/commands/blueprint.js +0 -92
- package/dist/commands/scale.d.ts +0 -2
- package/dist/commands/scale.js +0 -32
package/dist/index.js
CHANGED
|
@@ -27,7 +27,6 @@ import { chatCommand } from './commands/chat.js';
|
|
|
27
27
|
import { messageCommand } from './commands/message.js';
|
|
28
28
|
import { historyCommand } from './commands/history.js';
|
|
29
29
|
import { triggersCommand } from './commands/triggers.js';
|
|
30
|
-
import { blueprintCommand } from './commands/blueprint.js';
|
|
31
30
|
import { sleepCommand } from './commands/sleep.js';
|
|
32
31
|
import { checkForUpdates, printUpdateNotice, versionCheckSettled } from './version-check.js';
|
|
33
32
|
import { guideCommand } from './commands/guide.js';
|
|
@@ -58,6 +57,7 @@ program
|
|
|
58
57
|
const HIDDEN = { hidden: true };
|
|
59
58
|
// Auth
|
|
60
59
|
program.addCommand(loginCommand);
|
|
60
|
+
program.addCommand(signupCommand);
|
|
61
61
|
program.addCommand(logoutCommand);
|
|
62
62
|
program.addCommand(whoamiCommand);
|
|
63
63
|
program.addCommand(keysCommand);
|
|
@@ -82,7 +82,6 @@ program.addCommand(guideCommand);
|
|
|
82
82
|
// surface small. Lifecycle is mostly automatic (idle-sleep + auto-wake on
|
|
83
83
|
// chat), so these are ops/debug + power-user/reseller tools, not the happy
|
|
84
84
|
// path. They still work exactly as before; `maritime <cmd> --help` shows them. ---
|
|
85
|
-
program.addCommand(signupCommand, HIDDEN);
|
|
86
85
|
program.addCommand(startCommand, HIDDEN);
|
|
87
86
|
program.addCommand(stopCommand, HIDDEN);
|
|
88
87
|
program.addCommand(restartCommand, HIDDEN);
|
|
@@ -91,7 +90,6 @@ program.addCommand(execCommand, HIDDEN);
|
|
|
91
90
|
program.addCommand(infoCommand, HIDDEN);
|
|
92
91
|
program.addCommand(historyCommand, HIDDEN);
|
|
93
92
|
program.addCommand(triggersCommand, HIDDEN);
|
|
94
|
-
program.addCommand(blueprintCommand, HIDDEN);
|
|
95
93
|
program.addCommand(templatesCommand, HIDDEN);
|
|
96
94
|
program.addCommand(openCommand, HIDDEN);
|
|
97
95
|
// Make the programmatic contract discoverable from the first thing an agent
|
package/dist/interactive.js
CHANGED
|
@@ -16,7 +16,6 @@ const COMMANDS = [
|
|
|
16
16
|
{ name: 'triggers', value: 'triggers', description: 'Manage triggers', needsAgent: false },
|
|
17
17
|
{ name: 'templates', value: 'templates', description: 'Browse templates', needsAgent: false },
|
|
18
18
|
{ name: 'history', value: 'history', description: 'View deploy history', needsAgent: true },
|
|
19
|
-
{ name: 'blueprint', value: 'blueprint', description: 'Manage templates', needsAgent: false },
|
|
20
19
|
{ name: 'open', value: 'open', description: 'Open agent in browser', needsAgent: true },
|
|
21
20
|
{ name: 'whoami', value: 'whoami', description: 'Show current user', needsAgent: false },
|
|
22
21
|
{ name: 'logout', value: 'logout', description: 'Log out', needsAgent: false },
|
package/dist/output.js
CHANGED
|
@@ -79,6 +79,8 @@ function errorCodeForStatus(status) {
|
|
|
79
79
|
case 401:
|
|
80
80
|
case 403:
|
|
81
81
|
return 'unauthorized';
|
|
82
|
+
case 402:
|
|
83
|
+
return 'payment_required';
|
|
82
84
|
case 404:
|
|
83
85
|
return 'not_found';
|
|
84
86
|
case 409:
|
|
@@ -125,9 +127,14 @@ export function handleError(error) {
|
|
|
125
127
|
if (error instanceof ExitSignal)
|
|
126
128
|
throw error;
|
|
127
129
|
if (error instanceof CliHttpError) {
|
|
130
|
+
// The server's own code wins when it sent one: a 402 that says
|
|
131
|
+
// `seat_limit` tells the caller exactly which gate closed, where the
|
|
132
|
+
// status-derived fallback would only say `payment_required`. The
|
|
133
|
+
// message is always the server's detail verbatim, which for billing
|
|
134
|
+
// gates is already a complete sentence naming the fix.
|
|
128
135
|
fail(error.detail, {
|
|
129
136
|
status: error.status,
|
|
130
|
-
code: errorCodeForStatus(error.status),
|
|
137
|
+
code: error.code ?? errorCodeForStatus(error.status),
|
|
131
138
|
exitCode: exitCodeForStatus(error.status),
|
|
132
139
|
});
|
|
133
140
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "maritime-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "Maritime CLI - Deploy and talk to AI agents from your terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
|
-
"AGENTS.md"
|
|
24
|
+
"AGENTS.md",
|
|
25
|
+
"SKILL.md"
|
|
25
26
|
],
|
|
26
27
|
"engines": {
|
|
27
28
|
"node": ">=20.12"
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { authGet, authPost } from '../api.js';
|
|
4
|
-
import { resolveAgent } from '../resolve.js';
|
|
5
|
-
import { isJsonMode, outputJson, handleError, makeSpinner } from '../output.js';
|
|
6
|
-
const blueprintListCmd = new Command('list')
|
|
7
|
-
.description('List your templates')
|
|
8
|
-
.action(async () => {
|
|
9
|
-
try {
|
|
10
|
-
const blueprints = await authGet('/api/blueprints');
|
|
11
|
-
if (isJsonMode()) {
|
|
12
|
-
outputJson(blueprints);
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
if (blueprints.length === 0) {
|
|
16
|
-
console.log(chalk.dim('No blueprints found.'));
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
console.log('\n ' +
|
|
20
|
-
chalk.dim('NAME'.padEnd(24)) +
|
|
21
|
-
chalk.dim('STATUS'.padEnd(12)) +
|
|
22
|
-
chalk.dim('VISIBILITY'.padEnd(14)) +
|
|
23
|
-
chalk.dim('FRAMEWORK'));
|
|
24
|
-
console.log(chalk.dim(' ' + '\u2500'.repeat(62)));
|
|
25
|
-
for (const bp of blueprints) {
|
|
26
|
-
console.log(' ' +
|
|
27
|
-
chalk.bold(bp.name.padEnd(24)) +
|
|
28
|
-
bp.status.padEnd(12) +
|
|
29
|
-
bp.visibility.padEnd(14) +
|
|
30
|
-
bp.framework);
|
|
31
|
-
}
|
|
32
|
-
console.log();
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
handleError(error);
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const blueprintCreateCmd = new Command('create')
|
|
39
|
-
.description('Create a template from an agent')
|
|
40
|
-
.argument('<agent>', 'Agent name or ID')
|
|
41
|
-
.option('--name <name>', 'Blueprint name')
|
|
42
|
-
.option('--visibility <vis>', 'Visibility (private, unlisted, public)', 'private')
|
|
43
|
-
.action(async (agentArg, opts) => {
|
|
44
|
-
try {
|
|
45
|
-
const agent = await resolveAgent(agentArg);
|
|
46
|
-
const spinner = await makeSpinner('Creating blueprint...');
|
|
47
|
-
const blueprint = await authPost('/api/blueprints', {
|
|
48
|
-
agentId: agent.id,
|
|
49
|
-
name: opts.name || agent.name,
|
|
50
|
-
visibility: opts.visibility,
|
|
51
|
-
});
|
|
52
|
-
spinner.succeed(chalk.green('Blueprint created: ') + chalk.bold(blueprint.name));
|
|
53
|
-
if (isJsonMode()) {
|
|
54
|
-
outputJson(blueprint);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
console.log(chalk.dim(` ID: ${blueprint.id}`));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
catch (error) {
|
|
61
|
-
handleError(error);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
const blueprintDeployCmd = new Command('deploy')
|
|
65
|
-
.description('Deploy a new agent from a template')
|
|
66
|
-
.argument('<slug>', 'Blueprint slug or ID')
|
|
67
|
-
.option('--name <name>', 'Name for the new agent')
|
|
68
|
-
.action(async (slug, opts) => {
|
|
69
|
-
try {
|
|
70
|
-
const spinner = await makeSpinner('Deploying from blueprint...');
|
|
71
|
-
const body = {};
|
|
72
|
-
if (opts.name)
|
|
73
|
-
body.name = opts.name;
|
|
74
|
-
const result = await authPost(`/api/marketplace/${encodeURIComponent(slug)}/deploy`, body);
|
|
75
|
-
spinner.succeed(chalk.green('Agent created: ') + chalk.bold(result.name));
|
|
76
|
-
if (isJsonMode()) {
|
|
77
|
-
outputJson(result);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
console.log(chalk.dim(` Agent ID: ${result.agentId}`));
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
catch (error) {
|
|
84
|
-
handleError(error);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
export const blueprintCommand = new Command('blueprint')
|
|
88
|
-
.alias('bp')
|
|
89
|
-
.description('Manage templates')
|
|
90
|
-
.addCommand(blueprintListCmd)
|
|
91
|
-
.addCommand(blueprintCreateCmd)
|
|
92
|
-
.addCommand(blueprintDeployCmd);
|
package/dist/commands/scale.d.ts
DELETED
package/dist/commands/scale.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Command } from 'commander';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { authPut } from '../api.js';
|
|
4
|
-
import { resolveAgent } from '../resolve.js';
|
|
5
|
-
import { isJsonMode, outputJson, handleError, fail, EXIT } from '../output.js';
|
|
6
|
-
const VALID_TIERS = ['smart', 'extended', 'always_on'];
|
|
7
|
-
export const scaleCommand = new Command('scale')
|
|
8
|
-
.description('Change an agent tier')
|
|
9
|
-
.argument('<agent>', 'Agent name or ID')
|
|
10
|
-
.argument('<tier>', 'Target tier (smart, extended, always_on)')
|
|
11
|
-
.action(async (agentArg, tier) => {
|
|
12
|
-
if (!VALID_TIERS.includes(tier)) {
|
|
13
|
-
fail(`Invalid tier "${tier}". Must be one of: ${VALID_TIERS.join(', ')}`, {
|
|
14
|
-
code: 'usage',
|
|
15
|
-
exitCode: EXIT.USAGE,
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
const agent = await resolveAgent(agentArg);
|
|
20
|
-
const result = await authPut(`/api/agents/${agent.id}`, {
|
|
21
|
-
tier,
|
|
22
|
-
});
|
|
23
|
-
if (isJsonMode()) {
|
|
24
|
-
outputJson(result);
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
console.log(chalk.green('Tier updated:') + ` ${chalk.bold(agent.name)} is now ${chalk.bold(tier)}`);
|
|
28
|
-
}
|
|
29
|
-
catch (error) {
|
|
30
|
-
handleError(error);
|
|
31
|
-
}
|
|
32
|
-
});
|