@vincentai/cli 0.1.1 → 0.1.2

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.
@@ -1,6 +1,6 @@
1
1
  import { parseArgs, getRequired, getOptional, hasFlag, showHelp } from '../../lib/args.js';
2
2
  import { resolveApiKey } from '../../lib/keystore.js';
3
- import { vincentPost, getTradeManagerBaseUrl } from '../../lib/client.js';
3
+ import { vincentPost } from '../../lib/client.js';
4
4
  export async function run(argv) {
5
5
  const { flags } = parseArgs(argv);
6
6
  if (hasFlag(flags, 'help')) {
@@ -29,6 +29,6 @@ export async function run(argv) {
29
29
  const trailingPercent = getOptional(flags, 'trailing-percent');
30
30
  if (trailingPercent)
31
31
  body.trailingPercent = Number(trailingPercent);
32
- const res = await vincentPost('/api/rules', apiKey, body, { baseUrl: getTradeManagerBaseUrl() });
32
+ const res = await vincentPost('/api/skills/polymarket/rules', apiKey, body);
33
33
  console.log(JSON.stringify(res, null, 2));
34
34
  }
@@ -1,6 +1,6 @@
1
1
  import { parseArgs, getRequired, hasFlag, showHelp } from '../../lib/args.js';
2
2
  import { resolveApiKey } from '../../lib/keystore.js';
3
- import { vincentDelete, getTradeManagerBaseUrl } from '../../lib/client.js';
3
+ import { vincentDelete } from '../../lib/client.js';
4
4
  export async function run(argv) {
5
5
  const { flags } = parseArgs(argv);
6
6
  if (hasFlag(flags, 'help')) {
@@ -12,8 +12,6 @@ export async function run(argv) {
12
12
  }
13
13
  const apiKey = resolveApiKey(flags, 'POLYMARKET_WALLET');
14
14
  const ruleId = getRequired(flags, 'rule-id');
15
- const res = await vincentDelete(`/api/rules/${ruleId}`, apiKey, {
16
- baseUrl: getTradeManagerBaseUrl(),
17
- });
15
+ const res = await vincentDelete(`/api/skills/polymarket/rules/${ruleId}`, apiKey);
18
16
  console.log(JSON.stringify(res, null, 2));
19
17
  }
@@ -1,6 +1,6 @@
1
1
  import { parseArgs, getOptional, hasFlag, showHelp } from '../../lib/args.js';
2
2
  import { resolveApiKey } from '../../lib/keystore.js';
3
- import { vincentGet, getTradeManagerBaseUrl } from '../../lib/client.js';
3
+ import { vincentGet } from '../../lib/client.js';
4
4
  export async function run(argv) {
5
5
  const { flags } = parseArgs(argv);
6
6
  if (hasFlag(flags, 'help')) {
@@ -23,8 +23,6 @@ export async function run(argv) {
23
23
  const offset = getOptional(flags, 'offset');
24
24
  if (offset)
25
25
  params.offset = offset;
26
- const res = await vincentGet('/api/events', apiKey, params, {
27
- baseUrl: getTradeManagerBaseUrl(),
28
- });
26
+ const res = await vincentGet('/api/skills/polymarket/rules/events', apiKey, params);
29
27
  console.log(JSON.stringify(res, null, 2));
30
28
  }
@@ -1,11 +1,11 @@
1
1
  import { parseArgs, hasFlag, showHelp } from '../../lib/args.js';
2
- import { vincentGet, getTradeManagerBaseUrl } from '../../lib/client.js';
2
+ import { vincentGet } from '../../lib/client.js';
3
3
  export async function run(argv) {
4
4
  const { flags } = parseArgs(argv);
5
5
  if (hasFlag(flags, 'help')) {
6
6
  showHelp('trade-manager health', []);
7
7
  return;
8
8
  }
9
- const res = await vincentGet('/health', null, undefined, { baseUrl: getTradeManagerBaseUrl() });
9
+ const res = await vincentGet('/health', null);
10
10
  console.log(JSON.stringify(res, null, 2));
11
11
  }
@@ -1,6 +1,6 @@
1
1
  import { parseArgs, getOptional, hasFlag, showHelp } from '../../lib/args.js';
2
2
  import { resolveApiKey } from '../../lib/keystore.js';
3
- import { vincentGet, getTradeManagerBaseUrl } from '../../lib/client.js';
3
+ import { vincentGet } from '../../lib/client.js';
4
4
  export async function run(argv) {
5
5
  const { flags } = parseArgs(argv);
6
6
  if (hasFlag(flags, 'help')) {
@@ -15,6 +15,6 @@ export async function run(argv) {
15
15
  const status = getOptional(flags, 'status');
16
16
  if (status)
17
17
  params.status = status;
18
- const res = await vincentGet('/api/rules', apiKey, params, { baseUrl: getTradeManagerBaseUrl() });
18
+ const res = await vincentGet('/api/skills/polymarket/rules', apiKey, params);
19
19
  console.log(JSON.stringify(res, null, 2));
20
20
  }
@@ -1,6 +1,6 @@
1
1
  import { parseArgs, hasFlag, showHelp } from '../../lib/args.js';
2
2
  import { resolveApiKey } from '../../lib/keystore.js';
3
- import { vincentGet, getTradeManagerBaseUrl } from '../../lib/client.js';
3
+ import { vincentGet } from '../../lib/client.js';
4
4
  export async function run(argv) {
5
5
  const { flags } = parseArgs(argv);
6
6
  if (hasFlag(flags, 'help')) {
@@ -8,8 +8,6 @@ export async function run(argv) {
8
8
  return;
9
9
  }
10
10
  const apiKey = resolveApiKey(flags, 'POLYMARKET_WALLET');
11
- const res = await vincentGet('/api/positions', apiKey, undefined, {
12
- baseUrl: getTradeManagerBaseUrl(),
13
- });
11
+ const res = await vincentGet('/api/skills/polymarket/rules/positions', apiKey);
14
12
  console.log(JSON.stringify(res, null, 2));
15
13
  }
@@ -1,6 +1,6 @@
1
1
  import { parseArgs, hasFlag, showHelp } from '../../lib/args.js';
2
2
  import { resolveApiKey } from '../../lib/keystore.js';
3
- import { vincentGet, getTradeManagerBaseUrl } from '../../lib/client.js';
3
+ import { vincentGet } from '../../lib/client.js';
4
4
  export async function run(argv) {
5
5
  const { flags } = parseArgs(argv);
6
6
  if (hasFlag(flags, 'help')) {
@@ -8,6 +8,6 @@ export async function run(argv) {
8
8
  return;
9
9
  }
10
10
  const apiKey = resolveApiKey(flags, 'POLYMARKET_WALLET');
11
- const res = await vincentGet('/status', apiKey, undefined, { baseUrl: getTradeManagerBaseUrl() });
11
+ const res = await vincentGet('/api/skills/polymarket/rules/status', apiKey);
12
12
  console.log(JSON.stringify(res, null, 2));
13
13
  }
@@ -1,6 +1,6 @@
1
1
  import { parseArgs, getRequired, hasFlag, showHelp } from '../../lib/args.js';
2
2
  import { resolveApiKey } from '../../lib/keystore.js';
3
- import { vincentPatch, getTradeManagerBaseUrl } from '../../lib/client.js';
3
+ import { vincentPatch } from '../../lib/client.js';
4
4
  export async function run(argv) {
5
5
  const { flags } = parseArgs(argv);
6
6
  if (hasFlag(flags, 'help')) {
@@ -13,8 +13,8 @@ export async function run(argv) {
13
13
  }
14
14
  const apiKey = resolveApiKey(flags, 'POLYMARKET_WALLET');
15
15
  const ruleId = getRequired(flags, 'rule-id');
16
- const res = await vincentPatch(`/api/rules/${ruleId}`, apiKey, {
16
+ const res = await vincentPatch(`/api/skills/polymarket/rules/${ruleId}`, apiKey, {
17
17
  triggerPrice: Number(getRequired(flags, 'trigger-price')),
18
- }, { baseUrl: getTradeManagerBaseUrl() });
18
+ });
19
19
  console.log(JSON.stringify(res, null, 2));
20
20
  }
@@ -1,13 +1,9 @@
1
1
  const DEFAULT_BASE_URL = 'https://heyvincent.ai';
2
- const TRADE_MANAGER_BASE_URL = 'http://localhost:19000';
3
2
  function getBaseUrl() {
4
3
  return process.env.VINCENT_BASE_URL || DEFAULT_BASE_URL;
5
4
  }
6
- export function getTradeManagerBaseUrl() {
7
- return process.env.VINCENT_TRADE_MANAGER_URL || TRADE_MANAGER_BASE_URL;
8
- }
9
- async function request(method, path, apiKey, body, opts) {
10
- const base = opts?.baseUrl || getBaseUrl();
5
+ async function request(method, path, apiKey, body) {
6
+ const base = getBaseUrl();
11
7
  const url = `${base}${path}`;
12
8
  const headers = {};
13
9
  if (apiKey) {
@@ -40,7 +36,7 @@ async function request(method, path, apiKey, body, opts) {
40
36
  }
41
37
  return data;
42
38
  }
43
- export function vincentGet(path, apiKey, params, opts) {
39
+ export function vincentGet(path, apiKey, params) {
44
40
  let fullPath = path;
45
41
  if (params) {
46
42
  const entries = Object.entries(params).filter(([, v]) => v !== undefined && v !== '');
@@ -48,14 +44,14 @@ export function vincentGet(path, apiKey, params, opts) {
48
44
  fullPath += '?' + new URLSearchParams(entries).toString();
49
45
  }
50
46
  }
51
- return request('GET', fullPath, apiKey, undefined, opts);
47
+ return request('GET', fullPath, apiKey);
52
48
  }
53
- export function vincentPost(path, apiKey, body, opts) {
54
- return request('POST', path, apiKey, body, opts);
49
+ export function vincentPost(path, apiKey, body) {
50
+ return request('POST', path, apiKey, body);
55
51
  }
56
- export function vincentDelete(path, apiKey, opts) {
57
- return request('DELETE', path, apiKey, undefined, opts);
52
+ export function vincentDelete(path, apiKey) {
53
+ return request('DELETE', path, apiKey);
58
54
  }
59
- export function vincentPatch(path, apiKey, body, opts) {
60
- return request('PATCH', path, apiKey, body, opts);
55
+ export function vincentPatch(path, apiKey, body) {
56
+ return request('PATCH', path, apiKey, body);
61
57
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vincentai/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CLI for Vincent AI agent skills",
5
5
  "type": "module",
6
6
  "bin": {