@opengeni/contracts 3.0.2-canary.0 → 3.0.2-canary.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/contracts",
3
- "version": "3.0.2-canary.0",
3
+ "version": "3.0.2-canary.2",
4
4
  "description": "Shared zod schemas and wire-contract types for the OpenGeni API.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -18,6 +18,10 @@
18
18
  "module": "./dist/index.js",
19
19
  "types": "./dist/index.d.ts",
20
20
  "exports": {
21
+ "./plugin-discovery": {
22
+ "types": "./dist/plugin-discovery.d.ts",
23
+ "import": "./dist/plugin-discovery.js"
24
+ },
21
25
  "./host-mcp-bindings": {
22
26
  "types": "./dist/host-mcp-bindings.d.ts",
23
27
  "import": "./dist/host-mcp-bindings.js"
package/src/index.ts CHANGED
@@ -11414,6 +11414,7 @@ export const SkillImportFileSummary = z.object({
11414
11414
  export type SkillImportFileSummary = z.infer<typeof SkillImportFileSummary>;
11415
11415
 
11416
11416
  export const SkillImportPreview = z.object({
11417
+ markdown: z.string().max(262144).optional(),
11417
11418
  source: SkillImportSource,
11418
11419
  sourceUrl: z.string().url(),
11419
11420
  repositoryUrl: z.string().url(),
@@ -12147,6 +12148,7 @@ export const PluginInstallationSummary = z
12147
12148
  description: z.string().max(4000),
12148
12149
  category: z.string().min(1).max(100),
12149
12150
  tags: z.array(z.string().min(1).max(100)).max(64),
12151
+ logoUrl: z.string().url().max(2048).nullable().optional(),
12150
12152
  sourceUrl: z.string().url().max(2048).nullable(),
12151
12153
  manifestDigest: z.string().regex(/^[0-9a-f]{64}$/),
12152
12154
  installationVersion: z.number().int().positive(),
@@ -12322,6 +12324,17 @@ export const Session = /* @__PURE__ */ defineSkillContractSchema(() =>
12322
12324
  workspaceId: z.string().uuid(),
12323
12325
  accountId: z.string().uuid(),
12324
12326
  status: SessionStatus,
12327
+ /** Detail-only failure evidence through lastSequence; independent of timeline paging. */
12328
+ failureDiagnostics: z
12329
+ .object({
12330
+ eventId: z.string().uuid(),
12331
+ sequence: z.number().int().nonnegative(),
12332
+ turnId: z.string().uuid().nullable(),
12333
+ occurredAt: z.string(),
12334
+ payload: z.unknown(),
12335
+ })
12336
+ .nullable()
12337
+ .optional(),
12325
12338
  /** Additive list projection. Detail reads may omit it. */
12326
12339
  backgroundCommandActivity: SessionBackgroundCommandActivity.optional(),
12327
12340
  /** Current non-deleted schedules targeting this session, including paused schedules. */
@@ -16159,6 +16172,7 @@ export const MachineRuntimeCapabilities = z.object({
16159
16172
  browserBridge: z.boolean(),
16160
16173
  operationResourcePolicy: z.boolean(),
16161
16174
  operationCpuQuota: z.boolean(),
16175
+ transactionalFsWrite: z.boolean().default(false),
16162
16176
  });
16163
16177
  export type MachineRuntimeCapabilities = z.infer<typeof MachineRuntimeCapabilities>;
16164
16178
 
@@ -17099,3 +17113,7 @@ export * from "./remember";
17099
17113
  export * from "./agent-authored-durable-text";
17100
17114
 
17101
17115
  export * from "./feedback";
17116
+
17117
+ export type { PluginDiscoveryItem, PluginDiscoveryPage } from "./plugin-discovery";
17118
+ export { mcpEndpointIdentity } from "./mcp-endpoint";
17119
+ export { pluginMcpUnavailableReason } from "./mcp-endpoint";
@@ -0,0 +1,30 @@
1
+ /** Exact endpoint identity: normalize URL syntax, preserve paths and query parameters. */
2
+ export function mcpEndpointIdentity(value: string | null | undefined): string | null {
3
+ if (!value) return null;
4
+ try {
5
+ const url = new URL(value);
6
+ if (!["https:", "http:"].includes(url.protocol) || url.username || url.password) return null;
7
+ url.hash = "";
8
+ return url.href;
9
+ } catch {
10
+ return null;
11
+ }
12
+ }
13
+
14
+ export function pluginMcpUnavailableReason(server: {
15
+ endpoint: string | null;
16
+ transport?: string;
17
+ requiresConfiguration?: boolean;
18
+ }): string | null {
19
+ if (server.transport === "stdio" || !server.endpoint) return "Requires a local runtime";
20
+ if (
21
+ server.transport &&
22
+ !["http", "streamable-http", "streamable_http"].includes(server.transport)
23
+ )
24
+ return "Unsupported transport: " + server.transport;
25
+ if (server.requiresConfiguration || server.endpoint.includes("{"))
26
+ return "Requires custom connection configuration";
27
+ const endpoint = mcpEndpointIdentity(server.endpoint);
28
+ if (!endpoint?.startsWith("https://")) return "Requires a valid HTTPS endpoint";
29
+ return null;
30
+ }
@@ -0,0 +1,33 @@
1
+ /** Public discovery metadata; listing does not imply runtime compatibility. */
2
+ export { pluginMcpUnavailableReason } from "./mcp-endpoint";
3
+
4
+ export type PluginDiscoveryItem = {
5
+ id: string;
6
+ name: string;
7
+ displayName: string;
8
+ description: string;
9
+ longDescription: string;
10
+ provider: string;
11
+ category: string | null;
12
+ logoUrl: string | null;
13
+ darkLogoUrl: string | null;
14
+ sourceUrl: string | null;
15
+ author: { name?: string } | null;
16
+ version: string | null;
17
+ skills?: { name: string; sourceUrl: string }[] | null;
18
+ mcpServers?:
19
+ | {
20
+ name: string;
21
+ transport: string;
22
+ requiresConfiguration?: boolean;
23
+ endpoint: string | null;
24
+ }[]
25
+ | null;
26
+ components: string[] | null;
27
+ installation: string;
28
+ };
29
+ export type PluginDiscoveryPage = {
30
+ items: PluginDiscoveryItem[];
31
+ total: number;
32
+ nextOffset: number | null;
33
+ };
@@ -14,8 +14,12 @@ export function parseSkillFrontmatter(markdown: string): {
14
14
  uniqueKeys: true,
15
15
  prettyErrors: false,
16
16
  });
17
- if (document.errors.length || document.warnings.length)
18
- throw new Error("Skill artifact SKILL.md has invalid YAML frontmatter");
17
+ if (document.errors.length || document.warnings.length) {
18
+ const issue = document.errors[0] ?? document.warnings[0]!;
19
+ throw new Error(
20
+ `This skill's SKILL.md header contains invalid YAML: ${issue.message}. The source file needs correcting.`,
21
+ );
22
+ }
19
23
  const metadata: unknown = document.toJS({ maxAliasCount: 20 });
20
24
  if (!metadata || typeof metadata !== "object" || Array.isArray(metadata))
21
25
  throw new Error("Skill artifact SKILL.md frontmatter must be a mapping");