gipity 1.1.16 → 1.1.20
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 +58 -75
- package/dist/adopt-cwd.js +2 -13
- package/dist/api.js +27 -45
- package/dist/auth.js +1 -1
- package/dist/banner.js +3 -7
- package/dist/catalog.js +8 -7
- package/dist/commands/add.js +26 -9
- package/dist/commands/approval.js +1 -1
- package/dist/commands/ask.js +112 -0
- package/dist/commands/bug.js +5 -5
- package/dist/commands/build.js +10 -35
- package/dist/commands/credits.js +3 -3
- package/dist/commands/doctor.js +7 -8
- package/dist/commands/email.js +6 -56
- package/dist/commands/generate.js +12 -12
- package/dist/commands/init.js +40 -30
- package/dist/commands/key.js +1 -1
- package/dist/commands/load.js +2 -12
- package/dist/commands/logs.js +2 -2
- package/dist/commands/memory.js +5 -17
- package/dist/commands/notify.js +1 -1
- package/dist/commands/page-eval.js +55 -38
- package/dist/commands/page-inspect.js +6 -6
- package/dist/commands/page-screenshot.js +51 -54
- package/dist/commands/page-test.js +188 -14
- package/dist/commands/payments.js +2 -2
- package/dist/commands/project.js +66 -15
- package/dist/commands/realtime.js +96 -4
- package/dist/commands/records.js +4 -6
- package/dist/commands/sandbox.js +2 -3
- package/dist/commands/skill.js +50 -22
- package/dist/commands/status.js +7 -9
- package/dist/commands/test.js +2 -2
- package/dist/commands/token.js +4 -4
- package/dist/commands/workflow.js +45 -8
- package/dist/config.js +22 -6
- package/dist/flag-aliases.js +75 -18
- package/dist/help-skills.js +2 -2
- package/dist/hooks/capture-runner.js +5 -3
- package/dist/index.js +1631 -1517
- package/dist/knowledge.js +24 -21
- package/dist/login-flow.js +4 -4
- package/dist/net.js +91 -0
- package/dist/opencode-setup.js +2 -2
- package/dist/page-fixtures.js +3 -3
- package/dist/project-setup.js +2 -3
- package/dist/prompts.js +1 -1
- package/dist/provider-docs.js +22 -25
- package/dist/realtime-bench.js +12040 -0
- package/dist/relay/agent-token.js +1 -1
- package/dist/relay/daemon.js +0 -1
- package/dist/relay/setup.js +13 -2
- package/dist/setup.js +11 -12
- package/dist/sync.js +3 -3
- package/dist/utils.js +1 -1
- package/package.json +10 -4
- package/dist/commands/agent.js +0 -251
- package/dist/commands/chat.js +0 -137
- package/dist/commands/claude.js +0 -1056
- package/dist/commands/plan.js +0 -93
|
@@ -115,7 +115,7 @@ approvalCommand
|
|
|
115
115
|
}));
|
|
116
116
|
approvalCommand
|
|
117
117
|
.command('cancel <guid>')
|
|
118
|
-
.description('Cancel a pending approval (
|
|
118
|
+
.description('Cancel a pending approval without a decision (anything waiting on it stops waiting)')
|
|
119
119
|
.option('--json', 'Output as JSON')
|
|
120
120
|
.action((guid, opts) => run('Cancel', async () => {
|
|
121
121
|
if (!guid.startsWith('ap_')) {
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { readFileSync, fstatSync } from 'fs';
|
|
3
|
+
import { post } from '../api.js';
|
|
4
|
+
import { resolveProjectContext } from '../config.js';
|
|
5
|
+
import { guessMime } from '../upload.js';
|
|
6
|
+
import { warning } from '../colors.js';
|
|
7
|
+
import { run } from '../helpers/index.js';
|
|
8
|
+
import { withSpinner } from '../progress.js';
|
|
9
|
+
const IMAGE_TYPES = new Set(['image/png', 'image/jpeg', 'image/gif', 'image/webp']);
|
|
10
|
+
/** True when stdin is piped or redirected (not a terminal, not /dev/null). */
|
|
11
|
+
function stdinIsPiped() {
|
|
12
|
+
try {
|
|
13
|
+
const st = fstatSync(0);
|
|
14
|
+
return st.isFIFO() || st.isFile();
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/** A --file's text. `-` is stdin, read only when asked for: many harnesses
|
|
21
|
+
* leave stdin as an open pipe that never closes, so reading it unasked would
|
|
22
|
+
* hang an agent's `gipity ask "..."` forever. */
|
|
23
|
+
function readTextFile(path) {
|
|
24
|
+
try {
|
|
25
|
+
return readFileSync(path === '-' ? 0 : path, 'utf8');
|
|
26
|
+
}
|
|
27
|
+
catch (e) {
|
|
28
|
+
throw new Error(`can't read --file ${path} (${e.code || e.message}).`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function readImage(path) {
|
|
32
|
+
const mime = guessMime(path);
|
|
33
|
+
if (!IMAGE_TYPES.has(mime))
|
|
34
|
+
throw new Error(`--image ${path} is ${mime}; use a png, jpg, gif or webp.`);
|
|
35
|
+
let buf;
|
|
36
|
+
try {
|
|
37
|
+
buf = readFileSync(path);
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
throw new Error(`can't read --image ${path} (${e.code || e.message}).`);
|
|
41
|
+
}
|
|
42
|
+
return { data: buf.toString('base64'), mime_type: mime, name: path.split('/').pop() || path };
|
|
43
|
+
}
|
|
44
|
+
/** The question, then each --file under its own header (stdin, `-`, with none). */
|
|
45
|
+
export function buildAskPrompt(words, files) {
|
|
46
|
+
const parts = [];
|
|
47
|
+
if (words.length)
|
|
48
|
+
parts.push(words.join(' '));
|
|
49
|
+
for (const f of files)
|
|
50
|
+
parts.push(f.path === '-' ? f.content.trimEnd() : `--- ${f.path} ---\n${f.content.trimEnd()}`);
|
|
51
|
+
return parts.join('\n\n');
|
|
52
|
+
}
|
|
53
|
+
export const askCommand = new Command('ask')
|
|
54
|
+
.description('Ask a model one question and print the answer: no chat history, no tools. Attach text with --file (- for stdin) or images with --image')
|
|
55
|
+
.argument('[prompt...]', 'The question or instruction')
|
|
56
|
+
.option('--file <path...>', 'Add a text file to the prompt (repeatable); - reads stdin')
|
|
57
|
+
.option('--image <path...>', 'Attach an image: png, jpg, gif or webp (repeatable)')
|
|
58
|
+
.option('--model <model>', 'Model id, alias (small, fast, medium, large, haiku, sonnet, opus, ...) or provider (openai, anthropic, gemini). Default: small')
|
|
59
|
+
.option('--system <text>', 'Replace the default system prompt')
|
|
60
|
+
.option('--schema <json>', 'Answer with a JSON value matching this JSON schema; prints the JSON')
|
|
61
|
+
.option('--max-tokens <n>', 'Cap the answer length', (v) => parseInt(v, 10))
|
|
62
|
+
.option('--json', 'Output the whole result (answer, model, tokens) as JSON')
|
|
63
|
+
.addHelpText('after', `
|
|
64
|
+
Examples:
|
|
65
|
+
gipity ask "what does HTTP 425 mean?"
|
|
66
|
+
cat errors.log | gipity ask "group these by root cause" --file -
|
|
67
|
+
gipity ask "summarize this" --file notes.md
|
|
68
|
+
gipity ask "what's in this picture?" --image shot.png --model gemini
|
|
69
|
+
gipity ask "extract the dates" --file mail.txt --schema '{"type":"array","items":{"type":"string"}}'
|
|
70
|
+
`)
|
|
71
|
+
.action((words, opts) => run('Ask', async () => {
|
|
72
|
+
const paths = opts.file ?? [];
|
|
73
|
+
// Nothing else to ask: take piped stdin as the whole prompt (`... | gipity ask`).
|
|
74
|
+
if (!words.length && !paths.length && stdinIsPiped())
|
|
75
|
+
paths.push('-');
|
|
76
|
+
const files = paths.map(path => ({ path, content: readTextFile(path) }));
|
|
77
|
+
const prompt = buildAskPrompt(words, files);
|
|
78
|
+
if (!prompt.trim())
|
|
79
|
+
throw new Error('Nothing to ask. Pass a question, add --file <path> (or --file - for stdin), or pipe the prompt in.');
|
|
80
|
+
let schema;
|
|
81
|
+
if (opts.schema !== undefined) {
|
|
82
|
+
try {
|
|
83
|
+
schema = JSON.parse(opts.schema);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
throw new Error('--schema must be JSON (a JSON schema, e.g. \'{"type":"object","properties":{"answer":{"type":"string"}}}\').');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
const images = (opts.image ?? []).map(readImage);
|
|
90
|
+
const { config } = await resolveProjectContext();
|
|
91
|
+
const body = { prompt };
|
|
92
|
+
if (opts.model)
|
|
93
|
+
body.model = opts.model;
|
|
94
|
+
if (opts.system)
|
|
95
|
+
body.system = opts.system;
|
|
96
|
+
if (images.length)
|
|
97
|
+
body.images = images;
|
|
98
|
+
if (schema !== undefined)
|
|
99
|
+
body.schema = schema;
|
|
100
|
+
if (opts.maxTokens)
|
|
101
|
+
body.max_tokens = opts.maxTokens;
|
|
102
|
+
const call = () => post(`/projects/${config.projectGuid}/generate/text`, body);
|
|
103
|
+
const result = opts.json || !process.stderr.isTTY ? await call() : await withSpinner('Thinking...', call, { done: null });
|
|
104
|
+
if (opts.json) {
|
|
105
|
+
console.log(JSON.stringify(result));
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (result.truncated)
|
|
109
|
+
console.error(warning(`The answer hit the length limit and is cut off. Raise --max-tokens or ask for less.`));
|
|
110
|
+
console.log(schema !== undefined ? JSON.stringify(result.json, null, 2) : result.text.trim());
|
|
111
|
+
}));
|
|
112
|
+
//# sourceMappingURL=ask.js.map
|
package/dist/commands/bug.js
CHANGED
|
@@ -12,13 +12,13 @@ const SEVERITIES = ['S1', 'S2', 'S3', 'S4'];
|
|
|
12
12
|
const SEVERITY_HINT = 'S1=blocker, S2=major, S3=minor, S4=friction';
|
|
13
13
|
export const bugCommand = new Command('bug')
|
|
14
14
|
.description('Report Gipity platform bugs / friction in real time')
|
|
15
|
-
.addHelpText('after', `\nCapture platform friction the moment you hit it
|
|
15
|
+
.addHelpText('after', `\nCapture platform friction the moment you hit it, even one you worked around,` +
|
|
16
16
|
`\nso the team can triage it into a fix.\n` +
|
|
17
17
|
`\nCategories: ${CATEGORIES.join(', ')}` +
|
|
18
18
|
`\nSeverity: ${SEVERITY_HINT}` +
|
|
19
|
-
`\nNever include PII or user data
|
|
19
|
+
`\nNever include PII or user data: describe the platform problem in the abstract.` +
|
|
20
20
|
`\nFiled one by mistake? Withdraw it yourself with \`gipity bug retract <id>\`` +
|
|
21
|
-
`\n(works until a human picks it up)
|
|
21
|
+
`\n(works until a human picks it up). Don't file a second report asking for a close.`);
|
|
22
22
|
bugCommand
|
|
23
23
|
.command('report')
|
|
24
24
|
.description('File a bug / friction report about the Gipity platform')
|
|
@@ -52,7 +52,7 @@ bugCommand
|
|
|
52
52
|
console.log(JSON.stringify(res.data));
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
|
-
console.log(success(`✓ Bug report filed (${res.data.report_guid})
|
|
55
|
+
console.log(success(`✓ Bug report filed (${res.data.report_guid}): queued for triage.`));
|
|
56
56
|
}
|
|
57
57
|
catch (err) {
|
|
58
58
|
// The report itself is the record of "the platform broke" - don't lose it
|
|
@@ -84,7 +84,7 @@ bugCommand
|
|
|
84
84
|
console.log(JSON.stringify(res.data));
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
console.log(success(`✓ Bug report ${res.data.report_guid} retracted
|
|
87
|
+
console.log(success(`✓ Bug report ${res.data.report_guid} retracted: it is out of the triage queue.`));
|
|
88
88
|
}));
|
|
89
89
|
bugCommand
|
|
90
90
|
.command('list')
|
package/dist/commands/build.js
CHANGED
|
@@ -8,12 +8,11 @@ import { resolveCommand, spawnCommand, spawnSyncCommand } from '../platform.js';
|
|
|
8
8
|
import { getAuth, sessionExpired, accessTokenExpired, refreshTokenIfNeeded } from '../auth.js';
|
|
9
9
|
import { get, post, ApiError, getAccountSlug } from '../api.js';
|
|
10
10
|
import { interactiveLogin } from '../login-flow.js';
|
|
11
|
-
import { getConfig, saveConfigAt, clearConfigCache, getApiBaseOverride, DEFAULT_API_BASE, getConfigPath } from '../config.js';
|
|
11
|
+
import { getConfig, saveConfigAt, clearConfigCache, getApiBaseOverride, DEFAULT_API_BASE, getConfigPath, captureEnabled } from '../config.js';
|
|
12
12
|
import { sync } from '../sync.js';
|
|
13
13
|
import { slugify, ensureGipityPluginInstalled, setupProjectTools, setupToolForAgent, DEFAULT_SYNC_IGNORE, isSyncIgnored } from '../setup.js';
|
|
14
14
|
import { buildProjectContextBlock as buildProjectContextBlockText, buildNewProjectPrompt, buildResumeWrap, buildFreshWrap, } from '../prompts.js';
|
|
15
15
|
import * as relayState from '../relay/state.js';
|
|
16
|
-
import { maybeOfferRelayOn, ensureDaemonRunning } from '../relay/onboarding.js';
|
|
17
16
|
import { prompt, pickOne, confirm } from '../utils.js';
|
|
18
17
|
import { brand, bold, info, success, warning, error as clrError, muted } from '../colors.js';
|
|
19
18
|
import { createProgressReporter } from '../progress.js';
|
|
@@ -67,6 +66,7 @@ function reportSyncResult(result) {
|
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
import { getProjectsRoot } from '../relay/paths.js';
|
|
69
|
+
import { ensureDevicePaired } from '../relay/setup.js';
|
|
70
70
|
/** Ask the server for recursive VFS counts. Server owns the file metadata
|
|
71
71
|
* (counts, bytes, paths), so a single aggregate query beats walking the
|
|
72
72
|
* local filesystem - which only sees depth 1 without recursion and led
|
|
@@ -144,10 +144,9 @@ async function buildProjectContextBlock(opts) {
|
|
|
144
144
|
// Interactive email+code login now lives in `login-flow.ts` (shared with
|
|
145
145
|
// `gipity setup`). Used on first login and when the server returns 401
|
|
146
146
|
// mid-command (session expired).
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
// launching Claude Code so a paired user doesn't have to think about it.
|
|
147
|
+
// Relay (driving this machine from the web) is parked: `gipity build` no
|
|
148
|
+
// longer offers it or starts its daemon. `gipity relay` still works where the
|
|
149
|
+
// server has the `relay` feature on. See relay/onboarding.ts.
|
|
151
150
|
/** Format a millisecond duration as hh:mm:ss.s (one decimal on seconds). */
|
|
152
151
|
function formatElapsed(ms) {
|
|
153
152
|
const totalSec = ms / 1000;
|
|
@@ -388,13 +387,6 @@ async function runLaunch(cmdName, cmdCfg, opts) {
|
|
|
388
387
|
auth = await interactiveLogin();
|
|
389
388
|
}
|
|
390
389
|
console.log('');
|
|
391
|
-
// ── Step 1b: Relay first-run onboarding (account-scoped, runs before project) ──
|
|
392
|
-
if (!nonInteractive) {
|
|
393
|
-
await maybeOfferRelayOn();
|
|
394
|
-
}
|
|
395
|
-
if (!nonInteractive && relayState.isRelayEnabled() && !relayState.isPaused()) {
|
|
396
|
-
ensureDaemonRunning();
|
|
397
|
-
}
|
|
398
390
|
// ── Step 2: Project ───────────────────────────────────────────────
|
|
399
391
|
let initialPrompt = '';
|
|
400
392
|
let headlessNewProject = false;
|
|
@@ -476,19 +468,11 @@ async function runLaunch(cmdName, cmdCfg, opts) {
|
|
|
476
468
|
mkdirSync(projectDir, { recursive: true });
|
|
477
469
|
process.chdir(projectDir);
|
|
478
470
|
clearConfigCache();
|
|
479
|
-
let agentGuid = '';
|
|
480
|
-
try {
|
|
481
|
-
const agents = await get(`/projects/${project.short_guid}/agents`);
|
|
482
|
-
if (agents.data.length > 0)
|
|
483
|
-
agentGuid = agents.data[0].short_guid;
|
|
484
|
-
}
|
|
485
|
-
catch { /* no agents */ }
|
|
486
471
|
const accountSlug = await getAccountSlug();
|
|
487
472
|
saveConfigAt(projectDir, {
|
|
488
473
|
projectGuid: project.short_guid,
|
|
489
474
|
projectSlug: project.slug,
|
|
490
475
|
accountSlug,
|
|
491
|
-
agentGuid,
|
|
492
476
|
conversationGuid: null,
|
|
493
477
|
apiBase: getApiBaseOverride() || DEFAULT_API_BASE,
|
|
494
478
|
ignore: DEFAULT_SYNC_IGNORE,
|
|
@@ -597,7 +581,6 @@ async function runLaunch(cmdName, cmdCfg, opts) {
|
|
|
597
581
|
let project;
|
|
598
582
|
let isNewProject = false;
|
|
599
583
|
let accountSlug = '';
|
|
600
|
-
let agentGuid = '';
|
|
601
584
|
const result = forceAdoptCwd
|
|
602
585
|
? { kind: 'adopt-cwd' }
|
|
603
586
|
: projects.length > 0
|
|
@@ -621,7 +604,6 @@ async function runLaunch(cmdName, cmdCfg, opts) {
|
|
|
621
604
|
confirmDeletions: !nonInteractive,
|
|
622
605
|
});
|
|
623
606
|
project = adopted.project;
|
|
624
|
-
agentGuid = adopted.agentGuid;
|
|
625
607
|
// Treat as "new project" for the build prompt only when cwd is
|
|
626
608
|
// genuinely empty - otherwise the user has chosen to adopt
|
|
627
609
|
// existing content and shouldn't be asked "what to build?".
|
|
@@ -639,22 +621,12 @@ async function runLaunch(cmdName, cmdCfg, opts) {
|
|
|
639
621
|
mkdirSync(projectDir, { recursive: true });
|
|
640
622
|
process.chdir(projectDir);
|
|
641
623
|
clearConfigCache();
|
|
642
|
-
// Fetch agents
|
|
643
|
-
try {
|
|
644
|
-
const agents = await get(`/projects/${project.short_guid}/agents`);
|
|
645
|
-
if (agents.data.length > 0)
|
|
646
|
-
agentGuid = agents.data[0].short_guid;
|
|
647
|
-
}
|
|
648
|
-
catch {
|
|
649
|
-
// No agents
|
|
650
|
-
}
|
|
651
624
|
accountSlug = await getAccountSlug();
|
|
652
625
|
// Always write config (refresh stale GUIDs from a previous setup)
|
|
653
626
|
saveConfigAt(projectDir, {
|
|
654
627
|
projectGuid: project.short_guid,
|
|
655
628
|
projectSlug: project.slug,
|
|
656
629
|
accountSlug,
|
|
657
|
-
agentGuid,
|
|
658
630
|
conversationGuid: null,
|
|
659
631
|
apiBase: getApiBaseOverride() || DEFAULT_API_BASE,
|
|
660
632
|
ignore: DEFAULT_SYNC_IGNORE,
|
|
@@ -766,8 +738,11 @@ async function runLaunch(cmdName, cmdCfg, opts) {
|
|
|
766
738
|
// empty forever (the qwen-flight zero-message bug, 2026-07-07).
|
|
767
739
|
const inheritedConvGuid = Boolean(process.env.GIPITY_CONVERSATION_GUID);
|
|
768
740
|
let convGuidForHooks = process.env.GIPITY_CONVERSATION_GUID ?? null;
|
|
769
|
-
|
|
770
|
-
|
|
741
|
+
// Session recording is opt-in per project (captureEnabled): with it off
|
|
742
|
+
// no conversation is created and the hooks have nothing to post to.
|
|
743
|
+
if (!convGuidForHooks && captureEnabled(getConfig())) {
|
|
744
|
+
// Recording needs this machine registered; do it quietly the first time.
|
|
745
|
+
const device = relayState.getDevice() ?? await ensureDevicePaired().catch(() => null);
|
|
771
746
|
if (device) {
|
|
772
747
|
const cfg = getConfig();
|
|
773
748
|
const resumeIdx = process.argv.indexOf('--resume');
|
package/dist/commands/credits.js
CHANGED
|
@@ -129,7 +129,7 @@ export const creditsCommand = new Command('credits')
|
|
|
129
129
|
}
|
|
130
130
|
console.log('');
|
|
131
131
|
if (sub.tier !== 'pro') {
|
|
132
|
-
console.log(dim('Upgrade to Gipity Pro for higher limits and 20,000 credits/mo
|
|
132
|
+
console.log(dim('Upgrade to Gipity Pro for higher limits and 20,000 credits/mo: run `gipity credits buy`.'));
|
|
133
133
|
}
|
|
134
134
|
else {
|
|
135
135
|
console.log(dim('Need more credits? Run `gipity credits list` to see credit packs, then `gipity credits buy <pack>`.'));
|
|
@@ -268,7 +268,7 @@ creditsCommand
|
|
|
268
268
|
console.log('');
|
|
269
269
|
console.log(` ${bold('Checkout:')} ${success(url)}`);
|
|
270
270
|
console.log('');
|
|
271
|
-
console.log(dim('Open the link to complete your purchase
|
|
271
|
+
console.log(dim('Open the link to complete your purchase. It takes 2 minutes; cancel anytime. Your plan unlocks the moment payment clears.'));
|
|
272
272
|
if (opts.open)
|
|
273
273
|
openInBrowser(url);
|
|
274
274
|
}
|
|
@@ -313,7 +313,7 @@ creditsCommand
|
|
|
313
313
|
}
|
|
314
314
|
console.log(` ${bold('Billing portal:')} ${success(url)}`);
|
|
315
315
|
console.log('');
|
|
316
|
-
console.log(dim('Open the link to cancel, renew, update your card, or view invoices. Cancelling takes effect at the end of the billing period
|
|
316
|
+
console.log(dim('Open the link to cancel, renew, update your card, or view invoices. Cancelling takes effect at the end of the billing period: you keep your credits.'));
|
|
317
317
|
if (opts.open)
|
|
318
318
|
openInBrowser(url);
|
|
319
319
|
}
|
package/dist/commands/doctor.js
CHANGED
|
@@ -5,7 +5,7 @@ import { homedir } from 'os';
|
|
|
5
5
|
import { LOCAL_PKG_DIR, LOCAL_ENTRY, STATE_FILE, SETTINGS_FILE, UPDATE_LOG, readState, readSettings, updatesDisabled } from '../updater/state.js';
|
|
6
6
|
import { bold, dim, success, warning, error as clrError, muted } from '../colors.js';
|
|
7
7
|
import { getAuth, sessionExpired } from '../auth.js';
|
|
8
|
-
import { isClaudeInstalled, probeClaudeAuthenticated, claudeAuthStatus, claudeCredentialHeuristic
|
|
8
|
+
import { isClaudeInstalled, probeClaudeAuthenticated, claudeAuthStatus, claudeCredentialHeuristic } from '../claude-setup.js';
|
|
9
9
|
import * as relayState from '../relay/state.js';
|
|
10
10
|
import { planFor, UnsupportedPlatformError } from '../relay/installers.js';
|
|
11
11
|
import { resolveCliPath } from '../relay/setup.js';
|
|
@@ -176,20 +176,19 @@ export const doctorCommand = new Command('doctor')
|
|
|
176
176
|
const claudeAccount = env.claude.account ? muted(` (${env.claude.account}${env.claude.method ? ` via ${env.claude.method}` : ''})`) : '';
|
|
177
177
|
console.log(`${muted('claude code ')} installed ${yn(env.claude.installed)} · authenticated ${yn(env.claude.authenticated)}${claudeAccount}`);
|
|
178
178
|
if (env.claude.installed && !env.claude.authenticated) {
|
|
179
|
-
|
|
180
|
-
// fails every one of them. Say the fix here rather than making them find
|
|
181
|
-
// it from a failed dispatch.
|
|
182
|
-
console.log(`${muted(' ')} ${warning(claudeLoginHint())}`);
|
|
179
|
+
console.log(`${muted(' ')} ${warning('Claude Code is not logged in. Run `claude auth login` and sign in.')}`);
|
|
183
180
|
}
|
|
184
|
-
const autostartLabel = env.relay.autostart === null ? muted('n/a') : yn(env.relay.autostart);
|
|
185
|
-
console.log(`${muted('relay ')} paired ${yn(env.relay.paired)} · running ${yn(env.relay.running)} · autostart ${autostartLabel}${env.relay.paused ? warning(' · paused') : ''}${env.relay.device ? muted(` (${env.relay.device.name})`) : ''}`);
|
|
186
181
|
// Codex approves project hooks interactively and stores the decision in
|
|
187
182
|
// its own opaque state - we can't verify it from here, so surface the
|
|
188
183
|
// one manual step whenever this project ships Codex hooks.
|
|
189
184
|
if (existsSync(resolve(process.cwd(), '.codex', 'hooks.json'))) {
|
|
190
185
|
console.log(`${muted('codex hooks ')} ${warning('written')} - session capture needs a one-time approval: run /hooks inside Codex in this project`);
|
|
191
186
|
}
|
|
192
|
-
|
|
187
|
+
// The human verdict covers what building needs (node + a live Gipity
|
|
188
|
+
// login). The --json `ready` field keeps its parked-Relay meaning for the
|
|
189
|
+
// archived desktop client.
|
|
190
|
+
const buildReady = env.node.ok && env.gipity.logged_in;
|
|
191
|
+
console.log(`${muted('ready ')} ${buildReady ? success('yes') : warning('no - run `gipity build` to finish setup')}`);
|
|
193
192
|
// ── CLI install / update health ────────────────────────────────────
|
|
194
193
|
const state = readState();
|
|
195
194
|
const settings = readSettings();
|
package/dist/commands/email.js
CHANGED
|
@@ -1,62 +1,12 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
import { get, post } from '../api.js';
|
|
3
3
|
import { resolveProjectContext } from '../config.js';
|
|
4
|
-
import {
|
|
4
|
+
import { success, bold, muted, warning } from '../colors.js';
|
|
5
5
|
import { run } from '../helpers/index.js';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return [...prev, value];
|
|
9
|
-
}
|
|
10
|
-
// `email` is a command GROUP. Agent email is `email send`; the deployed app's
|
|
11
|
-
// email() service is exercised via `email test` / `email log`. (Keeping agent
|
|
12
|
-
// send under `send` rather than a bare-`email` default action avoids a
|
|
13
|
-
// parent/subcommand `--subject` option collision — and matches the `email`
|
|
14
|
-
// skill doc, which documents the CLI verb as `gipity email send`.)
|
|
6
|
+
// `email` is a command GROUP for the deployed app's email() service:
|
|
7
|
+
// `email test` sends through it, `email log` lists recent sends.
|
|
15
8
|
export const emailCommand = new Command('email')
|
|
16
|
-
.description("
|
|
17
|
-
// --- gipity email send ---
|
|
18
|
-
// Agent email from gipity@gipity.ai (omit --to to self-send).
|
|
19
|
-
emailCommand
|
|
20
|
-
.command('send')
|
|
21
|
-
.description('Send an email as the agent (from gipity@gipity.ai; omit --to to self-send)')
|
|
22
|
-
.requiredOption('--subject <subject>', 'Email subject')
|
|
23
|
-
.requiredOption('--body <body>', 'Email body (plain text)')
|
|
24
|
-
.option('--to <email>', 'Recipient (repeatable; omit for self-send)', collect, [])
|
|
25
|
-
.option('--cc <email>', 'Cc recipient (repeatable)', collect, [])
|
|
26
|
-
.option('--bcc <email>', 'Bcc recipient (repeatable)', collect, [])
|
|
27
|
-
.option('--reply-to <email>', 'Reply-To header address')
|
|
28
|
-
.option('--html <html>', 'Optional HTML body')
|
|
29
|
-
.option('--json', 'Output as JSON')
|
|
30
|
-
.action(async (opts) => {
|
|
31
|
-
try {
|
|
32
|
-
await resolveProjectContext();
|
|
33
|
-
const payload = { subject: opts.subject, body: opts.body };
|
|
34
|
-
if (opts.to.length)
|
|
35
|
-
payload.to = opts.to;
|
|
36
|
-
if (opts.cc.length)
|
|
37
|
-
payload.cc = opts.cc;
|
|
38
|
-
if (opts.bcc.length)
|
|
39
|
-
payload.bcc = opts.bcc;
|
|
40
|
-
if (opts.replyTo)
|
|
41
|
-
payload.reply_to = opts.replyTo;
|
|
42
|
-
if (opts.html)
|
|
43
|
-
payload.html = opts.html;
|
|
44
|
-
const res = await post('/agent-email/send', payload);
|
|
45
|
-
if (opts.json) {
|
|
46
|
-
console.log(JSON.stringify(res.data));
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
const recap = res.data.to.join(', ')
|
|
50
|
-
+ (res.data.cc.length ? `, cc: ${res.data.cc.join(', ')}` : '')
|
|
51
|
-
+ (res.data.bcc.length ? `, bcc: ${res.data.bcc.length}` : '');
|
|
52
|
-
console.log(success(`Email sent to ${recap}: ${res.data.subject}`));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
console.error(clrError(`Email failed: ${err.message}`));
|
|
57
|
-
process.exit(1);
|
|
58
|
-
}
|
|
59
|
-
});
|
|
9
|
+
.description("Test and inspect a deployed app's email() sends");
|
|
60
10
|
// --- gipity email test <to> ---
|
|
61
11
|
// Exercises the deployed app's email() send path (platform-brokered, owner-billed)
|
|
62
12
|
// so the agent can verify email works after deploy — the parallel of `notify test`.
|
|
@@ -88,7 +38,7 @@ emailCommand
|
|
|
88
38
|
else
|
|
89
39
|
console.log(warning(`Nothing sent (${skipped} skipped).`));
|
|
90
40
|
for (const r of results) {
|
|
91
|
-
console.log(muted(` ${r.to}
|
|
41
|
+
console.log(muted(` ${r.to} - ${r.status}${r.reason ? `: ${r.reason}` : ''}`));
|
|
92
42
|
}
|
|
93
43
|
}));
|
|
94
44
|
// --- gipity email log ---
|
|
@@ -117,7 +67,7 @@ emailCommand
|
|
|
117
67
|
console.log(bold(`${totals.n} attempt${totals.n === 1 ? '' : 's'} · ${totals.credits} credit${totals.credits === 1 ? '' : 's'}`));
|
|
118
68
|
for (const r of items) {
|
|
119
69
|
const when = new Date(r.created_at).toISOString().replace('T', ' ').slice(0, 16);
|
|
120
|
-
const to = r.detail?.to ?? '
|
|
70
|
+
const to = r.detail?.to ?? '-';
|
|
121
71
|
const subj = r.detail?.subject ? ` · ${r.detail.subject}` : '';
|
|
122
72
|
const status = r.detail?.status ? ` [skipped: ${r.detail.status}]` : '';
|
|
123
73
|
console.log(` ${muted(when)} ${to}${status ? warning(status) : ''}${muted(subj)}`);
|
|
@@ -125,13 +125,13 @@ const formatName = (ext) => (canonicalExt(ext) === 'jpg' ? 'JPEG' : ext.toUpperC
|
|
|
125
125
|
function correctExtension(filename, buf) {
|
|
126
126
|
const actual = sniffExt(buf);
|
|
127
127
|
if (!actual)
|
|
128
|
-
return filename; // unrecognized bytes
|
|
128
|
+
return filename; // unrecognized bytes: nothing better to say
|
|
129
129
|
const dot = filename.lastIndexOf('.');
|
|
130
130
|
const asked = dot > 0 ? filename.slice(dot + 1).toLowerCase() : '';
|
|
131
131
|
if (canonicalExt(asked) === actual)
|
|
132
132
|
return filename;
|
|
133
133
|
const corrected = `${dot > 0 ? filename.slice(0, dot) : filename}.${actual}`;
|
|
134
|
-
console.error(muted(`Note: the model returned ${formatName(actual)}, not ${asked ? formatName(asked) : 'the requested format'}
|
|
134
|
+
console.error(muted(`Note: the model returned ${formatName(actual)}, not ${asked ? formatName(asked) : 'the requested format'}: `
|
|
135
135
|
+ `saving as ${corrected} so the extension matches the actual bytes.`));
|
|
136
136
|
return corrected;
|
|
137
137
|
}
|
|
@@ -148,7 +148,7 @@ function noteFormatMismatch(filename, buf) {
|
|
|
148
148
|
const asked = dot > 0 ? filename.slice(dot + 1).toLowerCase() : '';
|
|
149
149
|
if (!asked || canonicalExt(asked) === actual)
|
|
150
150
|
return;
|
|
151
|
-
console.error(muted(`Note: ${basename(filename)} holds ${formatName(actual)} bytes though its name ends .${asked}
|
|
151
|
+
console.error(muted(`Note: ${basename(filename)} holds ${formatName(actual)} bytes though its name ends .${asked}: `
|
|
152
152
|
+ `that's fine (browsers and image/video/edit tools sniff the bytes, not the name). `
|
|
153
153
|
+ `Saved at the exact path you requested; reference it as-is.`));
|
|
154
154
|
}
|
|
@@ -232,7 +232,7 @@ Examples:
|
|
|
232
232
|
.addOption(new Option('--provider <provider>', 'Image provider (default: bfl)').choices(IMAGE_PROVIDER_IDS))
|
|
233
233
|
.option('--model <model>', `Model id for the chosen provider, or a tier alias (${IMAGE_TIER_ALIAS_IDS.join(', ')}); see Models below`)
|
|
234
234
|
.option('--size <size>', 'Dimensions as WxH, e.g. "1024x1024" (OpenAI/BFL)')
|
|
235
|
-
.addOption(new Option('--quality <quality>', 'Quality (gpt-image
|
|
235
|
+
.addOption(new Option('--quality <quality>', 'Quality (OpenAI gpt-image models only)').choices(IMAGE_QUALITY_IDS))
|
|
236
236
|
.addOption(new Option('--aspect-ratio <ratio>', 'Aspect ratio (Gemini only)').choices(IMAGE_GEMINI_ASPECT_RATIO_IDS))
|
|
237
237
|
.addOption(new Option('--image-size <size>', 'Output resolution (Gemini only)').choices(IMAGE_GEMINI_SIZE_IDS))
|
|
238
238
|
.option('--seed <n>', 'Deterministic seed (BFL only): reuse one seed to keep a set of images visually coherent', (v) => parseInt(v, 10))
|
|
@@ -287,29 +287,29 @@ Examples:
|
|
|
287
287
|
});
|
|
288
288
|
// ── VIDEO ──────────────────────────────────────────────────────────────
|
|
289
289
|
const videoCommand = new Command('video')
|
|
290
|
-
.description('Generate a short video (
|
|
290
|
+
.description('Generate a short video (3-10 seconds) from a text prompt')
|
|
291
291
|
.addHelpText('after', `
|
|
292
|
-
Models (default:
|
|
292
|
+
Models (default: gemini-omni-1.1-flash):
|
|
293
293
|
${VIDEO_MODELS_TABLE}
|
|
294
294
|
|
|
295
295
|
Aspect ratios: ${VIDEO_ASPECT_RATIOS}
|
|
296
296
|
|
|
297
297
|
Tips:
|
|
298
298
|
- Describe the scene, camera movement, lighting, and any dialogue
|
|
299
|
-
- Generation takes
|
|
299
|
+
- Generation takes 20-120 seconds
|
|
300
300
|
- Videos include AI-generated audio
|
|
301
301
|
|
|
302
302
|
Examples:
|
|
303
303
|
gipity generate video "a bird flying over a mountain lake at sunset"
|
|
304
|
-
gipity generate video "close-up of coffee being poured" --
|
|
304
|
+
gipity generate video "close-up of coffee being poured" --duration 5
|
|
305
305
|
gipity generate video "vertical dance video" --aspect 9:16 --resolution 1080p -o dance.mp4
|
|
306
|
-
gipity generate video "a wave crashing" --duration
|
|
306
|
+
gipity generate video "a wave crashing" --duration 3 --resolution 360p
|
|
307
307
|
`)
|
|
308
308
|
.argument('<prompt>', 'Description of the video scene, action, camera movement, and dialogue')
|
|
309
309
|
.addOption(new Option('--model <model>', 'Video model; see Models below for quality/price').choices(VIDEO_MODEL_IDS))
|
|
310
|
-
.addOption(new Option('--aspect <ratio>', 'Aspect ratio (landscape
|
|
310
|
+
.addOption(new Option('--aspect <ratio>', 'Aspect ratio (landscape or portrait)').choices(VIDEO_ASPECT_RATIO_IDS))
|
|
311
311
|
.addOption(new Option('--resolution <res>', 'Video resolution').choices(VIDEO_RESOLUTION_IDS))
|
|
312
|
-
.option('--duration <seconds>', 'Clip length in seconds
|
|
312
|
+
.option('--duration <seconds>', 'Clip length in whole seconds, 3-10. Default 8. Billing is per second, so shorter is cheaper.')
|
|
313
313
|
.option('-o, --output <file>', 'Output path (default ./generated.mp4). For a clip your app ships, write it into the source tree so it deploys, e.g. -o src/assets/video/clip.mp4; the cwd default is fine for one-off generation.')
|
|
314
314
|
.option('--json', 'Output as JSON')
|
|
315
315
|
.action(async (prompt, opts) => {
|
|
@@ -324,7 +324,7 @@ Examples:
|
|
|
324
324
|
resolution: opts.resolution,
|
|
325
325
|
duration_seconds: opts.duration ? Number(opts.duration) : undefined,
|
|
326
326
|
}, { timeoutMs: LONG_REQUEST_TIMEOUT_MS });
|
|
327
|
-
//
|
|
327
|
+
// A render runs 20-120s; the bouncing bar + timer keeps the wait honest.
|
|
328
328
|
const started = Date.now();
|
|
329
329
|
const result = opts.json
|
|
330
330
|
? await doGenerate()
|