Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"homepage": "https://github.com/DigitalKin-ai/agentic-mesh-protocol#readme",
"dependencies": {
"@grpc/grpc-js": "^1.14.3",
"google-protobuf": "^4.0.1",
"google-protobuf": "^4.0.2",
"zod": "^4.3.6"
},
"peerDependencies": {
Expand All @@ -54,7 +54,7 @@
},
"devDependencies": {
"@buf/bufbuild_protovalidate.bufbuild_es": "^2.11.0-20251209175733-2a1774d88802.1",
"@bufbuild/buf": "1.65.0",
"@bufbuild/buf": "1.66.0",
"@bufbuild/protobuf": "^2.11.0",
"@bufbuild/protoplugin": "^2.11.0",
"@types/google-protobuf": "^3.15.12",
Expand Down
105 changes: 105 additions & 0 deletions proto/agentic_mesh_protocol/task_manager/v1/task_manager_dto.proto
Copy link
Copy Markdown

@Ekyoz Ekyoz Feb 25, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(buf.validate.field).required = true,
Il faut indiquer que c'est obligatoire pour les champs necessaires pour les request/response.

Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// Copyright 2025 DigitalKin Inc.
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.gnu.org/licenses/gpl-3.0.html
//
// 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.

syntax = "proto3";

package agentic_mesh_protocol.task_manager.v1;

import "agentic_mesh_protocol/task_manager/v1/task_manager_message.proto";
import "buf/validate/validate.proto";

// SendSignalsRequest
// Request to send signals to tasks (create, stop, etc.).
// The action field on each task determines the signal type.
//
// Fields:
// - tasks: List of tasks with their signal action.
message SendSignalsRequest {
// tasks is the list of tasks with their signal action.
repeated Task tasks = 1 [
(buf.validate.field).required = true,
(buf.validate.field).repeated.min_items = 1
];
}

// SendSignalsResponse
// Response after sending signals to tasks.
//
// Fields:
// - success: Whether the operation was successful.
// - tasks: Tasks with updated state after signal processing.
message SendSignalsResponse {
// success indicates whether the operation was successful.
bool success = 1 [(buf.validate.field).required = true];
// tasks is the list of tasks with updated state.
repeated Task tasks = 2 [(buf.validate.field).required = true];
}

// ListHeartbeatsRequest
// Request to list heartbeats for one or more tasks.
//
// Fields:
// - task_ids: List of task identifiers to get heartbeats for.
message ListHeartbeatsRequest {
// task_ids is the list of task identifiers to get heartbeats for.
repeated string task_ids = 1 [
(buf.validate.field).required = true,
(buf.validate.field).repeated.min_items = 1,
(buf.validate.field).repeated.items.cel = {
id: "task_id_length"
expression: "this.size() >= 1"
message: "task_id must be at least 1 characters long"
}
];
}

// ListHeartbeatsResponse
// Response containing tasks with their current state.
//
// Fields:
// - tasks: Tasks with their current status.
// - total_count: Total number of tasks available.
message ListHeartbeatsResponse {
// total_count is the total number of tasks available.
int32 total_count = 1 [
(buf.validate.field).required = true,
(buf.validate.field).int32.gte = 0
];
// tasks is the list of tasks with their current status.
repeated Task tasks = 2 [(buf.validate.field).required = true];
}

// GetSignalsRequest
// Request to retrieve pending signals for a task.
// Used by task executors to poll for signals.
//
// Fields:
// - task_id: Task to check for signals.
message GetSignalsRequest {
// bulk query for task_ids' signals.
repeated string task_ids = 1 [
(buf.validate.field).required = true,
(buf.validate.field).repeated.min_items = 1
];
}

// GetSignalsResponse
// Response containing tasks with pending signals.
//
// Fields:
// - tasks: Tasks with their pending signal state.
message GetSignalsResponse {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validation

// tasks is the list of tasks with pending signal state.
repeated Task tasks = 1 [(buf.validate.field).required = true];
}
115 changes: 115 additions & 0 deletions proto/agentic_mesh_protocol/task_manager/v1/task_manager_message.proto
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_messages au lieu de _message pour le nom du fichier

Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
// Copyright 2025 DigitalKin Inc.
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.gnu.org/licenses/gpl-3.0.html
//
// 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.

syntax = "proto3";

package agentic_mesh_protocol.task_manager.v1;

import "buf/validate/validate.proto";
import "google/protobuf/struct.proto";
import "google/protobuf/timestamp.proto";

// Task
// Represents a unit of work dispatched to a module.
// Includes full task state, signaling, and error info.
//
// Fields:
// - task_id: Unique identifier of the task.
// - mission_id: Mission this task belongs to.
// - setup_id: Setup configuration to use.
// - setup_version_id: Setup version to use.
// - status: Current lifecycle status.
// - action: Latest signal action type.
// - created_at: When the task was created.
// - heartbeat_at: When the task sent its last heartbeat.
// - payload: Optional structured payload.
message Task {
// task_id is the unique identifier of the task.
string task_id = 1 [
(buf.validate.field).required = true,
(buf.validate.field).cel = {
id: "task_id_length"
expression: "this.size() >= 1"
message: "task_id must be at least 1 characters long"
}
];
// mission_id is the mission this task belongs to.
string mission_id = 2 [
(buf.validate.field).required = true,
(buf.validate.field).cel = {
id: "mission_id_prefix"
expression: "this.startsWith('missions:')"
message: "mission_id must start with 'missions:'"
},
(buf.validate.field).cel = {
id: "mission_id_length"
expression: "this.size() >= 10"
message: "mission_id must be at least 1 characters long"
}
];
// setup_id is the setup configuration to use.
string setup_id = 3 [
(buf.validate.field).required = true,
(buf.validate.field).cel = {
id: "setup_id_prefix"
expression: "this.startsWith('setups:')"
message: "setup_id must start with 'setups:'"
},
(buf.validate.field).cel = {
id: "setup_id_length"
expression: "this.size() >= 8"
message: "setup_id must be at least 1 characters long"
}
];
// setup_version_id is the setup version to use.
string setup_version_id = 4 [
(buf.validate.field).required = true,
(buf.validate.field).cel = {
id: "setup_version_id_prefix"
expression: "this.startsWith('setup_versions:')"
message: "setup_version_id must start with 'setup_versions:'"
},
(buf.validate.field).cel = {
id: "setup_version_id_length"
expression: "this.size() >= 16"
message: "setup_version_id must be at least 1 characters long"
}
];
// action is the latest signal action type.
string action = 5 [
(buf.validate.field).required = true,
(buf.validate.field).cel = {
id: "action_length"
expression: "this.size() >= 1"
message: "action must be at least 1 characters long"
}
];
// cancellation_reason is the reason for cancellation.
string cancellation_reason = 6 [
(buf.validate.field).required = true,
(buf.validate.field).cel = {
id: "cancellation_reason_length"
expression: "this.size() >= 1"
message: "action must be at least 1 characters long"
}
];
// created_at is when the task was created.
google.protobuf.Timestamp created_at = 7 [
(buf.validate.field).required = true
];
// heartbeat_at is when the task last sent a heartbeat.
optional google.protobuf.Timestamp heartbeat_at = 8;
// payload is an optional structured payload.
optional google.protobuf.Struct payload = 9;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright 2025 DigitalKin Inc.
//
// Licensed under the GNU General Public License, Version 3.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.gnu.org/licenses/gpl-3.0.html
//
// 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.

syntax = "proto3";

package agentic_mesh_protocol.task_manager.v1;

import "agentic_mesh_protocol/task_manager/v1/task_manager_dto.proto";

// TaskManagerService provides task orchestration
// and monitoring for the agentic mesh.
service TaskManagerService {
// SendSignals sends signals to tasks (create, stop, etc.).
rpc SendSignals(SendSignalsRequest)
returns (SendSignalsResponse);

// ListHeartbeats retrieves heartbeats for a task.
rpc ListHeartbeats(ListHeartbeatsRequest)
returns (ListHeartbeatsResponse);

// GetSignals retrieves pending signals for a task.
rpc GetSignals(GetSignalsRequest)
returns (GetSignalsResponse);
}
4 changes: 2 additions & 2 deletions proto/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
version: v2
deps:
- name: buf.build/bufbuild/protovalidate
commit: 2a1774d888024a9b93ce7eb4b59f6a83
digest: b5:6b7f9bc919b65e5b79d7b726ffc03d6f815a412d6b792970fa6f065cae162107bd0a9d47272c8ab1a2c9514e87b13d3fbf71df614374d62d2183afb64be2d30a
commit: 80ab13bee0bf4272b6161a72bf7034e0
digest: b5:1aa6a965be5d02d64e1d81954fa2e78ef9d1e33a0c30f92bc2626039006a94deb3a5b05f14ed8893f5c3ffce444ac008f7e968188ad225c4c29c813aa5f2daa1
2 changes: 1 addition & 1 deletion tools/zod/src/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
isFieldOptional,
type TypeMapperContext,
} from "./type-mapper.js";
import { getValidationChain, isFieldRequired } from "./validation-mapper.js";
import { getValidationChain, isFieldRequired } from "./validation/index.js";
import { toCamelCase, toSchemaName, getRelativeImportPath, toScreamingSnakeCase, stripEnumPrefix } from "./utils.js";

export interface PluginOptions {
Expand Down
Loading