@superdoc-dev/sdk 1.0.0-alpha.2 → 1.0.0-alpha.20

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 (67) hide show
  1. package/README.md +126 -0
  2. package/dist/generated/client.cjs +236 -0
  3. package/dist/generated/client.d.ts +6318 -0
  4. package/dist/generated/client.d.ts.map +1 -0
  5. package/dist/generated/client.js +231 -0
  6. package/dist/generated/contract.cjs +62387 -0
  7. package/dist/generated/contract.d.ts +45999 -0
  8. package/dist/generated/contract.d.ts.map +1 -0
  9. package/dist/generated/contract.js +62402 -0
  10. package/dist/helpers/format.d.ts +79 -0
  11. package/dist/helpers/format.d.ts.map +1 -0
  12. package/dist/helpers/format.js +121 -0
  13. package/dist/index.cjs +45 -0
  14. package/dist/index.d.ts +23 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +29 -0
  17. package/dist/runtime/embedded-cli.cjs +100 -0
  18. package/dist/runtime/embedded-cli.d.ts +5 -0
  19. package/dist/runtime/embedded-cli.d.ts.map +1 -0
  20. package/dist/runtime/embedded-cli.js +94 -0
  21. package/dist/runtime/errors.cjs +22 -0
  22. package/dist/runtime/errors.d.ts +17 -0
  23. package/dist/runtime/errors.d.ts.map +1 -0
  24. package/dist/runtime/errors.js +18 -0
  25. package/dist/runtime/host.cjs +352 -0
  26. package/dist/runtime/host.d.ts +37 -0
  27. package/dist/runtime/host.d.ts.map +1 -0
  28. package/dist/runtime/host.js +347 -0
  29. package/dist/runtime/process.cjs +32 -0
  30. package/dist/runtime/process.d.ts +16 -0
  31. package/dist/runtime/process.d.ts.map +1 -0
  32. package/dist/runtime/process.js +27 -0
  33. package/dist/runtime/transport-common.cjs +77 -0
  34. package/dist/runtime/transport-common.d.ts +49 -0
  35. package/dist/runtime/transport-common.d.ts.map +1 -0
  36. package/dist/runtime/transport-common.js +72 -0
  37. package/dist/skills.cjs +148 -0
  38. package/dist/skills.d.ts +25 -0
  39. package/dist/skills.d.ts.map +1 -0
  40. package/dist/skills.js +140 -0
  41. package/dist/tools.cjs +371 -0
  42. package/dist/tools.d.ts +113 -0
  43. package/dist/tools.d.ts.map +1 -0
  44. package/dist/tools.js +360 -0
  45. package/package.json +31 -18
  46. package/skills/editing-docx.md +24 -146
  47. package/tools/catalog.json +66563 -0
  48. package/tools/tool-name-map.json +382 -0
  49. package/tools/tools-policy.json +100 -0
  50. package/tools/tools.anthropic.json +27979 -0
  51. package/tools/tools.generic.json +64075 -0
  52. package/tools/tools.openai.json +29119 -0
  53. package/tools/tools.vercel.json +29119 -0
  54. package/LICENSE +0 -661
  55. package/skills/.gitkeep +0 -0
  56. package/src/__tests__/skills.test.ts +0 -93
  57. package/src/generated/DO_NOT_EDIT +0 -2
  58. package/src/generated/client.ts +0 -3151
  59. package/src/generated/contract.ts +0 -13396
  60. package/src/index.ts +0 -72
  61. package/src/runtime/__tests__/transport-common.test.ts +0 -151
  62. package/src/runtime/embedded-cli.ts +0 -109
  63. package/src/runtime/errors.ts +0 -30
  64. package/src/runtime/host.ts +0 -465
  65. package/src/runtime/process.ts +0 -45
  66. package/src/runtime/transport-common.ts +0 -159
  67. package/src/skills.ts +0 -91
@@ -1,93 +0,0 @@
1
- import { describe, expect, test } from 'bun:test';
2
- import { SuperDocCliError } from '../runtime/errors';
3
- import { getSkill, listSkills } from '../skills';
4
-
5
- describe('listSkills', () => {
6
- test('returns an array of skill names', () => {
7
- const skills = listSkills();
8
- expect(Array.isArray(skills)).toBe(true);
9
- expect(skills.length).toBeGreaterThan(0);
10
- });
11
-
12
- test('includes the editing-docx skill', () => {
13
- const skills = listSkills();
14
- expect(skills).toContain('editing-docx');
15
- });
16
-
17
- test('returns sorted results', () => {
18
- const skills = listSkills();
19
- const sorted = [...skills].sort();
20
- expect(skills).toEqual(sorted);
21
- });
22
-
23
- test('does not include file extensions', () => {
24
- const skills = listSkills();
25
- for (const name of skills) {
26
- expect(name).not.toContain('.md');
27
- }
28
- });
29
- });
30
-
31
- describe('getSkill', () => {
32
- test('returns content for a valid skill name', () => {
33
- const content = getSkill('editing-docx');
34
- expect(typeof content).toBe('string');
35
- expect(content.length).toBeGreaterThan(0);
36
- });
37
-
38
- test('throws INVALID_ARGUMENT for empty name', () => {
39
- expect(() => getSkill('')).toThrow(SuperDocCliError);
40
- try {
41
- getSkill('');
42
- } catch (error) {
43
- expect((error as SuperDocCliError).code).toBe('INVALID_ARGUMENT');
44
- }
45
- });
46
-
47
- test('throws INVALID_ARGUMENT for whitespace-only name', () => {
48
- expect(() => getSkill(' ')).toThrow(SuperDocCliError);
49
- try {
50
- getSkill(' ');
51
- } catch (error) {
52
- expect((error as SuperDocCliError).code).toBe('INVALID_ARGUMENT');
53
- }
54
- });
55
-
56
- test('throws INVALID_ARGUMENT for names with path traversal characters', () => {
57
- const maliciousNames = ['../etc/passwd', './local', 'foo/bar', 'a b c', 'skill.md'];
58
-
59
- for (const name of maliciousNames) {
60
- expect(() => getSkill(name)).toThrow(SuperDocCliError);
61
- try {
62
- getSkill(name);
63
- } catch (error) {
64
- expect((error as SuperDocCliError).code).toBe('INVALID_ARGUMENT');
65
- }
66
- }
67
- });
68
-
69
- test('throws SKILL_NOT_FOUND for nonexistent skill', () => {
70
- expect(() => getSkill('nonexistent-skill-name-xyz')).toThrow(SuperDocCliError);
71
- try {
72
- getSkill('nonexistent-skill-name-xyz');
73
- } catch (error) {
74
- const sdError = error as SuperDocCliError;
75
- expect(sdError.code).toBe('SKILL_NOT_FOUND');
76
- expect((sdError.details as { available: string[] }).available).toContain('editing-docx');
77
- }
78
- });
79
-
80
- test('accepts valid skill names with hyphens and underscores', () => {
81
- // These should not throw INVALID_ARGUMENT (they may throw SKILL_NOT_FOUND)
82
- const validNames = ['a', 'my-skill', 'my_skill', 'Skill1', '1skill'];
83
-
84
- for (const name of validNames) {
85
- try {
86
- getSkill(name);
87
- } catch (error) {
88
- // SKILL_NOT_FOUND is expected; INVALID_ARGUMENT means the regex is wrong
89
- expect((error as SuperDocCliError).code).not.toBe('INVALID_ARGUMENT');
90
- }
91
- }
92
- });
93
- });
@@ -1,2 +0,0 @@
1
- Files in this directory are auto-generated from the SDK contract.
2
- Do not edit them manually — run `pnpm run sdk:generate` instead.