@memnexus-ai/mx-agent-cli 0.1.303 → 0.1.304
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/agent-config/.mx-config-generation.json +2 -2
- package/dist/agent-config/AGENTS.md.template +1 -1
- package/dist/agent-config/agents/bar-raiser.md +41 -1
- package/dist/agent-config/agents/git-expert.md +58 -54
- package/dist/agent-config/claude-md/CLAUDE.core.md +1 -1
- package/dist/agent-config/hooks/session-idle-gate.sh +14 -1
- package/dist/agent-config/hooks/subagent-write-guard.sh +198 -12
- package/dist/agent-config/hooks/worktree-guard.sh +8 -6
- package/dist/agent-config/skills/mx-post-merge-sync/SKILL.md +57 -51
- package/dist/commands/codex-agent-gate.d.ts +1 -2
- package/dist/commands/codex-agent-gate.d.ts.map +1 -1
- package/dist/commands/codex-agent-gate.js +1 -2
- package/dist/commands/codex-agent-gate.js.map +1 -1
- package/dist/commands/codex-deploy-config.d.ts +6 -0
- package/dist/commands/codex-deploy-config.d.ts.map +1 -1
- package/dist/commands/codex-deploy-config.js +28 -8
- package/dist/commands/codex-deploy-config.js.map +1 -1
- package/dist/commands/codex-prove-guards.d.ts +2 -0
- package/dist/commands/codex-prove-guards.d.ts.map +1 -1
- package/dist/commands/codex-prove-guards.js +31 -3
- package/dist/commands/codex-prove-guards.js.map +1 -1
- package/dist/commands/codex-trust-keys.d.ts +2 -0
- package/dist/commands/codex-trust-keys.d.ts.map +1 -1
- package/dist/commands/codex-trust-keys.js +27 -7
- package/dist/commands/codex-trust-keys.js.map +1 -1
- package/dist/commands/coordination.d.ts +16 -0
- package/dist/commands/coordination.d.ts.map +1 -1
- package/dist/commands/coordination.js +24 -2
- package/dist/commands/coordination.js.map +1 -1
- package/dist/commands/create.d.ts +164 -7
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +293 -91
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/doctor.d.ts +17 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +33 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/gh.d.ts +3 -2
- package/dist/commands/gh.d.ts.map +1 -1
- package/dist/commands/gh.js +3 -2
- package/dist/commands/gh.js.map +1 -1
- package/dist/commands/new.d.ts +132 -17
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +426 -74
- package/dist/commands/new.js.map +1 -1
- package/dist/commands/start.d.ts +6 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js +105 -17
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/status.d.ts +7 -0
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +21 -1
- package/dist/commands/status.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-session.d.ts +11 -0
- package/dist/lib/agent-session.d.ts.map +1 -1
- package/dist/lib/agent-session.js +26 -7
- package/dist/lib/agent-session.js.map +1 -1
- package/dist/lib/behavioral-injection.d.ts.map +1 -1
- package/dist/lib/behavioral-injection.js +25 -7
- package/dist/lib/behavioral-injection.js.map +1 -1
- package/dist/lib/catalog-commit.d.ts.map +1 -1
- package/dist/lib/catalog-commit.js +17 -14
- package/dist/lib/catalog-commit.js.map +1 -1
- package/dist/lib/catalog.d.ts +93 -2
- package/dist/lib/catalog.d.ts.map +1 -1
- package/dist/lib/catalog.js +116 -9
- package/dist/lib/catalog.js.map +1 -1
- package/dist/lib/claude.d.ts.map +1 -1
- package/dist/lib/claude.js +28 -4
- package/dist/lib/claude.js.map +1 -1
- package/dist/lib/fleet-data.d.ts +98 -9
- package/dist/lib/fleet-data.d.ts.map +1 -1
- package/dist/lib/fleet-data.js +353 -34
- package/dist/lib/fleet-data.js.map +1 -1
- package/dist/lib/fleet-render.d.ts +8 -1
- package/dist/lib/fleet-render.d.ts.map +1 -1
- package/dist/lib/fleet-render.js +10 -3
- package/dist/lib/fleet-render.js.map +1 -1
- package/dist/lib/gh-remote.d.ts +15 -1
- package/dist/lib/gh-remote.d.ts.map +1 -1
- package/dist/lib/gh-remote.js +27 -2
- package/dist/lib/gh-remote.js.map +1 -1
- package/dist/lib/gh-token-run.d.ts +140 -14
- package/dist/lib/gh-token-run.d.ts.map +1 -1
- package/dist/lib/gh-token-run.js +187 -15
- package/dist/lib/gh-token-run.js.map +1 -1
- package/dist/lib/git-identity.d.ts +6 -2
- package/dist/lib/git-identity.d.ts.map +1 -1
- package/dist/lib/git-identity.js +17 -8
- package/dist/lib/git-identity.js.map +1 -1
- package/dist/lib/guarded-read.d.ts +15 -0
- package/dist/lib/guarded-read.d.ts.map +1 -0
- package/dist/lib/guarded-read.js +73 -0
- package/dist/lib/guarded-read.js.map +1 -0
- package/dist/lib/machine-setup.d.ts +165 -0
- package/dist/lib/machine-setup.d.ts.map +1 -0
- package/dist/lib/machine-setup.js +441 -0
- package/dist/lib/machine-setup.js.map +1 -0
- package/dist/lib/native-realpath.d.ts +70 -0
- package/dist/lib/native-realpath.d.ts.map +1 -0
- package/dist/lib/native-realpath.js +95 -0
- package/dist/lib/native-realpath.js.map +1 -0
- package/dist/lib/project-config.d.ts +2 -6
- package/dist/lib/project-config.d.ts.map +1 -1
- package/dist/lib/project-config.js.map +1 -1
- package/dist/lib/project-name.d.ts +15 -0
- package/dist/lib/project-name.d.ts.map +1 -0
- package/dist/lib/project-name.js +22 -0
- package/dist/lib/project-name.js.map +1 -0
- package/dist/lib/push-to.d.ts +113 -0
- package/dist/lib/push-to.d.ts.map +1 -0
- package/dist/lib/push-to.js +240 -0
- package/dist/lib/push-to.js.map +1 -0
- package/dist/lib/runtime/claude-gateway-routing.d.ts +161 -0
- package/dist/lib/runtime/claude-gateway-routing.d.ts.map +1 -0
- package/dist/lib/runtime/claude-gateway-routing.js +466 -0
- package/dist/lib/runtime/claude-gateway-routing.js.map +1 -0
- package/dist/lib/runtime/codex-adapter.d.ts +91 -5
- package/dist/lib/runtime/codex-adapter.d.ts.map +1 -1
- package/dist/lib/runtime/codex-adapter.js +204 -44
- package/dist/lib/runtime/codex-adapter.js.map +1 -1
- package/dist/lib/runtime/codex-config.d.ts +6 -12
- package/dist/lib/runtime/codex-config.d.ts.map +1 -1
- package/dist/lib/runtime/codex-config.js +17 -24
- package/dist/lib/runtime/codex-config.js.map +1 -1
- package/dist/lib/runtime/codex-guard-proof.d.ts +4 -7
- package/dist/lib/runtime/codex-guard-proof.d.ts.map +1 -1
- package/dist/lib/runtime/codex-guard-proof.js +16 -14
- package/dist/lib/runtime/codex-guard-proof.js.map +1 -1
- package/dist/lib/runtime/codex-hooks-list.d.ts +20 -0
- package/dist/lib/runtime/codex-hooks-list.d.ts.map +1 -1
- package/dist/lib/runtime/codex-hooks-list.js +20 -8
- package/dist/lib/runtime/codex-hooks-list.js.map +1 -1
- package/dist/lib/runtime/types.d.ts +1 -1
- package/dist/lib/runtime/types.d.ts.map +1 -1
- package/dist/lib/standards.d.ts +3 -0
- package/dist/lib/standards.d.ts.map +1 -1
- package/dist/lib/standards.js +1 -0
- package/dist/lib/standards.js.map +1 -1
- package/dist/lib/team-identity.d.ts.map +1 -1
- package/dist/lib/team-identity.js +18 -53
- package/dist/lib/team-identity.js.map +1 -1
- package/dist/lib/team-restore.d.ts +281 -0
- package/dist/lib/team-restore.d.ts.map +1 -0
- package/dist/lib/team-restore.js +533 -0
- package/dist/lib/team-restore.js.map +1 -0
- package/dist/lib/window-view.d.ts +5 -0
- package/dist/lib/window-view.d.ts.map +1 -1
- package/dist/lib/window-view.js +67 -6
- package/dist/lib/window-view.js.map +1 -1
- package/dist/lib/worktree-sync.d.ts +139 -11
- package/dist/lib/worktree-sync.d.ts.map +1 -1
- package/dist/lib/worktree-sync.js +327 -46
- package/dist/lib/worktree-sync.js.map +1 -1
- package/dist/standards/merge-gates.md +26 -0
- package/package.json +2 -2
|
@@ -97,12 +97,8 @@ export interface ProjectConfig {
|
|
|
97
97
|
*/
|
|
98
98
|
coordinationMode?: string;
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* pinned ID, so the fleet tracks Claude Code's current default Opus release
|
|
103
|
-
* automatically. Note there is no `[1m]` suffix: on the current Opus release
|
|
104
|
-
* the 1M context window is the default and the maximum, so a suffixed variant
|
|
105
|
-
* is unnecessary.
|
|
100
|
+
* Optional model ID or alias for the selected runtime. Claude defaults to
|
|
101
|
+
* opus. Codex uses its own default for empty values and Claude model names.
|
|
106
102
|
*/
|
|
107
103
|
sessionModel?: string;
|
|
108
104
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../src/lib/project-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AASH;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,aAAa;IAC5B,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qFAAqF;IACrF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qGAAqG;IACrG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+FAA+F;IAC/F,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iGAAiG;IACjG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACH,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B
|
|
1
|
+
{"version":3,"file":"project-config.d.ts","sourceRoot":"","sources":["../../src/lib/project-config.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wC,GAC7C,MAAM,EAAE,CAWV;AA+DD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,UAAU,SAAuC,GAChD,MAAM,CASR;AAWD;;;;;;;;;;;;GAYG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,UAAU,SAA8C,GACvD,iBAAiB,CA0CnB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EACb,YAAY,GAAE,kBAAwC,EACtD,UAAU,SAAmD,GAC5D,MAAM,CAmBR;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,aAAa,GAAG,aAAa,CA2C1E;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAsC3E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,aAAa,GAAG,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,CAerF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-config.js","sourceRoot":"","sources":["../../src/lib/project-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,8EAA8E;AAC9E,kFAAkF;AAClF,iDAAiD;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"project-config.js","sourceRoot":"","sources":["../../src/lib/project-config.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC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AI,uBAAuB,CAAC,iBAAiB;QACpF,gBAAgB,EAAE,CAAC,EAAE,gBAAgB,IAAI,uBAAuB,CAAC,gBAAgB;QACjF,YAAY,EAAE,CAAC,EAAE,YAAY,IAAI,uBAAuB,CAAC,YAAY;QACrE,sBAAsB,EAAE,CAAC,EAAE,sBAAsB,IAAI,uBAAuB,CAAC,sBAAsB;KACpG,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The project-name rule for `mx-agent new project` (#1111 item 5).
|
|
3
|
+
*
|
|
4
|
+
* PURE MODULE. It imports nothing, and it reads no file, process, network or
|
|
5
|
+
* environment at load or at call. The surface team's web app bundles it and runs
|
|
6
|
+
* the CLI's own rule on the server before it starts the CLI. Bootstrap keeps this
|
|
7
|
+
* module free of `fs`, `child_process`, `os`, `net`, `http`, `https` and every
|
|
8
|
+
* other import; `src/__tests__/project-name.test.ts` checks that statically.
|
|
9
|
+
*
|
|
10
|
+
* `commands/new.ts` re-exports `validateProjectName`, so imports from there keep
|
|
11
|
+
* working.
|
|
12
|
+
*/
|
|
13
|
+
/** Validate project name: letters, digits, hyphens/underscores, 1-50 chars, must start with letter or digit */
|
|
14
|
+
export declare function validateProjectName(name: string): void;
|
|
15
|
+
//# sourceMappingURL=project-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-name.d.ts","sourceRoot":"","sources":["../../src/lib/project-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,+GAA+G;AAC/G,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAStD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The project-name rule for `mx-agent new project` (#1111 item 5).
|
|
3
|
+
*
|
|
4
|
+
* PURE MODULE. It imports nothing, and it reads no file, process, network or
|
|
5
|
+
* environment at load or at call. The surface team's web app bundles it and runs
|
|
6
|
+
* the CLI's own rule on the server before it starts the CLI. Bootstrap keeps this
|
|
7
|
+
* module free of `fs`, `child_process`, `os`, `net`, `http`, `https` and every
|
|
8
|
+
* other import; `src/__tests__/project-name.test.ts` checks that statically.
|
|
9
|
+
*
|
|
10
|
+
* `commands/new.ts` re-exports `validateProjectName`, so imports from there keep
|
|
11
|
+
* working.
|
|
12
|
+
*/
|
|
13
|
+
/** Validate project name: letters, digits, hyphens/underscores, 1-50 chars, must start with letter or digit */
|
|
14
|
+
export function validateProjectName(name) {
|
|
15
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,49}$/.test(name)) {
|
|
16
|
+
throw new Error(`Invalid project name "${name}". Use letters, digits, hyphens, or underscores (1–50 chars, must start with a letter or digit).`);
|
|
17
|
+
}
|
|
18
|
+
if (/[;|&$`()><]/.test(name) || name.includes('..') || name.includes('/') || name.includes('\\')) {
|
|
19
|
+
throw new Error(`Project name "${name}" contains disallowed characters.`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=project-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-name.js","sourceRoot":"","sources":["../../src/lib/project-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,+GAA+G;AAC/G,MAAM,UAAU,mBAAmB,CAAC,IAAY;IAC9C,IAAI,CAAC,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACnD,MAAM,IAAI,KAAK,CACb,yBAAyB,IAAI,kGAAkG,CAChI,CAAC;IACJ,CAAC;IACD,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACjG,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,mCAAmC,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mx-agent new project <name> --scaffold-only --push-to <url>` (#1111 item 2,
|
|
3
|
+
* plan amendment 1 MF2 and MF3).
|
|
4
|
+
*
|
|
5
|
+
* The caller has created an empty GitHub repository already. This module checks
|
|
6
|
+
* the URL it was handed, sets `origin` to that URL, and pushes `main`. It never
|
|
7
|
+
* runs `gh`.
|
|
8
|
+
*
|
|
9
|
+
* THE CREDENTIAL. The push token comes from `GH_TOKEN` in this process's
|
|
10
|
+
* environment, read by git at push time only:
|
|
11
|
+
* - git asks `GIT_ASKPASS` for a username and a password. The helper is a
|
|
12
|
+
* shell script this module writes into a fresh 0700 temporary directory and
|
|
13
|
+
* deletes after the push. It answers the username prompt with
|
|
14
|
+
* `x-access-token` and the password prompt by printing `$GH_TOKEN` from its
|
|
15
|
+
* own environment. The script holds no token;
|
|
16
|
+
* - the ls-remote check and the push run with `-c credential.helper=`, so no
|
|
17
|
+
* configured credential helper is asked and none is handed the token to
|
|
18
|
+
* store, and with TLS verification on, no config proxy and https only
|
|
19
|
+
* (`pushGitConfigArgs`);
|
|
20
|
+
* - the helper answers only git's exact github.com prompts;
|
|
21
|
+
* - the child environment is an allowlist (`PUSH_ENV_ALLOWED`), ignores the
|
|
22
|
+
* global and system git config (`GIT_CONFIG_GLOBAL=/dev/null`,
|
|
23
|
+
* `GIT_CONFIG_NOSYSTEM=1`), and turns the terminal prompt off;
|
|
24
|
+
* - `origin` holds the plain URL, so `.git/config` never holds the token;
|
|
25
|
+
* - git's output goes through `printable()` (`gh-remote.ts`) and the
|
|
26
|
+
* `redactErrorText` rules, and any literal occurrence of the token is
|
|
27
|
+
* replaced, before anything prints it.
|
|
28
|
+
* This module never reads the token except to remove it from git's output, and
|
|
29
|
+
* never writes it to argv, a file, stdout or stderr.
|
|
30
|
+
*
|
|
31
|
+
* THE TEST SEAM IS INJECTION ONLY (MF3). `validatePushToUrl` accepts only
|
|
32
|
+
* `https://github.com/<owner>/<repo>` with an optional `.git`. No environment
|
|
33
|
+
* variable, flag or config value widens it. A test that pushes to a local bare
|
|
34
|
+
* repository passes its own validator to `runNew` and its own options here.
|
|
35
|
+
*/
|
|
36
|
+
import { PUSH_TIMEOUT_MS, type SpawnSyncFn } from './gh-remote.js';
|
|
37
|
+
export { PUSH_TIMEOUT_MS };
|
|
38
|
+
/** The username GitHub expects with an installation or fine-grained token. */
|
|
39
|
+
export declare const PUSH_USERNAME = "x-access-token";
|
|
40
|
+
/**
|
|
41
|
+
* Check a `--push-to` value. Returns the URL unchanged, or throws naming why.
|
|
42
|
+
*
|
|
43
|
+
* Accepted: `https://github.com/<owner>/<repo>` and the same with `.git`. Refused:
|
|
44
|
+
* any other scheme or host, userinfo, a port, a query, a fragment, a trailing
|
|
45
|
+
* slash, extra path segments, and an owner or repository outside GitHub's ASCII
|
|
46
|
+
* name alphabet (`validateOwnerRepoShape`). A regular expression on the raw
|
|
47
|
+
* string, not `new URL()`, so nothing is normalised before the check.
|
|
48
|
+
*/
|
|
49
|
+
export declare function validatePushToUrl(url: string): string;
|
|
50
|
+
/**
|
|
51
|
+
* The ways a `--push-to` push ends. The three `remote-*` reasons come from the
|
|
52
|
+
* `git ls-remote` check that runs before the push (#1111 amendment 2): the push
|
|
53
|
+
* never runs unless the remote exists and holds no ref.
|
|
54
|
+
*/
|
|
55
|
+
export type PushToReason = 'pushed' | 'push-failed' | 'push-timeout' | 'remote-not-empty' | 'remote-missing' | 'remote-unreachable';
|
|
56
|
+
export interface PushToResult {
|
|
57
|
+
reason: PushToReason;
|
|
58
|
+
/** What git wrote, redacted. Safe to print and to put in the JSON. */
|
|
59
|
+
detail: string;
|
|
60
|
+
}
|
|
61
|
+
export interface PushToOptions {
|
|
62
|
+
/** Where `GH_TOKEN` and PATH come from. Defaults to `process.env`. */
|
|
63
|
+
env?: NodeJS.ProcessEnv;
|
|
64
|
+
/** Injectable for tests. Defaults to `spawnSync`. */
|
|
65
|
+
spawn?: SpawnSyncFn;
|
|
66
|
+
/** Defaults to `PUSH_TIMEOUT_MS`. */
|
|
67
|
+
timeoutMs?: number;
|
|
68
|
+
/** Protocols git may use. Defaults to `['https']`. Injection only, for tests. */
|
|
69
|
+
protocols?: readonly string[];
|
|
70
|
+
}
|
|
71
|
+
/** The exact prompt git 2.x gives GIT_ASKPASS for the github.com username (credential.c, "%s for '%s': "). */
|
|
72
|
+
export declare const ASKPASS_USERNAME_PROMPT = "Username for 'https://github.com': ";
|
|
73
|
+
/** The exact password prompt, which names the username the helper returned. */
|
|
74
|
+
export declare const ASKPASS_PASSWORD_PROMPT = "Password for 'https://x-access-token@github.com': ";
|
|
75
|
+
/**
|
|
76
|
+
* The askpass helper. It holds no token: it prints `$GH_TOKEN` from its
|
|
77
|
+
* environment, and only for the exact github.com password prompt (security
|
|
78
|
+
* review on PR #1120, SF2). Any other prompt, a proxy's or another host's,
|
|
79
|
+
* exits 1 with no output, so git fails rather than sending the token there.
|
|
80
|
+
*/
|
|
81
|
+
export declare const ASKPASS_SCRIPT: string;
|
|
82
|
+
/**
|
|
83
|
+
* The only names copied from the caller's environment into the push and
|
|
84
|
+
* ls-remote children (security review on PR #1120, SF1). An allowlist: TLS,
|
|
85
|
+
* proxy, exec-path, ssh, protocol and config-injection variables never reach
|
|
86
|
+
* git. `LC_*` is matched by prefix. SYSTEMROOT is kept because git for Windows
|
|
87
|
+
* cannot open a network socket without it.
|
|
88
|
+
*/
|
|
89
|
+
export declare const PUSH_ENV_ALLOWED: readonly string[];
|
|
90
|
+
/**
|
|
91
|
+
* The push's child environment: only the allowed names above, then the
|
|
92
|
+
* isolation of `lib/gh-token-run.ts` FIXED_CHILD_ENV and `GIT_ASKPASS` set to
|
|
93
|
+
* the helper. `GH_TOKEN` stays, because the helper reads it.
|
|
94
|
+
*/
|
|
95
|
+
export declare function pushChildEnv(source: NodeJS.ProcessEnv, askpassPath: string): NodeJS.ProcessEnv;
|
|
96
|
+
/**
|
|
97
|
+
* The `-c` settings on both git network calls (SF1): no credential helper, TLS
|
|
98
|
+
* verification on, no proxy from config, and only the allowed protocols. The
|
|
99
|
+
* default is https alone; `protocols` is an injection point for tests that
|
|
100
|
+
* push to a local bare repository over file://. Nothing at runtime sets it.
|
|
101
|
+
*/
|
|
102
|
+
export declare function pushGitConfigArgs(protocols?: readonly string[]): string[];
|
|
103
|
+
/**
|
|
104
|
+
* git output made safe to print: control sequences, then URL userinfo, then the
|
|
105
|
+
* token shapes `redactSecrets` knows, then the token itself if it is present.
|
|
106
|
+
*/
|
|
107
|
+
export declare function redactPushOutput(text: string, token: string | undefined): string;
|
|
108
|
+
/**
|
|
109
|
+
* Set `origin` to `url` and push `main`. `url` must already have passed the
|
|
110
|
+
* caller's validator. Never throws for a git failure: it returns the reason.
|
|
111
|
+
*/
|
|
112
|
+
export declare function pushToRemote(outputDir: string, url: string, options?: PushToOptions): PushToResult;
|
|
113
|
+
//# sourceMappingURL=push-to.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-to.d.ts","sourceRoot":"","sources":["../../src/lib/push-to.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAMH,OAAO,EAAE,eAAe,EAA0B,KAAK,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAI3F,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,8EAA8E;AAC9E,eAAO,MAAM,aAAa,mBAAmB,CAAC;AAK9C;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAgBrD;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,aAAa,GAAG,cAAc,GAAG,kBAAkB,GAAG,gBAAgB,GAAG,oBAAoB,CAAC;AASpI,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,YAAY,CAAC;IACrB,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,sEAAsE;IACtE,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,qDAAqD;IACrD,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iFAAiF;IACjF,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/B;AAED,8GAA8G;AAC9G,eAAO,MAAM,uBAAuB,wCAAwC,CAAC;AAC7E,+EAA+E;AAC/E,eAAO,MAAM,uBAAuB,uDAAyD,CAAC;AAE9F;;;;;GAKG;AACH,eAAO,MAAM,cAAc,QAUf,CAAC;AAEb;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAAkF,CAAC;AAMjI;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC,UAAU,CAU9F;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,GAAE,SAAS,MAAM,EAAc,GAAG,MAAM,EAAE,CAQpF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAMhF;AAOD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB,GAAG,YAAY,CAuEtG"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `mx-agent new project <name> --scaffold-only --push-to <url>` (#1111 item 2,
|
|
3
|
+
* plan amendment 1 MF2 and MF3).
|
|
4
|
+
*
|
|
5
|
+
* The caller has created an empty GitHub repository already. This module checks
|
|
6
|
+
* the URL it was handed, sets `origin` to that URL, and pushes `main`. It never
|
|
7
|
+
* runs `gh`.
|
|
8
|
+
*
|
|
9
|
+
* THE CREDENTIAL. The push token comes from `GH_TOKEN` in this process's
|
|
10
|
+
* environment, read by git at push time only:
|
|
11
|
+
* - git asks `GIT_ASKPASS` for a username and a password. The helper is a
|
|
12
|
+
* shell script this module writes into a fresh 0700 temporary directory and
|
|
13
|
+
* deletes after the push. It answers the username prompt with
|
|
14
|
+
* `x-access-token` and the password prompt by printing `$GH_TOKEN` from its
|
|
15
|
+
* own environment. The script holds no token;
|
|
16
|
+
* - the ls-remote check and the push run with `-c credential.helper=`, so no
|
|
17
|
+
* configured credential helper is asked and none is handed the token to
|
|
18
|
+
* store, and with TLS verification on, no config proxy and https only
|
|
19
|
+
* (`pushGitConfigArgs`);
|
|
20
|
+
* - the helper answers only git's exact github.com prompts;
|
|
21
|
+
* - the child environment is an allowlist (`PUSH_ENV_ALLOWED`), ignores the
|
|
22
|
+
* global and system git config (`GIT_CONFIG_GLOBAL=/dev/null`,
|
|
23
|
+
* `GIT_CONFIG_NOSYSTEM=1`), and turns the terminal prompt off;
|
|
24
|
+
* - `origin` holds the plain URL, so `.git/config` never holds the token;
|
|
25
|
+
* - git's output goes through `printable()` (`gh-remote.ts`) and the
|
|
26
|
+
* `redactErrorText` rules, and any literal occurrence of the token is
|
|
27
|
+
* replaced, before anything prints it.
|
|
28
|
+
* This module never reads the token except to remove it from git's output, and
|
|
29
|
+
* never writes it to argv, a file, stdout or stderr.
|
|
30
|
+
*
|
|
31
|
+
* THE TEST SEAM IS INJECTION ONLY (MF3). `validatePushToUrl` accepts only
|
|
32
|
+
* `https://github.com/<owner>/<repo>` with an optional `.git`. No environment
|
|
33
|
+
* variable, flag or config value widens it. A test that pushes to a local bare
|
|
34
|
+
* repository passes its own validator to `runNew` and its own options here.
|
|
35
|
+
*/
|
|
36
|
+
import { spawnSync } from 'child_process';
|
|
37
|
+
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'fs';
|
|
38
|
+
import { tmpdir } from 'os';
|
|
39
|
+
import { join } from 'path';
|
|
40
|
+
import { PUSH_TIMEOUT_MS, validateOwnerRepoShape } from './gh-remote.js';
|
|
41
|
+
import { redactSecrets } from './memory.js';
|
|
42
|
+
import { redactUrlCredentials, stripControlSequences } from './startup-report.js';
|
|
43
|
+
export { PUSH_TIMEOUT_MS };
|
|
44
|
+
/** The username GitHub expects with an installation or fine-grained token. */
|
|
45
|
+
export const PUSH_USERNAME = 'x-access-token';
|
|
46
|
+
/** The longest URL accepted. GitHub owner and repository names are far shorter. */
|
|
47
|
+
const MAX_PUSH_URL_LENGTH = 200;
|
|
48
|
+
/**
|
|
49
|
+
* Check a `--push-to` value. Returns the URL unchanged, or throws naming why.
|
|
50
|
+
*
|
|
51
|
+
* Accepted: `https://github.com/<owner>/<repo>` and the same with `.git`. Refused:
|
|
52
|
+
* any other scheme or host, userinfo, a port, a query, a fragment, a trailing
|
|
53
|
+
* slash, extra path segments, and an owner or repository outside GitHub's ASCII
|
|
54
|
+
* name alphabet (`validateOwnerRepoShape`). A regular expression on the raw
|
|
55
|
+
* string, not `new URL()`, so nothing is normalised before the check.
|
|
56
|
+
*/
|
|
57
|
+
export function validatePushToUrl(url) {
|
|
58
|
+
const refuse = (why) => {
|
|
59
|
+
throw new Error(`--push-to refused: ${why}. Expected https://github.com/<owner>/<repo>, optionally ending in .git.`);
|
|
60
|
+
};
|
|
61
|
+
if (typeof url !== 'string' || url.length === 0)
|
|
62
|
+
refuse('the URL is empty');
|
|
63
|
+
if (url.length > MAX_PUSH_URL_LENGTH)
|
|
64
|
+
refuse(`the URL is longer than ${MAX_PUSH_URL_LENGTH} characters`);
|
|
65
|
+
const m = /^https:\/\/github\.com\/([^/?#@:\s]+)\/([^/?#@:\s]+)$/.exec(url);
|
|
66
|
+
if (!m)
|
|
67
|
+
refuse('the URL is not https://github.com/<owner>/<repo>');
|
|
68
|
+
const owner = m[1];
|
|
69
|
+
const repo = m[2].endsWith('.git') ? m[2].slice(0, -'.git'.length) : m[2];
|
|
70
|
+
if (repo.length === 0)
|
|
71
|
+
refuse('the repository name is empty');
|
|
72
|
+
// `p.git.git` would push to a repository named `p.git` (QA on PR #1120).
|
|
73
|
+
if (/\.git$/i.test(repo))
|
|
74
|
+
refuse('the repository name ends in .git after the optional .git suffix');
|
|
75
|
+
const shape = validateOwnerRepoShape(`${owner}/${repo}`);
|
|
76
|
+
if (shape !== null)
|
|
77
|
+
refuse(`the owner and repository ${shape}`);
|
|
78
|
+
return url;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* git's words for a repository that does not exist, or one this credential may
|
|
82
|
+
* not see: GitHub answers both with "Repository not found". The last two are a
|
|
83
|
+
* local path's, so a test against a bare repository reads the same way.
|
|
84
|
+
*/
|
|
85
|
+
const REMOTE_MISSING_RE = /repository not found|not found|\b404\b|does not appear to be a git repository|does not exist/i;
|
|
86
|
+
/** The exact prompt git 2.x gives GIT_ASKPASS for the github.com username (credential.c, "%s for '%s': "). */
|
|
87
|
+
export const ASKPASS_USERNAME_PROMPT = "Username for 'https://github.com': ";
|
|
88
|
+
/** The exact password prompt, which names the username the helper returned. */
|
|
89
|
+
export const ASKPASS_PASSWORD_PROMPT = `Password for 'https://${PUSH_USERNAME}@github.com': `;
|
|
90
|
+
/**
|
|
91
|
+
* The askpass helper. It holds no token: it prints `$GH_TOKEN` from its
|
|
92
|
+
* environment, and only for the exact github.com password prompt (security
|
|
93
|
+
* review on PR #1120, SF2). Any other prompt, a proxy's or another host's,
|
|
94
|
+
* exits 1 with no output, so git fails rather than sending the token there.
|
|
95
|
+
*/
|
|
96
|
+
export const ASKPASS_SCRIPT = [
|
|
97
|
+
'#!/bin/sh',
|
|
98
|
+
'# Written by mx-agent new project --push-to and deleted after the push.',
|
|
99
|
+
'# It holds no credential. git runs it with the prompt as $1.',
|
|
100
|
+
'case "$1" in',
|
|
101
|
+
` "${ASKPASS_USERNAME_PROMPT}") printf '%s\\n' '${PUSH_USERNAME}' ;;`,
|
|
102
|
+
` "${ASKPASS_PASSWORD_PROMPT}") printf '%s\\n' "$GH_TOKEN" ;;`,
|
|
103
|
+
' *) exit 1 ;;',
|
|
104
|
+
'esac',
|
|
105
|
+
'',
|
|
106
|
+
].join('\n');
|
|
107
|
+
/**
|
|
108
|
+
* The only names copied from the caller's environment into the push and
|
|
109
|
+
* ls-remote children (security review on PR #1120, SF1). An allowlist: TLS,
|
|
110
|
+
* proxy, exec-path, ssh, protocol and config-injection variables never reach
|
|
111
|
+
* git. `LC_*` is matched by prefix. SYSTEMROOT is kept because git for Windows
|
|
112
|
+
* cannot open a network socket without it.
|
|
113
|
+
*/
|
|
114
|
+
export const PUSH_ENV_ALLOWED = ['PATH', 'HOME', 'MX_AGENT_HOME', 'TMPDIR', 'LANG', 'GH_TOKEN', 'SYSTEMROOT'];
|
|
115
|
+
function allowedInPushEnv(name) {
|
|
116
|
+
return PUSH_ENV_ALLOWED.includes(name) || name.startsWith('LC_');
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* The push's child environment: only the allowed names above, then the
|
|
120
|
+
* isolation of `lib/gh-token-run.ts` FIXED_CHILD_ENV and `GIT_ASKPASS` set to
|
|
121
|
+
* the helper. `GH_TOKEN` stays, because the helper reads it.
|
|
122
|
+
*/
|
|
123
|
+
export function pushChildEnv(source, askpassPath) {
|
|
124
|
+
const env = {};
|
|
125
|
+
for (const [k, v] of Object.entries(source)) {
|
|
126
|
+
if (v !== undefined && allowedInPushEnv(k))
|
|
127
|
+
env[k] = v;
|
|
128
|
+
}
|
|
129
|
+
env.GIT_TERMINAL_PROMPT = '0';
|
|
130
|
+
env.GIT_CONFIG_GLOBAL = '/dev/null';
|
|
131
|
+
env.GIT_CONFIG_NOSYSTEM = '1';
|
|
132
|
+
env.GIT_ASKPASS = askpassPath;
|
|
133
|
+
return env;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The `-c` settings on both git network calls (SF1): no credential helper, TLS
|
|
137
|
+
* verification on, no proxy from config, and only the allowed protocols. The
|
|
138
|
+
* default is https alone; `protocols` is an injection point for tests that
|
|
139
|
+
* push to a local bare repository over file://. Nothing at runtime sets it.
|
|
140
|
+
*/
|
|
141
|
+
export function pushGitConfigArgs(protocols = ['https']) {
|
|
142
|
+
return [
|
|
143
|
+
'-c', 'credential.helper=',
|
|
144
|
+
'-c', 'http.sslVerify=true',
|
|
145
|
+
'-c', 'http.proxy=',
|
|
146
|
+
'-c', 'protocol.allow=never',
|
|
147
|
+
...protocols.flatMap((p) => ['-c', `protocol.${p}.allow=always`]),
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* git output made safe to print: control sequences, then URL userinfo, then the
|
|
152
|
+
* token shapes `redactSecrets` knows, then the token itself if it is present.
|
|
153
|
+
*/
|
|
154
|
+
export function redactPushOutput(text, token) {
|
|
155
|
+
let out = redactSecrets(redactUrlCredentials(stripControlSequences(text)));
|
|
156
|
+
// Only a value long enough to be a credential, so a short value cannot blank
|
|
157
|
+
// ordinary words out of the message.
|
|
158
|
+
if (token && token.length >= 8)
|
|
159
|
+
out = out.split(token).join('***');
|
|
160
|
+
return out;
|
|
161
|
+
}
|
|
162
|
+
function streamText(stream) {
|
|
163
|
+
if (typeof stream === 'string')
|
|
164
|
+
return stream;
|
|
165
|
+
return stream ? stream.toString('utf-8') : '';
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Set `origin` to `url` and push `main`. `url` must already have passed the
|
|
169
|
+
* caller's validator. Never throws for a git failure: it returns the reason.
|
|
170
|
+
*/
|
|
171
|
+
export function pushToRemote(outputDir, url, options = {}) {
|
|
172
|
+
const source = options.env ?? process.env;
|
|
173
|
+
const spawn = options.spawn ?? spawnSync;
|
|
174
|
+
const timeoutMs = options.timeoutMs ?? PUSH_TIMEOUT_MS;
|
|
175
|
+
const token = source.GH_TOKEN;
|
|
176
|
+
const clean = (t) => redactPushOutput(t, token).trim();
|
|
177
|
+
// Under MX_AGENT_HOME when it is set, so every write a --scaffold-only run
|
|
178
|
+
// makes outside the repository is under that directory (#1111 amendment 2).
|
|
179
|
+
const helperParent = source.MX_AGENT_HOME ? join(source.MX_AGENT_HOME, '.mx-agent') : tmpdir();
|
|
180
|
+
mkdirSync(helperParent, { recursive: true });
|
|
181
|
+
const helperDir = mkdtempSync(join(helperParent, 'askpass-'));
|
|
182
|
+
try {
|
|
183
|
+
const helper = join(helperDir, 'askpass.sh');
|
|
184
|
+
writeFileSync(helper, ASKPASS_SCRIPT, { mode: 0o700 });
|
|
185
|
+
const env = pushChildEnv(source, helper);
|
|
186
|
+
const base = { encoding: 'utf-8', stdio: ['ignore', 'pipe', 'pipe'], env };
|
|
187
|
+
const add = spawn('git', ['-C', outputDir, 'remote', 'add', 'origin', url], base);
|
|
188
|
+
if (add.error || add.status !== 0) {
|
|
189
|
+
const why = add.error ? add.error.message : streamText(add.stderr);
|
|
190
|
+
return { reason: 'push-failed', detail: clean(`git remote add origin exited ${add.status ?? 'without a status'}: ${why}`) };
|
|
191
|
+
}
|
|
192
|
+
// The remote must exist and hold no ref (#1111 amendment 2). Same
|
|
193
|
+
// credential, env and limit as the push. A non-empty remote is refused, not
|
|
194
|
+
// overwritten: nothing here ever force-pushes.
|
|
195
|
+
const gitConfig = pushGitConfigArgs(options.protocols);
|
|
196
|
+
const probe = spawn('git', ['-C', outputDir, ...gitConfig, 'ls-remote', 'origin'], {
|
|
197
|
+
...base, timeout: timeoutMs, killSignal: 'SIGKILL',
|
|
198
|
+
});
|
|
199
|
+
const probeErr = streamText(probe.stderr);
|
|
200
|
+
if (probe.error?.code === 'ETIMEDOUT') {
|
|
201
|
+
return { reason: 'push-timeout', detail: clean(`git ls-remote origin was stopped after ${Math.round(timeoutMs / 1000)} s; nothing was pushed. ${probeErr}`) };
|
|
202
|
+
}
|
|
203
|
+
if (probe.error || probe.status !== 0) {
|
|
204
|
+
const why = probe.error ? probe.error.message : probeErr;
|
|
205
|
+
return {
|
|
206
|
+
reason: REMOTE_MISSING_RE.test(why) ? 'remote-missing' : 'remote-unreachable',
|
|
207
|
+
detail: clean(`git ls-remote origin exited ${probe.status ?? 'without a status'}; nothing was pushed: ${why}`),
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
const refs = streamText(probe.stdout).split('\n').filter((l) => l.trim() !== '');
|
|
211
|
+
if (refs.length > 0) {
|
|
212
|
+
return {
|
|
213
|
+
reason: 'remote-not-empty',
|
|
214
|
+
detail: clean(`${url} already holds ${refs.length} ref(s); nothing was pushed. --push-to needs an empty repository.`),
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
// SIGKILL, as the gh probes use (gh-remote.ts), because a git that ignores
|
|
218
|
+
// SIGTERM would hold spawnSync past the limit.
|
|
219
|
+
const push = spawn('git', ['-C', outputDir, ...gitConfig, 'push', 'origin', 'main'], {
|
|
220
|
+
...base, timeout: timeoutMs, killSignal: 'SIGKILL',
|
|
221
|
+
});
|
|
222
|
+
const output = `${streamText(push.stdout)}${streamText(push.stderr)}`;
|
|
223
|
+
if (push.error?.code === 'ETIMEDOUT') {
|
|
224
|
+
return {
|
|
225
|
+
reason: 'push-timeout',
|
|
226
|
+
detail: clean(`the push was stopped after ${Math.round(timeoutMs / 1000)} s. Part of the transfer may have reached ${url}, `
|
|
227
|
+
+ `so that repository may already hold objects or a main branch. ${output}`),
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
if (push.error || push.status !== 0) {
|
|
231
|
+
const why = push.error ? push.error.message : output;
|
|
232
|
+
return { reason: 'push-failed', detail: clean(`git push origin main exited ${push.status ?? 'without a status'}: ${why}`) };
|
|
233
|
+
}
|
|
234
|
+
return { reason: 'pushed', detail: clean(output) || `pushed main to ${url}` };
|
|
235
|
+
}
|
|
236
|
+
finally {
|
|
237
|
+
rmSync(helperDir, { recursive: true, force: true });
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=push-to.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-to.js","sour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