gipity 1.1.36 → 1.1.37
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/helpers/sync.js +4 -1
- package/dist/index.js +39 -8
- package/dist/knowledge.js +1 -1
- package/dist/setup.js +1 -1
- package/dist/sync.js +47 -6
- package/package.json +1 -1
package/dist/helpers/sync.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* sync.ts - Shared sync-before-action helper.
|
|
3
3
|
*/
|
|
4
|
-
import { sync, isLocalTreeClean, appUploadNote } from '../sync.js';
|
|
4
|
+
import { sync, isLocalTreeClean, appUploadNote, heldLargeNote } from '../sync.js';
|
|
5
5
|
import { muted, error as clrError } from '../colors.js';
|
|
6
6
|
import { createProgressReporter } from '../progress.js';
|
|
7
7
|
/**
|
|
@@ -36,6 +36,9 @@ export async function syncBeforeAction(opts) {
|
|
|
36
36
|
const note = appUploadNote(result.appUploadsLeftLocal);
|
|
37
37
|
if (note && !opts.json)
|
|
38
38
|
console.log(muted(note));
|
|
39
|
+
const held = heldLargeNote(result.heldLarge);
|
|
40
|
+
if (held && !opts.json)
|
|
41
|
+
console.log(muted(held));
|
|
39
42
|
if (result.errors.length > 0 && !opts.json) {
|
|
40
43
|
for (const e of result.errors)
|
|
41
44
|
console.error(clrError(`[sync] ${e}`));
|
package/dist/index.js
CHANGED
|
@@ -7095,7 +7095,7 @@ Write files locally - Gipity's editor hooks (installed into Claude Code, Codex,
|
|
|
7095
7095
|
|
|
7096
7096
|
Files your deployed app stores at runtime through the app uploads API (users' uploads, \`gipity upload\`, or an external service using a project API key; under \`uploads/\` or any custom path) are user content, not source: they stay in Gipity Storage and never sync into this directory, and sync never deletes them. List them with \`gipity file tree\`, read one with \`gipity file cat <path>\`.
|
|
7097
7097
|
|
|
7098
|
-
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.
|
|
7098
|
+
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. Sync also holds back any NEW file over 100 MB outside \`src/\`, \`functions/\` and \`migrations/\` (a stray render or dataset would otherwise upload on every background sync): it stays local, and sync names it each time. Add it to \`.gipityignore\`, or upload it on purpose with \`gipity push <path>\`.
|
|
7099
7099
|
|
|
7100
7100
|
**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.
|
|
7101
7101
|
|
|
@@ -7959,7 +7959,7 @@ var init_setup = __esm({
|
|
|
7959
7959
|
GIPITY_MARKETPLACE_NAME = "gipity";
|
|
7960
7960
|
GIPITY_MARKETPLACE_REPO = "GipityAI/skills";
|
|
7961
7961
|
LEGACY_MARKETPLACE_REPO = "GipityAI/claude-plugin";
|
|
7962
|
-
GIPITY_PLUGIN_VERSION = "0.8.
|
|
7962
|
+
GIPITY_PLUGIN_VERSION = "0.8.3";
|
|
7963
7963
|
AGENTS_SKILLS_DIR = join6(homedir4(), ".agents", "skills");
|
|
7964
7964
|
AGENT_HOOKS_DIR = join6(homedir4(), ".gipity", "agent-hooks");
|
|
7965
7965
|
AGENT_SKILLS_MANIFEST = join6(homedir4(), ".gipity", "agent-skills.json");
|
|
@@ -34982,6 +34982,8 @@ init_setup();
|
|
|
34982
34982
|
var tar2 = __toESM(require_tar_stream(), 1);
|
|
34983
34983
|
var CONFIG_FILE2 = ".gipity.json";
|
|
34984
34984
|
var BULK_DELETE_COUNT = 10;
|
|
34985
|
+
var SYNC_LARGE_FILE_BYTES = 100 * 1024 * 1024;
|
|
34986
|
+
var DEPLOY_ROOTS = ["src/", "functions/", "migrations/"];
|
|
34985
34987
|
var BULK_DELETE_FRACTION = 0.25;
|
|
34986
34988
|
var DOWNLOAD_IDLE_MS = 3e4;
|
|
34987
34989
|
function syncStatePath() {
|
|
@@ -35461,6 +35463,30 @@ function withAppUploadNote(summary, leftLocal) {
|
|
|
35461
35463
|
return note ? `${summary}
|
|
35462
35464
|
${note}` : summary;
|
|
35463
35465
|
}
|
|
35466
|
+
function holdLargeNewUploads(planned, baselineFiles) {
|
|
35467
|
+
const held = [];
|
|
35468
|
+
const actions = planned.actions.filter((a) => {
|
|
35469
|
+
const hold = a.kind === "upload" && !baselineFiles[a.path] && (a.localSize ?? 0) > SYNC_LARGE_FILE_BYTES && !DEPLOY_ROOTS.some((r) => a.path.startsWith(r));
|
|
35470
|
+
if (hold) held.push({ path: a.path, size: a.localSize ?? 0 });
|
|
35471
|
+
return !hold;
|
|
35472
|
+
});
|
|
35473
|
+
if (!held.length) return { planned, held };
|
|
35474
|
+
return { planned: { ...planned, actions, uploads: planned.uploads - held.length }, held };
|
|
35475
|
+
}
|
|
35476
|
+
function heldLargeNote(held) {
|
|
35477
|
+
if (!held.length) return "";
|
|
35478
|
+
const list = held.map((h) => ` ${h.path} (${formatSize(h.size)})`).join("\n");
|
|
35479
|
+
const one = held.length === 1;
|
|
35480
|
+
return `Not uploaded: ${held.length} new file${one ? "" : "s"} over ${formatSize(SYNC_LARGE_FILE_BYTES)}:
|
|
35481
|
+
${list}
|
|
35482
|
+
Add ${one ? "it" : "them"} to .gipityignore to keep ${one ? "it" : "them"} local, or upload on purpose with \`gipity push <path>\`.`;
|
|
35483
|
+
}
|
|
35484
|
+
function withNotes(summary, leftLocal, held) {
|
|
35485
|
+
const note = heldLargeNote(held);
|
|
35486
|
+
const base = withAppUploadNote(summary, leftLocal);
|
|
35487
|
+
return note ? `${base}
|
|
35488
|
+
${note}` : base;
|
|
35489
|
+
}
|
|
35464
35490
|
async function bulkDeleteGuard(p, knownFiles, opts) {
|
|
35465
35491
|
const totalDeletes = p.deletesLocal + p.deletesRemote;
|
|
35466
35492
|
if (totalDeletes === 0) return true;
|
|
@@ -35549,16 +35575,17 @@ async function syncInner(projectGuid2, root, ignore2, opts, interactive) {
|
|
|
35549
35575
|
}
|
|
35550
35576
|
if (needHash.length) p?.phase(`Hashing ${needHash.length} file${needHash.length === 1 ? "" : "s"}...`);
|
|
35551
35577
|
await ensureLocalHashes(root, local, needHash);
|
|
35552
|
-
const planned = plan(local, remote, baseline.files);
|
|
35578
|
+
const { planned, held: heldLarge } = holdLargeNewUploads(plan(local, remote, baseline.files), baseline.files);
|
|
35553
35579
|
if (opts.plan) {
|
|
35554
35580
|
return {
|
|
35555
35581
|
plan: planned,
|
|
35556
35582
|
applied: 0,
|
|
35557
35583
|
skipped: 0,
|
|
35558
35584
|
errors: [],
|
|
35559
|
-
summary:
|
|
35585
|
+
summary: withNotes(formatPlan(planned), appUploadsLeftLocal, heldLarge),
|
|
35560
35586
|
deferredDeletes: 0,
|
|
35561
|
-
appUploadsLeftLocal
|
|
35587
|
+
appUploadsLeftLocal,
|
|
35588
|
+
heldLarge
|
|
35562
35589
|
};
|
|
35563
35590
|
}
|
|
35564
35591
|
if (opts.confirmMerge && remote.size > 0 && // project already has files - a real merge target
|
|
@@ -35581,7 +35608,8 @@ async function syncInner(projectGuid2, root, ignore2, opts, interactive) {
|
|
|
35581
35608
|
].join("\n"),
|
|
35582
35609
|
deferredDeletes: 0,
|
|
35583
35610
|
aborted: true,
|
|
35584
|
-
appUploadsLeftLocal: []
|
|
35611
|
+
appUploadsLeftLocal: [],
|
|
35612
|
+
heldLarge: []
|
|
35585
35613
|
});
|
|
35586
35614
|
if (getAutoConfirm()) {
|
|
35587
35615
|
} else if (interactive) {
|
|
@@ -36021,9 +36049,10 @@ async function syncInner(projectGuid2, root, ignore2, opts, interactive) {
|
|
|
36021
36049
|
applied,
|
|
36022
36050
|
skipped: skippedByGuard,
|
|
36023
36051
|
errors,
|
|
36024
|
-
summary:
|
|
36052
|
+
summary: withNotes(formatPlan(planned), appUploadsLeftLocal, heldLarge),
|
|
36025
36053
|
deferredDeletes: skippedByGuard,
|
|
36026
|
-
appUploadsLeftLocal
|
|
36054
|
+
appUploadsLeftLocal,
|
|
36055
|
+
heldLarge
|
|
36027
36056
|
};
|
|
36028
36057
|
}
|
|
36029
36058
|
function cleanupEmptyDirs(root, emptiedDirs) {
|
|
@@ -36255,6 +36284,8 @@ async function syncBeforeAction(opts) {
|
|
|
36255
36284
|
}
|
|
36256
36285
|
const note = appUploadNote(result.appUploadsLeftLocal);
|
|
36257
36286
|
if (note && !opts.json) console.log(muted(note));
|
|
36287
|
+
const held = heldLargeNote(result.heldLarge);
|
|
36288
|
+
if (held && !opts.json) console.log(muted(held));
|
|
36258
36289
|
if (result.errors.length > 0 && !opts.json) {
|
|
36259
36290
|
for (const e of result.errors) console.error(error(`[sync] ${e}`));
|
|
36260
36291
|
}
|
package/dist/knowledge.js
CHANGED
|
@@ -152,7 +152,7 @@ Write files locally - Gipity's editor hooks (installed into Claude Code, Codex,
|
|
|
152
152
|
|
|
153
153
|
Files your deployed app stores at runtime through the app uploads API (users' uploads, \`gipity upload\`, or an external service using a project API key; under \`uploads/\` or any custom path) are user content, not source: they stay in Gipity Storage and never sync into this directory, and sync never deletes them. List them with \`gipity file tree\`, read one with \`gipity file cat <path>\`.
|
|
154
154
|
|
|
155
|
-
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.
|
|
155
|
+
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. Sync also holds back any NEW file over 100 MB outside \`src/\`, \`functions/\` and \`migrations/\` (a stray render or dataset would otherwise upload on every background sync): it stays local, and sync names it each time. Add it to \`.gipityignore\`, or upload it on purpose with \`gipity push <path>\`.
|
|
156
156
|
|
|
157
157
|
**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.
|
|
158
158
|
|
package/dist/setup.js
CHANGED
|
@@ -172,7 +172,7 @@ export const LEGACY_MARKETPLACE_REPO = 'GipityAI/claude-plugin';
|
|
|
172
172
|
// an installed plugin when the marketplace advances - only an explicit
|
|
173
173
|
// `plugin install`/`update` does - so this constant is how a CLI upgrade tells
|
|
174
174
|
// ensureGipityPluginInstalled() to refresh a stale user-scope install.
|
|
175
|
-
export const GIPITY_PLUGIN_VERSION = '0.8.
|
|
175
|
+
export const GIPITY_PLUGIN_VERSION = '0.8.3';
|
|
176
176
|
/** True for hook commands the CLI itself wrote into settings.json in past
|
|
177
177
|
* versions. Matched by signature so migration strips exactly our own
|
|
178
178
|
* entries and never touches user-authored hooks. */
|
package/dist/sync.js
CHANGED
|
@@ -38,6 +38,14 @@ import * as tar from 'tar-stream';
|
|
|
38
38
|
* deletion in a small project isn't noise, and many deletions in a huge
|
|
39
39
|
* project probably are intentional. */
|
|
40
40
|
const BULK_DELETE_COUNT = 10;
|
|
41
|
+
/** New files above this size are held back from a full sync (see
|
|
42
|
+
* holdLargeNewUploads). A stray render or dataset dropped into a project
|
|
43
|
+
* folder otherwise uploads on every background sync: the UserPromptSubmit
|
|
44
|
+
* hook timed out mid-upload, never finished, and stalled every prompt. */
|
|
45
|
+
export const SYNC_LARGE_FILE_BYTES = 100 * 1024 * 1024;
|
|
46
|
+
/** Folders deploy ships. Large files here are part of the app, so they always
|
|
47
|
+
* sync (holding one back would silently drop it from the next deploy). */
|
|
48
|
+
const DEPLOY_ROOTS = ['src/', 'functions/', 'migrations/'];
|
|
41
49
|
const BULK_DELETE_FRACTION = 0.25;
|
|
42
50
|
/** A tar download that stops producing bytes for this long - without ever
|
|
43
51
|
* ending the stream - is treated as a stall and aborted, so a wedged
|
|
@@ -699,6 +707,39 @@ function withAppUploadNote(summary, leftLocal) {
|
|
|
699
707
|
const note = appUploadNote(leftLocal);
|
|
700
708
|
return note ? `${summary}\n${note}` : summary;
|
|
701
709
|
}
|
|
710
|
+
/** Pull new, never-synced files over SYNC_LARGE_FILE_BYTES out of the upload
|
|
711
|
+
* plan. A file already in the baseline was synced on purpose and keeps
|
|
712
|
+
* syncing; files under the deploy roots always sync. Pure: returns a new plan
|
|
713
|
+
* plus the held files. Exported for tests. */
|
|
714
|
+
export function holdLargeNewUploads(planned, baselineFiles) {
|
|
715
|
+
const held = [];
|
|
716
|
+
const actions = planned.actions.filter(a => {
|
|
717
|
+
const hold = a.kind === 'upload' &&
|
|
718
|
+
!baselineFiles[a.path] &&
|
|
719
|
+
(a.localSize ?? 0) > SYNC_LARGE_FILE_BYTES &&
|
|
720
|
+
!DEPLOY_ROOTS.some(r => a.path.startsWith(r));
|
|
721
|
+
if (hold)
|
|
722
|
+
held.push({ path: a.path, size: a.localSize ?? 0 });
|
|
723
|
+
return !hold;
|
|
724
|
+
});
|
|
725
|
+
if (!held.length)
|
|
726
|
+
return { planned, held };
|
|
727
|
+
return { planned: { ...planned, actions, uploads: planned.uploads - held.length }, held };
|
|
728
|
+
}
|
|
729
|
+
/** One-paragraph note for held large files: what happened and the two ways out. */
|
|
730
|
+
export function heldLargeNote(held) {
|
|
731
|
+
if (!held.length)
|
|
732
|
+
return '';
|
|
733
|
+
const list = held.map(h => ` ${h.path} (${formatSize(h.size)})`).join('\n');
|
|
734
|
+
const one = held.length === 1;
|
|
735
|
+
return `Not uploaded: ${held.length} new file${one ? '' : 's'} over ${formatSize(SYNC_LARGE_FILE_BYTES)}:\n${list}\n` +
|
|
736
|
+
`Add ${one ? 'it' : 'them'} to .gipityignore to keep ${one ? 'it' : 'them'} local, or upload on purpose with \`gipity push <path>\`.`;
|
|
737
|
+
}
|
|
738
|
+
function withNotes(summary, leftLocal, held) {
|
|
739
|
+
const note = heldLargeNote(held);
|
|
740
|
+
const base = withAppUploadNote(summary, leftLocal);
|
|
741
|
+
return note ? `${base}\n${note}` : base;
|
|
742
|
+
}
|
|
702
743
|
async function bulkDeleteGuard(p, knownFiles, opts) {
|
|
703
744
|
const totalDeletes = p.deletesLocal + p.deletesRemote;
|
|
704
745
|
if (totalDeletes === 0)
|
|
@@ -864,13 +905,13 @@ async function syncInner(projectGuid, root, ignore, opts, interactive) {
|
|
|
864
905
|
if (needHash.length)
|
|
865
906
|
p?.phase(`Hashing ${needHash.length} file${needHash.length === 1 ? '' : 's'}...`);
|
|
866
907
|
await ensureLocalHashes(root, local, needHash);
|
|
867
|
-
const planned = plan(local, remote, baseline.files);
|
|
908
|
+
const { planned, held: heldLarge } = holdLargeNewUploads(plan(local, remote, baseline.files), baseline.files);
|
|
868
909
|
if (opts.plan) {
|
|
869
910
|
return {
|
|
870
911
|
plan: planned, applied: 0, skipped: 0, errors: [],
|
|
871
|
-
summary:
|
|
912
|
+
summary: withNotes(formatPlan(planned), appUploadsLeftLocal, heldLarge),
|
|
872
913
|
deferredDeletes: 0,
|
|
873
|
-
appUploadsLeftLocal,
|
|
914
|
+
appUploadsLeftLocal, heldLarge,
|
|
874
915
|
};
|
|
875
916
|
}
|
|
876
917
|
// Uncertain-merge guard (armed via confirmMerge): syncing INTO a populated
|
|
@@ -903,7 +944,7 @@ async function syncInner(projectGuid, root, ignore, opts, interactive) {
|
|
|
903
944
|
...shape,
|
|
904
945
|
`Re-run with --yes to merge, or sync into an empty folder.`,
|
|
905
946
|
].join('\n'),
|
|
906
|
-
deferredDeletes: 0, aborted: true, appUploadsLeftLocal: [],
|
|
947
|
+
deferredDeletes: 0, aborted: true, appUploadsLeftLocal: [], heldLarge: [],
|
|
907
948
|
});
|
|
908
949
|
if (getAutoConfirm()) {
|
|
909
950
|
// --yes: proceed with the merge; the caller reports the applied counts.
|
|
@@ -1490,9 +1531,9 @@ async function syncInner(projectGuid, root, ignore, opts, interactive) {
|
|
|
1490
1531
|
applied,
|
|
1491
1532
|
skipped: skippedByGuard,
|
|
1492
1533
|
errors,
|
|
1493
|
-
summary:
|
|
1534
|
+
summary: withNotes(formatPlan(planned), appUploadsLeftLocal, heldLarge),
|
|
1494
1535
|
deferredDeletes: skippedByGuard,
|
|
1495
|
-
appUploadsLeftLocal,
|
|
1536
|
+
appUploadsLeftLocal, heldLarge,
|
|
1496
1537
|
};
|
|
1497
1538
|
}
|
|
1498
1539
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gipity",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.37",
|
|
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",
|