@desplega.ai/agent-swarm 1.79.0 → 1.79.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.
Files changed (43) hide show
  1. package/README.md +1 -0
  2. package/openapi.json +559 -1
  3. package/package.json +4 -4
  4. package/plugin/skills/kv-storage/SKILL.md +168 -0
  5. package/plugin/skills/pages/SKILL.md +149 -0
  6. package/src/artifact-sdk/browser-sdk.ts +292 -0
  7. package/src/be/db.ts +309 -0
  8. package/src/be/migrations/061_kv_store.sql +34 -0
  9. package/src/be/migrations/062_pages_view_count.sql +9 -0
  10. package/src/commands/provider-credentials.ts +1 -1
  11. package/src/http/index.ts +2 -0
  12. package/src/http/kv.ts +658 -0
  13. package/src/http/page-proxy.ts +5 -0
  14. package/src/http/pages-public.ts +44 -3
  15. package/src/http/status.ts +1 -1
  16. package/src/providers/pi-mono-adapter.ts +3 -3
  17. package/src/providers/pi-mono-extension.ts +1 -1
  18. package/src/server.ts +20 -1
  19. package/src/tasks/context-key.ts +28 -0
  20. package/src/telemetry.ts +65 -1
  21. package/src/tests/context-key.test.ts +17 -0
  22. package/src/tests/kv-http.test.ts +331 -0
  23. package/src/tests/kv-namespace-resolution.test.ts +172 -0
  24. package/src/tests/kv-page-proxy.test.ts +212 -0
  25. package/src/tests/kv-storage.test.ts +227 -0
  26. package/src/tests/kv-tool.test.ts +217 -0
  27. package/src/tests/page-proxy.test.ts +5 -1
  28. package/src/tests/page-session.test.ts +10 -5
  29. package/src/tests/pages-authed-mode.test.ts +5 -1
  30. package/src/tests/pages-view-count.test.ts +220 -0
  31. package/src/tests/swarm-diff.test.ts +303 -0
  32. package/src/tests/telemetry-init.test.ts +149 -0
  33. package/src/tools/kv/index.ts +5 -0
  34. package/src/tools/kv/kv-delete.ts +89 -0
  35. package/src/tools/kv/kv-get.ts +64 -0
  36. package/src/tools/kv/kv-incr.ts +116 -0
  37. package/src/tools/kv/kv-list.ts +81 -0
  38. package/src/tools/kv/kv-set.ts +194 -0
  39. package/src/tools/kv/resolve-namespace.ts +58 -0
  40. package/src/tools/tool-config.ts +7 -0
  41. package/src/types.ts +53 -0
  42. package/src/utils/internal-ai/complete-structured.ts +2 -2
  43. package/src/utils/internal-ai/credentials.ts +3 -3
package/README.md CHANGED
@@ -91,6 +91,7 @@ flowchart LR
91
91
  - **Scheduled & recurring tasks** — cron-based automation for standing work. [Scheduling →](https://docs.agent-swarm.dev/docs/concepts/scheduling)
92
92
  - **Multi-provider** — run with Claude Code, OpenAI Codex, pi-mono, Devin, Claude Managed Agents, or opencode. [Harness config →](https://docs.agent-swarm.dev/docs/guides/harness-configuration) · [Add a new provider →](https://docs.agent-swarm.dev/docs/guides/harness-providers)
93
93
  - **Skills & MCP servers** — reusable procedural knowledge and per-agent MCP servers with scope cascade. [MCP tools →](https://docs.agent-swarm.dev/docs/reference/mcp-tools)
94
+ - **DB-backed pages** — agents publish HTML or JSON pages (reports, dashboards, action specs) via the `create_page` MCP tool with public / authed / password modes and version history. [MCP tools → Pages](https://docs.agent-swarm.dev/docs/reference/mcp-tools#pages-tools)
94
95
  - **Real-time dashboard** — monitor agents, tasks, and inter-agent chat. [app.agent-swarm.dev →](https://app.agent-swarm.dev)
95
96
 
96
97
  ## Quick Start
package/openapi.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "openapi": "3.1.0",
3
3
  "info": {
4
4
  "title": "Agent Swarm API",
5
- "version": "1.79.0",
5
+ "version": "1.79.1",
6
6
  "description": "Multi-agent orchestration API for Claude Code, Codex, and Gemini CLI. Enables task distribution, agent communication, and service discovery.\n\nMCP tools are documented separately in [MCP.md](./MCP.md)."
7
7
  },
8
8
  "servers": [
@@ -3332,6 +3332,564 @@
3332
3332
  }
3333
3333
  }
3334
3334
  },
3335
+ "/api/kv/{key}": {
3336
+ "get": {
3337
+ "summary": "Get a KV entry by key (namespace resolved from request headers)",
3338
+ "tags": [
3339
+ "KV"
3340
+ ],
3341
+ "security": [
3342
+ {
3343
+ "bearerAuth": []
3344
+ }
3345
+ ],
3346
+ "parameters": [
3347
+ {
3348
+ "schema": {
3349
+ "type": "string",
3350
+ "minLength": 1,
3351
+ "maxLength": 512,
3352
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3353
+ },
3354
+ "required": true,
3355
+ "name": "key",
3356
+ "in": "path"
3357
+ }
3358
+ ],
3359
+ "responses": {
3360
+ "200": {
3361
+ "description": "KV entry"
3362
+ },
3363
+ "400": {
3364
+ "description": "Validation error or unresolvable namespace"
3365
+ },
3366
+ "404": {
3367
+ "description": "KV entry not found or expired"
3368
+ }
3369
+ }
3370
+ },
3371
+ "put": {
3372
+ "summary": "Upsert a KV entry by key (namespace resolved from request headers)",
3373
+ "tags": [
3374
+ "KV"
3375
+ ],
3376
+ "security": [
3377
+ {
3378
+ "bearerAuth": []
3379
+ }
3380
+ ],
3381
+ "parameters": [
3382
+ {
3383
+ "schema": {
3384
+ "type": "string",
3385
+ "minLength": 1,
3386
+ "maxLength": 512,
3387
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3388
+ },
3389
+ "required": true,
3390
+ "name": "key",
3391
+ "in": "path"
3392
+ }
3393
+ ],
3394
+ "requestBody": {
3395
+ "content": {
3396
+ "application/json": {
3397
+ "schema": {
3398
+ "type": "object",
3399
+ "properties": {
3400
+ "value": {},
3401
+ "valueType": {
3402
+ "type": "string",
3403
+ "enum": [
3404
+ "json",
3405
+ "string",
3406
+ "integer"
3407
+ ]
3408
+ },
3409
+ "expiresInSec": {
3410
+ "type": "integer",
3411
+ "exclusiveMinimum": 0
3412
+ }
3413
+ }
3414
+ }
3415
+ }
3416
+ }
3417
+ },
3418
+ "responses": {
3419
+ "200": {
3420
+ "description": "KV entry stored"
3421
+ },
3422
+ "400": {
3423
+ "description": "Validation error"
3424
+ },
3425
+ "403": {
3426
+ "description": "Caller may not write this namespace"
3427
+ },
3428
+ "409": {
3429
+ "description": "INCR collision: existing value_type is not 'integer'"
3430
+ },
3431
+ "413": {
3432
+ "description": "Body exceeds 2 MiB"
3433
+ }
3434
+ }
3435
+ },
3436
+ "delete": {
3437
+ "summary": "Delete a KV entry by key (namespace resolved from request headers)",
3438
+ "tags": [
3439
+ "KV"
3440
+ ],
3441
+ "security": [
3442
+ {
3443
+ "bearerAuth": []
3444
+ }
3445
+ ],
3446
+ "parameters": [
3447
+ {
3448
+ "schema": {
3449
+ "type": "string",
3450
+ "minLength": 1,
3451
+ "maxLength": 512,
3452
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3453
+ },
3454
+ "required": true,
3455
+ "name": "key",
3456
+ "in": "path"
3457
+ }
3458
+ ],
3459
+ "responses": {
3460
+ "204": {
3461
+ "description": "KV entry deleted"
3462
+ },
3463
+ "400": {
3464
+ "description": "Validation error or unresolvable namespace"
3465
+ },
3466
+ "403": {
3467
+ "description": "Caller may not write this namespace"
3468
+ },
3469
+ "404": {
3470
+ "description": "KV entry not found"
3471
+ }
3472
+ }
3473
+ }
3474
+ },
3475
+ "/api/kv/{key}/incr": {
3476
+ "post": {
3477
+ "summary": "Atomically increment an integer KV entry (header-resolved namespace)",
3478
+ "tags": [
3479
+ "KV"
3480
+ ],
3481
+ "security": [
3482
+ {
3483
+ "bearerAuth": []
3484
+ }
3485
+ ],
3486
+ "parameters": [
3487
+ {
3488
+ "schema": {
3489
+ "type": "string",
3490
+ "minLength": 1,
3491
+ "maxLength": 512,
3492
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3493
+ },
3494
+ "required": true,
3495
+ "name": "key",
3496
+ "in": "path"
3497
+ }
3498
+ ],
3499
+ "requestBody": {
3500
+ "content": {
3501
+ "application/json": {
3502
+ "schema": {
3503
+ "type": [
3504
+ "object",
3505
+ "null"
3506
+ ],
3507
+ "properties": {
3508
+ "by": {
3509
+ "type": "integer"
3510
+ }
3511
+ }
3512
+ }
3513
+ }
3514
+ }
3515
+ },
3516
+ "responses": {
3517
+ "200": {
3518
+ "description": "KV entry stored"
3519
+ },
3520
+ "400": {
3521
+ "description": "Validation error"
3522
+ },
3523
+ "403": {
3524
+ "description": "Caller may not write this namespace"
3525
+ },
3526
+ "409": {
3527
+ "description": "INCR collision: existing value_type is not 'integer'"
3528
+ },
3529
+ "413": {
3530
+ "description": "Body exceeds 2 MiB"
3531
+ }
3532
+ }
3533
+ }
3534
+ },
3535
+ "/api/kv": {
3536
+ "get": {
3537
+ "summary": "List KV entries in the header-resolved namespace",
3538
+ "tags": [
3539
+ "KV"
3540
+ ],
3541
+ "security": [
3542
+ {
3543
+ "bearerAuth": []
3544
+ }
3545
+ ],
3546
+ "parameters": [
3547
+ {
3548
+ "schema": {
3549
+ "type": "string"
3550
+ },
3551
+ "required": false,
3552
+ "name": "prefix",
3553
+ "in": "query"
3554
+ },
3555
+ {
3556
+ "schema": {
3557
+ "type": "integer",
3558
+ "exclusiveMinimum": 0,
3559
+ "maximum": 1000
3560
+ },
3561
+ "required": false,
3562
+ "name": "limit",
3563
+ "in": "query"
3564
+ },
3565
+ {
3566
+ "schema": {
3567
+ "type": [
3568
+ "integer",
3569
+ "null"
3570
+ ],
3571
+ "minimum": 0
3572
+ },
3573
+ "required": false,
3574
+ "name": "offset",
3575
+ "in": "query"
3576
+ }
3577
+ ],
3578
+ "responses": {
3579
+ "200": {
3580
+ "description": "KV entries in the resolved namespace"
3581
+ },
3582
+ "400": {
3583
+ "description": "Validation error or unresolvable namespace"
3584
+ }
3585
+ }
3586
+ }
3587
+ },
3588
+ "/api/kv/_/{namespace}/{key}": {
3589
+ "get": {
3590
+ "summary": "Get a KV entry by explicit namespace + key",
3591
+ "tags": [
3592
+ "KV"
3593
+ ],
3594
+ "security": [
3595
+ {
3596
+ "bearerAuth": []
3597
+ }
3598
+ ],
3599
+ "parameters": [
3600
+ {
3601
+ "schema": {
3602
+ "type": "string",
3603
+ "minLength": 1,
3604
+ "maxLength": 512,
3605
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3606
+ },
3607
+ "required": true,
3608
+ "name": "namespace",
3609
+ "in": "path"
3610
+ },
3611
+ {
3612
+ "schema": {
3613
+ "type": "string",
3614
+ "minLength": 1,
3615
+ "maxLength": 512,
3616
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3617
+ },
3618
+ "required": true,
3619
+ "name": "key",
3620
+ "in": "path"
3621
+ }
3622
+ ],
3623
+ "responses": {
3624
+ "200": {
3625
+ "description": "KV entry"
3626
+ },
3627
+ "400": {
3628
+ "description": "Validation error or unresolvable namespace"
3629
+ },
3630
+ "404": {
3631
+ "description": "KV entry not found or expired"
3632
+ }
3633
+ }
3634
+ },
3635
+ "put": {
3636
+ "summary": "Upsert a KV entry by explicit namespace + key",
3637
+ "tags": [
3638
+ "KV"
3639
+ ],
3640
+ "security": [
3641
+ {
3642
+ "bearerAuth": []
3643
+ }
3644
+ ],
3645
+ "parameters": [
3646
+ {
3647
+ "schema": {
3648
+ "type": "string",
3649
+ "minLength": 1,
3650
+ "maxLength": 512,
3651
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3652
+ },
3653
+ "required": true,
3654
+ "name": "namespace",
3655
+ "in": "path"
3656
+ },
3657
+ {
3658
+ "schema": {
3659
+ "type": "string",
3660
+ "minLength": 1,
3661
+ "maxLength": 512,
3662
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3663
+ },
3664
+ "required": true,
3665
+ "name": "key",
3666
+ "in": "path"
3667
+ }
3668
+ ],
3669
+ "requestBody": {
3670
+ "content": {
3671
+ "application/json": {
3672
+ "schema": {
3673
+ "type": "object",
3674
+ "properties": {
3675
+ "value": {},
3676
+ "valueType": {
3677
+ "type": "string",
3678
+ "enum": [
3679
+ "json",
3680
+ "string",
3681
+ "integer"
3682
+ ]
3683
+ },
3684
+ "expiresInSec": {
3685
+ "type": "integer",
3686
+ "exclusiveMinimum": 0
3687
+ }
3688
+ }
3689
+ }
3690
+ }
3691
+ }
3692
+ },
3693
+ "responses": {
3694
+ "200": {
3695
+ "description": "KV entry stored"
3696
+ },
3697
+ "400": {
3698
+ "description": "Validation error"
3699
+ },
3700
+ "403": {
3701
+ "description": "Caller may not write this namespace"
3702
+ },
3703
+ "409": {
3704
+ "description": "INCR collision: existing value_type is not 'integer'"
3705
+ },
3706
+ "413": {
3707
+ "description": "Body exceeds 2 MiB"
3708
+ }
3709
+ }
3710
+ },
3711
+ "delete": {
3712
+ "summary": "Delete a KV entry by explicit namespace + key",
3713
+ "tags": [
3714
+ "KV"
3715
+ ],
3716
+ "security": [
3717
+ {
3718
+ "bearerAuth": []
3719
+ }
3720
+ ],
3721
+ "parameters": [
3722
+ {
3723
+ "schema": {
3724
+ "type": "string",
3725
+ "minLength": 1,
3726
+ "maxLength": 512,
3727
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3728
+ },
3729
+ "required": true,
3730
+ "name": "namespace",
3731
+ "in": "path"
3732
+ },
3733
+ {
3734
+ "schema": {
3735
+ "type": "string",
3736
+ "minLength": 1,
3737
+ "maxLength": 512,
3738
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3739
+ },
3740
+ "required": true,
3741
+ "name": "key",
3742
+ "in": "path"
3743
+ }
3744
+ ],
3745
+ "responses": {
3746
+ "204": {
3747
+ "description": "KV entry deleted"
3748
+ },
3749
+ "403": {
3750
+ "description": "Caller may not write this namespace"
3751
+ },
3752
+ "404": {
3753
+ "description": "KV entry not found"
3754
+ }
3755
+ }
3756
+ }
3757
+ },
3758
+ "/api/kv/_/{namespace}/{key}/incr": {
3759
+ "post": {
3760
+ "summary": "Atomically increment an integer KV entry (explicit namespace)",
3761
+ "tags": [
3762
+ "KV"
3763
+ ],
3764
+ "security": [
3765
+ {
3766
+ "bearerAuth": []
3767
+ }
3768
+ ],
3769
+ "parameters": [
3770
+ {
3771
+ "schema": {
3772
+ "type": "string",
3773
+ "minLength": 1,
3774
+ "maxLength": 512,
3775
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3776
+ },
3777
+ "required": true,
3778
+ "name": "namespace",
3779
+ "in": "path"
3780
+ },
3781
+ {
3782
+ "schema": {
3783
+ "type": "string",
3784
+ "minLength": 1,
3785
+ "maxLength": 512,
3786
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3787
+ },
3788
+ "required": true,
3789
+ "name": "key",
3790
+ "in": "path"
3791
+ }
3792
+ ],
3793
+ "requestBody": {
3794
+ "content": {
3795
+ "application/json": {
3796
+ "schema": {
3797
+ "type": [
3798
+ "object",
3799
+ "null"
3800
+ ],
3801
+ "properties": {
3802
+ "by": {
3803
+ "type": "integer"
3804
+ }
3805
+ }
3806
+ }
3807
+ }
3808
+ }
3809
+ },
3810
+ "responses": {
3811
+ "200": {
3812
+ "description": "KV entry stored"
3813
+ },
3814
+ "400": {
3815
+ "description": "Validation error"
3816
+ },
3817
+ "403": {
3818
+ "description": "Caller may not write this namespace"
3819
+ },
3820
+ "409": {
3821
+ "description": "INCR collision: existing value_type is not 'integer'"
3822
+ },
3823
+ "413": {
3824
+ "description": "Body exceeds 2 MiB"
3825
+ }
3826
+ }
3827
+ }
3828
+ },
3829
+ "/api/kv/_/{namespace}": {
3830
+ "get": {
3831
+ "summary": "List KV entries in an explicit namespace",
3832
+ "tags": [
3833
+ "KV"
3834
+ ],
3835
+ "security": [
3836
+ {
3837
+ "bearerAuth": []
3838
+ }
3839
+ ],
3840
+ "parameters": [
3841
+ {
3842
+ "schema": {
3843
+ "type": "string",
3844
+ "minLength": 1,
3845
+ "maxLength": 512,
3846
+ "pattern": "^[a-zA-Z0-9._:/%-]{1,512}$"
3847
+ },
3848
+ "required": true,
3849
+ "name": "namespace",
3850
+ "in": "path"
3851
+ },
3852
+ {
3853
+ "schema": {
3854
+ "type": "string"
3855
+ },
3856
+ "required": false,
3857
+ "name": "prefix",
3858
+ "in": "query"
3859
+ },
3860
+ {
3861
+ "schema": {
3862
+ "type": "integer",
3863
+ "exclusiveMinimum": 0,
3864
+ "maximum": 1000
3865
+ },
3866
+ "required": false,
3867
+ "name": "limit",
3868
+ "in": "query"
3869
+ },
3870
+ {
3871
+ "schema": {
3872
+ "type": [
3873
+ "integer",
3874
+ "null"
3875
+ ],
3876
+ "minimum": 0
3877
+ },
3878
+ "required": false,
3879
+ "name": "offset",
3880
+ "in": "query"
3881
+ }
3882
+ ],
3883
+ "responses": {
3884
+ "200": {
3885
+ "description": "KV entries in the resolved namespace"
3886
+ },
3887
+ "400": {
3888
+ "description": "Validation error or unresolvable namespace"
3889
+ }
3890
+ }
3891
+ }
3892
+ },
3335
3893
  "/api/memory/index": {
3336
3894
  "post": {
3337
3895
  "summary": "Ingest content into memory system (async embedding)",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@desplega.ai/agent-swarm",
3
- "version": "1.79.0",
3
+ "version": "1.79.1",
4
4
  "description": "Multi-agent orchestration for Claude Code, Codex, Gemini CLI, and other AI coding assistants",
5
5
  "license": "MIT",
6
6
  "author": "desplega.sh <contact@desplega.sh>",
@@ -104,9 +104,9 @@
104
104
  "@desplega.ai/localtunnel": "^2.2.0",
105
105
  "@inkjs/ui": "^2.0.0",
106
106
  "@linear/sdk": "^77.0.0",
107
- "@mariozechner/pi-agent-core": "^0.73.0",
108
- "@mariozechner/pi-ai": "^0.73.0",
109
- "@mariozechner/pi-coding-agent": "^0.73.0",
107
+ "@earendil-works/pi-agent-core": "^0.74.0",
108
+ "@earendil-works/pi-ai": "^0.74.0",
109
+ "@earendil-works/pi-coding-agent": "^0.74.0",
110
110
  "@modelcontextprotocol/sdk": "^1.25.1",
111
111
  "@openai/codex-sdk": "^0.128.0",
112
112
  "@opencode-ai/sdk": "^1.14.30",