@pikku/addon-console 0.12.22 → 0.12.23
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/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
- package/dist/.pikku/addon/pikku-package.gen.js +1 -1
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
- package/dist/.pikku/auth/auth.types.d.ts +1 -1
- package/dist/.pikku/auth/auth.types.js +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/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 +637 -215
- package/dist/.pikku/function/pikku-functions.gen.js +7 -1
- package/dist/.pikku/function/pikku-functions.gen.js.map +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 +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -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/rpc/pikku-rpc-wirings-map.gen.d.ts +7 -3
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +7 -3
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
- 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 +5 -1
- package/dist/.pikku/schemas/register.gen.js.map +1 -1
- package/dist/.pikku/schemas/schemas/AddonPackageInfo.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/AgentCredentialCheckInput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/GetAddonMetaOutput.schema.json +1 -1
- package/dist/.pikku/schemas/schemas/SecurityAuditReport.schema.json +1 -0
- package/dist/.pikku/schemas/schemas/UpdateDependencyInput.schema.json +1 -0
- 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-map.gen.d.ts +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.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/src/functions/agent-credential-check.function.d.ts +2 -5
- package/dist/src/functions/agent-credential-check.function.d.ts.map +1 -1
- package/dist/src/functions/agent-credential-check.function.js +7 -4
- package/dist/src/functions/agent-credential-check.function.js.map +1 -1
- package/dist/src/functions/credential-delete.function.d.ts +2 -2
- package/dist/src/functions/credential-delete.function.js +2 -2
- package/dist/src/functions/credential-delete.function.js.map +1 -1
- package/dist/src/functions/credential-get.function.d.ts +2 -2
- package/dist/src/functions/credential-get.function.js +2 -2
- package/dist/src/functions/credential-get.function.js.map +1 -1
- package/dist/src/functions/credential-list-users.function.d.ts +2 -2
- package/dist/src/functions/credential-list-users.function.js +2 -2
- package/dist/src/functions/credential-list-users.function.js.map +1 -1
- package/dist/src/functions/credential-set.function.d.ts +2 -2
- package/dist/src/functions/credential-set.function.js +2 -2
- package/dist/src/functions/credential-set.function.js.map +1 -1
- package/dist/src/functions/credential-status.function.d.ts +2 -2
- package/dist/src/functions/credential-status.function.js +2 -2
- package/dist/src/functions/credential-status.function.js.map +1 -1
- package/dist/src/functions/credential-users.function.d.ts +2 -2
- package/dist/src/functions/credential-users.function.js +2 -2
- package/dist/src/functions/credential-users.function.js.map +1 -1
- package/dist/src/functions/delete-agent-thread.function.d.ts +2 -2
- package/dist/src/functions/delete-agent-thread.function.d.ts.map +1 -1
- package/dist/src/functions/delete-agent-thread.function.js +2 -3
- package/dist/src/functions/delete-agent-thread.function.js.map +1 -1
- package/dist/src/functions/delete-workflow-run.function.d.ts +2 -2
- package/dist/src/functions/delete-workflow-run.function.d.ts.map +1 -1
- package/dist/src/functions/delete-workflow-run.function.js +2 -3
- package/dist/src/functions/delete-workflow-run.function.js.map +1 -1
- package/dist/src/functions/get-addon-icon.function.d.ts +2 -2
- package/dist/src/functions/get-addon-icon.function.d.ts.map +1 -1
- package/dist/src/functions/get-addon-icon.function.js +2 -3
- package/dist/src/functions/get-addon-icon.function.js.map +1 -1
- package/dist/src/functions/get-addon-meta.function.d.ts +1 -1
- package/dist/src/functions/get-addon-meta.function.d.ts.map +1 -1
- package/dist/src/functions/get-addon-meta.function.js +2 -3
- package/dist/src/functions/get-addon-meta.function.js.map +1 -1
- package/dist/src/functions/get-addon-package.function.d.ts +2 -2
- package/dist/src/functions/get-addon-package.function.d.ts.map +1 -1
- package/dist/src/functions/get-addon-package.function.js +2 -3
- package/dist/src/functions/get-addon-package.function.js.map +1 -1
- package/dist/src/functions/get-agent-thread-messages.function.d.ts +2 -2
- package/dist/src/functions/get-agent-thread-messages.function.d.ts.map +1 -1
- package/dist/src/functions/get-agent-thread-messages.function.js +2 -3
- package/dist/src/functions/get-agent-thread-messages.function.js.map +1 -1
- package/dist/src/functions/get-agent-thread-runs.function.d.ts +2 -2
- package/dist/src/functions/get-agent-thread-runs.function.d.ts.map +1 -1
- package/dist/src/functions/get-agent-thread-runs.function.js +2 -3
- package/dist/src/functions/get-agent-thread-runs.function.js.map +1 -1
- package/dist/src/functions/get-agent-threads.function.d.ts +2 -2
- package/dist/src/functions/get-agent-threads.function.d.ts.map +1 -1
- package/dist/src/functions/get-agent-threads.function.js +2 -3
- package/dist/src/functions/get-agent-threads.function.js.map +1 -1
- package/dist/src/functions/get-ai-workflows.function.d.ts +2 -2
- package/dist/src/functions/get-ai-workflows.function.d.ts.map +1 -1
- package/dist/src/functions/get-ai-workflows.function.js +2 -3
- package/dist/src/functions/get-ai-workflows.function.js.map +1 -1
- package/dist/src/functions/get-all-meta.function.d.ts +1 -1
- package/dist/src/functions/get-all-meta.function.d.ts.map +1 -1
- package/dist/src/functions/get-all-meta.function.js +2 -3
- package/dist/src/functions/get-all-meta.function.js.map +1 -1
- package/dist/src/functions/get-auth-providers.function.d.ts +1 -1
- package/dist/src/functions/get-auth-providers.function.d.ts.map +1 -1
- package/dist/src/functions/get-auth-providers.function.js +2 -3
- package/dist/src/functions/get-auth-providers.function.js.map +1 -1
- package/dist/src/functions/get-channel-snippets.function.d.ts +2 -2
- package/dist/src/functions/get-channel-snippets.function.d.ts.map +1 -1
- package/dist/src/functions/get-channel-snippets.function.js +2 -3
- package/dist/src/functions/get-channel-snippets.function.js.map +1 -1
- package/dist/src/functions/get-db-schema.function.d.ts +1 -1
- package/dist/src/functions/get-db-schema.function.d.ts.map +1 -1
- package/dist/src/functions/get-db-schema.function.js +2 -3
- package/dist/src/functions/get-db-schema.function.js.map +1 -1
- package/dist/src/functions/get-function-coverage.function.d.ts +1 -1
- package/dist/src/functions/get-function-coverage.function.d.ts.map +1 -1
- package/dist/src/functions/get-function-coverage.function.js +2 -3
- package/dist/src/functions/get-function-coverage.function.js.map +1 -1
- package/dist/src/functions/get-functions-meta.function.d.ts +1 -1
- package/dist/src/functions/get-functions-meta.function.d.ts.map +1 -1
- package/dist/src/functions/get-functions-meta.function.js +2 -3
- package/dist/src/functions/get-functions-meta.function.js.map +1 -1
- package/dist/src/functions/get-installed-addons.function.d.ts +1 -1
- package/dist/src/functions/get-installed-addons.function.d.ts.map +1 -1
- package/dist/src/functions/get-installed-addons.function.js +2 -3
- package/dist/src/functions/get-installed-addons.function.js.map +1 -1
- package/dist/src/functions/get-installed-package.function.d.ts +2 -2
- package/dist/src/functions/get-installed-package.function.d.ts.map +1 -1
- package/dist/src/functions/get-installed-package.function.js +2 -3
- package/dist/src/functions/get-installed-package.function.js.map +1 -1
- package/dist/src/functions/get-openapi-detail.function.d.ts +2 -2
- package/dist/src/functions/get-openapi-detail.function.d.ts.map +1 -1
- package/dist/src/functions/get-openapi-detail.function.js +2 -3
- package/dist/src/functions/get-openapi-detail.function.js.map +1 -1
- package/dist/src/functions/get-openapis.function.d.ts +2 -2
- package/dist/src/functions/get-openapis.function.d.ts.map +1 -1
- package/dist/src/functions/get-openapis.function.js +2 -3
- package/dist/src/functions/get-openapis.function.js.map +1 -1
- package/dist/src/functions/get-schema.function.d.ts +2 -2
- package/dist/src/functions/get-schema.function.d.ts.map +1 -1
- package/dist/src/functions/get-schema.function.js +2 -3
- package/dist/src/functions/get-schema.function.js.map +1 -1
- package/dist/src/functions/get-security-audit.function.d.ts +3 -0
- package/dist/src/functions/get-security-audit.function.d.ts.map +1 -0
- package/dist/src/functions/get-security-audit.function.js +9 -0
- package/dist/src/functions/get-security-audit.function.js.map +1 -0
- package/dist/src/functions/get-security-audit.function.test.d.ts +2 -0
- package/dist/src/functions/get-security-audit.function.test.d.ts.map +1 -0
- package/dist/src/functions/get-security-audit.function.test.js +53 -0
- package/dist/src/functions/get-security-audit.function.test.js.map +1 -0
- package/dist/src/functions/get-state-diff.function.d.ts +2 -2
- package/dist/src/functions/get-state-diff.function.js +2 -2
- package/dist/src/functions/get-state-diff.function.js.map +1 -1
- package/dist/src/functions/get-workflow-meta-by-id.function.d.ts +2 -2
- package/dist/src/functions/get-workflow-meta-by-id.function.d.ts.map +1 -1
- package/dist/src/functions/get-workflow-meta-by-id.function.js +2 -3
- package/dist/src/functions/get-workflow-meta-by-id.function.js.map +1 -1
- package/dist/src/functions/get-workflow-run-history.function.d.ts +2 -2
- package/dist/src/functions/get-workflow-run-history.function.d.ts.map +1 -1
- package/dist/src/functions/get-workflow-run-history.function.js +3 -4
- package/dist/src/functions/get-workflow-run-history.function.js.map +1 -1
- package/dist/src/functions/get-workflow-run-names.function.d.ts +1 -1
- package/dist/src/functions/get-workflow-run-names.function.d.ts.map +1 -1
- package/dist/src/functions/get-workflow-run-names.function.js +3 -4
- package/dist/src/functions/get-workflow-run-names.function.js.map +1 -1
- package/dist/src/functions/get-workflow-run-steps.function.d.ts +2 -2
- package/dist/src/functions/get-workflow-run-steps.function.d.ts.map +1 -1
- package/dist/src/functions/get-workflow-run-steps.function.js +2 -3
- package/dist/src/functions/get-workflow-run-steps.function.js.map +1 -1
- package/dist/src/functions/get-workflow-run.function.d.ts +2 -2
- package/dist/src/functions/get-workflow-run.function.d.ts.map +1 -1
- package/dist/src/functions/get-workflow-run.function.js +2 -3
- package/dist/src/functions/get-workflow-run.function.js.map +1 -1
- package/dist/src/functions/get-workflow-runs.function.d.ts +2 -2
- package/dist/src/functions/get-workflow-runs.function.d.ts.map +1 -1
- package/dist/src/functions/get-workflow-runs.function.js +2 -3
- package/dist/src/functions/get-workflow-runs.function.js.map +1 -1
- package/dist/src/functions/get-workflow-version.function.d.ts +2 -2
- package/dist/src/functions/get-workflow-version.function.d.ts.map +1 -1
- package/dist/src/functions/get-workflow-version.function.js +2 -3
- package/dist/src/functions/get-workflow-version.function.js.map +1 -1
- package/dist/src/functions/install-addon.function.d.ts.map +1 -1
- package/dist/src/functions/install-addon.function.js +2 -1
- package/dist/src/functions/install-addon.function.js.map +1 -1
- package/dist/src/functions/install-openapi-addon.function.d.ts.map +1 -1
- package/dist/src/functions/install-openapi-addon.function.js +2 -1
- package/dist/src/functions/install-openapi-addon.function.js.map +1 -1
- package/dist/src/functions/oauth-connect.function.d.ts +2 -2
- package/dist/src/functions/oauth-connect.function.js +2 -2
- package/dist/src/functions/oauth-connect.function.js.map +1 -1
- package/dist/src/functions/oauth-disconnect.function.d.ts +2 -2
- package/dist/src/functions/oauth-disconnect.function.js +2 -2
- package/dist/src/functions/oauth-disconnect.function.js.map +1 -1
- package/dist/src/functions/oauth-exchange-tokens.function.d.ts +2 -2
- package/dist/src/functions/oauth-exchange-tokens.function.js +2 -2
- package/dist/src/functions/oauth-exchange-tokens.function.js.map +1 -1
- package/dist/src/functions/oauth-refresh-token.function.d.ts +2 -2
- package/dist/src/functions/oauth-refresh-token.function.js +2 -2
- package/dist/src/functions/oauth-refresh-token.function.js.map +1 -1
- package/dist/src/functions/oauth-status.function.d.ts +2 -2
- package/dist/src/functions/oauth-status.function.js +2 -2
- package/dist/src/functions/oauth-status.function.js.map +1 -1
- package/dist/src/functions/oauth-test-token.function.d.ts +2 -2
- package/dist/src/functions/oauth-test-token.function.js +2 -2
- package/dist/src/functions/oauth-test-token.function.js.map +1 -1
- package/dist/src/functions/ping.function.d.ts +2 -2
- package/dist/src/functions/ping.function.d.ts.map +1 -1
- package/dist/src/functions/ping.function.js +2 -3
- package/dist/src/functions/ping.function.js.map +1 -1
- package/dist/src/functions/read-agent-source.function.d.ts +2 -2
- package/dist/src/functions/read-agent-source.function.d.ts.map +1 -1
- package/dist/src/functions/read-agent-source.function.js +2 -3
- package/dist/src/functions/read-agent-source.function.js.map +1 -1
- package/dist/src/functions/read-function-body.function.d.ts +2 -2
- package/dist/src/functions/read-function-body.function.d.ts.map +1 -1
- package/dist/src/functions/read-function-body.function.js +2 -3
- package/dist/src/functions/read-function-body.function.js.map +1 -1
- package/dist/src/functions/read-function-source.function.d.ts +2 -2
- package/dist/src/functions/read-function-source.function.d.ts.map +1 -1
- package/dist/src/functions/read-function-source.function.js +2 -3
- package/dist/src/functions/read-function-source.function.js.map +1 -1
- package/dist/src/functions/render-email-preview.function.d.ts +1 -1
- package/dist/src/functions/render-email-preview.function.d.ts.map +1 -1
- package/dist/src/functions/render-email-preview.function.js +2 -3
- package/dist/src/functions/render-email-preview.function.js.map +1 -1
- package/dist/src/functions/run-function-tests.function.d.ts +1 -1
- package/dist/src/functions/run-function-tests.function.d.ts.map +1 -1
- package/dist/src/functions/run-function-tests.function.js +2 -3
- package/dist/src/functions/run-function-tests.function.js.map +1 -1
- package/dist/src/functions/run-security-audit.function.d.ts +3 -0
- package/dist/src/functions/run-security-audit.function.d.ts.map +1 -0
- package/dist/src/functions/run-security-audit.function.js +18 -0
- package/dist/src/functions/run-security-audit.function.js.map +1 -0
- package/dist/src/functions/update-agent-config.function.d.ts +2 -2
- package/dist/src/functions/update-agent-config.function.d.ts.map +1 -1
- package/dist/src/functions/update-agent-config.function.js +2 -3
- package/dist/src/functions/update-agent-config.function.js.map +1 -1
- package/dist/src/functions/update-dependency.function.d.ts +12 -0
- package/dist/src/functions/update-dependency.function.d.ts.map +1 -0
- package/dist/src/functions/update-dependency.function.js +62 -0
- package/dist/src/functions/update-dependency.function.js.map +1 -0
- package/dist/src/functions/update-email-template.function.d.ts +2 -2
- package/dist/src/functions/update-email-template.function.d.ts.map +1 -1
- package/dist/src/functions/update-email-template.function.js +2 -3
- package/dist/src/functions/update-email-template.function.js.map +1 -1
- package/dist/src/functions/update-function-body.function.d.ts +2 -2
- package/dist/src/functions/update-function-body.function.d.ts.map +1 -1
- package/dist/src/functions/update-function-body.function.js +2 -3
- package/dist/src/functions/update-function-body.function.js.map +1 -1
- package/dist/src/functions/update-function-config.function.d.ts +2 -2
- package/dist/src/functions/update-function-config.function.d.ts.map +1 -1
- package/dist/src/functions/update-function-config.function.js +2 -3
- package/dist/src/functions/update-function-config.function.js.map +1 -1
- package/dist/src/lib/audit-exec.d.ts +10 -0
- package/dist/src/lib/audit-exec.d.ts.map +1 -0
- package/dist/src/lib/audit-exec.js +75 -0
- package/dist/src/lib/audit-exec.js.map +1 -0
- package/dist/src/lib/find-project-root.d.ts +9 -0
- package/dist/src/lib/find-project-root.d.ts.map +1 -0
- package/dist/src/lib/find-project-root.js +21 -0
- package/dist/src/lib/find-project-root.js.map +1 -0
- package/dist/src/services.d.ts.map +1 -1
- package/dist/src/services.js +2 -2
- package/dist/src/services.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-security-audit.function.d.ts","sourceRoot":"","sources":["../../../src/functions/run-security-audit.function.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAGtD,eAAO,MAAM,gBAAgB,6VAmB3B,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { dirname } from 'node:path';
|
|
2
|
+
import { pikkuFunc } from '#pikku';
|
|
3
|
+
import { readAuditReport, runPikkuAudit } from '../lib/audit-exec.js';
|
|
4
|
+
export const runSecurityAudit = pikkuFunc({
|
|
5
|
+
title: 'Run Security Audit',
|
|
6
|
+
description: 'Runs `pikku audit --outdated`, regenerating .pikku/audit.json, and returns the fresh report. Mirrors the Run Tests action.',
|
|
7
|
+
expose: true,
|
|
8
|
+
func: async ({ metaService }) => {
|
|
9
|
+
if (!metaService?.basePath) {
|
|
10
|
+
throw new Error('Meta service is not configured. Ensure the console addon is set up with a MetaService.');
|
|
11
|
+
}
|
|
12
|
+
// basePath is the project's `.pikku` dir; run from the dir that holds it
|
|
13
|
+
// (the project root with pikku.config.json) so audit.json lands back in it.
|
|
14
|
+
await runPikkuAudit(dirname(metaService.basePath));
|
|
15
|
+
return readAuditReport(metaService);
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=run-security-audit.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-security-audit.function.js","sourceRoot":"","sources":["../../../src/functions/run-security-audit.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAErE,MAAM,CAAC,MAAM,gBAAgB,GAAG,SAAS,CAGvC;IACA,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,4HAA4H;IAC9H,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;QAC9B,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAA;QACH,CAAC;QACD,yEAAyE;QACzE,4EAA4E;QAC5E,MAAM,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAA;QAClD,OAAO,eAAe,CAAC,WAAW,CAAC,CAAA;IACrC,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -5,13 +5,13 @@ export declare const updateAgentConfig: import("#pikku").PikkuFunctionConfig<{
|
|
|
5
5
|
changes: AgentConfigChanges;
|
|
6
6
|
}, {
|
|
7
7
|
success: boolean;
|
|
8
|
-
}, "rpc" | "session", import("#pikku").
|
|
8
|
+
}, "rpc" | "session", import("#pikku").PikkuFunction<{
|
|
9
9
|
sourceFile: string;
|
|
10
10
|
exportedName: string;
|
|
11
11
|
changes: AgentConfigChanges;
|
|
12
12
|
}, {
|
|
13
13
|
success: boolean;
|
|
14
|
-
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").
|
|
14
|
+
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<{
|
|
15
15
|
sourceFile: string;
|
|
16
16
|
exportedName: string;
|
|
17
17
|
changes: AgentConfigChanges;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-agent-config.function.d.ts","sourceRoot":"","sources":["../../../src/functions/update-agent-config.function.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAE1E,eAAO,MAAM,iBAAiB;gBAEd,MAAM;kBACJ,MAAM;aACX,kBAAkB;;aAElB,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;aACX,kBAAkB;;aAElB,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;aACX,kBAAkB;;aAElB,OAAO;
|
|
1
|
+
{"version":3,"file":"update-agent-config.function.d.ts","sourceRoot":"","sources":["../../../src/functions/update-agent-config.function.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAE1E,eAAO,MAAM,iBAAiB;gBAEd,MAAM;kBACJ,MAAM;aACX,kBAAkB;;aAElB,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;aACX,kBAAkB;;aAElB,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;aACX,kBAAkB;;aAElB,OAAO;uEAelB,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { LocalEnvironmentOnlyError } from '@pikku/core/errors';
|
|
2
|
-
import {
|
|
3
|
-
export const updateAgentConfig =
|
|
2
|
+
import { pikkuFunc } from '#pikku';
|
|
3
|
+
export const updateAgentConfig = pikkuFunc({
|
|
4
4
|
title: 'Update Agent Config',
|
|
5
5
|
description: 'Updates the config properties of a pikku AI agent definition in source code and triggers a rebuild.',
|
|
6
6
|
expose: true,
|
|
7
|
-
auth: false,
|
|
8
7
|
func: async ({ codeEditService }, { sourceFile, exportedName, changes }) => {
|
|
9
8
|
if (!codeEditService) {
|
|
10
9
|
throw new LocalEnvironmentOnlyError('Only available in local development mode');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-agent-config.function.js","sourceRoot":"","sources":["../../../src/functions/update-agent-config.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"update-agent-config.function.js","sourceRoot":"","sources":["../../../src/functions/update-agent-config.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGlC,MAAM,CAAC,MAAM,iBAAiB,GAAG,SAAS,CAOxC;IACA,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,qGAAqG;IACvG,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE;QACzE,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,yBAAyB,CACjC,0CAA0C,CAC3C,CAAA;QACH,CAAC;QACD,MAAM,eAAe,CAAC,iBAAiB,CAAC,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAA;QAC1E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SecurityAuditReport } from '@pikku/core';
|
|
2
|
+
export declare const updateDependency: import("#pikku").PikkuFunctionConfig<{
|
|
3
|
+
package: string;
|
|
4
|
+
version: string;
|
|
5
|
+
}, SecurityAuditReport | null, "rpc" | "session", import("#pikku").PikkuFunction<{
|
|
6
|
+
package: string;
|
|
7
|
+
version: string;
|
|
8
|
+
}, SecurityAuditReport | null, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<{
|
|
9
|
+
package: string;
|
|
10
|
+
version: string;
|
|
11
|
+
}, SecurityAuditReport | null, "rpc" | "session", import("#pikku").Services>, undefined, undefined>;
|
|
12
|
+
//# sourceMappingURL=update-dependency.function.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-dependency.function.d.ts","sourceRoot":"","sources":["../../../src/functions/update-dependency.function.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AA0CtD,eAAO,MAAM,gBAAgB;aAChB,MAAM;aAAW,MAAM;;aAAvB,MAAM;aAAW,MAAM;;aAAvB,MAAM;aAAW,MAAM;mGAmClC,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { pikkuFunc } from '#pikku';
|
|
4
|
+
import { readAuditReport, runPikkuAudit, spawnProcess } from '../lib/audit-exec.js';
|
|
5
|
+
const DEP_SECTIONS = [
|
|
6
|
+
'dependencies',
|
|
7
|
+
'devDependencies',
|
|
8
|
+
'optionalDependencies',
|
|
9
|
+
'peerDependencies',
|
|
10
|
+
];
|
|
11
|
+
// Bump `pkg` to `version` in package.json, preserving the existing range
|
|
12
|
+
// operator (^, ~, or exact). Returns false if it is not a direct dependency.
|
|
13
|
+
function bumpPackageJson(pkgPath, pkg, version) {
|
|
14
|
+
const manifest = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
15
|
+
for (const section of DEP_SECTIONS) {
|
|
16
|
+
const current = manifest[section]?.[pkg];
|
|
17
|
+
if (typeof current === 'string') {
|
|
18
|
+
// Only plain semver ranges (^, ~, or exact) can be safely rewritten to a
|
|
19
|
+
// bare version. workspace:/file:/link:/git/url specifiers carry semantics
|
|
20
|
+
// a version string would silently destroy — refuse rather than clobber.
|
|
21
|
+
if (/^(workspace:|file:|link:|git\+|github:|https?:|npm:)/.test(current)) {
|
|
22
|
+
throw new Error(`${pkg} uses a non-semver specifier (${current}) — cannot bump it here.`);
|
|
23
|
+
}
|
|
24
|
+
const prefix = /^[\^~]/.test(current) ? current[0] : '';
|
|
25
|
+
manifest[section][pkg] = `${prefix}${version}`;
|
|
26
|
+
writeFileSync(pkgPath, `${JSON.stringify(manifest, null, 2)}\n`);
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
// Accept only a concrete semver (optionally with a prerelease/build tag) so a
|
|
33
|
+
// caller can't inject an arbitrary install specifier (tag, url, `../evil`).
|
|
34
|
+
const SEMVER_RE = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/;
|
|
35
|
+
export const updateDependency = pikkuFunc({
|
|
36
|
+
title: 'Update Dependency',
|
|
37
|
+
description: 'Bumps a dependency to the given version in package.json, runs `bun install`, re-runs `pikku audit`, and returns the refreshed report. The mechanical (free) remediation — it does NOT run the app or verify anything still works.',
|
|
38
|
+
expose: true,
|
|
39
|
+
func: async ({ metaService }, { package: pkg, version }) => {
|
|
40
|
+
if (!SEMVER_RE.test(version)) {
|
|
41
|
+
throw new Error(`Invalid version "${version}" — expected a concrete semver like 1.2.3.`);
|
|
42
|
+
}
|
|
43
|
+
if (!metaService?.basePath) {
|
|
44
|
+
throw new Error('Meta service is not configured. Ensure the console addon is set up with a MetaService.');
|
|
45
|
+
}
|
|
46
|
+
const projectDir = dirname(metaService.basePath);
|
|
47
|
+
const pkgPath = join(projectDir, 'package.json');
|
|
48
|
+
if (!existsSync(pkgPath)) {
|
|
49
|
+
throw new Error(`package.json not found at ${pkgPath}`);
|
|
50
|
+
}
|
|
51
|
+
if (!bumpPackageJson(pkgPath, pkg, version)) {
|
|
52
|
+
throw new Error(`${pkg} is not a direct dependency in package.json — cannot update it here.`);
|
|
53
|
+
}
|
|
54
|
+
// Resolve the lockfile against the new package.json. A non-zero exit is a
|
|
55
|
+
// real failure (surfaced to the caller); the app is never run or tested.
|
|
56
|
+
await spawnProcess('bun', ['install'], projectDir, { failOnNonZero: true });
|
|
57
|
+
// Refresh the audit so the finding clears in the UI.
|
|
58
|
+
await runPikkuAudit(projectDir);
|
|
59
|
+
return readAuditReport(metaService);
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
//# sourceMappingURL=update-dependency.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-dependency.function.js","sourceRoot":"","sources":["../../../src/functions/update-dependency.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnF,MAAM,YAAY,GAAG;IACnB,cAAc;IACd,iBAAiB;IACjB,sBAAsB;IACtB,kBAAkB;CACV,CAAA;AAEV,yEAAyE;AACzE,6EAA6E;AAC7E,SAAS,eAAe,CACtB,OAAe,EACf,GAAW,EACX,OAAe;IAEf,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IAC3D,KAAK,MAAM,OAAO,IAAI,YAAY,EAAE,C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EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CACb,wFAAwF,CACzF,CAAA;QACH,CAAC;QACD,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,cAAc,CAAC,CAAA;QAChD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,6BAA6B,OAAO,EAAE,CAAC,CAAA;QACzD,CAAC;QACD,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC;YAC5C,MAAM,IAAI,KAAK,CACb,GAAG,GAAG,sEAAsE,CAC7E,CAAA;QACH,CAAC;QACD,0EAA0E;QAC1E,yEAAyE;QACzE,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;QAC3E,qDAAqD;QACrD,MAAM,aAAa,CAAC,UAAU,CAAC,CAAA;QAC/B,OAAO,eAAe,CAAC,WAAW,CAAC,CAAA;IACrC,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -3,12 +3,12 @@ export declare const updateEmailTemplate: import("#pikku").PikkuFunctionConfig<{
|
|
|
3
3
|
source: string;
|
|
4
4
|
}, {
|
|
5
5
|
success: boolean;
|
|
6
|
-
}, "rpc" | "session", import("#pikku").
|
|
6
|
+
}, "rpc" | "session", import("#pikku").PikkuFunction<{
|
|
7
7
|
templateName: string;
|
|
8
8
|
source: string;
|
|
9
9
|
}, {
|
|
10
10
|
success: boolean;
|
|
11
|
-
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").
|
|
11
|
+
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<{
|
|
12
12
|
templateName: string;
|
|
13
13
|
source: string;
|
|
14
14
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-email-template.function.d.ts","sourceRoot":"","sources":["../../../src/functions/update-email-template.function.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;kBAEd,MAAM;YACZ,MAAM;;aAEL,OAAO;;kBAHF,MAAM;YACZ,MAAM;;aAEL,OAAO;;kBAHF,MAAM;YACZ,MAAM;;aAEL,OAAO;
|
|
1
|
+
{"version":3,"file":"update-email-template.function.d.ts","sourceRoot":"","sources":["../../../src/functions/update-email-template.function.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,mBAAmB;kBAEd,MAAM;YACZ,MAAM;;aAEL,OAAO;;kBAHF,MAAM;YACZ,MAAM;;aAEL,OAAO;;kBAHF,MAAM;YACZ,MAAM;;aAEL,OAAO;uEA4BlB,CAAA"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { NotFoundError } from '@pikku/core';
|
|
2
2
|
import { LocalEnvironmentOnlyError } from '@pikku/core/errors';
|
|
3
|
-
import {
|
|
4
|
-
export const updateEmailTemplate =
|
|
3
|
+
import { pikkuFunc } from '#pikku';
|
|
4
|
+
export const updateEmailTemplate = pikkuFunc({
|
|
5
5
|
title: 'Update Email Template',
|
|
6
6
|
description: 'Overwrites an email template HTML source file (templates/<name>.html) so small edits can be made from the console.',
|
|
7
7
|
expose: true,
|
|
8
|
-
auth: false,
|
|
9
8
|
func: async ({ metaService, codeEditService }, { templateName, source }) => {
|
|
10
9
|
if (!codeEditService) {
|
|
11
10
|
throw new LocalEnvironmentOnlyError('Only available in local development mode');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-email-template.function.js","sourceRoot":"","sources":["../../../src/functions/update-email-template.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"update-email-template.function.js","sourceRoot":"","sources":["../../../src/functions/update-email-template.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAM1C;IACA,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,oHAAoH;IACtH,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE;QACzE,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,yBAAyB,CACjC,0CAA0C,CAC3C,CAAA;QACH,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,WAAW,CAAC,YAAY,EAAE,CAAA;QACnD,IAAI,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;YACpB,MAAM,IAAI,aAAa,CACrB,iEAAiE,CAClE,CAAA;QACH,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;YACxC,MAAM,IAAI,aAAa,CAAC,2BAA2B,YAAY,EAAE,CAAC,CAAA;QACpE,CAAC;QACD,MAAM,eAAe,CAAC,mBAAmB,CACvC,UAAU,CAAC,GAAG,EACd,YAAY,EACZ,MAAM,CACP,CAAA;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -4,13 +4,13 @@ export declare const updateFunctionBody: import("#pikku").PikkuFunctionConfig<{
|
|
|
4
4
|
body: string;
|
|
5
5
|
}, {
|
|
6
6
|
success: boolean;
|
|
7
|
-
}, "rpc" | "session", import("#pikku").
|
|
7
|
+
}, "rpc" | "session", import("#pikku").PikkuFunction<{
|
|
8
8
|
sourceFile: string;
|
|
9
9
|
exportedName: string;
|
|
10
10
|
body: string;
|
|
11
11
|
}, {
|
|
12
12
|
success: boolean;
|
|
13
|
-
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").
|
|
13
|
+
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<{
|
|
14
14
|
sourceFile: string;
|
|
15
15
|
exportedName: string;
|
|
16
16
|
body: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-function-body.function.d.ts","sourceRoot":"","sources":["../../../src/functions/update-function-body.function.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;gBAEf,MAAM;kBACJ,MAAM;UACd,MAAM;;aAEH,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;UACd,MAAM;;aAEH,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;UACd,MAAM;;aAEH,OAAO;
|
|
1
|
+
{"version":3,"file":"update-function-body.function.d.ts","sourceRoot":"","sources":["../../../src/functions/update-function-body.function.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;gBAEf,MAAM;kBACJ,MAAM;UACd,MAAM;;aAEH,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;UACd,MAAM;;aAEH,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;UACd,MAAM;;aAEH,OAAO;uEAelB,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { LocalEnvironmentOnlyError } from '@pikku/core/errors';
|
|
2
|
-
import {
|
|
3
|
-
export const updateFunctionBody =
|
|
2
|
+
import { pikkuFunc } from '#pikku';
|
|
3
|
+
export const updateFunctionBody = pikkuFunc({
|
|
4
4
|
title: 'Update Function Body',
|
|
5
5
|
description: 'Replaces the function body of a pikku function definition in source code and triggers a rebuild.',
|
|
6
6
|
expose: true,
|
|
7
|
-
auth: false,
|
|
8
7
|
func: async ({ codeEditService }, { sourceFile, exportedName, body }) => {
|
|
9
8
|
if (!codeEditService) {
|
|
10
9
|
throw new LocalEnvironmentOnlyError('Only available in local development mode');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-function-body.function.js","sourceRoot":"","sources":["../../../src/functions/update-function-body.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"update-function-body.function.js","sourceRoot":"","sources":["../../../src/functions/update-function-body.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAElC,MAAM,CAAC,MAAM,kBAAkB,GAAG,SAAS,CAOzC;IACA,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,kGAAkG;IACpG,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,EAAE;QACtE,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,yBAAyB,CACjC,0CAA0C,CAC3C,CAAA;QACH,CAAC;QACD,MAAM,eAAe,CAAC,kBAAkB,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,CAAA;QACxE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -5,13 +5,13 @@ export declare const updateFunctionConfig: import("#pikku").PikkuFunctionConfig<
|
|
|
5
5
|
changes: FunctionConfigChanges;
|
|
6
6
|
}, {
|
|
7
7
|
success: boolean;
|
|
8
|
-
}, "rpc" | "session", import("#pikku").
|
|
8
|
+
}, "rpc" | "session", import("#pikku").PikkuFunction<{
|
|
9
9
|
sourceFile: string;
|
|
10
10
|
exportedName: string;
|
|
11
11
|
changes: FunctionConfigChanges;
|
|
12
12
|
}, {
|
|
13
13
|
success: boolean;
|
|
14
|
-
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").
|
|
14
|
+
}, "rpc" | "session", import("#pikku").Services> | import("#pikku").PikkuFunctionSessionless<{
|
|
15
15
|
sourceFile: string;
|
|
16
16
|
exportedName: string;
|
|
17
17
|
changes: FunctionConfigChanges;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-function-config.function.d.ts","sourceRoot":"","sources":["../../../src/functions/update-function-config.function.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAE7E,eAAO,MAAM,oBAAoB;gBAEjB,MAAM;kBACJ,MAAM;aACX,qBAAqB;;aAErB,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;aACX,qBAAqB;;aAErB,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;aACX,qBAAqB;;aAErB,OAAO;
|
|
1
|
+
{"version":3,"file":"update-function-config.function.d.ts","sourceRoot":"","sources":["../../../src/functions/update-function-config.function.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAE7E,eAAO,MAAM,oBAAoB;gBAEjB,MAAM;kBACJ,MAAM;aACX,qBAAqB;;aAErB,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;aACX,qBAAqB;;aAErB,OAAO;;gBAJJ,MAAM;kBACJ,MAAM;aACX,qBAAqB;;aAErB,OAAO;uEAmBlB,CAAA"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { LocalEnvironmentOnlyError } from '@pikku/core/errors';
|
|
2
|
-
import {
|
|
3
|
-
export const updateFunctionConfig =
|
|
2
|
+
import { pikkuFunc } from '#pikku';
|
|
3
|
+
export const updateFunctionConfig = pikkuFunc({
|
|
4
4
|
title: 'Update Function Config',
|
|
5
5
|
description: 'Updates the config properties of a pikku function definition in source code and triggers a rebuild.',
|
|
6
6
|
expose: true,
|
|
7
|
-
auth: false,
|
|
8
7
|
func: async ({ codeEditService }, { sourceFile, exportedName, changes }) => {
|
|
9
8
|
if (!codeEditService) {
|
|
10
9
|
throw new LocalEnvironmentOnlyError('Only available in local development mode');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-function-config.function.js","sourceRoot":"","sources":["../../../src/functions/update-function-config.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"update-function-config.function.js","sourceRoot":"","sources":["../../../src/functions/update-function-config.function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAGlC,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAO3C;IACA,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,qGAAqG;IACvG,MAAM,EAAE,IAAI;IACZ,IAAI,EAAE,KAAK,EAAE,EAAE,eAAe,EAAE,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,EAAE,EAAE;QACzE,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,IAAI,yBAAyB,CACjC,0CAA0C,CAC3C,CAAA;QACH,CAAC;QACD,MAAM,eAAe,CAAC,oBAAoB,CACxC,UAAU,EACV,YAAY,EACZ,OAAO,CACR,CAAA;QACD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;IAC1B,CAAC;CACF,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MetaService } from '@pikku/core/services';
|
|
2
|
+
import type { SecurityAuditReport } from '@pikku/core';
|
|
3
|
+
export declare function findBin(name: string, searchFrom: string): string;
|
|
4
|
+
export declare function readAuditReport(metaService: MetaService): Promise<SecurityAuditReport | null>;
|
|
5
|
+
export declare function spawnProcess(command: string, args: string[], cwd: string, { failOnNonZero, timeoutMs, }?: {
|
|
6
|
+
failOnNonZero?: boolean;
|
|
7
|
+
timeoutMs?: number;
|
|
8
|
+
}): Promise<void>;
|
|
9
|
+
export declare function runPikkuAudit(projectDir: string): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=audit-exec.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-exec.d.ts","sourceRoot":"","sources":["../../../src/lib/audit-exec.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAItD,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAUhE;AAID,wBAAsB,eAAe,CACnC,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAQrC;AAQD,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,EAAE,MAAM,EACX,EACE,aAAqB,EACrB,SAAsB,GACvB,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GACtD,OAAO,CAAC,IAAI,CAAC,CAqCf;AAGD,wBAAsB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGrE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { join, dirname } from 'node:path';
|
|
3
|
+
import { spawn } from 'node:child_process';
|
|
4
|
+
// Walk up from `searchFrom` for a `node_modules/.bin/<name>` executable,
|
|
5
|
+
// falling back to the bare name (resolved via PATH) if none is found.
|
|
6
|
+
export function findBin(name, searchFrom) {
|
|
7
|
+
let dir = searchFrom;
|
|
8
|
+
for (let i = 0; i < 6; i++) {
|
|
9
|
+
const candidate = join(dir, 'node_modules', '.bin', name);
|
|
10
|
+
if (existsSync(candidate))
|
|
11
|
+
return candidate;
|
|
12
|
+
const parent = dirname(dir);
|
|
13
|
+
if (parent === dir)
|
|
14
|
+
break;
|
|
15
|
+
dir = parent;
|
|
16
|
+
}
|
|
17
|
+
return name;
|
|
18
|
+
}
|
|
19
|
+
// Read + parse `.pikku/audit.json`. Absent or malformed → null (the UI treats
|
|
20
|
+
// that as "no report yet"); a parse/read error here is not actionable.
|
|
21
|
+
export async function readAuditReport(metaService) {
|
|
22
|
+
try {
|
|
23
|
+
const content = await metaService.readFile('audit.json');
|
|
24
|
+
if (!content)
|
|
25
|
+
return null;
|
|
26
|
+
return JSON.parse(content);
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// Spawn a process, resolving on close. Rejects on a spawn error, on a timeout
|
|
33
|
+
// (kills the child so a hung `bun install` can't hang the request forever), and
|
|
34
|
+
// — when `failOnNonZero` is set — on a non-zero exit. stderr is captured and
|
|
35
|
+
// included in the rejection so failures are diagnosable. `pikku audit` exits
|
|
36
|
+
// non-zero when it *finds* advisories yet still writes a valid report, so audit
|
|
37
|
+
// runs stay lenient; `bun install` uses failOnNonZero so a real failure surfaces.
|
|
38
|
+
export function spawnProcess(command, args, cwd, { failOnNonZero = false, timeoutMs = 5 * 60_000, } = {}) {
|
|
39
|
+
return new Promise((resolve, reject) => {
|
|
40
|
+
const proc = spawn(command, args, {
|
|
41
|
+
cwd,
|
|
42
|
+
env: { ...process.env },
|
|
43
|
+
stdio: ['ignore', 'ignore', 'pipe'],
|
|
44
|
+
});
|
|
45
|
+
let stderr = '';
|
|
46
|
+
proc.stderr?.on('data', (d) => {
|
|
47
|
+
if (stderr.length < 8192)
|
|
48
|
+
stderr += d.toString();
|
|
49
|
+
});
|
|
50
|
+
const timer = setTimeout(() => {
|
|
51
|
+
proc.kill('SIGKILL');
|
|
52
|
+
reject(new Error(`${command} ${args.join(' ')} timed out after ${timeoutMs}ms`));
|
|
53
|
+
}, timeoutMs);
|
|
54
|
+
proc.on('close', (code) => {
|
|
55
|
+
clearTimeout(timer);
|
|
56
|
+
if (failOnNonZero && code !== 0) {
|
|
57
|
+
reject(new Error(`${command} ${args.join(' ')} failed (exit ${code})` +
|
|
58
|
+
(stderr.trim() ? `: ${stderr.trim()}` : '')));
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
resolve();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
proc.on('error', (err) => {
|
|
65
|
+
clearTimeout(timer);
|
|
66
|
+
reject(err);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// Re-run `pikku audit --outdated` in the project, regenerating audit.json.
|
|
71
|
+
export async function runPikkuAudit(projectDir) {
|
|
72
|
+
const pikku = findBin('pikku', projectDir);
|
|
73
|
+
await spawnProcess(process.execPath, [pikku, 'audit', '--outdated'], projectDir);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=audit-exec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-exec.js","sourceRoot":"","sources":["../../../src/lib/audit-exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAI1C,yEAAyE;AACzE,sEAAsE;AACtE,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,UAAkB;IACtD,IAAI,GAAG,GAAG,UAAU,CAAA;IACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC3B,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE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AC,KAAK,EAAE,OAAO,EAAE,YAAY,CAAC,EAAE,UAAU,CAAC,CAAA;AAClF,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the project root (the directory containing pikku.config.json) from
|
|
3
|
+
* the MetaService basePath. For a flat pikku project, dirname(basePath) IS
|
|
4
|
+
* the root. In a monorepo layout (e.g. the Fabric sandbox, where basePath is
|
|
5
|
+
* `packages/functions/.pikku`), pikku.config.json lives further up — walk up
|
|
6
|
+
* until we find it, matching the CLI's own findConfigFile() behavior.
|
|
7
|
+
*/
|
|
8
|
+
export declare function findProjectRoot(basePath: string): string;
|
|
9
|
+
//# sourceMappingURL=find-project-root.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-project-root.d.ts","sourceRoot":"","sources":["../../../src/lib/find-project-root.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAQxD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve the project root (the directory containing pikku.config.json) from
|
|
5
|
+
* the MetaService basePath. For a flat pikku project, dirname(basePath) IS
|
|
6
|
+
* the root. In a monorepo layout (e.g. the Fabric sandbox, where basePath is
|
|
7
|
+
* `packages/functions/.pikku`), pikku.config.json lives further up — walk up
|
|
8
|
+
* until we find it, matching the CLI's own findConfigFile() behavior.
|
|
9
|
+
*/
|
|
10
|
+
export function findProjectRoot(basePath) {
|
|
11
|
+
let dir = dirname(basePath);
|
|
12
|
+
while (true) {
|
|
13
|
+
if (existsSync(`${dir}/pikku.config.json`))
|
|
14
|
+
return dir;
|
|
15
|
+
const parent = dirname(dir);
|
|
16
|
+
if (parent === dir)
|
|
17
|
+
return dirname(basePath);
|
|
18
|
+
dir = parent;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=find-project-root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"find-project-root.js","sourceRoot":"","sources":["../../../src/lib/find-project-root.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,QAAgB;IAC9C,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC3B,OAAO,IAAI,EAAE,CAAC;QACZ,IAAI,UAAU,CAAC,GAAG,GAAG,oBAAoB,CAAC;YAAE,OAAO,GAAG,CAAA;QACtD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAA;QAC3B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAA;QAC5C,GAAG,GAAG,MAAM,CAAA;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,uBAAuB,0MAwEnC,CAAA"}
|
package/dist/src/services.js
CHANGED
|
@@ -4,6 +4,7 @@ import { AddonService } from './services/addon.service.js';
|
|
|
4
4
|
import { OAuthService } from './services/oauth.service.js';
|
|
5
5
|
import { StateDiffService } from './services/state-diff.service.js';
|
|
6
6
|
import { DbSchemaService } from './services/db-schema.service.js';
|
|
7
|
+
import { findProjectRoot } from './lib/find-project-root.js';
|
|
7
8
|
export const createSingletonServices = pikkuAddonServices(async (_config, { variables, metaService: existingMetaService, aiAgentRunner, schedulerService, agentRunService, workflowService, workflowRunService, aiStorage, aiRunState, deploymentService, credentialService, }) => {
|
|
8
9
|
if (!existingMetaService) {
|
|
9
10
|
throw new Error('metaService is required for the console addon. Set it in your createSingletonServices using PikkuMetaService from #pikku/pikku-meta-service.gen.js');
|
|
@@ -19,8 +20,7 @@ export const createSingletonServices = pikkuAddonServices(async (_config, { vari
|
|
|
19
20
|
let stateDiffService = null;
|
|
20
21
|
let dbSchemaService = null;
|
|
21
22
|
if (metaBasePath) {
|
|
22
|
-
const
|
|
23
|
-
const projectRoot = dirname(metaBasePath);
|
|
23
|
+
const projectRoot = findProjectRoot(metaBasePath);
|
|
24
24
|
stateDiffService = new StateDiffService(projectRoot);
|
|
25
25
|
dbSchemaService = new DbSchemaService(metaService);
|
|
26
26
|
// code-edit.service pulls in the TypeScript compiler and is deliberately a
|
package/dist/src/services.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;
|
|
1
|
+
{"version":3,"file":"services.js","sourceRoot":"","sources":["../../src/services.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AACnE,OA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AAI,CAAC;YACH,MAAM,YAAY,GAAG,iCAAiC,CAAA;YACtD,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAA;YACtD,eAAe,GAAG,IAAI,eAAe,CAAC,WAAW,CAAC,CAAA;QACpD,CAAC;QAAC,MAAM,CAAC;YACP,yEAAyE;QAC3E,CAAC;IACH,CAAC;IAED,OAAO;QACL,WAAW;QACX,aAAa;QACb,YAAY;QACZ,YAAY;QACZ,eAAe;QACf,kBAAkB;QAClB,eAAe;QACf,SAAS;QACT,UAAU;QACV,iBAAiB;QACjB,aAAa;QACb,gBAAgB;QAChB,iBAAiB;QACjB,eAAe;QACf,gBAAgB;QAChB,eAAe;KAChB,CAAA;AACH,CAAC,CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/addon-console",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"imports": {
|
|
6
6
|
"#pikku": {
|
|
@@ -38,11 +38,11 @@
|
|
|
38
38
|
"test:coverage": "bash run-tests.sh --coverage"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@pikku/core": "^0.12.
|
|
41
|
+
"@pikku/core": "^0.12.51"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@pikku/cli": "^0.12.
|
|
45
|
-
"@pikku/core": "^0.12.
|
|
44
|
+
"@pikku/cli": "^0.12.67",
|
|
45
|
+
"@pikku/core": "^0.12.51",
|
|
46
46
|
"oauth2-mock-server": "^7.1.1",
|
|
47
47
|
"typescript": "^6.0.3"
|
|
48
48
|
},
|