gipity 1.1.4 → 1.1.5
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/adopt-cwd.js +1 -1
- package/dist/banner.js +3 -5
- package/dist/commands/add.js +1 -1
- package/dist/commands/build.js +12 -11
- package/dist/commands/chat.js +1 -1
- package/dist/commands/deploy.js +1 -1
- package/dist/commands/generate.js +5 -5
- package/dist/commands/gmail.js +1 -1
- package/dist/commands/job.js +10 -5
- package/dist/commands/load.js +2 -2
- package/dist/commands/login.js +7 -2
- package/dist/commands/page-eval.js +5 -5
- package/dist/commands/page-fetch.js +14 -10
- package/dist/commands/page-inspect.js +2 -2
- package/dist/commands/page-screenshot.js +5 -5
- package/dist/commands/page-test.js +1 -1
- package/dist/commands/remove.js +1 -1
- package/dist/commands/sandbox.js +1 -1
- package/dist/commands/save.js +1 -1
- package/dist/commands/secrets.js +1 -1
- package/dist/commands/service.js +1 -1
- package/dist/commands/setup.js +4 -6
- package/dist/commands/status.js +41 -12
- package/dist/commands/storage.js +2 -2
- package/dist/commands/sync.js +15 -0
- package/dist/commands/test.js +1 -1
- package/dist/commands/upload.js +1 -1
- package/dist/commands/workflow.js +1 -1
- package/dist/index.js +495 -415
- package/dist/knowledge.js +3 -0
- package/dist/login-flow.js +44 -2
- package/dist/relay/onboarding.js +26 -44
- package/dist/sync.js +6 -6
- package/dist/utils.js +60 -3
- package/package.json +2 -2
package/dist/knowledge.js
CHANGED
|
@@ -148,6 +148,8 @@ Write files locally - Gipity's editor hooks (installed into Claude Code, Grok, a
|
|
|
148
148
|
|
|
149
149
|
To keep local-only material (research clones, scratch data, vendored references) in the project directory without syncing or deploying it, list it in a \`.gipityignore\` at the project root - gitignore-style, one pattern per line, \`#\` comments. Ignored paths are invisible to sync in both directions; anything that already synced before being ignored stays on the server until you delete it.
|
|
150
150
|
|
|
151
|
+
**WSL trap: user-dropped files may be in a Windows-side twin.** On WSL, a same-named folder often exists at \`C:\\Users\\<name>\\GipityProjects\\<project>\` (visible as \`/mnt/c/Users/<name>/GipityProjects/<project>\`) - from Windows Explorer it looks like "the project folder", so users drop new files (audio, images) there. Nothing syncs from it. If the user says files are "in the project" but you can't find them, check that path before searching wider; \`gipity sync\` prints a notice when such a twin exists.
|
|
152
|
+
|
|
151
153
|
### Where files go: deploy only ships \`src/\`
|
|
152
154
|
|
|
153
155
|
Deploy is opt-in, not opt-out: the \`files\` phase uploads **only** what's under \`src/\` (plus \`functions/\` and \`migrations/\` as backend, not CDN files). Anything else at the project root is kept but never deployed. Put each kind of file in the right bucket so scratch and reference material can't bloat a deploy:
|
|
@@ -184,6 +186,7 @@ App development skills:
|
|
|
184
186
|
- \`app-debugging\` - debug a deployed app: page inspect/eval, screenshots, function logs
|
|
185
187
|
- \`app-development\` - functions, database, and API
|
|
186
188
|
- \`app-import\` - import apps from GitHub/.gip bundles (incl. Vercel/Replit/Lovable porting) and export any project as a portable .gip - app_import tool, gipity save/load
|
|
189
|
+
- \`app-records\` - Gipity Records: declared tables → validated CRUD, provenance, workflows, auto UI
|
|
187
190
|
- \`app-testing\` - testing deployed app functions (ctx.fn.call/callAs, the isolated test DB)
|
|
188
191
|
- \`deploy\` - the deploy pipeline & gipity.yaml manifest
|
|
189
192
|
- \`jobs\` - long-running CPU + GPU compute jobs (Python / Node / bash)
|
package/dist/login-flow.js
CHANGED
|
@@ -10,9 +10,48 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import { publicPost } from './api.js';
|
|
12
12
|
import { getAuth, saveAuth } from './auth.js';
|
|
13
|
+
import { getConfig } from './config.js';
|
|
13
14
|
import { prompt, decodeJwtExp } from './utils.js';
|
|
14
|
-
import { success, error as clrError, muted } from './colors.js';
|
|
15
|
+
import { success, error as clrError, warning, muted } from './colors.js';
|
|
15
16
|
import { flushBugQueue } from './bug-queue.js';
|
|
17
|
+
/** True when a fresh-account result would be a SURPRISE worth warning about:
|
|
18
|
+
* either this directory is linked to an existing project, or this machine
|
|
19
|
+
* already held a session for this exact email. A genuine first-time signup
|
|
20
|
+
* (nothing linked, no prior session) must stay silent. */
|
|
21
|
+
function newAccountWouldBeUnexpected(email, priorAuth) {
|
|
22
|
+
return !!getConfig() || priorAuth?.email.toLowerCase() === email.toLowerCase().trim();
|
|
23
|
+
}
|
|
24
|
+
/** Called right after `/auth/login` (send-code), before the code is entered -
|
|
25
|
+
* the server already knows at this point whether the email matches an
|
|
26
|
+
* existing account (bug cli#S2: logging into the wrong/new account was
|
|
27
|
+
* previously silent until a later "not found" error). */
|
|
28
|
+
export function warnBeforeCodeIfUnexpectedNewAccount(isNewUser, email, indent = '') {
|
|
29
|
+
if (isNewUser !== true)
|
|
30
|
+
return;
|
|
31
|
+
const priorAuth = getAuth();
|
|
32
|
+
if (!newAccountWouldBeUnexpected(email, priorAuth))
|
|
33
|
+
return;
|
|
34
|
+
const config = getConfig();
|
|
35
|
+
console.log(`${indent}${warning(`No existing Gipity account for ${email} — entering the code will CREATE a new one.`)}`);
|
|
36
|
+
if (config) {
|
|
37
|
+
console.log(`${indent}${muted(`This directory is linked to project ${config.projectSlug} (account ${config.accountSlug}). If you meant to log into that account, stop and re-check the email before entering the code.`)}`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/** Called right after `/auth/verify` succeeds. `priorAuth` must be captured
|
|
41
|
+
* BEFORE `saveAuth()` overwrites the cache - it's the only way to tell "this
|
|
42
|
+
* machine already had a session for this email" from "first login ever". */
|
|
43
|
+
export function warnIfUnexpectedNewAccount(isNewUser, email, priorAuth, indent = '') {
|
|
44
|
+
if (isNewUser !== true)
|
|
45
|
+
return;
|
|
46
|
+
if (!newAccountWouldBeUnexpected(email, priorAuth))
|
|
47
|
+
return;
|
|
48
|
+
const config = getConfig();
|
|
49
|
+
console.log(`${indent}${warning(`Logged into a NEW, empty account for ${email} — no prior account existed for this email.`)}`);
|
|
50
|
+
if (config) {
|
|
51
|
+
console.log(`${indent}${muted(`This directory is linked to project ${config.projectSlug} (account ${config.accountSlug}), which the new account does not own — project / skill / sync commands will fail with "not found".`)}`);
|
|
52
|
+
}
|
|
53
|
+
console.log(`${indent}${muted('If you expected an existing account, run: gipity status — then gipity login again with the correct email.')}`);
|
|
54
|
+
}
|
|
16
55
|
/** Prompt for email + 6-digit code, persist the tokens, and return the new
|
|
17
56
|
* auth. Exits the process on empty input or a bad token (the caller can't
|
|
18
57
|
* proceed without a session). */
|
|
@@ -22,13 +61,15 @@ export async function interactiveLogin() {
|
|
|
22
61
|
console.error(`\n ${clrError('Email required.')}`);
|
|
23
62
|
process.exit(1);
|
|
24
63
|
}
|
|
25
|
-
await publicPost('/auth/login', { email });
|
|
64
|
+
const sendRes = await publicPost('/auth/login', { email });
|
|
26
65
|
console.log(' Check your email for a 6-digit code.\n');
|
|
66
|
+
warnBeforeCodeIfUnexpectedNewAccount(sendRes.isNewUser, email, ' ');
|
|
27
67
|
const code = await prompt(' Code: ');
|
|
28
68
|
if (!code) {
|
|
29
69
|
console.error(`\n ${clrError('Code required.')}`);
|
|
30
70
|
process.exit(1);
|
|
31
71
|
}
|
|
72
|
+
const priorAuth = getAuth();
|
|
32
73
|
const res = await publicPost('/auth/verify', { email, code });
|
|
33
74
|
const exp = decodeJwtExp(res.accessToken);
|
|
34
75
|
if (!exp) {
|
|
@@ -38,6 +79,7 @@ export async function interactiveLogin() {
|
|
|
38
79
|
const expiresAt = new Date(exp * 1000).toISOString();
|
|
39
80
|
saveAuth({ accessToken: res.accessToken, refreshToken: res.refreshToken, email, expiresAt });
|
|
40
81
|
console.log(` ${success(`Logged in (${email}).`)}`);
|
|
82
|
+
warnIfUnexpectedNewAccount(res.isNewUser, email, priorAuth, ' ');
|
|
41
83
|
const delivered = await flushBugQueue().catch(() => 0);
|
|
42
84
|
if (delivered > 0) {
|
|
43
85
|
console.log(` ${muted(`Delivered ${delivered} queued bug report${delivered === 1 ? '' : 's'}.`)}`);
|
package/dist/relay/onboarding.js
CHANGED
|
@@ -12,8 +12,7 @@
|
|
|
12
12
|
* All the non-interactive primitives live in `setup.ts` (`pairDevice`,
|
|
13
13
|
* `startDaemon`, `installAutostart`); this module is only the prompts + copy.
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
16
|
-
import { prompt, confirm } from '../utils.js';
|
|
15
|
+
import { prompt, confirm, isWsl } from '../utils.js';
|
|
17
16
|
import { bold, brand, dim, success, error as clrError, muted } from '../colors.js';
|
|
18
17
|
import * as state from './state.js';
|
|
19
18
|
import { UnsupportedPlatformError } from './installers.js';
|
|
@@ -27,21 +26,6 @@ export const ensureDaemonRunning = startDaemon;
|
|
|
27
26
|
* ended up enabled (or was already), `false` if the user declined or a step
|
|
28
27
|
* failed. Non-interactive flows (e.g. `gipity claude -p`) must not call this.
|
|
29
28
|
*/
|
|
30
|
-
/** True inside Windows Subsystem for Linux (either env marker or kernel
|
|
31
|
-
* string). Used to explain autostart failures accurately - WSL ships without
|
|
32
|
-
* a systemd user session unless the user opts in via /etc/wsl.conf. */
|
|
33
|
-
function isWsl() {
|
|
34
|
-
if (process.platform !== 'linux')
|
|
35
|
-
return false;
|
|
36
|
-
if (process.env.WSL_DISTRO_NAME || process.env.WSL_INTEROP)
|
|
37
|
-
return true;
|
|
38
|
-
try {
|
|
39
|
-
return /microsoft/i.test(readFileSync('/proc/version', 'utf-8'));
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
29
|
export async function runRelaySetup(opts) {
|
|
46
30
|
const alreadyAnswered = state.getRelayEnabled() !== undefined;
|
|
47
31
|
// `gipity claude` first-run: honor the user's prior choice and don't re-ask.
|
|
@@ -66,13 +50,13 @@ export async function runRelaySetup(opts) {
|
|
|
66
50
|
console.log('');
|
|
67
51
|
console.log(` ${success('Registered as')} ${bold(existingDevice.name)} ${muted(`(${existingDevice.guid})`)}`);
|
|
68
52
|
if (state.isPaused()) {
|
|
69
|
-
console.log(` ${dim('The relay is paused
|
|
53
|
+
console.log(` ${dim('The relay is paused - resume it with')} ${brand('gipity relay resume')}${dim('.')}`);
|
|
70
54
|
}
|
|
71
55
|
else {
|
|
72
56
|
console.log(` ${dim('The relay is running. Open')} ${brand('gipity.ai')}${dim(' and type `/claude` to drive Claude Code here.')}`);
|
|
73
57
|
}
|
|
74
58
|
console.log('');
|
|
75
|
-
console.log(` ${dim('To register this computer again
|
|
59
|
+
console.log(` ${dim('To register this computer again (for example under a different name),')}`);
|
|
76
60
|
console.log(` ${dim('unregister it first, then re-run setup:')}`);
|
|
77
61
|
console.log(` ${brand('gipity relay revoke')} ${dim('# unpairs this computer and removes the login service')}`);
|
|
78
62
|
console.log(` ${brand('gipity connect')} ${dim('# register it again (asks for a new name)')}`);
|
|
@@ -82,34 +66,36 @@ export async function runRelaySetup(opts) {
|
|
|
82
66
|
}
|
|
83
67
|
// Header. `gipity setup` frames it as the deliberate action it is; the
|
|
84
68
|
// `gipity claude` first-run frames it as an optional add-on it's offering.
|
|
69
|
+
// Lines are pre-wrapped short so they never rewrap in a normal terminal.
|
|
85
70
|
if (opts.mode === 'run-now') {
|
|
86
71
|
console.log(` ${bold('Set up this computer as a relay')}`);
|
|
87
|
-
console.log(` ${dim('
|
|
88
|
-
console.log(` ${dim('
|
|
72
|
+
console.log(` ${dim('Gipity drives the coding agents on this computer from the web (')}${brand('gipity.ai')}${dim(')')}`);
|
|
73
|
+
console.log(` ${dim('on any browser, desktop or phone. Uses your Claude, Codex, or Grok')}`);
|
|
74
|
+
console.log(` ${dim('subscription - the cheapest way to pay for tokens.')}`);
|
|
89
75
|
}
|
|
90
76
|
else {
|
|
91
|
-
console.log(` ${bold('
|
|
92
|
-
console.log(` ${dim('
|
|
93
|
-
console.log('');
|
|
94
|
-
console.log(` ${dim('Enable now (takes 2 seconds) or turn on later with')} ${brand('gipity connect')}`);
|
|
77
|
+
console.log(` ${bold('Optional:')} ${dim('Gipity can drive the coding agents on this computer from the')}`);
|
|
78
|
+
console.log(` ${dim('web (')}${brand('gipity.ai')}${dim(') on any browser, desktop or phone. Like Claude Code remote')}`);
|
|
79
|
+
console.log(` ${dim('control, but one pane for all your coding agents.')}`);
|
|
95
80
|
}
|
|
96
81
|
console.log('');
|
|
97
82
|
const promptText = opts.mode === 'run-now'
|
|
98
|
-
? ' Set up remote control on this computer
|
|
99
|
-
: ' Enable remote control
|
|
83
|
+
? ' Set up remote control on this computer'
|
|
84
|
+
: ' Enable remote control';
|
|
100
85
|
const enable = await confirm(promptText, { default: 'yes' });
|
|
101
86
|
if (!enable) {
|
|
102
87
|
state.setRelayEnabled(false);
|
|
103
|
-
console.log(` ${muted('Skipped.')}`);
|
|
88
|
+
console.log(` ${muted('Skipped. Turn on later with')} ${brand('gipity connect')}${muted('.')}`);
|
|
104
89
|
console.log('');
|
|
105
90
|
return false;
|
|
106
91
|
}
|
|
92
|
+
console.log('');
|
|
107
93
|
// Device name - show a friendly default (owner + device kind); Enter accepts.
|
|
108
94
|
const defaultName = friendlyDeviceName();
|
|
109
95
|
const rawName = await prompt(` Device name [${bold(defaultName)}]: `);
|
|
110
96
|
const name = (rawName || defaultName).trim();
|
|
111
97
|
if (!name || name.length > 100) {
|
|
112
|
-
console.error(` ${clrError('Device name must be 1
|
|
98
|
+
console.error(` ${clrError('Device name must be 1-100 non-whitespace characters. Skipping.')}`);
|
|
113
99
|
state.setRelayEnabled(false);
|
|
114
100
|
return false;
|
|
115
101
|
}
|
|
@@ -128,13 +114,12 @@ export async function runRelaySetup(opts) {
|
|
|
128
114
|
// run instead of silently opting the user out forever.
|
|
129
115
|
return false;
|
|
130
116
|
}
|
|
131
|
-
//
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
117
|
+
// The user said yes to remote control - start the daemon now, no extra
|
|
118
|
+
// question. `gipity build` keeps it running on future runs.
|
|
119
|
+
startDaemon();
|
|
120
|
+
console.log('');
|
|
136
121
|
// Offer OS-level autostart (launchd / systemd --user / Task Scheduler).
|
|
137
|
-
const autostartOs = await confirm(' Also start at OS login
|
|
122
|
+
const autostartOs = await confirm(' Also start at OS login', { default: 'yes' });
|
|
138
123
|
if (autostartOs) {
|
|
139
124
|
try {
|
|
140
125
|
const res = installAutostart();
|
|
@@ -152,9 +137,7 @@ export async function runRelaySetup(opts) {
|
|
|
152
137
|
console.log(` ${muted('Autostart install returned non-zero - you can run')} ${brand('gipity relay install')} ${muted('later.')}`);
|
|
153
138
|
}
|
|
154
139
|
}
|
|
155
|
-
|
|
156
|
-
console.log(` ${success('Auto-start installed.')} ${dim(res.summary)}`);
|
|
157
|
-
}
|
|
140
|
+
// Success is silent - the Done line below covers it.
|
|
158
141
|
}
|
|
159
142
|
catch (err) {
|
|
160
143
|
if (err instanceof UnsupportedPlatformError) {
|
|
@@ -166,16 +149,15 @@ export async function runRelaySetup(opts) {
|
|
|
166
149
|
}
|
|
167
150
|
}
|
|
168
151
|
// Diagnostics consent - default on, clearly opt-out. Only ask once.
|
|
152
|
+
// (No personal data or file paths are ever sent; `gipity relay diagnostics
|
|
153
|
+
// on|off` flips it later.)
|
|
169
154
|
if (state.getDiagnosticsConsent() === undefined) {
|
|
170
|
-
|
|
155
|
+
console.log('');
|
|
156
|
+
const diag = await confirm(' Share anonymous diagnostics info', { default: 'yes' });
|
|
171
157
|
state.setDiagnosticsConsent(diag);
|
|
172
|
-
console.log(` ${dim(diag
|
|
173
|
-
? 'Thanks - no personal data or file paths are ever sent. Turn off anytime with `gipity relay diagnostics off`.'
|
|
174
|
-
: 'Diagnostics off. Turn on anytime with `gipity relay diagnostics on`.')}`);
|
|
175
158
|
}
|
|
176
159
|
console.log('');
|
|
177
|
-
console.log(` ${success(`
|
|
178
|
-
console.log(` ${dim('In the Gipity web CLI, type `/claude` to dispatch messages to this PC.')}`);
|
|
160
|
+
console.log(` ${success(`Done! ${bold(device.name)} is set up. New chats from gipity.ai can now execute here.`)}`);
|
|
179
161
|
console.log('');
|
|
180
162
|
return true;
|
|
181
163
|
}
|
package/dist/sync.js
CHANGED
|
@@ -154,7 +154,7 @@ export async function acquireLock(progress) {
|
|
|
154
154
|
// First time we're forced to wait: open the spinner so the wait is visible
|
|
155
155
|
// (with an elapsed timer) rather than reading as a frozen process.
|
|
156
156
|
if (!waitSpinner) {
|
|
157
|
-
waitSpinner = progress?.spinner('Waiting for another sync to finish
|
|
157
|
+
waitSpinner = progress?.spinner('Waiting for another sync to finish...') ?? null;
|
|
158
158
|
}
|
|
159
159
|
await new Promise(r => setTimeout(r, LOCK_POLL_MS));
|
|
160
160
|
}
|
|
@@ -735,9 +735,9 @@ async function syncInner(projectGuid, root, ignore, opts, interactive) {
|
|
|
735
735
|
const config = { projectGuid, ignore };
|
|
736
736
|
const p = opts.progress;
|
|
737
737
|
const baseline = readBaseline(projectGuid);
|
|
738
|
-
p?.phase('Scanning local files
|
|
738
|
+
p?.phase('Scanning local files...');
|
|
739
739
|
const local = walkLocal(root, ignore, baseline.files);
|
|
740
|
-
p?.phase('Checking Gipity for changes
|
|
740
|
+
p?.phase('Checking Gipity for changes...');
|
|
741
741
|
const remote = await fetchRemote(projectGuid);
|
|
742
742
|
// Ignored paths are invisible on BOTH sides: filtering only the local walk
|
|
743
743
|
// would classify a remote copy as "added" (pull it), then next pass as a
|
|
@@ -761,7 +761,7 @@ async function syncInner(projectGuid, root, ignore, opts, interactive) {
|
|
|
761
761
|
needHash.push(path);
|
|
762
762
|
}
|
|
763
763
|
if (needHash.length)
|
|
764
|
-
p?.phase(`Hashing ${needHash.length} file${needHash.length === 1 ? '' : 's'}
|
|
764
|
+
p?.phase(`Hashing ${needHash.length} file${needHash.length === 1 ? '' : 's'}...`);
|
|
765
765
|
await ensureLocalHashes(root, local, needHash);
|
|
766
766
|
const planned = plan(local, remote, baseline.files);
|
|
767
767
|
if (opts.plan) {
|
|
@@ -890,7 +890,7 @@ async function syncInner(projectGuid, root, ignore, opts, interactive) {
|
|
|
890
890
|
// Either way we fall through to the single-file recovery below rather than
|
|
891
891
|
// proceeding on a half-empty tree - a partial download must never be
|
|
892
892
|
// mistaken for a complete one.
|
|
893
|
-
errors.push(`Bulk download incomplete (${err.message}); recovering files individually
|
|
893
|
+
errors.push(`Bulk download incomplete (${err.message}); recovering files individually...`);
|
|
894
894
|
}
|
|
895
895
|
finally {
|
|
896
896
|
// Settle the bar even if the extracted-byte tally fell short of the
|
|
@@ -903,7 +903,7 @@ async function syncInner(projectGuid, root, ignore, opts, interactive) {
|
|
|
903
903
|
// an earlier truncated pull.
|
|
904
904
|
const missing = wantedDownloads.filter(a => !downloadedBytes.has(a.path));
|
|
905
905
|
if (missing.length) {
|
|
906
|
-
p?.phase(`Recovering ${missing.length} file${missing.length === 1 ? '' : 's'} the bulk download dropped
|
|
906
|
+
p?.phase(`Recovering ${missing.length} file${missing.length === 1 ? '' : 's'} the bulk download dropped...`);
|
|
907
907
|
for (const a of missing) {
|
|
908
908
|
// Verify against the remote's content hash: the downloads pass records
|
|
909
909
|
// this sha into the baseline, so bytes that don't match it must be
|
package/dist/utils.js
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
import { createInterface } from 'readline';
|
|
2
|
+
import { readFileSync, readdirSync, realpathSync, statSync } from 'node:fs';
|
|
3
|
+
import { basename, join } from 'node:path';
|
|
2
4
|
import { bold, dim } from './colors.js';
|
|
5
|
+
/** True inside Windows Subsystem for Linux (either env marker or kernel
|
|
6
|
+
* string). WSL ships without a systemd user session unless the user opts in
|
|
7
|
+
* via /etc/wsl.conf, and Windows-side paths live under /mnt/c. */
|
|
8
|
+
export function isWsl() {
|
|
9
|
+
if (process.platform !== 'linux')
|
|
10
|
+
return false;
|
|
11
|
+
if (process.env.WSL_DISTRO_NAME || process.env.WSL_INTEROP)
|
|
12
|
+
return true;
|
|
13
|
+
try {
|
|
14
|
+
return /microsoft/i.test(readFileSync('/proc/version', 'utf-8'));
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const WINDOWS_PSEUDO_USERS = new Set(['All Users', 'Default', 'Default User', 'Public', 'desktop.ini']);
|
|
21
|
+
/** Under WSL, find a same-named project folder on the Windows side
|
|
22
|
+
* (C:\Users\<name>\GipityProjects\<dir>) that is NOT the linked project.
|
|
23
|
+
* From Windows Explorer that folder looks like "the project", so users drop
|
|
24
|
+
* new files there - but nothing syncs from it. Returns the twin's WSL path,
|
|
25
|
+
* or null when there is no twin (or no Windows mount at all). */
|
|
26
|
+
export function findWindowsTwinProject(projectRoot, usersBase = '/mnt/c/Users') {
|
|
27
|
+
try {
|
|
28
|
+
const name = basename(projectRoot);
|
|
29
|
+
if (!name)
|
|
30
|
+
return null;
|
|
31
|
+
const realRoot = realpathSync(projectRoot);
|
|
32
|
+
for (const user of readdirSync(usersBase)) {
|
|
33
|
+
if (WINDOWS_PSEUDO_USERS.has(user))
|
|
34
|
+
continue;
|
|
35
|
+
const candidate = join(usersBase, user, 'GipityProjects', name);
|
|
36
|
+
try {
|
|
37
|
+
if (!statSync(candidate).isDirectory())
|
|
38
|
+
continue;
|
|
39
|
+
if (realpathSync(candidate) === realRoot)
|
|
40
|
+
continue; // the linked project itself lives on /mnt/c
|
|
41
|
+
return candidate;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// this user has no such folder - keep scanning
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
// usersBase unreadable: not WSL, or no C: mount
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
/** /mnt/c/Users/steve/... -> C:\Users\steve\... for display to a Windows user. */
|
|
54
|
+
export function wslPathToWindows(p) {
|
|
55
|
+
const m = p.match(/^\/mnt\/([a-z])\/(.*)$/);
|
|
56
|
+
if (!m)
|
|
57
|
+
return p;
|
|
58
|
+
return `${m[1].toUpperCase()}:\\${m[2].replace(/\//g, '\\')}`;
|
|
59
|
+
}
|
|
3
60
|
/** Safely decode a JWT payload without signature validation */
|
|
4
61
|
export function decodeJwtExp(token) {
|
|
5
62
|
try {
|
|
@@ -60,8 +117,8 @@ function rerunWithYes() {
|
|
|
60
117
|
*
|
|
61
118
|
* - `opts.default` controls which answer Enter / unknown-key selects. Defaults to `'no'`.
|
|
62
119
|
* - `opts.skip` (or the global `--yes` flag) auto-returns `true`.
|
|
63
|
-
* - Renders a `[Y/n]
|
|
64
|
-
* their own y/N suffix to `question`.
|
|
120
|
+
* - Renders a `[Y/n]:` or `[y/N]:` hint automatically - callers should NOT
|
|
121
|
+
* append their own y/N suffix (or a trailing `?`/`:`) to `question`.
|
|
65
122
|
* - In non-TTY environments without `--yes`, returns `false` and prints a hint. */
|
|
66
123
|
export async function confirm(question, opts = {}) {
|
|
67
124
|
const defaultYes = opts.default === 'yes';
|
|
@@ -75,7 +132,7 @@ export async function confirm(question, opts = {}) {
|
|
|
75
132
|
return false;
|
|
76
133
|
}
|
|
77
134
|
const hint = defaultYes ? dim('[Y/n]') : dim('[y/N]');
|
|
78
|
-
process.stdout.write(`${question} ${hint} `);
|
|
135
|
+
process.stdout.write(`${question} ${hint}: `);
|
|
79
136
|
const { stdin } = process;
|
|
80
137
|
const wasRaw = stdin.isRaw ?? false;
|
|
81
138
|
stdin.setRawMode(true);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gipity",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.5",
|
|
4
4
|
"description": "The full-stack platform tuned for AI agents. Database, storage, auth, functions, deploy, and drop-in kits - all agent-tuned. Pair with Claude Code or use standalone.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"gipity": "dist/updater/shim.js",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"prepack": "npm run build",
|
|
15
15
|
"dev": "tsc --watch",
|
|
16
16
|
"test": "npm run test:smoke",
|
|
17
|
-
"test:smoke": "npm run build && node --test dist/__tests__/utils.test.js dist/__tests__/platform.test.js dist/__tests__/colors.test.js dist/__tests__/config.test.js dist/__tests__/sync.test.js dist/__tests__/sync-apply.test.js dist/__tests__/sync-unretrievable.test.js dist/__tests__/sync-clean-check.test.js dist/__tests__/sync-lock.test.js dist/__tests__/auth-lock.test.js dist/__tests__/api-401-retry.test.js dist/__tests__/push-cas.test.js dist/__tests__/upload.test.js dist/__tests__/progress.test.js dist/__tests__/updater.test.js dist/__tests__/cli-smoke.test.js dist/__tests__/claude-noninteractive.test.js dist/__tests__/claude-trust.test.js dist/__tests__/build-picker.test.js dist/__tests__/relay-state.test.js dist/__tests__/relay-daemon.test.js dist/__tests__/session-pool.test.js dist/__tests__/relay-diagnostics.test.js dist/__tests__/relay-installers.test.js dist/__tests__/relay-bridge-abort.test.js dist/__tests__/relay-redact.test.js dist/__tests__/relay-machine-id.test.js dist/__tests__/stream-json.test.js dist/__tests__/ingest-queue.test.js dist/__tests__/media-upload.test.js dist/__tests__/stream-delta.test.js dist/__tests__/phase-tracker.test.js dist/__tests__/relay-ingest-contract.test.js dist/__tests__/prompts.test.js dist/__tests__/capture-transcript.test.js dist/__tests__/capture-parsers.test.js dist/__tests__/agents.test.js dist/__tests__/capture-lock.test.js dist/__tests__/capture-resolve.test.js dist/__tests__/flag-aliases.test.js dist/__tests__/client-context.test.js dist/__tests__/adopt-cwd.test.js dist/__tests__/cli-cmd-agent.test.js dist/__tests__/cli-cmd-approval.test.js dist/__tests__/cli-cmd-audit.test.js dist/__tests__/cli-cmd-bug.test.js dist/__tests__/cli-cmd-bug-queue.test.js dist/__tests__/cli-cmd-chat.test.js dist/__tests__/cli-cmd-credits.test.js dist/__tests__/cli-cmd-db.test.js dist/__tests__/cli-cmd-deploy.test.js dist/__tests__/cli-cmd-domain.test.js dist/__tests__/cli-cmd-email.test.js dist/__tests__/cli-cmd-file.test.js dist/__tests__/cli-cmd-storage.test.js dist/__tests__/cli-cmd-fn.test.js dist/__tests__/cli-cmd-service.test.js dist/__tests__/cli-cmd-job.test.js dist/__tests__/cli-cmd-generate.test.js dist/__tests__/cli-cmd-gmail.test.js dist/__tests__/cli-cmd-info.test.js dist/__tests__/cli-cmd-init.test.js dist/__tests__/cli-cmd-location.test.js dist/__tests__/cli-cmd-text.test.js dist/__tests__/cli-cmd-login.test.js dist/__tests__/cli-cmd-logout.test.js dist/__tests__/cli-cmd-token.test.js dist/__tests__/cli-cmd-logs.test.js dist/__tests__/cli-cmd-memory.test.js dist/__tests__/cli-cmd-page.test.js dist/__tests__/cli-cmd-plan.test.js dist/__tests__/cli-cmd-project.test.js dist/__tests__/cli-cmd-rbac.test.js dist/__tests__/cli-cmd-realtime.test.js dist/__tests__/cli-cmd-records.test.js dist/__tests__/cli-cmd-relay.test.js dist/__tests__/cli-cmd-setup.test.js dist/__tests__/cli-cmd-doctor.test.js dist/__tests__/claude-setup.test.js dist/__tests__/cli-cmd-sandbox.test.js dist/__tests__/cli-cmd-add.test.js dist/__tests__/cli-cmd-remove.test.js dist/__tests__/cli-cmd-skill.test.js dist/__tests__/cli-cmd-test.test.js dist/__tests__/cli-cmd-workflow.test.js dist/__tests__/setup-skills-block.test.js dist/__tests__/setup-hooks.test.js dist/__tests__/setup-codex-hooks.test.js dist/__tests__/trace.test.js",
|
|
17
|
+
"test:smoke": "npm run build && node --test dist/__tests__/utils.test.js dist/__tests__/platform.test.js dist/__tests__/colors.test.js dist/__tests__/config.test.js dist/__tests__/sync.test.js dist/__tests__/sync-apply.test.js dist/__tests__/sync-unretrievable.test.js dist/__tests__/sync-clean-check.test.js dist/__tests__/sync-lock.test.js dist/__tests__/auth-lock.test.js dist/__tests__/api-401-retry.test.js dist/__tests__/push-cas.test.js dist/__tests__/upload.test.js dist/__tests__/progress.test.js dist/__tests__/updater.test.js dist/__tests__/cli-smoke.test.js dist/__tests__/claude-noninteractive.test.js dist/__tests__/claude-trust.test.js dist/__tests__/build-picker.test.js dist/__tests__/relay-state.test.js dist/__tests__/relay-daemon.test.js dist/__tests__/session-pool.test.js dist/__tests__/relay-diagnostics.test.js dist/__tests__/relay-installers.test.js dist/__tests__/relay-bridge-abort.test.js dist/__tests__/relay-redact.test.js dist/__tests__/relay-machine-id.test.js dist/__tests__/stream-json.test.js dist/__tests__/ingest-queue.test.js dist/__tests__/media-upload.test.js dist/__tests__/stream-delta.test.js dist/__tests__/phase-tracker.test.js dist/__tests__/relay-ingest-contract.test.js dist/__tests__/prompts.test.js dist/__tests__/capture-transcript.test.js dist/__tests__/capture-parsers.test.js dist/__tests__/agents.test.js dist/__tests__/capture-lock.test.js dist/__tests__/capture-resolve.test.js dist/__tests__/flag-aliases.test.js dist/__tests__/client-context.test.js dist/__tests__/adopt-cwd.test.js dist/__tests__/cli-cmd-agent.test.js dist/__tests__/cli-cmd-approval.test.js dist/__tests__/cli-cmd-audit.test.js dist/__tests__/cli-cmd-bug.test.js dist/__tests__/cli-cmd-bug-queue.test.js dist/__tests__/cli-cmd-chat.test.js dist/__tests__/cli-cmd-credits.test.js dist/__tests__/cli-cmd-db.test.js dist/__tests__/cli-cmd-deploy.test.js dist/__tests__/cli-cmd-domain.test.js dist/__tests__/cli-cmd-email.test.js dist/__tests__/cli-cmd-file.test.js dist/__tests__/cli-cmd-storage.test.js dist/__tests__/cli-cmd-fn.test.js dist/__tests__/cli-cmd-service.test.js dist/__tests__/cli-cmd-job.test.js dist/__tests__/cli-cmd-generate.test.js dist/__tests__/cli-cmd-gmail.test.js dist/__tests__/cli-cmd-info.test.js dist/__tests__/cli-cmd-init.test.js dist/__tests__/cli-cmd-location.test.js dist/__tests__/cli-cmd-text.test.js dist/__tests__/cli-cmd-login.test.js dist/__tests__/cli-cmd-status.test.js dist/__tests__/cli-cmd-logout.test.js dist/__tests__/cli-cmd-token.test.js dist/__tests__/cli-cmd-logs.test.js dist/__tests__/cli-cmd-memory.test.js dist/__tests__/cli-cmd-page.test.js dist/__tests__/cli-cmd-plan.test.js dist/__tests__/cli-cmd-project.test.js dist/__tests__/cli-cmd-rbac.test.js dist/__tests__/cli-cmd-realtime.test.js dist/__tests__/cli-cmd-records.test.js dist/__tests__/cli-cmd-relay.test.js dist/__tests__/cli-cmd-setup.test.js dist/__tests__/cli-cmd-doctor.test.js dist/__tests__/claude-setup.test.js dist/__tests__/cli-cmd-sandbox.test.js dist/__tests__/cli-cmd-add.test.js dist/__tests__/cli-cmd-remove.test.js dist/__tests__/cli-cmd-skill.test.js dist/__tests__/cli-cmd-test.test.js dist/__tests__/cli-cmd-workflow.test.js dist/__tests__/setup-skills-block.test.js dist/__tests__/setup-hooks.test.js dist/__tests__/setup-codex-hooks.test.js dist/__tests__/trace.test.js",
|
|
18
18
|
"test:smoke:quick": "node scripts/smoke-quick.mjs",
|
|
19
19
|
"test:e2e": "tsc && GIPITY_E2E=1 node --test --test-timeout=180000 dist/__tests__/cli-e2e-live.test.js dist/__tests__/cli-e2e-sync-live.test.js dist/__tests__/cli-e2e-sync-stress-live.test.js dist/__tests__/cli-e2e-rollback-live.test.js dist/__tests__/cli-e2e-services-media-live.test.js dist/__tests__/cli-e2e-workflow-live.test.js dist/__tests__/cli-e2e-sandbox-live.test.js dist/__tests__/cli-e2e-page-fetch-live.test.js dist/__tests__/cli-e2e-page-test-live.test.js",
|
|
20
20
|
"test:e2e:sync": "tsc && GIPITY_E2E=1 node --test --test-timeout=180000 dist/__tests__/cli-e2e-sync-live.test.js",
|