@saturn-universe/plugin-sdk 0.1.1 → 0.1.2-dev.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/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { AgentSessionId, ContextProvider, ContextProviderInput, JsonValue, LoggerPort, ProviderProfile, RuntimeHooks, ToolContext, ToolDefinition, ToolHandler, ToolRegistrationOptions } from '@saturn-universe/core';
2
2
  export type { ContextProviderInput, ToolContext };
3
3
  export declare const SATURN_PLUGIN_API_VERSION = 1;
4
- export declare const SATURN_PLUGIN_SDK_VERSION = "0.1.1";
4
+ export declare const SATURN_PLUGIN_SDK_VERSION = "0.1.2-dev.1";
5
5
  export declare const SUPPORTED_CORDIS_VERSION = "4.1.0";
6
6
  interface PluginV1 {
7
7
  readonly apiVersion: typeof SATURN_PLUGIN_API_VERSION;
package/dist/index.js CHANGED
@@ -1,6 +1,8 @@
1
+ import semver from 'semver';
1
2
  export const SATURN_PLUGIN_API_VERSION = 1;
2
- export const SATURN_PLUGIN_SDK_VERSION = '0.1.1';
3
+ export const SATURN_PLUGIN_SDK_VERSION = '0.1.2-dev.1';
3
4
  export const SUPPORTED_CORDIS_VERSION = '4.1.0';
5
+ const { major, minor } = new semver.SemVer(SATURN_PLUGIN_SDK_VERSION);
4
6
  export function defineSaturnPlugin(declaration) {
5
7
  return { ...declaration, kind: 'saturn-registrar', apiVersion: SATURN_PLUGIN_API_VERSION };
6
8
  }
@@ -16,17 +18,17 @@ export function validatePluginCompatibility(input) {
16
18
  message: `Expected Saturn plugin API ${SATURN_PLUGIN_API_VERSION}, received ${input.apiVersion}`,
17
19
  },
18
20
  };
19
- // SDK 0.1.1 uses the same plugin API as 0.1.0.
20
- if (input.sdkVersion !== undefined &&
21
- input.sdkVersion !== SATURN_PLUGIN_SDK_VERSION &&
22
- input.sdkVersion !== '0.1.0')
23
- return {
24
- ok: false,
25
- error: {
26
- code: 'PLUGIN_SDK_INCOMPATIBLE',
27
- message: `Expected Saturn plugin SDK ${SATURN_PLUGIN_SDK_VERSION} or 0.1.0, received ${input.sdkVersion}`,
28
- },
29
- };
21
+ if (input.sdkVersion !== undefined) {
22
+ const version = semver.parse(input.sdkVersion);
23
+ if (!version || version.major !== major || version.minor !== minor)
24
+ return {
25
+ ok: false,
26
+ error: {
27
+ code: 'PLUGIN_SDK_INCOMPATIBLE',
28
+ message: `Expected Saturn plugin SDK ${major}.${minor}.x, received ${input.sdkVersion}`,
29
+ },
30
+ };
31
+ }
30
32
  if (input.kind === 'cordis') {
31
33
  if (input.cordisVersion !== SUPPORTED_CORDIS_VERSION)
32
34
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saturn-universe/plugin-sdk",
3
- "version": "0.1.1",
3
+ "version": "0.1.2-dev.1",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "files": [
@@ -14,7 +14,11 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@saturn-universe/core": "0.1.1"
17
+ "@saturn-universe/core": "0.1.2-dev.1",
18
+ "semver": "7.8.6"
19
+ },
20
+ "devDependencies": {
21
+ "@types/semver": "7.8.0"
18
22
  },
19
23
  "peerDependencies": {
20
24
  "@deepseek-ai/cordis": "4.1.0"