@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.
- package/dist/add-capability.js +2 -2
- package/dist/add-capability.js.map +1 -1
- package/dist/add-module.js +7 -7
- package/dist/add-module.js.map +1 -1
- package/dist/apply-capability.d.ts +1 -1
- package/dist/apply-capability.d.ts.map +1 -1
- package/dist/apply-capability.js +3 -3
- package/dist/apply-capability.js.map +1 -1
- package/dist/capability-catalog.d.ts +1 -1
- package/dist/capability-catalog.d.ts.map +1 -1
- package/dist/capability-catalog.js +11 -3
- package/dist/capability-catalog.js.map +1 -1
- package/dist/capability-patches.d.ts.map +1 -1
- package/dist/capability-patches.js +29 -46
- package/dist/capability-patches.js.map +1 -1
- package/dist/check-agent-guidance.d.ts.map +1 -1
- package/dist/check-agent-guidance.js +2 -1
- package/dist/check-agent-guidance.js.map +1 -1
- package/dist/check-agent.d.ts.map +1 -1
- package/dist/check-agent.js +2 -1
- package/dist/check-agent.js.map +1 -1
- package/dist/doctor.js +3 -3
- package/dist/doctor.js.map +1 -1
- package/dist/help.js +1 -1
- package/dist/help.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +111 -86
- package/dist/index.js.map +1 -1
- package/dist/upgrade.js +1 -1
- package/dist/upgrade.js.map +1 -1
- package/package.json +4 -4
- package/templates/agent/nested/api.md +1 -0
- package/templates/agent/nested/contracts.md +1 -0
- package/templates/agent/rules/api-modules.mdc +1 -1
- package/templates/agent/rules/contracts.mdc +1 -1
- package/templates/agent/rules/desktop.mdc +9 -0
- package/templates/agent/rules/security.mdc +9 -0
- package/templates/agent/rules/tests.mdc +1 -1
- package/templates/agent/skills/add-capability/SKILL.md +9 -0
- package/templates/agent/skills/add-module/SKILL.md +9 -0
- package/templates/agent/skills/contract-change/SKILL.md +19 -0
- package/templates/agent/skills/db-migration/SKILL.md +17 -0
- package/templates/agent/skills/debug-issue/SKILL.md +18 -0
- package/templates/agent/skills/desktop-electron/SKILL.md +20 -0
- package/templates/agent/skills/envelope-api/SKILL.md +9 -0
- package/templates/agent/skills/fix-layers/SKILL.md +9 -0
- package/templates/agent/skills/llm-feature/SKILL.md +19 -0
- package/templates/agent/skills/new-product/SKILL.md +9 -0
- package/templates/agent/skills/plan-feature/SKILL.md +9 -0
- package/templates/agent/skills/review-change/SKILL.md +20 -0
- package/templates/agent/skills/security-review/SKILL.md +20 -0
- package/templates/agent/skills/test-plan/SKILL.md +9 -0
- package/templates/agent/skills/ui-design/SKILL.md +9 -0
- package/templates/agent/skills/ui-review/SKILL.md +9 -0
- package/templates/agent/skills/verify-change/SKILL.md +9 -0
- package/templates/agent/skills/webhook-handling/SKILL.md +20 -0
- package/templates/agent/skills/write-tests/SKILL.md +9 -0
- package/templates/agent/ysk-kit.mdc +1 -1
- package/templates/capabilities/billing/apps/api/src/modules/billing/application/billing-service.test.ts +56 -0
- package/templates/capabilities/billing/apps/api/src/modules/billing/application/billing-service.ts +71 -18
- package/templates/capabilities/billing/apps/api/src/modules/billing/domain/stripe-webhook-event.ts +12 -0
- package/templates/capabilities/billing/apps/api/src/modules/billing/domain/webhook-event-repository.ts +19 -0
- package/templates/capabilities/billing/apps/api/src/modules/billing/infra/billing.app.test.ts +172 -0
- package/templates/capabilities/billing/apps/api/src/modules/billing/infra/memory-webhook-event-repository.ts +31 -0
- package/templates/capabilities/billing/apps/api/src/modules/billing/infra/prisma-webhook-event-repository.ts +39 -0
- package/templates/capabilities/billing/apps/api/src/modules/billing/infra/stripe-billing.test.ts +3 -0
- package/templates/capabilities/billing/apps/api/src/modules/billing/infra/stripe-billing.ts +34 -7
- package/templates/capabilities/billing/packages/contracts/src/api/billing.ts +2 -2
- package/templates/capabilities/billing/packages/contracts/src/dto/billing.ts +1 -1
- package/templates/capabilities/billing/packages/sdk/src/resources/billing.ts +1 -1
- package/templates/capabilities/llm/apps/api/src/modules/llm/application/llm-service.test.ts +58 -0
- package/templates/capabilities/llm/apps/api/src/modules/llm/application/llm-service.ts +63 -36
- package/templates/capabilities/llm/apps/api/src/modules/llm/domain/usage-repository.ts +1 -0
- package/templates/capabilities/llm/apps/api/src/modules/llm/infra/llm.app.test.ts +49 -0
- package/templates/capabilities/llm/apps/api/src/modules/llm/infra/memory-usage-repository.ts +6 -3
- package/templates/capabilities/llm/apps/api/src/modules/llm/infra/prisma-usage-repository.ts +5 -0
- package/templates/capabilities/llm/packages/contracts/src/api/llm.ts +2 -2
- package/templates/capabilities/llm/packages/contracts/src/dto/llm.ts +8 -2
- package/templates/capabilities/llm/packages/sdk/src/resources/llm.ts +2 -2
- package/templates/capabilities/push/packages/contracts/src/api/devices.ts +2 -2
- package/templates/capabilities/push/packages/sdk/src/resources/devices.ts +1 -1
- package/templates/capabilities/team/packages/contracts/src/api/organizations.ts +2 -2
- package/templates/capabilities/team/packages/contracts/src/dto/organization.ts +1 -1
- package/templates/capabilities/team/packages/sdk/src/resources/organizations.ts +1 -1
- package/templates/module/api.ts.tmpl +3 -3
- package/templates/module/dto.ts.tmpl +1 -1
- 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(
|
|
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() });
|
|
@@ -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 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();
|