@crewai-ts/core 0.1.0 → 0.1.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 (3) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +173 -67
  3. package/package.json +2 -2
package/LICENSE CHANGED
@@ -1,5 +1,12 @@
1
1
  MIT License
2
2
 
3
+ This project is an unofficial TypeScript port of CrewAI
4
+ (https://github.com/crewAIInc/crewAI), which is distributed under the MIT
5
+ License. As required by that license, the original copyright and permission
6
+ notice are retained below. This project is not affiliated with, endorsed by,
7
+ or maintained by crewAI, Inc.
8
+
9
+ Copyright (c) 2025 crewAI, Inc.
3
10
  Copyright (c) 2026 June
4
11
 
5
12
  Permission is hereby granted, free of charge, to any person obtaining a copy
package/README.md CHANGED
@@ -1,70 +1,51 @@
1
- # crewai-ts
1
+ # @crewai-ts/core
2
2
 
3
- TypeScript port of CrewAI.
3
+ [![npm version](https://img.shields.io/npm/v/@crewai-ts/core.svg)](https://www.npmjs.com/package/@crewai-ts/core)
4
+ [![license](https://img.shields.io/npm/l/@crewai-ts/core.svg)](./LICENSE)
5
+ [![types](https://img.shields.io/npm/types/@crewai-ts/core.svg)](https://www.npmjs.com/package/@crewai-ts/core)
4
6
 
5
- ## Current port surface
7
+ An **unofficial** TypeScript port of [CrewAI](https://github.com/crewAIInc/crewAI) — build
8
+ multi-agent workflows with agents, tasks, crews, and flows using a native TypeScript API.
6
9
 
7
- - `Agent`, `Task`, `ConditionalTask`, `Crew`
8
- - `LiteAgent` and `LiteAgentOutput` compatibility layer for direct agent execution
9
- - `Flow` with standard TS `@start`, `@listen`, `@router`, `or_`, `and_`, `ask()` input providers, and `@humanFeedback`
10
- - sequential `Crew.kickoff({ inputs })`
11
- - `TaskOutput` and `CrewOutput`
12
- - standard TS decorators: `@agent`, `@task`, `@crew`, `@beforeKickoff`, `@afterKickoff`, `@outputJson`, `@outputPydantic`, `@start`, `@listen`, `@router`
13
- - `CrewProject` YAML/object config loading for `agentsConfig` and `tasksConfig`
14
- - `BaseTool` / `StructuredTool` with argument validation, usage limits, tool-call execution, and task-level tool overrides
15
- - automatic `read_file` tool for named task, crew, and agent input files
16
- - tool result caching with `cacheFunction` and shareable `InMemoryToolCache`
17
- - crew `cache: false` control for disabling library tool result caching
18
- - sequential process async task scheduling, including sync barriers and CrewAI-style async validation
19
- - typed `crewaiEventBus` lifecycle events for crew kickoff, task execution, tool usage, and failures
20
- - agent and crew `stepCallback` hooks for tool/final agent steps
21
- - crew-level `taskCallback` hooks after task callbacks, with duplicate callback suppression
22
- - global before/after LLM and tool call hooks
23
- - security `Fingerprint` / `SecurityConfig` on agents, crews, and tasks
24
- - checkpoint `CheckpointConfig`, filesystem `JsonProvider`, and SQLite `SqliteProvider`
25
- - state `EventRecord` / `EventNode` graph for event relationship tracking
26
- - state `RuntimeState` checkpoint serialization, restore, lineage, and fork helpers
27
- - crew `outputLogFile` task execution logs in text or JSON files
28
- - crew `executionLogs` and `taskExecutionOutputJsonFiles` for per-task audit records
29
- - crew `replay(taskRef, inputs?)` from a task id, name, index, or task object
30
- - `Memory` / `MemoryScope` with recall/save tools injected into crews when memory is enabled
31
- - `Knowledge` sources (`StringKnowledgeSource`, `TextFileKnowledgeSource`, `JSONKnowledgeSource`, `CSVKnowledgeSource`) with agent and crew context injection
32
- - hierarchical process with manager agent/manager LLM validation and coworker delegation tools
33
- - sequential `allowDelegation` agents with coworker delegate/question tools
34
- - function or object LLM providers with tool-call options, string model registry, and token usage aggregation
35
- - iterative agent tool-use loop with `maxIter` and `resultAsAnswer` support
36
- - agent `maxRetryLimit` retries around task execution failures
37
- - agent `maxExecutionTime` timeout enforcement for task execution
38
- - agent `useSystemPrompt` control for models that do not accept system-role messages
39
- - deprecated CrewAI agent compatibility fields: `allowCodeExecution`, `codeExecutionMode`, `respectContextWindow`, `multimodal`
40
- - agent `systemTemplate`, `promptTemplate`, and `responseTemplate` prompt rendering
41
- - agent `injectDate` / `dateFormat` prompt injection
42
- - callable agent `guardrail` with retry-limit enforcement
43
- - agent-level `PlanningConfig`, `planning`, and legacy `reasoning` compatibility
44
- - agent and crew `maxRpm` throttling for LLM calls
45
- - `kickoffForEach` / `kickoffForEachAsync` batch execution with aggregate usage metrics
46
- - crew-level planning that injects per-task execution plans before kickoff
47
- - CrewAI-style default task context aggregation from previous task outputs
48
- - task `outputFile` writing with input interpolation and safe path validation
49
- - task `inputFiles` / `input_files` text file prompt injection
50
- - task `outputConverter` / `converter_cls` hooks for structured output conversion
51
- - structured task interpolation for strings, numbers, booleans, arrays, objects, and `null`
52
- - single or ordered multiple task `guardrails` with retry support
53
- - task `humanInput` feedback loops with injectable providers
54
- - task execution counters: `usedTools`, `toolsErrors`, `delegations`, `promptContext`, `processedByAgents`
55
- - task `allowCrewaiTriggerContext` support for `crewai_trigger_payload` kickoff inputs
56
- - `ConditionalTask` skip logic based on the previous task output
57
- - basic `stream: true` crew and flow outputs via `CrewStreamingOutput` / `FlowStreamingOutput`
10
+ The package mirrors CrewAI's runtime semantics (sequential and hierarchical processes,
11
+ delegation, planning, memory, knowledge, checkpoints, and streaming) while staying
12
+ idiomatic to TypeScript. It ships both **ESM and CommonJS** builds with full type
13
+ declarations, and provides Python-style snake_case aliases for common async entry points
14
+ to ease migration from the Python library.
15
+
16
+ > **Unofficial project.** This is a community port and is **not affiliated with, endorsed
17
+ > by, or maintained by crewAI, Inc.** "CrewAI" belongs to its respective owner. The original
18
+ > CrewAI is MIT-licensed (Copyright © crewAI, Inc.); this port retains that notice — see
19
+ > [License](#license).
20
+
21
+ ## Installation
22
+
23
+ ```bash
24
+ npm install @crewai-ts/core
25
+ ```
58
26
 
59
- Decorators store only library-private metadata. They do not use
60
- `reflect-metadata`, parameter decorators, or Nest metadata, so Nest applications
61
- should consume this package as a normal TypeScript library and keep Nest DI
62
- separate.
27
+ ```bash
28
+ pnpm add @crewai-ts/core
29
+ # or
30
+ yarn add @crewai-ts/core
31
+ ```
32
+
33
+ ## Requirements
34
+
35
+ - **Node.js >= 22** (the build targets `node22` and uses `node:sqlite` for the SQLite checkpoint provider)
36
+ - Works in both ESM (`import`) and CommonJS (`require`) projects — types are resolved per module system.
37
+
38
+ ```ts
39
+ // ESM
40
+ import { Agent, Crew, Task } from "@crewai-ts/core";
41
+ ```
42
+
43
+ ```js
44
+ // CommonJS
45
+ const { Agent, Crew, Task } = require("@crewai-ts/core");
46
+ ```
63
47
 
64
- CrewAI Python-style snake_case aliases are available for common async entry
65
- points, including `kickoff_async`, `kickoff_for_each`,
66
- `kickoff_for_each_async`, `akickoff_for_each`, `resume_async`, `from_pending`,
67
- and `from_state`.
48
+ ## Quick start
68
49
 
69
50
  ```ts
70
51
  import { Agent, Crew, Process, Task, agent, crew, task } from "@crewai-ts/core";
@@ -104,6 +85,117 @@ const batchResults = await new ResearchCrew().crew().kickoffForEach({
104
85
  });
105
86
  ```
106
87
 
88
+ > Decorators store only library-private metadata. They do not use `reflect-metadata`,
89
+ > parameter decorators, or Nest metadata, so Nest applications should consume this package
90
+ > as a normal TypeScript library and keep Nest DI separate.
91
+
92
+ CrewAI Python-style snake_case aliases are available for common async entry points,
93
+ including `kickoff_async`, `kickoff_for_each`, `kickoff_for_each_async`,
94
+ `akickoff_for_each`, `resume_async`, `from_pending`, and `from_state`.
95
+
96
+ ## Table of contents
97
+
98
+ - [Features](#features)
99
+ - [Streaming](#streaming)
100
+ - [LiteAgent](#liteagent)
101
+ - [Hooks](#hooks)
102
+ - [Security](#security)
103
+ - [Checkpoints](#checkpoints)
104
+ - [Tools](#tools)
105
+ - [LLM providers](#llm-providers)
106
+ - [Agent planning](#agent-planning)
107
+ - [Flows](#flows)
108
+ - [Task output files](#task-output-files)
109
+ - [Task input files](#task-input-files)
110
+ - [Conditional tasks](#conditional-tasks)
111
+ - [Human input](#human-input)
112
+ - [Crew planning](#crew-planning)
113
+ - [Memory](#memory)
114
+ - [Knowledge](#knowledge)
115
+ - [YAML-backed project config](#yaml-backed-project-config)
116
+ - [Development](#development)
117
+ - [License](#license)
118
+
119
+ ## Features
120
+
121
+ **Agents, tasks, and crews**
122
+
123
+ - `Agent`, `Task`, `ConditionalTask`, `Crew`, `TaskOutput`, and `CrewOutput`
124
+ - `LiteAgent` and `LiteAgentOutput` compatibility layer for direct agent execution
125
+ - sequential `Crew.kickoff({ inputs })` and sequential process async task scheduling, including sync barriers and CrewAI-style async validation
126
+ - hierarchical process with manager agent / manager LLM validation and coworker delegation tools
127
+ - sequential `allowDelegation` agents with coworker delegate / question tools
128
+ - `kickoffForEach` / `kickoffForEachAsync` batch execution with aggregate usage metrics
129
+ - crew `replay(taskRef, inputs?)` from a task id, name, index, or task object
130
+ - crew-level planning that injects per-task execution plans before kickoff
131
+ - CrewAI-style default task context aggregation from previous task outputs
132
+
133
+ **Decorators and project config**
134
+
135
+ - standard TS decorators: `@agent`, `@task`, `@crew`, `@beforeKickoff`, `@afterKickoff`, `@outputJson`, `@outputPydantic`, `@start`, `@listen`, `@router`
136
+ - `CrewProject` YAML / object config loading for `agentsConfig` and `tasksConfig`
137
+
138
+ **Agent execution controls**
139
+
140
+ - iterative agent tool-use loop with `maxIter` and `resultAsAnswer` support
141
+ - agent `maxRetryLimit` retries around task execution failures
142
+ - agent `maxExecutionTime` timeout enforcement for task execution
143
+ - agent and crew `maxRpm` throttling for LLM calls
144
+ - agent `useSystemPrompt` control for models that do not accept system-role messages
145
+ - agent `systemTemplate`, `promptTemplate`, and `responseTemplate` prompt rendering
146
+ - agent `injectDate` / `dateFormat` prompt injection
147
+ - callable agent `guardrail` with retry-limit enforcement
148
+ - agent-level `PlanningConfig`, `planning`, and legacy `reasoning` compatibility
149
+ - deprecated CrewAI agent compatibility fields: `allowCodeExecution`, `codeExecutionMode`, `respectContextWindow`, `multimodal`
150
+
151
+ **Tasks**
152
+
153
+ - task `outputFile` writing with input interpolation and safe path validation
154
+ - task `inputFiles` / `input_files` text file prompt injection, plus an automatic `read_file` tool for named task, crew, and agent input files
155
+ - task `outputConverter` / `converter_cls` hooks for structured output conversion
156
+ - structured task interpolation for strings, numbers, booleans, arrays, objects, and `null`
157
+ - single or ordered multiple task `guardrails` with retry support
158
+ - task `humanInput` feedback loops with injectable providers
159
+ - task execution counters: `usedTools`, `toolsErrors`, `delegations`, `promptContext`, `processedByAgents`
160
+ - task `allowCrewaiTriggerContext` support for `crewai_trigger_payload` kickoff inputs
161
+ - `ConditionalTask` skip logic based on the previous task output
162
+
163
+ **Tools**
164
+
165
+ - `BaseTool` / `StructuredTool` with argument validation, usage limits, tool-call execution, and task-level tool overrides
166
+ - tool result caching with `cacheFunction` and shareable `InMemoryToolCache`
167
+ - crew `cache: false` control for disabling library tool result caching
168
+
169
+ **LLM providers**
170
+
171
+ - function or object LLM providers with tool-call options, string model registry, and token usage aggregation
172
+
173
+ **Flows**
174
+
175
+ - `Flow` with standard TS `@start`, `@listen`, `@router`, `or_`, `and_`, `ask()` input providers, and `@humanFeedback`
176
+ - basic `stream: true` crew and flow outputs via `CrewStreamingOutput` / `FlowStreamingOutput`
177
+
178
+ **Events and hooks**
179
+
180
+ - typed `crewaiEventBus` lifecycle events for crew kickoff, task execution, tool usage, and failures
181
+ - agent and crew `stepCallback` hooks for tool / final agent steps
182
+ - crew-level `taskCallback` hooks after task callbacks, with duplicate callback suppression
183
+ - global before / after LLM and tool call hooks
184
+
185
+ **Memory and knowledge**
186
+
187
+ - `Memory` / `MemoryScope` with recall / save tools injected into crews when memory is enabled
188
+ - `Knowledge` sources (`StringKnowledgeSource`, `TextFileKnowledgeSource`, `JSONKnowledgeSource`, `CSVKnowledgeSource`) with agent and crew context injection
189
+
190
+ **State, security, and checkpoints**
191
+
192
+ - security `Fingerprint` / `SecurityConfig` on agents, crews, and tasks
193
+ - checkpoint `CheckpointConfig`, filesystem `JsonProvider`, and SQLite `SqliteProvider`
194
+ - state `EventRecord` / `EventNode` graph for event relationship tracking
195
+ - state `RuntimeState` checkpoint serialization, restore, lineage, and fork helpers
196
+ - crew `outputLogFile` task execution logs in text or JSON files
197
+ - crew `executionLogs` and `taskExecutionOutputJsonFiles` for per-task audit records
198
+
107
199
  ## Streaming
108
200
 
109
201
  Set `stream: true` on a crew or flow to receive a streaming output wrapper from
@@ -684,9 +776,23 @@ class ResearchCrew extends CrewProject {
684
776
  }
685
777
  ```
686
778
 
687
- ## Scripts
779
+ ## Development
780
+
781
+ This repo is built with [tsup](https://tsup.egoist.dev/) (ESM + CJS + type declarations)
782
+ and tested with [Vitest](https://vitest.dev/).
783
+
784
+ ```bash
785
+ npm run build # build ESM + CJS output and declarations
786
+ npm run check # type-check in no-emit mode
787
+ npm test # run the Vitest suite
788
+ npm run lint # run ESLint
789
+ ```
790
+
791
+ ## License
792
+
793
+ [MIT](./LICENSE) © June
688
794
 
689
- - `npm run build` builds ESM output and declarations.
690
- - `npm run check` runs TypeScript in no-emit mode.
691
- - `npm test` runs Vitest.
692
- - `npm run lint` runs ESLint.
795
+ This project is an unofficial TypeScript port of [CrewAI](https://github.com/crewAIInc/crewAI)
796
+ (Copyright © crewAI, Inc.), which is distributed under the MIT License. It is not affiliated
797
+ with or endorsed by crewAI, Inc. As required by the MIT License, the original copyright and
798
+ permission notice are retained in [LICENSE](./LICENSE).
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@crewai-ts/core",
3
- "version": "0.1.0",
4
- "description": "TypeScript port of CrewAI.",
3
+ "version": "0.1.1",
4
+ "description": "Unofficial TypeScript port of CrewAI (not affiliated with crewAI, Inc.).",
5
5
  "keywords": [
6
6
  "crewai",
7
7
  "agents",