@pikku/cli 0.12.86 → 0.12.89
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/console-app/assets/{index-Cr3_cO3Z.js → index-BaOGIr2O.js} +149 -149
- package/console-app/index.html +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
- package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-channel.js +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
- package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +2 -2
- package/dist/.pikku/function/pikku-functions.gen.js +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
- package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
- package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.d.ts +3 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +3 -1
- package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
- package/dist/.pikku/pikku-meta-service.gen.js +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
- package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.d.ts +1 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +6 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +6 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +4 -0
- package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +5 -0
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
- package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
- package/dist/.pikku/schemas/register.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
- package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
- package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/bin/pikku-bin.mjs +2 -2
- package/dist/bin/pikku.js +37 -0
- package/dist/src/fabric/functions/deploy.function.js +6 -0
- package/dist/src/fabric/functions/init.function.js +2 -2
- package/dist/src/fabric/functions/validate.function.js +12 -2
- package/dist/src/fabric/lib/config.d.ts +8 -0
- package/dist/src/fabric/lib/config.js +15 -1
- package/dist/src/fabric/lib/git.js +2 -2
- package/dist/src/functions/db/sqlite/sqlite-runtime-node.js +14 -1
- package/dist/src/functions/wirings/queue/pikku-command-queue.js +10 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/skills/pikku-concepts/SKILL.md +16 -0
- package/skills/pikku-fabric/SKILL.md +92 -19
- package/skills/pikku-permissions/SKILL.md +21 -5
package/console-app/index.html
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
}
|
|
22
22
|
} catch (e) {}
|
|
23
23
|
</script>
|
|
24
|
-
<script type="module" crossorigin src="/console/assets/index-
|
|
24
|
+
<script type="module" crossorigin src="/console/assets/index-BaOGIr2O.js"></script>
|
|
25
25
|
<link rel="stylesheet" crossorigin href="/console/assets/index-CSzCJzBb.css">
|
|
26
26
|
</head>
|
|
27
27
|
<body>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.89
|
|
3
3
|
*/
|
|
4
4
|
import { CoreAIAgent, PikkuAIMiddlewareHooks } from '@pikku/core/ai-agent';
|
|
5
5
|
import type { PikkuPermission, PikkuMiddleware, Services, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js';
|
|
@@ -222,7 +222,7 @@
|
|
|
222
222
|
"outputs": [
|
|
223
223
|
"FabricInitOutput"
|
|
224
224
|
],
|
|
225
|
-
"implementationHash": "
|
|
225
|
+
"implementationHash": "af5225360e5de4f9",
|
|
226
226
|
"contractHash": "b2e147aae8fa11dc",
|
|
227
227
|
"inputHash": "05039012",
|
|
228
228
|
"outputHash": "57ad379a"
|
|
@@ -2628,7 +2628,7 @@
|
|
|
2628
2628
|
"outputs": [
|
|
2629
2629
|
"PikkuCommandQueueOutput"
|
|
2630
2630
|
],
|
|
2631
|
-
"implementationHash": "
|
|
2631
|
+
"implementationHash": "ae1284e8ff0c72c0",
|
|
2632
2632
|
"middleware": [
|
|
2633
2633
|
{
|
|
2634
2634
|
"type": "wire",
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.89
|
|
3
3
|
*/
|
|
4
4
|
import './rpc/pikku-rpc-wirings-meta.internal.gen.js';
|
|
5
5
|
import './function/pikku-functions-meta.gen.js';
|
|
6
|
+
import './queue/pikku-queue-workers-wirings-meta.gen.js';
|
|
6
7
|
import './cli/pikku-cli-wirings-meta.gen.js';
|
|
7
8
|
import './schemas/register.gen.js';
|
|
8
9
|
import './function/pikku-functions.gen.js';
|
|
9
10
|
import './workflow/pikku-workflow-wirings.gen.js';
|
|
11
|
+
import './queue/pikku-queue-workers-wirings.gen.js';
|
|
10
12
|
import './cli/pikku-cli-wirings.gen.js';
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.89
|
|
3
3
|
*/
|
|
4
4
|
import './rpc/pikku-rpc-wirings-meta.internal.gen.js';
|
|
5
5
|
import './function/pikku-functions-meta.gen.js';
|
|
6
|
+
import './queue/pikku-queue-workers-wirings-meta.gen.js';
|
|
6
7
|
import './cli/pikku-cli-wirings-meta.gen.js';
|
|
7
8
|
import './schemas/register.gen.js';
|
|
8
9
|
import './function/pikku-functions.gen.js';
|
|
9
10
|
import './workflow/pikku-workflow-wirings.gen.js';
|
|
11
|
+
import './queue/pikku-queue-workers-wirings.gen.js';
|
|
10
12
|
import './cli/pikku-cli-wirings.gen.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.89
|
|
3
3
|
*/
|
|
4
4
|
export { wireScope } from '@pikku/core/scope';
|
|
5
5
|
export type { CoreScopes, CoreScopeNode, FlatScope, ScopeDefinitionMeta, ScopeDefinitionsMeta } from '@pikku/core/scope';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.89
|
|
3
3
|
*/
|
|
4
4
|
import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
|
|
5
5
|
import secretsMeta from './pikku-secrets-meta.gen.json' with { type: 'json' };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.89
|
|
3
3
|
*/
|
|
4
4
|
export { wireVariable } from '@pikku/core/variable';
|
|
5
5
|
export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.
|
|
2
|
+
* This file was generated by @pikku/cli@0.12.89
|
|
3
3
|
*/
|
|
4
4
|
import { TypedVariablesService as CoreTypedVariablesService } from '@pikku/core/services';
|
|
5
5
|
import variablesMeta from './pikku-variables-meta.gen.json' with { type: 'json' };
|
package/dist/bin/pikku-bin.mjs
CHANGED
|
@@ -11,8 +11,8 @@ async function checkForUpdate() {
|
|
|
11
11
|
})
|
|
12
12
|
if (!res.ok) return
|
|
13
13
|
const { version: latest } = await res.json()
|
|
14
|
-
if (latest !== '0.12.
|
|
15
|
-
process.stderr.write(`\n Update available 0.12.
|
|
14
|
+
if (latest !== '0.12.89') {
|
|
15
|
+
process.stderr.write(`\n Update available 0.12.89 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
|
|
16
16
|
}
|
|
17
17
|
} catch {}
|
|
18
18
|
}
|
package/dist/bin/pikku.js
CHANGED
|
@@ -10,6 +10,42 @@ import { fileURLToPath, pathToFileURL } from 'url';
|
|
|
10
10
|
import { dirname, join } from 'path';
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
12
|
const __dirname = dirname(__filename);
|
|
13
|
+
/**
|
|
14
|
+
* Load `.env` from the working directory into process.env, so `pikku dev`,
|
|
15
|
+
* `pikku db migrate` and friends see the secrets a project keeps there —
|
|
16
|
+
* LocalSecretService reads process.env and nothing else, so without this the
|
|
17
|
+
* first sign-up fails with "Requested secret not found".
|
|
18
|
+
*
|
|
19
|
+
* Cannot be left to the package manager: the CLI has a node shebang, so `bunx
|
|
20
|
+
* pikku dev` execs node and bun's own .env injection never reaches the process.
|
|
21
|
+
* Existing variables win — a real env var must always beat a checked-out file.
|
|
22
|
+
*
|
|
23
|
+
* `process.loadEnvFile` is node-only, and the shebang is not a guarantee: under
|
|
24
|
+
* `bunx --bun pikku …` (which projects use so the CLI gets bun's `node:sqlite`)
|
|
25
|
+
* the process is bun and that method does not exist. Parse the file ourselves in
|
|
26
|
+
* that case rather than losing every secret in it.
|
|
27
|
+
*/
|
|
28
|
+
function loadEnvFile() {
|
|
29
|
+
const envPath = join(process.cwd(), '.env');
|
|
30
|
+
if (!existsSync(envPath))
|
|
31
|
+
return;
|
|
32
|
+
try {
|
|
33
|
+
if (typeof process.loadEnvFile === 'function') {
|
|
34
|
+
process.loadEnvFile(envPath);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
for (const line of readFileSync(envPath, 'utf-8').split('\n')) {
|
|
38
|
+
const match = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*)$/.exec(line);
|
|
39
|
+
if (!match)
|
|
40
|
+
continue;
|
|
41
|
+
const value = match[2].trim().replace(/^(['"])(.*)\1$/s, '$2');
|
|
42
|
+
process.env[match[1]] ??= value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
process.stderr.write(` Could not read .env: ${error.message}\n`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
13
49
|
async function checkForUpdate() {
|
|
14
50
|
if (process.env.CI || !process.stderr.isTTY)
|
|
15
51
|
return;
|
|
@@ -33,6 +69,7 @@ async function checkForUpdate() {
|
|
|
33
69
|
const pikkuCliPath = join(__dirname, '../.pikku/cli/pikku-cli.gen.js');
|
|
34
70
|
if (existsSync(pikkuCliPath)) {
|
|
35
71
|
try {
|
|
72
|
+
loadEnvFile();
|
|
36
73
|
const { PikkuCLI } = await import(pathToFileURL(pikkuCliPath).href);
|
|
37
74
|
const updateCheck = checkForUpdate();
|
|
38
75
|
await PikkuCLI(process.argv.slice(2));
|
|
@@ -51,6 +51,12 @@ async function prepDeploy({ branch, production, ref }) {
|
|
|
51
51
|
if (!ctx.projectId) {
|
|
52
52
|
throw new Error('No fabric project linked. Run `pikku fabric link` first.');
|
|
53
53
|
}
|
|
54
|
+
// Guarded rather than asserted: the schema-level refine is bypassed whenever
|
|
55
|
+
// the function is called outside CLI arg parsing, and `branch!` turned that
|
|
56
|
+
// into "local branch undefined does not exist" — an error that names nothing.
|
|
57
|
+
if (!production && !branch) {
|
|
58
|
+
throw new Error('Pass exactly one of --branch or --production.');
|
|
59
|
+
}
|
|
54
60
|
const targetBranch = production ? 'main' : branch;
|
|
55
61
|
const safety = await assertNamedBranchDeploySafety(targetBranch);
|
|
56
62
|
const resolved = ref ? ((await resolveRef(ref)) ?? ref) : safety.headSha;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { pikkuSessionlessFunc } from '../../../.pikku/pikku-types.gen.js';
|
|
3
|
-
import { findProjectConfig, resolveApiContext, writeProjectConfig, } from '../lib/config.js';
|
|
3
|
+
import { findProjectConfig, isLinkedProjectId, resolveApiContext, writeProjectConfig, } from '../lib/config.js';
|
|
4
4
|
import { getFabricRPC } from '../lib/http.js';
|
|
5
5
|
export const FabricInitInput = z.object({
|
|
6
6
|
repo: z.string(),
|
|
@@ -30,7 +30,7 @@ export const FabricInit = pikkuSessionlessFunc({
|
|
|
30
30
|
if (!ctx.token)
|
|
31
31
|
throw new Error('Not logged in. Run `pikku fabric login` first.');
|
|
32
32
|
const existing = await findProjectConfig();
|
|
33
|
-
if (existing && !force) {
|
|
33
|
+
if (existing && isLinkedProjectId(existing.config.projectId) && !force) {
|
|
34
34
|
throw new Error(`Already linked: ${existing.config.projectId} at ${existing.path}. Pass --force to replace.`);
|
|
35
35
|
}
|
|
36
36
|
const rpc = getFabricRPC({ apiUrl: ctx.apiUrl, token: ctx.token });
|