@ysk-kit/cli 1.2.1 → 1.2.3

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 (87) hide show
  1. package/dist/add-capability.js +2 -2
  2. package/dist/add-capability.js.map +1 -1
  3. package/dist/add-module.js +7 -7
  4. package/dist/add-module.js.map +1 -1
  5. package/dist/apply-capability.d.ts +1 -1
  6. package/dist/apply-capability.d.ts.map +1 -1
  7. package/dist/apply-capability.js +3 -3
  8. package/dist/apply-capability.js.map +1 -1
  9. package/dist/capability-catalog.d.ts +1 -1
  10. package/dist/capability-catalog.d.ts.map +1 -1
  11. package/dist/capability-catalog.js +11 -3
  12. package/dist/capability-catalog.js.map +1 -1
  13. package/dist/capability-patches.d.ts.map +1 -1
  14. package/dist/capability-patches.js +29 -46
  15. package/dist/capability-patches.js.map +1 -1
  16. package/dist/check-agent-guidance.d.ts.map +1 -1
  17. package/dist/check-agent-guidance.js +2 -1
  18. package/dist/check-agent-guidance.js.map +1 -1
  19. package/dist/check-agent.d.ts.map +1 -1
  20. package/dist/check-agent.js +2 -1
  21. package/dist/check-agent.js.map +1 -1
  22. package/dist/doctor.js +3 -3
  23. package/dist/doctor.js.map +1 -1
  24. package/dist/help.js +1 -1
  25. package/dist/help.js.map +1 -1
  26. package/dist/index.d.ts +1 -0
  27. package/dist/index.js +111 -86
  28. package/dist/index.js.map +1 -1
  29. package/dist/upgrade.js +1 -1
  30. package/dist/upgrade.js.map +1 -1
  31. package/package.json +4 -4
  32. package/templates/agent/nested/api.md +1 -0
  33. package/templates/agent/nested/contracts.md +1 -0
  34. package/templates/agent/rules/api-modules.mdc +1 -1
  35. package/templates/agent/rules/contracts.mdc +1 -1
  36. package/templates/agent/rules/desktop.mdc +9 -0
  37. package/templates/agent/rules/security.mdc +9 -0
  38. package/templates/agent/rules/tests.mdc +1 -1
  39. package/templates/agent/skills/add-capability/SKILL.md +9 -0
  40. package/templates/agent/skills/add-module/SKILL.md +9 -0
  41. package/templates/agent/skills/contract-change/SKILL.md +19 -0
  42. package/templates/agent/skills/db-migration/SKILL.md +17 -0
  43. package/templates/agent/skills/debug-issue/SKILL.md +18 -0
  44. package/templates/agent/skills/desktop-electron/SKILL.md +20 -0
  45. package/templates/agent/skills/envelope-api/SKILL.md +9 -0
  46. package/templates/agent/skills/fix-layers/SKILL.md +9 -0
  47. package/templates/agent/skills/llm-feature/SKILL.md +19 -0
  48. package/templates/agent/skills/new-product/SKILL.md +9 -0
  49. package/templates/agent/skills/plan-feature/SKILL.md +9 -0
  50. package/templates/agent/skills/review-change/SKILL.md +20 -0
  51. package/templates/agent/skills/security-review/SKILL.md +20 -0
  52. package/templates/agent/skills/test-plan/SKILL.md +9 -0
  53. package/templates/agent/skills/ui-design/SKILL.md +9 -0
  54. package/templates/agent/skills/ui-review/SKILL.md +9 -0
  55. package/templates/agent/skills/verify-change/SKILL.md +9 -0
  56. package/templates/agent/skills/webhook-handling/SKILL.md +20 -0
  57. package/templates/agent/skills/write-tests/SKILL.md +9 -0
  58. package/templates/agent/ysk-kit.mdc +1 -1
  59. package/templates/capabilities/billing/apps/api/src/modules/billing/application/billing-service.test.ts +56 -0
  60. package/templates/capabilities/billing/apps/api/src/modules/billing/application/billing-service.ts +71 -18
  61. package/templates/capabilities/billing/apps/api/src/modules/billing/domain/stripe-webhook-event.ts +12 -0
  62. package/templates/capabilities/billing/apps/api/src/modules/billing/domain/webhook-event-repository.ts +19 -0
  63. package/templates/capabilities/billing/apps/api/src/modules/billing/infra/billing.app.test.ts +172 -0
  64. package/templates/capabilities/billing/apps/api/src/modules/billing/infra/memory-webhook-event-repository.ts +31 -0
  65. package/templates/capabilities/billing/apps/api/src/modules/billing/infra/prisma-webhook-event-repository.ts +39 -0
  66. package/templates/capabilities/billing/apps/api/src/modules/billing/infra/stripe-billing.test.ts +3 -0
  67. package/templates/capabilities/billing/apps/api/src/modules/billing/infra/stripe-billing.ts +34 -7
  68. package/templates/capabilities/billing/packages/contracts/src/api/billing.ts +2 -2
  69. package/templates/capabilities/billing/packages/contracts/src/dto/billing.ts +1 -1
  70. package/templates/capabilities/billing/packages/sdk/src/resources/billing.ts +1 -1
  71. package/templates/capabilities/llm/apps/api/src/modules/llm/application/llm-service.test.ts +58 -0
  72. package/templates/capabilities/llm/apps/api/src/modules/llm/application/llm-service.ts +63 -36
  73. package/templates/capabilities/llm/apps/api/src/modules/llm/domain/usage-repository.ts +1 -0
  74. package/templates/capabilities/llm/apps/api/src/modules/llm/infra/llm.app.test.ts +49 -0
  75. package/templates/capabilities/llm/apps/api/src/modules/llm/infra/memory-usage-repository.ts +6 -3
  76. package/templates/capabilities/llm/apps/api/src/modules/llm/infra/prisma-usage-repository.ts +5 -0
  77. package/templates/capabilities/llm/packages/contracts/src/api/llm.ts +2 -2
  78. package/templates/capabilities/llm/packages/contracts/src/dto/llm.ts +8 -2
  79. package/templates/capabilities/llm/packages/sdk/src/resources/llm.ts +2 -2
  80. package/templates/capabilities/push/packages/contracts/src/api/devices.ts +2 -2
  81. package/templates/capabilities/push/packages/sdk/src/resources/devices.ts +1 -1
  82. package/templates/capabilities/team/packages/contracts/src/api/organizations.ts +2 -2
  83. package/templates/capabilities/team/packages/contracts/src/dto/organization.ts +1 -1
  84. package/templates/capabilities/team/packages/sdk/src/resources/organizations.ts +1 -1
  85. package/templates/module/api.ts.tmpl +3 -3
  86. package/templates/module/dto.ts.tmpl +1 -1
  87. package/templates/module/sdk-resource.ts.tmpl +1 -1
@@ -1,6 +1,6 @@
1
1
  import { initContract } from '@ts-rest/core';
2
- import { LlmCompleteCommandSchema, LlmCompleteDtoSchema, LlmModelsDtoSchema } from '../dto/llm';
3
- import { ErrSchema, OkSchema } from '../errors/envelope';
2
+ import { LlmCompleteCommandSchema, LlmCompleteDtoSchema, LlmModelsDtoSchema } from '../dto/llm.js';
3
+ import { ErrSchema, OkSchema } from '../errors/envelope.js';
4
4
 
5
5
  const c = initContract();
6
6
 
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { LlmRoleSchema } from '../enums/llm-role';
2
+ import { LlmClientRoleSchema, LlmRoleSchema } from '../enums/llm-role.js';
3
3
 
4
4
  export const LlmMessageSchema = z.object({
5
5
  role: LlmRoleSchema,
@@ -7,8 +7,14 @@ export const LlmMessageSchema = z.object({
7
7
  });
8
8
  export type LlmMessage = z.infer<typeof LlmMessageSchema>;
9
9
 
10
+ export const LlmClientMessageSchema = z.object({
11
+ role: LlmClientRoleSchema,
12
+ content: z.string().min(1).max(32_000),
13
+ });
14
+ export type LlmClientMessage = z.infer<typeof LlmClientMessageSchema>;
15
+
10
16
  export const LlmCompleteCommandSchema = z.object({
11
- messages: z.array(LlmMessageSchema).min(1).max(50),
17
+ messages: z.array(LlmClientMessageSchema).min(1).max(50),
12
18
  temperature: z.number().min(0).max(2).optional(),
13
19
  });
14
20
  export type LlmCompleteCommand = z.infer<typeof LlmCompleteCommandSchema>;
@@ -5,8 +5,8 @@ import type {
5
5
  LlmUsage,
6
6
  Platform,
7
7
  } from '@ysk-kit/contracts';
8
- import type { HttpClient } from '../http';
9
- import type { TokenStore } from '../token-store';
8
+ import type { HttpClient } from '../http.js';
9
+ import type { TokenStore } from '../token-store.js';
10
10
 
11
11
  export const llmResource = (
12
12
  http: HttpClient,
@@ -1,7 +1,7 @@
1
1
  import { initContract } from '@ts-rest/core';
2
2
  import { z } from 'zod';
3
- import { DeviceDtoSchema, RegisterDeviceCommandSchema } from '../dto/device';
4
- import { ErrSchema, OkSchema } from '../errors/envelope';
3
+ import { DeviceDtoSchema, RegisterDeviceCommandSchema } from '../dto/device.js';
4
+ import { ErrSchema, OkSchema } from '../errors/envelope.js';
5
5
 
6
6
  const c = initContract();
7
7
 
@@ -1,5 +1,5 @@
1
1
  import type { DeviceDto, RegisterDeviceCommand } from '@ysk-kit/contracts';
2
- import type { HttpClient } from '../http';
2
+ import type { HttpClient } from '../http.js';
3
3
 
4
4
  export const devicesResource = (http: HttpClient) => ({
5
5
  list: () => http.request<DeviceDto[]>('/v1/me/devices'),
@@ -9,8 +9,8 @@ import {
9
9
  OrganizationDtoSchema,
10
10
  OrgInviteDtoSchema,
11
11
  UpdateOrganizationCommandSchema,
12
- } from '../dto/organization';
13
- import { ErrSchema, OkSchema } from '../errors/envelope';
12
+ } from '../dto/organization.js';
13
+ import { ErrSchema, OkSchema } from '../errors/envelope.js';
14
14
 
15
15
  const c = initContract();
16
16
  const orgIdParams = z.object({ organizationId: z.string().uuid() });
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { InviteOrgRoleSchema, OrgRoleSchema } from '../enums/org-role';
2
+ import { InviteOrgRoleSchema, OrgRoleSchema } from '../enums/org-role.js';
3
3
 
4
4
  export const OrganizationDtoSchema = z.object({
5
5
  id: z.string().uuid(),
@@ -7,7 +7,7 @@ import type {
7
7
  OrgInviteDto,
8
8
  UpdateOrganizationCommand,
9
9
  } from '@ysk-kit/contracts';
10
- import type { HttpClient } from '../http';
10
+ import type { HttpClient } from '../http.js';
11
11
 
12
12
  export const organizationsResource = (http: HttpClient) => ({
13
13
  create: (body: CreateOrganizationCommand) =>
@@ -4,9 +4,9 @@ import {
4
4
  Create{{pascal}}CommandSchema,
5
5
  Paginated{{pascal}}Schema,
6
6
  {{pascal}}DtoSchema,
7
- } from '../dto/{{kebab}}';
8
- import { PageQuerySchema } from '../dto/user';
9
- import { ErrSchema, OkSchema } from '../errors/envelope';
7
+ } from '../dto/{{kebab}}.js';
8
+ import { PageQuerySchema } from '../dto/user.js';
9
+ import { ErrSchema, OkSchema } from '../errors/envelope.js';
10
10
 
11
11
  const c = initContract();
12
12
 
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { PaginatedSchema } from './user';
2
+ import { PaginatedSchema } from './user.js';
3
3
 
4
4
  export const {{pascal}}DtoSchema = z.object({
5
5
  id: z.string().uuid(),
@@ -1,5 +1,5 @@
1
1
  import type { Create{{pascal}}Command, Paginated{{pascal}}, {{pascal}}Dto } from '@ysk-kit/contracts';
2
- import type { HttpClient } from '../http';
2
+ import type { HttpClient } from '../http.js';
3
3
 
4
4
  const toQuery = (query?: { cursor?: string; limit?: number }): string => {
5
5
  const params = new URLSearchParams();