omp-channel 0.0.0-stage → 0.2.0

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 (44) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +8 -0
  4. package/README.md +318 -2
  5. package/dist/adapter.d.ts +46 -0
  6. package/dist/adapter.js +18 -0
  7. package/dist/adapter.js.map +1 -0
  8. package/dist/config.d.ts +58 -0
  9. package/dist/config.js +140 -0
  10. package/dist/config.js.map +1 -0
  11. package/dist/dispatcher.d.ts +53 -0
  12. package/dist/dispatcher.js +242 -0
  13. package/dist/dispatcher.js.map +1 -0
  14. package/dist/extension.d.ts +27 -0
  15. package/dist/extension.js +151 -0
  16. package/dist/extension.js.map +1 -0
  17. package/dist/http-adapter.d.ts +20 -0
  18. package/dist/http-adapter.js +140 -0
  19. package/dist/http-adapter.js.map +1 -0
  20. package/dist/index.d.ts +11 -0
  21. package/dist/index.js +50 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/module-adapter.d.ts +3 -0
  24. package/dist/module-adapter.js +21 -0
  25. package/dist/module-adapter.js.map +1 -0
  26. package/dist/protocol.d.ts +113 -0
  27. package/dist/protocol.js +222 -0
  28. package/dist/protocol.js.map +1 -0
  29. package/dist/redact.d.ts +11 -0
  30. package/dist/redact.js +65 -0
  31. package/dist/redact.js.map +1 -0
  32. package/dist/tool-schema.d.ts +13 -0
  33. package/dist/tool-schema.js +13 -0
  34. package/dist/tool-schema.js.map +1 -0
  35. package/dist/turn.d.ts +24 -0
  36. package/dist/turn.js +60 -0
  37. package/dist/turn.js.map +1 -0
  38. package/docs/protocol.md +334 -0
  39. package/package.json +76 -4
  40. package/schema/config.schema.json +159 -0
  41. package/schema/failure.schema.json +34 -0
  42. package/schema/inbound-event.schema.json +82 -0
  43. package/schema/outbound-reply.schema.json +34 -0
  44. package/schema/status.schema.json +22 -0
@@ -0,0 +1,82 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.com/omp-channel/schema/inbound-event.schema.json",
4
+ "title": "Inbound event (service to agent)",
5
+ "description": "An event the service sends to the agent. Identifiers use letters, digits, dot, colon, underscore and dash.",
6
+ "$defs": {
7
+ "id": {
8
+ "type": "string",
9
+ "minLength": 1,
10
+ "maxLength": 128,
11
+ "pattern": "^[A-Za-z0-9._:-]+$"
12
+ }
13
+ },
14
+ "oneOf": [
15
+ {
16
+ "title": "message",
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "required": ["type", "conversationId", "messageId", "sender", "text", "attribution"],
20
+ "properties": {
21
+ "type": {
22
+ "const": "message"
23
+ },
24
+ "conversationId": {
25
+ "$ref": "#/$defs/id"
26
+ },
27
+ "messageId": {
28
+ "$ref": "#/$defs/id"
29
+ },
30
+ "sender": {
31
+ "type": "string",
32
+ "minLength": 1,
33
+ "maxLength": 64
34
+ },
35
+ "text": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "maxLength": 4000
39
+ },
40
+ "sentAt": {
41
+ "type": "string",
42
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$"
43
+ },
44
+ "replyTo": {
45
+ "$ref": "#/$defs/id"
46
+ },
47
+ "attribution": {
48
+ "type": "string",
49
+ "enum": ["user", "agent"]
50
+ }
51
+ }
52
+ },
53
+ {
54
+ "title": "interrupt",
55
+ "type": "object",
56
+ "additionalProperties": false,
57
+ "required": ["type", "conversationId"],
58
+ "properties": {
59
+ "type": {
60
+ "const": "interrupt"
61
+ },
62
+ "conversationId": {
63
+ "$ref": "#/$defs/id"
64
+ }
65
+ }
66
+ },
67
+ {
68
+ "title": "close",
69
+ "type": "object",
70
+ "additionalProperties": false,
71
+ "required": ["type", "conversationId"],
72
+ "properties": {
73
+ "type": {
74
+ "const": "close"
75
+ },
76
+ "conversationId": {
77
+ "$ref": "#/$defs/id"
78
+ }
79
+ }
80
+ }
81
+ ]
82
+ }
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.com/omp-channel/schema/outbound-reply.schema.json",
4
+ "title": "Outbound reply (agent to service)",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["type", "conversationId", "messageId", "replyTo", "text", "at"],
8
+ "properties": {
9
+ "type": { "const": "reply" },
10
+ "conversationId": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "maxLength": 128,
14
+ "pattern": "^[A-Za-z0-9._:-]+$"
15
+ },
16
+ "messageId": {
17
+ "type": "string",
18
+ "minLength": 1,
19
+ "maxLength": 128,
20
+ "pattern": "^[A-Za-z0-9._:-]+$"
21
+ },
22
+ "replyTo": {
23
+ "type": "string",
24
+ "minLength": 1,
25
+ "maxLength": 128,
26
+ "pattern": "^[A-Za-z0-9._:-]+$"
27
+ },
28
+ "text": { "type": "string", "minLength": 1, "maxLength": 20000 },
29
+ "at": {
30
+ "type": "string",
31
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$"
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://example.com/omp-channel/schema/status.schema.json",
4
+ "title": "Agent status (agent to service)",
5
+ "type": "object",
6
+ "additionalProperties": false,
7
+ "required": ["type", "conversationId", "status", "at"],
8
+ "properties": {
9
+ "type": { "const": "status" },
10
+ "conversationId": {
11
+ "type": "string",
12
+ "minLength": 1,
13
+ "maxLength": 128,
14
+ "pattern": "^[A-Za-z0-9._:-]+$"
15
+ },
16
+ "status": { "type": "string", "enum": ["working", "free"] },
17
+ "at": {
18
+ "type": "string",
19
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})$"
20
+ }
21
+ }
22
+ }