@opensoha/contracts 0.1.7 → 0.1.8

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 (30) hide show
  1. package/compat/json-schema-ecosystem-0.1.0.json +1 -1
  2. package/compat/openapi-loose-boundaries-0.1.0.json +1 -1
  3. package/fixtures/json-schema/companion-pack/invalid/traversal.json +19 -0
  4. package/fixtures/json-schema/companion-pack/valid/svg.json +47 -0
  5. package/fixtures/json-schema/companion-provenance/invalid/missing-source.json +8 -0
  6. package/fixtures/json-schema/companion-provenance/valid/minimal.json +10 -0
  7. package/fixtures/json-schema/marketplace-catalog/valid/companion-pack.json +39 -0
  8. package/fixtures/json-schema/plugin-manifest/invalid/companion-pack-without-assets.json +17 -0
  9. package/fixtures/json-schema/plugin-manifest/valid/companion-pack.json +28 -0
  10. package/fixtures/openapi/CompanionInteractionReceiptEnvelope/invalid/missing-profile.json +9 -0
  11. package/fixtures/openapi/CompanionInteractionReceiptEnvelope/valid/applied.json +22 -0
  12. package/fixtures/openapi/CompanionInteractionRequest/invalid/client-reward.json +5 -0
  13. package/fixtures/openapi/CompanionInteractionRequest/valid/pet.json +5 -0
  14. package/fixtures/openapi/CompanionPackManifest/invalid/external-entry.json +11 -0
  15. package/fixtures/openapi/CompanionPackManifest/valid/svg.json +20 -0
  16. package/fixtures/openapi/CompanionProfileEnvelope/invalid/level-zero.json +15 -0
  17. package/fixtures/openapi/CompanionProfileEnvelope/valid/default.json +15 -0
  18. package/fixtures/openapi/PluginProvenanceStatement/invalid/algorithm.json +10 -0
  19. package/fixtures/openapi/PluginProvenanceStatement/valid/minimal.json +10 -0
  20. package/gen/go/sohaapi/client.go +1 -1
  21. package/gen/go/sohaapi/types.go +532 -18
  22. package/gen/ts/sohaapi/index.ts +515 -1
  23. package/openapi/soha-api.json +1040 -2
  24. package/openapi/soha-api.yaml +464 -1
  25. package/openapi/spec_generated.go +3 -3
  26. package/package.json +3 -1
  27. package/plugins/companion-pack.schema.json +118 -0
  28. package/plugins/companion-provenance.schema.json +19 -0
  29. package/plugins/marketplace-catalog.schema.json +20 -0
  30. package/plugins/plugin-manifest.schema.json +19 -1
@@ -1,7 +1,7 @@
1
1
  openapi: 3.1.0
2
2
  info:
3
3
  title: Soha API
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  description: >
6
6
  Public OpenSoha core API contract. This first contract focuses on stable
7
7
  cross-repository boundaries: auth, health, runner-facing control-plane
@@ -6403,6 +6403,25 @@ paths:
6403
6403
  application/json:
6404
6404
  schema:
6405
6405
  $ref: "#/components/schemas/PluginManifest"
6406
+ /marketplace/plugins/{pluginID}/{version}/provenance.json:
6407
+ get:
6408
+ tags: [Marketplace]
6409
+ operationId: getPublicMarketplacePluginProvenance
6410
+ security: []
6411
+ parameters:
6412
+ - $ref: "#/components/parameters/PluginID"
6413
+ - name: version
6414
+ in: path
6415
+ required: true
6416
+ schema:
6417
+ type: string
6418
+ responses:
6419
+ "200":
6420
+ description: Immutable signed provenance statement for a plugin package.
6421
+ content:
6422
+ application/json:
6423
+ schema:
6424
+ $ref: "#/components/schemas/PluginProvenanceStatement"
6406
6425
  /plugins/marketplace:
6407
6426
  get:
6408
6427
  tags: [Plugins]
@@ -6763,6 +6782,170 @@ paths:
6763
6782
  application/json:
6764
6783
  schema:
6765
6784
  $ref: "#/components/schemas/InstalledPluginEnvelope"
6785
+ /plugins/{pluginID}/activate:
6786
+ post:
6787
+ tags: [Plugins]
6788
+ operationId: activateInstalledPlugin
6789
+ parameters:
6790
+ - $ref: "#/components/parameters/PluginID"
6791
+ - $ref: "#/components/parameters/IdempotencyKey"
6792
+ requestBody:
6793
+ required: false
6794
+ content:
6795
+ application/json:
6796
+ schema:
6797
+ $ref: "#/components/schemas/CompanionActivationRequest"
6798
+ responses:
6799
+ "200":
6800
+ description: Companion pack version activated.
6801
+ content:
6802
+ application/json:
6803
+ schema:
6804
+ $ref: "#/components/schemas/InstalledPluginEnvelope"
6805
+ "401": { $ref: "#/components/responses/Error" }
6806
+ "403": { $ref: "#/components/responses/Error" }
6807
+ "404": { $ref: "#/components/responses/Error" }
6808
+ "409": { $ref: "#/components/responses/Error" }
6809
+ "422": { $ref: "#/components/responses/Error" }
6810
+ "503": { $ref: "#/components/responses/Error" }
6811
+ /plugins/{pluginID}/rollback:
6812
+ post:
6813
+ tags: [Plugins]
6814
+ operationId: rollbackInstalledPlugin
6815
+ parameters:
6816
+ - $ref: "#/components/parameters/PluginID"
6817
+ - $ref: "#/components/parameters/IdempotencyKey"
6818
+ requestBody:
6819
+ required: false
6820
+ content:
6821
+ application/json:
6822
+ schema:
6823
+ $ref: "#/components/schemas/CompanionRollbackRequest"
6824
+ responses:
6825
+ "200":
6826
+ description: Companion pack rolled back to a retained verified version.
6827
+ content:
6828
+ application/json:
6829
+ schema:
6830
+ $ref: "#/components/schemas/InstalledPluginEnvelope"
6831
+ "401": { $ref: "#/components/responses/Error" }
6832
+ "403": { $ref: "#/components/responses/Error" }
6833
+ "404": { $ref: "#/components/responses/Error" }
6834
+ "409": { $ref: "#/components/responses/Error" }
6835
+ "422": { $ref: "#/components/responses/Error" }
6836
+ "503": { $ref: "#/components/responses/Error" }
6837
+ /plugins/{pluginID}/assets/{assetPath}:
6838
+ get:
6839
+ tags: [Plugins]
6840
+ operationId: getInstalledPluginAsset
6841
+ parameters:
6842
+ - $ref: "#/components/parameters/PluginID"
6843
+ - $ref: "#/components/parameters/PluginAssetPath"
6844
+ responses:
6845
+ "200":
6846
+ description: Immutable verified asset from the active companion pack.
6847
+ headers:
6848
+ Cache-Control:
6849
+ schema:
6850
+ type: string
6851
+ content:
6852
+ application/octet-stream:
6853
+ schema:
6854
+ type: string
6855
+ format: binary
6856
+ application/json:
6857
+ schema:
6858
+ type: string
6859
+ format: binary
6860
+ image/png:
6861
+ schema:
6862
+ type: string
6863
+ format: binary
6864
+ image/jpeg:
6865
+ schema:
6866
+ type: string
6867
+ format: binary
6868
+ image/webp:
6869
+ schema:
6870
+ type: string
6871
+ format: binary
6872
+ image/svg+xml:
6873
+ schema:
6874
+ type: string
6875
+ format: binary
6876
+ "401": { $ref: "#/components/responses/Error" }
6877
+ "403": { $ref: "#/components/responses/Error" }
6878
+ "404": { $ref: "#/components/responses/Error" }
6879
+ /companion/profile:
6880
+ get:
6881
+ tags: [Companion]
6882
+ operationId: getCompanionProfile
6883
+ responses:
6884
+ "200":
6885
+ description: Current principal's companion profile.
6886
+ content:
6887
+ application/json:
6888
+ schema:
6889
+ $ref: "#/components/schemas/CompanionProfileEnvelope"
6890
+ "401": { $ref: "#/components/responses/Error" }
6891
+ "403": { $ref: "#/components/responses/Error" }
6892
+ "503": { $ref: "#/components/responses/Error" }
6893
+ /companion/interactions:
6894
+ post:
6895
+ tags: [Companion]
6896
+ operationId: recordCompanionInteraction
6897
+ parameters:
6898
+ - $ref: "#/components/parameters/IdempotencyKey"
6899
+ requestBody:
6900
+ required: true
6901
+ content:
6902
+ application/json:
6903
+ schema:
6904
+ $ref: "#/components/schemas/CompanionInteractionRequest"
6905
+ responses:
6906
+ "200":
6907
+ description: Existing idempotent interaction result.
6908
+ content:
6909
+ application/json:
6910
+ schema:
6911
+ $ref: "#/components/schemas/CompanionInteractionReceiptEnvelope"
6912
+ "201":
6913
+ description: Interaction applied to the companion profile.
6914
+ content:
6915
+ application/json:
6916
+ schema:
6917
+ $ref: "#/components/schemas/CompanionInteractionReceiptEnvelope"
6918
+ "400": { $ref: "#/components/responses/Error" }
6919
+ "401": { $ref: "#/components/responses/Error" }
6920
+ "403": { $ref: "#/components/responses/Error" }
6921
+ "404": { $ref: "#/components/responses/Error" }
6922
+ "409": { $ref: "#/components/responses/Error" }
6923
+ "422": { $ref: "#/components/responses/Error" }
6924
+ "503": { $ref: "#/components/responses/Error" }
6925
+ /companion/profile/reset:
6926
+ post:
6927
+ tags: [Companion]
6928
+ operationId: resetCompanionProfile
6929
+ parameters:
6930
+ - $ref: "#/components/parameters/IdempotencyKey"
6931
+ requestBody:
6932
+ required: false
6933
+ content:
6934
+ application/json:
6935
+ schema:
6936
+ $ref: "#/components/schemas/CompanionProfileResetRequest"
6937
+ responses:
6938
+ "200":
6939
+ description: Companion progression reset for the selected pack.
6940
+ content:
6941
+ application/json:
6942
+ schema:
6943
+ $ref: "#/components/schemas/CompanionProfileEnvelope"
6944
+ "401": { $ref: "#/components/responses/Error" }
6945
+ "403": { $ref: "#/components/responses/Error" }
6946
+ "404": { $ref: "#/components/responses/Error" }
6947
+ "409": { $ref: "#/components/responses/Error" }
6948
+ "503": { $ref: "#/components/responses/Error" }
6766
6949
  /ai/agent-providers/catalog:
6767
6950
  get:
6768
6951
  tags: [Agent Providers]
@@ -9215,6 +9398,16 @@ components:
9215
9398
  required: true
9216
9399
  schema:
9217
9400
  type: string
9401
+ PluginAssetPath:
9402
+ name: assetPath
9403
+ in: path
9404
+ required: true
9405
+ description: Slash-separated relative path declared by the active companion pack.
9406
+ schema:
9407
+ type: string
9408
+ minLength: 1
9409
+ maxLength: 512
9410
+ pattern: "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[A-Za-z0-9._/-]+$"
9218
9411
  KnowledgeBaseID:
9219
9412
  name: baseID
9220
9413
  in: path
@@ -21193,6 +21386,185 @@ components:
21193
21386
  items:
21194
21387
  type: string
21195
21388
  additionalProperties: false
21389
+ CompanionAsset:
21390
+ type: object
21391
+ required: [path, kind, contentType, sizeBytes, sha256]
21392
+ properties:
21393
+ path:
21394
+ type: string
21395
+ minLength: 1
21396
+ maxLength: 512
21397
+ pattern: "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[A-Za-z0-9._/-]+$"
21398
+ kind:
21399
+ type: string
21400
+ enum: [entry, model, texture, motion, expression, physics, pose, thumbnail, audio]
21401
+ contentType:
21402
+ type: string
21403
+ enum: [application/json, application/octet-stream, image/png, image/jpeg, image/webp, image/svg+xml, audio/mpeg, audio/ogg]
21404
+ sizeBytes:
21405
+ type: integer
21406
+ format: int64
21407
+ minimum: 1
21408
+ maximum: 67108864
21409
+ sha256:
21410
+ type: string
21411
+ pattern: "^sha256:[a-f0-9]{64}$"
21412
+ additionalProperties: false
21413
+ CompanionAnimationBindings:
21414
+ type: object
21415
+ properties:
21416
+ idle: { type: string, minLength: 1 }
21417
+ listening: { type: string, minLength: 1 }
21418
+ thinking: { type: string, minLength: 1 }
21419
+ speaking: { type: string, minLength: 1 }
21420
+ error: { type: string, minLength: 1 }
21421
+ dragging: { type: string, minLength: 1 }
21422
+ hover: { type: string, minLength: 1 }
21423
+ tap: { type: string, minLength: 1 }
21424
+ additionalProperties: false
21425
+ CompanionInteractionDefinition:
21426
+ type: object
21427
+ required: [id, action]
21428
+ properties:
21429
+ id:
21430
+ type: string
21431
+ pattern: "^[a-z][a-z0-9._-]*$"
21432
+ label: { type: string, minLength: 1, maxLength: 64 }
21433
+ action:
21434
+ type: string
21435
+ enum: [tap, pet, feed, play, greet]
21436
+ animation: { type: string, minLength: 1 }
21437
+ cooldownSeconds: { type: integer, minimum: 0, maximum: 86400 }
21438
+ rewardXp: { type: integer, minimum: 0, maximum: 1000 }
21439
+ rewardAffinity: { type: integer, minimum: 0, maximum: 100 }
21440
+ additionalProperties: false
21441
+ CompanionUnlockDefinition:
21442
+ type: object
21443
+ required: [id, kind, level, ref]
21444
+ properties:
21445
+ id:
21446
+ type: string
21447
+ pattern: "^[a-z][a-z0-9._-]*$"
21448
+ kind:
21449
+ type: string
21450
+ enum: [interaction, animation, expression, asset]
21451
+ level: { type: integer, minimum: 1, maximum: 100 }
21452
+ ref: { type: string, minLength: 1 }
21453
+ additionalProperties: false
21454
+ CompanionPackLicense:
21455
+ type: object
21456
+ required: [name, url, redistributionAllowed, commercialUseAllowed]
21457
+ properties:
21458
+ name: { type: string, minLength: 1 }
21459
+ spdxId: { type: string, minLength: 1 }
21460
+ url: { type: string, format: uri }
21461
+ sourceUrl: { type: string, format: uri }
21462
+ attribution: { type: string, maxLength: 2048 }
21463
+ redistributionAllowed: { type: boolean, enum: [true] }
21464
+ commercialUseAllowed: { type: boolean }
21465
+ additionalProperties: false
21466
+ CompanionPackManifest:
21467
+ type: object
21468
+ required: [renderer, entryAsset, assets, license]
21469
+ properties:
21470
+ renderer:
21471
+ type: string
21472
+ enum: [svg, sprite, live2d-cubism]
21473
+ entryAsset:
21474
+ type: string
21475
+ minLength: 1
21476
+ maxLength: 512
21477
+ pattern: "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[A-Za-z0-9._/-]+$"
21478
+ thumbnailAsset:
21479
+ type: string
21480
+ minLength: 1
21481
+ maxLength: 512
21482
+ pattern: "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[A-Za-z0-9._/-]+$"
21483
+ modelFormatVersion: { type: string, minLength: 1 }
21484
+ assets:
21485
+ type: array
21486
+ minItems: 1
21487
+ maxItems: 512
21488
+ items:
21489
+ $ref: "#/components/schemas/CompanionAsset"
21490
+ animations:
21491
+ $ref: "#/components/schemas/CompanionAnimationBindings"
21492
+ interactions:
21493
+ type: array
21494
+ maxItems: 64
21495
+ items:
21496
+ $ref: "#/components/schemas/CompanionInteractionDefinition"
21497
+ unlocks:
21498
+ type: array
21499
+ maxItems: 128
21500
+ items:
21501
+ $ref: "#/components/schemas/CompanionUnlockDefinition"
21502
+ license:
21503
+ $ref: "#/components/schemas/CompanionPackLicense"
21504
+ additionalProperties: false
21505
+ PluginPackageDescriptor:
21506
+ type: object
21507
+ required: [url, contentType, sizeBytes, sha256]
21508
+ properties:
21509
+ url: { type: string, format: uri }
21510
+ contentType:
21511
+ type: string
21512
+ enum: [application/zip, application/gzip, application/x-tar]
21513
+ sizeBytes:
21514
+ type: integer
21515
+ format: int64
21516
+ minimum: 1
21517
+ maximum: 268435456
21518
+ sha256:
21519
+ type: string
21520
+ pattern: "^sha256:[a-f0-9]{64}$"
21521
+ signature: { type: string, minLength: 1 }
21522
+ signatureAlgorithm:
21523
+ type: string
21524
+ enum: [ed25519]
21525
+ signingKeyId:
21526
+ type: string
21527
+ pattern: "^[a-z][a-z0-9._-]*$"
21528
+ provenanceUrl: { type: string, format: uri }
21529
+ sbomUrl: { type: string, format: uri }
21530
+ additionalProperties: false
21531
+ PluginProvenanceStatement:
21532
+ type: object
21533
+ description: The Ed25519 signature covers UTF-8 lines subjectSha256, builderId, sourceUri, sourceCommit, and builtAt in that order, joined with LF and without a trailing LF.
21534
+ required: [subjectSha256, builderId, sourceUri, sourceCommit, builtAt, signingKeyId, signatureAlgorithm, signature]
21535
+ properties:
21536
+ subjectSha256:
21537
+ type: string
21538
+ pattern: "^sha256:[a-f0-9]{64}$"
21539
+ builderId: { type: string, minLength: 1, maxLength: 512 }
21540
+ sourceUri: { type: string, format: uri }
21541
+ sourceCommit: { type: string, pattern: "^[A-Fa-f0-9]{7,64}$" }
21542
+ builtAt: { type: string, format: date-time }
21543
+ signingKeyId: { type: string, pattern: "^[a-z][a-z0-9._-]*$" }
21544
+ signatureAlgorithm: { type: string, enum: [ed25519] }
21545
+ signature: { type: string, minLength: 1 }
21546
+ additionalProperties: false
21547
+ PluginArtifactRecord:
21548
+ type: object
21549
+ required: [version, sha256, sizeBytes, checksumStatus, signatureStatus, provenanceStatus, active]
21550
+ properties:
21551
+ version: { type: string }
21552
+ sha256:
21553
+ type: string
21554
+ pattern: "^sha256:[a-f0-9]{64}$"
21555
+ sizeBytes: { type: integer, format: int64, minimum: 1 }
21556
+ checksumStatus:
21557
+ type: string
21558
+ enum: [verified, mismatch]
21559
+ signatureStatus:
21560
+ type: string
21561
+ enum: [verified, not_provided, untrusted, invalid]
21562
+ provenanceStatus:
21563
+ type: string
21564
+ enum: [verified, not_provided, invalid]
21565
+ active: { type: boolean }
21566
+ installedAt: { type: string, format: date-time }
21567
+ additionalProperties: false
21196
21568
  PluginCompatibility:
21197
21569
  type: object
21198
21570
  properties:
@@ -21696,6 +22068,8 @@ components:
21696
22068
  type: string
21697
22069
  signature:
21698
22070
  type: string
22071
+ package:
22072
+ $ref: "#/components/schemas/PluginPackageDescriptor"
21699
22073
  publishedAt:
21700
22074
  type: string
21701
22075
  format: date-time
@@ -21786,6 +22160,7 @@ components:
21786
22160
  - notification-channel
21787
22161
  - identity-template
21788
22162
  - ui-extension
22163
+ - companion-pack
21789
22164
  description:
21790
22165
  type: string
21791
22166
  homepage:
@@ -21810,6 +22185,8 @@ components:
21810
22185
  $ref: "#/components/schemas/PluginIntegrity"
21811
22186
  runtime:
21812
22187
  $ref: "#/components/schemas/PluginRuntimeSpec"
22188
+ companionPack:
22189
+ $ref: "#/components/schemas/CompanionPackManifest"
21813
22190
  configSchema:
21814
22191
  $ref: "#/components/schemas/JSONSchema"
21815
22192
  extensionPoints:
@@ -22134,6 +22511,12 @@ components:
22134
22511
  type: string
22135
22512
  signatureStatus:
22136
22513
  type: string
22514
+ activeVersion:
22515
+ type: string
22516
+ artifacts:
22517
+ type: array
22518
+ items:
22519
+ $ref: "#/components/schemas/PluginArtifactRecord"
22137
22520
  requestedPermissions:
22138
22521
  $ref: "#/components/schemas/PluginPermissionRequest"
22139
22522
  configuredSecretRefs:
@@ -22175,9 +22558,89 @@ components:
22175
22558
  $ref: "#/components/schemas/PluginManifest"
22176
22559
  expectedChecksum:
22177
22560
  type: string
22561
+ package:
22562
+ $ref: "#/components/schemas/PluginPackageDescriptor"
22178
22563
  enable:
22179
22564
  type: boolean
22180
22565
  additionalProperties: false
22566
+ CompanionActivationRequest:
22567
+ type: object
22568
+ properties:
22569
+ version: { type: string, minLength: 1 }
22570
+ additionalProperties: false
22571
+ CompanionRollbackRequest:
22572
+ type: object
22573
+ required: [version]
22574
+ properties:
22575
+ version: { type: string, minLength: 1 }
22576
+ reason: { type: string, maxLength: 512 }
22577
+ additionalProperties: false
22578
+ CompanionProfile:
22579
+ type: object
22580
+ required: [id, ownerId, activePluginId, activeVersion, level, xp, affinity, unlockedIds, revision, createdAt, updatedAt]
22581
+ properties:
22582
+ id: { type: string }
22583
+ ownerId: { type: string }
22584
+ activePluginId: { type: string }
22585
+ activeVersion: { type: string }
22586
+ level: { type: integer, minimum: 1, maximum: 100 }
22587
+ xp: { type: integer, minimum: 0 }
22588
+ affinity: { type: integer, minimum: 0 }
22589
+ unlockedIds:
22590
+ type: array
22591
+ uniqueItems: true
22592
+ items: { type: string }
22593
+ revision: { type: integer, format: int64, minimum: 1 }
22594
+ lastInteractionAt: { type: string, format: date-time }
22595
+ createdAt: { type: string, format: date-time }
22596
+ updatedAt: { type: string, format: date-time }
22597
+ additionalProperties: false
22598
+ CompanionInteractionRequest:
22599
+ type: object
22600
+ required: [pluginId, interactionId]
22601
+ properties:
22602
+ pluginId: { type: string }
22603
+ interactionId:
22604
+ type: string
22605
+ pattern: "^[a-z][a-z0-9._-]*$"
22606
+ sessionId: { type: string }
22607
+ messageId: { type: string }
22608
+ clientRevision: { type: integer, format: int64, minimum: 1 }
22609
+ additionalProperties: false
22610
+ CompanionInteractionReceipt:
22611
+ type: object
22612
+ required: [idempotencyKey, applied, xpAwarded, affinityAwarded, unlockedIds, profile]
22613
+ properties:
22614
+ idempotencyKey: { type: string }
22615
+ applied: { type: boolean }
22616
+ xpAwarded: { type: integer, minimum: 0 }
22617
+ affinityAwarded: { type: integer, minimum: 0 }
22618
+ unlockedIds:
22619
+ type: array
22620
+ uniqueItems: true
22621
+ items: { type: string }
22622
+ profile:
22623
+ $ref: "#/components/schemas/CompanionProfile"
22624
+ additionalProperties: false
22625
+ CompanionProfileResetRequest:
22626
+ type: object
22627
+ properties:
22628
+ pluginId: { type: string }
22629
+ additionalProperties: false
22630
+ CompanionProfileEnvelope:
22631
+ type: object
22632
+ required: [data]
22633
+ properties:
22634
+ data:
22635
+ $ref: "#/components/schemas/CompanionProfile"
22636
+ additionalProperties: false
22637
+ CompanionInteractionReceiptEnvelope:
22638
+ type: object
22639
+ required: [data]
22640
+ properties:
22641
+ data:
22642
+ $ref: "#/components/schemas/CompanionInteractionReceipt"
22643
+ additionalProperties: false
22181
22644
  PluginConfigRequest:
22182
22645
  type: object
22183
22646
  properties:
@@ -5,9 +5,9 @@ package openapi
5
5
  import _ "embed"
6
6
 
7
7
  const (
8
- Version = "0.1.7"
9
- YAMLSHA256 = "1342c9f391d02d91c336d27c65ae81781f4432cbc5ffc47ea53fad9c688adb0a"
10
- JSONSHA256 = "1e028d64f794045e22d447b4609b53f9846324fa78ca88818493b6ee80a3b0e1"
8
+ Version = "0.1.8"
9
+ YAMLSHA256 = "67feba4d2b47ae3982a9feb7a2286be4c856e0d29d63f445be165335acf364ef"
10
+ JSONSHA256 = "dd0200945f41e4d87553ef88fdeb14577b219367768a43487ac3c23f5380eabb"
11
11
  )
12
12
 
13
13
  //go:embed soha-api.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensoha/contracts",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "description": "Shared OpenSoha API, agent, MCP, skill, event, and auth contracts.",
6
6
  "license": "Apache-2.0",
@@ -53,6 +53,8 @@
53
53
  "./mcp/gateway-capability-baseline.schema.json": "./mcp/gateway-capability-baseline.schema.json",
54
54
  "./skills/skill-manifest.schema.json": "./skills/skill-manifest.schema.json",
55
55
  "./plugins/plugin-manifest.schema.json": "./plugins/plugin-manifest.schema.json",
56
+ "./plugins/companion-pack.schema.json": "./plugins/companion-pack.schema.json",
57
+ "./plugins/companion-provenance.schema.json": "./plugins/companion-provenance.schema.json",
56
58
  "./plugins/marketplace-catalog.schema.json": "./plugins/marketplace-catalog.schema.json",
57
59
  "./events/event-envelope.schema.json": "./events/event-envelope.schema.json",
58
60
  "./auth/token-claims.schema.json": "./auth/token-claims.schema.json",
@@ -0,0 +1,118 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://contracts.opensoha.dev/plugins/companion-pack.schema.json",
4
+ "title": "OpenSoha Companion Pack",
5
+ "type": "object",
6
+ "required": ["renderer", "entryAsset", "assets", "license"],
7
+ "properties": {
8
+ "renderer": {
9
+ "type": "string",
10
+ "enum": ["svg", "sprite", "live2d-cubism"]
11
+ },
12
+ "entryAsset": { "$ref": "#/$defs/safePath" },
13
+ "thumbnailAsset": { "$ref": "#/$defs/safePath" },
14
+ "modelFormatVersion": { "type": "string", "minLength": 1 },
15
+ "assets": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "maxItems": 512,
19
+ "items": { "$ref": "#/$defs/asset" }
20
+ },
21
+ "animations": { "$ref": "#/$defs/animations" },
22
+ "interactions": {
23
+ "type": "array",
24
+ "maxItems": 64,
25
+ "items": { "$ref": "#/$defs/interaction" }
26
+ },
27
+ "unlocks": {
28
+ "type": "array",
29
+ "maxItems": 128,
30
+ "items": { "$ref": "#/$defs/unlock" }
31
+ },
32
+ "license": { "$ref": "#/$defs/license" }
33
+ },
34
+ "$defs": {
35
+ "safePath": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "maxLength": 512,
39
+ "pattern": "^(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\\\)[A-Za-z0-9._/-]+$"
40
+ },
41
+ "sha256": {
42
+ "type": "string",
43
+ "pattern": "^sha256:[a-f0-9]{64}$"
44
+ },
45
+ "asset": {
46
+ "type": "object",
47
+ "required": ["path", "kind", "contentType", "sizeBytes", "sha256"],
48
+ "properties": {
49
+ "path": { "$ref": "#/$defs/safePath" },
50
+ "kind": {
51
+ "type": "string",
52
+ "enum": ["entry", "model", "texture", "motion", "expression", "physics", "pose", "thumbnail", "audio"]
53
+ },
54
+ "contentType": {
55
+ "type": "string",
56
+ "enum": ["application/json", "application/octet-stream", "image/png", "image/jpeg", "image/webp", "image/svg+xml", "audio/mpeg", "audio/ogg"]
57
+ },
58
+ "sizeBytes": { "type": "integer", "minimum": 1, "maximum": 67108864 },
59
+ "sha256": { "$ref": "#/$defs/sha256" }
60
+ },
61
+ "additionalProperties": false
62
+ },
63
+ "animations": {
64
+ "type": "object",
65
+ "properties": {
66
+ "idle": { "type": "string", "minLength": 1 },
67
+ "listening": { "type": "string", "minLength": 1 },
68
+ "thinking": { "type": "string", "minLength": 1 },
69
+ "speaking": { "type": "string", "minLength": 1 },
70
+ "error": { "type": "string", "minLength": 1 },
71
+ "dragging": { "type": "string", "minLength": 1 },
72
+ "hover": { "type": "string", "minLength": 1 },
73
+ "tap": { "type": "string", "minLength": 1 }
74
+ },
75
+ "additionalProperties": false
76
+ },
77
+ "interaction": {
78
+ "type": "object",
79
+ "required": ["id", "action"],
80
+ "properties": {
81
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9._-]*$" },
82
+ "label": { "type": "string", "minLength": 1, "maxLength": 64 },
83
+ "action": { "type": "string", "enum": ["tap", "pet", "feed", "play", "greet"] },
84
+ "animation": { "type": "string", "minLength": 1 },
85
+ "cooldownSeconds": { "type": "integer", "minimum": 0, "maximum": 86400 },
86
+ "rewardXp": { "type": "integer", "minimum": 0, "maximum": 1000 },
87
+ "rewardAffinity": { "type": "integer", "minimum": 0, "maximum": 100 }
88
+ },
89
+ "additionalProperties": false
90
+ },
91
+ "unlock": {
92
+ "type": "object",
93
+ "required": ["id", "kind", "level", "ref"],
94
+ "properties": {
95
+ "id": { "type": "string", "pattern": "^[a-z][a-z0-9._-]*$" },
96
+ "kind": { "type": "string", "enum": ["interaction", "animation", "expression", "asset"] },
97
+ "level": { "type": "integer", "minimum": 1, "maximum": 100 },
98
+ "ref": { "type": "string", "minLength": 1 }
99
+ },
100
+ "additionalProperties": false
101
+ },
102
+ "license": {
103
+ "type": "object",
104
+ "required": ["name", "url", "redistributionAllowed", "commercialUseAllowed"],
105
+ "properties": {
106
+ "name": { "type": "string", "minLength": 1 },
107
+ "spdxId": { "type": "string", "minLength": 1 },
108
+ "url": { "type": "string", "format": "uri" },
109
+ "sourceUrl": { "type": "string", "format": "uri" },
110
+ "attribution": { "type": "string", "maxLength": 2048 },
111
+ "redistributionAllowed": { "const": true },
112
+ "commercialUseAllowed": { "type": "boolean" }
113
+ },
114
+ "additionalProperties": false
115
+ }
116
+ },
117
+ "additionalProperties": false
118
+ }