@skaile/workspaces 4.9.3 → 4.10.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 +18 -0
- package/dist/app-sdk/index.js +1 -1
- package/dist/{asset-feeds-74HE5Q7W.js → asset-feeds-W24JZM36.js} +7 -7
- package/dist/{asset-feeds-74HE5Q7W.js.map → asset-feeds-W24JZM36.js.map} +1 -1
- package/dist/asset-manager/catalog-deployer.js +3 -3
- package/dist/asset-manager/index.js +6 -6
- package/dist/asset-manager/installer.js +4 -4
- package/dist/bridge/drivers/claude-sdk.js +7 -7
- package/dist/bridge/drivers/codex.js +5 -5
- package/dist/bridge/drivers/continue.js +6 -6
- package/dist/bridge/drivers/echo.js +3 -3
- package/dist/bridge/drivers/gemini.js +4 -4
- package/dist/bridge/drivers/goose.js +6 -6
- package/dist/bridge/drivers/omp.js +1 -1
- package/dist/bridge/drivers/opencode.js +6 -6
- package/dist/bridge/drivers/qwen.js +4 -4
- package/dist/bridge/index.js +8 -8
- package/dist/{chunk-3GKBSHUG.js → chunk-35PMOWAD.js} +3 -3
- package/dist/{chunk-3GKBSHUG.js.map → chunk-35PMOWAD.js.map} +1 -1
- package/dist/{chunk-7ZWLVXQN.js → chunk-37PUZERM.js} +2 -2
- package/dist/{chunk-7ZWLVXQN.js.map → chunk-37PUZERM.js.map} +1 -1
- package/dist/{chunk-LDQB5VEC.js → chunk-3T5DRUNZ.js} +2 -2
- package/dist/{chunk-LDQB5VEC.js.map → chunk-3T5DRUNZ.js.map} +1 -1
- package/dist/{chunk-WPW5XS6I.js → chunk-3YTFHHMI.js} +2 -2
- package/dist/{chunk-WPW5XS6I.js.map → chunk-3YTFHHMI.js.map} +1 -1
- package/dist/{chunk-6L2WH2LS.js → chunk-5D5MCO4L.js} +9 -9
- package/dist/{chunk-6L2WH2LS.js.map → chunk-5D5MCO4L.js.map} +1 -1
- package/dist/{chunk-FTSXFA7P.js → chunk-6XKQEDF7.js} +5 -5
- package/dist/{chunk-FTSXFA7P.js.map → chunk-6XKQEDF7.js.map} +1 -1
- package/dist/{chunk-VLRP35H4.js → chunk-7J4YIVKJ.js} +7 -7
- package/dist/{chunk-VLRP35H4.js.map → chunk-7J4YIVKJ.js.map} +1 -1
- package/dist/{chunk-2LT4CWA5.js → chunk-7ZJXFQ42.js} +3 -3
- package/dist/{chunk-2LT4CWA5.js.map → chunk-7ZJXFQ42.js.map} +1 -1
- package/dist/{chunk-7LHSC2DS.js → chunk-A3X4LDOD.js} +4 -4
- package/dist/{chunk-7LHSC2DS.js.map → chunk-A3X4LDOD.js.map} +1 -1
- package/dist/{chunk-YCIW4YOT.js → chunk-BXV6RLF4.js} +3 -3
- package/dist/{chunk-YCIW4YOT.js.map → chunk-BXV6RLF4.js.map} +1 -1
- package/dist/{chunk-RL7O3OZQ.js → chunk-BZ7GHZ2J.js} +5 -5
- package/dist/{chunk-RL7O3OZQ.js.map → chunk-BZ7GHZ2J.js.map} +1 -1
- package/dist/{chunk-AF3ETSXF.js → chunk-CJXSTOGW.js} +4 -4
- package/dist/{chunk-AF3ETSXF.js.map → chunk-CJXSTOGW.js.map} +1 -1
- package/dist/{chunk-O33RRDO5.js → chunk-CSS3HHQ6.js} +7 -7
- package/dist/{chunk-O33RRDO5.js.map → chunk-CSS3HHQ6.js.map} +1 -1
- package/dist/{chunk-JU736VOI.js → chunk-CTQ4G3UY.js} +229 -43
- package/dist/chunk-CTQ4G3UY.js.map +1 -0
- package/dist/{chunk-XEWX4V7T.js → chunk-DIQVQT5C.js} +4 -4
- package/dist/{chunk-XEWX4V7T.js.map → chunk-DIQVQT5C.js.map} +1 -1
- package/dist/{chunk-LMS54WVA.js → chunk-EUWEMCYO.js} +4 -4
- package/dist/{chunk-LMS54WVA.js.map → chunk-EUWEMCYO.js.map} +1 -1
- package/dist/{chunk-P2G6XSJ3.js → chunk-HO4UO25I.js} +4 -2
- package/dist/chunk-HO4UO25I.js.map +1 -0
- package/dist/{chunk-KQTMJP3X.js → chunk-IECQMSQ5.js} +3 -3
- package/dist/{chunk-KQTMJP3X.js.map → chunk-IECQMSQ5.js.map} +1 -1
- package/dist/{chunk-GFU367UH.js → chunk-JECDED7B.js} +4 -4
- package/dist/{chunk-GFU367UH.js.map → chunk-JECDED7B.js.map} +1 -1
- package/dist/{chunk-2KVFAWUA.js → chunk-LFW2SH54.js} +3 -3
- package/dist/{chunk-2KVFAWUA.js.map → chunk-LFW2SH54.js.map} +1 -1
- package/dist/{chunk-JUZJUKWM.js → chunk-MMLXSVQ3.js} +3 -3
- package/dist/{chunk-JUZJUKWM.js.map → chunk-MMLXSVQ3.js.map} +1 -1
- package/dist/{chunk-R4OMDCGZ.js → chunk-NQ3OMJFK.js} +3 -3
- package/dist/{chunk-R4OMDCGZ.js.map → chunk-NQ3OMJFK.js.map} +1 -1
- package/dist/{chunk-AOE4KOMJ.js → chunk-O3DHAGBO.js} +3 -3
- package/dist/{chunk-AOE4KOMJ.js.map → chunk-O3DHAGBO.js.map} +1 -1
- package/dist/{chunk-QAH24E5U.js → chunk-O64WU6WS.js} +4 -4
- package/dist/{chunk-QAH24E5U.js.map → chunk-O64WU6WS.js.map} +1 -1
- package/dist/{chunk-XZYZOCPK.js → chunk-OE2OMMOX.js} +5 -5
- package/dist/{chunk-XZYZOCPK.js.map → chunk-OE2OMMOX.js.map} +1 -1
- package/dist/{chunk-LN4M7WMX.js → chunk-QV36ENWE.js} +295 -38
- package/dist/chunk-QV36ENWE.js.map +1 -0
- package/dist/{chunk-WXECUQC6.js → chunk-ULX3R5PV.js} +6 -6
- package/dist/{chunk-WXECUQC6.js.map → chunk-ULX3R5PV.js.map} +1 -1
- package/dist/{chunk-F4PCBWPB.js → chunk-UXUDNBJM.js} +3 -3
- package/dist/{chunk-F4PCBWPB.js.map → chunk-UXUDNBJM.js.map} +1 -1
- package/dist/{chunk-ZVYWMD6Q.js → chunk-VLXODO37.js} +4 -4
- package/dist/{chunk-ZVYWMD6Q.js.map → chunk-VLXODO37.js.map} +1 -1
- package/dist/{chunk-UM4LDXV5.js → chunk-WILO77HE.js} +3 -3
- package/dist/{chunk-UM4LDXV5.js.map → chunk-WILO77HE.js.map} +1 -1
- package/dist/{chunk-S4RYZDBB.js → chunk-WXB6YEHZ.js} +3 -3
- package/dist/{chunk-S4RYZDBB.js.map → chunk-WXB6YEHZ.js.map} +1 -1
- package/dist/{chunk-SDNGG6FB.js → chunk-YZSMZK37.js} +3 -3
- package/dist/{chunk-SDNGG6FB.js.map → chunk-YZSMZK37.js.map} +1 -1
- package/dist/cli/index.js +52 -52
- package/dist/connectors/config.js +4 -4
- package/dist/connectors/index.js +12 -12
- package/dist/connectors-shared/index.js +2 -2
- package/dist/core/index.js +3 -3
- package/dist/core/runtime-assets.js +2 -2
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/workspace-config.d.ts +50 -0
- package/dist/core/src/workspace-config.d.ts.map +1 -1
- package/dist/core/workspace-config.js +1 -1
- package/dist/deploy/index.js +3 -3
- package/dist/{ensure-sources-VTIIEJBO.js → ensure-sources-5ZYEU4BE.js} +9 -9
- package/dist/{ensure-sources-VTIIEJBO.js.map → ensure-sources-5ZYEU4BE.js.map} +1 -1
- package/dist/factory-assets/connectors/box.js +12 -12
- package/dist/factory-assets/connectors/deploy.js +12 -12
- package/dist/factory-assets/connectors/devserver.js +12 -12
- package/dist/factory-assets/connectors/flow/adapter.js +12 -12
- package/dist/factory-assets/connectors/flow/engine.js +4 -4
- package/dist/factory-assets/connectors/flow/run-flow.js +13 -13
- package/dist/factory-assets/connectors/flow.js +12 -12
- package/dist/factory-assets/connectors/git/CONNECTOR.md +7 -1
- package/dist/factory-assets/connectors/git/driver.d.ts +60 -10
- package/dist/factory-assets/connectors/git/driver.d.ts.map +1 -1
- package/dist/factory-assets/connectors/git.js +12 -12
- package/dist/factory-assets/connectors/gmail.js +12 -12
- package/dist/factory-assets/connectors/googledrive.js +12 -12
- package/dist/factory-assets/connectors/local.js +12 -12
- package/dist/factory-assets/connectors/mattermost.js +12 -12
- package/dist/factory-assets/connectors/memory.js +12 -12
- package/dist/factory-assets/connectors/minio.js +12 -12
- package/dist/factory-assets/connectors/postgres.js +12 -12
- package/dist/factory-assets/connectors/s3.js +12 -12
- package/dist/factory-assets/connectors/sharepoint.js +12 -12
- package/dist/factory-assets/connectors/sqlite.js +12 -12
- package/dist/factory-assets/connectors/static-server.js +12 -12
- package/dist/factory-assets/connectors/tunnel.js +12 -12
- package/dist/factory-assets/connectors/webdav.js +12 -12
- package/dist/factory-assets/connectors/xstate-store.js +12 -12
- package/dist/factory-assets/connectors/xstate.js +12 -12
- package/dist/{flows-SYYQDDCT.js → flows-H6FL4NZU.js} +6 -6
- package/dist/{flows-SYYQDDCT.js.map → flows-H6FL4NZU.js.map} +1 -1
- package/dist/{helpers-JJ4OLUVW.js → helpers-4SAB547F.js} +9 -9
- package/dist/{helpers-JJ4OLUVW.js.map → helpers-4SAB547F.js.map} +1 -1
- package/dist/library/index.js +4 -4
- package/dist/library/install.js +3 -3
- package/dist/{library-publish-IA76SB6X.js → library-publish-GXIWW7NW.js} +13 -13
- package/dist/{library-publish-IA76SB6X.js.map → library-publish-GXIWW7NW.js.map} +1 -1
- package/dist/{open-library-F24FIE65.js → open-library-OOP3UQUP.js} +11 -11
- package/dist/{open-library-F24FIE65.js.map → open-library-OOP3UQUP.js.map} +1 -1
- package/dist/{paths-NHONUGUU.js → paths-RL6NZW5X.js} +6 -6
- package/dist/{paths-NHONUGUU.js.map → paths-RL6NZW5X.js.map} +1 -1
- package/dist/{plugin-store-4RALGK5S.js → plugin-store-ZTAJCMTY.js} +5 -5
- package/dist/{plugin-store-4RALGK5S.js.map → plugin-store-ZTAJCMTY.js.map} +1 -1
- package/dist/{project-OGJSXBAC.js → project-P27CJXPB.js} +10 -10
- package/dist/{project-OGJSXBAC.js.map → project-P27CJXPB.js.map} +1 -1
- package/dist/resolver/index.js +3 -3
- package/dist/runner/index.js +17 -17
- package/dist/runner/src/assistant-home.d.ts +86 -0
- package/dist/runner/src/assistant-home.d.ts.map +1 -0
- package/dist/runner/src/session-builder.d.ts +1 -1
- package/dist/runner/src/session-builder.d.ts.map +1 -1
- package/dist/sdk/asset-manager.js +6 -6
- package/dist/sdk/bridge.js +8 -8
- package/dist/sdk/core.js +3 -3
- package/dist/sdk/flow.js +4 -4
- package/dist/sdk/index.js +17 -17
- package/dist/sdk/resolver.js +3 -3
- package/dist/sdk/runner.js +17 -17
- package/dist/sdk/session.js +2 -2
- package/dist/sdk/types.js +1 -1
- package/dist/session/index.js +2 -2
- package/dist/{setup-3IIIW3QM.js → setup-JNGNZTTP.js} +15 -15
- package/dist/{setup-3IIIW3QM.js.map → setup-JNGNZTTP.js.map} +1 -1
- package/dist/{skills-VUPPILR5.js → skills-Y6MU2NRI.js} +5 -5
- package/dist/{skills-VUPPILR5.js.map → skills-Y6MU2NRI.js.map} +1 -1
- package/dist/{source-HBEZDIWE.js → source-LOGTGPGJ.js} +12 -12
- package/dist/{source-HBEZDIWE.js.map → source-LOGTGPGJ.js.map} +1 -1
- package/dist/{source-manifest-publish-G7ZAYFMH.js → source-manifest-publish-PH2XMOLW.js} +14 -14
- package/dist/{source-manifest-publish-G7ZAYFMH.js.map → source-manifest-publish-PH2XMOLW.js.map} +1 -1
- package/dist/tui/index.js +17 -17
- package/dist/types/index.js +1 -1
- package/dist/types/src/events.d.ts +2 -2
- package/dist/types/src/events.d.ts.map +1 -1
- package/dist/types/src/version.d.ts +6 -1
- package/dist/types/src/version.d.ts.map +1 -1
- package/dist/workspace-plugin/adapters/mcp.js +6 -6
- package/dist/workspace-plugin/adapters/omp.js +7 -7
- package/dist/workspace-plugin/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-JU736VOI.js.map +0 -1
- package/dist/chunk-LN4M7WMX.js.map +0 -1
- package/dist/chunk-P2G6XSJ3.js.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
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-YZSMZK37.js';
|
|
2
|
+
import { OAuthRequiredError, ConnectorFieldMissingError, LegacyAuthGrammarError, resolveAuthRef, readUnavailableMarker, ConnectorStartupError } from './chunk-MMLXSVQ3.js';
|
|
3
|
+
import { EventNormalizer } from './chunk-VLXODO37.js';
|
|
4
|
+
import { resolveModelTier } from './chunk-BXV6RLF4.js';
|
|
5
|
+
import { createDriver } from './chunk-3T5DRUNZ.js';
|
|
6
6
|
import { pluginRegistry } from './chunk-6E6PKKAD.js';
|
|
7
7
|
import { computeStimulus } from './chunk-IFGTRL2I.js';
|
|
8
|
-
import { interpolateNodeInstruction, resolveNodeBindings, getConsumedOutputSchema, validateConsumedNodeOutput, appendAttempt, resolveTerminalFailureStatus, remainingActiveExecutionMs, deriveCheckEvidence, computeFlowStateFromSnapshots, availableRouterFrontier, evaluateRouterSelection, routerSelectionOutput, planRouterSkips, unsettledRouterBranchIds, countFailedAttempts, hasAutomaticRetryBudget, persistedRouterSelection } from './chunk-
|
|
8
|
+
import { interpolateNodeInstruction, resolveNodeBindings, getConsumedOutputSchema, validateConsumedNodeOutput, appendAttempt, resolveTerminalFailureStatus, remainingActiveExecutionMs, deriveCheckEvidence, computeFlowStateFromSnapshots, availableRouterFrontier, evaluateRouterSelection, routerSelectionOutput, planRouterSkips, unsettledRouterBranchIds, countFailedAttempts, hasAutomaticRetryBudget, persistedRouterSelection } from './chunk-O3DHAGBO.js';
|
|
9
9
|
import { INPUT_SCHEMA_SHAPES_HINT, coerceInputSchema } from './chunk-KLMXMW6Z.js';
|
|
10
10
|
import { classifierDecision, withoutReservedClassifierFields, parseFlowDefinition } from './chunk-REYJKU7T.js';
|
|
11
11
|
import { describeStimulus, buildOrchestratorPrompt, renderSubpromptPrompt, renderStimulusPrompt } from './chunk-2D5BYAL6.js';
|
|
12
12
|
import { deterministicNodeKindLabel, nodeInstruction, flowDefaults, isAgentNode, isGateNode, isCheckNode, nodeRequiresApproval, isSubFlowNode, isFunctionNode, isSubpromptNode, isRouterNode, isActiveRuntimeNode, nodeIsOptional, nodeLabel, nodeAssets } from './chunk-ELPR5XBG.js';
|
|
13
|
-
import { withActivityLabelDefs } from './chunk-
|
|
13
|
+
import { withActivityLabelDefs } from './chunk-O64WU6WS.js';
|
|
14
14
|
import { processAlive } from './chunk-4GY63JU6.js';
|
|
15
15
|
import { withFsDeadline, tryWithFsDeadline, FsDeadlineError, fsDeadlineMs } from './chunk-MKZOK4JU.js';
|
|
16
16
|
import { portableSpawn } from './chunk-KSIRR5PL.js';
|
|
@@ -1749,6 +1749,32 @@ async function ensureTrackingRefspec(branch, cwd) {
|
|
|
1749
1749
|
}
|
|
1750
1750
|
await git(["config", "--add", "remote.origin.fetch", wanted], cwd);
|
|
1751
1751
|
}
|
|
1752
|
+
async function dropTrackingRefspec(branch, cwd) {
|
|
1753
|
+
const name = branch.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
1754
|
+
await gitOrNull(
|
|
1755
|
+
[
|
|
1756
|
+
"config",
|
|
1757
|
+
"--unset-all",
|
|
1758
|
+
"remote.origin.fetch",
|
|
1759
|
+
`^\\+?refs/heads/${name}:refs/remotes/origin/${name}$`
|
|
1760
|
+
],
|
|
1761
|
+
cwd
|
|
1762
|
+
);
|
|
1763
|
+
}
|
|
1764
|
+
async function isAncestor(ancestor, descendant, cwd) {
|
|
1765
|
+
return await gitOrNull(["merge-base", "--is-ancestor", ancestor, descendant], cwd) !== null;
|
|
1766
|
+
}
|
|
1767
|
+
async function originTrackingRef(branch, cwd) {
|
|
1768
|
+
const ref = `refs/remotes/origin/${branch}`;
|
|
1769
|
+
return await gitOrNull(["rev-parse", "--verify", "--quiet", ref], cwd) === null ? null : ref;
|
|
1770
|
+
}
|
|
1771
|
+
async function setSessionUpstream(branch, cwd) {
|
|
1772
|
+
await git(["config", `branch.${branch}.remote`, "origin"], cwd);
|
|
1773
|
+
await git(["config", `branch.${branch}.merge`, `refs/heads/${branch}`], cwd);
|
|
1774
|
+
}
|
|
1775
|
+
function cLocaleEnv() {
|
|
1776
|
+
return { ...process.env, LC_ALL: "C", LANGUAGE: "" };
|
|
1777
|
+
}
|
|
1752
1778
|
async function readGitSyncStatus(cwd, baseBranch) {
|
|
1753
1779
|
const branchRaw = await gitOrNull(["rev-parse", "--abbrev-ref", "HEAD"], cwd);
|
|
1754
1780
|
const branch = branchRaw && branchRaw !== "HEAD" ? branchRaw : null;
|
|
@@ -1878,6 +1904,9 @@ var GitConnector = class extends AbstractConnector {
|
|
|
1878
1904
|
const authUrl = this.authUrl(state);
|
|
1879
1905
|
await this.prepareCheckout(targetDir, url, branch, authUrl, declaration.access, started);
|
|
1880
1906
|
if (session.enabled && !session.isMain && session.slug) {
|
|
1907
|
+
if (declaration.mount?.exposeAccessToken !== true) {
|
|
1908
|
+
await this.rebakeRemoteAuth(targetDir, state);
|
|
1909
|
+
}
|
|
1881
1910
|
await this.checkoutSessionBranch(state, session, targetDir);
|
|
1882
1911
|
}
|
|
1883
1912
|
if (sync.fetchIntervalSec > 0) {
|
|
@@ -1917,8 +1946,13 @@ var GitConnector = class extends AbstractConnector {
|
|
|
1917
1946
|
}
|
|
1918
1947
|
if (state.sessionBranchFetch === "failed") {
|
|
1919
1948
|
state.sessionBranchFetch = await this.trackSessionBranch(state.activeBranch, targetDir);
|
|
1920
|
-
if (state.sessionBranchFetch === "fetched"
|
|
1921
|
-
|
|
1949
|
+
if (state.sessionBranchFetch === "fetched") {
|
|
1950
|
+
if (state.sessionBranchCreated) {
|
|
1951
|
+
await this.adoptOriginSessionBranch(state.activeBranch, targetDir);
|
|
1952
|
+
} else {
|
|
1953
|
+
await this.reconcileLocalSessionBranch(state, state.activeBranch, targetDir);
|
|
1954
|
+
await syncSubmodules(targetDir, this.log);
|
|
1955
|
+
}
|
|
1922
1956
|
}
|
|
1923
1957
|
}
|
|
1924
1958
|
await ensureSkaileExcluded(targetDir, this.log);
|
|
@@ -2040,6 +2074,9 @@ var GitConnector = class extends AbstractConnector {
|
|
|
2040
2074
|
if (await localBranchExists(sessionBranch, targetDir)) {
|
|
2041
2075
|
await gitLocalCheckout([sessionBranch], targetDir);
|
|
2042
2076
|
this.log.info("reusing existing local session branch", { sessionBranch });
|
|
2077
|
+
if (state.sessionBranchFetch === "fetched") {
|
|
2078
|
+
await this.reconcileLocalSessionBranch(state, sessionBranch, targetDir);
|
|
2079
|
+
}
|
|
2043
2080
|
} else {
|
|
2044
2081
|
let originHasBranch = false;
|
|
2045
2082
|
try {
|
|
@@ -2063,6 +2100,7 @@ var GitConnector = class extends AbstractConnector {
|
|
|
2063
2100
|
if (created && state.lifecycle.publishOnCreate) {
|
|
2064
2101
|
try {
|
|
2065
2102
|
await git(["push", "-u", "origin", sessionBranch], targetDir, 6e4);
|
|
2103
|
+
await this.recordPushedSessionBranch(sessionBranch, targetDir);
|
|
2066
2104
|
this.log.info("published new session branch", { sessionBranch });
|
|
2067
2105
|
} catch (err) {
|
|
2068
2106
|
this.log.warn("publish-on-create push failed; deferring to lifecycle push", {
|
|
@@ -2073,36 +2111,47 @@ var GitConnector = class extends AbstractConnector {
|
|
|
2073
2111
|
}
|
|
2074
2112
|
}
|
|
2075
2113
|
/**
|
|
2076
|
-
*
|
|
2077
|
-
*
|
|
2078
|
-
* normal case for a new session, and any other failure
|
|
2079
|
-
*
|
|
2114
|
+
* Fetch the session branch into `refs/remotes/origin/<sessionBranch>` and,
|
|
2115
|
+
* when origin has it, map it with a fetch refspec. Never throws: a missing
|
|
2116
|
+
* remote branch is the normal case for a new session, and any other failure
|
|
2117
|
+
* leaves the checkout as it was (the caller creates the branch from the base).
|
|
2080
2118
|
*
|
|
2081
|
-
*
|
|
2082
|
-
*
|
|
2119
|
+
* The refspec is added only once origin has the branch, and removed when
|
|
2120
|
+
* origin does not have it: a configured refspec for a missing branch makes
|
|
2121
|
+
* every plain `git fetch origin` fail. Runs on every connect, so it also
|
|
2122
|
+
* repairs a checkout cloned before the refspec existed.
|
|
2083
2123
|
*/
|
|
2084
2124
|
async trackSessionBranch(sessionBranch, targetDir) {
|
|
2085
|
-
|
|
2086
|
-
await ensureTrackingRefspec(sessionBranch, targetDir);
|
|
2087
|
-
} catch (err) {
|
|
2088
|
-
this.log.warn("could not add session-branch fetch refspec", {
|
|
2089
|
-
sessionBranch,
|
|
2090
|
-
error: redactUrlAuth(err instanceof Error ? err.message : String(err))
|
|
2091
|
-
});
|
|
2092
|
-
}
|
|
2125
|
+
let outcome;
|
|
2093
2126
|
try {
|
|
2094
2127
|
await runGit([...gitPrefix(targetDir), "fetch", "origin", trackingRefspec(sessionBranch)], {
|
|
2095
2128
|
cwd: targetDir,
|
|
2096
2129
|
timeout: 6e4,
|
|
2097
|
-
env:
|
|
2130
|
+
env: cLocaleEnv()
|
|
2098
2131
|
});
|
|
2099
|
-
|
|
2132
|
+
outcome = "fetched";
|
|
2100
2133
|
} catch (err) {
|
|
2101
2134
|
const message = redactUrlAuth(err instanceof Error ? err.message : String(err));
|
|
2102
|
-
if (
|
|
2103
|
-
|
|
2104
|
-
|
|
2135
|
+
if (!/couldn't find remote ref/i.test(message)) {
|
|
2136
|
+
this.log.warn("session-branch fetch failed", { sessionBranch, error: message });
|
|
2137
|
+
return "failed";
|
|
2138
|
+
}
|
|
2139
|
+
outcome = "absent";
|
|
2140
|
+
}
|
|
2141
|
+
try {
|
|
2142
|
+
if (outcome === "fetched") {
|
|
2143
|
+
await ensureTrackingRefspec(sessionBranch, targetDir);
|
|
2144
|
+
} else {
|
|
2145
|
+
await dropTrackingRefspec(sessionBranch, targetDir);
|
|
2146
|
+
await gitOrNull(["update-ref", "-d", `refs/remotes/origin/${sessionBranch}`], targetDir);
|
|
2147
|
+
}
|
|
2148
|
+
} catch (err) {
|
|
2149
|
+
this.log.warn("could not update session-branch fetch refspec", {
|
|
2150
|
+
sessionBranch,
|
|
2151
|
+
error: redactUrlAuth(err instanceof Error ? err.message : String(err))
|
|
2152
|
+
});
|
|
2105
2153
|
}
|
|
2154
|
+
return outcome;
|
|
2106
2155
|
}
|
|
2107
2156
|
/**
|
|
2108
2157
|
* Re-point a session branch that this connect cut from the base at
|
|
@@ -2124,25 +2173,101 @@ var GitConnector = class extends AbstractConnector {
|
|
|
2124
2173
|
}
|
|
2125
2174
|
}
|
|
2126
2175
|
/**
|
|
2127
|
-
*
|
|
2128
|
-
*
|
|
2129
|
-
*
|
|
2130
|
-
*
|
|
2176
|
+
* Line up a reused local session branch (checked out) with
|
|
2177
|
+
* `origin/<sessionBranch>` after a successful fetch. Never rewrites local
|
|
2178
|
+
* history and never throws:
|
|
2179
|
+
* - local is an ancestor of origin → fast-forward (another node pushed
|
|
2180
|
+
* newer work);
|
|
2181
|
+
* - local has commits that origin does not have → keep them and log a
|
|
2182
|
+
* warning; when origin also has commits that local lacks (diverged),
|
|
2183
|
+
* merge origin in with {@link integrateOriginSessionBranch};
|
|
2184
|
+
* - origin has no such branch → nothing to do.
|
|
2185
|
+
* In the first two cases the upstream is set to `origin/<sessionBranch>`.
|
|
2131
2186
|
*/
|
|
2132
|
-
async
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2187
|
+
async reconcileLocalSessionBranch(state, sessionBranch, targetDir) {
|
|
2188
|
+
const originRef = await originTrackingRef(sessionBranch, targetDir);
|
|
2189
|
+
if (originRef === null) return;
|
|
2190
|
+
try {
|
|
2191
|
+
await setSessionUpstream(sessionBranch, targetDir);
|
|
2192
|
+
if (await isAncestor("HEAD", originRef, targetDir)) {
|
|
2193
|
+
const before = await git(["rev-parse", "HEAD"], targetDir);
|
|
2194
|
+
await git(["merge", "--ff-only", originRef], targetDir, 6e4);
|
|
2195
|
+
if (await git(["rev-parse", "HEAD"], targetDir) !== before) {
|
|
2196
|
+
this.log.info("session branch fast-forwarded to origin", { sessionBranch });
|
|
2197
|
+
}
|
|
2198
|
+
return;
|
|
2199
|
+
}
|
|
2200
|
+
const { ahead, behind } = await countAheadBehind(targetDir, originRef);
|
|
2201
|
+
this.log.warn("local session branch has commits not on origin; kept", {
|
|
2202
|
+
sessionBranch,
|
|
2203
|
+
ahead,
|
|
2204
|
+
behind
|
|
2205
|
+
});
|
|
2206
|
+
if (behind > 0) await this.integrateOriginSessionBranch(state, targetDir, sessionBranch);
|
|
2207
|
+
} catch (err) {
|
|
2208
|
+
this.log.warn("could not line up the local session branch with origin", {
|
|
2209
|
+
sessionBranch,
|
|
2210
|
+
error: redactUrlAuth(err instanceof Error ? err.message : String(err))
|
|
2211
|
+
});
|
|
2136
2212
|
}
|
|
2213
|
+
}
|
|
2214
|
+
/**
|
|
2215
|
+
* Merge `origin/<branch>` into the checked-out session branch when origin
|
|
2216
|
+
* holds commits that the local branch lacks (another node or the agent
|
|
2217
|
+
* pushed, or an older driver rewrote the local branch). A merge, never a
|
|
2218
|
+
* rebase: the commits on origin are published. After this, a push of the
|
|
2219
|
+
* branch is a fast-forward and needs no force. Never throws; a merge that
|
|
2220
|
+
* cannot complete is aborted, and the push that follows fails as before.
|
|
2221
|
+
*/
|
|
2222
|
+
async integrateOriginSessionBranch(s, cwd, branch = s.activeBranch) {
|
|
2223
|
+
const originRef = await originTrackingRef(branch, cwd);
|
|
2224
|
+
if (originRef === null || await isAncestor(originRef, "HEAD", cwd)) return;
|
|
2137
2225
|
try {
|
|
2138
|
-
await
|
|
2226
|
+
await gitCommitting(["merge", "--no-edit", originRef], cwd, 6e4);
|
|
2227
|
+
this.log.info("merged origin session branch", { branch });
|
|
2139
2228
|
} catch (err) {
|
|
2140
|
-
this.log.warn("
|
|
2141
|
-
branch
|
|
2229
|
+
this.log.warn("merge of origin session branch failed", {
|
|
2230
|
+
branch,
|
|
2142
2231
|
error: redactUrlAuth(err instanceof Error ? err.message : String(err))
|
|
2143
2232
|
});
|
|
2233
|
+
await this.resolveConflictsOrAbort(s, cwd, "merge");
|
|
2144
2234
|
}
|
|
2235
|
+
}
|
|
2236
|
+
/**
|
|
2237
|
+
* After a successful push of a session branch: map it with a fetch refspec
|
|
2238
|
+
* and point `refs/remotes/origin/<branch>` at the pushed tip. The push ran
|
|
2239
|
+
* before the refspec existed (a refspec for a branch that origin does not
|
|
2240
|
+
* have yet would break `git fetch origin`), so git did not update the
|
|
2241
|
+
* tracking ref itself. With both, `@{upstream}` resolves and the platform's
|
|
2242
|
+
* hibernate save gate sees `ahead` 0. Never throws.
|
|
2243
|
+
*/
|
|
2244
|
+
async recordPushedSessionBranch(branch, cwd) {
|
|
2245
|
+
try {
|
|
2246
|
+
await ensureTrackingRefspec(branch, cwd);
|
|
2247
|
+
await git(["update-ref", `refs/remotes/origin/${branch}`, `refs/heads/${branch}`], cwd);
|
|
2248
|
+
} catch (err) {
|
|
2249
|
+
this.log.warn("could not record the pushed session branch", {
|
|
2250
|
+
branch,
|
|
2251
|
+
error: redactUrlAuth(err instanceof Error ? err.message : String(err))
|
|
2252
|
+
});
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
/**
|
|
2256
|
+
* Push the active branch. A session branch first gets any commits that are
|
|
2257
|
+
* only on `origin/<branch>` merged in, so the push is a fast-forward and
|
|
2258
|
+
* never needs a force. It is pushed with `-u` and then recorded (see
|
|
2259
|
+
* {@link recordPushedSessionBranch}), so `@{upstream}` resolves — the
|
|
2260
|
+
* platform's hibernate save gate reads exactly that. The base branch keeps
|
|
2261
|
+
* its plain push.
|
|
2262
|
+
*/
|
|
2263
|
+
async pushActiveBranch(s, cwd) {
|
|
2264
|
+
if (s.activeBranch === s.branch) {
|
|
2265
|
+
await git(["push", "origin", s.activeBranch], cwd, 6e4);
|
|
2266
|
+
return;
|
|
2267
|
+
}
|
|
2268
|
+
await this.integrateOriginSessionBranch(s, cwd);
|
|
2145
2269
|
await git(["push", "-u", "origin", s.activeBranch], cwd, 6e4);
|
|
2270
|
+
await this.recordPushedSessionBranch(s.activeBranch, cwd);
|
|
2146
2271
|
}
|
|
2147
2272
|
/**
|
|
2148
2273
|
* Attempt to create `sessionBranch` anchored on `session.fromRef`. Returns
|
|
@@ -3056,7 +3181,7 @@ var GitConnector = class extends AbstractConnector {
|
|
|
3056
3181
|
s.fetchInFlight = true;
|
|
3057
3182
|
void this.runPeriodicFetch(s, mountPath).catch((err) => {
|
|
3058
3183
|
this.log.debug("periodic fetch failed", {
|
|
3059
|
-
error: err instanceof Error ? err.message : String(err)
|
|
3184
|
+
error: redactUrlAuth(err instanceof Error ? err.message : String(err))
|
|
3060
3185
|
});
|
|
3061
3186
|
}).finally(() => {
|
|
3062
3187
|
s.fetchInFlight = false;
|
|
@@ -3065,9 +3190,17 @@ var GitConnector = class extends AbstractConnector {
|
|
|
3065
3190
|
}
|
|
3066
3191
|
/** One periodic-fetch tick. Bails out at each resumption point once disconnected. */
|
|
3067
3192
|
async runPeriodicFetch(s, mountPath) {
|
|
3068
|
-
await
|
|
3193
|
+
await this.fetchOrigin(s, mountPath);
|
|
3069
3194
|
if (s.disposed) return;
|
|
3070
3195
|
if (s.sync.autoRebase && s.activeBranch !== s.branch) {
|
|
3196
|
+
const onOrigin = await this.trackSessionBranch(s.activeBranch, mountPath);
|
|
3197
|
+
if (s.disposed) return;
|
|
3198
|
+
if (onOrigin !== "absent") {
|
|
3199
|
+
await this.mergeBaseIntoSessionBranch(s, mountPath);
|
|
3200
|
+
if (s.disposed) return;
|
|
3201
|
+
await syncSubmodules(mountPath, this.log);
|
|
3202
|
+
return;
|
|
3203
|
+
}
|
|
3071
3204
|
try {
|
|
3072
3205
|
await gitCommitting(["rebase", `origin/${s.branch}`], mountPath, 6e4);
|
|
3073
3206
|
} catch (err) {
|
|
@@ -3085,6 +3218,59 @@ var GitConnector = class extends AbstractConnector {
|
|
|
3085
3218
|
await syncSubmodules(mountPath, this.log);
|
|
3086
3219
|
}
|
|
3087
3220
|
}
|
|
3221
|
+
/**
|
|
3222
|
+
* `git fetch origin` for the periodic tick. When origin no longer has a
|
|
3223
|
+
* branch that a session refspec names (for example a session branch deleted
|
|
3224
|
+
* after a merge, or one from an earlier session on this checkout), that
|
|
3225
|
+
* refspec fails the whole fetch. Drop it and fetch again. The base branch
|
|
3226
|
+
* refspec is never dropped.
|
|
3227
|
+
*/
|
|
3228
|
+
async fetchOrigin(s, mountPath) {
|
|
3229
|
+
for (let attempt = 0; ; attempt++) {
|
|
3230
|
+
try {
|
|
3231
|
+
await runGit([...gitPrefix(mountPath), "fetch", "origin"], {
|
|
3232
|
+
cwd: mountPath,
|
|
3233
|
+
timeout: 6e4,
|
|
3234
|
+
env: cLocaleEnv()
|
|
3235
|
+
});
|
|
3236
|
+
return;
|
|
3237
|
+
} catch (err) {
|
|
3238
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
3239
|
+
const missing = /couldn't find remote ref refs\/heads\/(\S+)/.exec(message)?.[1];
|
|
3240
|
+
if (missing === void 0 || missing === s.branch || !isValidGitRefOrSha(missing)) {
|
|
3241
|
+
throw err;
|
|
3242
|
+
}
|
|
3243
|
+
if (attempt >= 3) throw err;
|
|
3244
|
+
this.log.info("branch not on origin; dropping its fetch refspec", { branch: missing });
|
|
3245
|
+
await dropTrackingRefspec(missing, mountPath);
|
|
3246
|
+
await gitOrNull(["update-ref", "-d", `refs/remotes/origin/${missing}`], mountPath);
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
3250
|
+
/**
|
|
3251
|
+
* Merge `origin/<base>` into a published session branch (periodic tick with
|
|
3252
|
+
* `autoRebase`). No-op when the base is already contained. Conflicts are
|
|
3253
|
+
* handled like the merge on close: keep "ours" (the session branch) and
|
|
3254
|
+
* save "theirs" as `.conflict` files.
|
|
3255
|
+
*/
|
|
3256
|
+
async mergeBaseIntoSessionBranch(s, mountPath) {
|
|
3257
|
+
const baseRef = `origin/${s.branch}`;
|
|
3258
|
+
if (await isAncestor(baseRef, "HEAD", mountPath)) return;
|
|
3259
|
+
try {
|
|
3260
|
+
await gitCommitting(["merge", "--no-edit", baseRef], mountPath, 6e4);
|
|
3261
|
+
this.log.info("merged base into published session branch", {
|
|
3262
|
+
branch: s.activeBranch,
|
|
3263
|
+
base: s.branch
|
|
3264
|
+
});
|
|
3265
|
+
} catch (err) {
|
|
3266
|
+
this.log.warn("merge of base into session branch failed", {
|
|
3267
|
+
branch: s.activeBranch,
|
|
3268
|
+
base: s.branch,
|
|
3269
|
+
error: redactUrlAuth(err instanceof Error ? err.message : String(err))
|
|
3270
|
+
});
|
|
3271
|
+
await this.resolveConflictsOrAbort(s, mountPath, "merge");
|
|
3272
|
+
}
|
|
3273
|
+
}
|
|
3088
3274
|
// ── Conflict resolution ──────────────────────────────────────────────────
|
|
3089
3275
|
/**
|
|
3090
3276
|
* Attempt to resolve merge/rebase conflicts by keeping "ours" and copying
|
|
@@ -11245,5 +11431,5 @@ function describeFlowOperations() {
|
|
|
11245
11431
|
}
|
|
11246
11432
|
|
|
11247
11433
|
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, SQLiteConnector, SessionInlineSubFlowRunner, SessionNodeExecutor, SessionSubpromptRunner, SharePointConnector, StaticServerConnector, TunnelConnector, WebDAVConnector, XStateConnector, XStateStoreConnector, __test, atomicReplaceCredential, buildConnectorPromptSection, buildConnectorToolDefs, buildFlowPromptEvent, buildFlowToolDefs, buildLazyFlowToolDefs, buildLazySdkFlowTools, buildSdkConnectorTools, buildSdkFlowTools, 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, readGitSyncStatus, registerBuiltinConnectors, removeMountBlock, removeUnavailableMountBlock, renderCredentialHelperScript, tryGetConnector, worktreeRegistry, writeHelperScript, writeMountBlock, writeUnavailableMountBlock };
|
|
11248
|
-
//# sourceMappingURL=chunk-
|
|
11249
|
-
//# sourceMappingURL=chunk-
|
|
11434
|
+
//# sourceMappingURL=chunk-CTQ4G3UY.js.map
|
|
11435
|
+
//# sourceMappingURL=chunk-CTQ4G3UY.js.map
|