@pikku/cli 0.12.0 → 0.12.1

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 (185) hide show
  1. package/cli.schema.json +1 -1
  2. package/console-app/assets/index-DiYPTQU_.js +676 -0
  3. package/console-app/index.html +6 -1
  4. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +30 -3
  5. package/dist/.pikku/agent/pikku-agent-types.gen.js +13 -0
  6. package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +2 -2
  7. package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +1 -1
  8. package/dist/.pikku/agent/pikku-agent-wirings.gen.js +1 -1
  9. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  10. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  11. package/dist/.pikku/channel/pikku-channels-meta.gen.js +2 -2
  12. package/dist/.pikku/channel/pikku-channels.gen.d.ts +1 -1
  13. package/dist/.pikku/channel/pikku-channels.gen.js +1 -1
  14. package/dist/.pikku/cli/pikku-cli-channel.js +57 -3
  15. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  16. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  17. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  18. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  19. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +2 -2
  20. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +228 -10
  21. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  22. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  23. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  24. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  25. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  26. package/dist/.pikku/function/pikku-function-types.gen.d.ts +14 -11
  27. package/dist/.pikku/function/pikku-function-types.gen.js +25 -13
  28. package/dist/.pikku/function/pikku-functions-meta.gen.js +2 -2
  29. package/dist/.pikku/function/pikku-functions-meta.gen.json +359 -105
  30. package/dist/.pikku/function/pikku-functions.gen.js +3 -3
  31. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  32. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  33. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +2 -2
  34. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  35. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  36. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  37. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  38. package/dist/.pikku/mcp/pikku-mcp-wirings-meta.gen.js +2 -2
  39. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.d.ts +1 -1
  40. package/dist/.pikku/mcp/pikku-mcp-wirings.gen.js +1 -1
  41. package/dist/.pikku/pikku-bootstrap.gen.js +2 -2
  42. package/dist/.pikku/pikku-services.gen.d.ts +2 -1
  43. package/dist/.pikku/pikku-services.gen.js +1 -0
  44. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  45. package/dist/.pikku/pikku-types.gen.js +1 -1
  46. package/dist/.pikku/pikku-websocket.gen.d.ts +1 -1
  47. package/dist/.pikku/pikku-websocket.gen.js +1 -1
  48. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  49. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  50. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +2 -2
  51. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  52. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  53. package/dist/.pikku/rpc/pikku-remote-rpc-workers.gen.js +1 -1
  54. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +2 -2
  55. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +15 -6
  56. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  57. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  58. package/dist/.pikku/scheduler/pikku-schedulers-wirings-meta.gen.js +2 -2
  59. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.d.ts +1 -1
  60. package/dist/.pikku/scheduler/pikku-schedulers-wirings.gen.js +1 -1
  61. package/dist/.pikku/schemas/register.gen.js +15 -5
  62. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  63. package/dist/.pikku/schemas/schemas/PikkuNewAddonInput.schema.json +1 -0
  64. package/dist/.pikku/schemas/schemas/PikkuNewFunctionInput.schema.json +1 -0
  65. package/dist/.pikku/schemas/schemas/PikkuNewMiddlewareInput.schema.json +1 -0
  66. package/dist/.pikku/schemas/schemas/PikkuNewPermissionInput.schema.json +1 -0
  67. package/dist/.pikku/schemas/schemas/PikkuNewWiringInput.schema.json +1 -0
  68. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  69. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  70. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  71. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  72. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  73. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  74. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  75. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  76. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  77. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  78. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  79. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  80. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +2 -2
  81. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
  82. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  83. package/dist/src/cli.wiring.js +190 -9
  84. package/dist/src/functions/commands/all.js +6 -6
  85. package/dist/src/functions/commands/info.d.ts +9 -0
  86. package/dist/src/functions/commands/info.js +283 -0
  87. package/dist/src/functions/commands/new-addon.d.ts +34 -0
  88. package/dist/src/functions/commands/new-addon.js +636 -0
  89. package/dist/src/functions/commands/new-function.d.ts +10 -0
  90. package/dist/src/functions/commands/new-function.js +79 -0
  91. package/dist/src/functions/commands/new-middleware.d.ts +10 -0
  92. package/dist/src/functions/commands/new-middleware.js +48 -0
  93. package/dist/src/functions/commands/new-permission.d.ts +10 -0
  94. package/dist/src/functions/commands/new-permission.js +45 -0
  95. package/dist/src/functions/commands/new-wiring.d.ts +10 -0
  96. package/dist/src/functions/commands/new-wiring.js +102 -0
  97. package/dist/src/functions/commands/pikku-command-bootstrap.js +11 -40
  98. package/dist/src/functions/commands/versions-check.js +85 -3
  99. package/dist/src/functions/commands/versions-update.js +1 -1
  100. package/dist/src/functions/runtimes/nextjs/serialize-nextjs-backend-wrapper.js +0 -4
  101. package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.js +3 -2
  102. package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.js +5 -5
  103. package/dist/src/functions/wirings/ai-agent/serialize-agent-map.d.ts +1 -1
  104. package/dist/src/functions/wirings/ai-agent/serialize-ai-agent-types.d.ts +1 -1
  105. package/dist/src/functions/wirings/ai-agent/serialize-ai-agent-types.js +48 -3
  106. package/dist/src/functions/wirings/ai-agent/serialize-public-agent.js +30 -52
  107. package/dist/src/functions/wirings/channels/pikku-channels.js +1 -1
  108. package/dist/src/functions/wirings/channels/pikku-command-channel-types.js +2 -2
  109. package/dist/src/functions/wirings/channels/pikku-command-channels.js +1 -1
  110. package/dist/src/functions/wirings/channels/serialize-typed-channel-map.d.ts +4 -4
  111. package/dist/src/functions/wirings/cli/pikku-command-cli.js +1 -1
  112. package/dist/src/functions/wirings/cli/serialize-channel-cli-client.d.ts +2 -2
  113. package/dist/src/functions/wirings/cli/serialize-channel-cli.d.ts +1 -1
  114. package/dist/src/functions/wirings/cli/serialize-local-cli-bootstrap.d.ts +1 -1
  115. package/dist/src/functions/wirings/console/pikku-command-console-functions.js +2 -1
  116. package/dist/src/functions/wirings/console/pikku-command-nodes-meta.js +1 -1
  117. package/dist/src/functions/wirings/console/serialize-console-functions.d.ts +1 -1
  118. package/dist/src/functions/wirings/console/serialize-console-functions.js +18 -157
  119. package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +1 -0
  120. package/dist/src/functions/wirings/functions/pikku-command-addon-types.js +33 -0
  121. package/dist/src/functions/wirings/functions/pikku-command-function-types-split.js +1 -1
  122. package/dist/src/functions/wirings/functions/pikku-command-function-types.js +4 -4
  123. package/dist/src/functions/wirings/functions/pikku-command-functions.js +8 -14
  124. package/dist/src/functions/wirings/functions/schemas.js +1 -1
  125. package/dist/src/functions/wirings/functions/serialize-addon-types.d.ts +1 -0
  126. package/dist/src/functions/wirings/functions/{serialize-external-types.js → serialize-addon-types.js} +16 -15
  127. package/dist/src/functions/wirings/functions/serialize-function-imports.d.ts +3 -3
  128. package/dist/src/functions/wirings/functions/serialize-function-imports.js +3 -3
  129. package/dist/src/functions/wirings/functions/serialize-function-types.js +28 -14
  130. package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.d.ts +1 -1
  131. package/dist/src/functions/wirings/functions/serialize-pikku-types-hub.js +2 -2
  132. package/dist/src/functions/wirings/http/pikku-command-http-routes.js +1 -1
  133. package/dist/src/functions/wirings/http/pikku-http-routes.js +1 -1
  134. package/dist/src/functions/wirings/http/serialize-typed-http-map.d.ts +3 -3
  135. package/dist/src/functions/wirings/mcp/pikku-command-mcp.js +1 -1
  136. package/dist/src/functions/wirings/package/pikku-command-package.js +5 -5
  137. package/dist/src/functions/wirings/package/serialize-package.js +2 -2
  138. package/dist/src/functions/wirings/permissions/pikku-command-permissions.js +0 -5
  139. package/dist/src/functions/wirings/queue/serialize-queue-map.d.ts +2 -2
  140. package/dist/src/functions/wirings/queue/serialize-queue-meta.d.ts +1 -1
  141. package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.js +6 -6
  142. package/dist/src/functions/wirings/rpc/pikku-command-rpc.js +2 -4
  143. package/dist/src/functions/wirings/rpc/serialize-public-rpc.js +25 -16
  144. package/dist/src/functions/wirings/rpc/serialize-rpc-wrapper.js +43 -7
  145. package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.d.ts +8 -3
  146. package/dist/src/functions/wirings/rpc/serialize-typed-rpc-map.js +41 -31
  147. package/dist/src/functions/wirings/scheduler/serialize-scheduler-meta.d.ts +1 -1
  148. package/dist/src/functions/wirings/secrets/serialize-secrets-types.d.ts +2 -2
  149. package/dist/src/functions/wirings/triggers/serialize-trigger-meta.d.ts +1 -1
  150. package/dist/src/functions/wirings/triggers/serialize-trigger-meta.js +2 -2
  151. package/dist/src/functions/wirings/variables/serialize-variables-types.d.ts +2 -2
  152. package/dist/src/functions/wirings/workflow/pikku-command-workflow.js +2 -2
  153. package/dist/src/functions/wirings/workflow/serialize-workflow-map.d.ts +2 -2
  154. package/dist/src/functions/wirings/workflow/serialize-workflow-meta.js +2 -2
  155. package/dist/src/services/cli-logger-forwarder.service.d.ts +4 -3
  156. package/dist/src/services/cli-logger.service.d.ts +3 -2
  157. package/dist/src/services.d.ts +4 -3
  158. package/dist/src/services.js +2 -3
  159. package/dist/src/utils/check-required-types.d.ts +1 -1
  160. package/dist/src/utils/contract-versions.d.ts +1 -1
  161. package/dist/src/utils/file-writer.d.ts +6 -1
  162. package/dist/src/utils/file-writer.js +14 -1
  163. package/dist/src/utils/generate-bootstrap-file.d.ts +2 -2
  164. package/dist/src/utils/openapi/codegen.d.ts +19 -0
  165. package/dist/src/utils/openapi/codegen.js +288 -0
  166. package/dist/src/utils/openapi/naming.d.ts +30 -0
  167. package/dist/src/utils/openapi/naming.js +167 -0
  168. package/dist/src/utils/openapi/parse-openapi.d.ts +36 -0
  169. package/dist/src/utils/openapi/parse-openapi.js +196 -0
  170. package/dist/src/utils/openapi/zod-codegen.d.ts +53 -0
  171. package/dist/src/utils/openapi/zod-codegen.js +251 -0
  172. package/dist/src/utils/pikku-cli-config.d.ts +2 -2
  173. package/dist/src/utils/pikku-cli-config.js +8 -14
  174. package/dist/src/utils/pikku-files-and-methods.d.ts +1 -1
  175. package/dist/src/utils/pikku-files-and-methods.js +1 -1
  176. package/dist/src/utils/serialize-import-map.d.ts +2 -2
  177. package/dist/src/utils/serialize-import-map.js +1 -1
  178. package/dist/src/utils/serialize-meta-ts.js +1 -1
  179. package/dist/src/utils/serialize-schemas.d.ts +2 -2
  180. package/dist/tsconfig.tsbuildinfo +1 -1
  181. package/package.json +3 -3
  182. package/console-app/assets/index-C19L3UJu.js +0 -637
  183. package/dist/src/functions/wirings/functions/pikku-command-external-types.d.ts +0 -1
  184. package/dist/src/functions/wirings/functions/pikku-command-external-types.js +0 -33
  185. package/dist/src/functions/wirings/functions/serialize-external-types.d.ts +0 -1
@@ -1,8 +1,6 @@
1
1
  export const serializePublicAgent = (pathToPikkuTypes, requireAuth = true) => {
2
2
  const authFlag = requireAuth ? 'true' : 'false';
3
- return `import { pikkuSessionlessFunc, wireHTTP } from '${pathToPikkuTypes}'
4
- import { streamAIAgent, approveAIAgent } from '@pikku/core/ai-agent'
5
- import type { AIStreamChannel } from '@pikku/core/ai-agent'
3
+ return `import { pikkuSessionlessFunc, defineHTTPRoutes, wireHTTPRoutes } from '${pathToPikkuTypes}'
6
4
 
7
5
  export const agentCaller = pikkuSessionlessFunc<
8
6
  { agentName: string; message: string; threadId: string; resourceId: string },
@@ -10,7 +8,7 @@ export const agentCaller = pikkuSessionlessFunc<
10
8
  >({
11
9
  auth: ${authFlag},
12
10
  func: async (_services, data, { rpc }) => {
13
- return await (rpc.agent as any)(data.agentName, {
11
+ return await rpc.agent.run(data.agentName as any, {
14
12
  message: data.message,
15
13
  threadId: data.threadId,
16
14
  resourceId: data.resourceId,
@@ -23,13 +21,12 @@ export const agentStreamCaller = pikkuSessionlessFunc<
23
21
  void
24
22
  >({
25
23
  auth: ${authFlag},
26
- func: async (services, data, { channel }) => {
27
- await streamAIAgent(
28
- data.agentName,
29
- { message: data.message, threadId: data.threadId, resourceId: data.resourceId },
30
- channel as unknown as AIStreamChannel,
31
- { singletonServices: services }
32
- )
24
+ func: async (_services, data, { rpc }) => {
25
+ await rpc.agent.stream(data.agentName as any, {
26
+ message: data.message,
27
+ threadId: data.threadId,
28
+ resourceId: data.resourceId,
29
+ })
33
30
  },
34
31
  })
35
32
 
@@ -38,53 +35,34 @@ export const agentApproveCaller = pikkuSessionlessFunc<
38
35
  unknown
39
36
  >({
40
37
  auth: ${authFlag},
41
- func: async ({ aiRunState }, { runId, approvals, agentName }) => {
42
- if (!aiRunState) {
43
- throw new Error('AIRunStateService not available')
44
- }
45
- return await approveAIAgent(aiRunState, runId, approvals, agentName)
38
+ func: async (_services, { runId, approvals, agentName }, { rpc }) => {
39
+ return await rpc.agent.approve(runId, approvals, agentName)
46
40
  },
47
41
  })
48
42
 
49
- wireHTTP({
50
- route: '/rpc/agent/:agentName',
51
- method: 'options',
52
- tags: ['pikku:public'],
43
+ export const agentRoutes = defineHTTPRoutes({
53
44
  auth: ${authFlag},
54
- func: pikkuSessionlessFunc<{ agentName: string }>(async () => void 0),
55
- })
56
-
57
- wireHTTP({
58
- route: '/rpc/agent/:agentName',
59
- method: 'post',
60
45
  tags: ['pikku:public'],
61
- auth: ${authFlag},
62
- func: agentCaller,
63
- })
64
-
65
- wireHTTP({
66
- route: '/rpc/agent/:agentName/stream',
67
- method: 'options',
68
- tags: ['pikku:public'],
69
- auth: ${authFlag},
70
- func: pikkuSessionlessFunc<{ agentName: string }>(async () => void 0),
71
- })
72
-
73
- wireHTTP({
74
- route: '/rpc/agent/:agentName/stream',
75
- method: 'get',
76
- tags: ['pikku:public'],
77
- auth: ${authFlag},
78
- sse: true,
79
- func: agentStreamCaller,
46
+ routes: {
47
+ agentRun: {
48
+ route: '/rpc/agent/:agentName',
49
+ method: 'post',
50
+ func: agentCaller,
51
+ },
52
+ agentStream: {
53
+ route: '/rpc/agent/:agentName/stream',
54
+ method: 'post',
55
+ sse: true,
56
+ func: agentStreamCaller,
57
+ },
58
+ agentApprove: {
59
+ route: '/rpc/agent/:agentName/approve',
60
+ method: 'post',
61
+ func: agentApproveCaller,
62
+ },
63
+ },
80
64
  })
81
65
 
82
- wireHTTP({
83
- route: '/rpc/agent/:agentName/approve',
84
- method: 'post',
85
- tags: ['pikku:public'],
86
- auth: ${authFlag},
87
- func: agentApproveCaller,
88
- })
66
+ wireHTTPRoutes({ routes: { agent: agentRoutes } })
89
67
  `;
90
68
  };
@@ -15,7 +15,7 @@ export const pikkuChannels = pikkuVoidFunc({
15
15
  const importStatement = supportsImportAttributes
16
16
  ? `import metaData from '${jsonImportPath}' with { type: 'json' }`
17
17
  : `import metaData from '${jsonImportPath}'`;
18
- await writeFileInDir(logger, channelsWiringMetaFile, `import { pikkuState } from '@pikku/core'\nimport { ChannelsMeta } from '@pikku/core/channel'\n${importStatement}\npikkuState(null, 'channel', 'meta', metaData as ChannelsMeta)`);
18
+ await writeFileInDir(logger, channelsWiringMetaFile, `import { pikkuState } from '@pikku/core/internal'\nimport { ChannelsMeta } from '@pikku/core/channel'\n${importStatement}\npikkuState(null, 'channel', 'meta', metaData as ChannelsMeta)`);
19
19
  },
20
20
  middleware: [
21
21
  logCommandInfoAndTime({
@@ -5,9 +5,9 @@ import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-
5
5
  import { serializeChannelTypes } from './serialize-channel-types.js';
6
6
  export const pikkuChannelTypes = pikkuSessionlessFunc({
7
7
  func: async ({ logger, config }) => {
8
- const { channelsTypesFile, functionTypesFile, packageMappings, externalPackageName, } = config;
8
+ const { channelsTypesFile, functionTypesFile, packageMappings, addonName } = config;
9
9
  const functionTypesImportPath = getFileImportRelativePath(channelsTypesFile, functionTypesFile, packageMappings);
10
- const content = serializeChannelTypes(functionTypesImportPath, externalPackageName);
10
+ const content = serializeChannelTypes(functionTypesImportPath, addonName);
11
11
  await writeFileInDir(logger, channelsTypesFile, content);
12
12
  },
13
13
  middleware: [
@@ -24,7 +24,7 @@ export const pikkuChannels = pikkuSessionlessFunc({
24
24
  const importStatement = supportsImportAttributes
25
25
  ? `import metaData from '${jsonImportPath}' with { type: 'json' }`
26
26
  : `import metaData from '${jsonImportPath}'`;
27
- await writeFileInDir(logger, channelsWiringMetaFile, `import { pikkuState } from '@pikku/core'\nimport type { ChannelsMeta } from '@pikku/core/channel'\n${importStatement}\npikkuState(null, 'channel', 'meta', metaData as ChannelsMeta)`);
27
+ await writeFileInDir(logger, channelsWiringMetaFile, `import { pikkuState } from '@pikku/core/internal'\nimport type { ChannelsMeta } from '@pikku/core/channel'\n${importStatement}\npikkuState(null, 'channel', 'meta', metaData as ChannelsMeta)`);
28
28
  return true;
29
29
  },
30
30
  middleware: [
@@ -1,5 +1,5 @@
1
- import { ChannelsMeta } from '@pikku/core/channel';
2
- import { TypesMap } from '@pikku/inspector';
3
- import { FunctionsMeta } from '@pikku/core';
4
- import { Logger } from '@pikku/core/services';
1
+ import type { ChannelsMeta } from '@pikku/core/channel';
2
+ import type { TypesMap } from '@pikku/inspector';
3
+ import type { FunctionsMeta } from '@pikku/core';
4
+ import type { Logger } from '@pikku/core/services';
5
5
  export declare const serializeTypedChannelsMap: (logger: Logger, relativeToPath: string, packageMappings: Record<string, string>, typesMap: TypesMap, functionsMeta: FunctionsMeta, channelsMeta: ChannelsMeta) => string;
@@ -24,7 +24,7 @@ export const pikkuCLI = pikkuSessionlessFunc({
24
24
  const importStatement = supportsImportAttributes
25
25
  ? `import metaData from '${jsonImportPath}' with { type: 'json' }`
26
26
  : `import metaData from '${jsonImportPath}'`;
27
- await writeFileInDir(logger, cliWiringMetaFile, `import { pikkuState } from '@pikku/core'\nimport { CLIMeta } from '@pikku/core/cli'\n${importStatement}\npikkuState(null, 'cli', 'meta', metaData as CLIMeta)`);
27
+ await writeFileInDir(logger, cliWiringMetaFile, `import { pikkuState } from '@pikku/core/internal'\nimport { CLIMeta } from '@pikku/core/cli'\n${importStatement}\npikkuState(null, 'cli', 'meta', metaData as CLIMeta)`);
28
28
  return true;
29
29
  },
30
30
  middleware: [
@@ -1,5 +1,5 @@
1
- import { CLIProgramMeta } from '@pikku/core/cli';
2
- import { Config } from '../../../../types/application-types.js';
1
+ import type { CLIProgramMeta } from '@pikku/core/cli';
2
+ import type { Config } from '../../../../types/application-types.js';
3
3
  /**
4
4
  * Collect all unique renderer names from CLI metadata (populated by inspector)
5
5
  */
@@ -1,4 +1,4 @@
1
- import { CLIProgramMeta } from '@pikku/core/cli';
1
+ import type { CLIProgramMeta } from '@pikku/core/cli';
2
2
  /**
3
3
  * Serializes a wireChannel call from CLI metadata
4
4
  * This creates a WebSocket backend for all CLI commands
@@ -1,4 +1,4 @@
1
- import { Config } from '../../../../types/application-types.js';
1
+ import type { Config } from '../../../../types/application-types.js';
2
2
  /**
3
3
  * Serializes the local (in-program) CLI bootstrap code
4
4
  */
@@ -9,7 +9,8 @@ export const pikkuConsoleFunctions = pikkuSessionlessFunc({
9
9
  if (config.console?.functionsPath) {
10
10
  const consoleFunctionsPath = join(config.rootDir, config.console.functionsPath);
11
11
  const pathToPikkuTypes = getFileImportRelativePath(consoleFunctionsPath, config.typesDeclarationFile, config.packageMappings);
12
- await writeFileInDir(logger, consoleFunctionsPath, serializeConsoleFunctions(pathToPikkuTypes));
12
+ const pathToAgentTypes = getFileImportRelativePath(consoleFunctionsPath, config.agentTypesFile, config.packageMappings);
13
+ await writeFileInDir(logger, consoleFunctionsPath, serializeConsoleFunctions(pathToPikkuTypes, pathToAgentTypes));
13
14
  return true;
14
15
  }
15
16
  return false;
@@ -19,7 +19,7 @@ const loadIcon = async (iconPath, rootDir, logger) => {
19
19
  }
20
20
  return trimmed.replace(/<\?xml[^?]*\?>\s*/g, '').trim();
21
21
  }
22
- catch (e) {
22
+ catch {
23
23
  logger.warn(`Could not load icon: ${fullPath}`);
24
24
  return undefined;
25
25
  }
@@ -1 +1 @@
1
- export declare const serializeConsoleFunctions: (pathToPikkuTypes: string) => string;
1
+ export declare const serializeConsoleFunctions: (pathToPikkuTypes: string, _pathToAgentTypes: string) => string;
@@ -1,66 +1,12 @@
1
- export const serializeConsoleFunctions = (pathToPikkuTypes) => {
2
- return `import { pikkuSessionlessFunc, defineHTTPRoutes, wireHTTPRoutes, external } from '${pathToPikkuTypes}'
3
- import { streamAIAgent, resumeAIAgent } from '@pikku/core/ai-agent'
4
- import type { AIStreamChannel } from '@pikku/core/ai-agent'
1
+ export const serializeConsoleFunctions = (pathToPikkuTypes, _pathToAgentTypes) => {
2
+ return `import { pikkuSessionlessFunc, defineHTTPRoutes, wireHTTPRoutes, addon, wireAddon } from '${pathToPikkuTypes}'
5
3
 
6
- export const streamAgentRun = pikkuSessionlessFunc<
7
- { agentName: string; message: string; threadId: string; resourceId?: string },
8
- any
9
- >({
10
- title: 'Stream Agent Run',
11
- description: 'SSE stream of agent conversation responses.',
12
- expose: false,
13
- auth: false,
14
- func: async (services, data, { channel }) => {
15
- if (!channel) return
16
- await streamAIAgent(
17
- data.agentName,
18
- {
19
- message: data.message,
20
- threadId: data.threadId,
21
- resourceId: data.resourceId || 'console-playground',
22
- },
23
- channel as unknown as AIStreamChannel,
24
- { singletonServices: services }
25
- )
26
- },
27
- })
28
-
29
- export const resumeAgentRun = pikkuSessionlessFunc<
30
- {
31
- agentName: string
32
- toolCallId: string
33
- approved: boolean
34
- },
35
- any
36
- >({
37
- title: 'Resume Agent Run',
38
- description: 'Resume an agent run after tool approval/denial.',
39
- expose: false,
40
- auth: false,
41
- func: async (services, data, { channel }) => {
42
- if (!channel) return
43
- await resumeAIAgent(
44
- {
45
- toolCallId: data.toolCallId,
46
- approved: data.approved,
47
- },
48
- channel as unknown as AIStreamChannel,
49
- { singletonServices: services }
50
- )
51
- },
52
- })
53
-
54
- export interface SetSecretInput {
4
+ export const pikkuConsoleSetSecret = pikkuSessionlessFunc<{
55
5
  secretId: string
56
6
  value: unknown
57
- }
58
-
59
- export interface SetSecretOutput {
7
+ }, {
60
8
  success: boolean
61
- }
62
-
63
- export const setSecret = pikkuSessionlessFunc<SetSecretInput, SetSecretOutput>({
9
+ }>({
64
10
  description: 'Set the value of a secret',
65
11
  expose: true,
66
12
  auth: false,
@@ -70,18 +16,9 @@ export const setSecret = pikkuSessionlessFunc<SetSecretInput, SetSecretOutput>({
70
16
  },
71
17
  })
72
18
 
73
- export interface GetVariableInput {
74
- variableId: string
75
- }
76
-
77
- export interface GetVariableOutput {
78
- exists: boolean
79
- value: unknown | null
80
- }
81
-
82
- export const getVariable = pikkuSessionlessFunc<
83
- GetVariableInput,
84
- GetVariableOutput
19
+ export const pikkuConsoleGetVariable = pikkuSessionlessFunc<
20
+ { variableId: string },
21
+ { exists: boolean; value: unknown | null }
85
22
  >({
86
23
  description: 'Get the current value of a variable',
87
24
  expose: true,
@@ -101,18 +38,9 @@ export const getVariable = pikkuSessionlessFunc<
101
38
  },
102
39
  })
103
40
 
104
- export interface SetVariableInput {
105
- variableId: string
106
- value: unknown
107
- }
108
-
109
- export interface SetVariableOutput {
110
- success: boolean
111
- }
112
-
113
- export const setVariable = pikkuSessionlessFunc<
114
- SetVariableInput,
115
- SetVariableOutput
41
+ export const pikkuConsoleSetVariable = pikkuSessionlessFunc<
42
+ { variableId: string; value: unknown },
43
+ { success: boolean }
116
44
  >({
117
45
  description: 'Set the value of a variable',
118
46
  expose: true,
@@ -127,18 +55,9 @@ export const setVariable = pikkuSessionlessFunc<
127
55
  },
128
56
  })
129
57
 
130
- export interface GetSecretInput {
131
- secretId: string
132
- }
133
-
134
- export interface GetSecretOutput {
135
- exists: boolean
136
- value: unknown | null
137
- }
138
-
139
- export const getSecret = pikkuSessionlessFunc<
140
- GetSecretInput,
141
- GetSecretOutput
58
+ export const pikkuConsoleGetSecret = pikkuSessionlessFunc<
59
+ { secretId: string },
60
+ { exists: boolean; value: unknown | null }
142
61
  >({
143
62
  description: 'Get the current value of a secret',
144
63
  expose: true,
@@ -153,77 +72,19 @@ export const getSecret = pikkuSessionlessFunc<
153
72
  },
154
73
  })
155
74
 
156
- export interface StartWorkflowRunInput {
157
- workflowName: string
158
- input?: any
159
- }
160
-
161
- export interface StartWorkflowRunOutput {
162
- runId: string
163
- }
164
-
165
- export const startWorkflowRun = pikkuSessionlessFunc<
166
- StartWorkflowRunInput,
167
- StartWorkflowRunOutput
168
- >({
169
- title: 'Start Workflow Run',
170
- description: 'Starts a new workflow run by name with optional input.',
171
- expose: true,
172
- auth: false,
173
- func: async (_services, { workflowName, input }, { rpc }) => {
174
- return await (rpc as any).startWorkflow(workflowName, input || {})
175
- },
176
- })
177
-
178
75
  export const consoleRoutes = defineHTTPRoutes({
179
76
  auth: false,
180
77
  routes: {
181
- externalIconOptions: {
182
- route: '/external/icon/:alias',
183
- method: 'options',
184
- func: pikkuSessionlessFunc<{ alias: string }>(async () => void 0),
185
- },
186
- externalIcon: {
187
- route: '/external/icon/:alias',
188
- method: 'get',
189
- func: external('console:getExternalIcon'),
190
- },
191
- agentStreamOptions: {
192
- route: '/api/agents/:agentName/stream',
193
- method: 'options',
194
- func: pikkuSessionlessFunc<{ agentName: string }>(async () => void 0),
195
- },
196
- agentStream: {
197
- route: '/api/agents/:agentName/stream',
198
- method: 'post',
199
- sse: true,
200
- func: streamAgentRun,
201
- },
202
- agentResumeOptions: {
203
- route: '/api/agents/:agentName/resume',
204
- method: 'options',
205
- func: pikkuSessionlessFunc<{ agentName: string }>(async () => void 0),
206
- },
207
- agentResume: {
208
- route: '/api/agents/:agentName/resume',
209
- method: 'post',
210
- sse: true,
211
- func: resumeAgentRun,
212
- },
213
- workflowRunStreamOptions: {
214
- route: '/api/workflow-run/:runId/stream',
215
- method: 'options',
216
- func: pikkuSessionlessFunc<{ runId: string }>(async () => void 0),
217
- },
218
78
  workflowRunStream: {
219
- route: '/api/workflow-run/:runId/stream',
79
+ route: '/workflow-run/:runId/stream',
220
80
  method: 'get',
221
81
  sse: true,
222
- func: external('console:streamWorkflowRun'),
82
+ func: addon('console:streamWorkflowRun'),
223
83
  },
224
84
  },
225
85
  })
226
86
 
227
- wireHTTPRoutes({ routes: { console: consoleRoutes } })
87
+ wireAddon({ name: 'console', package: '@pikku/addon-console' })
88
+ wireHTTPRoutes({ baseRoute: '/api', routes: { console: consoleRoutes } })
228
89
  `;
229
90
  };
@@ -0,0 +1 @@
1
+ export declare const pikkuAddonTypes: import("#pikku").PikkuFunctionConfig<void, void, "session" | "rpc", import("#pikku").PikkuFunctionSessionless<void, void, "session" | "rpc", import("#pikku").Services> | import("#pikku").PikkuFunction<void, void, "session" | "rpc", import("#pikku").Services>, undefined, undefined>;
@@ -0,0 +1,33 @@
1
+ import { pikkuSessionlessFunc } from '#pikku';
2
+ import { getFileImportRelativePath } from '../../../utils/file-import-path.js';
3
+ import { checkRequiredTypes } from '../../../utils/check-required-types.js';
4
+ import { writeFileInDir } from '../../../utils/file-writer.js';
5
+ import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-time.js';
6
+ import { serializeAddonTypes } from './serialize-addon-types.js';
7
+ export const pikkuAddonTypes = pikkuSessionlessFunc({
8
+ func: async ({ logger, config, getInspectorState }) => {
9
+ if (!config.addon) {
10
+ return;
11
+ }
12
+ const visitState = await getInspectorState();
13
+ const { addonTypesFile, packageMappings, servicesFile, secretsFile, variablesFile, } = config;
14
+ checkRequiredTypes(visitState.filesAndMethodsErrors, {
15
+ singletonServicesType: true,
16
+ });
17
+ const { singletonServicesType, pikkuConfigType } = visitState.filesAndMethods;
18
+ if (!singletonServicesType) {
19
+ throw new Error('Required types not found');
20
+ }
21
+ const configTypeImport = pikkuConfigType
22
+ ? `import type { ${pikkuConfigType.type} } from '${getFileImportRelativePath(addonTypesFile, pikkuConfigType.typePath, packageMappings)}'`
23
+ : '// Config type not found, will use fallback';
24
+ const content = serializeAddonTypes(`import type { ${singletonServicesType.type} } from '${getFileImportRelativePath(addonTypesFile, singletonServicesType.typePath, packageMappings)}'`, singletonServicesType.type, configTypeImport, `import type { RequiredSingletonServices } from '${getFileImportRelativePath(addonTypesFile, servicesFile, packageMappings)}'`, `import { TypedSecretService } from '${getFileImportRelativePath(addonTypesFile, secretsFile, packageMappings)}'`, `import { TypedVariablesService } from '${getFileImportRelativePath(addonTypesFile, variablesFile, packageMappings)}'`);
25
+ await writeFileInDir(logger, addonTypesFile, content);
26
+ },
27
+ middleware: [
28
+ logCommandInfoAndTime({
29
+ commandStart: 'Creating addon types',
30
+ commandEnd: 'Created addon types',
31
+ }),
32
+ ],
33
+ });
@@ -21,7 +21,7 @@ export const pikkuFunctionTypesSplit = pikkuSessionlessFunc({
21
21
  const configTypeImport = pikkuConfigType
22
22
  ? `import type { ${pikkuConfigType.type} } from '${getFileImportRelativePath(functionTypesFile, pikkuConfigType.typePath, packageMappings)}'`
23
23
  : '// Config type not found, will use fallback';
24
- const content = serializeFunctionTypes(`import type { ${userSessionType.type} } from '${getFileImportRelativePath(functionTypesFile, userSessionType.typePath, packageMappings)}'`, userSessionType.type, `import type { ${singletonServicesType.type} } from '${getFileImportRelativePath(functionTypesFile, singletonServicesType.typePath, packageMappings)}'`, singletonServicesType.type, `import type { ${wireServicesType.type} } from '${getFileImportRelativePath(functionTypesFile, wireServicesType.typePath, packageMappings)}'`, wireServicesType.type, `import type { TypedPikkuRPC, FlattenedRPCMap } from '${getFileImportRelativePath(functionTypesFile, rpcInternalMapDeclarationFile, packageMappings)}'`, `import type { RequiredSingletonServices, RequiredWireServices } from '${getFileImportRelativePath(functionTypesFile, servicesFile, packageMappings)}'`, configTypeImport, config.externalPackageName, undefined, config.node?.categories);
24
+ const content = serializeFunctionTypes(`import type { ${userSessionType.type} } from '${getFileImportRelativePath(functionTypesFile, userSessionType.typePath, packageMappings)}'`, userSessionType.type, `import type { ${singletonServicesType.type} } from '${getFileImportRelativePath(functionTypesFile, singletonServicesType.typePath, packageMappings)}'`, singletonServicesType.type, `import type { ${wireServicesType.type} } from '${getFileImportRelativePath(functionTypesFile, wireServicesType.typePath, packageMappings)}'`, wireServicesType.type, `import type { TypedPikkuRPC, FlattenedRPCMap } from '${getFileImportRelativePath(functionTypesFile, rpcInternalMapDeclarationFile, packageMappings)}'`, `import type { RequiredSingletonServices, RequiredWireServices } from '${getFileImportRelativePath(functionTypesFile, servicesFile, packageMappings)}'`, configTypeImport, config.addonName, undefined, config.node?.categories);
25
25
  await writeFileInDir(logger, functionTypesFile, content);
26
26
  },
27
27
  middleware: [
@@ -5,13 +5,13 @@ import { logCommandInfoAndTime } from '../../../middleware/log-command-info-and-
5
5
  import { serializePikkuTypesHub } from './serialize-pikku-types-hub.js';
6
6
  export const pikkuFunctionTypes = pikkuSessionlessFunc({
7
7
  func: async ({ logger, config }) => {
8
- const { typesDeclarationFile: typesFile, packageMappings, functionTypesFile, httpTypesFile, channelsTypesFile, triggersTypesFile, schedulersTypesFile, queueTypesFile, mcpTypesFile, cliTypesFile, nodeTypesFile, secretTypesFile, externalTypesFile, } = config;
9
- const getImportPath = (file) => config.externalPackage
8
+ const { typesDeclarationFile: typesFile, packageMappings, functionTypesFile, httpTypesFile, channelsTypesFile, triggersTypesFile, schedulersTypesFile, queueTypesFile, mcpTypesFile, cliTypesFile, nodeTypesFile, secretTypesFile, addonTypesFile, } = config;
9
+ const getImportPath = (file) => config.addon
10
10
  ? null
11
11
  : getFileImportRelativePath(typesFile, file, packageMappings);
12
- // Node and trigger types are included for external packages
12
+ // Node and trigger types are included for addon packages
13
13
  const getAlwaysImportPath = (file) => getFileImportRelativePath(typesFile, file, packageMappings);
14
- const content = serializePikkuTypesHub(getFileImportRelativePath(typesFile, functionTypesFile, packageMappings), getImportPath(httpTypesFile), getImportPath(channelsTypesFile), getAlwaysImportPath(triggersTypesFile), getImportPath(schedulersTypesFile), getImportPath(queueTypesFile), getImportPath(mcpTypesFile), getImportPath(cliTypesFile), getAlwaysImportPath(nodeTypesFile), getAlwaysImportPath(secretTypesFile), config.externalPackage ? getAlwaysImportPath(externalTypesFile) : null);
14
+ const content = serializePikkuTypesHub(getFileImportRelativePath(typesFile, functionTypesFile, packageMappings), getImportPath(httpTypesFile), getImportPath(channelsTypesFile), getAlwaysImportPath(triggersTypesFile), getImportPath(schedulersTypesFile), getImportPath(queueTypesFile), getImportPath(mcpTypesFile), getImportPath(cliTypesFile), getAlwaysImportPath(nodeTypesFile), getAlwaysImportPath(secretTypesFile), config.addon ? getAlwaysImportPath(addonTypesFile) : null);
15
15
  await writeFileInDir(logger, typesFile, content);
16
16
  },
17
17
  middleware: [
@@ -21,24 +21,18 @@ export const pikkuFunctions = pikkuSessionlessFunc({
21
21
  const importStatement = supportsImportAttributes
22
22
  ? `import metaData from '${jsonImportPath}' with { type: 'json' }`
23
23
  : `import metaData from '${jsonImportPath}'`;
24
- const packageName = config.externalPackageName
25
- ? `'${config.externalPackageName}'`
26
- : 'null';
27
- await writeFileInDir(logger, functionsMetaFile, `import { pikkuState, FunctionsMeta } from '@pikku/core'\n${importStatement}\npikkuState(${packageName}, 'function', 'meta', metaData as FunctionsMeta)`);
28
- // For external packages, register ALL functions (they'll be invoked by consumers)
24
+ const packageName = config.addonName ? `'${config.addonName}'` : 'null';
25
+ await writeFileInDir(logger, functionsMetaFile, `import { pikkuState } from '@pikku/core/internal'\nimport type { FunctionsMeta } from '@pikku/core'\n${importStatement}\npikkuState(${packageName}, 'function', 'meta', metaData as FunctionsMeta)`);
26
+ // For addon packages, register ALL functions (they'll be invoked by consumers)
29
27
  // For main packages, only register functions that are invoked via internal RPCs
30
- const isExternalPackage = !!config.externalPackageName;
28
+ const isAddon = !!config.addonName;
31
29
  const hasRPCs = rpc.exposedFiles.size > 0 || rpc.internalFiles.size > 0;
32
30
  const hasFunctions = functions.files.size > 0;
33
- const shouldGenerateFunctionsFile = isExternalPackage
34
- ? hasFunctions
35
- : hasRPCs;
31
+ const shouldGenerateFunctionsFile = isAddon ? hasFunctions : hasRPCs;
36
32
  if (shouldGenerateFunctionsFile) {
37
- // For external packages, use all function files; for main packages, use internal RPC files
38
- const filesToRegister = isExternalPackage
39
- ? functions.files
40
- : rpc.internalFiles;
41
- await writeFileInDir(logger, functionsFile, serializeFunctionImports(functionsFile, filesToRegister, functions.meta, packageMappings, config.externalPackageName));
33
+ // For addon packages, use all function files; for main packages, use internal RPC files
34
+ const filesToRegister = isAddon ? functions.files : rpc.internalFiles;
35
+ await writeFileInDir(logger, functionsFile, serializeFunctionImports(functionsFile, filesToRegister, functions.meta, packageMappings, config.addonName));
42
36
  }
43
37
  return shouldGenerateFunctionsFile;
44
38
  },
@@ -7,7 +7,7 @@ export const pikkuSchemas = pikkuSessionlessFunc({
7
7
  if (Object.keys(visitState.schemas).length === 0) {
8
8
  return undefined;
9
9
  }
10
- await saveSchemas(logger, config.schemaDirectory, visitState.schemas, visitState.requiredSchemas, config.schema?.supportsImportAttributes ?? true, config.externalPackageName || null);
10
+ await saveSchemas(logger, config.schemaDirectory, visitState.schemas, visitState.requiredSchemas, config.schema?.supportsImportAttributes ?? true, config.addonName || null);
11
11
  return true;
12
12
  },
13
13
  middleware: [
@@ -0,0 +1 @@
1
+ export declare const serializeAddonTypes: (singletonServicesTypeImport: string, singletonServicesTypeName: string, configTypeImport: string, requiredServicesTypeImport: string, typedSecretServiceImport: string, typedVariablesServiceImport: string) => string;
@@ -1,8 +1,9 @@
1
- export const serializeExternalTypes = (singletonServicesTypeImport, singletonServicesTypeName, configTypeImport, requiredServicesTypeImport, typedSecretServiceImport, typedVariablesServiceImport) => {
1
+ export const serializeAddonTypes = (singletonServicesTypeImport, singletonServicesTypeName, configTypeImport, requiredServicesTypeImport, typedSecretServiceImport, typedVariablesServiceImport) => {
2
2
  return `/**
3
- * External package types for pikkuExternalConfig and pikkuExternalServices
3
+ * Addon package types for pikkuAddonConfig and pikkuAddonServices
4
4
  */
5
5
 
6
+ import type { CreateConfig } from '@pikku/core'
6
7
  ${singletonServicesTypeImport}
7
8
  ${configTypeImport}
8
9
  ${requiredServicesTypeImport}
@@ -13,40 +14,40 @@ ${singletonServicesTypeName !== 'SingletonServices' ? `type SingletonServices =
13
14
  ${configTypeImport.includes('Config type not found') ? 'type Config = any' : ''}
14
15
 
15
16
  /**
16
- * Base services provided to external package service factories.
17
+ * Base services provided to addon package service factories.
17
18
  * These are always available from the parent application.
18
19
  */
19
- export type ExternalBaseServices = {
20
+ export type AddonBaseServices = {
20
21
  logger: SingletonServices['logger']
21
22
  variables: TypedVariablesService
22
23
  secrets: TypedSecretService
23
24
  }
24
25
 
25
26
  /**
26
- * Creates a Pikku config factory for external packages.
27
- * Unlike pikkuConfig, this receives ExternalBaseServices (logger, variables, secrets)
28
- * from the parent application, so external packages can read variables/secrets during config creation.
27
+ * Creates a Pikku config factory for addon packages.
28
+ * Unlike pikkuConfig, this receives AddonBaseServices (logger, variables, secrets)
29
+ * from the parent application, so addon packages can read variables/secrets during config creation.
29
30
  */
30
- export const pikkuExternalConfig = <ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & ExternalBaseServices>(
31
+ export const pikkuAddonConfig = <ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & AddonBaseServices>(
31
32
  func: (services: ExistingServices) => Promise<Config>
32
- ) => {
33
- return async (_variables: any, existingServices?: Partial<SingletonServices>): Promise<Config> => {
33
+ ): CreateConfig<Config> => {
34
+ return (async (_variables: any, existingServices?: Partial<SingletonServices>): Promise<Config> => {
34
35
  const { secrets, variables, ...rest } = (existingServices ?? {}) as unknown as SingletonServices
35
36
  return func({ ...rest, secrets: new TypedSecretService(secrets), variables: new TypedVariablesService(variables) } as ExistingServices)
36
- }
37
+ }) as unknown as CreateConfig<Config>
37
38
  }
38
39
 
39
40
  /**
40
- * Creates a Pikku singleton services factory for external packages.
41
+ * Creates a Pikku singleton services factory for addon packages.
41
42
  * Unlike pikkuServices, this expects the parent application to provide
42
43
  * logger, variables, and secrets - no fallbacks needed.
43
44
  *
44
- * @param func - External services factory function that receives config and base services
45
+ * @param func - Addon services factory function that receives config and base services
45
46
  * @returns The singleton services factory function
46
47
  *
47
48
  * @example
48
49
  * \`\`\`typescript
49
- * export const createSingletonServices = pikkuExternalServices(async (
50
+ * export const createSingletonServices = pikkuAddonServices(async (
50
51
  * config,
51
52
  * { secrets }
52
53
  * ) => {
@@ -56,7 +57,7 @@ export const pikkuExternalConfig = <ExistingServices extends Omit<Partial<Single
56
57
  * })
57
58
  * \`\`\`
58
59
  */
59
- export const pikkuExternalServices = <T extends Record<string, any>, ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & ExternalBaseServices>(
60
+ export const pikkuAddonServices = <T extends Record<string, any>, ExistingServices extends Omit<Partial<SingletonServices>, 'variables' | 'secrets'> & AddonBaseServices>(
60
61
  func: (config: Config, services: ExistingServices) => Promise<T>
61
62
  ) => {
62
63
  return async (config: Config, existingServices?: Partial<SingletonServices>): Promise<RequiredSingletonServices> => {
@@ -1,7 +1,7 @@
1
- import { FunctionsMeta } from '@pikku/core';
1
+ import type { FunctionsMeta } from '@pikku/core';
2
2
  export declare const serializeFunctionImports: (outputPath: string, functionsMap: Map<string, {
3
3
  path: string;
4
4
  exportedName: string;
5
5
  }>, functionsMeta: FunctionsMeta, packageMappings?: Record<string, string>,
6
- /** Package name for external packages (e.g., '@pikku/templates-function-external') */
7
- externalPackageName?: string) => string;
6
+ /** Package name for addon packages (e.g., '@pikku/templates-function-addon') */
7
+ addonName?: string) => string;