2.0.2 • Published 2 years ago

agentframework v2.0.2

Weekly downloads
86
License
Apache-2.0
Repository
github
Last release
2 years ago

:lollipop: Modernize: 100% for TypeScript. Side-effect free tree shaking compatible with ES2015.

: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

PlatformVersion
Node.js17, 16, 15, 14, 12, 10, 8
TypeScript4.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

DateVersionStatus
2022-03-112.0.2Stable
2019-02-271.0.0Maintenance
2018-12-210.9.23EOL
2017-06-300.5.12EOL
2016-11-030.2.28EOL

Install

npm i agentframework

Example code

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

Agent Oriented Programming

Principle

PARADIGMINSPIRATIONPRINCIPLE
Function ProgrammingMathIt transform data
OOPThe worldIt describe things and the relationships between them
Agent Oriented ProgrammingHumanIt actions like a human (AI)

Concepts

HUMANAGENT FRAMEWORKDESCRIPTION
PeopleAgentA class decorate with @agent attribute
ActionBehaviorClass method decorate with @action, @method or @behavior attribute
BeliefMemoryPrivate class field decorated with @state, @remember, @memory attribute
EnvironmentDomainA container for agents, entities, services or artifacts
AutonomyActivationTimer, scheduler which based on environment conditions
SocialityMessageAgent can communicate with other agent
MobilityMobile AgentAn 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

  • Breaking change: Remove I from interface name
  • Breaking change: Remove Intializer. Use Interceptor instead
  • MVP: Dependency injection/dependency lookup and Domain driven design support
  • MVP: Improve unit test coverage rate
  • COMPATIBILITY: Revise error types and message
  • COMPATIBILITY: Revise Domain interface
  • 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

  • MVP: Reflection can access type information generated by tsc. tsc --emitDecoratorMetadata
  • MVP: Reflection support both ES6 and ES2017 (Reflect.metadata)
  • MVP: Share metadata across different agentframework library of same application
  • MVP: Both agent or normal class can be used for dependence injection
  • MVP: Add IInitializer to init a field property
  • MVP: Interceptor can work with Initializer during dependence injection
  • EPIC: Create agent without domain
  • EPIC: Provide access to intercepted property value in constructor
  • PERFORMANCE: Metadata only attribute, attribute without interceptor
  • PERFORMANCE: Pre-compile class member interceptors to improve method call performance
  • PERFORMANCE: Caching class constructor interceptors to reduce future class instance creation time.
  • PERFORMANCE: Remove interceptor for @agent attribute to improve performance
  • PERFORMANCE: Do not add proxy if the agent don't have interceptor
  • PERFORMANCE: Remove ES6 Proxy if don't have field interceptor
  • COMPATIBILITY: Move @inject and @ready decorator out from core
  • COMPATIBILITY: GetPrototypeOf should return origin prototype
  • COMPATIBILITY: Agent should works in extended classes
  • COMPATIBILITY: instanceOf should works when compile to proxy
  • COMPATIBILITY: Revise IInvocation Interface
  • COMPATIBILITY: Revise IInitializer Interface
  • COMPATIBILITY: Revise IInterceptor Interface
  • COMPATIBILITY: Revise IAttribute Interface
  • COMPATIBILITY: Revise Reflection Interface
  • COMPATIBILITY: Revise Reflector Interface
  • COMPATIBILITY: Revise Agent Options
  • COMPATIBILITY: Revise Domain Interface (Domain is been completely moved to 2.0)

Special Thanks To:

JetBrains, creators of the IntelliJ IDEA, supports AgentFramework with one of their Open Source Licenses. 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.

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

2.0.0-rc.20

3 years ago

2.0.0-rc.19

3 years ago

2.0.0-rc.18

3 years ago

2.0.0-rc.17

3 years ago

2.0.0-rc.16

3 years ago

2.0.0-rc.15

3 years ago

2.0.0-rc.13

3 years ago

2.0.0-rc.12

3 years ago

2.0.0-rc.11

3 years ago

2.0.0-rc.10

3 years ago

2.0.0-rc.9

3 years ago

2.0.0-rc.8

3 years ago

2.0.0-rc.7

3 years ago

2.0.0-rc.6

3 years ago

2.0.0-rc.5

3 years ago

2.0.0-rc.4

4 years ago

2.0.0-rc.3

4 years ago

2.0.0-rc.2

4 years ago

2.0.0-rc.1

4 years ago

1.0.0

5 years ago

1.0.0-rc.24

5 years ago

1.0.0-rc.23

5 years ago

1.0.0-rc.22

5 years ago

1.0.0-rc.21

5 years ago

1.0.0-rc.20

5 years ago

1.0.0-rc.19

5 years ago

1.0.0-rc.18

5 years ago

1.0.0-rc.17

5 years ago

1.0.0-rc.16

5 years ago

1.0.0-rc.15

5 years ago

1.0.0-rc.14

5 years ago

1.0.0-rc.13

5 years ago

1.0.0-rc.12

5 years ago

1.0.0-rc.11

5 years ago

1.0.0-rc.10

5 years ago

1.0.0-rc.9

5 years ago

1.0.0-rc.8

5 years ago

1.0.0-rc.7

5 years ago

1.0.0-rc.6

5 years ago

1.0.0-rc.5

5 years ago

1.0.0-rc.4

5 years ago

1.0.0-rc.3

5 years ago

1.0.0-rc.2

5 years ago

1.0.0-rc.1

5 years ago

1.0.0-rc.0

5 years ago

0.9.22

5 years ago

0.9.21

5 years ago

0.9.20

5 years ago

0.9.19

5 years ago

0.9.18

6 years ago

0.9.17

6 years ago

0.9.16

6 years ago

0.9.15

6 years ago

0.9.14

6 years ago

0.9.13

6 years ago

0.9.12

6 years ago

0.9.11

6 years ago

0.9.10

6 years ago

0.9.9

6 years ago

0.9.8

6 years ago

0.9.7

6 years ago

0.9.6

6 years ago

0.9.5

6 years ago

0.9.4

6 years ago

0.9.3

6 years ago

0.9.2

6 years ago

0.9.1

6 years ago

0.9.0

6 years ago

0.5.12

7 years ago

0.5.10

7 years ago

0.5.8

7 years ago

0.5.7

7 years ago

0.5.6

7 years ago

0.5.5

7 years ago

0.5.4

7 years ago

0.5.3

7 years ago

0.5.2

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.4

7 years ago

0.4.2

7 years ago

0.4.0

7 years ago

0.3.12

7 years ago

0.3.10

7 years ago

0.3.8

7 years ago

0.3.7

7 years ago

0.3.6

7 years ago

0.3.4

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.28

8 years ago

0.2.26

8 years ago

0.2.24

8 years ago

0.2.22

8 years ago

0.2.20

8 years ago

0.2.18

8 years ago

0.2.16

8 years ago

0.2.13

8 years ago

0.2.12

8 years ago

0.2.11

8 years ago

0.2.10

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago