@themoltnet/agent-daemon 0.32.1 → 0.32.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.
Files changed (2) hide show
  1. package/dist/main.js +870 -5
  2. package/package.json +6 -6
package/dist/main.js CHANGED
@@ -4454,6 +4454,875 @@ function deepFreeze(value) {
4454
4454
  deepFreeze(RUNTIME_PROFILE_CONTEXT_CATALOGUE);
4455
4455
  Object.freeze(Object.keys(RUNTIME_PROFILE_CONTEXT_CATALOGUE.recipes));
4456
4456
  //#endregion
4457
+ //#region ../../libs/models/src/preview-sign.ts
4458
+ function schemaRef$1(schema, id) {
4459
+ return Unsafe(Ref$1(id));
4460
+ }
4461
+ var PreviewSignBase64UrlSchema = String$1({
4462
+ $id: "PreviewSignBase64Url",
4463
+ minLength: 1,
4464
+ maxLength: 5462,
4465
+ pattern: "^[A-Za-z0-9_-]+$"
4466
+ });
4467
+ var PreviewSignSha256Base64UrlSchema = String$1({
4468
+ $id: "PreviewSignSha256Base64Url",
4469
+ minLength: 43,
4470
+ maxLength: 43,
4471
+ pattern: "^[A-Za-z0-9_-]+$"
4472
+ });
4473
+ var PreviewSignP256DerSignatureBase64UrlSchema = String$1({
4474
+ $id: "PreviewSignP256DerSignatureBase64Url",
4475
+ minLength: 11,
4476
+ maxLength: 96,
4477
+ pattern: "^[A-Za-z0-9_-]+$"
4478
+ });
4479
+ var PreviewSignEs256PublicKeySchema = _Object_({
4480
+ kty: Literal(2),
4481
+ algorithm: Literal(-7),
4482
+ curve: Literal(1),
4483
+ x: schemaRef$1(PreviewSignSha256Base64UrlSchema, "PreviewSignSha256Base64Url"),
4484
+ y: schemaRef$1(PreviewSignSha256Base64UrlSchema, "PreviewSignSha256Base64Url")
4485
+ }, {
4486
+ $id: "PreviewSignEs256PublicKey",
4487
+ additionalProperties: false
4488
+ });
4489
+ var PreviewSignEcdhEsHkdf256PublicKeySchema = _Object_({
4490
+ kty: Literal(2),
4491
+ algorithm: Literal(-25),
4492
+ curve: Literal(1),
4493
+ x: schemaRef$1(PreviewSignSha256Base64UrlSchema, "PreviewSignSha256Base64Url"),
4494
+ y: schemaRef$1(PreviewSignSha256Base64UrlSchema, "PreviewSignSha256Base64Url")
4495
+ }, {
4496
+ $id: "PreviewSignEcdhEsHkdf256PublicKey",
4497
+ additionalProperties: false
4498
+ });
4499
+ var PreviewSignEsp256PublicKeySchema = _Object_({
4500
+ kty: Literal(2),
4501
+ algorithm: Literal(-9),
4502
+ curve: Literal(1),
4503
+ x: schemaRef$1(PreviewSignSha256Base64UrlSchema, "PreviewSignSha256Base64Url"),
4504
+ y: schemaRef$1(PreviewSignSha256Base64UrlSchema, "PreviewSignSha256Base64Url")
4505
+ }, {
4506
+ $id: "PreviewSignEsp256PublicKey",
4507
+ additionalProperties: false
4508
+ });
4509
+ var PreviewSignArkgSeedPublicKeySchema = _Object_({
4510
+ kty: Literal(-65537),
4511
+ algorithm: Literal(-65700),
4512
+ derivedAlgorithm: Literal(-9),
4513
+ blindingKey: schemaRef$1(PreviewSignEs256PublicKeySchema, "PreviewSignEs256PublicKey"),
4514
+ kemKey: schemaRef$1(PreviewSignEcdhEsHkdf256PublicKeySchema, "PreviewSignEcdhEsHkdf256PublicKey")
4515
+ }, {
4516
+ $id: "PreviewSignArkgSeedPublicKey",
4517
+ additionalProperties: false
4518
+ });
4519
+ var PreviewSignPublicMaterialSchema = _Object_({
4520
+ version: Literal(1),
4521
+ outerCredentialId: schemaRef$1(PreviewSignBase64UrlSchema, "PreviewSignBase64Url"),
4522
+ outerPublicKey: schemaRef$1(PreviewSignEs256PublicKeySchema, "PreviewSignEs256PublicKey"),
4523
+ previewKeyHandle: schemaRef$1(PreviewSignBase64UrlSchema, "PreviewSignBase64Url"),
4524
+ seedPublicKey: schemaRef$1(PreviewSignArkgSeedPublicKeySchema, "PreviewSignArkgSeedPublicKey")
4525
+ }, {
4526
+ $id: "PreviewSignPublicMaterial",
4527
+ additionalProperties: false
4528
+ });
4529
+ var PreviewSignChallengeSchema = _Object_({
4530
+ verificationMethod: Literal("human-hardware-previewsign"),
4531
+ version: Literal(1),
4532
+ envelope: schemaRef$1(PreviewSignBase64UrlSchema, "PreviewSignBase64Url"),
4533
+ digest: schemaRef$1(PreviewSignSha256Base64UrlSchema, "PreviewSignSha256Base64Url"),
4534
+ additionalArguments: schemaRef$1(PreviewSignBase64UrlSchema, "PreviewSignBase64Url"),
4535
+ outerCredentialId: schemaRef$1(PreviewSignBase64UrlSchema, "PreviewSignBase64Url"),
4536
+ outerPublicKey: schemaRef$1(PreviewSignEs256PublicKeySchema, "PreviewSignEs256PublicKey"),
4537
+ previewKeyHandle: schemaRef$1(PreviewSignBase64UrlSchema, "PreviewSignBase64Url")
4538
+ }, {
4539
+ $id: "PreviewSignChallenge",
4540
+ additionalProperties: false
4541
+ });
4542
+ var PreviewSignChallengeValueSchema = _Object_({
4543
+ verificationMethod: Literal("human-hardware-previewsign"),
4544
+ value: schemaRef$1(PreviewSignChallengeSchema, "PreviewSignChallenge")
4545
+ }, {
4546
+ $id: "PreviewSignChallengeValue",
4547
+ additionalProperties: false
4548
+ });
4549
+ var PreviewSignChallengeOperationSchema = Union([Literal("credential-registration"), Literal("signing-request")], { $id: "PreviewSignChallengeOperation" });
4550
+ var PreviewSignReceiptSchema = _Object_({
4551
+ version: Literal(1),
4552
+ signature: schemaRef$1(PreviewSignP256DerSignatureBase64UrlSchema, "PreviewSignP256DerSignatureBase64Url")
4553
+ }, {
4554
+ $id: "PreviewSignReceipt",
4555
+ additionalProperties: false
4556
+ });
4557
+ var PreviewSignReceiptValueSchema = _Object_({
4558
+ verificationMethod: Literal("human-hardware-previewsign"),
4559
+ value: schemaRef$1(PreviewSignReceiptSchema, "PreviewSignReceipt")
4560
+ }, {
4561
+ $id: "PreviewSignReceiptValue",
4562
+ additionalProperties: false
4563
+ });
4564
+ var previewSignSchemaContext = {
4565
+ PreviewSignBase64Url: PreviewSignBase64UrlSchema,
4566
+ PreviewSignSha256Base64Url: PreviewSignSha256Base64UrlSchema,
4567
+ PreviewSignP256DerSignatureBase64Url: PreviewSignP256DerSignatureBase64UrlSchema,
4568
+ PreviewSignEs256PublicKey: PreviewSignEs256PublicKeySchema,
4569
+ PreviewSignEcdhEsHkdf256PublicKey: PreviewSignEcdhEsHkdf256PublicKeySchema,
4570
+ PreviewSignEsp256PublicKey: PreviewSignEsp256PublicKeySchema,
4571
+ PreviewSignArkgSeedPublicKey: PreviewSignArkgSeedPublicKeySchema,
4572
+ PreviewSignPublicMaterial: PreviewSignPublicMaterialSchema,
4573
+ PreviewSignChallenge: PreviewSignChallengeSchema,
4574
+ PreviewSignChallengeValue: PreviewSignChallengeValueSchema,
4575
+ PreviewSignChallengeOperation: PreviewSignChallengeOperationSchema,
4576
+ PreviewSignReceipt: PreviewSignReceiptSchema,
4577
+ PreviewSignReceiptValue: PreviewSignReceiptValueSchema
4578
+ };
4579
+ //#endregion
4580
+ //#region ../../libs/models/src/verification-method.ts
4581
+ /**
4582
+ * Persisted and wire-level signing verification method identifiers.
4583
+ *
4584
+ * This vocabulary is append-only. Never rename, remove, or change an existing
4585
+ * value: PostgreSQL rows, workflow inputs, and API clients persist these exact
4586
+ * strings. Future signing methods must add a new property and value.
4587
+ */
4588
+ var VERIFICATION_METHOD = {
4589
+ AgentEd25519: "agent-ed25519",
4590
+ HumanHardwarePreviewSign: "human-hardware-previewsign"
4591
+ };
4592
+ VERIFICATION_METHOD.AgentEd25519, VERIFICATION_METHOD.HumanHardwarePreviewSign;
4593
+ //#endregion
4594
+ //#region ../../libs/models/src/schemas.ts
4595
+ var UuidSchema = String$1({
4596
+ format: "uuid",
4597
+ description: "UUID v4 identifier"
4598
+ });
4599
+ var TimestampSchema = String$1({
4600
+ format: "date-time",
4601
+ description: "ISO 8601 timestamp"
4602
+ });
4603
+ Union([Literal(VERIFICATION_METHOD.AgentEd25519), Literal(VERIFICATION_METHOD.HumanHardwarePreviewSign)], { description: "Stable signing verification method identifier" });
4604
+ Union([
4605
+ Literal("private"),
4606
+ Literal("moltnet"),
4607
+ Literal("public")
4608
+ ], { description: "Entry visibility level" });
4609
+ var ENTRY_TYPE_VALUES = [
4610
+ "episodic",
4611
+ "semantic",
4612
+ "procedural",
4613
+ "reflection"
4614
+ ];
4615
+ var EntryTypeSchema = Union([
4616
+ Literal("episodic"),
4617
+ Literal("semantic"),
4618
+ Literal("procedural"),
4619
+ Literal("reflection")
4620
+ ], { description: "Entry memory type" });
4621
+ /** Regex fragment matching a single entry type value. */
4622
+ var ENTRY_TYPE_PATTERN = `(${ENTRY_TYPE_VALUES.join("|")})`;
4623
+ `${ENTRY_TYPE_PATTERN}${ENTRY_TYPE_PATTERN}`, ENTRY_TYPE_VALUES.length - 1;
4624
+ var PublicKeySchema = String$1({
4625
+ pattern: "^ed25519:[A-Za-z0-9+/=]+$",
4626
+ description: "Ed25519 public key with prefix"
4627
+ });
4628
+ var FingerprintSchema = String$1({
4629
+ pattern: "^[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}$",
4630
+ description: "Key fingerprint (A1B2-C3D4-E5F6-G7H8)"
4631
+ });
4632
+ _Object_({
4633
+ title: Optional(String$1({ maxLength: 255 })),
4634
+ content: String$1({
4635
+ minLength: 1,
4636
+ maxLength: 1e5
4637
+ }),
4638
+ tags: Optional(_Array_(String$1({ maxLength: 128 }), { maxItems: 20 }))
4639
+ });
4640
+ _Object_({
4641
+ title: Optional(String$1({ maxLength: 255 })),
4642
+ content: Optional(String$1({
4643
+ minLength: 1,
4644
+ maxLength: 1e5
4645
+ })),
4646
+ tags: Optional(_Array_(String$1({ maxLength: 128 }), { maxItems: 20 }))
4647
+ });
4648
+ _Object_({
4649
+ query: Optional(String$1({
4650
+ minLength: 1,
4651
+ maxLength: 500
4652
+ })),
4653
+ tags: Optional(_Array_(String$1({ maxLength: 128 }), {
4654
+ minItems: 1,
4655
+ maxItems: 20,
4656
+ description: "Filter: entry must have ALL specified tags"
4657
+ })),
4658
+ limit: Optional(Number$1({
4659
+ minimum: 1,
4660
+ maximum: 100,
4661
+ default: 20
4662
+ })),
4663
+ offset: Optional(Number$1({
4664
+ minimum: 0,
4665
+ default: 0
4666
+ }))
4667
+ });
4668
+ _Object_({
4669
+ identityId: UuidSchema,
4670
+ publicKey: PublicKeySchema,
4671
+ fingerprint: FingerprintSchema,
4672
+ createdAt: TimestampSchema
4673
+ });
4674
+ _Object_({
4675
+ publicKey: PublicKeySchema,
4676
+ fingerprint: FingerprintSchema
4677
+ });
4678
+ _Object_({ message: String$1({
4679
+ minLength: 1,
4680
+ maxLength: 1e4
4681
+ }) });
4682
+ _Object_({
4683
+ message: String$1(),
4684
+ signature: String$1({ description: "Base64 encoded Ed25519 signature" }),
4685
+ publicKey: PublicKeySchema
4686
+ });
4687
+ _Object_({
4688
+ message: String$1({
4689
+ minLength: 1,
4690
+ maxLength: 1e4
4691
+ }),
4692
+ signature: String$1({ description: "Base64 encoded signature" }),
4693
+ publicKey: PublicKeySchema
4694
+ });
4695
+ _Object_({
4696
+ valid: Boolean$1(),
4697
+ signer: Optional(_Object_({ fingerprint: FingerprintSchema }))
4698
+ });
4699
+ var BaseAuthContextSchema = _Object_({
4700
+ identityId: UuidSchema,
4701
+ scopes: _Array_(String$1()),
4702
+ subjectType: Union([Literal("agent"), Literal("human")]),
4703
+ currentTeamId: Union([UuidSchema, Null()])
4704
+ });
4705
+ Union([Intersect([BaseAuthContextSchema, _Object_({
4706
+ subjectType: Literal("agent"),
4707
+ publicKey: PublicKeySchema,
4708
+ fingerprint: FingerprintSchema,
4709
+ clientId: String$1()
4710
+ })]), Intersect([BaseAuthContextSchema, _Object_({
4711
+ subjectType: Literal("human"),
4712
+ clientId: Union([String$1(), Null()])
4713
+ })])]);
4714
+ _Object_({
4715
+ success: Boolean$1(),
4716
+ message: Optional(String$1())
4717
+ });
4718
+ _Object_({ diaryId: UuidSchema });
4719
+ _Object_({
4720
+ diaryId: UuidSchema,
4721
+ entryId: UuidSchema
4722
+ });
4723
+ _Object_({ entryId: UuidSchema });
4724
+ _Object_({ id: UuidSchema });
4725
+ _Object_({
4726
+ publicKey: PublicKeySchema,
4727
+ fingerprint: FingerprintSchema,
4728
+ agentName: String$1({
4729
+ minLength: 1,
4730
+ maxLength: 34
4731
+ }),
4732
+ org: Optional(String$1({
4733
+ minLength: 1,
4734
+ maxLength: 39,
4735
+ pattern: "^[a-zA-Z0-9-]+$",
4736
+ description: "GitHub organization name. When provided, the GitHub App will be created under this org instead of the personal account."
4737
+ }))
4738
+ });
4739
+ _Object_({
4740
+ workflowId: String$1(),
4741
+ manifestFormUrl: String$1()
4742
+ });
4743
+ _Object_({
4744
+ status: Union([
4745
+ Literal("awaiting_github"),
4746
+ Literal("github_code_ready"),
4747
+ Literal("awaiting_installation"),
4748
+ Literal("completed"),
4749
+ Literal("failed")
4750
+ ]),
4751
+ githubCode: Optional(String$1()),
4752
+ identityId: Optional(String$1()),
4753
+ clientId: Optional(String$1()),
4754
+ clientSecret: Optional(String$1()),
4755
+ installationId: Optional(String$1())
4756
+ });
4757
+ _Object_({
4758
+ wf: String$1({
4759
+ minLength: 1,
4760
+ description: "Workflow ID baked into setup_url"
4761
+ }),
4762
+ installation_id: String$1({ minLength: 1 }),
4763
+ setup_action: Optional(String$1())
4764
+ });
4765
+ _Object_({ id: UuidSchema });
4766
+ _Object_({
4767
+ id: UuidSchema,
4768
+ subjectId: UuidSchema
4769
+ });
4770
+ _Object_({
4771
+ id: UuidSchema,
4772
+ inviteId: UuidSchema
4773
+ });
4774
+ _Object_({ name: String$1({
4775
+ minLength: 1,
4776
+ maxLength: 255
4777
+ }) });
4778
+ _Object_({
4779
+ role: Optional(Union([Literal("manager"), Literal("member")])),
4780
+ maxUses: Optional(Integer({
4781
+ minimum: 1,
4782
+ default: 1
4783
+ })),
4784
+ expiresInHours: Optional(Integer({
4785
+ minimum: 1,
4786
+ maximum: 720,
4787
+ default: 168
4788
+ }))
4789
+ });
4790
+ _Object_({ code: String$1({ minLength: 1 }) });
4791
+ _Object_({ role: Union([Literal("manager"), Literal("member")]) });
4792
+ var TeamRoleSchema = Union([
4793
+ Literal("owner"),
4794
+ Literal("manager"),
4795
+ Literal("member")
4796
+ ]);
4797
+ _Object_({
4798
+ id: UuidSchema,
4799
+ name: String$1()
4800
+ });
4801
+ var DateTimeUnsafe = Unsafe(String$1({ format: "date-time" }));
4802
+ _Object_({
4803
+ id: UuidSchema,
4804
+ code: String$1(),
4805
+ role: Union([Literal("manager"), Literal("member")]),
4806
+ maxUses: Integer(),
4807
+ useCount: Integer(),
4808
+ expiresAt: DateTimeUnsafe,
4809
+ createdAt: DateTimeUnsafe
4810
+ });
4811
+ var TeamMemberSchema = _Object_({
4812
+ subjectId: UuidSchema,
4813
+ subjectType: Union([Literal("agent"), Literal("human")]),
4814
+ role: TeamRoleSchema,
4815
+ displayName: String$1(),
4816
+ fingerprint: Optional(String$1()),
4817
+ email: Optional(String$1())
4818
+ });
4819
+ _Object_({
4820
+ id: UuidSchema,
4821
+ name: String$1(),
4822
+ personal: Boolean$1(),
4823
+ status: String$1(),
4824
+ role: TeamRoleSchema
4825
+ });
4826
+ _Object_({
4827
+ id: UuidSchema,
4828
+ name: String$1(),
4829
+ status: String$1(),
4830
+ personal: Boolean$1(),
4831
+ createdAt: DateTimeUnsafe,
4832
+ updatedAt: DateTimeUnsafe,
4833
+ members: _Array_(TeamMemberSchema)
4834
+ });
4835
+ _Object_({
4836
+ teamId: UuidSchema,
4837
+ role: Union([Literal("manager"), Literal("member")])
4838
+ });
4839
+ _Object_({
4840
+ updated: Boolean$1(),
4841
+ role: Union([Literal("manager"), Literal("member")])
4842
+ });
4843
+ _Object_({ deleted: Boolean$1() });
4844
+ _Object_({ removed: Boolean$1() });
4845
+ var FoundingMemberSchema = _Object_({
4846
+ subjectId: UuidSchema,
4847
+ subjectNs: Union([Literal("Agent"), Literal("Human")]),
4848
+ role: Union([
4849
+ Literal("owner"),
4850
+ Literal("manager"),
4851
+ Literal("member")
4852
+ ])
4853
+ });
4854
+ _Object_({
4855
+ name: String$1({
4856
+ minLength: 1,
4857
+ maxLength: 255
4858
+ }),
4859
+ foundingMembers: Optional(_Array_(FoundingMemberSchema, { minItems: 1 }))
4860
+ });
4861
+ _Object_({
4862
+ id: UuidSchema,
4863
+ name: String$1(),
4864
+ status: String$1(),
4865
+ workflowId: Optional(String$1())
4866
+ });
4867
+ _Object_({});
4868
+ _Object_({
4869
+ accepted: Boolean$1(),
4870
+ teamStatus: String$1()
4871
+ });
4872
+ _Object_({ destinationTeamId: UuidSchema });
4873
+ _Object_({ transferId: UuidSchema });
4874
+ _Object_({ items: _Array_(_Object_({
4875
+ id: UuidSchema,
4876
+ diaryId: UuidSchema,
4877
+ sourceTeamId: UuidSchema,
4878
+ destinationTeamId: UuidSchema,
4879
+ status: String$1(),
4880
+ initiatedBy: UuidSchema,
4881
+ expiresAt: Unsafe(String$1({ format: "date-time" })),
4882
+ createdAt: Unsafe(String$1({ format: "date-time" }))
4883
+ })) });
4884
+ _Object_({ groupId: UuidSchema });
4885
+ _Object_({
4886
+ groupId: UuidSchema,
4887
+ subjectId: UuidSchema
4888
+ });
4889
+ _Object_({ name: String$1({
4890
+ minLength: 1,
4891
+ maxLength: 255
4892
+ }) });
4893
+ _Object_({
4894
+ subjectId: UuidSchema,
4895
+ subjectNs: Optional(Union([Literal("Agent"), Literal("Human")]))
4896
+ });
4897
+ _Object_({
4898
+ id: UuidSchema,
4899
+ name: String$1(),
4900
+ teamId: UuidSchema
4901
+ });
4902
+ var GroupMemberResponseSchema = _Object_({
4903
+ subjectId: UuidSchema,
4904
+ subjectNs: String$1()
4905
+ });
4906
+ _Object_({
4907
+ id: UuidSchema,
4908
+ name: String$1(),
4909
+ teamId: UuidSchema,
4910
+ createdAt: DateTimeUnsafe,
4911
+ members: _Array_(GroupMemberResponseSchema)
4912
+ });
4913
+ var DiaryGrantRoleSchema = Union([Literal("writer"), Literal("manager")]);
4914
+ var GrantSubjectNsSchema = Union([
4915
+ Literal("Agent"),
4916
+ Literal("Human"),
4917
+ Literal("Group")
4918
+ ]);
4919
+ _Object_({
4920
+ subjectId: UuidSchema,
4921
+ subjectNs: GrantSubjectNsSchema,
4922
+ role: DiaryGrantRoleSchema
4923
+ });
4924
+ _Object_({
4925
+ subjectId: UuidSchema,
4926
+ subjectNs: GrantSubjectNsSchema,
4927
+ role: DiaryGrantRoleSchema
4928
+ });
4929
+ _Object_({ grants: _Array_(_Object_({
4930
+ subjectId: UuidSchema,
4931
+ subjectNs: GrantSubjectNsSchema,
4932
+ role: DiaryGrantRoleSchema
4933
+ })) });
4934
+ _Object_({ revoked: Boolean$1() });
4935
+ _Object_({ "x-moltnet-team-id": String$1({
4936
+ format: "uuid",
4937
+ description: "Team ID (UUID) that will own the resource. Required."
4938
+ }) });
4939
+ _Object_({ "x-moltnet-team-id": Optional(String$1({
4940
+ format: "uuid",
4941
+ description: "Team ID (UUID) for scoping the request. Optional."
4942
+ })) });
4943
+ _Object_({
4944
+ kind: Literal("agent"),
4945
+ identityId: UuidSchema,
4946
+ fingerprint: FingerprintSchema,
4947
+ publicKey: PublicKeySchema
4948
+ }, {
4949
+ $id: "AgentPrincipal",
4950
+ additionalProperties: false
4951
+ });
4952
+ _Object_({
4953
+ kind: Literal("human"),
4954
+ humanId: UuidSchema,
4955
+ identityId: Union([UuidSchema, Null()])
4956
+ }, {
4957
+ $id: "HumanPrincipal",
4958
+ additionalProperties: false
4959
+ });
4960
+ var principalUnionVariants = [_Object_({
4961
+ kind: Literal("agent"),
4962
+ identityId: UuidSchema,
4963
+ fingerprint: FingerprintSchema,
4964
+ publicKey: PublicKeySchema
4965
+ }, { additionalProperties: false }), _Object_({
4966
+ kind: Literal("human"),
4967
+ humanId: UuidSchema,
4968
+ identityId: Union([UuidSchema, Null()])
4969
+ }, { additionalProperties: false })];
4970
+ Union(principalUnionVariants, {
4971
+ $id: "PrincipalIdentity",
4972
+ discriminator: { propertyName: "kind" }
4973
+ });
4974
+ /**
4975
+ * `$id`-less twin of `PrincipalIdentitySchema`. Required anywhere the
4976
+ * schema is **embedded** inline into another schema (MCP `outputSchema`
4977
+ * — every tool that returns a creator-bearing object embeds its own
4978
+ * copy; provenance-graph node `meta.creator`, etc.). Ajv 8 throws
4979
+ * `reference "PrincipalIdentity" resolves to more than one schema` if
4980
+ * the same `$id` appears twice in the same compilation pass, which is
4981
+ * exactly what happens when the MCP server lists tools and Ajv
4982
+ * traverses every advertised `outputSchema`.
4983
+ *
4984
+ * Structurally identical to `PrincipalIdentitySchema` (they share the
4985
+ * variants array); change one, change both.
4986
+ */
4987
+ var PrincipalIdentitySchemaInline = Union(principalUnionVariants, { discriminator: { propertyName: "kind" } });
4988
+ //#endregion
4989
+ //#region ../../libs/models/src/problem-details.ts
4990
+ var ProblemCodeSchema = Union([
4991
+ Literal("UNAUTHORIZED"),
4992
+ Literal("FORBIDDEN"),
4993
+ Literal("NOT_FOUND"),
4994
+ Literal("CONFLICT"),
4995
+ Literal("UNSUPPORTED_MEDIA_TYPE"),
4996
+ Literal("VALIDATION_FAILED"),
4997
+ Literal("INVALID_CHALLENGE"),
4998
+ Literal("INVALID_SIGNATURE"),
4999
+ Literal("VOUCHER_LIMIT"),
5000
+ Literal("RATE_LIMIT_EXCEEDED"),
5001
+ Literal("SERIALIZATION_EXHAUSTED"),
5002
+ Literal("SIGNING_REQUEST_EXPIRED"),
5003
+ Literal("SIGNING_REQUEST_ALREADY_COMPLETED"),
5004
+ Literal("SIGNING_REQUEST_LIMIT_REACHED"),
5005
+ Literal("REGISTRATION_FAILED"),
5006
+ Literal("UPSTREAM_ERROR"),
5007
+ Literal("SERVICE_UNAVAILABLE"),
5008
+ Literal("INTERNAL_SERVER_ERROR"),
5009
+ Literal("TEAM_PERSONAL_IMMUTABLE"),
5010
+ Literal("TEAM_NOT_ACTIVE"),
5011
+ Literal("INVITE_EXPIRED"),
5012
+ Literal("INVITE_EXHAUSTED"),
5013
+ Literal("TEAM_LAST_OWNER"),
5014
+ Literal("TEAM_ALREADY_ACTIVE"),
5015
+ Literal("TEAM_NOT_FOUNDING"),
5016
+ Literal("FOUNDING_ALREADY_ACCEPTED"),
5017
+ Literal("DIARY_TRANSFER_PENDING"),
5018
+ Literal("DIARY_TRANSFER_NOT_FOUND"),
5019
+ Literal("DIARY_TRANSFER_ALREADY_RESOLVED")
5020
+ ]);
5021
+ var ProblemDetailsSchema = _Object_({
5022
+ type: String$1({ format: "uri" }),
5023
+ title: String$1(),
5024
+ status: Integer({
5025
+ minimum: 100,
5026
+ maximum: 599
5027
+ }),
5028
+ code: ProblemCodeSchema,
5029
+ detail: Optional(String$1()),
5030
+ instance: Optional(String$1())
5031
+ }, {
5032
+ $id: "ProblemDetails",
5033
+ additionalProperties: true
5034
+ });
5035
+ _Object_({
5036
+ field: String$1(),
5037
+ message: String$1(),
5038
+ code: Optional(String$1())
5039
+ }, {
5040
+ $id: "ValidationError",
5041
+ additionalProperties: false
5042
+ });
5043
+ _Object_({
5044
+ resource: String$1(),
5045
+ id: Optional(String$1({ format: "uuid" })),
5046
+ keys: Optional(Record(String$1(), String$1()))
5047
+ }, {
5048
+ $id: "ConflictTarget",
5049
+ additionalProperties: false
5050
+ });
5051
+ _Object_({
5052
+ constraint: Optional(String$1()),
5053
+ target: Optional(Ref$1("ConflictTarget"))
5054
+ }, {
5055
+ $id: "ConflictError",
5056
+ additionalProperties: false
5057
+ });
5058
+ var ConflictProblemDetailsSchema = Intersect([ProblemDetailsSchema, _Object_({ conflict: Ref$1("ConflictError") })], { $id: "ConflictProblemDetails" });
5059
+ _Object_({
5060
+ type: String$1(),
5061
+ severity: Number$1(),
5062
+ match: String$1()
5063
+ }, {
5064
+ $id: "InjectionThreat",
5065
+ additionalProperties: false
5066
+ });
5067
+ Intersect([ConflictProblemDetailsSchema, _Object_({ flagged: Optional(_Array_(_Object_({
5068
+ id: String$1({ format: "uuid" }),
5069
+ threats: _Array_(Ref$1("InjectionThreat"))
5070
+ }, { additionalProperties: false }))) })], { $id: "InjectionConflictProblemDetails" });
5071
+ Intersect([ProblemDetailsSchema, _Object_({ errors: _Array_(Ref$1("ValidationError")) })], { $id: "ValidationProblemDetails" });
5072
+ Union([
5073
+ Literal("pack"),
5074
+ Literal("entry"),
5075
+ Literal("rendered_pack")
5076
+ ]);
5077
+ var ProvenanceGraphEdgeKindSchema = Union([
5078
+ Literal("includes"),
5079
+ Literal("supersedes"),
5080
+ Literal("rendered_from")
5081
+ ]);
5082
+ var ProvenanceGraphPackMetaSchema = _Object_({
5083
+ packId: UuidSchema,
5084
+ diaryId: UuidSchema,
5085
+ packCid: String$1(),
5086
+ packType: String$1(),
5087
+ packCodec: String$1(),
5088
+ pinned: Boolean$1(),
5089
+ createdAt: TimestampSchema,
5090
+ expiresAt: Union([TimestampSchema, Null()]),
5091
+ supersedesPackId: Union([UuidSchema, Null()])
5092
+ });
5093
+ /**
5094
+ * Discriminated creator embedded inside provenance-node response
5095
+ * payloads. Re-uses the shared `PrincipalIdentitySchemaInline` (the
5096
+ * `$id`-less twin) — embedding the named `PrincipalIdentitySchema`
5097
+ * here would clash with the top-level registration via @fastify/swagger
5098
+ * (`reference "PrincipalIdentity" resolves to more than one schema`).
5099
+ */
5100
+ var ProvenanceGraphCreatorSchema = PrincipalIdentitySchemaInline;
5101
+ var ProvenanceGraphEntryMetaSchema = _Object_({
5102
+ entryId: UuidSchema,
5103
+ diaryId: UuidSchema,
5104
+ entryType: EntryTypeSchema,
5105
+ contentHash: Union([String$1(), Null()]),
5106
+ createdAt: TimestampSchema,
5107
+ updatedAt: TimestampSchema,
5108
+ signed: Boolean$1(),
5109
+ title: Union([String$1(), Null()]),
5110
+ tags: _Array_(String$1()),
5111
+ creator: Optional(ProvenanceGraphCreatorSchema)
5112
+ });
5113
+ var ProvenanceGraphPackNodeSchema = _Object_({
5114
+ id: String$1(),
5115
+ kind: Literal("pack"),
5116
+ label: String$1(),
5117
+ cid: Union([String$1(), Null()]),
5118
+ meta: Intersect([ProvenanceGraphPackMetaSchema, _Object_({ creator: Optional(ProvenanceGraphCreatorSchema) })])
5119
+ });
5120
+ var ProvenanceGraphEntryNodeSchema = _Object_({
5121
+ id: String$1(),
5122
+ kind: Literal("entry"),
5123
+ label: String$1(),
5124
+ cid: Union([String$1(), Null()]),
5125
+ meta: ProvenanceGraphEntryMetaSchema
5126
+ });
5127
+ var ProvenanceGraphRenderedPackMetaSchema = _Object_({
5128
+ renderedPackId: UuidSchema,
5129
+ sourcePackId: UuidSchema,
5130
+ diaryId: UuidSchema,
5131
+ packCid: String$1(),
5132
+ renderMethod: String$1(),
5133
+ totalTokens: Number$1(),
5134
+ pinned: Boolean$1(),
5135
+ createdAt: TimestampSchema,
5136
+ expiresAt: Union([TimestampSchema, Null()]),
5137
+ creator: Optional(ProvenanceGraphCreatorSchema)
5138
+ });
5139
+ var ProvenanceGraphNodeSchema = Union([
5140
+ ProvenanceGraphPackNodeSchema,
5141
+ ProvenanceGraphEntryNodeSchema,
5142
+ _Object_({
5143
+ id: String$1(),
5144
+ kind: Literal("rendered_pack"),
5145
+ label: String$1(),
5146
+ cid: Union([String$1(), Null()]),
5147
+ meta: ProvenanceGraphRenderedPackMetaSchema
5148
+ })
5149
+ ]);
5150
+ var ProvenanceGraphEdgeSchema = _Object_({
5151
+ id: String$1(),
5152
+ from: String$1(),
5153
+ to: String$1(),
5154
+ kind: ProvenanceGraphEdgeKindSchema,
5155
+ label: Optional(String$1()),
5156
+ meta: Optional(Record(String$1(), Union([
5157
+ String$1(),
5158
+ Number$1(),
5159
+ Boolean$1(),
5160
+ Null()
5161
+ ])))
5162
+ });
5163
+ _Object_({
5164
+ metadata: _Object_({
5165
+ format: Literal("moltnet.provenance-graph/v1"),
5166
+ generatedAt: TimestampSchema,
5167
+ rootNodeId: String$1(),
5168
+ rootPackId: UuidSchema,
5169
+ depth: Number$1({ minimum: 0 })
5170
+ }),
5171
+ nodes: _Array_(ProvenanceGraphNodeSchema),
5172
+ edges: _Array_(ProvenanceGraphEdgeSchema)
5173
+ }, { $id: "ProvenanceGraph" });
5174
+ //#endregion
5175
+ //#region ../../libs/models/src/signer-constraint.ts
5176
+ var SIGNER_CONSTRAINT_TYPE = {
5177
+ Human: "human",
5178
+ TeamRole: "team-role",
5179
+ Group: "group"
5180
+ };
5181
+ Union([
5182
+ _Object_({
5183
+ type: Literal(SIGNER_CONSTRAINT_TYPE.Human),
5184
+ id: String$1({ format: "uuid" })
5185
+ }),
5186
+ _Object_({
5187
+ type: Literal(SIGNER_CONSTRAINT_TYPE.TeamRole),
5188
+ id: TeamRoleSchema
5189
+ }),
5190
+ _Object_({
5191
+ type: Literal(SIGNER_CONSTRAINT_TYPE.Group),
5192
+ id: String$1({ format: "uuid" })
5193
+ })
5194
+ ]);
5195
+ //#endregion
5196
+ //#region ../../libs/models/src/signer-protocol.ts
5197
+ function schemaRef(schema) {
5198
+ return Ref$1(schemaId(schema));
5199
+ }
5200
+ function schemaId(schema) {
5201
+ const id = schema.$id;
5202
+ if (typeof id !== "string" || id.length === 0) throw new Error("Signer protocol schemas must have an identifier");
5203
+ return id;
5204
+ }
5205
+ var SignerBase64UrlSchema = PreviewSignBase64UrlSchema;
5206
+ var SignerUuidSchema = String$1({
5207
+ $id: "SignerUuid",
5208
+ pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
5209
+ });
5210
+ var SignerOperationSchema = Union([
5211
+ Literal("credential-enrollment"),
5212
+ Literal("credential-registration"),
5213
+ Literal("signing-request")
5214
+ ], { $id: "SignerOperation" });
5215
+ var SignerChallengeOperationSchema = PreviewSignChallengeOperationSchema;
5216
+ var SignerPreviewSignPublicMaterialSchema = PreviewSignPublicMaterialSchema;
5217
+ var SignerPreviewSignChallengeValueSchema = PreviewSignChallengeValueSchema;
5218
+ var SignerProblemSchema = _Object_({
5219
+ code: String$1({ minLength: 1 }),
5220
+ message: String$1({ minLength: 1 })
5221
+ }, {
5222
+ $id: "SignerProblem",
5223
+ additionalProperties: false
5224
+ });
5225
+ var SignerCeremonyParamsSchema = _Object_({ ceremonyId: Unsafe(schemaRef(SignerBase64UrlSchema)) }, {
5226
+ $id: "SignerCeremonyParams",
5227
+ additionalProperties: false
5228
+ });
5229
+ var SignerSessionSchema = _Object_({
5230
+ version: Literal(1),
5231
+ token: Unsafe(schemaRef(SignerBase64UrlSchema)),
5232
+ expiresAt: String$1()
5233
+ }, {
5234
+ $id: "SignerSession",
5235
+ additionalProperties: false
5236
+ });
5237
+ var SignerEnrollmentCeremonyRequestSchema = _Object_({
5238
+ version: Literal(1),
5239
+ operation: Literal("credential-enrollment"),
5240
+ label: String$1({
5241
+ minLength: 1,
5242
+ maxLength: 255
5243
+ }),
5244
+ teamId: Unsafe(schemaRef(SignerUuidSchema))
5245
+ }, {
5246
+ $id: "SignerEnrollmentCeremonyRequest",
5247
+ additionalProperties: false
5248
+ });
5249
+ var SignerChallengeCeremonyRequestSchema = _Object_({
5250
+ version: Literal(1),
5251
+ operation: Unsafe(schemaRef(SignerChallengeOperationSchema)),
5252
+ resourceId: Unsafe(schemaRef(SignerUuidSchema)),
5253
+ challenge: Unsafe(schemaRef(SignerPreviewSignChallengeValueSchema))
5254
+ }, {
5255
+ $id: "SignerChallengeCeremonyRequest",
5256
+ additionalProperties: false
5257
+ });
5258
+ var SignerCeremonyRequestSchema = Union([Unsafe(schemaRef(SignerEnrollmentCeremonyRequestSchema)), Unsafe(schemaRef(SignerChallengeCeremonyRequestSchema))], { $id: "SignerCeremonyRequest" });
5259
+ var SignerCeremonySchema = _Object_({
5260
+ version: Literal(1),
5261
+ id: Unsafe(schemaRef(SignerBase64UrlSchema)),
5262
+ operation: Unsafe(schemaRef(SignerOperationSchema)),
5263
+ approvalUrl: String$1(),
5264
+ expiresAt: String$1()
5265
+ }, {
5266
+ $id: "SignerCeremony",
5267
+ additionalProperties: false
5268
+ });
5269
+ var SignerPendingResultSchema = _Object_({
5270
+ version: Literal(1),
5271
+ status: Literal("pending"),
5272
+ operation: Unsafe(schemaRef(SignerOperationSchema))
5273
+ }, {
5274
+ $id: "SignerPendingResult",
5275
+ additionalProperties: false
5276
+ });
5277
+ var SignerEnrollmentResultSchema = _Object_({
5278
+ version: Literal(1),
5279
+ status: Literal("completed"),
5280
+ operation: Literal("credential-enrollment"),
5281
+ publicMaterial: Unsafe(schemaRef(SignerPreviewSignPublicMaterialSchema))
5282
+ }, {
5283
+ $id: "SignerEnrollmentResult",
5284
+ additionalProperties: false
5285
+ });
5286
+ var SignerReceiptSchema = PreviewSignReceiptValueSchema;
5287
+ var SignerSignatureResultSchema = _Object_({
5288
+ version: Literal(1),
5289
+ status: Literal("completed"),
5290
+ operation: Unsafe(schemaRef(SignerChallengeOperationSchema)),
5291
+ receipt: Unsafe(schemaRef(SignerReceiptSchema))
5292
+ }, {
5293
+ $id: "SignerSignatureResult",
5294
+ additionalProperties: false
5295
+ });
5296
+ var SignerFailedResultSchema = _Object_({
5297
+ version: Literal(1),
5298
+ status: Literal("failed"),
5299
+ operation: Unsafe(schemaRef(SignerOperationSchema)),
5300
+ code: String$1(),
5301
+ message: String$1()
5302
+ }, {
5303
+ $id: "SignerFailedResult",
5304
+ additionalProperties: false
5305
+ });
5306
+ var SignerCeremonyResultSchema = Union([
5307
+ Unsafe(schemaRef(SignerPendingResultSchema)),
5308
+ Unsafe(schemaRef(SignerEnrollmentResultSchema)),
5309
+ Unsafe(schemaRef(SignerSignatureResultSchema)),
5310
+ Unsafe(schemaRef(SignerFailedResultSchema))
5311
+ ], { $id: "SignerCeremonyResult" });
5312
+ ({ ...previewSignSchemaContext }), schemaId(SignerUuidSchema), schemaId(SignerOperationSchema), schemaId(SignerProblemSchema), schemaId(SignerCeremonyParamsSchema), schemaId(SignerSessionSchema), schemaId(SignerEnrollmentCeremonyRequestSchema), schemaId(SignerChallengeCeremonyRequestSchema), schemaId(SignerCeremonyRequestSchema), schemaId(SignerCeremonySchema), schemaId(SignerPendingResultSchema), schemaId(SignerEnrollmentResultSchema), schemaId(SignerSignatureResultSchema), schemaId(SignerFailedResultSchema), schemaId(SignerCeremonyResultSchema);
5313
+ //#endregion
5314
+ //#region ../../libs/models/src/tool-enforcement.ts
5315
+ var TOOL_ENFORCEMENT_VALUES = [
5316
+ "off",
5317
+ "watch",
5318
+ "enforce"
5319
+ ];
5320
+ var ToolEnforcementSchema = Union([
5321
+ Literal(TOOL_ENFORCEMENT_VALUES[0]),
5322
+ Literal(TOOL_ENFORCEMENT_VALUES[1]),
5323
+ Literal(TOOL_ENFORCEMENT_VALUES[2])
5324
+ ], { description: "Runtime tool-policy enforcement mode: off (inert), watch (audit only), enforce (block disallowed tools, fail-closed)." });
5325
+ //#endregion
4457
5326
  //#region ../../libs/tasks/src/runtime-profiles.ts
4458
5327
  var RuntimeProfileName = String$1({
4459
5328
  minLength: 1,
@@ -4480,11 +5349,7 @@ var RuntimeProfileWorkspaceMode = Union([
4480
5349
  * `off` (inert), `watch` (audit only), `enforce` (block disallowed tools,
4481
5350
  * fail-closed). Read by the daemon via `GET /runtime-profiles/:id/allowed-tools`.
4482
5351
  */
4483
- var RuntimeProfileToolEnforcement = Union([
4484
- Literal("off"),
4485
- Literal("watch"),
4486
- Literal("enforce")
4487
- ]);
5352
+ var RuntimeProfileToolEnforcement = ToolEnforcementSchema;
4488
5353
  var RuntimeProfileAllowedWorkspaceModes = _Array_(RuntimeProfileWorkspaceMode, {
4489
5354
  minItems: 1,
4490
5355
  maxItems: 3,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@themoltnet/agent-daemon",
3
- "version": "0.32.1",
3
+ "version": "0.32.2",
4
4
  "license": "AGPL-3.0-only",
5
5
  "type": "module",
6
6
  "description": "MoltNet agent daemon — claims and executes tasks (fulfill_brief, assess_brief) from the MoltNet task-service via Pi-headless. CLI: moltnet-agent.",
@@ -51,19 +51,19 @@
51
51
  "@opentelemetry/semantic-conventions": "^1.39.0",
52
52
  "pino": "^10.3.1",
53
53
  "pino-pretty": "^13.1.3",
54
- "@themoltnet/agent-runtime": "0.36.6",
55
54
  "@themoltnet/sdk": "0.127.0",
56
- "@themoltnet/pi-extension": "0.36.1"
55
+ "@themoltnet/agent-runtime": "0.36.6",
56
+ "@themoltnet/pi-extension": "0.36.2"
57
57
  },
58
58
  "devDependencies": {
59
59
  "tsx": "^4.7.0",
60
60
  "typescript": "~5.9.2",
61
61
  "vite": "^8.0.0",
62
62
  "vitest": "^3.0.0",
63
- "@moltnet/bootstrap": "0.1.0",
64
63
  "@moltnet/crypto-service": "0.1.0",
65
- "@moltnet/tasks": "0.1.0",
66
- "@moltnet/observability": "0.1.0"
64
+ "@moltnet/bootstrap": "0.1.0",
65
+ "@moltnet/observability": "0.1.0",
66
+ "@moltnet/tasks": "0.1.0"
67
67
  },
68
68
  "nx": {
69
69
  "projectType": "application",