@akanjs/cli 3.0.0-beta.10 → 3.0.0-beta.11
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/.build-stamp +1 -1
- package/TunnelShare-sbsaggmb.js +9 -0
- package/{abstractCompactor-gmkc0z8j.js → abstractCompactor-bqh31fk5.js} +2 -2
- package/{agent.command-0q17pnrs.js → agent.command-7357vxd8.js} +5 -5
- package/{application.command-18y0s485.js → application.command-pc8mdn3w.js} +10 -10
- package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-4f1wrba0.js} +2 -2
- package/{applicationReleasePackager-4yasxwv9.js → applicationReleasePackager-jkjmy5ee.js} +1 -1
- package/buildBatch.proc.js +2 -2
- package/{capacitorApp-36rbr858.js → capacitorApp-hqvsrec4.js} +2 -2
- package/{cloud.command-av97ndh6.js → cloud.command-cawrd5nq.js} +10 -10
- package/cloud.script-1bmptvw0.js +20 -0
- package/commandManifest.json +1 -1
- package/{context.command-5v37ef3n.js → context.command-982b6kdp.js} +14 -14
- package/{devTui-m1atgkc9.js → devTui-hmteztv3.js} +4 -24
- package/{devTuiView-0hc2emhe.js → devTuiView-40jvjnyz.js} +1 -1
- package/{guideline.command-4pz9g1rt.js → guideline.command-jn0vwszx.js} +4 -4
- package/guidelines/agentRule/agentRule.instruction.md +41 -0
- package/incrementalBuilder.proc.js +1 -1
- package/{index-ktb5njgy.js → index-15r9a10e.js} +2 -2
- package/{index-vxtad5bd.js → index-1nwxbr2y.js} +2 -2
- package/{index-y6n8nmny.js → index-3pvkjza8.js} +10 -10
- package/{index-2tv3fdx4.js → index-5nyznra1.js} +1 -0
- package/{index-wt7qrtd4.js → index-7f4dsf9v.js} +1 -1
- package/{index-ffvk10zz.js → index-8pkvrcv1.js} +3 -3
- package/{index-rtxxan88.js → index-8tfmh0v6.js} +5 -5
- package/{index-2xp0kfkt.js → index-ay8wj00x.js} +7 -7
- package/{index-0g7r8xz3.js → index-b3ae16mg.js} +1 -1
- package/{index-m0xccmmm.js → index-bw2marpf.js} +9 -0
- package/{index-a17x49vg.js → index-ceph7zqj.js} +3 -3
- package/{index-04bk599g.js → index-em4swemt.js} +3 -3
- package/{index-5ystnsd5.js → index-fr2x3qvv.js} +5 -5
- package/index-jcekapz4.js +49 -0
- package/{index-gyd220p2.js → index-jwjaf9fy.js} +1 -1
- package/{index-d43r08tf.js → index-kbsach1y.js} +4 -4
- package/index-p6pbz9n5.js +25 -0
- package/{index-sj5vxr8f.js → index-r8bd61d9.js} +46 -11
- package/{index-k2j1hc4r.js → index-s3fvrydw.js} +3 -3
- package/{index-vyvre9en.js → index-sh88vtye.js} +1 -1
- package/{index-9077wzd2.js → index-t8gvwcrx.js} +2 -2
- package/{index-a64esmtb.js → index-vrwdx0zx.js} +1 -1
- package/{index-te54x9zm.js → index-yc1keaer.js} +2 -2
- package/{index-j9yhg404.js → index-ys7dvdb3.js} +1 -1
- package/index.js +20 -19
- package/{library.command-qzzbj6d8.js → library.command-1f9h2ex6.js} +3 -3
- package/{localRegistry.command-vyrgg4xw.js → localRegistry.command-rx758ajg.js} +9 -9
- package/{module.command-rq5hq3ax.js → module.command-c2eve036.js} +7 -7
- package/{package.command-d9hd6v9n.js → package.command-y2rh4np7.js} +3 -3
- package/package.json +2 -2
- package/{page.command-126d56te.js → page.command-e5h29fyt.js} +3 -3
- package/{primitive.command-taxd1538.js → primitive.command-c44f7z1s.js} +8 -8
- package/{quality.command-6gsna0a3.js → quality.command-5evdd263.js} +2 -2
- package/{repair.command-tq2dgy72.js → repair.command-c2amvt74.js} +5 -5
- package/{scalar.command-3bcmrrkv.js → scalar.command-xyzerygj.js} +6 -6
- package/{subspace.command-eddzqpx3.js → subspace.command-ebfwzypw.js} +5 -5
- package/tunnel.command-v6a7at16.js +130 -0
- package/{workflow.command-gtdnzvbz.js → workflow.command-t174m6sy.js} +11 -11
- package/{workspace.command-06wvstgr.js → workspace.command-bg3eveth.js} +21 -21
- package/cloud.script-cm11xjdz.js +0 -20
|
@@ -4,23 +4,23 @@ import {
|
|
|
4
4
|
} from "./index-q0y2jq9j.js";
|
|
5
5
|
import {
|
|
6
6
|
GlobalConfig
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-bw2marpf.js";
|
|
8
8
|
import {
|
|
9
9
|
Workspace,
|
|
10
10
|
CommandContainer,
|
|
11
11
|
runner,
|
|
12
12
|
script,
|
|
13
13
|
command
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-b3ae16mg.js";
|
|
15
15
|
import {
|
|
16
16
|
Executor,
|
|
17
17
|
WorkspaceExecutor,
|
|
18
18
|
AppExecutor
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-5nyznra1.js";
|
|
20
20
|
import"./index-6wwzs1bc.js";
|
|
21
21
|
import {
|
|
22
22
|
SlicePlanner
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-ys7dvdb3.js";
|
|
24
24
|
import {
|
|
25
25
|
LibSource
|
|
26
26
|
} from "./index-3d9y066c.js";
|
|
@@ -725,7 +725,7 @@ class SubspaceRunner extends runner("subspace") {
|
|
|
725
725
|
if (!asked)
|
|
726
726
|
return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
|
|
727
727
|
const { libs } = await subspace.slice();
|
|
728
|
-
const { CloudScript } = await import("./cloud.script-
|
|
728
|
+
const { CloudScript } = await import("./cloud.script-1bmptvw0.js");
|
|
729
729
|
const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
|
|
730
730
|
host,
|
|
731
731
|
workspaceId,
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import"./index-q0y2jq9j.js";
|
|
3
|
+
import {
|
|
4
|
+
GlobalConfig,
|
|
5
|
+
CloudApi
|
|
6
|
+
} from "./index-bw2marpf.js";
|
|
7
|
+
import {
|
|
8
|
+
Workspace,
|
|
9
|
+
runner,
|
|
10
|
+
script,
|
|
11
|
+
command
|
|
12
|
+
} from "./index-b3ae16mg.js";
|
|
13
|
+
import {
|
|
14
|
+
AppExecutor
|
|
15
|
+
} from "./index-5nyznra1.js";
|
|
16
|
+
import"./index-6wwzs1bc.js";
|
|
17
|
+
import {
|
|
18
|
+
TunnelShare2
|
|
19
|
+
} from "./index-jcekapz4.js";
|
|
20
|
+
import {
|
|
21
|
+
writeClipboard
|
|
22
|
+
} from "./index-p6pbz9n5.js";
|
|
23
|
+
|
|
24
|
+
// pkgs/@akanjs/cli/tunnel/tunnel.script.ts
|
|
25
|
+
import { select } from "@inquirer/prompts";
|
|
26
|
+
|
|
27
|
+
// pkgs/@akanjs/cli/tunnel/tunnel.runner.ts
|
|
28
|
+
import { Logger } from "akanjs/common";
|
|
29
|
+
import chalk from "chalk";
|
|
30
|
+
class TunnelRunner extends runner("tunnel") {
|
|
31
|
+
async share(app, options) {
|
|
32
|
+
const spinner = app.spinning("Requesting a tunnel...");
|
|
33
|
+
const share = await TunnelShare2.open(app, {
|
|
34
|
+
...options,
|
|
35
|
+
onLost: (reason) => Logger.rawLog(`tunnel disconnected (${reason}); reconnecting`, undefined, "error")
|
|
36
|
+
}).catch((error) => {
|
|
37
|
+
spinner.fail("Could not open the tunnel");
|
|
38
|
+
throw error;
|
|
39
|
+
});
|
|
40
|
+
spinner.succeed(`${app.name} is shared`);
|
|
41
|
+
const copied = await writeClipboard(share.url);
|
|
42
|
+
Logger.rawLog(`
|
|
43
|
+
${chalk.bold(share.url)}${copied ? chalk.dim(" (copied)") : ""}`);
|
|
44
|
+
if (share.grant.expiresAt)
|
|
45
|
+
Logger.rawLog(chalk.dim(` expires ${share.grant.expiresAt}`));
|
|
46
|
+
Logger.rawLog(chalk.dim(` code ${share.grant.code} \u2014 stop it with: akan tunnel --stop ${share.grant.code}
|
|
47
|
+
`));
|
|
48
|
+
await TunnelRunner.holdUntilInterrupt(() => share.close());
|
|
49
|
+
}
|
|
50
|
+
async list(workspace, host = GlobalConfig.akanCloudHost) {
|
|
51
|
+
const api = await CloudApi.fromHost(workspace, host);
|
|
52
|
+
const tunnels = await api.tunnelListInSelf();
|
|
53
|
+
if (!tunnels.length) {
|
|
54
|
+
Logger.rawLog("No tunnels are open.");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
for (const tunnel of tunnels)
|
|
58
|
+
Logger.rawLog(`${tunnel.connected ? chalk.green("\u25CF") : chalk.dim("\u25CB")} ${tunnel.code} ${tunnel.url}` + `${tunnel.name ? ` ${chalk.dim(tunnel.name)}` : ""}` + `${tunnel.expiresAt ? chalk.dim(` expires ${tunnel.expiresAt}`) : ""}`);
|
|
59
|
+
}
|
|
60
|
+
async stop(code, workspace, host = GlobalConfig.akanCloudHost) {
|
|
61
|
+
const api = await CloudApi.fromHost(workspace, host);
|
|
62
|
+
const stopped = await api.revokeTunnel(code);
|
|
63
|
+
if (stopped)
|
|
64
|
+
Logger.rawLog(`Stopped ${code}.`);
|
|
65
|
+
else
|
|
66
|
+
Logger.rawLog(`No tunnel named ${code} is open.`, undefined, "error");
|
|
67
|
+
}
|
|
68
|
+
static holdUntilInterrupt(onInterrupt) {
|
|
69
|
+
return new Promise((resolve) => {
|
|
70
|
+
let closing = false;
|
|
71
|
+
const stop = () => {
|
|
72
|
+
if (closing) {
|
|
73
|
+
Logger.rawLog("Abandoning the tunnel release; it will expire on its own.", undefined, "error");
|
|
74
|
+
process.exit(130);
|
|
75
|
+
}
|
|
76
|
+
closing = true;
|
|
77
|
+
onInterrupt().then(() => resolve());
|
|
78
|
+
};
|
|
79
|
+
process.on("SIGINT", stop);
|
|
80
|
+
process.on("SIGTERM", stop);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// pkgs/@akanjs/cli/tunnel/tunnel.script.ts
|
|
86
|
+
class TunnelScript extends script("tunnel", [TunnelRunner]) {
|
|
87
|
+
static async resolveApp(workspace, name) {
|
|
88
|
+
const appNames = await workspace.getApps();
|
|
89
|
+
if (!appNames.length)
|
|
90
|
+
throw new Error("No apps found in this workspace (apps/<appName>/akan.config.ts)");
|
|
91
|
+
if (name && !appNames.includes(name))
|
|
92
|
+
throw new Error(`Unknown app: ${name}. Available: ${appNames.join(", ")}`);
|
|
93
|
+
if (name)
|
|
94
|
+
return AppExecutor.from(workspace, name);
|
|
95
|
+
const only = appNames.length === 1 ? appNames[0] : null;
|
|
96
|
+
if (only)
|
|
97
|
+
return AppExecutor.from(workspace, only);
|
|
98
|
+
return AppExecutor.from(workspace, await select({ message: "Select the app to share", choices: appNames }));
|
|
99
|
+
}
|
|
100
|
+
async share(name, { workspace, host, port, ttl }) {
|
|
101
|
+
const app = await TunnelScript.resolveApp(workspace, name);
|
|
102
|
+
await this.tunnelRunner.share(app, {
|
|
103
|
+
workspace,
|
|
104
|
+
...host ? { host } : {},
|
|
105
|
+
...port ? { port } : {},
|
|
106
|
+
...ttl ? { ttlMinutes: ttl } : {}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
async list(workspace, host) {
|
|
110
|
+
await this.tunnelRunner.list(workspace, host);
|
|
111
|
+
}
|
|
112
|
+
async stop(code, workspace, host) {
|
|
113
|
+
await this.tunnelRunner.stop(code, workspace, host);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// pkgs/@akanjs/cli/tunnel/tunnel.command.ts
|
|
118
|
+
class TunnelCommand extends command("tunnel", [TunnelScript], ({ public: target }) => ({
|
|
119
|
+
tunnel: target({ desc: "Share a locally running app on a public URL" }).arg("app", String, { desc: "app to share", nullable: true }).option("list", Boolean, { desc: "list the shares this account is holding", default: false }).option("stop", String, { desc: "stop the share with this code", default: "" }).option("host", String, { desc: "host of the cloud", default: GlobalConfig.akanCloudHost }).option("port", Number, { desc: "local port to share (default: the app's dev port)", nullable: true }).option("ttl", Number, { desc: "minutes before the share expires", nullable: true }).with(Workspace).exec(async function(app, list, stop, host, port, ttl, workspace) {
|
|
120
|
+
if (list)
|
|
121
|
+
return await this.tunnelScript.list(workspace, host);
|
|
122
|
+
if (stop)
|
|
123
|
+
return await this.tunnelScript.stop(stop, workspace, host);
|
|
124
|
+
await this.tunnelScript.share(app, { workspace, host, ...port ? { port } : {}, ...ttl ? { ttl } : {} });
|
|
125
|
+
})
|
|
126
|
+
})) {
|
|
127
|
+
}
|
|
128
|
+
export {
|
|
129
|
+
TunnelCommand
|
|
130
|
+
};
|
|
@@ -3,31 +3,31 @@ import {
|
|
|
3
3
|
Workspace,
|
|
4
4
|
script,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-b3ae16mg.js";
|
|
7
7
|
import"./index-q0y2jq9j.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-5nyznra1.js";
|
|
9
9
|
import"./index-6wwzs1bc.js";
|
|
10
10
|
import {
|
|
11
11
|
createWorkflowStepRegistry
|
|
12
|
-
} from "./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
12
|
+
} from "./index-jwjaf9fy.js";
|
|
13
|
+
import"./index-bw2marpf.js";
|
|
14
|
+
import"./index-yc1keaer.js";
|
|
15
15
|
import {
|
|
16
16
|
ModuleScript
|
|
17
|
-
} from "./index-
|
|
18
|
-
import"./index-
|
|
17
|
+
} from "./index-fr2x3qvv.js";
|
|
18
|
+
import"./index-sh88vtye.js";
|
|
19
19
|
import"./index-h7yw2z9n.js";
|
|
20
20
|
import {
|
|
21
21
|
PrimitiveScript
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-kbsach1y.js";
|
|
23
23
|
import {
|
|
24
24
|
ScalarScript
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-ceph7zqj.js";
|
|
26
26
|
import"./index-by5gpp8x.js";
|
|
27
|
-
import"./index-
|
|
27
|
+
import"./index-15r9a10e.js";
|
|
28
28
|
import {
|
|
29
29
|
WorkflowRunner
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-8pkvrcv1.js";
|
|
31
31
|
|
|
32
32
|
// pkgs/@akanjs/cli/workflow/workflow.script.ts
|
|
33
33
|
import { Logger } from "akanjs/common";
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./index-q0y2jq9j.js";
|
|
5
5
|
import {
|
|
6
6
|
GlobalConfig
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-bw2marpf.js";
|
|
8
8
|
import {
|
|
9
9
|
Exec,
|
|
10
10
|
Workspace,
|
|
11
11
|
runner,
|
|
12
12
|
script,
|
|
13
13
|
command
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-b3ae16mg.js";
|
|
15
15
|
import {
|
|
16
16
|
extractAgentBlock,
|
|
17
17
|
collectScopeRecipeSources,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
AppExecutor,
|
|
22
22
|
LibExecutor,
|
|
23
23
|
PkgExecutor
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-5nyznra1.js";
|
|
25
25
|
import"./index-6wwzs1bc.js";
|
|
26
26
|
import {
|
|
27
27
|
countBlocking,
|
|
@@ -32,42 +32,42 @@ import {
|
|
|
32
32
|
collectRecipeSources2,
|
|
33
33
|
scanRecipes2
|
|
34
34
|
} from "./index-by5gpp8x.js";
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
35
|
+
import"./index-jwjaf9fy.js";
|
|
36
|
+
import"./index-15r9a10e.js";
|
|
37
37
|
import"./index-h7yw2z9n.js";
|
|
38
38
|
import {
|
|
39
39
|
AgentScript
|
|
40
|
-
} from "./index-
|
|
40
|
+
} from "./index-s3fvrydw.js";
|
|
41
41
|
import {
|
|
42
42
|
ApplicationScript
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-r8bd61d9.js";
|
|
44
44
|
import {
|
|
45
45
|
LibraryScript
|
|
46
|
-
} from "./index-
|
|
46
|
+
} from "./index-1nwxbr2y.js";
|
|
47
47
|
import"./index-hwkygn9s.js";
|
|
48
|
-
import"./index-
|
|
48
|
+
import"./index-yc1keaer.js";
|
|
49
49
|
import"./index-kcxmv48c.js";
|
|
50
50
|
import {
|
|
51
51
|
PackageScript
|
|
52
|
-
} from "./index-
|
|
52
|
+
} from "./index-t8gvwcrx.js";
|
|
53
53
|
import {
|
|
54
54
|
getNpmRegistryUrl,
|
|
55
55
|
getLatestPackageVersion
|
|
56
|
-
} from "./index-
|
|
56
|
+
} from "./index-8tfmh0v6.js";
|
|
57
57
|
import {
|
|
58
58
|
CloudScript2
|
|
59
|
-
} from "./index-
|
|
59
|
+
} from "./index-ay8wj00x.js";
|
|
60
60
|
import {
|
|
61
61
|
ContextScript
|
|
62
|
-
} from "./index-
|
|
63
|
-
import"./index-
|
|
64
|
-
import"./index-
|
|
65
|
-
import"./index-
|
|
66
|
-
import"./index-
|
|
67
|
-
import"./index-
|
|
68
|
-
import"./index-
|
|
69
|
-
import"./index-
|
|
70
|
-
import"./index-
|
|
62
|
+
} from "./index-3pvkjza8.js";
|
|
63
|
+
import"./index-7f4dsf9v.js";
|
|
64
|
+
import"./index-em4swemt.js";
|
|
65
|
+
import"./index-8pkvrcv1.js";
|
|
66
|
+
import"./index-fr2x3qvv.js";
|
|
67
|
+
import"./index-sh88vtye.js";
|
|
68
|
+
import"./index-kbsach1y.js";
|
|
69
|
+
import"./index-ceph7zqj.js";
|
|
70
|
+
import"./index-ys7dvdb3.js";
|
|
71
71
|
|
|
72
72
|
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|
|
73
73
|
import path from "path";
|
package/cloud.script-cm11xjdz.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
CloudScript2
|
|
4
|
-
} from "./index-2xp0kfkt.js";
|
|
5
|
-
import"./index-rtxxan88.js";
|
|
6
|
-
import"./index-sj5vxr8f.js";
|
|
7
|
-
import"./index-j9yhg404.js";
|
|
8
|
-
import"./index-vxtad5bd.js";
|
|
9
|
-
import"./index-9077wzd2.js";
|
|
10
|
-
import"./index-te54x9zm.js";
|
|
11
|
-
import"./index-m0xccmmm.js";
|
|
12
|
-
import"./index-0g7r8xz3.js";
|
|
13
|
-
import"./index-hwkygn9s.js";
|
|
14
|
-
import"./index-2tv3fdx4.js";
|
|
15
|
-
import"./index-6wwzs1bc.js";
|
|
16
|
-
import"./index-kcxmv48c.js";
|
|
17
|
-
import"./index-q0y2jq9j.js";
|
|
18
|
-
export {
|
|
19
|
-
CloudScript2 as CloudScript
|
|
20
|
-
};
|