@behavior-os/sdk 2.2.0 → 2.2.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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @behavior-os/sdk@2.2.0 build C:\www\behavior-os\packages\sdk
2
+ > @behavior-os/sdk@2.2.1 build /home/runner/work/behavior-os-governance/behavior-os-governance/packages/sdk
3
3
  > tsc -p tsconfig.build.json
4
4
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @behavior-os/sdk
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - fix(publish): ship installable manifests
8
+
9
+ The 2.2.0 tarballs were produced with `npm publish` from the workspace, so the
10
+ published manifests still contained `workspace:*` dependency ranges and npm
11
+ rejects the install with `EUNSUPPORTEDPROTOCOL: Unsupported URL Type
12
+ "workspace:"`. Republishing through `pnpm changeset publish` rewrites those
13
+ ranges to the real version.
14
+
15
+ `pnpm verify:publish` now packs every publishable package and fails when a
16
+ packed manifest still carries a `workspace:` range or declares a `bin`/`main`
17
+ target that is missing from the tarball. The release and tag workflows run it
18
+ before publishing, and it is part of `pnpm verify:all`.
19
+ - Updated dependencies
20
+ - @behavior-os/schemas@2.2.1
21
+ - @behavior-os/core@2.2.1
22
+
3
23
  ## 2.2.0
4
24
 
5
25
  ### Minor Changes
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2026 Ilvan Joaquim
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@behavior-os/sdk",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "description": "High-level TypeScript SDK for Behavior-OS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -11,18 +11,18 @@
11
11
  "types": "./dist/index.d.ts"
12
12
  }
13
13
  },
14
- "scripts": {
15
- "build": "tsc -p tsconfig.build.json",
16
- "test": "vitest run",
17
- "typecheck": "tsc --noEmit -p tsconfig.json",
18
- "clean": "node ../../scripts/clean.mjs"
19
- },
20
14
  "dependencies": {
21
- "@behavior-os/core": "workspace:*",
22
- "@behavior-os/schemas": "workspace:*"
15
+ "@behavior-os/core": "2.2.1",
16
+ "@behavior-os/schemas": "2.2.1"
23
17
  },
24
18
  "devDependencies": {
25
19
  "typescript": "~5.9.3",
26
20
  "vitest": "^4.1.11"
21
+ },
22
+ "scripts": {
23
+ "build": "tsc -p tsconfig.build.json",
24
+ "test": "vitest run",
25
+ "typecheck": "tsc --noEmit -p tsconfig.json",
26
+ "clean": "node ../../scripts/clean.mjs"
27
27
  }
28
- }
28
+ }
@@ -1,15 +0,0 @@
1
-
2
- > @behavior-os/sdk@2.1.0 test C:\www\behavior-os\packages\sdk
3
- > vitest run
4
-
5
-
6
-  RUN  v4.1.12 C:/www/behavior-os/packages/sdk
7
-
8
- ✓ tests/sdk-integration.test.ts (5 tests) 36ms
9
- ✓ tests/sdk.test.ts (10 tests) 57ms
10
-
11
-  Test Files  2 passed (2)
12
-  Tests  15 passed (15)
13
-  Start at  14:01:56
14
-  Duration  6.55s (transform 7.67s, setup 0ms, import 10.27s, tests 93ms, environment 1ms)
15
-
@@ -1,4 +0,0 @@
1
-
2
- > @behavior-os/sdk@2.1.0 typecheck C:\www\behavior-os\packages\sdk
3
- > tsc --noEmit -p tsconfig.json
4
-
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=sdk-integration.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk-integration.test.d.ts","sourceRoot":"","sources":["sdk-integration.test.ts"],"names":[],"mappings":""}
@@ -1,67 +0,0 @@
1
- import { beforeEach, describe, expect, it } from 'vitest';
2
- import { BehaviorOSSDK } from '../src/index.js';
3
-
4
- describe('BehaviorOSSDK Integration', () => {
5
- let sdk;
6
- beforeEach(() => {
7
- sdk = new BehaviorOSSDK();
8
- });
9
- it('should create and manage missions through SDK', () => {
10
- const mission = sdk.createMission({
11
- title: 'SDK Test Mission',
12
- type: 'feature',
13
- priority: 'high',
14
- dnaPattern: 'enterprise-governance',
15
- });
16
- expect(mission.id).toBeDefined();
17
- expect(mission.title).toBe('SDK Test Mission');
18
- const started = sdk.startMission(mission.id);
19
- expect(started?.status).toBe('active');
20
- });
21
- it('should evaluate governance through SDK', async () => {
22
- const dna = {
23
- name: 'Test DNA',
24
- version: '1.0.0',
25
- description: 'Test',
26
- personas: [],
27
- governance: [],
28
- quality: [],
29
- };
30
- await sdk.loadDNA(dna);
31
- const decision = sdk.evaluateGovernance('test-action', {
32
- agent: 'sdk-agent',
33
- context: {},
34
- });
35
- expect(decision.action).toBe('test-action');
36
- expect(decision.verdict).toBeDefined();
37
- });
38
- it('should record and retrieve learning through SDK', () => {
39
- sdk.recordLearning({
40
- type: 'insight',
41
- source: 'sdk-test',
42
- content: 'SDK learning test',
43
- impact: 'high',
44
- });
45
- const insights = sdk.getInsights(10);
46
- expect(insights.length).toBeGreaterThan(0);
47
- });
48
- it('should get status and state through SDK', () => {
49
- const status = sdk.getStatus();
50
- expect(status.engine).toBe(true);
51
- const state = sdk.getState();
52
- expect(state).toBeDefined();
53
- });
54
- it('should load DNA through SDK', async () => {
55
- const dna = {
56
- name: 'SDK DNA',
57
- version: '1.0.0',
58
- description: 'SDK test DNA',
59
- personas: [],
60
- governance: [],
61
- quality: [],
62
- };
63
- await sdk.loadDNA(dna);
64
- expect(sdk.getDNA()?.name).toBe('SDK DNA');
65
- });
66
- });
67
- //# sourceMappingURL=sdk-integration.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk-integration.test.js","sourceRoot":"","sources":["sdk-integration.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,QAAQ,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACzC,IAAI,GAAkB,CAAC;IAEvB,UAAU,CAAC,GAAG,EAAE;QACd,GAAG,GAAG,IAAI,aAAa,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+CAA+C,EAAE,GAAG,EAAE;QACvD,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,CAAC;YAChC,KAAK,EAAE,kBAAkB;YACzB,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,uBAAuB;SACpC,CAAC,CAAC;QAEH,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QACjC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAE/C,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;Q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AEjC,MAAM,KAAK,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC7B,MAAM,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IAC9B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC3C,MAAM,GAAG,GAAQ;YACf,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,OAAO;YAChB,WAAW,EAAE,cAAc;YAC3B,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,EAAE;YACd,OAAO,EAAE,EAAE;SACZ,CAAC;QAEF,MAAM,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACvB,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=sdk.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.test.d.ts","sourceRoot":"","sources":["sdk.test.ts"],"names":[],"mappings":""}
package/tests/sdk.test.js DELETED
@@ -1,75 +0,0 @@
1
- import { beforeEach, describe, expect, it } from 'vitest';
2
- import { BehaviorOSSDK } from '../src/index.js';
3
-
4
- describe('BehaviorOSSDK', () => {
5
- let sdk;
6
- beforeEach(() => {
7
- sdk = new BehaviorOSSDK();
8
- });
9
- it('should initialize with default config', () => {
10
- const status = sdk.getStatus();
11
- expect(status.engine).toBe(true);
12
- expect(status.dna).toBeNull();
13
- });
14
- it('should load DNA pattern', async () => {
15
- const dna = {
16
- name: 'Test DNA',
17
- version: '1.0.0',
18
- description: 'Test',
19
- personas: [],
20
- governance: [],
21
- quality: [],
22
- };
23
- await sdk.loadDNA(dna);
24
- expect(sdk.getDNA()).toEqual(dna);
25
- });
26
- it('should evaluate governance with DNA loaded', async () => {
27
- const dna = {
28
- name: 'Test DNA',
29
- version: '1.0.0',
30
- description: 'Test',
31
- personas: [],
32
- governance: [],
33
- quality: [],
34
- };
35
- await sdk.loadDNA(dna);
36
- const decision = sdk.evaluateGovernance('test-action', {
37
- agent: 'agent-1',
38
- context: {},
39
- });
40
- expect(decision.action).toBe('test-action');
41
- expect(decision.verdict).toBeDefined();
42
- expect(decision.timestamp).toBeDefined();
43
- });
44
- it('should create mission', () => {
45
- const mission = sdk.createMission({
46
- title: 'Test Mission',
47
- type: 'feature',
48
- priority: 'high',
49
- });
50
- expect(mission.id).toBeDefined();
51
- expect(mission.title).toBe('Test Mission');
52
- expect(mission.status).toBe('pending');
53
- });
54
- it('should record learning', () => {
55
- const event = sdk.recordLearning({
56
- type: 'insight',
57
- source: 'test',
58
- content: 'Test insight',
59
- impact: 'medium',
60
- });
61
- expect(event.id).toBeDefined();
62
- expect(event.content).toBe('Test insight');
63
- });
64
- it('should get insights after recording', () => {
65
- sdk.recordLearning({
66
- type: 'insight',
67
- source: 'test',
68
- content: 'Test insight',
69
- impact: 'high',
70
- });
71
- const insights = sdk.getInsights(10);
72
- expect(insights.length).toBeGreaterThan(0);
73
- });
74
- });
75
- //# sourceMappingURL=sdk.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdk.test.js","sourceRoot":"","sources":["sdk.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,GAAkB,CAAC;IAEvB,UAAU,CAAC,GAAG,EAAE;QACd,GAAG,GAAG,IAAI,aAAa,EAAE,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC/C,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,EAAE,CAAC;QAC/B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3
- //# sourceMappingURL=vitest.config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vitest.config.d.ts","sourceRoot":"","sources":["vitest.config.ts"],"names":[],"mappings":";AAGA,wBAYG"}
package/vitest.config.js DELETED
@@ -1,16 +0,0 @@
1
- import path from 'node:path';
2
- import { defineConfig } from 'vitest/config';
3
- export default defineConfig({
4
- test: {
5
- globals: true,
6
- environment: 'node',
7
- include: ['tests/**/*.test.ts'],
8
- },
9
- resolve: {
10
- alias: {
11
- '@behavior-os/core': path.resolve(__dirname, '../core/src/index.ts'),
12
- '@behavior-os/schemas': path.resolve(__dirname, '../schemas/src/index.ts'),
13
- },
14
- },
15
- });
16
- //# sourceMappingURL=vitest.config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"vitest.config.js","sourceRoot":"","sources":["vitest.config.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,eAAe,YAAY,CAAC;IAC1B,IAAI,EAAE;QACJ,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,MAAM;QACnB,OAAO,EAAE,CAAC,oBAAoB,CAAC;KAChC;IACD,OAAO,EAAE;QACP,KAAK,EAAE;YACL,mBAAmB,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,sBAAsB,CAAC;YACpE,sBAAsB,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,yBAAyB,CAAC;SAC3E;KACF;CACF,CAAC,CAAC"}