agentframework

所属分类:代理服务器
开发工具:TypeScript
文件大小:0KB
下载次数:0
上传日期:2022-08-19 09:47:36
上 传 者sh-1993
说明:  一种优雅高效的TypeScript元编程API,用于构建软件代理
(An elegant & efficient TypeScript metaprogramming API to build software agents)

文件列表:
.adr-dir (27, 2022-07-13)
.editorconfig (242, 2022-07-13)
.nycrc (534, 2022-07-13)
.travis.yml (1163, 2022-07-13)
LICENSE (9143, 2022-07-13)
NOTICE (563, 2022-07-13)
doc/ (0, 2022-07-13)
doc/Brainstorm.md (315, 2022-07-13)
doc/architecture/ (0, 2022-07-13)
doc/architecture/decisions/ (0, 2022-07-13)
doc/architecture/decisions/0001-use-rollup-instead-of-webpack-to-generate-release-build.md (470, 2022-07-13)
doc/architecture/decisions/0002-use-es6-proxy-to-provide-transparent-interceptor-layer.md (498, 2022-07-13)
doc/architecture/decisions/0003-performance-decisions.md (595, 2022-07-13)
doc/architecture/decisions/0004-use-lazy-function-to-create-dynamic-agent-type.md (1083, 2022-07-13)
doc/architecture/decisions/0005-use-for-instead-of-callbacks-helpers.md (237, 2022-07-13)
doc/architecture/decisions/0006-use-property-field-to-get-interceptor-instead-of-use-method.md (877, 2022-07-13)
doc/architecture/decisions/0007-cancel-adr-0002-and-use-codegen-to-generate-interceptor.md (389, 2022-07-13)
doc/architecture/decisions/0008-minify-build.md (295, 2022-07-13)
doc/architecture/decisions/0009-class-field-inject.md (790, 2022-07-13)
doc/architecture/decisions/0010-use-agent-to-describe-an-instance-of-class.md (427, 2022-07-13)
doc/architecture/decisions/0011-re-implement-decorate-metadata-param-to-improve-performance.md (490, 2022-07-13)
doc/architecture/decisions/0012-use-tsmon-instead-of-ts-node.md (304, 2022-07-13)
doc/architecture/decisions/0013-interceptor-only-works-with-class-got-agent-decorator.md (746, 2022-07-13)
doc/architecture/decisions/0014-a-class-can-only-have-one-agent-decorator.md (374, 2022-07-13)
doc/backlogs/ (0, 2022-07-13)
doc/backlogs/TODO.md (794, 2022-07-13)
doc/changelogs/ (0, 2022-07-13)
doc/changelogs/CHANGELOG_0.2.x.md (146, 2022-07-13)
doc/changelogs/CHANGELOG_0.3.x.md (136, 2022-07-13)
doc/changelogs/CHANGELOG_0.4.x.md (119, 2022-07-13)
... ...

AgentFramework

An elegant & efficient TypeScript metaprogramming API to build software agents

gzip size

--- :lollipop: **Modernize:** 100% for TypeScript. Side-effect free tree shaking compatible with [ES2015](https://unpkg.com/agentframework/). :zap: **Fast:** Use CodeGen to minimize overheads. Faster than es6 Proxy. :dart: **Efficient:** Well-designed and crafted api only has **1300 SLOC** and **5.6kb** after minzipped. :recycle: **Clean:** Transparent dynamic proxy. No prototype pollution. No reflect-metadata or any npm dependencies. ## Supported Environment | Platform | Version | | -------------- | ----------------------------------------------------------------------------------- | | Node.js | 18, 16, 14, 12, 10, 8 | | TypeScript | 4.7, 4.6, 4.5, 4.4, 4.3, 4.2, 4.1, 4.0, 3.9, 3.8, 3.7, 3.6, 3.5, 3.4, 3.3, 3.2, 3.1, 3.0 | ## Changelog | Date | Version | Status | | ---------- | ------------------------------------------------------ | ----------- | | 2022-03-11 | [2.0.2](doc/changelogs/CHANGELOG_2.0.x.md) | Stable | | 2019-02-27 | [1.0.0](doc/changelogs/CHANGELOG_1.0.x.md) | Maintenance | | 2018-12-21 | [0.9.23](doc/changelogs/CHANGELOG_0.9.x.md) | EOL | | 2017-06-30 | [0.5.12](doc/changelogs/CHANGELOG_0.5.x.md) | EOL | | 2016-11-03 | [0.2.28](doc/changelogs/CHANGELOG_0.2.x.md) | EOL | ### Install ```bash npm i agentframework ``` ### Example code ```typescript import { agent, singleton } from 'agentframework'; class ComponentA { name = 'Agent Framework'; } @agent() class ProjectA { @singleton() private component!: ComponentA; constructor() { console.log(`WOW! You working on project ${this.component.name}!`); } } const project = new ProjectA(); console.log('Is it create from the ProjectA class?', project instanceof ProjectA); ``` ## Features - Add metadata to your code at design-time (using @decorator) or runtime (using Reflector api) - Access the metadata at runtime (using Reflector api) - AOP, dependence injection and dependence lookup ## Projects - [Hello World!](https://github.com/agentframework/hello-world) Your first AgentFramework project. ## Agent Oriented Programming ### Principle | PARADIGM | INSPIRATION | PRINCIPLE | | -------------------------- | ----------- | ----------------------------------------------------- | | Function Programming | Math | It transform data | | OOP | The world | It describe things and the relationships between them | | Agent Oriented Programming | Human | It actions like a human (AI) | ### Concepts | HUMAN | AGENT FRAMEWORK | DESCRIPTION | | ----------- | --------------- | ----------------------------------------------------------------------- | | People | Agent | A class decorate with @agent attribute | | Action | Behavior | Class method decorate with @action, @method or @behavior attribute | | Belief | Memory | Private class field decorated with @state, @remember, @memory attribute | | Environment | Domain | A container for agents, entities, services or artifacts | | Autonomy | Activation | Timer, scheduler which based on environment conditions | | Sociality | Message | Agent can communicate with other agent | | Mobility | Mobile Agent | An agent can move from domain to domain with their belief unchanged | ### When use Agent Framework - You want to build software agents. - You want to use dependence injection or dependence lookup. - You want to build a framework which similar to Spring Framework but in JavaScript. - You want to build an abstract layer for a specific business domain in your organization. - You want to remove duplicated code and keep project codebase small and clean. - You need a powerful method to pre-process, post-process or modify system behaviors without touching existing code. ### Agentframework 2.x milestones - [x] Breaking change: Remove `I` from interface name - [x] Breaking change: Remove `Intializer`. Use `Interceptor` instead - [x] MVP: Dependency injection/dependency lookup and `Domain` driven design support - [x] MVP: Improve unit test coverage rate - [x] COMPATIBILITY: Revise error types and message - [x] COMPATIBILITY: Revise Domain interface - [x] COMPATIBILITY: Revise embedded decorators - [ ] EPIC: Abstract data layer - mongodb 4.x - [ ] EPIC: Cross architecture web application development (Server, Serverless) - [ ] EPIC: Serverless support - AWS Lambda, Google Cloud Function, Azure Function, Alicloud Function Computing - [ ] EPIC: Bot development (Telegram) - [ ] Other: Example and references - [ ] Other: docs.agentframework.com - [ ] Other: agentframework.com ### Agentframework 1.x milestones - [x] MVP: Reflection can access type information generated by tsc. `tsc --emitDecoratorMetadata` - [x] MVP: Reflection support both ES6 and ES2017 (Reflect.metadata) - [x] MVP: Share metadata across different agentframework library of same application - [x] MVP: Both agent or normal class can be used for dependence injection - [x] MVP: Add IInitializer to init a field property - [x] MVP: Interceptor can work with Initializer during dependence injection - [x] EPIC: Create agent without domain - [x] EPIC: Provide access to intercepted property value in constructor - [x] PERFORMANCE: Metadata only attribute, attribute without interceptor - [x] PERFORMANCE: Pre-compile class member interceptors to improve method call performance - [x] PERFORMANCE: Caching class constructor interceptors to reduce future class instance creation time. - [x] PERFORMANCE: Remove interceptor for @agent attribute to improve performance - [x] PERFORMANCE: Do not add proxy if the agent don't have interceptor - [x] PERFORMANCE: Remove ES6 Proxy if don't have field interceptor - [x] COMPATIBILITY: Move @inject and @ready decorator out from core - [x] COMPATIBILITY: GetPrototypeOf should return origin prototype - [x] COMPATIBILITY: Agent should works in extended classes - [x] COMPATIBILITY: instanceOf should works when compile to proxy - [x] COMPATIBILITY: Revise IInvocation Interface - [x] COMPATIBILITY: Revise IInitializer Interface - [x] COMPATIBILITY: Revise IInterceptor Interface - [x] COMPATIBILITY: Revise IAttribute Interface - [x] COMPATIBILITY: Revise Reflection Interface - [x] COMPATIBILITY: Revise Reflector Interface - [x] COMPATIBILITY: Revise Agent Options - [x] COMPATIBILITY: Revise Domain Interface (Domain is been completely moved to 2.0) ## Special Thanks To: [](https://www.jetbrains.com) [JetBrains](https://www.jetbrains.com/), creators of the IntelliJ IDEA, supports AgentFramework with one of their [Open Source Licenses](https://www.jetbrains.com/opensource/). IntelliJ IDEA is the recommended IDE for working with AgentFramework. ## License Copyright 2022 Ling Zhang! Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

近期下载者

相关文件


收藏者