freestyle-sync 0.1.2 → 0.1.4

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.
Files changed (45) hide show
  1. package/README.md +2 -1
  2. package/{freestyle-sync.config.ts → dist/freestyle-sync.config.js} +2 -3
  3. package/dist/main.js +1319 -0
  4. package/{plugins/agent-claude/src/index.ts → dist/plugins/agent-claude/src/index.js} +32 -29
  5. package/{plugins/agent-codex/src/index.ts → dist/plugins/agent-codex/src/index.js} +13 -14
  6. package/{plugins/agent-copilot/src/index.ts → dist/plugins/agent-copilot/src/index.js} +151 -164
  7. package/{plugins/auth-aws/src/index.ts → dist/plugins/auth-aws/src/index.js} +14 -8
  8. package/{plugins/auth-azure/src/index.ts → dist/plugins/auth-azure/src/index.js} +14 -8
  9. package/dist/plugins/auth-context.js +213 -0
  10. package/{plugins/auth-docker/src/index.ts → dist/plugins/auth-docker/src/index.js} +14 -8
  11. package/{plugins/auth-env/src/index.ts → dist/plugins/auth-env/src/index.js} +11 -11
  12. package/{plugins/auth-gcloud/src/index.ts → dist/plugins/auth-gcloud/src/index.js} +14 -8
  13. package/{plugins/auth-git/src/index.ts → dist/plugins/auth-git/src/index.js} +24 -17
  14. package/{plugins/auth-github-cli/src/index.ts → dist/plugins/auth-github-cli/src/index.js} +20 -14
  15. package/{plugins/auth-npm/src/index.ts → dist/plugins/auth-npm/src/index.js} +19 -13
  16. package/{plugins/auth-ssh/src/index.ts → dist/plugins/auth-ssh/src/index.js} +19 -13
  17. package/dist/plugins/auth-yarn/src/index.js +24 -0
  18. package/{plugins/node-npm/src/index.ts → dist/plugins/node-npm/src/index.js} +6 -8
  19. package/dist/plugins/npm-native-deps.js +307 -0
  20. package/{plugins/shell-history/src/index.ts → dist/plugins/shell-history/src/index.js} +13 -12
  21. package/{plugins/vscode/src/index.ts → dist/plugins/vscode/src/index.js} +38 -40
  22. package/{src/main.ts → dist/src/main.js} +406 -463
  23. package/dist/src/plugin-api.js +6 -0
  24. package/dist/src/pushvm.config.js +36 -0
  25. package/package.json +8 -4
  26. package/PUBLISHING.md +0 -3
  27. package/plugins/agent-claude/package.json +0 -8
  28. package/plugins/agent-codex/package.json +0 -8
  29. package/plugins/agent-copilot/package.json +0 -8
  30. package/plugins/auth-aws/package.json +0 -8
  31. package/plugins/auth-azure/package.json +0 -8
  32. package/plugins/auth-docker/package.json +0 -8
  33. package/plugins/auth-env/package.json +0 -8
  34. package/plugins/auth-gcloud/package.json +0 -8
  35. package/plugins/auth-git/package.json +0 -8
  36. package/plugins/auth-github-cli/package.json +0 -8
  37. package/plugins/auth-npm/package.json +0 -8
  38. package/plugins/auth-ssh/package.json +0 -8
  39. package/plugins/auth-yarn/package.json +0 -8
  40. package/plugins/auth-yarn/src/index.ts +0 -19
  41. package/plugins/node-npm/package.json +0 -8
  42. package/plugins/shell-history/package.json +0 -8
  43. package/plugins/vscode/package.json +0 -8
  44. package/src/plugin-api.ts +0 -107
  45. package/tsconfig.json +0 -18
@@ -0,0 +1,6 @@
1
+ export function definePlugin(plugin) {
2
+ return plugin;
3
+ }
4
+ export function defineConfig(config) {
5
+ return config;
6
+ }
@@ -0,0 +1,36 @@
1
+ import { defineConfig } from "./plugin-api.js";
2
+ import { claudeAgentPlugin } from "@freestyle-sync/agent-claude";
3
+ import { codexAgentPlugin } from "@freestyle-sync/agent-codex";
4
+ import { copilotAgentPlugin } from "@freestyle-sync/agent-copilot";
5
+ import { awsAuthPlugin } from "@freestyle-sync/auth-aws";
6
+ import { azureAuthPlugin } from "@freestyle-sync/auth-azure";
7
+ import { dockerAuthPlugin } from "@freestyle-sync/auth-docker";
8
+ import { envAuthPlugin } from "@freestyle-sync/auth-env";
9
+ import { gcloudAuthPlugin } from "@freestyle-sync/auth-gcloud";
10
+ import { gitAuthPlugin } from "@freestyle-sync/auth-git";
11
+ import { githubCliAuthPlugin } from "@freestyle-sync/auth-github-cli";
12
+ import { npmAuthPlugin } from "@freestyle-sync/auth-npm";
13
+ import { sshAuthPlugin } from "@freestyle-sync/auth-ssh";
14
+ import { yarnAuthPlugin } from "@freestyle-sync/auth-yarn";
15
+ import { nodeNpmPlugin } from "@freestyle-sync/node-npm";
16
+ import { shellHistoryPlugin } from "@freestyle-sync/shell-history";
17
+ export default defineConfig({
18
+ plugins: [
19
+ envAuthPlugin(),
20
+ gitAuthPlugin(),
21
+ sshAuthPlugin(),
22
+ githubCliAuthPlugin(),
23
+ npmAuthPlugin(),
24
+ yarnAuthPlugin(),
25
+ dockerAuthPlugin(),
26
+ awsAuthPlugin(),
27
+ azureAuthPlugin(),
28
+ gcloudAuthPlugin(),
29
+ nodeNpmPlugin(),
30
+ claudeAgentPlugin(),
31
+ codexAgentPlugin(),
32
+ copilotAgentPlugin(),
33
+ shellHistoryPlugin(),
34
+ // vscodePlugin(),
35
+ ],
36
+ });
package/package.json CHANGED
@@ -1,16 +1,19 @@
1
1
  {
2
2
  "name": "freestyle-sync",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
- "main": "src/main.ts",
5
+ "main": "dist/src/main.js",
6
6
  "exports": {
7
- ".": "./src/main.ts"
7
+ ".": "./dist/src/main.js"
8
8
  },
9
+ "files": [
10
+ "dist"
11
+ ],
9
12
  "workspaces": [
10
13
  "plugins/*"
11
14
  ],
12
15
  "bin": {
13
- "freestyle-sync": "src/main.ts"
16
+ "freestyle-sync": "dist/src/main.js"
14
17
  },
15
18
  "engines": {
16
19
  "node": ">=24"
@@ -18,6 +21,7 @@
18
21
  "scripts": {
19
22
  "build": "tsc -p tsconfig.json",
20
23
  "check": "tsc --noEmit -p tsconfig.json",
24
+ "prepack": "npm run build",
21
25
  "start": "node src/main.ts"
22
26
  },
23
27
  "dependencies": {
package/PUBLISHING.md DELETED
@@ -1,3 +0,0 @@
1
- ```
2
- npm run check && npm run build && npm publish && npm publish --workspaces --access public
3
- ```
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/agent-claude",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/agent-codex",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/agent-copilot",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-aws",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-azure",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-docker",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-env",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-gcloud",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-git",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-github-cli",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-npm",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-ssh",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/auth-yarn",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,19 +0,0 @@
1
- import { stat } from "node:fs/promises";
2
- import { homedir } from "node:os";
3
- import path from "node:path";
4
- import { definePlugin, type ContextCandidate } from "../../../src/plugin-api.ts";
5
-
6
- export function yarnAuthPlugin() {
7
- return definePlugin({
8
- name: "@freestyle-sync/auth-yarn",
9
- async discoverContextCandidates({ options }) {
10
- if (!options.includeAuth) return [];
11
- const item: ContextCandidate = { source: path.join(homedir(), ".yarnrc.yml"), remoteRoot: "/root/.yarnrc.yml", label: "Yarn auth", sensitive: true, preferenceKey: "context:yarn-auth", promptLabel: "Yarn auth" };
12
- return await exists(item.source) ? [item] : [];
13
- },
14
- });
15
- }
16
-
17
- async function exists(filePath: string) {
18
- try { await stat(filePath); return true; } catch { return false; }
19
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/node-npm",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/shell-history",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
@@ -1,8 +0,0 @@
1
- {
2
- "name": "@freestyle-sync/vscode",
3
- "version": "0.1.0",
4
- "type": "module",
5
- "exports": {
6
- ".": "./src/index.ts"
7
- }
8
- }
package/src/plugin-api.ts DELETED
@@ -1,107 +0,0 @@
1
- export type CliOptions = {
2
- projectRoot: string;
3
- cachePath: string;
4
- remoteProjectDir: string;
5
- name: string;
6
- vmId?: string;
7
- idleTimeoutSeconds?: number;
8
- yes: boolean;
9
- dryRun: boolean;
10
- disablePlugins: string[];
11
- enablePlugins: string[];
12
- resetPluginPrefs: boolean;
13
- listPlugins: boolean;
14
- includeAuth: boolean;
15
- includeAgentContext: boolean;
16
- includeGitDir: boolean;
17
- includeAllCopilotWorkspaces: boolean;
18
- snapshot: boolean;
19
- install: boolean;
20
- autoSsh: boolean;
21
- envKeys: string[];
22
- };
23
-
24
- export type ContextCandidate = {
25
- source: string;
26
- remoteRoot: string;
27
- label: string;
28
- sensitive: boolean;
29
- preferenceKey: string;
30
- promptLabel: string;
31
- };
32
-
33
- export type RemoteVm = {
34
- exec(args: { command: string; timeoutMs?: number }): Promise<{ stdout?: string | null; stderr?: string | null; statusCode?: number | null }>;
35
- fs: {
36
- writeFile(path: string, content: Buffer): Promise<void>;
37
- writeTextFile(path: string, content: string): Promise<void>;
38
- };
39
- };
40
-
41
- export type UploadArchiveInChunks = (
42
- vm: RemoteVm,
43
- vmId: string,
44
- archivePath: string,
45
- remoteArchivePath: string,
46
- label: string,
47
- ) => Promise<void>;
48
-
49
- export type ExecFileAsync = (file: string, args: string[]) => Promise<{ stdout: string; stderr: string }>;
50
-
51
- export type PushvmPluginUtils = {
52
- checkedExec(vm: RemoteVm, command: string, timeoutMs?: number): Promise<{ stdout?: string | null; stderr?: string | null; statusCode?: number | null }>;
53
- createTar(args: string[]): Promise<void>;
54
- uploadArchiveInChunks: UploadArchiveInChunks;
55
- execFileAsync: ExecFileAsync;
56
- shellQuote(value: string): string;
57
- md5(value: string): string;
58
- delay(ms: number): Promise<void>;
59
- };
60
-
61
- export type PushvmPluginContext = {
62
- options: CliOptions;
63
- utils: PushvmPluginUtils;
64
- };
65
-
66
- export type RemoteHookContext = PushvmPluginContext & {
67
- vm: RemoteVm;
68
- vmId: string;
69
- };
70
-
71
- export type EditorHookContext = RemoteHookContext & {
72
- scheme: "vscode" | "cursor";
73
- remoteWorkspaceUri: string;
74
- };
75
-
76
- export type ConnectHookContext = RemoteHookContext & {
77
- contextCandidates: ContextCandidate[];
78
- runBeforeOpenRemoteEditor(args: { scheme: "vscode" | "cursor"; remoteWorkspaceUri: string }): Promise<string[]>;
79
- runAfterOpenRemoteEditor(args: { scheme: "vscode" | "cursor"; remoteWorkspaceUri: string }): Promise<string[]>;
80
- };
81
-
82
- export type PushvmPlugin = {
83
- name: string;
84
- collectEnvironment?(context: PushvmPluginContext): Record<string, string>;
85
- discoverContextCandidates?(context: PushvmPluginContext): Promise<ContextCandidate[]> | ContextCandidate[];
86
- shouldSkipContextDirectory?(relativePath: string, name: string): boolean;
87
- isProtectedRemotePath?(remotePath: string): boolean;
88
- afterProjectSync?(context: RemoteHookContext): Promise<void> | void;
89
- afterContextSync?(context: RemoteHookContext & { changedRemotePaths: string[] }): Promise<void> | void;
90
- beforeSnapshot?(context: RemoteHookContext): Promise<void> | void;
91
- afterSync?(context: RemoteHookContext & { contextCandidates: ContextCandidate[] }): Promise<string[] | void> | string[] | void;
92
- connect?(context: ConnectHookContext): Promise<boolean | void> | boolean | void;
93
- beforeOpenRemoteEditor?(context: EditorHookContext & { contextCandidates: ContextCandidate[] }): Promise<string[] | void> | string[] | void;
94
- afterOpenRemoteEditor?(context: EditorHookContext & { contextCandidates: ContextCandidate[] }): Promise<string[] | void> | string[] | void;
95
- };
96
-
97
- export type PushvmConfig = {
98
- plugins: PushvmPlugin[];
99
- };
100
-
101
- export function definePlugin(plugin: PushvmPlugin): PushvmPlugin {
102
- return plugin;
103
- }
104
-
105
- export function defineConfig(config: PushvmConfig): PushvmConfig {
106
- return config;
107
- }
package/tsconfig.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "allowImportingTsExtensions": true,
7
- "rewriteRelativeImportExtensions": true,
8
- "strict": true,
9
- "esModuleInterop": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "skipLibCheck": true,
12
- "types": ["node"],
13
- "erasableSyntaxOnly": true,
14
- "outDir": "dist",
15
- "rootDir": "."
16
- },
17
- "include": ["freestyle-sync.config.ts", "src/**/*.ts", "plugins/**/*.ts"]
18
- }