@agentworkforce/deploy 0.0.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.
Files changed (65) hide show
  1. package/dist/bundle.d.ts +22 -0
  2. package/dist/bundle.d.ts.map +1 -0
  3. package/dist/bundle.js +132 -0
  4. package/dist/bundle.js.map +1 -0
  5. package/dist/bundle.test.d.ts +2 -0
  6. package/dist/bundle.test.d.ts.map +1 -0
  7. package/dist/bundle.test.js +92 -0
  8. package/dist/bundle.test.js.map +1 -0
  9. package/dist/connect.d.ts +81 -0
  10. package/dist/connect.d.ts.map +1 -0
  11. package/dist/connect.js +127 -0
  12. package/dist/connect.js.map +1 -0
  13. package/dist/deploy.d.ts +50 -0
  14. package/dist/deploy.d.ts.map +1 -0
  15. package/dist/deploy.js +172 -0
  16. package/dist/deploy.js.map +1 -0
  17. package/dist/deploy.test.d.ts +2 -0
  18. package/dist/deploy.test.d.ts.map +1 -0
  19. package/dist/deploy.test.js +293 -0
  20. package/dist/deploy.test.js.map +1 -0
  21. package/dist/index.d.ts +11 -0
  22. package/dist/index.d.ts.map +1 -0
  23. package/dist/index.js +10 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/io.d.ts +22 -0
  26. package/dist/io.d.ts.map +1 -0
  27. package/dist/io.js +76 -0
  28. package/dist/io.js.map +1 -0
  29. package/dist/login.d.ts +24 -0
  30. package/dist/login.d.ts.map +1 -0
  31. package/dist/login.js +27 -0
  32. package/dist/login.js.map +1 -0
  33. package/dist/modes/cloud.d.ts +18 -0
  34. package/dist/modes/cloud.d.ts.map +1 -0
  35. package/dist/modes/cloud.js +21 -0
  36. package/dist/modes/cloud.js.map +1 -0
  37. package/dist/modes/dev.d.ts +12 -0
  38. package/dist/modes/dev.d.ts.map +1 -0
  39. package/dist/modes/dev.js +153 -0
  40. package/dist/modes/dev.js.map +1 -0
  41. package/dist/modes/sandbox-client.d.ts +63 -0
  42. package/dist/modes/sandbox-client.d.ts.map +1 -0
  43. package/dist/modes/sandbox-client.js +177 -0
  44. package/dist/modes/sandbox-client.js.map +1 -0
  45. package/dist/modes/sandbox-client.test.d.ts +2 -0
  46. package/dist/modes/sandbox-client.test.d.ts.map +1 -0
  47. package/dist/modes/sandbox-client.test.js +177 -0
  48. package/dist/modes/sandbox-client.test.js.map +1 -0
  49. package/dist/modes/sandbox.d.ts +50 -0
  50. package/dist/modes/sandbox.d.ts.map +1 -0
  51. package/dist/modes/sandbox.js +131 -0
  52. package/dist/modes/sandbox.js.map +1 -0
  53. package/dist/modes/sandbox.test.d.ts +2 -0
  54. package/dist/modes/sandbox.test.d.ts.map +1 -0
  55. package/dist/modes/sandbox.test.js +95 -0
  56. package/dist/modes/sandbox.test.js.map +1 -0
  57. package/dist/preflight.d.ts +14 -0
  58. package/dist/preflight.d.ts.map +1 -0
  59. package/dist/preflight.js +78 -0
  60. package/dist/preflight.js.map +1 -0
  61. package/dist/types.d.ts +140 -0
  62. package/dist/types.d.ts.map +1 -0
  63. package/dist/types.js +2 -0
  64. package/dist/types.js.map +1 -0
  65. package/package.json +40 -0
@@ -0,0 +1,140 @@
1
+ import type { PersonaSpec } from '@agentworkforce/persona-kit';
2
+ export type DeployMode = 'dev' | 'sandbox' | 'cloud';
3
+ export interface DeployOptions {
4
+ /** Absolute path to the persona JSON file. Required. */
5
+ personaPath: string;
6
+ /** Run mode. Defaults to `sandbox` if Daytona creds resolve, else `dev`. */
7
+ mode?: DeployMode;
8
+ /** Workforce workspace to deploy into. Defaults to the active workspace. */
9
+ workspace?: string;
10
+ /** Skip the integration-connect prompts; fail if any declared integration is missing. */
11
+ noConnect?: boolean;
12
+ /** Force BYO Daytona even when workforce-managed sandbox issuance is available. */
13
+ byoSandbox?: boolean;
14
+ /** Background the runner instead of streaming logs in the foreground. */
15
+ detach?: boolean;
16
+ /** Emit the bundle to this directory and exit (no launch). */
17
+ bundleOut?: string;
18
+ /** Validate-only: parse + lint + check connection status, no side effects. */
19
+ dryRun?: boolean;
20
+ /** Override the WORKFORCE_CLOUD_URL; defaults to env or production. */
21
+ cloudUrl?: string;
22
+ /** Override stdout writer for tests + structured outputs. */
23
+ io?: DeployIO;
24
+ }
25
+ export interface DeployIO {
26
+ /** User-facing progress line (clean prose, suitable for terminals). */
27
+ info(message: string): void;
28
+ /** Warning line; rendered with a marker the user reads. */
29
+ warn(message: string): void;
30
+ /** Error line; non-fatal context. */
31
+ error(message: string): void;
32
+ /** Interactive prompt; resolves to user's answer. */
33
+ prompt(question: string, opts?: {
34
+ defaultValue?: string;
35
+ }): Promise<string>;
36
+ /** Confirmation prompt; resolves to true/false. */
37
+ confirm(question: string, opts?: {
38
+ defaultValue?: boolean;
39
+ }): Promise<boolean>;
40
+ }
41
+ /** The result returned by a successful `deploy(...)` call. */
42
+ export interface DeployResult {
43
+ /** Resolved deployment identifier (stable across restarts of the same persona). */
44
+ deploymentId: string;
45
+ /** Which run mode the orchestrator picked. */
46
+ mode: DeployMode;
47
+ /** Workspace the deployment is scoped to. */
48
+ workspace: string;
49
+ /** Path to the staged bundle on disk. */
50
+ bundleDir: string;
51
+ /** Integrations that were connected (or already-connected) as part of this deploy. */
52
+ connectedIntegrations: string[];
53
+ /** Schedules registered with the runtime. */
54
+ schedules: string[];
55
+ /** Run-mode-specific handle. `dev` returns a child process handle; `sandbox` a Daytona sandbox id; `cloud` a server-side deployment id. */
56
+ runHandle?: unknown;
57
+ /** Non-fatal warnings collected during deploy. */
58
+ warnings: string[];
59
+ }
60
+ /**
61
+ * Contract the deploy orchestrator expects from the bundle stager. The
62
+ * default implementation lives in `bundle.ts` (esbuild-driven); callers
63
+ * pass an alternative via `DeployResolvers.bundle` to swap bundlers or
64
+ * inject test fakes.
65
+ */
66
+ export interface BundleStager {
67
+ stage(input: BundleStageInput): Promise<BundleResult>;
68
+ }
69
+ export interface BundleStageInput {
70
+ personaPath: string;
71
+ persona: PersonaSpec;
72
+ outDir: string;
73
+ bundlerOptions?: {
74
+ minify?: boolean;
75
+ };
76
+ }
77
+ export interface BundleResult {
78
+ personaCopyPath: string;
79
+ runnerPath: string;
80
+ bundlePath: string;
81
+ packageJsonPath: string;
82
+ sizeBytes: number;
83
+ }
84
+ /**
85
+ * Contract each run-mode launcher implements. The defaults live next
86
+ * to this file: `modes/dev.ts` (local child_process), `modes/sandbox.ts`
87
+ * (Daytona), and `modes/cloud.ts` (workforce-cloud hosted, opt-in once
88
+ * the cloud deployments endpoint ships). Callers swap individual modes
89
+ * via `DeployResolvers.modes` — useful for tests and custom runtimes.
90
+ */
91
+ export interface ModeLauncher {
92
+ launch(input: ModeLaunchInput): Promise<ModeLaunchHandle>;
93
+ }
94
+ export interface ModeLaunchInput {
95
+ persona: PersonaSpec;
96
+ bundle: BundleResult;
97
+ workspace: string;
98
+ env?: Record<string, string>;
99
+ io: DeployIO;
100
+ detach?: boolean;
101
+ /**
102
+ * Force BYO Daytona auth even when the user is logged in to workforce
103
+ * cloud. Mode-specific (sandbox launcher only); other modes ignore.
104
+ */
105
+ byoSandbox?: boolean;
106
+ }
107
+ export interface ModeLaunchHandle {
108
+ /** Mode-specific identifier (pid for dev, sandboxId for sandbox, deploymentId for cloud). */
109
+ id: string;
110
+ /** Stop the runner cleanly. */
111
+ stop(): Promise<void>;
112
+ /**
113
+ * Resolves when the runner exits. For long-lived modes (sandbox), this
114
+ * resolves only when the user invokes `stop()`.
115
+ */
116
+ done: Promise<{
117
+ code: number;
118
+ }>;
119
+ }
120
+ export interface IntegrationConnectOutcome {
121
+ provider: string;
122
+ status: 'already-connected' | 'connected-now' | 'skipped' | 'failed';
123
+ message?: string;
124
+ }
125
+ /** Surface a parsed persona only after we know it passed the deploy preflight. */
126
+ export interface DeployPreflight {
127
+ persona: PersonaSpec;
128
+ /** Persona JSON path resolved to absolute. */
129
+ personaPath: string;
130
+ /** Absolute path to the directory containing the persona JSON. */
131
+ personaDir: string;
132
+ /** Absolute path to the resolved `onEvent` file. */
133
+ onEventPath: string;
134
+ /** Schedules and integrations summarized. */
135
+ schedules: string[];
136
+ integrations: string[];
137
+ /** Non-fatal warnings (unknown triggers, etc). */
138
+ warnings: string[];
139
+ }
140
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,CAAC;AAErD,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yFAAyF;IACzF,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,mFAAmF;IACnF,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,yEAAyE;IACzE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,EAAE,CAAC,EAAE,QAAQ,CAAC;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,uEAAuE;IACvE,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,2DAA2D;IAC3D,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,qCAAqC;IACrC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,qDAAqD;IACrD,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;I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e;IAC9B,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B,6FAA6F;IAC7F,EAAE,EAAE,MAAM,CAAC;IACX,+BAA+B;IAC/B,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACtB;;;OAGG;IACH,IAAI,EAAE,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjC;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,mBAAmB,GAAG,eAAe,GAAG,SAAS,GAAG,QAAQ,CAAC;IACrE,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,WAAW,CAAC;IACrB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAC;IACpB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@agentworkforce/deploy",
3
+ "version": "0.0.0",
4
+ "private": false,
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md",
17
+ "package.json"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "https://github.com/AgentWorkforce/workforce",
22
+ "directory": "packages/deploy"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "scripts": {
28
+ "build": "tsc -p tsconfig.json",
29
+ "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput",
30
+ "typecheck": "tsc -p tsconfig.json --noEmit",
31
+ "test": "tsc -p tsconfig.json && node --test dist/**/*.test.js dist/*.test.js",
32
+ "lint": "tsc -p tsconfig.json --noEmit"
33
+ },
34
+ "dependencies": {
35
+ "@agentworkforce/persona-kit": "workspace:*",
36
+ "@agentworkforce/runtime": "workspace:*",
37
+ "@daytonaio/sdk": "^0.148.0",
38
+ "esbuild": "^0.25.0"
39
+ }
40
+ }