@skaile/workspaces 4.27.3 → 4.28.0
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/CHANGELOG.md +8 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-YB2G5ASA.js → asset-feeds-DRGVRBN5.js} +4 -4
- package/dist/{asset-feeds-YB2G5ASA.js.map → asset-feeds-DRGVRBN5.js.map} +1 -1
- package/dist/asset-manager/index.js +1 -1
- package/dist/bridge/drivers/claude-sdk.js +4 -4
- package/dist/bridge/drivers/codex.js +2 -2
- package/dist/bridge/drivers/continue.js +3 -3
- package/dist/bridge/drivers/echo.js +3 -3
- package/dist/bridge/drivers/gemini.js +5 -5
- package/dist/bridge/drivers/goose.js +3 -3
- package/dist/bridge/drivers/omp.js +4 -4
- package/dist/bridge/drivers/opencode.js +3 -3
- package/dist/bridge/drivers/qwen.js +5 -5
- package/dist/bridge/index.js +5 -5
- package/dist/{chunk-YOPE344M.js → chunk-2JANXYTJ.js} +2 -2
- package/dist/chunk-2JANXYTJ.js.map +1 -0
- package/dist/{chunk-CMWAGYP7.js → chunk-2LJDCZLP.js} +3 -3
- package/dist/{chunk-CMWAGYP7.js.map → chunk-2LJDCZLP.js.map} +1 -1
- package/dist/{chunk-LAMLMF7I.js → chunk-32POIALR.js} +2 -2
- package/dist/{chunk-LAMLMF7I.js.map → chunk-32POIALR.js.map} +1 -1
- package/dist/{chunk-3MMMZDGA.js → chunk-36HJNHDN.js} +4 -4
- package/dist/{chunk-3MMMZDGA.js.map → chunk-36HJNHDN.js.map} +1 -1
- package/dist/{chunk-KVWSBQNP.js → chunk-5UQNCPIP.js} +3 -3
- package/dist/{chunk-KVWSBQNP.js.map → chunk-5UQNCPIP.js.map} +1 -1
- package/dist/{chunk-GKE66NTN.js → chunk-6ZELKHAI.js} +3 -3
- package/dist/{chunk-GKE66NTN.js.map → chunk-6ZELKHAI.js.map} +1 -1
- package/dist/{chunk-GRBB4CQL.js → chunk-DJZRPPFJ.js} +2 -2
- package/dist/chunk-DJZRPPFJ.js.map +1 -0
- package/dist/{chunk-AVYBLJ3A.js → chunk-DMXEFYND.js} +3 -3
- package/dist/{chunk-AVYBLJ3A.js.map → chunk-DMXEFYND.js.map} +1 -1
- package/dist/{chunk-TRRFUVDJ.js → chunk-ERDK4ATM.js} +3 -3
- package/dist/{chunk-TRRFUVDJ.js.map → chunk-ERDK4ATM.js.map} +1 -1
- package/dist/{chunk-RHMQ5ZFT.js → chunk-G3VT2BCY.js} +190 -28
- package/dist/chunk-G3VT2BCY.js.map +1 -0
- package/dist/{chunk-IQID7X6P.js → chunk-H5EGBMZ5.js} +2 -2
- package/dist/{chunk-IQID7X6P.js.map → chunk-H5EGBMZ5.js.map} +1 -1
- package/dist/{chunk-OX7SQXTG.js → chunk-HCHH6TPK.js} +3 -3
- package/dist/{chunk-OX7SQXTG.js.map → chunk-HCHH6TPK.js.map} +1 -1
- package/dist/{chunk-F4ECQAN3.js → chunk-HFVK7FKK.js} +3 -3
- package/dist/{chunk-F4ECQAN3.js.map → chunk-HFVK7FKK.js.map} +1 -1
- package/dist/{chunk-76VT47KJ.js → chunk-LCLEAHFX.js} +6 -6
- package/dist/{chunk-76VT47KJ.js.map → chunk-LCLEAHFX.js.map} +1 -1
- package/dist/{chunk-TM3WSOFC.js → chunk-PL4LZ4OQ.js} +2 -2
- package/dist/{chunk-TM3WSOFC.js.map → chunk-PL4LZ4OQ.js.map} +1 -1
- package/dist/{chunk-BADVX5LG.js → chunk-Q2AOHZFF.js} +4 -4
- package/dist/{chunk-BADVX5LG.js.map → chunk-Q2AOHZFF.js.map} +1 -1
- package/dist/{chunk-QDVMO5OD.js → chunk-RISETQGB.js} +3 -3
- package/dist/{chunk-QDVMO5OD.js.map → chunk-RISETQGB.js.map} +1 -1
- package/dist/{chunk-EPQ77JC2.js → chunk-V73R7GJC.js} +3 -3
- package/dist/{chunk-EPQ77JC2.js.map → chunk-V73R7GJC.js.map} +1 -1
- package/dist/{chunk-HMUFI3L5.js → chunk-VSG3YPG4.js} +3 -3
- package/dist/{chunk-HMUFI3L5.js.map → chunk-VSG3YPG4.js.map} +1 -1
- package/dist/{chunk-JNYGVLLM.js → chunk-WYDJPPUF.js} +6 -6
- package/dist/{chunk-JNYGVLLM.js.map → chunk-WYDJPPUF.js.map} +1 -1
- package/dist/{chunk-NLUW3IJL.js → chunk-X5CW2HDM.js} +3 -3
- package/dist/{chunk-NLUW3IJL.js.map → chunk-X5CW2HDM.js.map} +1 -1
- package/dist/{chunk-LFYAU2H3.js → chunk-XEBSA7YU.js} +6 -6
- package/dist/{chunk-LFYAU2H3.js.map → chunk-XEBSA7YU.js.map} +1 -1
- package/dist/{chunk-XQEB4FZ4.js → chunk-ZQWC5WBF.js} +11 -11
- package/dist/{chunk-XQEB4FZ4.js.map → chunk-ZQWC5WBF.js.map} +1 -1
- package/dist/cli/index.js +36 -36
- package/dist/connectors/config.js +1 -1
- package/dist/connectors/index.js +8 -8
- package/dist/connectors/src/connector-base.d.ts +3 -3
- package/dist/connectors/src/connector-base.d.ts.map +1 -1
- package/dist/connectors/src/connector-manager.d.ts +1 -7
- package/dist/connectors/src/connector-manager.d.ts.map +1 -1
- package/dist/connectors/src/connector-types.d.ts +15 -3
- package/dist/connectors/src/connector-types.d.ts.map +1 -1
- package/dist/connectors/src/index.d.ts +1 -1
- package/dist/connectors/src/index.d.ts.map +1 -1
- package/dist/connectors-shared/index.js +2 -2
- package/dist/{ensure-sources-WZL35TMD.js → ensure-sources-LLUFLA2F.js} +4 -4
- package/dist/{ensure-sources-WZL35TMD.js.map → ensure-sources-LLUFLA2F.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +8 -8
- package/dist/factory-assets/connectors/deploy.js +8 -8
- package/dist/factory-assets/connectors/devserver.js +8 -8
- package/dist/factory-assets/connectors/flow/adapter.js +8 -8
- package/dist/factory-assets/connectors/flow/run-flow.js +9 -9
- package/dist/factory-assets/connectors/flow.js +8 -8
- package/dist/factory-assets/connectors/git/driver.d.ts +37 -2
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +8 -8
- package/dist/factory-assets/connectors/gmail.js +8 -8
- package/dist/factory-assets/connectors/googledrive.js +8 -8
- package/dist/factory-assets/connectors/local.js +8 -8
- package/dist/factory-assets/connectors/mattermost.js +8 -8
- package/dist/factory-assets/connectors/memory.js +8 -8
- package/dist/factory-assets/connectors/minio.js +8 -8
- package/dist/factory-assets/connectors/postgres.js +8 -8
- package/dist/factory-assets/connectors/s3.js +8 -8
- package/dist/factory-assets/connectors/sharepoint.js +8 -8
- package/dist/factory-assets/connectors/sqlite.js +8 -8
- package/dist/factory-assets/connectors/static-server.js +8 -8
- package/dist/factory-assets/connectors/tunnel.js +8 -8
- package/dist/factory-assets/connectors/webdav.js +8 -8
- package/dist/factory-assets/connectors/xstate-store.js +8 -8
- package/dist/factory-assets/connectors/xstate.js +8 -8
- package/dist/{helpers-5DLQSUB7.js → helpers-KUI4C7BN.js} +4 -4
- package/dist/{helpers-5DLQSUB7.js.map → helpers-KUI4C7BN.js.map} +1 -1
- package/dist/{library-publish-XJPEJKHY.js → library-publish-JURXXSXX.js} +6 -6
- package/dist/{library-publish-XJPEJKHY.js.map → library-publish-JURXXSXX.js.map} +1 -1
- package/dist/{open-library-UDTZCLXQ.js → open-library-B67SV3J5.js} +5 -5
- package/dist/{open-library-UDTZCLXQ.js.map → open-library-B67SV3J5.js.map} +1 -1
- package/dist/{project-YMEDDXTO.js → project-DY7ZOBMA.js} +5 -5
- package/dist/{project-YMEDDXTO.js.map → project-DY7ZOBMA.js.map} +1 -1
- package/dist/runner/index.js +12 -12
- package/dist/runner/src/lifecycle-handler.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +1 -1
- package/dist/sdk/bridge.js +5 -5
- package/dist/sdk/index.js +12 -12
- package/dist/sdk/runner.js +12 -12
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/session/index.js +2 -2
- package/dist/{setup-NGFLSHDL.js → setup-YAHBP22C.js} +10 -10
- package/dist/{setup-NGFLSHDL.js.map → setup-YAHBP22C.js.map} +1 -1
- package/dist/{source-BLV2FY5K.js → source-LB6KXJQD.js} +6 -6
- package/dist/{source-BLV2FY5K.js.map → source-LB6KXJQD.js.map} +1 -1
- package/dist/{source-manifest-publish-EKBNHC54.js → source-manifest-publish-O76QKC22.js} +7 -7
- package/dist/{source-manifest-publish-EKBNHC54.js.map → source-manifest-publish-O76QKC22.js.map} +1 -1
- package/dist/tui/index.js +12 -12
- package/dist/types/index.js +1 -1
- package/dist/types/src/events.d.ts +45 -0
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +2 -2
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GRBB4CQL.js.map +0 -1
- package/dist/chunk-RHMQ5ZFT.js.map +0 -1
- package/dist/chunk-YOPE344M.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { declaredConnectErrorKind, ClassifiedConnectError, withConnectErrorKind } from './chunk-
|
|
2
|
-
import { OAuthRequiredError, ConnectorFieldMissingError, LegacyAuthGrammarError, resolveAuthRef, readUnavailableMarker, ConnectorStartupError } from './chunk-
|
|
3
|
-
import { EventNormalizer } from './chunk-
|
|
4
|
-
import { resolveModelTier } from './chunk-
|
|
5
|
-
import { createDriver } from './chunk-
|
|
1
|
+
import { declaredConnectErrorKind, ClassifiedConnectError, withConnectErrorKind } from './chunk-5UQNCPIP.js';
|
|
2
|
+
import { OAuthRequiredError, ConnectorFieldMissingError, LegacyAuthGrammarError, resolveAuthRef, readUnavailableMarker, ConnectorStartupError } from './chunk-2JANXYTJ.js';
|
|
3
|
+
import { EventNormalizer } from './chunk-Q2AOHZFF.js';
|
|
4
|
+
import { resolveModelTier } from './chunk-X5CW2HDM.js';
|
|
5
|
+
import { createDriver } from './chunk-H5EGBMZ5.js';
|
|
6
6
|
import { pluginRegistry } from './chunk-6E6PKKAD.js';
|
|
7
7
|
import { computeStimulus } from './chunk-IFGTRL2I.js';
|
|
8
8
|
import { interpolateNodeInstruction, resolveNodeBindings, getConsumedOutputSchema, validateConsumedNodeOutput, appendAttempt, resolveTerminalFailureStatus, remainingActiveExecutionMs, deriveCheckEvidence, computeFlowStateFromSnapshots, availableRouterFrontier, evaluateRouterSelection, routerSelectionOutput, planRouterSkips, unsettledRouterBranchIds, countFailedAttempts, hasAutomaticRetryBudget, persistedRouterSelection } from './chunk-KTCMBEEB.js';
|
|
@@ -11,7 +11,7 @@ import { parseFlowDefinition } from './chunk-ALLCAFHQ.js';
|
|
|
11
11
|
import { describeStimulus, buildOrchestratorPrompt, renderSubpromptPrompt, renderStimulusPrompt } from './chunk-D6YOE2DB.js';
|
|
12
12
|
import { deterministicNodeKindLabel, nodeInstruction, flowDefaults, isAgentNode, isGateNode, isCheckNode, nodeRequiresApproval, isSubFlowNode, isActiveRuntimeNode, isFunctionNode, isSubpromptNode, isRouterNode, nodeIsOptional, nodeLabel, nodeAssets } from './chunk-V4RGCKYC.js';
|
|
13
13
|
import { classifierDecision, withoutReservedClassifierFields } from './chunk-DHMBE5J7.js';
|
|
14
|
-
import { withActivityLabelDefs } from './chunk-
|
|
14
|
+
import { withActivityLabelDefs } from './chunk-DJZRPPFJ.js';
|
|
15
15
|
import { processAlive } from './chunk-4GY63JU6.js';
|
|
16
16
|
import { withFsDeadline, tryWithFsDeadline, FsDeadlineError, fsDeadlineMs } from './chunk-2FBPAR2V.js';
|
|
17
17
|
import { portableSpawn } from './chunk-DPLIN2RA.js';
|
|
@@ -21,6 +21,7 @@ import { mkdir, rename, writeFile, readFile, stat, cp, rmdir, chmod, rm, readdir
|
|
|
21
21
|
import * as z4 from 'zod';
|
|
22
22
|
import { execFile } from 'child_process';
|
|
23
23
|
import { promisify } from 'util';
|
|
24
|
+
import { tmpdir } from 'os';
|
|
24
25
|
import { createReadStream, existsSync, mkdirSync, openSync, closeSync, chmodSync, utimesSync, readFileSync, writeSync, renameSync } from 'fs';
|
|
25
26
|
import { createServer } from 'http';
|
|
26
27
|
import mime from 'mime';
|
|
@@ -1549,6 +1550,10 @@ function gitPrefix(cwd) {
|
|
|
1549
1550
|
return ["-c", `safe.directory=${cwd}`];
|
|
1550
1551
|
}
|
|
1551
1552
|
var SKAILE_INTERNAL_DIR = ".skaile";
|
|
1553
|
+
function isSkaileInternalPath(statusPath) {
|
|
1554
|
+
const p = statusPath.startsWith('"') ? statusPath.slice(1) : statusPath;
|
|
1555
|
+
return p === SKAILE_INTERNAL_DIR || p.startsWith(`${SKAILE_INTERNAL_DIR}/`);
|
|
1556
|
+
}
|
|
1552
1557
|
var SKAILE_EXCLUDE_MARKER = "# skaile: platform-internal session state (git connector)";
|
|
1553
1558
|
var UNSTAGE_BATCH = 500;
|
|
1554
1559
|
async function commitIdentityArgs(cwd) {
|
|
@@ -1689,13 +1694,20 @@ async function ensureSkaileExcluded(cwd, log) {
|
|
|
1689
1694
|
}
|
|
1690
1695
|
}
|
|
1691
1696
|
async function runGit(args, options) {
|
|
1692
|
-
const
|
|
1697
|
+
const pending = execFileAsync2("git", args, {
|
|
1693
1698
|
encoding: "utf-8",
|
|
1694
1699
|
timeout: options.timeout,
|
|
1695
1700
|
killSignal: "SIGKILL",
|
|
1696
1701
|
...options.cwd === void 0 ? {} : { cwd: options.cwd },
|
|
1697
|
-
...options.env === void 0 ? {} : { env: options.env }
|
|
1702
|
+
...options.env === void 0 ? {} : { env: options.env },
|
|
1703
|
+
...options.maxBuffer === void 0 ? {} : { maxBuffer: options.maxBuffer }
|
|
1698
1704
|
});
|
|
1705
|
+
if (options.input !== void 0) {
|
|
1706
|
+
pending.child.stdin?.on("error", () => {
|
|
1707
|
+
});
|
|
1708
|
+
pending.child.stdin?.end(options.input);
|
|
1709
|
+
}
|
|
1710
|
+
const { stdout } = await pending;
|
|
1699
1711
|
return stdout.trim();
|
|
1700
1712
|
}
|
|
1701
1713
|
function git(args, cwd, timeout = 3e4) {
|
|
@@ -1753,8 +1765,9 @@ async function runRemoteGit(args, auth, options) {
|
|
|
1753
1765
|
);
|
|
1754
1766
|
}
|
|
1755
1767
|
const recursion = RECURSING_SUBCOMMANDS.has(subcommandOf(args)) ? NO_SUBMODULE_RECURSION : [];
|
|
1768
|
+
const cwd = options.cwd ?? options.neutralCwd;
|
|
1756
1769
|
return runGit([...gitPrefix(options.safeDir), ...NETWORK_GIT_ARGS, ...recursion, ...args], {
|
|
1757
|
-
...
|
|
1770
|
+
...cwd === void 0 ? {} : { cwd },
|
|
1758
1771
|
timeout: options.timeout,
|
|
1759
1772
|
env: networkGitEnv(withheld === null ? auth : void 0, options.env)
|
|
1760
1773
|
});
|
|
@@ -1987,6 +2000,41 @@ async function gitOrNull(args, cwd) {
|
|
|
1987
2000
|
return null;
|
|
1988
2001
|
}
|
|
1989
2002
|
}
|
|
2003
|
+
var PUSH_STATE_REMOTE_TIMEOUT_MS = 1e4;
|
|
2004
|
+
var PUSH_STATE_LOCAL_TIMEOUT_MS = 1e4;
|
|
2005
|
+
var PROBE_GIT_ARGS = [
|
|
2006
|
+
"-c",
|
|
2007
|
+
"core.fsmonitor=false",
|
|
2008
|
+
"-c",
|
|
2009
|
+
"status.showUntrackedFiles=all",
|
|
2010
|
+
"-c",
|
|
2011
|
+
"core.untrackedCache=false",
|
|
2012
|
+
"-c",
|
|
2013
|
+
"core.excludesFile=/dev/null"
|
|
2014
|
+
];
|
|
2015
|
+
async function probeGitOrNull(args, cwd, input) {
|
|
2016
|
+
try {
|
|
2017
|
+
return await runGit([...gitPrefix(cwd), ...PROBE_GIT_ARGS, ...args], {
|
|
2018
|
+
cwd,
|
|
2019
|
+
timeout: PUSH_STATE_LOCAL_TIMEOUT_MS,
|
|
2020
|
+
env: { ...process.env, GIT_NO_REPLACE_OBJECTS: "1", GIT_WORK_TREE: cwd },
|
|
2021
|
+
maxBuffer: 64 * 1024 * 1024,
|
|
2022
|
+
...input === void 0 ? {} : { input }
|
|
2023
|
+
});
|
|
2024
|
+
} catch {
|
|
2025
|
+
return null;
|
|
2026
|
+
}
|
|
2027
|
+
}
|
|
2028
|
+
async function hasInitialisedSubmodule(cwd) {
|
|
2029
|
+
const staged = await probeGitOrNull(["ls-files", "--stage", "-z"], cwd);
|
|
2030
|
+
if (staged === null) return true;
|
|
2031
|
+
for (const entry of staged.split("\0")) {
|
|
2032
|
+
if (!entry.startsWith("160000 ")) continue;
|
|
2033
|
+
const path = entry.slice(entry.indexOf(" ") + 1);
|
|
2034
|
+
if (await pathExists(join(cwd, path, ".git"))) return true;
|
|
2035
|
+
}
|
|
2036
|
+
return false;
|
|
2037
|
+
}
|
|
1990
2038
|
async function countAheadBehind(cwd, remoteRef) {
|
|
1991
2039
|
const out = await gitOrNull(["rev-list", "--left-right", "--count", `${remoteRef}...HEAD`], cwd);
|
|
1992
2040
|
if (!out) {
|
|
@@ -2995,30 +3043,135 @@ var GitConnector = class extends AbstractConnector {
|
|
|
2995
3043
|
};
|
|
2996
3044
|
}
|
|
2997
3045
|
// ── Session lifecycle ──────────────────────────────────────────────────────
|
|
3046
|
+
/**
|
|
3047
|
+
* Commit and push per the lifecycle config, then report what the checkout
|
|
3048
|
+
* can prove afterwards (`pushState`) so the host can tell whether anything
|
|
3049
|
+
* exists only on local disk. A push that throws still throws (no report).
|
|
3050
|
+
*/
|
|
2998
3051
|
async onHibernate(handle) {
|
|
2999
3052
|
this.log.info("hibernate");
|
|
3000
3053
|
const s = handle.state;
|
|
3001
3054
|
if (s.fleetManaged) {
|
|
3002
3055
|
return "fleet-managed";
|
|
3003
3056
|
}
|
|
3004
|
-
const
|
|
3005
|
-
if (!lc.commitOnHibernate) return;
|
|
3057
|
+
const cwd = handle.mountPath;
|
|
3006
3058
|
return this.withMountLock(s, async () => {
|
|
3007
|
-
const
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
if (lc.pushOnHibernate) {
|
|
3011
|
-
try {
|
|
3012
|
-
await this.pushActiveBranch(s, handle.mountPath);
|
|
3013
|
-
this.log.info("push ok", { branch: s.activeBranch });
|
|
3014
|
-
} catch (err) {
|
|
3015
|
-
this.log.error("push failed", err, { branch: s.activeBranch });
|
|
3016
|
-
throw err;
|
|
3017
|
-
}
|
|
3018
|
-
}
|
|
3019
|
-
return `Committed ${sha} on ${s.activeBranch}${lc.pushOnHibernate ? " (pushed)" : ""}`;
|
|
3059
|
+
const detail = await this.hibernateSave(s, cwd);
|
|
3060
|
+
const pushState = await this.readPushState(s, cwd);
|
|
3061
|
+
return detail === void 0 ? { pushState } : { detail, pushState };
|
|
3020
3062
|
});
|
|
3021
3063
|
}
|
|
3064
|
+
/** The commit/push half of {@link onHibernate}; returns its detail line. Runs under the mount lock. */
|
|
3065
|
+
async hibernateSave(s, cwd) {
|
|
3066
|
+
const lc = s.lifecycle;
|
|
3067
|
+
if (!lc.commitOnHibernate) return void 0;
|
|
3068
|
+
const result = await commitAll(cwd, `skaile: hibernate snapshot`, this.log);
|
|
3069
|
+
if (!result) return this.pushUnpushedOnHibernate(s, cwd);
|
|
3070
|
+
const sha = await git(["rev-parse", "--short", "HEAD"], cwd);
|
|
3071
|
+
if (lc.pushOnHibernate) {
|
|
3072
|
+
try {
|
|
3073
|
+
await this.pushActiveBranch(s, cwd);
|
|
3074
|
+
this.log.info("push ok", { branch: s.activeBranch });
|
|
3075
|
+
} catch (err) {
|
|
3076
|
+
this.log.error("push failed", err, { branch: s.activeBranch });
|
|
3077
|
+
throw err;
|
|
3078
|
+
}
|
|
3079
|
+
}
|
|
3080
|
+
return `Committed ${sha} on ${s.activeBranch}${lc.pushOnHibernate ? " (pushed)" : ""}`;
|
|
3081
|
+
}
|
|
3082
|
+
/**
|
|
3083
|
+
* What this checkout can prove after a hibernate save, for a host deciding
|
|
3084
|
+
* whether deleting the workspace loses anything. Read-only: never fetches,
|
|
3085
|
+
* pushes, or writes the repo. Every doubt answers in the "keep it" direction.
|
|
3086
|
+
*/
|
|
3087
|
+
async readPushState(s, cwd) {
|
|
3088
|
+
const status = await probeGitOrNull(
|
|
3089
|
+
["status", "--porcelain", "--untracked-files=all", "--ignore-submodules=none"],
|
|
3090
|
+
cwd
|
|
3091
|
+
);
|
|
3092
|
+
const ignored = await probeGitOrNull(
|
|
3093
|
+
["status", "--porcelain", "--ignored=matching", "--untracked-files=normal"],
|
|
3094
|
+
cwd
|
|
3095
|
+
);
|
|
3096
|
+
const head = await probeGitOrNull(["rev-parse", "--verify", "--quiet", "HEAD^{commit}"], cwd) || null;
|
|
3097
|
+
const abbrev = head === null ? null : await probeGitOrNull(["rev-parse", "--abbrev-ref", "HEAD"], cwd);
|
|
3098
|
+
return {
|
|
3099
|
+
clean: status === "",
|
|
3100
|
+
onRemote: await this.isWorkspaceOnRemote(s, cwd, head),
|
|
3101
|
+
ignoredFiles: ignored === null ? null : ignored.split("\n").some((line) => line.startsWith("!! ") && !isSkaileInternalPath(line.slice(3))),
|
|
3102
|
+
head,
|
|
3103
|
+
branch: abbrev === null || abbrev === "" || abbrev === "HEAD" ? null : abbrev
|
|
3104
|
+
};
|
|
3105
|
+
}
|
|
3106
|
+
/**
|
|
3107
|
+
* Whether every commit reachable from a local ref (`refs/heads/*`, `HEAD`
|
|
3108
|
+
* even when detached, `refs/stash`) is reachable from some remote branch
|
|
3109
|
+
* head. The remote heads come from `ls-remote`, because local `origin/*`
|
|
3110
|
+
* refs go stale (a push by URL does not move them); only the ones whose
|
|
3111
|
+
* commit this checkout already holds can be walked, so a head we lack
|
|
3112
|
+
* proves nothing and the answer leans to `false`.
|
|
3113
|
+
*
|
|
3114
|
+
* `false` for any initialised submodule, checked first: a commit pinned only
|
|
3115
|
+
* in its local clone is out of this walk's reach. `null` when the remote
|
|
3116
|
+
* cannot be asked within {@link PUSH_STATE_REMOTE_TIMEOUT_MS}, which includes
|
|
3117
|
+
* a remote the mount reaches only through ambient config (a credential helper,
|
|
3118
|
+
* ssh or CA settings in global/system gitconfig): that config is switched off
|
|
3119
|
+
* here, so such a workspace always reads "cannot tell" and is kept.
|
|
3120
|
+
*/
|
|
3121
|
+
async isWorkspaceOnRemote(s, cwd, head) {
|
|
3122
|
+
if (await hasInitialisedSubmodule(cwd)) return false;
|
|
3123
|
+
let out;
|
|
3124
|
+
try {
|
|
3125
|
+
out = await runRemoteGit(["ls-remote", "--heads", plainRemoteUrl(s)], s, {
|
|
3126
|
+
neutralCwd: tmpdir(),
|
|
3127
|
+
safeDir: cwd,
|
|
3128
|
+
timeout: PUSH_STATE_REMOTE_TIMEOUT_MS,
|
|
3129
|
+
env: {
|
|
3130
|
+
...process.env,
|
|
3131
|
+
GIT_CONFIG_GLOBAL: "/dev/null",
|
|
3132
|
+
GIT_CONFIG_NOSYSTEM: "1",
|
|
3133
|
+
GIT_NO_REPLACE_OBJECTS: "1"
|
|
3134
|
+
}
|
|
3135
|
+
});
|
|
3136
|
+
} catch (err) {
|
|
3137
|
+
this.log.warn("ls-remote for hibernate push state failed \u2014 cannot tell what is pushed", {
|
|
3138
|
+
error: redactCredentials(err instanceof Error ? err.message : String(err))
|
|
3139
|
+
});
|
|
3140
|
+
return null;
|
|
3141
|
+
}
|
|
3142
|
+
const refs = await probeGitOrNull(
|
|
3143
|
+
["for-each-ref", "--format=%(objectname)", "refs/heads", "refs/tags", "refs/stash"],
|
|
3144
|
+
cwd
|
|
3145
|
+
);
|
|
3146
|
+
if (refs === null) return false;
|
|
3147
|
+
const local = new Set(refs.split("\n").filter((l) => l !== ""));
|
|
3148
|
+
if (head !== null) local.add(head);
|
|
3149
|
+
if (local.size === 0) return true;
|
|
3150
|
+
const remote = /* @__PURE__ */ new Set();
|
|
3151
|
+
for (const line of out.split("\n")) {
|
|
3152
|
+
const sha = line.split(" ")[0];
|
|
3153
|
+
if (sha) remote.add(sha);
|
|
3154
|
+
}
|
|
3155
|
+
let present = [];
|
|
3156
|
+
if (remote.size > 0) {
|
|
3157
|
+
const batch = await probeGitOrNull(
|
|
3158
|
+
["cat-file", "--batch-check=%(objectname) %(objecttype)"],
|
|
3159
|
+
cwd,
|
|
3160
|
+
`${[...remote].join("\n")}
|
|
3161
|
+
`
|
|
3162
|
+
);
|
|
3163
|
+
if (batch === null) return false;
|
|
3164
|
+
present = batch.split("\n").map((line) => line.split(" ")).filter(([, type]) => type === "commit").map(([sha]) => sha);
|
|
3165
|
+
}
|
|
3166
|
+
const count = await probeGitOrNull(
|
|
3167
|
+
["rev-list", "--count", "--stdin"],
|
|
3168
|
+
cwd,
|
|
3169
|
+
// `^<sha>` per line: older git does not honour `--not` on stdin.
|
|
3170
|
+
`${[...local, ...present.map((sha) => `^${sha}`)].join("\n")}
|
|
3171
|
+
`
|
|
3172
|
+
);
|
|
3173
|
+
return count === "0";
|
|
3174
|
+
}
|
|
3022
3175
|
/**
|
|
3023
3176
|
* Hibernate with nothing new to commit: push commits that are still only
|
|
3024
3177
|
* local (the agent committed its own work, or an earlier push failed).
|
|
@@ -8424,8 +8577,17 @@ var ConnectorManager = class {
|
|
|
8424
8577
|
continue;
|
|
8425
8578
|
}
|
|
8426
8579
|
try {
|
|
8427
|
-
const
|
|
8428
|
-
|
|
8580
|
+
const outcome = await fn.call(entry.connector, entry.handle);
|
|
8581
|
+
if (outcome !== null && typeof outcome === "object") {
|
|
8582
|
+
results.push({
|
|
8583
|
+
id,
|
|
8584
|
+
ok: true,
|
|
8585
|
+
...outcome.detail === void 0 ? {} : { detail: outcome.detail },
|
|
8586
|
+
...outcome.pushState === void 0 ? {} : { pushState: outcome.pushState }
|
|
8587
|
+
});
|
|
8588
|
+
} else {
|
|
8589
|
+
results.push({ id, ok: true, detail: outcome ?? void 0 });
|
|
8590
|
+
}
|
|
8429
8591
|
} catch (err) {
|
|
8430
8592
|
results.push({
|
|
8431
8593
|
id,
|
|
@@ -12618,5 +12780,5 @@ function describeFlowOperations() {
|
|
|
12618
12780
|
}
|
|
12619
12781
|
|
|
12620
12782
|
export { AbstractConnector, BUILTIN_CONNECTOR_CATALOG, BoxConnector, ClassifierSubpromptRunner, ConnectorManager, DeployConnector, DevServerConnector, FlowAdapter, GitConnector, GmailConnector, GoogleDriveConnector, LocalConnector, LogBuffer, MAX_REARM_MS, MIN_REFRESH_DELAY_MS, ManagedGitconfigCollisionError, MattermostConnector, MemoryConnector, MinIOConnector, NO_ACTIVE_FLOW_ERROR, PortPool, PostgresConnector, REFRESH_LEAD_MS, S3Connector, S3FetchStoppedError, S3PresignedRequestError, S3_PRESIGN_BATCH, SQLiteConnector, SessionInlineSubFlowRunner, SessionNodeExecutor, SessionSubpromptRunner, SharePointConnector, StaticServerConnector, TunnelConnector, WebDAVConnector, XStateConnector, XStateStoreConnector, __test, atomicReplaceCredential, buildConnectorPromptSection, buildConnectorToolDefs, buildFlowPromptEvent, buildFlowToolDefs, buildLazyFlowToolDefs, buildLazySdkFlowTools, buildSdkConnectorTools, buildSdkFlowTools, checkFleetMountLiveness, classifierQuestion, classifyConnectError, createConnector, createConnector10, createConnector11, createConnector12, createConnector13, createConnector14, createConnector15, createConnector16, createConnector17, createConnector18, createConnector19, createConnector2, createConnector20, createConnector3, createConnector4, createConnector5, createConnector6, createConnector7, createConnector8, createConnector9, createFsWatcher, createWorktree, defaultSpawn, describeFlowOperations, driveOrchestratorTurn, ensureDirMode, ensureFleetMounted, ensureRefreshAttemptStamp, findGitRoot, findMissingPackages, getConnector, installNpmPackages, isFleetManaged, isPackageResolvable, listConnectors, listWorktrees, missingTokenMediatorMessage, parseListObjectsV2, presignScopePrefix, presignableKey, readGitSyncStatus, registerBuiltinConnectors, removeMountBlock, removeUnavailableMountBlock, renderCredentialHelperScript, tryGetConnector, worktreeRegistry, writeHelperScript, writeMountBlock, writeUnavailableMountBlock };
|
|
12621
|
-
//# sourceMappingURL=chunk-
|
|
12622
|
-
//# sourceMappingURL=chunk-
|
|
12783
|
+
//# sourceMappingURL=chunk-G3VT2BCY.js.map
|
|
12784
|
+
//# sourceMappingURL=chunk-G3VT2BCY.js.map
|