digital-workers 0.1.1 → 2.0.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 (83) hide show
  1. package/.turbo/turbo-build.log +5 -0
  2. package/CHANGELOG.md +9 -0
  3. package/README.md +290 -106
  4. package/dist/actions.d.ts +95 -0
  5. package/dist/actions.d.ts.map +1 -0
  6. package/dist/actions.js +437 -0
  7. package/dist/actions.js.map +1 -0
  8. package/dist/approve.d.ts +49 -0
  9. package/dist/approve.d.ts.map +1 -0
  10. package/dist/approve.js +235 -0
  11. package/dist/approve.js.map +1 -0
  12. package/dist/ask.d.ts +42 -0
  13. package/dist/ask.d.ts.map +1 -0
  14. package/dist/ask.js +227 -0
  15. package/dist/ask.js.map +1 -0
  16. package/dist/decide.d.ts +62 -0
  17. package/dist/decide.d.ts.map +1 -0
  18. package/dist/decide.js +245 -0
  19. package/dist/decide.js.map +1 -0
  20. package/dist/do.d.ts +63 -0
  21. package/dist/do.d.ts.map +1 -0
  22. package/dist/do.js +228 -0
  23. package/dist/do.js.map +1 -0
  24. package/dist/generate.d.ts +61 -0
  25. package/dist/generate.d.ts.map +1 -0
  26. package/dist/generate.js +299 -0
  27. package/dist/generate.js.map +1 -0
  28. package/dist/goals.d.ts +89 -0
  29. package/dist/goals.d.ts.map +1 -0
  30. package/dist/goals.js +206 -0
  31. package/dist/goals.js.map +1 -0
  32. package/dist/index.d.ts +68 -0
  33. package/dist/index.d.ts.map +1 -0
  34. package/dist/index.js +69 -0
  35. package/dist/index.js.map +1 -0
  36. package/dist/is.d.ts +54 -0
  37. package/dist/is.d.ts.map +1 -0
  38. package/dist/is.js +318 -0
  39. package/dist/is.js.map +1 -0
  40. package/dist/kpis.d.ts +103 -0
  41. package/dist/kpis.d.ts.map +1 -0
  42. package/dist/kpis.js +271 -0
  43. package/dist/kpis.js.map +1 -0
  44. package/dist/notify.d.ts +47 -0
  45. package/dist/notify.d.ts.map +1 -0
  46. package/dist/notify.js +220 -0
  47. package/dist/notify.js.map +1 -0
  48. package/dist/role.d.ts +53 -0
  49. package/dist/role.d.ts.map +1 -0
  50. package/dist/role.js +111 -0
  51. package/dist/role.js.map +1 -0
  52. package/dist/team.d.ts +61 -0
  53. package/dist/team.d.ts.map +1 -0
  54. package/dist/team.js +131 -0
  55. package/dist/team.js.map +1 -0
  56. package/dist/transports.d.ts +164 -0
  57. package/dist/transports.d.ts.map +1 -0
  58. package/dist/transports.js +358 -0
  59. package/dist/transports.js.map +1 -0
  60. package/dist/types.d.ts +693 -0
  61. package/dist/types.d.ts.map +1 -0
  62. package/dist/types.js +72 -0
  63. package/dist/types.js.map +1 -0
  64. package/package.json +27 -61
  65. package/src/actions.ts +615 -0
  66. package/src/approve.ts +317 -0
  67. package/src/ask.ts +304 -0
  68. package/src/decide.ts +295 -0
  69. package/src/do.ts +275 -0
  70. package/src/generate.ts +364 -0
  71. package/src/goals.ts +220 -0
  72. package/src/index.ts +118 -0
  73. package/src/is.ts +372 -0
  74. package/src/kpis.ts +348 -0
  75. package/src/notify.ts +303 -0
  76. package/src/role.ts +116 -0
  77. package/src/team.ts +142 -0
  78. package/src/transports.ts +504 -0
  79. package/src/types.ts +843 -0
  80. package/test/actions.test.ts +546 -0
  81. package/test/standalone.test.ts +299 -0
  82. package/test/types.test.ts +460 -0
  83. package/tsconfig.json +9 -0
package/dist/types.js ADDED
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Type definitions for digital-workers
3
+ *
4
+ * Digital workers (Agents and Humans) communicate through Actions that integrate
5
+ * with the ai-workflows system. Worker actions (notify, ask, approve, decide)
6
+ * are durable workflow actions with Actor/Object semantics.
7
+ *
8
+ * ## Key Concepts
9
+ *
10
+ * - **Worker**: Common interface for Agent and Human
11
+ * - **Contacts**: How a worker can be reached (email, slack, phone, etc.)
12
+ * - **Action**: Durable workflow action (notify, ask, approve, decide)
13
+ * - **Team**: Group of workers with shared contacts
14
+ *
15
+ * @packageDocumentation
16
+ */
17
+ // ============================================================================
18
+ // Worker Verbs - Following ai-database Verb pattern
19
+ // ============================================================================
20
+ /**
21
+ * Worker verbs following the ai-database conjugation pattern
22
+ *
23
+ * Each verb has:
24
+ * - action: Base form (notify, ask, approve, decide)
25
+ * - actor: Who does it (notifier, asker, approver, decider)
26
+ * - activity: Gerund (notifying, asking, approving, deciding)
27
+ * - reverse: Past forms (notifiedAt, notifiedBy, askedAt, etc.)
28
+ */
29
+ export const WorkerVerbs = {
30
+ notify: {
31
+ action: 'notify',
32
+ actor: 'notifier',
33
+ act: 'notifies',
34
+ activity: 'notifying',
35
+ result: 'notification',
36
+ reverse: { at: 'notifiedAt', by: 'notifiedBy', via: 'notifiedVia' },
37
+ },
38
+ ask: {
39
+ action: 'ask',
40
+ actor: 'asker',
41
+ act: 'asks',
42
+ activity: 'asking',
43
+ result: 'question',
44
+ reverse: { at: 'askedAt', by: 'askedBy', via: 'askedVia' },
45
+ },
46
+ approve: {
47
+ action: 'approve',
48
+ actor: 'approver',
49
+ act: 'approves',
50
+ activity: 'approving',
51
+ result: 'approval',
52
+ reverse: { at: 'approvedAt', by: 'approvedBy', via: 'approvedVia' },
53
+ inverse: 'reject',
54
+ },
55
+ decide: {
56
+ action: 'decide',
57
+ actor: 'decider',
58
+ act: 'decides',
59
+ activity: 'deciding',
60
+ result: 'decision',
61
+ reverse: { at: 'decidedAt', by: 'decidedBy' },
62
+ },
63
+ do: {
64
+ action: 'do',
65
+ actor: 'doer',
66
+ act: 'does',
67
+ activity: 'doing',
68
+ result: 'task',
69
+ reverse: { at: 'doneAt', by: 'doneBy' },
70
+ },
71
+ };
72
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAkdH,+EAA+E;AAC/E,oDAAoD;AACpD,+EAA+E;AAE/E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MA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-workers",
3
- "version": "0.1.1",
4
- "description": "Enhanced autonomous digital workers with event loop, KPI tracking, and communication capabilities",
3
+ "version": "2.0.1",
4
+ "description": "Common abstract interface over AI Agents and Humans",
5
+ "type": "module",
5
6
  "main": "dist/index.js",
6
- "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
8
- "files": [
9
- "dist"
10
- ],
11
- "keywords": [
12
- "agent",
13
- "autonomous",
14
- "ai",
15
- "digital-worker",
16
- "kpi",
17
- "okr"
18
- ],
19
- "author": "Drivly",
20
- "license": "MIT",
21
- "repository": {
22
- "type": "git",
23
- "url": "https://github.com/drivly/primitives.org.ai.git",
24
- "directory": "packages/digital-workers"
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
25
13
  },
26
- "homepage": "https://mdx.org.ai",
27
- "bugs": {
28
- "url": "https://github.com/drivly/primitives.org.ai/issues"
14
+ "scripts": {
15
+ "build": "tsc",
16
+ "dev": "tsc --watch",
17
+ "test": "vitest",
18
+ "typecheck": "tsc --noEmit",
19
+ "lint": "eslint .",
20
+ "clean": "rm -rf dist"
29
21
  },
30
22
  "dependencies": {
31
- "node-cron": "^3.0.3",
32
- "autonomous-agents": "0.1.0"
33
- },
34
- "devDependencies": {
35
- "@types/node": "^22.15.3",
36
- "@types/node-cron": "^3.0.11",
37
- "@typescript-eslint/eslint-plugin": "^6.0.0",
38
- "@typescript-eslint/parser": "^6.0.0",
39
- "eslint": "^8.56.0",
40
- "prettier": "^3.2.5",
41
- "tsup": "^8.0.0",
42
- "typescript": "^5.0.0",
43
- "vitest": "^3.1.3"
23
+ "ai-functions": "workspace:*",
24
+ "ai-workflows": "workspace:*",
25
+ "rpc.do": "^0.1.0"
44
26
  },
45
- "engines": {
46
- "node": ">=18"
47
- },
48
- "tsup": {
49
- "entry": [
50
- "src/index.ts"
51
- ],
52
- "format": [
53
- "cjs",
54
- "esm"
55
- ],
56
- "dts": true,
57
- "splitting": false,
58
- "sourcemap": true,
59
- "clean": true
60
- },
61
- "scripts": {
62
- "build": "tsup",
63
- "dev": "tsup --watch",
64
- "lint": "eslint src/**/*.ts",
65
- "test": "vitest run",
66
- "test:watch": "vitest",
67
- "format": "prettier --write \"src/**/*.ts\" --semi false --single-quote true --jsx-single-quote true --print-width 160 --tab-width 2"
68
- }
69
- }
27
+ "keywords": [
28
+ "ai",
29
+ "agents",
30
+ "humans",
31
+ "workers",
32
+ "primitives"
33
+ ],
34
+ "license": "MIT"
35
+ }