@cossistant/types 0.0.33 → 0.1.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.
- package/analytics.d.ts +31 -0
- package/analytics.d.ts.map +1 -0
- package/analytics.js +41 -0
- package/analytics.js.map +1 -0
- package/api/ai-agent-capabilities.d.ts +37 -0
- package/api/ai-agent-capabilities.d.ts.map +1 -0
- package/api/ai-agent-capabilities.js +432 -0
- package/api/ai-agent-capabilities.js.map +1 -0
- package/api/ai-agent.d.ts +224 -1
- package/api/ai-agent.d.ts.map +1 -1
- package/api/ai-agent.js +55 -1
- package/api/ai-agent.js.map +1 -1
- package/api/common.d.ts.map +1 -1
- package/api/conversation.d.ts +5 -5
- package/api/conversation.d.ts.map +1 -1
- package/api/index.d.ts +3 -2
- package/api/index.js +3 -2
- package/api/knowledge.d.ts.map +1 -1
- package/api/link-source.d.ts +4 -4
- package/api/link-source.d.ts.map +1 -1
- package/api/timeline-item.d.ts +6 -6
- package/api/timeline-item.d.ts.map +1 -1
- package/index.d.ts +5 -2
- package/index.d.ts.map +1 -1
- package/index.js +5 -2
- package/package.json +1 -1
- package/realtime-events.d.ts +4 -4
- package/schemas.d.ts +1 -1
- package/skill-file-format.d.ts +24 -0
- package/skill-file-format.d.ts.map +1 -0
- package/skill-file-format.js +119 -0
- package/skill-file-format.js.map +1 -0
- package/trpc/conversation.d.ts +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill-file-format.js","names":["name: string | undefined","description: string | undefined"],"sources":["../src/skill-file-format.ts"],"sourcesContent":["const FRONTMATTER_DELIMITER = \"---\";\nconst MARKDOWN_EXTENSION_REGEX = /\\.md$/i;\nconst DEFAULT_DESCRIPTION = \"Skill instructions\";\n\nexport type ParseSkillFileContentInput = {\n\tcontent: string;\n\tcanonicalFileName: string;\n\tfallbackDescription?: string;\n};\n\nexport type ParsedSkillFileContent = {\n\tname: string;\n\tdescription: string;\n\tbody: string;\n\thasFrontmatter: boolean;\n};\n\nexport type SerializeSkillFileContentInput = {\n\tname: string;\n\tdescription: string;\n\tbody: string;\n};\n\nfunction normalizeNewlines(value: string): string {\n\treturn value.replace(/\\r\\n/g, \"\\n\");\n}\n\nfunction trimYamlScalar(value: string): string {\n\tconst trimmed = value.trim();\n\n\tif (\n\t\t(trimmed.startsWith('\"') && trimmed.endsWith('\"')) ||\n\t\t(trimmed.startsWith(\"'\") && trimmed.endsWith(\"'\"))\n\t) {\n\t\treturn trimmed.slice(1, -1).trim();\n\t}\n\n\treturn trimmed;\n}\n\nfunction normalizeSkillDescription(value: string): string {\n\treturn value.replace(/\\s+/g, \" \").trim();\n}\n\nfunction splitFrontmatter(content: string): {\n\tfrontmatterLines: string[];\n\tbody: string;\n\thasFrontmatter: boolean;\n} {\n\tif (!content.startsWith(`${FRONTMATTER_DELIMITER}\\n`)) {\n\t\treturn { frontmatterLines: [], body: content, hasFrontmatter: false };\n\t}\n\n\tconst lines = content.split(\"\\n\");\n\tif (lines[0]?.trim() !== FRONTMATTER_DELIMITER) {\n\t\treturn { frontmatterLines: [], body: content, hasFrontmatter: false };\n\t}\n\n\tlet closingDelimiterIndex = -1;\n\tfor (let index = 1; index < lines.length; index += 1) {\n\t\tif (lines[index]?.trim() === FRONTMATTER_DELIMITER) {\n\t\t\tclosingDelimiterIndex = index;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (closingDelimiterIndex === -1) {\n\t\treturn { frontmatterLines: [], body: content, hasFrontmatter: false };\n\t}\n\n\tconst frontmatterLines = lines.slice(1, closingDelimiterIndex);\n\tconst body = lines.slice(closingDelimiterIndex + 1).join(\"\\n\");\n\n\treturn { frontmatterLines, body, hasFrontmatter: true };\n}\n\nfunction parseFrontmatterLines(frontmatterLines: string[]): {\n\tname?: string;\n\tdescription?: string;\n} | null {\n\tlet name: string | undefined;\n\tlet description: string | undefined;\n\n\tfor (const line of frontmatterLines) {\n\t\tconst trimmed = line.trim();\n\t\tif (!trimmed || trimmed.startsWith(\"#\")) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst separatorIndex = trimmed.indexOf(\":\");\n\t\tif (separatorIndex === -1) {\n\t\t\treturn null;\n\t\t}\n\n\t\tconst key = trimmed.slice(0, separatorIndex).trim();\n\t\tconst value = trimYamlScalar(trimmed.slice(separatorIndex + 1));\n\n\t\tif (key === \"name\") {\n\t\t\tname = value;\n\t\t}\n\n\t\tif (key === \"description\") {\n\t\t\tdescription = value;\n\t\t}\n\t}\n\n\treturn { name, description };\n}\n\nexport function stripSkillMarkdownExtension(value: string): string {\n\treturn value.trim().replace(MARKDOWN_EXTENSION_REGEX, \"\");\n}\n\nexport function deriveSkillDescriptionFromBody(body: string): string {\n\tconst lines = normalizeNewlines(body)\n\t\t.split(\"\\n\")\n\t\t.map((line) => line.trim())\n\t\t.filter(Boolean);\n\n\tconst firstLine =\n\t\tlines.find(\n\t\t\t(line) =>\n\t\t\t\tline !== FRONTMATTER_DELIMITER && !/^(name|description)\\s*:/i.test(line)\n\t\t) ?? \"\";\n\tif (!firstLine) {\n\t\treturn \"\";\n\t}\n\n\tconst normalized = firstLine\n\t\t.replace(/^#{1,6}\\s+/, \"\")\n\t\t.replace(/^[-*+]\\s+/, \"\")\n\t\t.replace(/^\\d+\\.\\s+/, \"\")\n\t\t.replace(/\\s+/g, \" \")\n\t\t.trim();\n\n\tif (!normalized) {\n\t\treturn \"\";\n\t}\n\n\tif (normalized.length <= 160) {\n\t\treturn normalized;\n\t}\n\n\treturn `${normalized.slice(0, 157)}...`;\n}\n\nexport function parseSkillFileContent(\n\tinput: ParseSkillFileContentInput\n): ParsedSkillFileContent {\n\tconst canonicalName = stripSkillMarkdownExtension(input.canonicalFileName);\n\tconst normalizedContent = normalizeNewlines(input.content);\n\tconst splitResult = splitFrontmatter(normalizedContent);\n\n\tif (splitResult.hasFrontmatter) {\n\t\tconst parsedFrontmatter = parseFrontmatterLines(\n\t\t\tsplitResult.frontmatterLines\n\t\t);\n\t\tif (parsedFrontmatter) {\n\t\t\tconst body = splitResult.body.replace(/^\\n+/, \"\");\n\t\t\tconst description =\n\t\t\t\tnormalizeSkillDescription(parsedFrontmatter.description ?? \"\") ||\n\t\t\t\tnormalizeSkillDescription(input.fallbackDescription ?? \"\") ||\n\t\t\t\tnormalizeSkillDescription(deriveSkillDescriptionFromBody(body)) ||\n\t\t\t\tDEFAULT_DESCRIPTION;\n\n\t\t\treturn {\n\t\t\t\tname: stripSkillMarkdownExtension(\n\t\t\t\t\tparsedFrontmatter.name ?? canonicalName\n\t\t\t\t),\n\t\t\t\tdescription,\n\t\t\t\tbody,\n\t\t\t\thasFrontmatter: true,\n\t\t\t};\n\t\t}\n\t}\n\n\tconst description =\n\t\tnormalizeSkillDescription(input.fallbackDescription ?? \"\") ||\n\t\tnormalizeSkillDescription(\n\t\t\tderiveSkillDescriptionFromBody(normalizedContent)\n\t\t) ||\n\t\tDEFAULT_DESCRIPTION;\n\n\treturn {\n\t\tname: canonicalName,\n\t\tdescription,\n\t\tbody: normalizedContent,\n\t\thasFrontmatter: false,\n\t};\n}\n\nexport function serializeSkillFileContent(\n\tinput: SerializeSkillFileContentInput\n): string {\n\tconst name = stripSkillMarkdownExtension(input.name);\n\tconst description =\n\t\tnormalizeSkillDescription(input.description) || DEFAULT_DESCRIPTION;\n\tconst body = normalizeNewlines(input.body).replace(/^\\n+/, \"\").trimEnd();\n\n\tif (!body) {\n\t\treturn [\n\t\t\tFRONTMATTER_DELIMITER,\n\t\t\t`name: ${name}`,\n\t\t\t`description: ${description}`,\n\t\t\tFRONTMATTER_DELIMITER,\n\t\t].join(\"\\n\");\n\t}\n\n\treturn [\n\t\tFRONTMATTER_DELIMITER,\n\t\t`name: ${name}`,\n\t\t`description: ${description}`,\n\t\tFRONTMATTER_DELIMITER,\n\t\t\"\",\n\t\tbody,\n\t].join(\"\\n\");\n}\n"],"mappings":";AAAA,MAAM,wBAAwB;AAC9B,MAAM,2BAA2B;AACjC,MAAM,sBAAsB;AAqB5B,SAA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O;IACN,MAAM,4BACL,kBAAkB,QAAQ,cAC1B;IACD;IACA;IACA,gBAAgB;IAChB;;;AAWH,QAAO;EACN,MAAM;EACN,aARA,0BAA0B,MAAM,uBAAuB,GAAG,IAC1D,0BACC,+BAA+B,kBAAkB,CACjD,IACD;EAKA,MAAM;EACN,gBAAgB;EAChB;;AAGF,SAAgB,0BACf,OACS;CACT,MAAM,OAAO,4BAA4B,MAAM,KAAK;CACpD,MAAM,cACL,0BAA0B,MAAM,YAAY,IAAI;CACjD,MAAM,OAAO,kBAAkB,MAAM,KAAK,CAAC,QAAQ,QAAQ,GAAG,CAAC,SAAS;AAExE,KAAI,CAAC,KACJ,QAAO;EACN;EACA,SAAS;EACT,gBAAgB;EAChB;EACA,CAAC,KAAK,KAAK;AAGb,QAAO;EACN;EACA,SAAS;EACT,gBAAgB;EAChB;EACA;EACA;EACA,CAAC,KAAK,KAAK"}
|
package/trpc/conversation.d.ts
CHANGED
|
@@ -369,8 +369,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
|
|
|
369
369
|
}, z.core.$strip>, z.ZodObject<{
|
|
370
370
|
type: z.ZodLiteral<"metadata">;
|
|
371
371
|
source: z.ZodEnum<{
|
|
372
|
-
email: "email";
|
|
373
372
|
widget: "widget";
|
|
373
|
+
email: "email";
|
|
374
374
|
api: "api";
|
|
375
375
|
}>;
|
|
376
376
|
}, z.core.$strip>]>>;
|
|
@@ -590,8 +590,8 @@ declare const conversationHeaderSchema: z.ZodObject<{
|
|
|
590
590
|
}, z.core.$strip>, z.ZodObject<{
|
|
591
591
|
type: z.ZodLiteral<"metadata">;
|
|
592
592
|
source: z.ZodEnum<{
|
|
593
|
-
email: "email";
|
|
594
593
|
widget: "widget";
|
|
594
|
+
email: "email";
|
|
595
595
|
api: "api";
|
|
596
596
|
}>;
|
|
597
597
|
}, z.core.$strip>]>>;
|
|
@@ -876,8 +876,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
|
|
|
876
876
|
}, z.core.$strip>, z.ZodObject<{
|
|
877
877
|
type: z.ZodLiteral<"metadata">;
|
|
878
878
|
source: z.ZodEnum<{
|
|
879
|
-
email: "email";
|
|
880
879
|
widget: "widget";
|
|
880
|
+
email: "email";
|
|
881
881
|
api: "api";
|
|
882
882
|
}>;
|
|
883
883
|
}, z.core.$strip>]>>;
|
|
@@ -1097,8 +1097,8 @@ declare const listConversationHeadersResponseSchema: z.ZodObject<{
|
|
|
1097
1097
|
}, z.core.$strip>, z.ZodObject<{
|
|
1098
1098
|
type: z.ZodLiteral<"metadata">;
|
|
1099
1099
|
source: z.ZodEnum<{
|
|
1100
|
-
email: "email";
|
|
1101
1100
|
widget: "widget";
|
|
1101
|
+
email: "email";
|
|
1102
1102
|
api: "api";
|
|
1103
1103
|
}>;
|
|
1104
1104
|
}, z.core.$strip>]>>;
|