@signetai/core 0.217.1 → 0.217.3
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/index.js
CHANGED
|
@@ -22335,12 +22335,15 @@ function resolveWorkspaceSourceRepoPath(workspaceDir, repoDirName = SIGNET_SOURC
|
|
|
22335
22335
|
return join9(resolve4(workspaceDir), repoDirName);
|
|
22336
22336
|
}
|
|
22337
22337
|
function syncWorkspaceSourceRepo(workspaceDir, options = {}) {
|
|
22338
|
+
const clone = options.cloneIfMissing === true;
|
|
22338
22339
|
const timeoutMs = options.gitTimeoutMs ?? DEFAULT_GIT_TIMEOUT_MS;
|
|
22339
22340
|
const remoteUrl = options.remoteUrl ?? SIGNET_SOURCE_REMOTE_URL;
|
|
22340
22341
|
const repoPath = resolveWorkspaceSourceRepoPath(workspaceDir, options.repoDirName);
|
|
22341
22342
|
if (!isSafeCloneSource(remoteUrl)) {
|
|
22342
22343
|
return unsafeRemoteResult(repoPath);
|
|
22343
22344
|
}
|
|
22345
|
+
if (!clone && !existsSync8(repoPath))
|
|
22346
|
+
return missingCheckoutResult(repoPath);
|
|
22344
22347
|
if (!isGitAvailable(timeoutMs)) {
|
|
22345
22348
|
return gitUnavailableResult(repoPath);
|
|
22346
22349
|
}
|
|
@@ -22352,18 +22355,21 @@ function syncWorkspaceSourceRepo(workspaceDir, options = {}) {
|
|
|
22352
22355
|
return sourceRepoSyncLockErrorResult(repoPath, lock.message);
|
|
22353
22356
|
}
|
|
22354
22357
|
try {
|
|
22355
|
-
return syncWorkspaceSourceRepoLocked(runGit, workspaceDir, repoPath, remoteUrl, timeoutMs);
|
|
22358
|
+
return syncWorkspaceSourceRepoLocked(runGit, workspaceDir, repoPath, remoteUrl, timeoutMs, clone);
|
|
22356
22359
|
} finally {
|
|
22357
22360
|
releaseSourceRepoSyncLock(lock.lock);
|
|
22358
22361
|
}
|
|
22359
22362
|
}
|
|
22360
22363
|
async function syncWorkspaceSourceRepoAsync(workspaceDir, options = {}) {
|
|
22364
|
+
const clone = options.cloneIfMissing === true;
|
|
22361
22365
|
const timeoutMs = options.gitTimeoutMs ?? DEFAULT_GIT_TIMEOUT_MS;
|
|
22362
22366
|
const remoteUrl = options.remoteUrl ?? SIGNET_SOURCE_REMOTE_URL;
|
|
22363
22367
|
const repoPath = resolveWorkspaceSourceRepoPath(workspaceDir, options.repoDirName);
|
|
22364
22368
|
if (!isSafeCloneSource(remoteUrl)) {
|
|
22365
22369
|
return unsafeRemoteResult(repoPath);
|
|
22366
22370
|
}
|
|
22371
|
+
if (!clone && !existsSync8(repoPath))
|
|
22372
|
+
return missingCheckoutResult(repoPath);
|
|
22367
22373
|
if (!await isGitAvailableAsync(timeoutMs)) {
|
|
22368
22374
|
return gitUnavailableResult(repoPath);
|
|
22369
22375
|
}
|
|
@@ -22375,13 +22381,15 @@ async function syncWorkspaceSourceRepoAsync(workspaceDir, options = {}) {
|
|
|
22375
22381
|
return sourceRepoSyncLockErrorResult(repoPath, lock.message);
|
|
22376
22382
|
}
|
|
22377
22383
|
try {
|
|
22378
|
-
return await syncWorkspaceSourceRepoLocked(runGitAsync, workspaceDir, repoPath, remoteUrl, timeoutMs);
|
|
22384
|
+
return await syncWorkspaceSourceRepoLocked(runGitAsync, workspaceDir, repoPath, remoteUrl, timeoutMs, clone);
|
|
22379
22385
|
} finally {
|
|
22380
22386
|
releaseSourceRepoSyncLock(lock.lock);
|
|
22381
22387
|
}
|
|
22382
22388
|
}
|
|
22383
|
-
function syncWorkspaceSourceRepoLocked(run, workspaceDir, repoPath, remoteUrl, timeoutMs) {
|
|
22389
|
+
function syncWorkspaceSourceRepoLocked(run, workspaceDir, repoPath, remoteUrl, timeoutMs, cloneIfMissing) {
|
|
22384
22390
|
if (!existsSync8(repoPath) || isEmptyDirectory(repoPath)) {
|
|
22391
|
+
if (!cloneIfMissing)
|
|
22392
|
+
return missingCheckoutResult(repoPath);
|
|
22385
22393
|
const workspaceReady = ensureWorkspaceDir(workspaceDir);
|
|
22386
22394
|
if (workspaceReady.ok === false) {
|
|
22387
22395
|
return errorResult(repoPath, workspaceReady.message);
|
|
@@ -22695,6 +22703,15 @@ function releaseSourceRepoSyncLock(lock) {
|
|
|
22695
22703
|
async function sleep(ms) {
|
|
22696
22704
|
await new Promise((resolve5) => setTimeout(resolve5, ms));
|
|
22697
22705
|
}
|
|
22706
|
+
function missingCheckoutResult(repoPath) {
|
|
22707
|
+
return {
|
|
22708
|
+
status: "skipped",
|
|
22709
|
+
path: repoPath,
|
|
22710
|
+
message: "No Signet source checkout; source builds can create one explicitly",
|
|
22711
|
+
branch: null,
|
|
22712
|
+
defaultBranch: null
|
|
22713
|
+
};
|
|
22714
|
+
}
|
|
22698
22715
|
function unsafeRemoteResult(repoPath) {
|
|
22699
22716
|
return {
|
|
22700
22717
|
status: "error",
|
|
@@ -22886,7 +22903,7 @@ function parsePorcelainStatusPath(line) {
|
|
|
22886
22903
|
const rawPath = line.slice(3);
|
|
22887
22904
|
const renameSeparator = " -> ";
|
|
22888
22905
|
const path = rawPath.includes(renameSeparator) ? rawPath.slice(rawPath.lastIndexOf(renameSeparator) + renameSeparator.length) : rawPath;
|
|
22889
|
-
return path.replace(
|
|
22906
|
+
return path.replace(/^"|"$/g, "");
|
|
22890
22907
|
}
|
|
22891
22908
|
function readUpstreamBranchWith(run, repoPath, timeoutMs) {
|
|
22892
22909
|
return mapMaybePromise(run(["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{upstream}"], repoPath, timeoutMs), (result) => readTrimmedValue(result));
|
|
@@ -2,6 +2,8 @@ export declare const SIGNET_SOURCE_CHECKOUT_DIRNAME = "signetai";
|
|
|
2
2
|
export declare const SIGNET_SOURCE_REMOTE_URL = "https://github.com/Signet-AI/signetai.git";
|
|
3
3
|
export type WorkspaceSourceRepoStatus = "cloned" | "pulled" | "fetched" | "current" | "skipped" | "error";
|
|
4
4
|
export interface WorkspaceSourceRepoSyncOptions {
|
|
5
|
+
/** Only explicit source builds may create a checkout; routine sync updates existing repositories. */
|
|
6
|
+
readonly cloneIfMissing?: boolean;
|
|
5
7
|
readonly gitTimeoutMs?: number;
|
|
6
8
|
readonly remoteUrl?: string;
|
|
7
9
|
readonly repoDirName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-source-repo.d.ts","sourceRoot":"","sources":["../src/workspace-source-repo.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,8BAA8B,aAAa,CAAC;AACzD,eAAO,MAAM,wBAAwB,8CAA8C,CAAC;AAOpF,MAAM,MAAM,yBAAyB,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE1G,MAAM,WAAW,8BAA8B;IAC9C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,6BAA6B;IAC7C,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAuCD,wBAAgB,8BAA8B,CAC7C,YAAY,EAAE,MAAM,EACpB,WAAW,SAAiC,GAC1C,MAAM,CAER;AAED,wBAAgB,uBAAuB,CACtC,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,8BAAmC,GAC1C,6BAA6B,
|
|
1
|
+
{"version":3,"file":"workspace-source-repo.d.ts","sourceRoot":"","sources":["../src/workspace-source-repo.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,8BAA8B,aAAa,CAAC;AACzD,eAAO,MAAM,wBAA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